decocms 3.35.1 → 3.35.3

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 (237) hide show
  1. package/dist/client/assets/{AlertCircle-asB0zjf2.js → AlertCircle-DjOU_aot.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-DRnt_VKh.js → ArrowUpRight-BXJMGk9i.js} +1 -1
  3. package/dist/client/assets/{Check-CNRVH6xs.js → Check-D7HZW6oZ.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-B7v5_MG4.js → CheckCircle-XS4dmEOs.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BKkz3Gyp.js → ChevronDown-CxTVikeq.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-DkMFugke.js → ChevronLeft-BEmN2X52.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-DixPnH3V.js → ChevronRight-3jD7TdJZ.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-BeDEmrn1.js → ChevronUp-Dbc77Gwp.js} +1 -1
  9. package/dist/client/assets/{Container-C41D-bwR.js → Container-Hfp9SJFa.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-DimB1qZR.js → DotsVertical-Cz5MZln-.js} +1 -1
  11. package/dist/client/assets/{Eye-CFpoJQMe.js → Eye-BIZqMr-y.js} +1 -1
  12. package/dist/client/assets/{FilterLines-htpqKUqo.js → FilterLines-iroXgkwP.js} +1 -1
  13. package/dist/client/assets/{Globe01-CxF-Z8O2.js → Globe01-CiCGKTg3.js} +1 -1
  14. package/dist/client/assets/{HardDrive-TXw7C9gB.js → HardDrive-B26C8dI3.js} +1 -1
  15. package/dist/client/assets/{Key01-CDAkGspz.js → Key01-DZeJDklU.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-BG08KNqc.js → LayoutLeft-CY1OP6dH.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-AylVRyuU.js → LinkExternal01-DwxMIV-o.js} +1 -1
  18. package/dist/client/assets/{Monitor01-gdKmZQTW.js → Monitor01-_FIjo4ge.js} +1 -1
  19. package/dist/client/assets/{Palette-D9_6t0uI.js → Palette-BDd6wxPD.js} +1 -1
  20. package/dist/client/assets/{Play-aa6uUei5.js → Play-C933mY5z.js} +1 -1
  21. package/dist/client/assets/{Plus-DcxLSicT.js → Plus-aXWGGcSy.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-Dd5D2uNm.js → RefreshCcw01-DS1vtLKW.js} +1 -1
  23. package/dist/client/assets/{SearchMd-2GibIebB.js → SearchMd-Cr6CluRw.js} +1 -1
  24. package/dist/client/assets/{Settings02-D0kdZjJD.js → Settings02-DeH66RiM.js} +1 -1
  25. package/dist/client/assets/{Shield01-CpxvRW7h.js → Shield01-0kTDalL_.js} +1 -1
  26. package/dist/client/assets/{Star01-BVQUiqS1.js → Star01-pwvCfpNJ.js} +1 -1
  27. package/dist/client/assets/{Stars01-B2PA7s4d.js → Stars01-Bw7_Rdwp.js} +1 -1
  28. package/dist/client/assets/{Stars02-BFz8RQ16.js → Stars02-vcxNwhIa.js} +1 -1
  29. package/dist/client/assets/{Sun-DMcKqqHE.js → Sun-De2vWRC7.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-qUOmQUUG.js → SwitchHorizontal01-Blia-yUi.js} +1 -1
  31. package/dist/client/assets/{Tool01-DNz0OMpT.js → Tool01-DC4THSlP.js} +1 -1
  32. package/dist/client/assets/{Trash01-rpak8qu1.js → Trash01-DBSukaq0.js} +1 -1
  33. package/dist/client/assets/{Upload01-d_Wyw7QT.js → Upload01-DruP7_KV.js} +1 -1
  34. package/dist/client/assets/{User01-BWllfXHj.js → User01-Bweqikx-.js} +1 -1
  35. package/dist/client/assets/{Users01-DG6YdAo1.js → Users01-N436STOJ.js} +1 -1
  36. package/dist/client/assets/{Users03-B9AqN8LK.js → Users03-DiilXFZ6.js} +1 -1
  37. package/dist/client/assets/{X-DxE022Fo.js → X-B1W1F4mo.js} +1 -1
  38. package/dist/client/assets/{XCircle-B_UH_gQt.js → XCircle-BtUzMyFW.js} +1 -1
  39. package/dist/client/assets/{XClose-DOt_DYPz.js → XClose-r0gXvFlp.js} +1 -1
  40. package/dist/client/assets/{Zap-CyMJw7DY.js → Zap-Dvtyg5Ik.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-Dz4Qok6x.js → ZapSquare-BQX2HOTP.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-BkCtUzuC.js → ZoomOut-DC46Ewts.js} +1 -1
  43. package/dist/client/assets/{access-gate-u6bqRJWi.js → access-gate-CVMVVI4n.js} +1 -1
  44. package/dist/client/assets/{accordion-B7oL0ZOw.js → accordion-DBJsIIHl.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-DI1aX1UO.js → add-section-modal-v1Vhtks6.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-BxQUOIVO.js → agent-capabilities-n5Q1YbJ5.js} +1 -1
  47. package/dist/client/assets/{agent-icon-BrUPk7cd.js → agent-icon-CCGqC-bl.js} +1 -1
  48. package/dist/client/assets/{agent-icons-oFY-K2bC.js → agent-icons-CDVkEkIq.js} +2 -2
  49. package/dist/client/assets/{agents-list-BOxJitnX.js → agents-list-DDPJUJaX.js} +1 -1
  50. package/dist/client/assets/{ai-providers-DjvmZlJ5.js → ai-providers-48DFDYIz.js} +1 -1
  51. package/dist/client/assets/{alert-8WGQf_5q.js → alert-ZcglsRSH.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-DUUnhBc6.js → alert-dialog-B2k_N3ZX.js} +1 -1
  53. package/dist/client/assets/app-editor-DmCxU5-w.js +1 -0
  54. package/dist/client/assets/{auth-DTxUlSLU.js → auth-ClbRbdVv.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-_asaISim.js → auth-catchall-BQd5LNUx.js} +1 -1
  56. package/dist/client/assets/{auth-split-layout-DU0bpIBM.js → auth-split-layout-jRGUFWwU.js} +1 -1
  57. package/dist/client/assets/{automation-list-row-atv_xAlK.js → automation-list-row-CXD-x28t.js} +1 -1
  58. package/dist/client/assets/{automation-runs-8yvWAbAC.js → automation-runs-BIJek_K_.js} +1 -1
  59. package/dist/client/assets/{automations-B1IxT7Wc.js → automations-D53YpHbQ.js} +1 -1
  60. package/dist/client/assets/{avatar-BqYC23h9.js → avatar-BG2RlqaT.js} +1 -1
  61. package/dist/client/assets/{badge-CGZjMX2o.js → badge-DIN7Nq6a.js} +1 -1
  62. package/dist/client/assets/{brand-context-Dki54pAn.js → brand-context--o_ht-A-.js} +1 -1
  63. package/dist/client/assets/{buckets-BgnqByrS.js → buckets-DD6OfmjS.js} +1 -1
  64. package/dist/client/assets/{calendar-CaIJu6mx.js → calendar-RJSiIOON.js} +1 -1
  65. package/dist/client/assets/{capability-load-error-DWbE5k9a.js → capability-load-error-BfCjxOlU.js} +1 -1
  66. package/dist/client/assets/{card-BlzflWCA.js → card-ykuj7mlf.js} +1 -1
  67. package/dist/client/assets/{chat-context-BUN4BStS.js → chat-context-CEWm5eLB.js} +1 -1
  68. package/dist/client/assets/{checkbox-C1s8UE6Y.js → checkbox-BKpSRHdU.js} +1 -1
  69. package/dist/client/assets/{cli-auth-success-DOMHymP7.js → cli-auth-success-qAM068ao.js} +1 -1
  70. package/dist/client/assets/{collection-detail-Fe7fYzy1.js → collection-detail-BaAVQGsi.js} +1 -1
  71. package/dist/client/assets/{collection-display-button-CTi0VUGU.js → collection-display-button-ve31YRQs.js} +1 -1
  72. package/dist/client/assets/{collection-search-CJ5Ov7mh.js → collection-search-C5MSFdhR.js} +1 -1
  73. package/dist/client/assets/{collection-table-wrapper-BMZaf4HK.js → collection-table-wrapper-Wi0b7UJz.js} +1 -1
  74. package/dist/client/assets/{collection-tabs-zuvlZo6K.js → collection-tabs-CAVXo49Z.js} +1 -1
  75. package/dist/client/assets/{collections-Dg2-DQoz.js → collections-Cs_tB6Xp.js} +1 -1
  76. package/dist/client/assets/{command-ETJRln9I.js → command-ClPkeFT9.js} +1 -1
  77. package/dist/client/assets/connect-desktop-dialog-DrC4f6Q3.js +1 -0
  78. package/dist/client/assets/{connection-card-BryVkZk7.js → connection-card-aeOBPbSz.js} +1 -1
  79. package/dist/client/assets/{connection-detail-KbHJGNLa.js → connection-detail-p5zHxWJQ.js} +1 -1
  80. package/dist/client/assets/{connection-form-helpers-C9SsVHwd.js → connection-form-helpers-C2pw-OdH.js} +1 -1
  81. package/dist/client/assets/{connections-C-B_pHNS.js → connections-DtVPIESl.js} +1 -1
  82. package/dist/client/assets/decopilot-sse-pool-BZ8GwOYU.js +1 -0
  83. package/dist/client/assets/{dialog-dItkri_7.js → dialog-BwBYyWWk.js} +1 -1
  84. package/dist/client/assets/{domain-settings-Cwl6OKHc.js → domain-settings-p2x5w3J1.js} +1 -1
  85. package/dist/client/assets/{drawer-CiKI2xvg.js → drawer-QIeXv6B7.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-DA6--pO3.js → dropdown-menu-CL4WEQRf.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-DvjE2kdj.js → dynamic-plugin-layout-cQR6S4X8.js} +1 -1
  88. package/dist/client/assets/{empty-state-Wjey2haZ.js → empty-state-BKLgisam.js} +1 -1
  89. package/dist/client/assets/{empty-state-ubN3bG68.js → empty-state-C4JeGg4X.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-BUZFKLkD.js → extract-connection-data-Dz_jOB39.js} +1 -1
  91. package/dist/client/assets/{features-wYfaVlaa.js → features-lNOjZ0fU.js} +1 -1
  92. package/dist/client/assets/{file-explorer-uNvjlPcF.js → file-explorer-MIJepCP_.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-BC52hPZD.js → file-type-icon-B6AnVMPu.js} +1 -1
  94. package/dist/client/assets/{files-DCMyG2Qq.js → files-C6_93qT5.js} +1 -1
  95. package/dist/client/assets/{form-BvrZIBZy.js → form-Z86e6etr.js} +1 -1
  96. package/dist/client/assets/{general-CVh1dm4M.js → general-CBaQO14X.js} +1 -1
  97. package/dist/client/assets/{generate-id-BYzu1jEq.js → generate-id-C7CxZwCs.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-D-39cmmm.js → github-repo-picker-BlgfXLdP.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-eoCiDxtu.js → header-tab-button-BOZYRinC.js} +1 -1
  100. package/dist/client/assets/{hover-card-DuwXdrhz.js → hover-card-DCrCVVSt.js} +1 -1
  101. package/dist/client/assets/{image-field-BctFTejU.js → image-field-CnaeZ7Cq.js} +1 -1
  102. package/dist/client/assets/{index-7TDtRiUY.js → index--1Ng2vB4.js} +4 -4
  103. package/dist/client/assets/{index-Dilf6iGE.js → index-1vLRIaGM.js} +1 -1
  104. package/dist/client/assets/{index-cSwj9er3.js → index-BdZLvIUs.js} +1 -1
  105. package/dist/client/assets/{index-DFBJ_PWq.js → index-Cf5_qS_K.js} +1 -1
  106. package/dist/client/assets/{index-BMYBcbtc.js → index-CiRwseKn.js} +1 -1
  107. package/dist/client/assets/{index-BOvqwG23.js → index-CmVsJNWn.js} +1 -1
  108. package/dist/client/assets/{index-CYZk0gv3.js → index-D36v7D1U.js} +1 -1
  109. package/dist/client/assets/{index-CQVYoK7e.js → index-DvG0T2G3.js} +1 -1
  110. package/dist/client/assets/{index-CfhwhmtA.js → index-DxJD6aw-.js} +1 -1
  111. package/dist/client/assets/{index-BN_h4BrS.js → index-F-DdQVig.js} +1 -1
  112. package/dist/client/assets/{index-B6rgjRY6.js → index-Jt8pUNdF.js} +1 -1
  113. package/dist/client/assets/{index-DkJOKUiK.js → index-Nc3tqGu_.js} +1 -1
  114. package/dist/client/assets/{index-DkBXivRM.js → index-YE7XuOF9.js} +1 -1
  115. package/dist/client/assets/{index-CyhU99S0.js → index-qk7utkhC.js} +1 -1
  116. package/dist/client/assets/{index-redirect-C0KSMoT0.js → index-redirect-Bga8SUq5.js} +1 -1
  117. package/dist/client/assets/{index-Dv-yFpKM.js → index-uVHAmIsb.js} +3 -3
  118. package/dist/client/assets/{input-B16LqKMQ.js → input-BYcDxHNs.js} +1 -1
  119. package/dist/client/assets/{integration-icon-7cYHs9rV.js → integration-icon-YIddy6rU.js} +1 -1
  120. package/dist/client/assets/{label-DfTmRnMe.js → label-6YORzGJ9.js} +1 -1
  121. package/dist/client/assets/{layout-BCfLVStg.js → layout-BqzITPb8.js} +1 -1
  122. package/dist/client/assets/{login-BQe_0Uvb.js → login-OD0e1zDV.js} +1 -1
  123. package/dist/client/assets/{mcp-oauth-BoL_9gDY.js → mcp-oauth-Bqzn0Dif.js} +1 -1
  124. package/dist/client/assets/{members-DjEZG3vo.js → members-DS-tdh70.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-CEYWUBYY.js → monaco-editor-BUU4dfTp.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-Bn6k8FMZ.js → monitoring-stats-row-W1kG1QMr.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-RkcrzPY9.js → oauth-callback-TPVFfDa1.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-5c5f08wA.js → oauth-callback-ai-provider-BSrRnpyk.js} +1 -1
  129. package/dist/client/assets/{onboarding-DgNS0nCK.js → onboarding-K3muUGna.js} +1 -1
  130. package/dist/client/assets/{org-install-BAqLW3a2.js → org-install-B_NKJRUX.js} +1 -1
  131. package/dist/client/assets/{org-layout--7cqwMMu.js → org-layout-DS11FDyh.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-oYg4_27L.js → org-plugin-layout-Ds4SKE20.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-BPPrLLbX.js → page-seo-form-CUXHyT3k.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-DWN_jrpV.js +1 -0
  135. package/dist/client/assets/{pair-rD44zBRY.js → pair-DguDTLaz.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-BrE2fclx.js → plugin-empty-state-BsOWqXT4.js} +1 -1
  137. package/dist/client/assets/{plugin-header-K2albhDB.js → plugin-header-CVnVRSWb.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-QWYZgGti.js → plugin-layout-B-eexJrb.js} +1 -1
  139. package/dist/client/assets/{popover-BneLTlXE.js → popover-OWTo-ttg.js} +1 -1
  140. package/dist/client/assets/{post-editor-DtVXF5Vi.js → post-editor-9P0wvqVY.js} +1 -1
  141. package/dist/client/assets/{primitives-CGyfTuZM.js → primitives-BKz7PoD1.js} +1 -1
  142. package/dist/client/assets/{profile-DyIp4_Sh.js → profile-DKgH58jm.js} +1 -1
  143. package/dist/client/assets/project-app-view-aiPHbBMn.js +1 -0
  144. package/dist/client/assets/record-editor-CEd3Nq-X.js +1 -0
  145. package/dist/client/assets/registry-BJIUp0yq.js +2 -0
  146. package/dist/client/assets/{registry-layout-D_1w2T32.js → registry-layout-BVyz_YyX.js} +1 -1
  147. package/dist/client/assets/{require-capability-BYMVx09Z.js → require-capability-BNXWgOaA.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-cXbsWfNV.js → required-auth-layout-CgveTWoj.js} +1 -1
  149. package/dist/client/assets/{reset-password-CUBQj13G.js → reset-password-B5XJrRXo.js} +1 -1
  150. package/dist/client/assets/{resizable-DTSOtBpc.js → resizable-ZwB_SgdO.js} +1 -1
  151. package/dist/client/assets/{roles-CNJV2xc7.js → roles-B3qZ9FQm.js} +1 -1
  152. package/dist/client/assets/save-referenced-block-BWbuYBb2.js +1 -0
  153. package/dist/client/assets/{save-status-CFFENSy0.js → save-status-BAgQweyK.js} +1 -1
  154. package/dist/client/assets/{schema-form-EY1QOp8v.js → schema-form-CD60zPdr.js} +1 -1
  155. package/dist/client/assets/{scroll-area-CGmfUT4q.js → scroll-area-CixG0pJh.js} +1 -1
  156. package/dist/client/assets/{search-input-nds5g8eq.js → search-input-BfizHALq.js} +1 -1
  157. package/dist/client/assets/{secrets-D9isT8UG.js → secrets-hkT-vkWO.js} +1 -1
  158. package/dist/client/assets/{sections-editor-Bdjt3M_c.js → sections-editor-C7wGHkLQ.js} +1 -1
  159. package/dist/client/assets/{select-CXfOBpVA.js → select-DpIv2m7o.js} +1 -1
  160. package/dist/client/assets/{select-model-BLS2zNwN.js → select-model-DHqBdvUI.js} +1 -1
  161. package/dist/client/assets/{seo-editor-COMkxwHv.js → seo-editor-X4tutsUS.js} +1 -1
  162. package/dist/client/assets/{settings-layout-B65ypXYb.js → settings-layout-BPos4Lfi.js} +1 -1
  163. package/dist/client/assets/{settings-section-ysm1dXbe.js → settings-section-nvSL8mUn.js} +1 -1
  164. package/dist/client/assets/{sheet-DwJxE17f.js → sheet-J3PJeFDK.js} +1 -1
  165. package/dist/client/assets/{shell-controls-CghaJ_r9.js → shell-controls-CV-_zqGg.js} +1 -1
  166. package/dist/client/assets/{shell-layout-BI3SgcG0.js → shell-layout-tEjGEg5-.js} +1 -1
  167. package/dist/client/assets/{shell-route-loading-BQp4nxMc.js → shell-route-loading-CZqCIakz.js} +1 -1
  168. package/dist/client/assets/{sidebar-nhuTSqFS.js → sidebar-DawbXHdj.js} +1 -1
  169. package/dist/client/assets/{skeleton-DcZkQ-WQ.js → skeleton-BCgq4Xy6.js} +1 -1
  170. package/dist/client/assets/{sortable.esm-BJmSIQN6.js → sortable.esm-DsSid7Zp.js} +1 -1
  171. package/dist/client/assets/{spinner-C76OMH7i.js → spinner-BQT6CDh-.js} +1 -1
  172. package/dist/client/assets/{sso-Biwe8B2Y.js → sso-B1HWtZMn.js} +1 -1
  173. package/dist/client/assets/{store-DPy_WrJu.js → store-BfFFxnM0.js} +1 -1
  174. package/dist/client/assets/store-registry-DspBhmXB.js +2 -0
  175. package/dist/client/assets/{studio-tools-DP4PwlLL.js → studio-tools-Bsqb-6Fx.js} +1 -1
  176. package/dist/client/assets/{switch-Dlc-euH4.js → switch-Cu-9OUl1.js} +1 -1
  177. package/dist/client/assets/{tab-id-DrxIMKZC.js → tab-id-DxwgE0jf.js} +1 -1
  178. package/dist/client/assets/{table-BY5hmAW9.js → table-XS_vYE_1.js} +1 -1
  179. package/dist/client/assets/{tabs-MktB_dq3.js → tabs-B4F5NKqf.js} +1 -1
  180. package/dist/client/assets/{task-status-Bkjp3y0Q.js → task-status-OfocbInI.js} +1 -1
  181. package/dist/client/assets/{textarea-Dc7UpW7V.js → textarea-pwpin7Xo.js} +1 -1
  182. package/dist/client/assets/{toggle-group-PAs-hpFv.js → toggle-group-BTyEkyOV.js} +1 -1
  183. package/dist/client/assets/{toolbar-CCipnjie.js → toolbar-ZyghcYDs.js} +1 -1
  184. package/dist/client/assets/{tools-list-D8vEf5kn.js → tools-list-Dm-oDLPn.js} +1 -1
  185. package/dist/client/assets/{tooltip-DyNW-AXf.js → tooltip-C_pZvUmA.js} +1 -1
  186. package/dist/client/assets/{types-DYMMjWos.js → types-CVQ_neIF.js} +1 -1
  187. package/dist/client/assets/{use-ai-providers-C1UbdVdO.js → use-ai-providers-CGgTldnc.js} +1 -1
  188. package/dist/client/assets/{use-automations-DFVkTFjl.js → use-automations-C3tUJiXy.js} +1 -1
  189. package/dist/client/assets/{use-capability-Bw0k887i.js → use-capability-BcwY0Lf1.js} +1 -1
  190. package/dist/client/assets/{use-clock-tick-DMfzqE_6.js → use-clock-tick-Bsu4JpY1.js} +1 -1
  191. package/dist/client/assets/{use-collections-DGD5HYrs.js → use-collections-CNY4Rigp.js} +1 -1
  192. package/dist/client/assets/{use-connection-XtO-eFJi.js → use-connection-Cd3-MJT5.js} +1 -1
  193. package/dist/client/assets/{use-copy-fHv0q1pV.js → use-copy-C62Opw3r.js} +1 -1
  194. package/dist/client/assets/{use-create-virtual-mcp-DTGwia7F.js → use-create-virtual-mcp-JNvxHXlx.js} +1 -1
  195. package/dist/client/assets/{use-debounced-autosave-nDLl3CCi.js → use-debounced-autosave-CmpKlipe.js} +1 -1
  196. package/dist/client/assets/{use-delete-connection-CWxG7WKN.js → use-delete-connection-DOqJ3DYp.js} +1 -1
  197. package/dist/client/assets/{use-file-configs-DhxZBYOT.js → use-file-configs-OSUx89xj.js} +1 -1
  198. package/dist/client/assets/{use-infinite-scroll-D4S3aGR5.js → use-infinite-scroll-Ce2zTY3i.js} +1 -1
  199. package/dist/client/assets/{use-list-state-Cx82QFu_.js → use-list-state-B6GtGz_i.js} +1 -1
  200. package/dist/client/assets/{use-mcp-client-C8ZwZB20.js → use-mcp-client-Bqv2ciYo.js} +1 -1
  201. package/dist/client/assets/{use-mcp-prompts-D2owAcPE.js → use-mcp-prompts-B2fIh5W5.js} +1 -1
  202. package/dist/client/assets/{use-mcp-tools-BW-64A4f.js → use-mcp-tools-DNa7v9SS.js} +1 -1
  203. package/dist/client/assets/{use-members-DPyxvdDj.js → use-members-BBAnZQ_N.js} +1 -1
  204. package/dist/client/assets/{use-navigate-to-agent-B9d6Q1VR.js → use-navigate-to-agent-CDxi6d1t.js} +1 -1
  205. package/dist/client/assets/{use-org-auth-client-BTTZUjKk.js → use-org-auth-client-BvIrqhMj.js} +1 -1
  206. package/dist/client/assets/{use-org-sso-B1KJDg2R.js → use-org-sso-DvInKERU.js} +1 -1
  207. package/dist/client/assets/{use-organization-roles-zS-vWU34.js → use-organization-roles-CrylSy9-.js} +1 -1
  208. package/dist/client/assets/{use-organization-settings-CCLHoFg6.js → use-organization-settings-CdYVljPu.js} +1 -1
  209. package/dist/client/assets/{use-registry-connections-CAyIHNjF.js → use-registry-connections-Bdnyk0np.js} +1 -1
  210. package/dist/client/assets/{use-secrets-CtwUwXaf.js → use-secrets-5xq_sQR4.js} +1 -1
  211. package/dist/client/assets/{use-status-sounds-B27SY7cH.js → use-status-sounds-CugYppDe.js} +1 -1
  212. package/dist/client/assets/{use-view-mode-BRITAZ4S.js → use-view-mode-BmgcQL7Y.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-DLQJqd7d.js → use-virtual-mcp-Clsr41cX.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-CL1ZPxL1.js +1 -0
  215. package/dist/client/assets/{useRouterState-Y1aLUix_.js → useRouterState-BCoEdLHo.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-B0dXZKGJ.js +1 -0
  217. package/dist/client/assets/{user-CLXOG3Qm.js → user-DNJpS6qb.js} +1 -1
  218. package/dist/client/assets/{view-mode-toggle-D_5X7-ae.js → view-mode-toggle-CnJNM_yP.js} +1 -1
  219. package/dist/client/assets/{watch-sse-pool-rXavNycp.js → watch-sse-pool-DiiHGFSQ.js} +1 -1
  220. package/dist/client/assets/{workflow-Bq61DMkg.js → workflow-DTPliqqz.js} +1 -1
  221. package/dist/client/assets/workflow-detail-DmBVM3K8.js +1 -0
  222. package/dist/client/index.html +1 -1
  223. package/dist/server/cli.js +2 -2
  224. package/dist/server/server.js +1 -1
  225. package/package.json +1 -1
  226. package/dist/client/assets/app-editor-8bhdvSJz.js +0 -1
  227. package/dist/client/assets/connect-desktop-dialog-Ccy-ptqT.js +0 -1
  228. package/dist/client/assets/decopilot-sse-pool-BYcZYovC.js +0 -1
  229. package/dist/client/assets/page-seo-sheet-B3ue-ZRT.js +0 -1
  230. package/dist/client/assets/project-app-view-LYHB1B7I.js +0 -1
  231. package/dist/client/assets/record-editor-CoIz7HmY.js +0 -1
  232. package/dist/client/assets/registry-DusjF1MY.js +0 -2
  233. package/dist/client/assets/save-referenced-block-R6f1-KeE.js +0 -1
  234. package/dist/client/assets/store-registry-D7UNS3l2.js +0 -2
  235. package/dist/client/assets/useInfiniteQuery-G_6i7LOo.js +0 -1
  236. package/dist/client/assets/useSuspenseInfiniteQuery-BhcYyKm_.js +0 -1
  237. package/dist/client/assets/workflow-detail-BJvoV5gO.js +0 -1
@@ -1 +1 @@
1
- import{P as he,aG as Ie,b7 as Ae,R as le,aE as De,e as P,j as t,l as ge,B as V,r as q,c as je,p as J,q as $e,K as ne,f as Y,w as ce,u as Pe,b8 as Oe,E as ze,g as Me,b9 as Ee,F as Ve,G as Ue,H as Fe,n as X,ba as Re}from"./index-Dv-yFpKM.js";import{g as Le}from"./generate-id-BYzu1jEq.js";import{E as ve}from"./empty-state-Wjey2haZ.js";import{E as He,c as Be,r as Ge,b as We,d as Xe}from"./connection-form-helpers-C9SsVHwd.js";import{c as qe,S as Ke}from"./index-DkBXivRM.js";import{u as be,T as Qe}from"./tools-list-D8vEf5kn.js";import{u as Je}from"./use-members-DPyxvdDj.js";import{A as Ye}from"./avatar-BqYC23h9.js";import{a as Ne,b as ye,u as Ze}from"./use-connection-XtO-eFJi.js";import{u as _e}from"./use-mcp-client-C8ZwZB20.js";import{b as et}from"./use-mcp-tools-BW-64A4f.js";import{a as tt}from"./use-mcp-prompts-D2owAcPE.js";import{i as st,a as nt}from"./mcp-oauth-BoL_9gDY.js";import{I as oe}from"./integration-icon-7cYHs9rV.js";import{s as ot}from"./Plus-DcxLSicT.js";import{r as it,u as at,a6 as rt,S as lt}from"./agent-icon-BrUPk7cd.js";import{a as Se}from"./Settings02-D0kdZjJD.js";import{s as ae}from"./Trash01-rpak8qu1.js";import{b as ct,a as dt,d as mt,S as ut,c as xt}from"./sheet-DwJxE17f.js";import{F as L,b as H,c as B,d as E,f as G,e as pt,a as ft}from"./form-BvrZIBZy.js";import{I as W}from"./input-B16LqKMQ.js";import{u as ht,D as gt}from"./use-delete-connection-CWxG7WKN.js";import{V as jt}from"./layout-BCfLVStg.js";import{c as vt,C as bt,B as Nt,a as yt,b as _t,d as St,e as Ct}from"./monitoring-stats-row-Bn6k8FMZ.js";import{u as wt}from"./studio-tools-DP4PwlLL.js";import{a as kt}from"./use-virtual-mcp-DLQJqd7d.js";import{i as Ce}from"./ChevronRight-DixPnH3V.js";import{a as we}from"./Users03-B9AqN8LK.js";import{T as ee,a as Tt,b as te,c as It}from"./tabs-MktB_dq3.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as At}from"./ZapSquare-Dz4Qok6x.js";import{b as Dt}from"./Tool01-DNz0OMpT.js";import{g as re,M as $t}from"./types-DYMMjWos.js";import{C as Pt}from"./collection-search-CJ5Ov7mh.js";import{C as Ot}from"./card-BlzflWCA.js";import{B as zt}from"./badge-CGZjMX2o.js";import{D as Mt,a as Et,b as Vt,c as de}from"./dropdown-menu-DA6--pO3.js";import{d as me,S as ue,a as xe,b as pe,c as R}from"./select-CXfOBpVA.js";import{i as Ut}from"./CheckCircle-B7v5_MG4.js";import{t as Ft}from"./ChevronDown-BKkz3Gyp.js";import{n as Rt}from"./Container-C41D-bwR.js";import{s as se}from"./Star01-BVQUiqS1.js";import{s as Lt}from"./RefreshCcw01-Dd5D2uNm.js";import{s as Ht}from"./XClose-DOt_DYPz.js";import"./collections-Dg2-DQoz.js";import"./ZoomOut-BkCtUzuC.js";import"./Key01-CDAkGspz.js";import"./index-CQVYoK7e.js";import"./auth-DTxUlSLU.js";import"./index-CYZk0gv3.js";import"./extract-connection-data-BUZFKLkD.js";import"./use-registry-connections-CAyIHNjF.js";import"./use-organization-settings-CCLHoFg6.js";import"./index-BMYBcbtc.js";import"./popover-BneLTlXE.js";import"./tooltip-DyNW-AXf.js";import"./Check-CNRVH6xs.js";import"./SearchMd-2GibIebB.js";import"./use-create-virtual-mcp-DTGwia7F.js";import"./use-navigate-to-agent-B9d6Q1VR.js";import"./Eye-CFpoJQMe.js";import"./use-org-auth-client-BTTZUjKk.js";import"./User01-BWllfXHj.js";import"./use-collections-DGD5HYrs.js";import"./AlertCircle-asB0zjf2.js";import"./SwitchHorizontal01-qUOmQUUG.js";import"./XCircle-B_UH_gQt.js";import"./ArrowUpRight-DRnt_VKh.js";import"./ChevronLeft-DkMFugke.js";import"./ChevronUp-BeDEmrn1.js";import"./DotsVertical-DimB1qZR.js";import"./Globe01-CxF-Z8O2.js";import"./FilterLines-htpqKUqo.js";import"./Palette-D9_6t0uI.js";import"./HardDrive-TXw7C9gB.js";import"./Stars02-BFz8RQ16.js";import"./LayoutLeft-BG08KNqc.js";import"./LinkExternal01-AylVRyuU.js";import"./Monitor01-gdKmZQTW.js";import"./Sun-DMcKqqHE.js";import"./Play-aa6uUei5.js";import"./Shield01-CpxvRW7h.js";import"./Stars01-B2PA7s4d.js";import"./Upload01-d_Wyw7QT.js";import"./Users01-DG6YdAo1.js";import"./X-DxE022Fo.js";import"./Zap-CyMJw7DY.js";import"./label-DfTmRnMe.js";import"./alert-dialog-DUUnhBc6.js";import"./index-CfhwhmtA.js";import"./sidebar-nhuTSqFS.js";const Bt=he({scopes:De(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Gt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Bt}];function Wt(s){const e=P.c(46),{instance:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i}=s;let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const l=be(c),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",d=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==d?(h=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",d),e[2]=d,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==i?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>i(n,"active"),children:[t.jsx(it,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>i(n,"inactive"),title:"Disable",children:t.jsx(at,{size:13})}),e[20]=n,e[21]=p,e[22]=i,e[23]=T):T=e[23];let C;e[24]!==n||e[25]!==a?(C=()=>a(n),e[24]=n,e[25]=a,e[26]=C):C=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Se,{size:13}),e[27]=y):y=e[27];let I;e[28]!==C?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:C,title:"Configure",children:y}),e[28]=C,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ae,{size:13}),e[33]=k):k=e[33];let S;e[34]!==_?(S=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=S):S=e[35];let f;e[36]!==I||e[37]!==S||e[38]!==N||e[39]!==T?(f=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,S]}),e[36]=I,e[37]=S,e[38]=N,e[39]=T,e[40]=f):f=e[40];let w;return e[41]!==f||e[42]!==h||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:h,children:[g,j,f]}),e[41]=f,e[42]=h,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function Xt(s){const e=P.c(15),{instance:n,onConfigure:a}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=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 i;e[5]!==n||e[6]!==a?(i=()=>a(n),e[5]=n,e[6]=a,e[7]=i):i=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 l;e[9]!==i?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,title:"Configure",children:c})}),e[9]=i,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function qt(s){const e=P.c(27),{instances:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i,onAdd:c,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(ot,{size:13}),e[2]=l,e[3]=p):p=e[3];let d;e[4]!==l||e[5]!==c||e[6]!==p?(d=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:c,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=c,e[6]=p,e[7]=d):d=e[7];let h;e[8]!==x||e[9]!==d?(h=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,d]}),e[8]=x,e[9]=d,e[10]=h):h=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==a||e[14]!==o||e[15]!==i){let j;e[17]!==r||e[18]!==a||e[19]!==o||e[20]!==i?(j=N=>t.jsx(q.Suspense,{fallback:t.jsx(Xt,{instance:N,onConfigure:a}),children:t.jsx(Wt,{instance:N,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i})},N.id),e[17]=r,e[18]=a,e[19]=o,e[20]=i,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=a,e[14]=o,e[15]=i,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==h||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[h,v]}),e[24]=h,e[25]=v,e[26]=b):b=e[26],b}const Kt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Qt(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 Jt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Yt(s){const e=P.c(1),{connectionId:n,orgId:a,timeframe:r}=s,o=wt(),i=Qt(r),{data:c}=$e({queryKey:ne.connectionActivity(n,r,a),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:i.startDate.toISOString(),endDate:i.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=vt(c?.logs??[],i),u=l.data,x=l.totalCalls>0;let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=p):p=e[0],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:l.totalCalls.toLocaleString()}),p]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(bt,{config:Jt,className:"h-16 w-full",children:t.jsxs(Nt,{data:u,barCategoryGap:"4%",children:[t.jsx(yt,{content:t.jsx(_t,{labelFormatter:es}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Zt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.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 Zt(s,e){return t.jsx(Ct,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function es(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ts(){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 ss(s){const e=P.c(13),{connectionId:n}=s,[a,r]=q.useState("14d"),{org:o}=J();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=i):i=e[0];let c;e[1]!==a?(c=Kt.map(d=>t.jsx("button",{type:"button",onClick:()=>r(d.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===d.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:d.label},d.value)),e[1]=a,e[2]=c):c=e[2];let l;e[3]!==c?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[i,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ts,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==a?(x=t.jsx(q.Suspense,{fallback:u,children:t.jsx(Yt,{connectionId:n,orgId:o.id,timeframe:a})}),e[6]=n,e[7]=o.id,e[8]=a,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function ns(s){const e=P.c(15),{virtualMcp:n,org:a}=s,r=Y();let o;e[0]!==r||e[1]!==a||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:a,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=a,e[2]=n.id,e[3]=o):o=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(we,{size:16}),e[4]=i):i=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:i}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==c||e[13]!==l?(x=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,l,u]}),e[11]=o,e[12]=c,e[13]=l,e[14]=x):x=e[14],x}function os(s){const e=P.c(7),{virtualMcps:n,org:a}=s;let r;if(e[0]!==a||e[1]!==n){let i;e[3]!==a?(i=c=>t.jsx(ns,{virtualMcp:c,org:a},c.id),e[3]=a,e[4]=i):i=e[4],r=n.map(i),e[0]=a,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function is(s){const e=P.c(7),{connection:n}=s,{org:a}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=kt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}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 l;return e[4]!==a.slug||e[5]!==o?(l=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(os,{virtualMcps:o,org:a.slug})})]}),e[4]=a.slug,e[5]=o,e[6]=l):l=e[6],l}function as(s){const e=P.c(31),{tools:n,connectionId:a,org:r}=s,o=Y(),{org:i}=J();let c;e[0]!==a||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=a,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const l=_e(c),u=Ne(a);let x;e[4]!==u||e[5]!==a?(x=u?ke(u):a,e[4]=u,e[5]=a,e[6]=x):x=e[6];const p=x,[d,h]=q.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==d||e[12]!==n){const C=(n??[]).filter(rs),y=d.toLowerCase().trim(),I=y?C.filter(f=>f.name.toLowerCase().includes(y)||f.description&&f.description.toLowerCase().includes(y)):C;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=f=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(f.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=f=>{f.key==="Escape"&&(h(""),f.target.blur())},e[21]=S):S=e[21],e[22]!==d?(j=t.jsx(Pt,{value:d,onChange:h,placeholder:"Search apps...",onKeyDown:S}),e[22]=d,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:d?"No apps found":"No apps available",description:d?"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:I.map(f=>{const w=re(f._meta);return t.jsxs(Ot,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(f),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx($t,{resourceURI:w,toolInfo:{tool:f},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),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:f.name}),t.jsx(Qe,{annotations:f.annotations,_meta:f._meta})]}),f.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.description})]})]},f.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=d,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 N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function rs(s){return!!re(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=i=>i.charAt(0).toUpperCase()+i.slice(1),a=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&a.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let a;return e[0]!==n?(a=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]=a):a=e[1],a}function ls(s){const e=P.c(50),{tools:n,prompts:a,resources:r,connectionId:o,org:i}=s;let c;e[0]!==a?(c=a===void 0?[]:a,e[0]=a,e[1]=c):c=e[1];const l=c;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),d=Ne(o??"");let h;e[4]!==d||e[5]!==o?(h=d?ke(d):o,e[4]=d,e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==i?(v=function(D){!o||!i||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(D)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=i,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==i||e[14]!==n?(j=o&&i&&n.some(ms),e[12]=o,e[13]=i,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=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]=m):m=e[16],m}let C;e[17]!==n.length?(C=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=C):C=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==C||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Tt,{variant:"underline",className:"gap-1",children:[C,y,I,_]})}),e[23]=C,e[24]=y,e[25]=k):k=e[25];let S;e[26]!==b||e[27]!==n?(S=n.length>0?n.map(m=>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(m.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(Dt,{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(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=S):S=e[28];let f;e[29]!==S?(f=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[29]=S,e[30]=f):f=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==i||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(as,{tools:n,connectionId:o,org:i})}),e[31]=o,e[32]=N,e[33]=i,e[34]=n,e[35]=w):w=e[35];let z;e[36]!==l?(z=l.length>0?l.map(ds):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=z):z=e[37];let O;e[38]!==z?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[38]=z,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(cs):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let M;e[42]!==A?(M=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=M):M=e[43];let U;return e[44]!==k||e[45]!==f||e[46]!==w||e[47]!==O||e[48]!==M?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(It,{defaultValue:"tools",variant:"underline",children:[k,f,w,O,M]})}),e[44]=k,e[45]=f,e[46]=w,e[47]=O,e[48]=M,e[49]=U):U=e[49],U}function cs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(rt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children: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 ds(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(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(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 ms(s){return re(s._meta)}function us(s){const e=P.c(13),{connection:n,displayTitle:a}=s,r=a??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let i;e[3]!==r?(i=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:r})}),e[3]=r,e[4]=i):i=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 l;e[7]!==i||e[8]!==c?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=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,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function xs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:a,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),i=ce({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),l=(()=>{if(typeof i!="string"||!i)return!1;try{const d=new URL(i);return d.hostname==="api.githubcopilot.com"&&d.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=c||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"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(L,{control:s.control,name:"ui_type",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{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(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{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(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(W,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Rt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(lt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(G,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(W,{placeholder:"node, bun, python...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(W,{placeholder:"arg1 arg2 --flag value",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(G,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(W,{placeholder:"/path/to/project (optional)",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(He,{value:d.value??[],onChange:d.onChange})}),t.jsx(G,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Mt,{children:[t.jsx(Et,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{variant:"success",className:"gap-1.5",children:[t.jsx(Ut,{size:12}),"Authenticated via OAuth",t.jsx(Ft,{size:12})]})})}),t.jsxs(Vt,{align:"start",children:[t.jsxs(de,{onClick:a,children:[t.jsx(Lt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(ae,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&d.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:()=>d.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(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(W,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(pt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(G,{})]})})]})}function ps(s){return s.command==="npx"}function fs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function hs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(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 a=s.connection_headers,r=Ge(a.envVars);if(ps(a)){const i=fs(a);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:i,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=hs(a);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:r}}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 gs(s){let e,n=null,a=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=We(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Xe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",a=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...a&&{connection_token:a},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function js({connection:s,connectionId:e,org:n,isUpdating:a,tools:r,prompts:o,resources:i,siblings:c}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),d=ht({onSuccess:()=>{c.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=q.useState(null),[v,b]=q.useState(!1),j=be({connectionId:e}),{data:N}=Je(),T=N?.data?.members??[],C=h??s,y=T.find(m=>m.userId===C.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},S=qe(k,Gt),f=Ue({resolver:Fe(Be),values:fe(h??s)}),w=f.formState.isDirty,z=async()=>{if(!await f.trigger())return;const D=f.getValues(),$=gs(D),F=h?.id??e;await x.update.mutateAsync({id:F,data:$}),f.reset(D)},O=()=>{f.reset(fe(h??s))},A=async m=>{const{token:D,tokenInfo:$,error:F}=await nt({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(F||!D){X.error(`Authentication failed: ${F}`);return}if($)try{const K=await fetch(`/api/${p.slug}/connections/${m}/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(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:D}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:D}})}else await x.update.mutateAsync({id:m,data:{connection_token:D}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),X.success("Authentication successful")},M=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const $=await m.text();X.error(`Failed to remove OAuth: ${$}`);return}const D=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(D.href,null)}),X.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),X.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(gt,{...d}),t.jsx(ct,{open:h!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(dt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(mt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(ut,{className:"text-base",children:h?.title??s.title}),t.jsx(xt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&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(Ye,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(ft,{...f,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(L,{control:f.control,name:"title",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Name"}),t.jsx(E,{children:t.jsx(W,{...m})}),t.jsx(G,{})]})}),t.jsx(L,{control:f.control,name:"description",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Description"}),t.jsx(E,{children:t.jsx(W,{...m,value:m.value||""})}),t.jsx(G,{})]})})]}),t.jsx(xs,{form:f,connection:h??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:M,onRemoveOAuth:U}),t.jsx(Ke,{connection:h??s,form:f,hasMcpBinding:S,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:M,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:z,disabled:!w||a,className:"flex-1",children:a?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=h??s;g(null),d.requestDelete(m)},children:[t.jsx(ae,{size:15}),"Delete"]})]})]},h?.id??s.id)]})}),t.jsx(jt,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(us,{connection:s,displayTitle:(()=>{const m=c[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.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(ss,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(qt,{instances:c,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>d.requestDelete(m),onToggleStatus:async(m,D)=>{try{await x.update.mutateAsync({id:m.id,data:{status:D}}),X.success(D==="active"?"Connection enabled":"Connection disabled")}catch{X.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=c[0]??s,D=m.title.replace(/\s*\(\d+\)\s*$/,""),$=c.length+1,F=`${D} (${$})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:F,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await st({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(is,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ls,{tools:r,prompts:o,resources:i,connectionId:e,org:n})})]})})]})})]})}function vs(){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 a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:r,org:o}=Me(a),{org:i}=J(),c=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=Ze(l),x=u[0]??null,p=x?.id??"",d=p||null;let h;s[4]!==i.id||s[5]!==i.slug||s[6]!==d?(h={connectionId:d,orgId:i.id,orgSlug:i.slug},s[4]=i.id,s[5]=i.slug,s[6]=d,s[7]=h):h=s[7];const g=_e(h);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=et(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(Cs):(x?.tools??[]).map(Ss);e:{if(u.length<=1){j=A;break e}const M=new Set,U=[],m=ys;for(const D of u){const $=D.id===p?A:m(D.tools);for(const F of $)M.has(F.name)||(M.add(F.name),U.push(F))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:C}=tt(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==C?.prompts?(_=C?.prompts??[],s[19]=C?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(Ns),s[21]=_,s[22]=k):k=s[22];const S=k;let f;s[23]!==I?.resources?(f=I?.resources??[],s[23]=I?.resources,s[24]=f):f=s[24];let w;s[25]!==f?(w=f.map(bs),s[25]=f,s[26]=w):w=s[26];const z=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==c.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==S||s[36]!==z||s[37]!==u?(O=t.jsx(js,{org:o,connection:x,connectionId:p,isUpdating:c.update.isPending,tools:N,prompts:S,resources:z,siblings:u}),s[30]=c.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=S,s[36]=z,s[37]=u,s[38]=O):O=s[38],O}function bs(s){return{name:s.name,description:s.description,uri:s.uri}}function Ns(s){return{name:s.name,description:s.description}}function ys(s){return(s??[]).map(_s)}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Cs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ze,{children:t.jsx(q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(vs,{})})}),s[0]=e):e=s[0],e}function uo(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ws,{}),s[0]=e):e=s[0],e}export{uo as default};
1
+ import{P as he,aG as Ie,b7 as Ae,R as le,aE as De,e as P,j as t,l as ge,B as V,r as q,c as je,p as J,q as $e,K as ne,f as Y,w as ce,u as Pe,b8 as Oe,E as ze,g as Me,b9 as Ee,F as Ve,G as Ue,H as Fe,n as X,ba as Re}from"./index-uVHAmIsb.js";import{g as Le}from"./generate-id-C7CxZwCs.js";import{E as ve}from"./empty-state-BKLgisam.js";import{E as He,c as Be,r as Ge,b as We,d as Xe}from"./connection-form-helpers-C2pw-OdH.js";import{c as qe,S as Ke}from"./index-YE7XuOF9.js";import{u as be,T as Qe}from"./tools-list-Dm-oDLPn.js";import{u as Je}from"./use-members-BBAnZQ_N.js";import{A as Ye}from"./avatar-BG2RlqaT.js";import{a as Ne,b as ye,u as Ze}from"./use-connection-Cd3-MJT5.js";import{u as _e}from"./use-mcp-client-Bqv2ciYo.js";import{b as et}from"./use-mcp-tools-DNa7v9SS.js";import{a as tt}from"./use-mcp-prompts-B2fIh5W5.js";import{i as st,a as nt}from"./mcp-oauth-Bqzn0Dif.js";import{I as oe}from"./integration-icon-YIddy6rU.js";import{s as ot}from"./Plus-aXWGGcSy.js";import{r as it,u as at,a6 as rt,S as lt}from"./agent-icon-CCGqC-bl.js";import{a as Se}from"./Settings02-DeH66RiM.js";import{s as ae}from"./Trash01-DBSukaq0.js";import{b as ct,a as dt,d as mt,S as ut,c as xt}from"./sheet-J3PJeFDK.js";import{F as L,b as H,c as B,d as E,f as G,e as pt,a as ft}from"./form-Z86e6etr.js";import{I as W}from"./input-BYcDxHNs.js";import{u as ht,D as gt}from"./use-delete-connection-DOqJ3DYp.js";import{V as jt}from"./layout-BqzITPb8.js";import{c as vt,C as bt,B as Nt,a as yt,b as _t,d as St,e as Ct}from"./monitoring-stats-row-W1kG1QMr.js";import{u as wt}from"./studio-tools-Bsqb-6Fx.js";import{a as kt}from"./use-virtual-mcp-Clsr41cX.js";import{i as Ce}from"./ChevronRight-3jD7TdJZ.js";import{a as we}from"./Users03-DiilXFZ6.js";import{T as ee,a as Tt,b as te,c as It}from"./tabs-B4F5NKqf.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as At}from"./ZapSquare-BQX2HOTP.js";import{b as Dt}from"./Tool01-DC4THSlP.js";import{g as re,M as $t}from"./types-CVQ_neIF.js";import{C as Pt}from"./collection-search-C5MSFdhR.js";import{C as Ot}from"./card-ykuj7mlf.js";import{B as zt}from"./badge-DIN7Nq6a.js";import{D as Mt,a as Et,b as Vt,c as de}from"./dropdown-menu-CL4WEQRf.js";import{d as me,S as ue,a as xe,b as pe,c as R}from"./select-DpIv2m7o.js";import{i as Ut}from"./CheckCircle-XS4dmEOs.js";import{t as Ft}from"./ChevronDown-CxTVikeq.js";import{n as Rt}from"./Container-Hfp9SJFa.js";import{s as se}from"./Star01-pwvCfpNJ.js";import{s as Lt}from"./RefreshCcw01-DS1vtLKW.js";import{s as Ht}from"./XClose-r0gXvFlp.js";import"./collections-Cs_tB6Xp.js";import"./ZoomOut-DC46Ewts.js";import"./Key01-DZeJDklU.js";import"./index-DvG0T2G3.js";import"./auth-ClbRbdVv.js";import"./index-D36v7D1U.js";import"./extract-connection-data-Dz_jOB39.js";import"./use-registry-connections-Bdnyk0np.js";import"./use-organization-settings-CdYVljPu.js";import"./index-CiRwseKn.js";import"./popover-OWTo-ttg.js";import"./tooltip-C_pZvUmA.js";import"./Check-D7HZW6oZ.js";import"./SearchMd-Cr6CluRw.js";import"./use-create-virtual-mcp-JNvxHXlx.js";import"./use-navigate-to-agent-CDxi6d1t.js";import"./Eye-BIZqMr-y.js";import"./use-org-auth-client-BvIrqhMj.js";import"./User01-Bweqikx-.js";import"./use-collections-CNY4Rigp.js";import"./AlertCircle-DjOU_aot.js";import"./SwitchHorizontal01-Blia-yUi.js";import"./XCircle-BtUzMyFW.js";import"./ArrowUpRight-BXJMGk9i.js";import"./ChevronLeft-BEmN2X52.js";import"./ChevronUp-Dbc77Gwp.js";import"./DotsVertical-Cz5MZln-.js";import"./Globe01-CiCGKTg3.js";import"./FilterLines-iroXgkwP.js";import"./Palette-BDd6wxPD.js";import"./HardDrive-B26C8dI3.js";import"./Stars02-vcxNwhIa.js";import"./LayoutLeft-CY1OP6dH.js";import"./LinkExternal01-DwxMIV-o.js";import"./Monitor01-_FIjo4ge.js";import"./Sun-De2vWRC7.js";import"./Play-C933mY5z.js";import"./Shield01-0kTDalL_.js";import"./Stars01-Bw7_Rdwp.js";import"./Upload01-DruP7_KV.js";import"./Users01-N436STOJ.js";import"./X-B1W1F4mo.js";import"./Zap-Dvtyg5Ik.js";import"./label-6YORzGJ9.js";import"./alert-dialog-B2k_N3ZX.js";import"./index-DxJD6aw-.js";import"./sidebar-DawbXHdj.js";const Bt=he({scopes:De(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Gt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Bt}];function Wt(s){const e=P.c(46),{instance:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i}=s;let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const l=be(c),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",d=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==d?(h=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",d),e[2]=d,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==i?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>i(n,"active"),children:[t.jsx(it,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>i(n,"inactive"),title:"Disable",children:t.jsx(at,{size:13})}),e[20]=n,e[21]=p,e[22]=i,e[23]=T):T=e[23];let C;e[24]!==n||e[25]!==a?(C=()=>a(n),e[24]=n,e[25]=a,e[26]=C):C=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Se,{size:13}),e[27]=y):y=e[27];let I;e[28]!==C?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:C,title:"Configure",children:y}),e[28]=C,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ae,{size:13}),e[33]=k):k=e[33];let S;e[34]!==_?(S=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=S):S=e[35];let f;e[36]!==I||e[37]!==S||e[38]!==N||e[39]!==T?(f=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,S]}),e[36]=I,e[37]=S,e[38]=N,e[39]=T,e[40]=f):f=e[40];let w;return e[41]!==f||e[42]!==h||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:h,children:[g,j,f]}),e[41]=f,e[42]=h,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function Xt(s){const e=P.c(15),{instance:n,onConfigure:a}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=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 i;e[5]!==n||e[6]!==a?(i=()=>a(n),e[5]=n,e[6]=a,e[7]=i):i=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 l;e[9]!==i?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,title:"Configure",children:c})}),e[9]=i,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function qt(s){const e=P.c(27),{instances:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i,onAdd:c,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(ot,{size:13}),e[2]=l,e[3]=p):p=e[3];let d;e[4]!==l||e[5]!==c||e[6]!==p?(d=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:c,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=c,e[6]=p,e[7]=d):d=e[7];let h;e[8]!==x||e[9]!==d?(h=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,d]}),e[8]=x,e[9]=d,e[10]=h):h=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==a||e[14]!==o||e[15]!==i){let j;e[17]!==r||e[18]!==a||e[19]!==o||e[20]!==i?(j=N=>t.jsx(q.Suspense,{fallback:t.jsx(Xt,{instance:N,onConfigure:a}),children:t.jsx(Wt,{instance:N,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i})},N.id),e[17]=r,e[18]=a,e[19]=o,e[20]=i,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=a,e[14]=o,e[15]=i,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==h||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[h,v]}),e[24]=h,e[25]=v,e[26]=b):b=e[26],b}const Kt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Qt(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 Jt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Yt(s){const e=P.c(1),{connectionId:n,orgId:a,timeframe:r}=s,o=wt(),i=Qt(r),{data:c}=$e({queryKey:ne.connectionActivity(n,r,a),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:i.startDate.toISOString(),endDate:i.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=vt(c?.logs??[],i),u=l.data,x=l.totalCalls>0;let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=p):p=e[0],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:l.totalCalls.toLocaleString()}),p]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(bt,{config:Jt,className:"h-16 w-full",children:t.jsxs(Nt,{data:u,barCategoryGap:"4%",children:[t.jsx(yt,{content:t.jsx(_t,{labelFormatter:es}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Zt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.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 Zt(s,e){return t.jsx(Ct,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function es(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ts(){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 ss(s){const e=P.c(13),{connectionId:n}=s,[a,r]=q.useState("14d"),{org:o}=J();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=i):i=e[0];let c;e[1]!==a?(c=Kt.map(d=>t.jsx("button",{type:"button",onClick:()=>r(d.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===d.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:d.label},d.value)),e[1]=a,e[2]=c):c=e[2];let l;e[3]!==c?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[i,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ts,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==a?(x=t.jsx(q.Suspense,{fallback:u,children:t.jsx(Yt,{connectionId:n,orgId:o.id,timeframe:a})}),e[6]=n,e[7]=o.id,e[8]=a,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function ns(s){const e=P.c(15),{virtualMcp:n,org:a}=s,r=Y();let o;e[0]!==r||e[1]!==a||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:a,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=a,e[2]=n.id,e[3]=o):o=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(we,{size:16}),e[4]=i):i=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:i}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==c||e[13]!==l?(x=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,l,u]}),e[11]=o,e[12]=c,e[13]=l,e[14]=x):x=e[14],x}function os(s){const e=P.c(7),{virtualMcps:n,org:a}=s;let r;if(e[0]!==a||e[1]!==n){let i;e[3]!==a?(i=c=>t.jsx(ns,{virtualMcp:c,org:a},c.id),e[3]=a,e[4]=i):i=e[4],r=n.map(i),e[0]=a,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function is(s){const e=P.c(7),{connection:n}=s,{org:a}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=kt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}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 l;return e[4]!==a.slug||e[5]!==o?(l=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(os,{virtualMcps:o,org:a.slug})})]}),e[4]=a.slug,e[5]=o,e[6]=l):l=e[6],l}function as(s){const e=P.c(31),{tools:n,connectionId:a,org:r}=s,o=Y(),{org:i}=J();let c;e[0]!==a||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=a,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const l=_e(c),u=Ne(a);let x;e[4]!==u||e[5]!==a?(x=u?ke(u):a,e[4]=u,e[5]=a,e[6]=x):x=e[6];const p=x,[d,h]=q.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==d||e[12]!==n){const C=(n??[]).filter(rs),y=d.toLowerCase().trim(),I=y?C.filter(f=>f.name.toLowerCase().includes(y)||f.description&&f.description.toLowerCase().includes(y)):C;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=f=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(f.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=f=>{f.key==="Escape"&&(h(""),f.target.blur())},e[21]=S):S=e[21],e[22]!==d?(j=t.jsx(Pt,{value:d,onChange:h,placeholder:"Search apps...",onKeyDown:S}),e[22]=d,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:d?"No apps found":"No apps available",description:d?"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:I.map(f=>{const w=re(f._meta);return t.jsxs(Ot,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(f),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx($t,{resourceURI:w,toolInfo:{tool:f},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),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:f.name}),t.jsx(Qe,{annotations:f.annotations,_meta:f._meta})]}),f.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.description})]})]},f.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=d,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 N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function rs(s){return!!re(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=i=>i.charAt(0).toUpperCase()+i.slice(1),a=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&a.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let a;return e[0]!==n?(a=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]=a):a=e[1],a}function ls(s){const e=P.c(50),{tools:n,prompts:a,resources:r,connectionId:o,org:i}=s;let c;e[0]!==a?(c=a===void 0?[]:a,e[0]=a,e[1]=c):c=e[1];const l=c;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),d=Ne(o??"");let h;e[4]!==d||e[5]!==o?(h=d?ke(d):o,e[4]=d,e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==i?(v=function(D){!o||!i||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(D)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=i,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==i||e[14]!==n?(j=o&&i&&n.some(ms),e[12]=o,e[13]=i,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=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]=m):m=e[16],m}let C;e[17]!==n.length?(C=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=C):C=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==C||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Tt,{variant:"underline",className:"gap-1",children:[C,y,I,_]})}),e[23]=C,e[24]=y,e[25]=k):k=e[25];let S;e[26]!==b||e[27]!==n?(S=n.length>0?n.map(m=>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(m.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(Dt,{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(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=S):S=e[28];let f;e[29]!==S?(f=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[29]=S,e[30]=f):f=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==i||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(as,{tools:n,connectionId:o,org:i})}),e[31]=o,e[32]=N,e[33]=i,e[34]=n,e[35]=w):w=e[35];let z;e[36]!==l?(z=l.length>0?l.map(ds):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=z):z=e[37];let O;e[38]!==z?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[38]=z,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(cs):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let M;e[42]!==A?(M=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=M):M=e[43];let U;return e[44]!==k||e[45]!==f||e[46]!==w||e[47]!==O||e[48]!==M?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(It,{defaultValue:"tools",variant:"underline",children:[k,f,w,O,M]})}),e[44]=k,e[45]=f,e[46]=w,e[47]=O,e[48]=M,e[49]=U):U=e[49],U}function cs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(rt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children: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 ds(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(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(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 ms(s){return re(s._meta)}function us(s){const e=P.c(13),{connection:n,displayTitle:a}=s,r=a??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let i;e[3]!==r?(i=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:r})}),e[3]=r,e[4]=i):i=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 l;e[7]!==i||e[8]!==c?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=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,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function xs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:a,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),i=ce({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),l=(()=>{if(typeof i!="string"||!i)return!1;try{const d=new URL(i);return d.hostname==="api.githubcopilot.com"&&d.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=c||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"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(L,{control:s.control,name:"ui_type",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{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(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{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(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(W,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Rt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(lt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(G,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(W,{placeholder:"node, bun, python...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(W,{placeholder:"arg1 arg2 --flag value",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(G,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(W,{placeholder:"/path/to/project (optional)",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(He,{value:d.value??[],onChange:d.onChange})}),t.jsx(G,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:d})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Mt,{children:[t.jsx(Et,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{variant:"success",className:"gap-1.5",children:[t.jsx(Ut,{size:12}),"Authenticated via OAuth",t.jsx(Ft,{size:12})]})})}),t.jsxs(Vt,{align:"start",children:[t.jsxs(de,{onClick:a,children:[t.jsx(Lt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(ae,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&d.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:()=>d.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(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(W,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(pt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(G,{})]})})]})}function ps(s){return s.command==="npx"}function fs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function hs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(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 a=s.connection_headers,r=Ge(a.envVars);if(ps(a)){const i=fs(a);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:i,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=hs(a);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:r}}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 gs(s){let e,n=null,a=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=We(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Xe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",a=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...a&&{connection_token:a},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function js({connection:s,connectionId:e,org:n,isUpdating:a,tools:r,prompts:o,resources:i,siblings:c}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),d=ht({onSuccess:()=>{c.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=q.useState(null),[v,b]=q.useState(!1),j=be({connectionId:e}),{data:N}=Je(),T=N?.data?.members??[],C=h??s,y=T.find(m=>m.userId===C.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},S=qe(k,Gt),f=Ue({resolver:Fe(Be),values:fe(h??s)}),w=f.formState.isDirty,z=async()=>{if(!await f.trigger())return;const D=f.getValues(),$=gs(D),F=h?.id??e;await x.update.mutateAsync({id:F,data:$}),f.reset(D)},O=()=>{f.reset(fe(h??s))},A=async m=>{const{token:D,tokenInfo:$,error:F}=await nt({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(F||!D){X.error(`Authentication failed: ${F}`);return}if($)try{const K=await fetch(`/api/${p.slug}/connections/${m}/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(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:D}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:D}})}else await x.update.mutateAsync({id:m,data:{connection_token:D}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),X.success("Authentication successful")},M=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const $=await m.text();X.error(`Failed to remove OAuth: ${$}`);return}const D=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(D.href,null)}),X.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),X.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(gt,{...d}),t.jsx(ct,{open:h!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(dt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(mt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(ut,{className:"text-base",children:h?.title??s.title}),t.jsx(xt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&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(Ye,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(ft,{...f,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(L,{control:f.control,name:"title",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Name"}),t.jsx(E,{children:t.jsx(W,{...m})}),t.jsx(G,{})]})}),t.jsx(L,{control:f.control,name:"description",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Description"}),t.jsx(E,{children:t.jsx(W,{...m,value:m.value||""})}),t.jsx(G,{})]})})]}),t.jsx(xs,{form:f,connection:h??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:M,onRemoveOAuth:U}),t.jsx(Ke,{connection:h??s,form:f,hasMcpBinding:S,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:M,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:z,disabled:!w||a,className:"flex-1",children:a?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=h??s;g(null),d.requestDelete(m)},children:[t.jsx(ae,{size:15}),"Delete"]})]})]},h?.id??s.id)]})}),t.jsx(jt,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(us,{connection:s,displayTitle:(()=>{const m=c[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.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(ss,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(qt,{instances:c,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>d.requestDelete(m),onToggleStatus:async(m,D)=>{try{await x.update.mutateAsync({id:m.id,data:{status:D}}),X.success(D==="active"?"Connection enabled":"Connection disabled")}catch{X.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=c[0]??s,D=m.title.replace(/\s*\(\d+\)\s*$/,""),$=c.length+1,F=`${D} (${$})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:F,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await st({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(is,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ls,{tools:r,prompts:o,resources:i,connectionId:e,org:n})})]})})]})})]})}function vs(){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 a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:r,org:o}=Me(a),{org:i}=J(),c=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=Ze(l),x=u[0]??null,p=x?.id??"",d=p||null;let h;s[4]!==i.id||s[5]!==i.slug||s[6]!==d?(h={connectionId:d,orgId:i.id,orgSlug:i.slug},s[4]=i.id,s[5]=i.slug,s[6]=d,s[7]=h):h=s[7];const g=_e(h);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=et(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(Cs):(x?.tools??[]).map(Ss);e:{if(u.length<=1){j=A;break e}const M=new Set,U=[],m=ys;for(const D of u){const $=D.id===p?A:m(D.tools);for(const F of $)M.has(F.name)||(M.add(F.name),U.push(F))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:C}=tt(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==C?.prompts?(_=C?.prompts??[],s[19]=C?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(Ns),s[21]=_,s[22]=k):k=s[22];const S=k;let f;s[23]!==I?.resources?(f=I?.resources??[],s[23]=I?.resources,s[24]=f):f=s[24];let w;s[25]!==f?(w=f.map(bs),s[25]=f,s[26]=w):w=s[26];const z=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==c.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==S||s[36]!==z||s[37]!==u?(O=t.jsx(js,{org:o,connection:x,connectionId:p,isUpdating:c.update.isPending,tools:N,prompts:S,resources:z,siblings:u}),s[30]=c.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=S,s[36]=z,s[37]=u,s[38]=O):O=s[38],O}function bs(s){return{name:s.name,description:s.description,uri:s.uri}}function Ns(s){return{name:s.name,description:s.description}}function ys(s){return(s??[]).map(_s)}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Cs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ze,{children:t.jsx(q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(vs,{})})}),s[0]=e):e=s[0],e}function uo(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ws,{}),s[0]=e):e=s[0],e}export{uo as default};
@@ -1 +1 @@
1
- import{P as H,aG as A,b7 as I,R as a,aE as j,aF as z,e as L,j as u,B as C}from"./index-Dv-yFpKM.js";import{I as R}from"./input-B16LqKMQ.js";import{s as W}from"./Plus-DcxLSicT.js";import{s as q}from"./Trash01-rpak8qu1.js";const K=H({key:a().min(1,"Key is required"),value:a()}),M=H({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(R,{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(R,{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 F(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 D(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,M as c,Z as d,Y as i,D as p,F as r};
1
+ import{P as H,aG as A,b7 as I,R as a,aE as j,aF as z,e as L,j as u,B as C}from"./index-uVHAmIsb.js";import{I as R}from"./input-BYcDxHNs.js";import{s as W}from"./Plus-aXWGGcSy.js";import{s as q}from"./Trash01-DBSukaq0.js";const K=H({key:a().min(1,"Key is required"),value:a()}),M=H({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(R,{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(R,{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 F(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 D(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,M as c,Z as d,Y as i,D as p,F as r};
@@ -1 +1 @@
1
- import{e as ce,j as t,E as tt,r as X,l as le,p as ke,f as De,d as nt,b as Ae,u as st,o as ot,L as it,G as at,H as ct,B as M,t as ne,F as rt,c as de,n as W,K as lt}from"./index-Dv-yFpKM.js";import{g as dt}from"./generate-id-BYzu1jEq.js";import{C as mt}from"./collection-display-button-CTi0VUGU.js";import{S as ut}from"./search-input-nds5g8eq.js";import{C as pt}from"./collection-tabs-zuvlZo6K.js";import{u as ht,a as we,g as xt,C as ve}from"./connection-card-BryVkZk7.js";import{E as gt}from"./empty-state-Wjey2haZ.js";import{I as ft}from"./integration-icon-7cYHs9rV.js";import{P as pe}from"./index-CfhwhmtA.js";import{u as jt,D as yt}from"./use-delete-connection-CWxG7WKN.js";import{u as Ce}from"./use-capability-Bw0k887i.js";import{u as Ct}from"./use-infinite-scroll-D4S3aGR5.js";import{u as vt}from"./use-list-state-Cx82QFu_.js";import{g as Te,a as _t,e as bt}from"./extract-connection-data-BUZFKLkD.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Le,f as Oe,e as $e,g as ze,a as Ee,A as Me}from"./alert-dialog-DUUnhBc6.js";import{C as Fe}from"./checkbox-C1s8UE6Y.js";import{D as Ve,a as Be,b as Ue,c as He,e as Re,d as Ke}from"./dialog-dItkri_7.js";import{b as St,a as Nt,c as kt,D as Dt,d as At,e as wt,f as Tt}from"./drawer-CiKI2xvg.js";import{u as It}from"./tooltip-DyNW-AXf.js";import{D as We,a as Xe,b as qe,c as ae}from"./dropdown-menu-DA6--pO3.js";import{F as Y,b as J,c as Z,d as ee,f as te,a as Se}from"./form-BvrZIBZy.js";import{I as ie}from"./input-B16LqKMQ.js";import{d as Pt,S as Lt,a as Ot,b as $t,c as re}from"./select-CXfOBpVA.js";import{T as zt}from"./textarea-Dc7UpW7V.js";import{b as Ge,u as Et}from"./use-connection-XtO-eFJi.js";import{a as Mt}from"./use-virtual-mcp-DLQJqd7d.js";import{i as Ft,a as Vt}from"./mcp-oauth-BoL_9gDY.js";import{u as Bt}from"./studio-tools-DP4PwlLL.js";import{S as Ut,a5 as Ht,u as Rt,r as Kt}from"./agent-icon-BrUPk7cd.js";import{n as ge}from"./Container-C41D-bwR.js";import{i as Qe}from"./DotsVertical-DimB1qZR.js";import{s as Ye}from"./Eye-CFpoJQMe.js";import{s as ye}from"./Star01-BVQUiqS1.js";import{s as Je}from"./Plus-DcxLSicT.js";import{s as Ze}from"./Trash01-rpak8qu1.js";import{s as et}from"./XClose-DOt_DYPz.js";import{i as he,a as Ne,E as Wt,c as Xt,p as qt,b as Gt,d as Qt}from"./connection-form-helpers-C9SsVHwd.js";import"./collections-Dg2-DQoz.js";import"./SwitchHorizontal01-qUOmQUUG.js";import"./Check-CNRVH6xs.js";import"./view-mode-toggle-D_5X7-ae.js";import"./badge-CGZjMX2o.js";import"./SearchMd-2GibIebB.js";import"./use-registry-connections-CAyIHNjF.js";import"./use-mcp-client-C8ZwZB20.js";import"./auth-DTxUlSLU.js";import"./use-organization-settings-CCLHoFg6.js";import"./useInfiniteQuery-G_6i7LOo.js";import"./card-BlzflWCA.js";import"./sidebar-nhuTSqFS.js";import"./LayoutLeft-BG08KNqc.js";import"./sheet-DwJxE17f.js";import"./X-DxE022Fo.js";import"./use-view-mode-BRITAZ4S.js";import"./ChevronRight-DixPnH3V.js";import"./label-DfTmRnMe.js";import"./ChevronDown-BKkz3Gyp.js";import"./ChevronUp-BeDEmrn1.js";import"./use-collections-DGD5HYrs.js";import"./AlertCircle-asB0zjf2.js";import"./Tool01-DNz0OMpT.js";import"./RefreshCcw01-Dd5D2uNm.js";import"./XCircle-B_UH_gQt.js";import"./ArrowUpRight-DRnt_VKh.js";import"./ZapSquare-Dz4Qok6x.js";import"./Users03-B9AqN8LK.js";import"./CheckCircle-B7v5_MG4.js";import"./ChevronLeft-DkMFugke.js";import"./ZoomOut-BkCtUzuC.js";import"./Globe01-CxF-Z8O2.js";import"./FilterLines-htpqKUqo.js";import"./Palette-D9_6t0uI.js";import"./HardDrive-TXw7C9gB.js";import"./Stars02-BFz8RQ16.js";import"./Key01-CDAkGspz.js";import"./LinkExternal01-AylVRyuU.js";import"./Monitor01-gdKmZQTW.js";import"./Sun-DMcKqqHE.js";import"./Play-aa6uUei5.js";import"./Settings02-D0kdZjJD.js";import"./Shield01-CpxvRW7h.js";import"./Stars01-B2PA7s4d.js";import"./Upload01-d_Wyw7QT.js";import"./User01-BWllfXHj.js";import"./Users01-DG6YdAo1.js";import"./Zap-CyMJw7DY.js";function Yt(v){const e=ce.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:l}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const g=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const x=y,S=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(N={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=N):N=e[13];let c;e[14]!==g||e[15]!==n.connections||e[16]!==p||e[17]!==l||e[18]!==m||e[19]!==u?(c=()=>u?(()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.id)})():p(),e[14]=g,e[15]=n.connections,e[16]=p,e[17]=l,e[18]=m,e[19]=u,e[20]=c):c=e[20];const j=u&&g&&"ring-2 ring-primary",d=u&&x&&!g&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=de(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==g||e[26]!==n.connections||e[27]!==l||e[28]!==m||e[29]!==u||e[30]!==x?(D=u?t.jsx(Fe,{checked:g?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.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]=g,e[26]=n.connections,e[27]=l,e[28]=m,e[29]=u,e[30]=x,e[31]=D):D=e[31];const U=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==U?(F=de("overflow-hidden transition-all duration-150 ease-out",U),e[32]=U,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Zt,children:t.jsx(Qe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Ye,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(We,{children:[s,t.jsx(qe,{align:"end",onClick:Jt,children:t.jsxs(ae,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==c||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:N,onClick:c,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=c,e[49]=k,e[50]=B):B=e[50],B}function Jt(v){return v.stopPropagation()}function Zt(v){return v.stopPropagation()}function en(v){const e=ce.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:l,onDeselectAll:h,onDelete:g,onAddToAgent:y,onToggleStatus:x,onCancel:S}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let c;e[2]!==n||e[3]!==h||e[4]!==l||e[5]!==p?(c=n<p?t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:["Select all (",p,")"]}):t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=l,e[5]=p,e[6]=c):c=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Je,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==g||e[12]!==x?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("active"),children:"Enable"}),t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("inactive"),children:"Disable"}),t.jsxs(M,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[t.jsx(Ze,{size:13}),"Delete"]})]}),e[10]=u,e[11]=g,e[12]=x,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(et,{size:13}),e[14]=k):k=e[14];let _;e[15]!==S?(_=t.jsx(M,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:S,children:k}),e[15]=S,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==c||e[19]!==j||e[20]!==d||e[21]!==_?(D=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:[N,c,j,d,_]})}),e[17]=N,e[18]=c,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function tn(v){const e=ce.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[l,h]=X.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(Ue,{children:[t.jsx(He,{children:"Add to Agent"}),t.jsx(Re,{children:"Select an agent to add the selected connections to."})]}),e[0]=g):g=e[0];let y;e[1]!==u||e[2]!==l?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",l===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(ft,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=l,e[3]=y):y=e[3];let x;e[4]!==y?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=x):x=e[5];let S;e[6]!==p?(S=t.jsx(M,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=S):S=e[7];const N=!l;let c;e[8]!==m||e[9]!==p||e[10]!==l?(c=()=>{l&&(m(l),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=l,e[11]=c):c=e[11];let j;e[12]!==N||e[13]!==c?(j=t.jsx(M,{disabled:N,onClick:c,children:"Add"}),e[12]=N,e[13]=c,e[14]=j):j=e[14];let d;e[15]!==S||e[16]!==j?(d=t.jsxs(Ke,{children:[S,j]}),e[15]=S,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==x||e[19]!==d?(k=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[g,x,d]}),e[18]=x,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Ve,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function nn(v){const e=ce.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,l=u!==1?"s":"";let h;e[0]!==u||e[1]!==l?(h=t.jsxs(Ie,{children:["Delete ",u," connection",l,"?"]}),e[0]=u,e[1]=l,e[2]=h):h=e[2];const g=u!==1?"s":"";let y;e[3]!==g?(y=t.jsxs(Pe,{children:["This will permanently delete the selected connection",g,". This action cannot be undone."]}),e[3]=g,e[4]=y):y=e[4];let x;e[5]!==h||e[6]!==y?(x=t.jsxs(Le,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=x):x=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Oe,{children:"Cancel"}),e[8]=S):S=e[8];const N=u!==1?"s":"";let c;e[9]!==u||e[10]!==m||e[11]!==N?(c=t.jsxs($e,{children:[S,t.jsxs(ze,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=c):c=e[12];let j;e[13]!==x||e[14]!==c?(j=t.jsxs(Ee,{children:[x,c]}),e[13]=x,e[14]=c,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(Me,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function sn(v){return v._registryId?.includes("community-registry")===!0}function on(v){const e=ce.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:l,onNavigateConnected:h,onConnect:g}=v,[y,x]=X.useState(!1),[S,N]=X.useState(null);let c,j;e[0]!==m||e[1]!==n?(c=Te(n)??"",j=m.has(c),e[0]=m,e[1]=n,e[2]=c,e[3]=j):(c=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let U;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(U=n.server?.icons?.[0]?.src||_t(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=U):U=e[6];const F=U;let s;if(e[7]!==u||e[8]!==c){let b;e[10]!==c?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===c,e[10]=c,e[11]=b):b=e[11],s=u.filter(b),e[7]=u,e[8]=c,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=sn(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==g||e[20]!==h?(w=()=>{if(d){const b=A[0];b&&h(b);return}p&&L()},L=()=>{$?(N("connect"),x(!0)):g(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=g,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==g||e[25]!==S?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),x(!1),S==="connect"&&g(n),N(null)},e[23]=n,e[24]=g,e[25]=S,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let Q;e[31]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ge,{}),e[31]=Q):Q=e[31];let R;e[32]!==$||e[33]!==n._sourceIcon?(R=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=R):R=e[34];let q;e[35]!==p||e[36]!==l||e[37]!==L||e[38]!==d||e[39]!==n.id?(q=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(M,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:l!==null,onClick:b=>{b.stopPropagation(),L()},children:l===n.id?t.jsx(le,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=l,e[37]=L,e[38]=d,e[39]=n.id,e[40]=q):q=e[40];let i;e[41]!==R||e[42]!==q?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[R,q]}),e[41]=R,e[42]=q,e[43]=i):i=e[43];let f;e[44]!==w||e[45]!==i||e[46]!==P?(f=t.jsx(ve,{connection:P,fallbackIcon:Q,onClick:w,headerActionsAlwaysVisible:!0,headerActions:i}),e[44]=w,e[45]=i,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Le,{children:[t.jsx(Ie,{children:"Community MCP Server"}),t.jsx(Pe,{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[48]=O):O=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Oe,{children:"Cancel"}),e[49]=H):H=e[49];let z;e[50]!==C?(z=t.jsxs(Ee,{children:[O,t.jsxs($e,{children:[H,t.jsx(ze,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=z):z=e[51];let r;e[52]!==y||e[53]!==z?(r=t.jsx(Me,{open:y,onOpenChange:x,children:z}),e[52]=y,e[53]=z,e[54]=r):r=e[54];let I;return e[55]!==f||e[56]!==r?(I=t.jsxs(t.Fragment,{children:[f,r]}),e[55]=f,e[56]=r,e[57]=I):I=e[57],I}function an({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:l}=ke(),h=rt(),g=De(),{data:y}=Ae.useSession(),x=Ge(),S=Et(v),N=jt(),{granted:c}=Ce("connections:manage"),{granted:j}=Ce("agents:manage"),[d,k]=X.useState(new Set),_=d.size>0,[D,U]=X.useState(!1),[F,s]=X.useState(!1),[A,V]=X.useState(null),$=Mt(),w=S.filter(o=>!(n!=="ALL"&&o.connection_type!==n||p!=="ALL"&&o.status!==p)),L=xt(w),B=o=>{k(a=>{const E=new Set(a);return E.has(o)?E.delete(o):E.add(o),E})},C=()=>{k(new Set)},P=we(m,v.searchTerm),Q=P.items,R=Ct(P.loadMore,P.hasMore,P.isLoadingMore),q=new Set(S.filter(o=>o.app_name).map(o=>o.app_name)),i=u==="ALL"||m.some(o=>o.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?Q.filter(o=>{if(i!=="ALL"&&o._registryId!==i)return!1;if(f){const a=Te(o);if(a&&q.has(a))return!1}return!0}):[],H=e==="connected"||f?L:[],z=async o=>{if(!(!l||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:o.id,source:"connections_page"}),V(o.id);try{const a=bt(o,l.id,y.user.id,{remoteIndex:0}),E=a.connection_type==="STDIO",T=!!a.connection_url,G=E&&a.connection_headers&&typeof a.connection_headers=="object"&&"command"in a.connection_headers;if(!T&&!G){W.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await x.create.mutateAsync(a),_e=new URL(`/api/${l.slug}/mcp/${K}`,window.location.origin),be=await Ft({url:_e.href,token:null,orgId:l.id});if(be.supportsOAuth&&!be.isAuthenticated){const{token:ue,tokenInfo:oe,error:je}=await Vt({connectionId:K,orgSlug:l.slug,scope:"offline_access"});if(je||!ue){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:je??"no_token"}),W.error(`Authentication failed: ${je??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),oe)try{(await fetch(`/api/${l.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:oe.accessToken,refreshToken:oe.refreshToken,expiresIn:oe.expiresIn,scope:oe.scope,clientId:oe.clientId,clientSecret:oe.clientSecret,tokenEndpoint:oe.tokenEndpoint})})).ok?await x.update.mutateAsync({id:K,data:{}}):await x.update.mutateAsync({id:K,data:{connection_token:ue}})}catch{await x.update.mutateAsync({id:K,data:{connection_token:ue}})}else await x.update.mutateAsync({id:K,data:{connection_token:ue}});await h.invalidateQueries({queryKey:lt.isMCPAuthenticated(_e.href,null)}),W.success("Authentication successful")}}W.success("Connected successfully")}catch(a){W.error(`Failed to connect: ${a instanceof Error?a.message:String(a)}`)}finally{V(null)}}},r=Bt(),I=()=>{h.invalidateQueries({predicate:o=>{const a=o.queryKey;return a[1]===l.id&&a[3]==="collection"&&a[4]==="CONNECTIONS"}})},b=async()=>{U(!1);const o=[...d];ne("connections_bulk_delete",{count:o.length});let a=0;for(const E of o)try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:E,force:!0}),a++}catch{}I(),W.success(`Deleted ${a} connection${a!==1?"s":""}`),C()},se=async(o,a)=>{try{await x.update.mutateAsync({id:o,data:{status:a}}),I(),W.success(a==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},fe=async o=>{const a=[...d];ne("connections_bulk_status_toggled",{count:a.length,to_status:o});let E=0;for(const T of a)try{await x.update.mutateAsync({id:T,data:{status:o}}),E++}catch{}I(),W.success(`${o==="active"?"Enabled":"Disabled"} ${E} connection${E!==1?"s":""}`),C()},me=async o=>{const a=$.find(G=>G.id===o);if(!a)return;ne("connections_bulk_add_to_agent",{agent_id:o,count:d.size});const E=new Set(a.connections.map(G=>G.connection_id)),T=[...d].filter(G=>!E.has(G)).map(G=>({connection_id:G,selected_tools:null,selected_resources:null,selected_prompts:null}));if(T.length===0){W.info("All selected connections are already in that agent");return}try{await r.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:o,data:{connections:[...a.connections,...T]}}),h.invalidateQueries({predicate:G=>{const K=G.queryKey;return K[1]===l.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),W.success(`Added ${T.length} connection${T.length!==1?"s":""} to "${a.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...N}),t.jsx(nn,{open:D,onOpenChange:U,count:d.size,onConfirm:b}),t.jsx(tn,{open:F,onOpenChange:s,agents:$,onConfirm:me}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:c?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(o=>{if(o.type==="group")return t.jsx(Yt,{group:o,onOpen:()=>{g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:o.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},o.key);const a=o.connection,E=d.has(a.id);return t.jsx(ve,{connection:a,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?B(a.id):g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),className:de(E&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:E,onCheckedChange:()=>B(a.id),onClick:T=>T.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(We,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:T=>T.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(qe,{align:"end",onClick:T=>T.stopPropagation(),children:[t.jsxs(ae,{onClick:T=>{T.stopPropagation(),g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}})},children:[t.jsx(Ye,{size:16}),"Open"]}),(c||j)&&t.jsxs(ae,{onClick:T=>{T.stopPropagation(),B(a.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),c&&(a.status==="active"?t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"inactive")},children:[t.jsx(Rt,{size:16}),"Disable"]}):t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"active")},children:[t.jsx(Kt,{size:16}),"Enable"]})),c&&t.jsxs(ae,{variant:"destructive",onClick:T=>{T.stopPropagation(),N.requestDelete(a)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})})]})},a.id)}),O.map(o=>t.jsx(on,{item:o,canManage:c,allConnections:S,connectedAppNames:q,connectingItemId:A,onNavigateConnected:a=>g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),onConnect:z},`catalog-${o._registryId}:${o.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(le,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(en,{count:d.size,total:w.length,canManage:c,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(o=>o.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>U(!0),onAddToAgent:()=>s(!0),onToggleStatus:fe,onCancel:C})]})}function cn(){const{org:v}=ke(),e=De(),n=nt({strict:!1}),{data:p}=Ae.useSession(),{stdioEnabled:u}=st(),m=It(),{granted:l}=Ce("connections:manage"),h=vt({namespace:v.slug,resource:"connections"}),g=Ge(),[y,x]=ot(it.connectionsTab(v.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[S,N]=X.useState("ALL"),[c,j]=X.useState("ALL"),[d,k]=X.useState("ALL"),_=ht(),U=we(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=at({resolver:ct(Xt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=he({uiType:A,connectionUrl:V??"",npxPackage:$??""})??Ne({uiType:A,connectionUrl:V??"",registryItems:U}),L=l&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async i=>{let f,O=null,H=null,z=null;i.ui_type==="NPX"?(f="STDIO",O="",z=Gt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(f="STDIO",O="",z=Qt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(f=i.ui_type,O=i.connection_url||"",H=i.connection_token||null);const r=dt("conn");ne("connection_custom_created",{connection_type:f,ui_type:i.ui_type}),await g.create.mutateAsync({id:r,title:i.title,description:i.description||null,connection_type:f,connection_url:O,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:z,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:xe({app_name:null,connection_url:O,title:i.title,id:r})}})},Q=i=>{i||(L&&C(),s.reset())},R=i=>{const f=i.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,z=!!s.formState.dirtyFields.env_vars,r=b=>{if(b&&(!O&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!z&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],fe=new Set(se.map(o=>o.key)),me=b.envVarKeys.filter(o=>!fe.has(o));me.length>0&&s.setValue("env_vars",[...se,...me.map(o=>({key:o,value:""}))],{shouldDirty:!0})}},I=qt(f);if(I&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",I.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),r(he({uiType:"NPX",npxPackage:I.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const b=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),r(he({uiType:b,connectionUrl:f})??Ne({uiType:b,connectionUrl:f,registryItems:U}));return}A==="NPX"&&r(he({uiType:"NPX",npxPackage:f}))},q=l?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(M,{variant:"outline",onClick:B,children:[t.jsx(Je,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const i="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Y,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Pt,{value:r.value,onValueChange:r.onChange,children:[t.jsx(ee,{children:t.jsx(Lt,{children:t.jsx(Ot,{})})}),t.jsxs($t,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(Y,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Y,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...r,value:r.value??""})}),t.jsx(te,{})]})}),t.jsx(Y,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...r,value:r.value??""})}),t.jsx(te,{})]})})]}),t.jsx(Y,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...r,value:r.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(Y,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Wt,{value:r.value??[],onChange:r.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{control:s.control,name:"connection_url",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(Y,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...r,value:r.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(Y,{control:s.control,name:"title",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...r})}),t.jsx(te,{})]})}),t.jsx(Y,{control:s.control,name:"description",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(zt,{placeholder:"A brief description of this connection",rows:3,...r,value:r.value??""})}),t.jsx(te,{})]})})]}),z=L;return m?t.jsx(St,{open:z,onOpenChange:Q,children:t.jsxs(Nt,{className:"max-h-[90vh]",children:[t.jsx(kt,{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(Dt,{children:i}),t.jsx(At,{className:"mt-1",children:f})]}),t.jsx(wt,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(et,{size:16})})})]})}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(Tt,{children:t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Ve,{open:z,onOpenChange:Q,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(Ue,{children:[t.jsx(He,{children:i}),t.jsx(Re,{children:f})]}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Ke,{children:[t.jsx(M,{type:"button",variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.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(ut,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(h.setSearch(""),i.target.blur())}}),t.jsx(mt,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.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:S,onChange:i=>N(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:c,onChange:i=>j(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:i=>k(i||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),q]}),t.jsx(pt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:i=>{const f=i;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),x(f)}}),t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(an,{listState:h,activeTab:y,typeFilter:S,statusFilter:c,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function Us(){const v=ce.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(cn,{})})}),v[0]=e):e=v[0],e}export{Us as default};
1
+ import{e as ce,j as t,E as tt,r as X,l as le,p as ke,f as De,d as nt,b as Ae,u as st,o as ot,L as it,G as at,H as ct,B as M,t as ne,F as rt,c as de,n as W,K as lt}from"./index-uVHAmIsb.js";import{g as dt}from"./generate-id-C7CxZwCs.js";import{C as mt}from"./collection-display-button-ve31YRQs.js";import{S as ut}from"./search-input-BfizHALq.js";import{C as pt}from"./collection-tabs-CAVXo49Z.js";import{u as ht,a as we,g as xt,C as ve}from"./connection-card-aeOBPbSz.js";import{E as gt}from"./empty-state-BKLgisam.js";import{I as ft}from"./integration-icon-YIddy6rU.js";import{P as pe}from"./index-DxJD6aw-.js";import{u as jt,D as yt}from"./use-delete-connection-DOqJ3DYp.js";import{u as Ce}from"./use-capability-BcwY0Lf1.js";import{u as Ct}from"./use-infinite-scroll-Ce2zTY3i.js";import{u as vt}from"./use-list-state-B6GtGz_i.js";import{g as Te,a as _t,e as bt}from"./extract-connection-data-Dz_jOB39.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Le,f as Oe,e as $e,g as ze,a as Ee,A as Me}from"./alert-dialog-B2k_N3ZX.js";import{C as Fe}from"./checkbox-BKpSRHdU.js";import{D as Ve,a as Be,b as Ue,c as He,e as Re,d as Ke}from"./dialog-BwBYyWWk.js";import{b as St,a as Nt,c as kt,D as Dt,d as At,e as wt,f as Tt}from"./drawer-QIeXv6B7.js";import{u as It}from"./tooltip-C_pZvUmA.js";import{D as We,a as Xe,b as qe,c as ae}from"./dropdown-menu-CL4WEQRf.js";import{F as Y,b as J,c as Z,d as ee,f as te,a as Se}from"./form-Z86e6etr.js";import{I as ie}from"./input-BYcDxHNs.js";import{d as Pt,S as Lt,a as Ot,b as $t,c as re}from"./select-DpIv2m7o.js";import{T as zt}from"./textarea-pwpin7Xo.js";import{b as Ge,u as Et}from"./use-connection-Cd3-MJT5.js";import{a as Mt}from"./use-virtual-mcp-Clsr41cX.js";import{i as Ft,a as Vt}from"./mcp-oauth-Bqzn0Dif.js";import{u as Bt}from"./studio-tools-Bsqb-6Fx.js";import{S as Ut,a5 as Ht,u as Rt,r as Kt}from"./agent-icon-CCGqC-bl.js";import{n as ge}from"./Container-Hfp9SJFa.js";import{i as Qe}from"./DotsVertical-Cz5MZln-.js";import{s as Ye}from"./Eye-BIZqMr-y.js";import{s as ye}from"./Star01-pwvCfpNJ.js";import{s as Je}from"./Plus-aXWGGcSy.js";import{s as Ze}from"./Trash01-DBSukaq0.js";import{s as et}from"./XClose-r0gXvFlp.js";import{i as he,a as Ne,E as Wt,c as Xt,p as qt,b as Gt,d as Qt}from"./connection-form-helpers-C2pw-OdH.js";import"./collections-Cs_tB6Xp.js";import"./SwitchHorizontal01-Blia-yUi.js";import"./Check-D7HZW6oZ.js";import"./view-mode-toggle-CnJNM_yP.js";import"./badge-DIN7Nq6a.js";import"./SearchMd-Cr6CluRw.js";import"./use-registry-connections-Bdnyk0np.js";import"./use-mcp-client-Bqv2ciYo.js";import"./auth-ClbRbdVv.js";import"./use-organization-settings-CdYVljPu.js";import"./useInfiniteQuery-CL1ZPxL1.js";import"./card-ykuj7mlf.js";import"./sidebar-DawbXHdj.js";import"./LayoutLeft-CY1OP6dH.js";import"./sheet-J3PJeFDK.js";import"./X-B1W1F4mo.js";import"./use-view-mode-BmgcQL7Y.js";import"./ChevronRight-3jD7TdJZ.js";import"./label-6YORzGJ9.js";import"./ChevronDown-CxTVikeq.js";import"./ChevronUp-Dbc77Gwp.js";import"./use-collections-CNY4Rigp.js";import"./AlertCircle-DjOU_aot.js";import"./Tool01-DC4THSlP.js";import"./RefreshCcw01-DS1vtLKW.js";import"./XCircle-BtUzMyFW.js";import"./ArrowUpRight-BXJMGk9i.js";import"./ZapSquare-BQX2HOTP.js";import"./Users03-DiilXFZ6.js";import"./CheckCircle-XS4dmEOs.js";import"./ChevronLeft-BEmN2X52.js";import"./ZoomOut-DC46Ewts.js";import"./Globe01-CiCGKTg3.js";import"./FilterLines-iroXgkwP.js";import"./Palette-BDd6wxPD.js";import"./HardDrive-B26C8dI3.js";import"./Stars02-vcxNwhIa.js";import"./Key01-DZeJDklU.js";import"./LinkExternal01-DwxMIV-o.js";import"./Monitor01-_FIjo4ge.js";import"./Sun-De2vWRC7.js";import"./Play-C933mY5z.js";import"./Settings02-DeH66RiM.js";import"./Shield01-0kTDalL_.js";import"./Stars01-Bw7_Rdwp.js";import"./Upload01-DruP7_KV.js";import"./User01-Bweqikx-.js";import"./Users01-N436STOJ.js";import"./Zap-Dvtyg5Ik.js";function Yt(v){const e=ce.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:l}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const g=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const x=y,S=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(N={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=N):N=e[13];let c;e[14]!==g||e[15]!==n.connections||e[16]!==p||e[17]!==l||e[18]!==m||e[19]!==u?(c=()=>u?(()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.id)})():p(),e[14]=g,e[15]=n.connections,e[16]=p,e[17]=l,e[18]=m,e[19]=u,e[20]=c):c=e[20];const j=u&&g&&"ring-2 ring-primary",d=u&&x&&!g&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=de(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==g||e[26]!==n.connections||e[27]!==l||e[28]!==m||e[29]!==u||e[30]!==x?(D=u?t.jsx(Fe,{checked:g?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.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]=g,e[26]=n.connections,e[27]=l,e[28]=m,e[29]=u,e[30]=x,e[31]=D):D=e[31];const U=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==U?(F=de("overflow-hidden transition-all duration-150 ease-out",U),e[32]=U,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Zt,children:t.jsx(Qe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Ye,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(We,{children:[s,t.jsx(qe,{align:"end",onClick:Jt,children:t.jsxs(ae,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==c||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:N,onClick:c,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=c,e[49]=k,e[50]=B):B=e[50],B}function Jt(v){return v.stopPropagation()}function Zt(v){return v.stopPropagation()}function en(v){const e=ce.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:l,onDeselectAll:h,onDelete:g,onAddToAgent:y,onToggleStatus:x,onCancel:S}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let c;e[2]!==n||e[3]!==h||e[4]!==l||e[5]!==p?(c=n<p?t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:["Select all (",p,")"]}):t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=l,e[5]=p,e[6]=c):c=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Je,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==g||e[12]!==x?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("active"),children:"Enable"}),t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("inactive"),children:"Disable"}),t.jsxs(M,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[t.jsx(Ze,{size:13}),"Delete"]})]}),e[10]=u,e[11]=g,e[12]=x,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(et,{size:13}),e[14]=k):k=e[14];let _;e[15]!==S?(_=t.jsx(M,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:S,children:k}),e[15]=S,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==c||e[19]!==j||e[20]!==d||e[21]!==_?(D=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:[N,c,j,d,_]})}),e[17]=N,e[18]=c,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function tn(v){const e=ce.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[l,h]=X.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(Ue,{children:[t.jsx(He,{children:"Add to Agent"}),t.jsx(Re,{children:"Select an agent to add the selected connections to."})]}),e[0]=g):g=e[0];let y;e[1]!==u||e[2]!==l?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",l===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(ft,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=l,e[3]=y):y=e[3];let x;e[4]!==y?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=x):x=e[5];let S;e[6]!==p?(S=t.jsx(M,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=S):S=e[7];const N=!l;let c;e[8]!==m||e[9]!==p||e[10]!==l?(c=()=>{l&&(m(l),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=l,e[11]=c):c=e[11];let j;e[12]!==N||e[13]!==c?(j=t.jsx(M,{disabled:N,onClick:c,children:"Add"}),e[12]=N,e[13]=c,e[14]=j):j=e[14];let d;e[15]!==S||e[16]!==j?(d=t.jsxs(Ke,{children:[S,j]}),e[15]=S,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==x||e[19]!==d?(k=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[g,x,d]}),e[18]=x,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Ve,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function nn(v){const e=ce.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,l=u!==1?"s":"";let h;e[0]!==u||e[1]!==l?(h=t.jsxs(Ie,{children:["Delete ",u," connection",l,"?"]}),e[0]=u,e[1]=l,e[2]=h):h=e[2];const g=u!==1?"s":"";let y;e[3]!==g?(y=t.jsxs(Pe,{children:["This will permanently delete the selected connection",g,". This action cannot be undone."]}),e[3]=g,e[4]=y):y=e[4];let x;e[5]!==h||e[6]!==y?(x=t.jsxs(Le,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=x):x=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Oe,{children:"Cancel"}),e[8]=S):S=e[8];const N=u!==1?"s":"";let c;e[9]!==u||e[10]!==m||e[11]!==N?(c=t.jsxs($e,{children:[S,t.jsxs(ze,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=c):c=e[12];let j;e[13]!==x||e[14]!==c?(j=t.jsxs(Ee,{children:[x,c]}),e[13]=x,e[14]=c,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(Me,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function sn(v){return v._registryId?.includes("community-registry")===!0}function on(v){const e=ce.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:l,onNavigateConnected:h,onConnect:g}=v,[y,x]=X.useState(!1),[S,N]=X.useState(null);let c,j;e[0]!==m||e[1]!==n?(c=Te(n)??"",j=m.has(c),e[0]=m,e[1]=n,e[2]=c,e[3]=j):(c=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let U;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(U=n.server?.icons?.[0]?.src||_t(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=U):U=e[6];const F=U;let s;if(e[7]!==u||e[8]!==c){let b;e[10]!==c?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===c,e[10]=c,e[11]=b):b=e[11],s=u.filter(b),e[7]=u,e[8]=c,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=sn(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==g||e[20]!==h?(w=()=>{if(d){const b=A[0];b&&h(b);return}p&&L()},L=()=>{$?(N("connect"),x(!0)):g(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=g,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==g||e[25]!==S?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),x(!1),S==="connect"&&g(n),N(null)},e[23]=n,e[24]=g,e[25]=S,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let Q;e[31]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ge,{}),e[31]=Q):Q=e[31];let R;e[32]!==$||e[33]!==n._sourceIcon?(R=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=R):R=e[34];let q;e[35]!==p||e[36]!==l||e[37]!==L||e[38]!==d||e[39]!==n.id?(q=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(M,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:l!==null,onClick:b=>{b.stopPropagation(),L()},children:l===n.id?t.jsx(le,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=l,e[37]=L,e[38]=d,e[39]=n.id,e[40]=q):q=e[40];let i;e[41]!==R||e[42]!==q?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[R,q]}),e[41]=R,e[42]=q,e[43]=i):i=e[43];let f;e[44]!==w||e[45]!==i||e[46]!==P?(f=t.jsx(ve,{connection:P,fallbackIcon:Q,onClick:w,headerActionsAlwaysVisible:!0,headerActions:i}),e[44]=w,e[45]=i,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Le,{children:[t.jsx(Ie,{children:"Community MCP Server"}),t.jsx(Pe,{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[48]=O):O=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Oe,{children:"Cancel"}),e[49]=H):H=e[49];let z;e[50]!==C?(z=t.jsxs(Ee,{children:[O,t.jsxs($e,{children:[H,t.jsx(ze,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=z):z=e[51];let r;e[52]!==y||e[53]!==z?(r=t.jsx(Me,{open:y,onOpenChange:x,children:z}),e[52]=y,e[53]=z,e[54]=r):r=e[54];let I;return e[55]!==f||e[56]!==r?(I=t.jsxs(t.Fragment,{children:[f,r]}),e[55]=f,e[56]=r,e[57]=I):I=e[57],I}function an({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:l}=ke(),h=rt(),g=De(),{data:y}=Ae.useSession(),x=Ge(),S=Et(v),N=jt(),{granted:c}=Ce("connections:manage"),{granted:j}=Ce("agents:manage"),[d,k]=X.useState(new Set),_=d.size>0,[D,U]=X.useState(!1),[F,s]=X.useState(!1),[A,V]=X.useState(null),$=Mt(),w=S.filter(o=>!(n!=="ALL"&&o.connection_type!==n||p!=="ALL"&&o.status!==p)),L=xt(w),B=o=>{k(a=>{const E=new Set(a);return E.has(o)?E.delete(o):E.add(o),E})},C=()=>{k(new Set)},P=we(m,v.searchTerm),Q=P.items,R=Ct(P.loadMore,P.hasMore,P.isLoadingMore),q=new Set(S.filter(o=>o.app_name).map(o=>o.app_name)),i=u==="ALL"||m.some(o=>o.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?Q.filter(o=>{if(i!=="ALL"&&o._registryId!==i)return!1;if(f){const a=Te(o);if(a&&q.has(a))return!1}return!0}):[],H=e==="connected"||f?L:[],z=async o=>{if(!(!l||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:o.id,source:"connections_page"}),V(o.id);try{const a=bt(o,l.id,y.user.id,{remoteIndex:0}),E=a.connection_type==="STDIO",T=!!a.connection_url,G=E&&a.connection_headers&&typeof a.connection_headers=="object"&&"command"in a.connection_headers;if(!T&&!G){W.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await x.create.mutateAsync(a),_e=new URL(`/api/${l.slug}/mcp/${K}`,window.location.origin),be=await Ft({url:_e.href,token:null,orgId:l.id});if(be.supportsOAuth&&!be.isAuthenticated){const{token:ue,tokenInfo:oe,error:je}=await Vt({connectionId:K,orgSlug:l.slug,scope:"offline_access"});if(je||!ue){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:je??"no_token"}),W.error(`Authentication failed: ${je??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),oe)try{(await fetch(`/api/${l.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:oe.accessToken,refreshToken:oe.refreshToken,expiresIn:oe.expiresIn,scope:oe.scope,clientId:oe.clientId,clientSecret:oe.clientSecret,tokenEndpoint:oe.tokenEndpoint})})).ok?await x.update.mutateAsync({id:K,data:{}}):await x.update.mutateAsync({id:K,data:{connection_token:ue}})}catch{await x.update.mutateAsync({id:K,data:{connection_token:ue}})}else await x.update.mutateAsync({id:K,data:{connection_token:ue}});await h.invalidateQueries({queryKey:lt.isMCPAuthenticated(_e.href,null)}),W.success("Authentication successful")}}W.success("Connected successfully")}catch(a){W.error(`Failed to connect: ${a instanceof Error?a.message:String(a)}`)}finally{V(null)}}},r=Bt(),I=()=>{h.invalidateQueries({predicate:o=>{const a=o.queryKey;return a[1]===l.id&&a[3]==="collection"&&a[4]==="CONNECTIONS"}})},b=async()=>{U(!1);const o=[...d];ne("connections_bulk_delete",{count:o.length});let a=0;for(const E of o)try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:E,force:!0}),a++}catch{}I(),W.success(`Deleted ${a} connection${a!==1?"s":""}`),C()},se=async(o,a)=>{try{await x.update.mutateAsync({id:o,data:{status:a}}),I(),W.success(a==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},fe=async o=>{const a=[...d];ne("connections_bulk_status_toggled",{count:a.length,to_status:o});let E=0;for(const T of a)try{await x.update.mutateAsync({id:T,data:{status:o}}),E++}catch{}I(),W.success(`${o==="active"?"Enabled":"Disabled"} ${E} connection${E!==1?"s":""}`),C()},me=async o=>{const a=$.find(G=>G.id===o);if(!a)return;ne("connections_bulk_add_to_agent",{agent_id:o,count:d.size});const E=new Set(a.connections.map(G=>G.connection_id)),T=[...d].filter(G=>!E.has(G)).map(G=>({connection_id:G,selected_tools:null,selected_resources:null,selected_prompts:null}));if(T.length===0){W.info("All selected connections are already in that agent");return}try{await r.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:o,data:{connections:[...a.connections,...T]}}),h.invalidateQueries({predicate:G=>{const K=G.queryKey;return K[1]===l.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),W.success(`Added ${T.length} connection${T.length!==1?"s":""} to "${a.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...N}),t.jsx(nn,{open:D,onOpenChange:U,count:d.size,onConfirm:b}),t.jsx(tn,{open:F,onOpenChange:s,agents:$,onConfirm:me}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:c?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(o=>{if(o.type==="group")return t.jsx(Yt,{group:o,onOpen:()=>{g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:o.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},o.key);const a=o.connection,E=d.has(a.id);return t.jsx(ve,{connection:a,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?B(a.id):g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),className:de(E&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:E,onCheckedChange:()=>B(a.id),onClick:T=>T.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(We,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:T=>T.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(qe,{align:"end",onClick:T=>T.stopPropagation(),children:[t.jsxs(ae,{onClick:T=>{T.stopPropagation(),g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}})},children:[t.jsx(Ye,{size:16}),"Open"]}),(c||j)&&t.jsxs(ae,{onClick:T=>{T.stopPropagation(),B(a.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),c&&(a.status==="active"?t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"inactive")},children:[t.jsx(Rt,{size:16}),"Disable"]}):t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"active")},children:[t.jsx(Kt,{size:16}),"Enable"]})),c&&t.jsxs(ae,{variant:"destructive",onClick:T=>{T.stopPropagation(),N.requestDelete(a)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})})]})},a.id)}),O.map(o=>t.jsx(on,{item:o,canManage:c,allConnections:S,connectedAppNames:q,connectingItemId:A,onNavigateConnected:a=>g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),onConnect:z},`catalog-${o._registryId}:${o.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(le,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(en,{count:d.size,total:w.length,canManage:c,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(o=>o.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>U(!0),onAddToAgent:()=>s(!0),onToggleStatus:fe,onCancel:C})]})}function cn(){const{org:v}=ke(),e=De(),n=nt({strict:!1}),{data:p}=Ae.useSession(),{stdioEnabled:u}=st(),m=It(),{granted:l}=Ce("connections:manage"),h=vt({namespace:v.slug,resource:"connections"}),g=Ge(),[y,x]=ot(it.connectionsTab(v.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[S,N]=X.useState("ALL"),[c,j]=X.useState("ALL"),[d,k]=X.useState("ALL"),_=ht(),U=we(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=at({resolver:ct(Xt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=he({uiType:A,connectionUrl:V??"",npxPackage:$??""})??Ne({uiType:A,connectionUrl:V??"",registryItems:U}),L=l&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async i=>{let f,O=null,H=null,z=null;i.ui_type==="NPX"?(f="STDIO",O="",z=Gt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(f="STDIO",O="",z=Qt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(f=i.ui_type,O=i.connection_url||"",H=i.connection_token||null);const r=dt("conn");ne("connection_custom_created",{connection_type:f,ui_type:i.ui_type}),await g.create.mutateAsync({id:r,title:i.title,description:i.description||null,connection_type:f,connection_url:O,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:z,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:xe({app_name:null,connection_url:O,title:i.title,id:r})}})},Q=i=>{i||(L&&C(),s.reset())},R=i=>{const f=i.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,z=!!s.formState.dirtyFields.env_vars,r=b=>{if(b&&(!O&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!z&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],fe=new Set(se.map(o=>o.key)),me=b.envVarKeys.filter(o=>!fe.has(o));me.length>0&&s.setValue("env_vars",[...se,...me.map(o=>({key:o,value:""}))],{shouldDirty:!0})}},I=qt(f);if(I&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",I.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),r(he({uiType:"NPX",npxPackage:I.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const b=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),r(he({uiType:b,connectionUrl:f})??Ne({uiType:b,connectionUrl:f,registryItems:U}));return}A==="NPX"&&r(he({uiType:"NPX",npxPackage:f}))},q=l?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(M,{variant:"outline",onClick:B,children:[t.jsx(Je,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const i="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Y,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Pt,{value:r.value,onValueChange:r.onChange,children:[t.jsx(ee,{children:t.jsx(Lt,{children:t.jsx(Ot,{})})}),t.jsxs($t,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(Y,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Y,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...r,value:r.value??""})}),t.jsx(te,{})]})}),t.jsx(Y,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...r,value:r.value??""})}),t.jsx(te,{})]})})]}),t.jsx(Y,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...r,value:r.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(Y,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Wt,{value:r.value??[],onChange:r.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{control:s.control,name:"connection_url",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(Y,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...r,value:r.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(Y,{control:s.control,name:"title",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...r})}),t.jsx(te,{})]})}),t.jsx(Y,{control:s.control,name:"description",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(zt,{placeholder:"A brief description of this connection",rows:3,...r,value:r.value??""})}),t.jsx(te,{})]})})]}),z=L;return m?t.jsx(St,{open:z,onOpenChange:Q,children:t.jsxs(Nt,{className:"max-h-[90vh]",children:[t.jsx(kt,{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(Dt,{children:i}),t.jsx(At,{className:"mt-1",children:f})]}),t.jsx(wt,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(et,{size:16})})})]})}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(Tt,{children:t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Ve,{open:z,onOpenChange:Q,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(Ue,{children:[t.jsx(He,{children:i}),t.jsx(Re,{children:f})]}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Ke,{children:[t.jsx(M,{type:"button",variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.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(ut,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(h.setSearch(""),i.target.blur())}}),t.jsx(mt,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.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:S,onChange:i=>N(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:c,onChange:i=>j(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:i=>k(i||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),q]}),t.jsx(pt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:i=>{const f=i;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),x(f)}}),t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(an,{listState:h,activeTab:y,typeFilter:S,statusFilter:c,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function Us(){const v=ce.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(cn,{})})}),v[0]=e):e=v[0],e}export{Us as default};
@@ -0,0 +1 @@
1
+ import{d as o}from"./watch-sse-pool-DiiHGFSQ.js";const c=o;export{c as d};
@@ -1 +1 @@
1
- import{e as n,j as i,cw as u,c,bB as m,dm as x,dn as j,cx as N,cy as b,dp as g,dq as D}from"./index-Dv-yFpKM.js";import{i as h}from"./X-DxE022Fo.js";function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{w as D,T as a,B as b,E as c,R as d,O as e,k as f,v as g,y as h,z as i};
1
+ import{e as n,j as i,cw as u,c,bB as m,dm as x,dn as j,cx as N,cy as b,dp as g,dq as D}from"./index-uVHAmIsb.js";import{i as h}from"./X-B1W1F4mo.js";function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{w as D,T as a,B as b,E as c,R as d,O as e,k as f,v as g,y as h,z as i};
@@ -1 +1 @@
1
- import{e as Z,p as L,b as Q,F as B,K as G,m as U,a as P,j as s,B as J,t as p,n as z}from"./index-Dv-yFpKM.js";import{u as $}from"./studio-tools-DP4PwlLL.js";import{S as Y}from"./switch-Dlc-euH4.js";import{S as H,a as v,b as F}from"./settings-section-ysm1dXbe.js";function ei(){const i=Z.c(59),{org:e}=L(),{data:q}=Q.useSession(),M=B(),a=$();let r;i[0]!==e.id?(r=G.organizationDomain(e.id),i[0]=e.id,i[1]=r):r=i[1];let d;i[2]!==a?(d=()=>a.call("ORGANIZATION_DOMAIN_GET",{}),i[2]=a,i[3]=d):d=i[3];let A;i[4]!==r||i[5]!==d?(A={queryKey:r,queryFn:d},i[4]=r,i[5]=d,i[6]=A):A=i[6];const{data:k,isPending:K}=U(A),R=q?.user?.email??"";let x;i[7]!==R?(x=R.split("@")[1]?.toLowerCase()??"",i[7]=R,i[8]=x):x=i[8];const n=x,o=k?.domain??null,T=k?.autoJoinEnabled??!1,w=n&&n!==o;let C;i[9]!==e.id||i[10]!==M?(C=()=>M.invalidateQueries({queryKey:G.organizationDomain(e.id)}),i[9]=e.id,i[10]=M,i[11]=C):C=i[11];const l=C;let c;i[12]!==a||i[13]!==n?(c=()=>a.call("ORGANIZATION_DOMAIN_SET",{domain:n,autoJoinEnabled:!1}),i[12]=a,i[13]=n,i[14]=c):c=i[14];let m;i[15]!==l||i[16]!==e.id||i[17]!==n?(m=()=>{p("organization_domain_claimed",{organization_id:e.id,email_domain:n}),l(),z.success("Domain claimed")},i[15]=l,i[16]=e.id,i[17]=n,i[18]=m):m=i[18];let u;i[19]!==e.id||i[20]!==n?(u=t=>{p("organization_domain_claim_failed",{organization_id:e.id,email_domain:n,error:t instanceof Error?t.message:String(t)}),z.error(t instanceof Error?t.message:"Failed to claim domain")},i[19]=e.id,i[20]=n,i[21]=u):u=i[21];let D;i[22]!==c||i[23]!==m||i[24]!==u?(D={mutationFn:c,onSuccess:m,onError:u},i[22]=c,i[23]=m,i[24]=u,i[25]=D):D=i[25];const h=P(D);let g;i[26]!==a?(g=()=>a.call("ORGANIZATION_DOMAIN_CLEAR",{}),i[26]=a,i[27]=g):g=i[27];let f;i[28]!==o||i[29]!==l||i[30]!==e.id?(f=()=>{p("organization_domain_cleared",{organization_id:e.id,email_domain:o}),l(),z.success("Domain removed")},i[28]=o,i[29]=l,i[30]=e.id,i[31]=f):f=i[31];let _;i[32]!==o||i[33]!==e.id?(_=t=>{p("organization_domain_clear_failed",{organization_id:e.id,email_domain:o,error:t instanceof Error?t.message:String(t)}),z.error(t instanceof Error?t.message:"Failed to remove domain")},i[32]=o,i[33]=e.id,i[34]=_):_=i[34];let I;i[35]!==f||i[36]!==_||i[37]!==g?(I={mutationFn:g,onSuccess:f,onError:_},i[35]=f,i[36]=_,i[37]=g,i[38]=I):I=i[38];const N=P(I);let E;i[39]!==o||i[40]!==e.id||i[41]!==a?(E=async t=>{if(o)return p("organization_auto_join_toggled",{organization_id:e.id,enabled:t}),a.call("ORGANIZATION_DOMAIN_UPDATE",{autoJoinEnabled:t})},i[39]=o,i[40]=e.id,i[41]=a,i[42]=E):E=i[42];let j;i[43]!==l?(j=()=>{l(),z.success("Auto-join setting updated")},i[43]=l,i[44]=j):j=i[44];let S;i[45]!==e.id?(S=t=>{p("organization_auto_join_toggle_failed",{organization_id:e.id,error:t instanceof Error?t.message:String(t)}),z.error(t instanceof Error?t.message:"Failed to update auto-join")},i[45]=e.id,i[46]=S):S=i[46];let O;i[47]!==E||i[48]!==j||i[49]!==S?(O={mutationFn:E,onSuccess:j,onError:S},i[47]=E,i[48]=j,i[49]=S,i[50]=O):O=i[50];const y=P(O);if(K)return null;let b;return i[51]!==T||i[52]!==w||i[53]!==N||i[54]!==o||i[55]!==h||i[56]!==y||i[57]!==n?(b=s.jsx(H,{title:"Email domain",children:o?s.jsxs(v,{children:[s.jsx(F,{title:o,description:"Claimed domain",action:s.jsx(J,{variant:"outline",size:"sm",onClick:()=>N.mutate(),disabled:N.isPending,children:"Remove"})}),s.jsx(F,{title:"Auto-join",description:`Users with @${o} emails will automatically join this organization on signup.`,action:s.jsx(Y,{checked:T,onCheckedChange:t=>y.mutate(t),disabled:y.isPending})})]}):w?s.jsx(v,{children:s.jsx(F,{title:n,description:"Let new users with matching emails auto-join this org.",action:s.jsx(J,{size:"sm",onClick:()=>h.mutate(),disabled:h.isPending,children:h.isPending?"Claiming...":"Claim domain"})})}):s.jsx(v,{children:s.jsx(F,{title:"No domain detected",description:"Sign in with a corporate email to claim a domain for your organization."})})}),i[51]=T,i[52]=w,i[53]=N,i[54]=o,i[55]=h,i[56]=y,i[57]=n,i[58]=b):b=i[58],b}export{ei as D};
1
+ import{e as Z,p as L,b as Q,F as B,K as G,m as U,a as P,j as s,B as J,t as p,n as z}from"./index-uVHAmIsb.js";import{u as $}from"./studio-tools-Bsqb-6Fx.js";import{S as Y}from"./switch-Cu-9OUl1.js";import{S as H,a as v,b as F}from"./settings-section-nvSL8mUn.js";function ei(){const i=Z.c(59),{org:e}=L(),{data:q}=Q.useSession(),M=B(),a=$();let r;i[0]!==e.id?(r=G.organizationDomain(e.id),i[0]=e.id,i[1]=r):r=i[1];let d;i[2]!==a?(d=()=>a.call("ORGANIZATION_DOMAIN_GET",{}),i[2]=a,i[3]=d):d=i[3];let A;i[4]!==r||i[5]!==d?(A={queryKey:r,queryFn:d},i[4]=r,i[5]=d,i[6]=A):A=i[6];const{data:k,isPending:K}=U(A),R=q?.user?.email??"";let x;i[7]!==R?(x=R.split("@")[1]?.toLowerCase()??"",i[7]=R,i[8]=x):x=i[8];const n=x,o=k?.domain??null,T=k?.autoJoinEnabled??!1,w=n&&n!==o;let C;i[9]!==e.id||i[10]!==M?(C=()=>M.invalidateQueries({queryKey:G.organizationDomain(e.id)}),i[9]=e.id,i[10]=M,i[11]=C):C=i[11];const l=C;let c;i[12]!==a||i[13]!==n?(c=()=>a.call("ORGANIZATION_DOMAIN_SET",{domain:n,autoJoinEnabled:!1}),i[12]=a,i[13]=n,i[14]=c):c=i[14];let m;i[15]!==l||i[16]!==e.id||i[17]!==n?(m=()=>{p("organization_domain_claimed",{organization_id:e.id,email_domain:n}),l(),z.success("Domain claimed")},i[15]=l,i[16]=e.id,i[17]=n,i[18]=m):m=i[18];let u;i[19]!==e.id||i[20]!==n?(u=t=>{p("organization_domain_claim_failed",{organization_id:e.id,email_domain:n,error:t instanceof Error?t.message:String(t)}),z.error(t instanceof Error?t.message:"Failed to claim domain")},i[19]=e.id,i[20]=n,i[21]=u):u=i[21];let D;i[22]!==c||i[23]!==m||i[24]!==u?(D={mutationFn:c,onSuccess:m,onError:u},i[22]=c,i[23]=m,i[24]=u,i[25]=D):D=i[25];const h=P(D);let g;i[26]!==a?(g=()=>a.call("ORGANIZATION_DOMAIN_CLEAR",{}),i[26]=a,i[27]=g):g=i[27];let f;i[28]!==o||i[29]!==l||i[30]!==e.id?(f=()=>{p("organization_domain_cleared",{organization_id:e.id,email_domain:o}),l(),z.success("Domain removed")},i[28]=o,i[29]=l,i[30]=e.id,i[31]=f):f=i[31];let _;i[32]!==o||i[33]!==e.id?(_=t=>{p("organization_domain_clear_failed",{organization_id:e.id,email_domain:o,error:t instanceof Error?t.message:String(t)}),z.error(t instanceof Error?t.message:"Failed to remove domain")},i[32]=o,i[33]=e.id,i[34]=_):_=i[34];let I;i[35]!==f||i[36]!==_||i[37]!==g?(I={mutationFn:g,onSuccess:f,onError:_},i[35]=f,i[36]=_,i[37]=g,i[38]=I):I=i[38];const N=P(I);let E;i[39]!==o||i[40]!==e.id||i[41]!==a?(E=async t=>{if(o)return p("organization_auto_join_toggled",{organization_id:e.id,enabled:t}),a.call("ORGANIZATION_DOMAIN_UPDATE",{autoJoinEnabled:t})},i[39]=o,i[40]=e.id,i[41]=a,i[42]=E):E=i[42];let j;i[43]!==l?(j=()=>{l(),z.success("Auto-join setting updated")},i[43]=l,i[44]=j):j=i[44];let S;i[45]!==e.id?(S=t=>{p("organization_auto_join_toggle_failed",{organization_id:e.id,error:t instanceof Error?t.message:String(t)}),z.error(t instanceof Error?t.message:"Failed to update auto-join")},i[45]=e.id,i[46]=S):S=i[46];let O;i[47]!==E||i[48]!==j||i[49]!==S?(O={mutationFn:E,onSuccess:j,onError:S},i[47]=E,i[48]=j,i[49]=S,i[50]=O):O=i[50];const y=P(O);if(K)return null;let b;return i[51]!==T||i[52]!==w||i[53]!==N||i[54]!==o||i[55]!==h||i[56]!==y||i[57]!==n?(b=s.jsx(H,{title:"Email domain",children:o?s.jsxs(v,{children:[s.jsx(F,{title:o,description:"Claimed domain",action:s.jsx(J,{variant:"outline",size:"sm",onClick:()=>N.mutate(),disabled:N.isPending,children:"Remove"})}),s.jsx(F,{title:"Auto-join",description:`Users with @${o} emails will automatically join this organization on signup.`,action:s.jsx(Y,{checked:T,onCheckedChange:t=>y.mutate(t),disabled:y.isPending})})]}):w?s.jsx(v,{children:s.jsx(F,{title:n,description:"Let new users with matching emails auto-join this org.",action:s.jsx(J,{size:"sm",onClick:()=>h.mutate(),disabled:h.isPending,children:h.isPending?"Claiming...":"Claim domain"})})}):s.jsx(v,{children:s.jsx(F,{title:"No domain detected",description:"Sign in with a corporate email to claim a domain for your organization."})})}),i[51]=T,i[52]=w,i[53]=N,i[54]=o,i[55]=h,i[56]=y,i[57]=n,i[58]=b):b=i[58],b}export{ei as D};
@@ -1 +1 @@
1
- import{e as d,j as s,cl as i,c}from"./index-Dv-yFpKM.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{D,g as a,x as b,h as c,N as d,b as e,j as f,v as g};
1
+ import{e as d,j as s,cl as i,c}from"./index-uVHAmIsb.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{D,g as a,x as b,h as c,N as d,b as e,j as f,v as g};
@@ -1 +1 @@
1
- import{e as c,j as d,dQ as f,dR as m,c as u,dS as g,dT as x,dU as v,dV as b,dW as h,dX as w,dY as j,dZ as N,d_ as z,d$ as _,e0 as y,e1 as p}from"./index-Dv-yFpKM.js";import{i as $}from"./Check-CNRVH6xs.js";import{i as D}from"./ChevronRight-DixPnH3V.js";import{a as M}from"./DotsVertical-DimB1qZR.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(l=d.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx($,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=d.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function Q(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function U(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function V(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function W(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function X(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,E as b,G as c,V as d,W as e,X as f,U as g,O as h,P as i,Q as j,L as k};
1
+ import{e as c,j as d,dQ as f,dR as m,c as u,dS as g,dT as x,dU as v,dV as b,dW as h,dX as w,dY as j,dZ as N,d_ as z,d$ as _,e0 as y,e1 as p}from"./index-uVHAmIsb.js";import{i as $}from"./Check-D7HZW6oZ.js";import{i as D}from"./ChevronRight-3jD7TdJZ.js";import{a as M}from"./DotsVertical-Cz5MZln-.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(l=d.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx($,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=d.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function Q(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function U(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function V(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function W(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function X(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,E as b,G as c,V as d,W as e,X as f,U as g,O as h,P as i,Q as j,L as k};