decocms 2.175.0 → 2.175.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/dist/client/assets/{AlertCircle-5ZbLDi3s.js → AlertCircle-CnfwZdxb.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-D4ghzTQG.js → AlignLeft-zj1VrWVO.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-B5WC3D5H.js → ArrowDown-BnnQhLmg.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-D0Lalw4x.js → ArrowLeft-C3_bzjZf.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-tKKJvEkq.js → ArrowUp-BuKX1RSZ.js} +1 -1
  6. package/dist/client/assets/{Check-CuWDIJeM.js → Check-7kB05ju_.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-wz1RfkCA.js → CheckCircle-DrGaevdP.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-UsIketHR.js → CheckDone01-CVJEgdwq.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-cu3amtx9.js → CheckVerified02-DmV5dzDn.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-D0TXudCx.js → ChevronDown-DHeagNGb.js} +1 -1
  11. package/dist/client/assets/{ChevronLeft-BZsszCLQ.js → ChevronLeft-W2gkpjgL.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-UJRwW9xN.js → ChevronRight-Blv21S_7.js} +1 -1
  13. package/dist/client/assets/{ChevronUp-DXMXl76b.js → ChevronUp-J7upZD3-.js} +1 -1
  14. package/dist/client/assets/{Clock-DKQ7EGj-.js → Clock-9Mm0U0Dg.js} +1 -1
  15. package/dist/client/assets/{Code01-DZzuHJh9.js → Code01-DDbKsccR.js} +1 -1
  16. package/dist/client/assets/{Coins01-DWo6Ypxq.js → Coins01-DTz6uYyF.js} +1 -1
  17. package/dist/client/assets/{Container-YdffBHg3.js → Container-Ci_1Xm4L.js} +1 -1
  18. package/dist/client/assets/{Copy01-CPHBT83w.js → Copy01-BexEalI-.js} +1 -1
  19. package/dist/client/assets/{Dataflow03-CUuQJ-m_.js → Dataflow03-CKfLDuKw.js} +1 -1
  20. package/dist/client/assets/{DotsHorizontal-DUoeCjzn.js → DotsHorizontal-3xIvFzgk.js} +1 -1
  21. package/dist/client/assets/{DotsVertical-BaBvJOuP.js → DotsVertical-7N_NB6wt.js} +1 -1
  22. package/dist/client/assets/{Download01-D5-Ilwwi.js → Download01-D-oC1d8d.js} +1 -1
  23. package/dist/client/assets/{Edit01-Dpq6F4lk.js → Edit01-gYPHsLoC.js} +1 -1
  24. package/dist/client/assets/{Edit05-h0OeCHXT.js → Edit05-BA2Lz_6R.js} +1 -1
  25. package/dist/client/assets/{Eye-DDwMVcxZ.js → Eye-Cn6YseXl.js} +1 -1
  26. package/dist/client/assets/{EyeOff-D8njwIM7.js → EyeOff-L-SLicw9.js} +1 -1
  27. package/dist/client/assets/{File02-Bc8tH3v5.js → File02-Dx1Iz50W.js} +1 -1
  28. package/dist/client/assets/{File06-ZV5CfSHG.js → File06-Dqc-K1-5.js} +1 -1
  29. package/dist/client/assets/{FilterLines-aqS8nu95.js → FilterLines-DCrzLWfV.js} +1 -1
  30. package/dist/client/assets/{Globe01-BdWDm7Ni.js → Globe01-DW2rHI0i.js} +1 -1
  31. package/dist/client/assets/{Globe02-Cn3qFriL.js → Globe02-CyGtzZ8k.js} +1 -1
  32. package/dist/client/assets/{Grid01-Gq7hBl7S.js → Grid01-Dqz--q3o.js} +1 -1
  33. package/dist/client/assets/{Hash02-CmJ0Y9N4.js → Hash02-pqCZ_ykD.js} +1 -1
  34. package/dist/client/assets/{Home02-Dz88FEOV.js → Home02-D2W6xjpZ.js} +1 -1
  35. package/dist/client/assets/{Image01-DBWShOGl.js → Image01-U7ZIAIPc.js} +1 -1
  36. package/dist/client/assets/{Inbox01-CJphqD3y.js → Inbox01-DpRIO4ZY.js} +1 -1
  37. package/dist/client/assets/{InfoCircle-uEl5PLW5.js → InfoCircle-CvSmMU6H.js} +1 -1
  38. package/dist/client/assets/{Key01-IptFTL_3.js → Key01-Dq5b7fdA.js} +1 -1
  39. package/dist/client/assets/{LayersTwo01-B5fVqAUB.js → LayersTwo01-Li6JqY2K.js} +1 -1
  40. package/dist/client/assets/{LayoutLeft-B8-msEGR.js → LayoutLeft-BAk65lFq.js} +1 -1
  41. package/dist/client/assets/{Link01-BpjSsBky.js → Link01-NJWLnzFs.js} +1 -1
  42. package/dist/client/assets/{LinkExternal01-B21lACin.js → LinkExternal01-B8e_Oa3I.js} +1 -1
  43. package/dist/client/assets/{List-ySIwqood.js → List-Cc_Ri6eQ.js} +1 -1
  44. package/dist/client/assets/{Loading01-WTkiPysv.js → Loading01-Cbk1oNZ2.js} +1 -1
  45. package/dist/client/assets/{Lock01-DqO9uSP7.js → Lock01-dP10fLup.js} +1 -1
  46. package/dist/client/assets/{Play-D72BHSXn.js → Play-DqxAqUbl.js} +1 -1
  47. package/dist/client/assets/{Plus-Dto-8y6a.js → Plus-CqWob4tu.js} +1 -1
  48. package/dist/client/assets/{RefreshCcw01-DckyCUMd.js → RefreshCcw01-B6R5Js1R.js} +1 -1
  49. package/dist/client/assets/{Save01-C2uk3LpG.js → Save01-BfieBu6m.js} +1 -1
  50. package/dist/client/assets/{SearchMd-Kap2MdR9.js → SearchMd-DJI6OMcD.js} +1 -1
  51. package/dist/client/assets/{Settings01-CYUXeHtK.js → Settings01-BWkL3Bf9.js} +1 -1
  52. package/dist/client/assets/{Shield01-CJ-f24yL.js → Shield01-DMT1motk.js} +1 -1
  53. package/dist/client/assets/{Terminal-BQ1GlFmm.js → Terminal-zNrinv6B.js} +1 -1
  54. package/dist/client/assets/Tool01-CUx5BAY-.js +1 -0
  55. package/dist/client/assets/{Trash01-DkXbOnbi.js → Trash01-C0891dQq.js} +1 -1
  56. package/dist/client/assets/{Upload01-BasmYIL8.js → Upload01-ngHWsp64.js} +1 -1
  57. package/dist/client/assets/{Users03-BXwEsNFj.js → Users03-FsZwQwZq.js} +1 -1
  58. package/dist/client/assets/{X-CNbskBah.js → X-CeRZ6ROs.js} +1 -1
  59. package/dist/client/assets/XAxis-B4Pxztvn.js +1 -0
  60. package/dist/client/assets/{XCircle-DvUvQRq1.js → XCircle-X3Ds2fko.js} +1 -1
  61. package/dist/client/assets/{XClose-B0FgAxIQ.js → XClose-BieEiV6P.js} +1 -1
  62. package/dist/client/assets/{Zap-BgjTj76q.js → Zap-B-qa654H.js} +1 -1
  63. package/dist/client/assets/{agent-connections-preview-Bh6ijP_X.js → agent-connections-preview-BXeLz6mJ.js} +1 -1
  64. package/dist/client/assets/agent-detail-2cFCKx9t.js +2 -0
  65. package/dist/client/assets/agents-DS-16MLo.js +1 -0
  66. package/dist/client/assets/ai-providers-logos-Bb5LHAPU.js +1 -0
  67. package/dist/client/assets/{alert-dialog-DtAWdTyc.js → alert-dialog-DgTufZ_p.js} +3 -3
  68. package/dist/client/assets/{auth-catchall-5qyXxzaS.js → auth-catchall-zO2o6cw1.js} +1 -1
  69. package/dist/client/assets/automation-detail-CyiDphKi.js +1 -0
  70. package/dist/client/assets/automations-CBvKrAy1.js +1 -0
  71. package/dist/client/assets/{avatar-ChRCLY4k.js → avatar-w6QMWHVj.js} +1 -1
  72. package/dist/client/assets/{badge-C4uZcq7J.js → badge-B-_hRtCy.js} +1 -1
  73. package/dist/client/assets/{binder-hd3C3mvD.js → binder-BEJ4wRzw.js} +1 -1
  74. package/dist/client/assets/{breadcrumb-pLMl4xjy.js → breadcrumb-Dk9kRV2t.js} +1 -1
  75. package/dist/client/assets/card-BSGld6G2.js +1 -0
  76. package/dist/client/assets/chart-CEfru1MQ.js +15 -0
  77. package/dist/client/assets/{checkbox-D2IG7klY.js → checkbox-COsQJsO9.js} +1 -1
  78. package/dist/client/assets/{collapsible-ttq3VbhQ.js → collapsible-BCGKc4Wz.js} +1 -1
  79. package/dist/client/assets/{collection-detail-DoRLjPv6.js → collection-detail-BimbOEiL.js} +5 -5
  80. package/dist/client/assets/collection-display-button-CuyLh-NC.js +1 -0
  81. package/dist/client/assets/{collection-search-Mtc1qP5K.js → collection-search-aJlY7LHs.js} +1 -1
  82. package/dist/client/assets/collection-table-wrapper-CcbJTCba.js +1 -0
  83. package/dist/client/assets/{collection-tabs-CHem1-m4.js → collection-tabs-B2Xeppc1.js} +1 -1
  84. package/dist/client/assets/{command-DRBqjkmt.js → command-CyHipwcz.js} +1 -1
  85. package/dist/client/assets/{connect-CRbH1TYm.js → connect-3nC8bK4k.js} +1 -1
  86. package/dist/client/assets/connection-card-iA_b7WBI.js +1 -0
  87. package/dist/client/assets/connection-detail-B4CoR-IH.js +1 -0
  88. package/dist/client/assets/{connection-status-COvhqytZ.js → connection-status-BddpcBJZ.js} +1 -1
  89. package/dist/client/assets/connections-B-zXLcDP.js +1 -0
  90. package/dist/client/assets/{constants-B9t4Nuz_.js → constants-CDL9XClm.js} +1 -1
  91. package/dist/client/assets/constants-DxY-8FrK.js +1 -0
  92. package/dist/client/assets/{context-CiizXS06.js → context-DDV_uL9a.js} +1 -1
  93. package/dist/client/assets/{create-organization-dialog-BCMxp6fo.js → create-organization-dialog-CG01zre5.js} +1 -1
  94. package/dist/client/assets/{create-project-dialog-BvxMRX5X.js → create-project-dialog-5e-piQzY.js} +1 -1
  95. package/dist/client/assets/{danger-BjSxZinj.js → danger-_ZcnVgTL.js} +1 -1
  96. package/dist/client/assets/{danger-zone-B2z3wTq9.js → danger-zone-e3foS_su.js} +1 -1
  97. package/dist/client/assets/{dependencies-BkOdHYmE.js → dependencies-DUviAtSp.js} +1 -1
  98. package/dist/client/assets/dialog-DxTRqiug.js +1 -0
  99. package/dist/client/assets/{dropdown-menu-Cp0O2jCN.js → dropdown-menu-CdjuOUR6.js} +1 -1
  100. package/dist/client/assets/dynamic-plugin-layout-DszdejBu.js +1 -0
  101. package/dist/client/assets/{editable-task-title-COr46zxY.js → editable-task-title-44X_8A19.js} +1 -1
  102. package/dist/client/assets/{empty-state-DbRFhzf6.js → empty-state-Bj_isc1T.js} +1 -1
  103. package/dist/client/assets/{empty-state-SBIKV11G.js → empty-state-v8jdj56V.js} +1 -1
  104. package/dist/client/assets/env-vars-editor-Bs6jziXp.js +1 -0
  105. package/dist/client/assets/extract-connection-data-Cyjq-Q5I.js +1 -0
  106. package/dist/client/assets/{file-browser-B2cQNHIN.js → file-browser-4NMlO2k_.js} +2 -2
  107. package/dist/client/assets/{form-DPPO-3Tw.js → form-BV3tSlED.js} +1 -1
  108. package/dist/client/assets/{general-DDQcxBFZ.js → general-LSfgt8-y.js} +1 -1
  109. package/dist/client/assets/{grid-view-BhmPSvr_.js → grid-view-BD9vYk3H.js} +1 -1
  110. package/dist/client/assets/home-Ck605SqF.js +1 -0
  111. package/dist/client/assets/{index-B3fUA0k0.js → index-B70G5L15.js} +1 -1
  112. package/dist/client/assets/{index-Bmxys2UV.js → index-BE93ZIdg.js} +1 -1
  113. package/dist/client/assets/{index-DO8fUd54.js → index-BXUNq6d7.js} +4 -4
  114. package/dist/client/assets/{index-D-NeGwUy.js → index-CZ7yh8sQ.js} +1 -1
  115. package/dist/client/assets/index-Ci8WAd55.css +1 -0
  116. package/dist/client/assets/index-Dg_kVhT7.js +1 -0
  117. package/dist/client/assets/index-DlhaGZnK.js +1 -0
  118. package/dist/client/assets/{index-COM-PDLy.js → index-L6huQtcJ.js} +1 -1
  119. package/dist/client/assets/index-rWegviRE.js +1 -0
  120. package/dist/client/assets/{index-BVSHvvtZ.js → index-uQDoUdMq.js} +1 -1
  121. package/dist/client/assets/{index-C6XH6ylF.js → index-zJEaoyYS.js} +12 -12
  122. package/dist/client/assets/{infiniteQueryObserver-x0ce-nmx.js → infiniteQueryObserver-DXFe0xIV.js} +1 -1
  123. package/dist/client/assets/{input-BM9bdg-F.js → input-BFH8rk50.js} +1 -1
  124. package/dist/client/assets/integration-icon-D6SJHU0f.js +1 -0
  125. package/dist/client/assets/{label-CnT8WAQY.js → label-DE7vX487.js} +1 -1
  126. package/dist/client/assets/{layout-ubFJ5DPd.js → layout-B2GnF_Vp.js} +1 -1
  127. package/dist/client/assets/layout-B_GGomJW.js +1 -0
  128. package/dist/client/assets/login-CgzRmuxY.js +1 -0
  129. package/dist/client/assets/{logo-upload-Bb5Ay7-T.js → logo-upload-Bfzj_LQV.js} +1 -1
  130. package/dist/client/assets/{markdown-ZobUYaB1.js → markdown-Da-6gcG9.js} +8 -8
  131. package/dist/client/assets/{mcp-app-renderer-CLfglV2_.js → mcp-app-renderer-CNc9yMN5.js} +2 -2
  132. package/dist/client/assets/mcp-server-card-s9NGsKpt.js +1 -0
  133. package/dist/client/assets/mcp-server-detail-fMXGyX4W.js +2 -0
  134. package/dist/client/assets/members-BvBWfv9e.js +3 -0
  135. package/dist/client/assets/{monaco-editor-kjafc2y3.js → monaco-editor-VspAvYbk.js} +1 -1
  136. package/dist/client/assets/monitoring-B1jfqgQN.js +4 -0
  137. package/dist/client/assets/monitoring-dashboard-edit-Bdujw4Ym.js +1 -0
  138. package/dist/client/assets/{monitoring-dashboard-view-FD-yc8mV.js → monitoring-dashboard-view-CSfkxnkl.js} +2 -2
  139. package/dist/client/assets/monitoring-stats-row-Ds_uiyYJ.js +28 -0
  140. package/dist/client/assets/{oauth-callback-wHI3TkEb.js → oauth-callback-BNPNdlSW.js} +1 -1
  141. package/dist/client/assets/{oauth-callback-ai-provider-DHfWQd6C.js → oauth-callback-ai-provider-CODmoIp9.js} +1 -1
  142. package/dist/client/assets/org-ai-providers-CQKU4ds_.js +1 -0
  143. package/dist/client/assets/page-Bbbh0c0Z.js +1 -0
  144. package/dist/client/assets/page-BfphKBfj.js +1 -0
  145. package/dist/client/assets/{plugin-empty-state-Bh1khfVy.js → plugin-empty-state-BWhKyfJ8.js} +1 -1
  146. package/dist/client/assets/{plugin-empty-state-C0KzvXIH.js → plugin-empty-state-Cx_CuKe3.js} +1 -1
  147. package/dist/client/assets/{plugin-header-DJbwn5SE.js → plugin-header-ET8DV5kQ.js} +1 -1
  148. package/dist/client/assets/{plugin-header-ydYJ1Vj6.js → plugin-header-ncr8MkbN.js} +1 -1
  149. package/dist/client/assets/plugins-BdyM0ZUw.js +1 -0
  150. package/dist/client/assets/{popover-D1WG-emQ.js → popover-BcyJids_.js} +1 -1
  151. package/dist/client/assets/project-app-view-BdLdOYqG.js +1 -0
  152. package/dist/client/assets/project-layout-DReK69oR.js +1 -0
  153. package/dist/client/assets/{project-plugins-BVdloqBu.js → project-plugins-CXWguN_r.js} +1 -1
  154. package/dist/client/assets/projects-list-CZANuMq5.js +1 -0
  155. package/dist/client/assets/{registry-layout-B5XpbAHd.js → registry-layout-CqXQ571U.js} +1 -1
  156. package/dist/client/assets/registry-utils-CaVl1vKg.js +1 -0
  157. package/dist/client/assets/{reports-layout-Ct8yUpC8.js → reports-layout-CQyNOFqA.js} +1 -1
  158. package/dist/client/assets/{reset-password-BXrkGw9C.js → reset-password-Bt_v8_59.js} +1 -1
  159. package/dist/client/assets/{resizable-CqLBllsV.js → resizable-B4X_WbHf.js} +1 -1
  160. package/dist/client/assets/{save-actions-MbSzUbWU.js → save-actions-Py9YKTe0.js} +1 -1
  161. package/dist/client/assets/{scroll-area-BcJ1ckdt.js → scroll-area-R7PT492V.js} +1 -1
  162. package/dist/client/assets/{select-RxUFw6pZ.js → select-B-f7jgVG.js} +1 -1
  163. package/dist/client/assets/{select-virtual-mcp-DU8qBWLM.js → select-virtual-mcp-YanYQUBn.js} +1 -1
  164. package/dist/client/assets/sheet-7nFLkS7G.js +1 -0
  165. package/dist/client/assets/shell-layout-Dp8xiQMR.js +3 -0
  166. package/dist/client/assets/{sidebar-settings-DICq5I_K.js → sidebar-settings-w0p27D0n.js} +1 -1
  167. package/dist/client/assets/{skeleton-CU7LuZGk.js → skeleton-CK2-6UkT.js} +1 -1
  168. package/dist/client/assets/{spinner-CpOteR2a.js → spinner-B1-EIDBS.js} +1 -1
  169. package/dist/client/assets/{store-invite-D2k0Vn6N.js → store-invite-DVPM6U-x.js} +1 -1
  170. package/dist/client/assets/{switch-DyxdcdWl.js → switch-4UL4iV3X.js} +1 -1
  171. package/dist/client/assets/{table-DyNKuHyS.js → table-Bu98B5a-.js} +1 -1
  172. package/dist/client/assets/{tabs-XMAGaWgq.js → tabs-Cif80TZ4.js} +1 -1
  173. package/dist/client/assets/{task-status-DJB3YbbO.js → task-status-BWKjAgiX.js} +16 -16
  174. package/dist/client/assets/{tasks-panel-XTVNkW83.js → tasks-panel-D6Bb-wiS.js} +1 -1
  175. package/dist/client/assets/tasks-tenjlvFT.js +1 -0
  176. package/dist/client/assets/{textarea-BLuscN8X.js → textarea-DPLd5P1K.js} +1 -1
  177. package/dist/client/assets/{time-range-picker-Bd3fku3n.js → time-range-picker-FJd_w9AH.js} +1 -1
  178. package/dist/client/assets/{toggle-group-BrL6C5fG.js → toggle-group-B4QQy8X1.js} +1 -1
  179. package/dist/client/assets/tools-list-BgmW-tI4.js +1 -0
  180. package/dist/client/assets/{tooltip-BLTgyg7W.js → tooltip-BGPUMzDS.js} +1 -1
  181. package/dist/client/assets/{topbar-portal-_Qqzdv9B.js → topbar-portal-CLOTo-7w.js} +1 -1
  182. package/dist/client/assets/{types-BPYct9bF.js → types-DZ5M-eMJ.js} +5 -5
  183. package/dist/client/assets/{use-automations-BeAHZecx.js → use-automations-D7j59hRT.js} +1 -1
  184. package/dist/client/assets/use-binding-CZ8osTa1.js +1 -0
  185. package/dist/client/assets/{use-collections-C8rLdQUN.js → use-collections-yY78nnLx.js} +1 -1
  186. package/dist/client/assets/{use-connection-BNGXvSqD.js → use-connection-lXrlfojY.js} +1 -1
  187. package/dist/client/assets/{use-copy-DPJ8nWWs.js → use-copy-DZJI58oZ.js} +1 -1
  188. package/dist/client/assets/{use-create-virtual-mcp-BfS4KaKE.js → use-create-virtual-mcp-DK_WDS9Y.js} +1 -1
  189. package/dist/client/assets/use-infinite-scroll-C-TK62Eo.js +1 -0
  190. package/dist/client/assets/{use-install-from-registry-BEC7S-53.js → use-install-from-registry-C24f0cqa.js} +1 -1
  191. package/dist/client/assets/{use-list-state-DsQajLIu.js → use-list-state-D6LU1koz.js} +1 -1
  192. package/dist/client/assets/{use-mcp-prompts-D_02f3uO.js → use-mcp-prompts-DT9l3i02.js} +1 -1
  193. package/dist/client/assets/{use-mcp-resources-BNoK6dDS.js → use-mcp-resources-DhBJVSsg.js} +1 -1
  194. package/dist/client/assets/{use-mcp-tools-BCCglZve.js → use-mcp-tools-CwVNqTmj.js} +1 -1
  195. package/dist/client/assets/{use-members-Cqa4gqXV.js → use-members-fpZqw1dy.js} +1 -1
  196. package/dist/client/assets/{use-mobile-kAkblq0-.js → use-mobile-B0lEbMk3.js} +1 -1
  197. package/dist/client/assets/{use-project-DNZXkIib.js → use-project-BnRSDoVD.js} +1 -1
  198. package/dist/client/assets/use-store-discovery-C9fJhQ4Y.js +1 -0
  199. package/dist/client/assets/{use-view-mode-Bl6DaWwW.js → use-view-mode-0w9n1sJ-.js} +1 -1
  200. package/dist/client/assets/{use-virtual-mcp-DoDJBE5n.js → use-virtual-mcp-CyoGC0aH.js} +1 -1
  201. package/dist/client/assets/useInfiniteQuery-BlrmUHYA.js +1 -0
  202. package/dist/client/assets/{useMutation-CNVq636e.js → useMutation-CkdHuTyE.js} +1 -1
  203. package/dist/client/assets/useQuery-Bmc4jnG2.js +1 -0
  204. package/dist/client/assets/useSuspenseInfiniteQuery-DD4jjrsx.js +1 -0
  205. package/dist/client/assets/{user-6WV0RuBu.js → user-sbKkVV9F.js} +1 -1
  206. package/dist/client/assets/workflow-CpP3zoVI.js +1 -0
  207. package/dist/client/index.html +2 -2
  208. package/dist/server/node_modules/{postgres-bytea/license → pg/LICENSE} +6 -6
  209. package/dist/server/node_modules/pg/README.md +95 -0
  210. package/dist/server/node_modules/pg/esm/index.mjs +20 -0
  211. package/dist/server/node_modules/pg/lib/client.js +743 -0
  212. package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
  213. package/dist/server/node_modules/pg/lib/connection.js +221 -0
  214. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
  215. package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
  216. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
  217. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
  218. package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
  219. package/dist/server/node_modules/pg/lib/defaults.js +91 -0
  220. package/dist/server/node_modules/pg/lib/index.js +73 -0
  221. package/dist/server/node_modules/pg/lib/native/client.js +323 -0
  222. package/dist/server/node_modules/pg/lib/native/index.js +2 -0
  223. package/dist/server/node_modules/pg/lib/native/query.js +165 -0
  224. package/dist/server/node_modules/pg/lib/query.js +252 -0
  225. package/dist/server/node_modules/pg/lib/result.js +109 -0
  226. package/dist/server/node_modules/pg/lib/stream.js +83 -0
  227. package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
  228. package/dist/server/node_modules/pg/lib/utils.js +217 -0
  229. package/dist/server/node_modules/pg/package.json +76 -0
  230. package/package.json +1 -1
  231. package/dist/client/assets/agent-detail-Cda1RjKX.js +0 -2
  232. package/dist/client/assets/agents-DNXSTqTl.js +0 -1
  233. package/dist/client/assets/ai-providers-logos-W57Qm-EN.js +0 -1
  234. package/dist/client/assets/automation-detail-BV87rs7m.js +0 -1
  235. package/dist/client/assets/automations-Dp0qrLbX.js +0 -1
  236. package/dist/client/assets/card-B4dTtsmd.js +0 -1
  237. package/dist/client/assets/chart-Caf0jSbB.js +0 -15
  238. package/dist/client/assets/collection-display-button-C0A6ba73.js +0 -1
  239. package/dist/client/assets/collection-tab-CTog7m1d.js +0 -1
  240. package/dist/client/assets/collection-table-wrapper-Ccujw2gS.js +0 -1
  241. package/dist/client/assets/connection-card-DXMFAvSL.js +0 -1
  242. package/dist/client/assets/connection-detail-D-M6vj9q.js +0 -1
  243. package/dist/client/assets/connections-BZmayWR_.js +0 -1
  244. package/dist/client/assets/constants-Dr5R1EQY.js +0 -1
  245. package/dist/client/assets/dialog-CTFHRhvl.js +0 -1
  246. package/dist/client/assets/dynamic-plugin-layout-CcrlbNZV.js +0 -1
  247. package/dist/client/assets/env-vars-editor-1feSU4JA.js +0 -1
  248. package/dist/client/assets/extract-connection-data-adtLKfGW.js +0 -1
  249. package/dist/client/assets/github-icon-Dp3wHhYE.js +0 -1
  250. package/dist/client/assets/home-Dxpbp1Bj.js +0 -1
  251. package/dist/client/assets/icon-picker-BKKuKn6y.js +0 -1
  252. package/dist/client/assets/index-B1uuY7UL.js +0 -1
  253. package/dist/client/assets/index-B_m3AdpY.js +0 -1
  254. package/dist/client/assets/index-BqlWbrG0.js +0 -1
  255. package/dist/client/assets/index-DmrxmdhV.css +0 -1
  256. package/dist/client/assets/integration-icon-BrOdBipR.js +0 -1
  257. package/dist/client/assets/layout-C4PDA52F.js +0 -1
  258. package/dist/client/assets/login-CTOJXY_r.js +0 -1
  259. package/dist/client/assets/mcp-server-card-AL30DdJr.js +0 -1
  260. package/dist/client/assets/mcp-server-detail-CN2kEGgD.js +0 -2
  261. package/dist/client/assets/members-CpLusvJM.js +0 -3
  262. package/dist/client/assets/monitoring-BNAsqD0Y.js +0 -31
  263. package/dist/client/assets/monitoring-dashboard-edit-CtIPN7nQ.js +0 -1
  264. package/dist/client/assets/org-ai-providers-Cu3Y8hG7.js +0 -1
  265. package/dist/client/assets/page-BWMoYp-g.js +0 -1
  266. package/dist/client/assets/page-Ch5Qzmi-.js +0 -1
  267. package/dist/client/assets/plugins-D5THwapv.js +0 -1
  268. package/dist/client/assets/project-app-view-D-VHvgqy.js +0 -1
  269. package/dist/client/assets/project-layout-Cd8cNifU.js +0 -1
  270. package/dist/client/assets/projects-list-Z8HiWxIk.js +0 -1
  271. package/dist/client/assets/readme-viewer-MbTGGbgZ.js +0 -1
  272. package/dist/client/assets/registry-utils-oSXyNc33.js +0 -1
  273. package/dist/client/assets/shell-layout-0dnPJSNe.js +0 -3
  274. package/dist/client/assets/tasks-BJvBlQqj.js +0 -1
  275. package/dist/client/assets/tools-list-BeUwtNiH.js +0 -1
  276. package/dist/client/assets/use-binding-DSWv53zN.js +0 -1
  277. package/dist/client/assets/use-llm-IG8InXvX.js +0 -1
  278. package/dist/client/assets/use-local-storage-C3Bo802w.js +0 -1
  279. package/dist/client/assets/useInfiniteQuery-BBGNgnIc.js +0 -1
  280. package/dist/client/assets/useQuery-BeFLqBun.js +0 -1
  281. package/dist/client/assets/useSuspenseInfiniteQuery-CdVyznmA.js +0 -1
  282. package/dist/client/assets/workflow-DUYpxPLh.js +0 -1
  283. package/dist/server/node_modules/pg-int8/LICENSE +0 -13
  284. package/dist/server/node_modules/pg-int8/README.md +0 -16
  285. package/dist/server/node_modules/pg-int8/index.js +0 -100
  286. package/dist/server/node_modules/pg-int8/package.json +0 -24
  287. package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
  288. package/dist/server/node_modules/postgres-array/index.js +0 -97
  289. package/dist/server/node_modules/postgres-array/license +0 -21
  290. package/dist/server/node_modules/postgres-array/package.json +0 -35
  291. package/dist/server/node_modules/postgres-array/readme.md +0 -43
  292. package/dist/server/node_modules/postgres-bytea/index.js +0 -33
  293. package/dist/server/node_modules/postgres-bytea/package.json +0 -34
  294. package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
  295. package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
  296. package/dist/server/node_modules/postgres-interval/index.js +0 -125
  297. package/dist/server/node_modules/postgres-interval/license +0 -21
  298. package/dist/server/node_modules/postgres-interval/package.json +0 -36
  299. package/dist/server/node_modules/postgres-interval/readme.md +0 -48
  300. /package/dist/client/assets/{readme-viewer-DWnTz46N.css → mcp-server-detail-DWnTz46N.css} +0 -0
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DO8fUd54.js","assets/index-DmrxmdhV.css","assets/index-BVSHvvtZ.js","assets/use-collections-C8rLdQUN.js","assets/useMutation-CNVq636e.js","assets/constants-B9t4Nuz_.js","assets/use-connection-BNGXvSqD.js","assets/use-mcp-tools-BCCglZve.js","assets/useQuery-BeFLqBun.js","assets/use-mcp-resources-BNoK6dDS.js","assets/use-mcp-prompts-D_02f3uO.js","assets/use-virtual-mcp-DoDJBE5n.js","assets/decopilot-events-Brt4gAR6.js","assets/usage-B8rgFVXq.js"])))=>i.map(i=>d[i]);
2
- import{r as Y,c as G,j as t,B as se,w as me,z as ze,K as ue,c1 as fe,u as _e,e as Ie,O as ie,g as Fe,d as Oe,bh as He,f as Ge,F as qe}from"./index-DO8fUd54.js";import{i as Ke}from"./AlertCircle-5ZbLDi3s.js";import{i as ke}from"./Loading01-WTkiPysv.js";import{P as de}from"./index-B1uuY7UL.js";import{b as We,c as Qe,a as Ye,T as Je}from"./tooltip-BLTgyg7W.js";import{i as Xe}from"./Check-CuWDIJeM.js";import{a as Ze}from"./Copy01-CPHBT83w.js";import{I as Te}from"./integration-icon-BrOdBipR.js";import{i as et}from"./CheckCircle-wz1RfkCA.js";import{t as tt}from"./ChevronDown-D0TXudCx.js";import{s as ve}from"./Plus-Dto-8y6a.js";import{a as st,c as rt,b as ot,D as nt}from"./dropdown-menu-Cp0O2jCN.js";import{n as be}from"./LinkExternal01-B21lACin.js";import{E as it}from"./empty-state-SBIKV11G.js";import{R as ye}from"./readme-viewer-MbTGGbgZ.js";import{u as pe}from"./useQuery-BeFLqBun.js";import{m as je}from"./marked.esm-BaswSlok.js";import{a as lt}from"./tools-list-BeUwtNiH.js";import{C as at}from"./collection-tabs-CHem1-m4.js";import{s as ct}from"./Globe02-Cn3qFriL.js";import{a as dt,b as mt,e as ut}from"./mcp-server-card-AL30DdJr.js";import{i as ft}from"./Terminal-BQ1GlFmm.js";import{B as pt,a as xt,b as Ne,d as ht,e as gt,c as vt}from"./breadcrumb-pLMl4xjy.js";import{u as bt}from"./use-binding-DSWv53zN.js";import{a as yt,b as jt,u as Nt}from"./use-connection-BNGXvSqD.js";import{u as wt}from"./constants-B9t4Nuz_.js";import{u as Ct}from"./use-mcp-tools-BCCglZve.js";import{u as St}from"./use-local-storage-C3Bo802w.js";import{e as _t}from"./extract-connection-data-adtLKfGW.js";import{s as It}from"./slugify-CEUa2lfQ.js";import{e as kt,g as Tt}from"./github-icon-Dp3wHhYE.js";import{f as Lt,d as we,g as Pt,h as Mt}from"./registry-utils-oSXyNc33.js";import{i as Rt}from"./InfoCircle-uEl5PLW5.js";import"./index-COM-PDLy.js";import"./Container-YdffBHg3.js";import"./ChevronRight-UJRwW9xN.js";import"./File06-ZV5CfSHG.js";import"./collection-display-button-C0A6ba73.js";import"./ArrowDown-B5WC3D5H.js";import"./ArrowUp-tKKJvEkq.js";import"./Grid01-Gq7hBl7S.js";import"./List-ySIwqood.js";import"./badge-C4uZcq7J.js";import"./collection-search-Mtc1qP5K.js";import"./SearchMd-Kap2MdR9.js";import"./input-BM9bdg-F.js";import"./collection-table-wrapper-Ccujw2gS.js";import"./table-DyNKuHyS.js";import"./card-B4dTtsmd.js";import"./types-BPYct9bF.js";import"./Eye-DDwMVcxZ.js";import"./LayersTwo01-B5fVqAUB.js";import"./layout-ubFJ5DPd.js";import"./CheckVerified02-cu3amtx9.js";import"./Lock01-DqO9uSP7.js";import"./binder-hd3C3mvD.js";import"./use-collections-C8rLdQUN.js";import"./useMutation-CNVq636e.js";import"./constants-Dr5R1EQY.js";import"./generate-id-Dyweu44Y.js";const Le=({size:r=24,color:e="currentColor",...s})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:r,height:r,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},Y.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));Le.displayName="SearchLg";function Dt(r){const e=G.c(3),{message:s}=r,o=s===void 0?"Loading MCP Server details...":s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ke,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let l;return e[1]!==o?(l=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,t.jsx("p",{className:"text-sm text-muted-foreground",children:o})]}),e[1]=o,e[2]=l):l=e[2],l}function Et(r){const e=G.c(9),{error:s,onBack:o}=r,n=s instanceof Error?s.message:s;let l,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ke,{size:48,className:"text-destructive mb-4"}),c=t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=l,e[1]=c):(l=e[0],c=e[1]);let m;e[2]!==n?(m=t.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=m):m=e[3];let a;e[4]!==o?(a=t.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=o,e[5]=a):a=e[5];let d;return e[6]!==m||e[7]!==a?(d=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[l,c,m,a]}),e[6]=m,e[7]=a,e[8]=d):d=e[8],d}function Ut(r){const e=G.c(5),{onBack:s}=r;let o,n,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Le,{size:48,className:"text-muted-foreground mb-4"}),n=t.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),l=t.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=o,e[1]=n,e[2]=l):(o=e[0],n=e[1],l=e[2]);let c;return e[3]!==s?(c=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[o,n,l,t.jsx("button",{onClick:s,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=s,e[4]=c):c=e[4],c}function $t(r){const e=G.c(11),{breadcrumb:s,shareUrl:o}=r,[n,l]=Y.useState(!1);let c;e[0]!==o?(c=async()=>{o&&(await navigator.clipboard.writeText(o),l(!0),me.success("Share link copied to clipboard"),setTimeout(()=>l(!1),2e3))},e[0]=o,e[1]=c):c=e[1];const m=c;let a;e[2]!==s?(a=t.jsx(de.Header.Left,{children:s}),e[2]=s,e[3]=a):a=e[3];let d;e[4]!==n||e[5]!==m||e[6]!==o?(d=o&&t.jsx(de.Header.Right,{children:t.jsx(We,{children:t.jsxs(Qe,{children:[t.jsx(Ye,{asChild:!0,children:t.jsxs(se,{variant:"outline",size:"sm",onClick:m,className:"gap-1.5 cursor-pointer",children:[n?t.jsx(Xe,{size:16,className:"text-green-600"}):t.jsx(Ze,{size:16}),t.jsx("span",{children:n?"Copied!":"Share"})]})}),t.jsx(Je,{children:t.jsx("p",{children:"Copy a universal link anyone can use to find this MCP"})})]})})}),e[4]=n,e[5]=m,e[6]=o,e[7]=d):d=e[7];let w;return e[8]!==a||e[9]!==d?(w=t.jsxs(de.Header,{children:[a,d]}),e[8]=a,e[9]=d,e[10]=w):w=e[10],w}function Ce(r){const e=G.c(28),{versions:s,selectedIndex:o,onSelect:n,isInstalling:l,variant:c,showLabel:m}=r,a=l===void 0?!1:l,d=c===void 0?"default":c,w=m===void 0?!1:m,p=s[o],I=w?"sm":"default",f=d==="default"&&"rounded-l-none px-2 border-l-2 border-l-white/50";let v;e[0]!==f?(v=ze("shrink-0 cursor-pointer",f),e[0]=f,e[1]=v):v=e[1];let u;e[2]!==p?.server?.version||e[3]!==w?(u=w&&t.jsxs("span",{className:"mr-1",children:["v",p?.server?.version||"unknown"]}),e[2]=p?.server?.version,e[3]=w,e[4]=u):u=e[4];const N=w?14:20;let h;e[5]!==N?(h=t.jsx(tt,{size:N}),e[5]=N,e[6]=h):h=e[6];let y;e[7]!==a||e[8]!==I||e[9]!==v||e[10]!==u||e[11]!==h||e[12]!==d?(y=t.jsx(st,{asChild:!0,children:t.jsxs(se,{variant:d,disabled:a,size:I,className:v,children:[u,h]})}),e[7]=a,e[8]=I,e[9]=v,e[10]=u,e[11]=h,e[12]=d,e[13]=y):y=e[13];let j;if(e[14]!==a||e[15]!==n||e[16]!==o||e[17]!==s){let T;e[19]!==a||e[20]!==n||e[21]!==o?(T=(S,_)=>{const M=S._meta?.["io.modelcontextprotocol.registry/official"];return t.jsx(rt,{onClick:()=>n(_),disabled:a,className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"font-medium text-sm",children:["v",S.server?.version||"unknown"]}),M?.isLatest&&t.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),_===o&&t.jsx(et,{size:16,className:"text-muted-foreground shrink-0"})]})},_)},e[19]=a,e[20]=n,e[21]=o,e[22]=T):T=e[22],j=s.map(T),e[14]=a,e[15]=n,e[16]=o,e[17]=s,e[18]=j}else j=e[18];let g;e[23]!==j?(g=t.jsx(ot,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:j}),e[23]=j,e[24]=g):g=e[24];let L;return e[25]!==y||e[26]!==g?(L=t.jsxs(nt,{children:[y,g]}),e[25]=y,e[26]=g,e[27]=L):L=e[27],L}function Vt(r){const e=G.c(46),{data:s,itemVersions:o,onInstall:n,canInstall:l,isInstalling:c,hideInstallControls:m,selectedVersionIndex:a,onVersionChange:d}=r,w=l===void 0?!0:l,p=c===void 0?!1:c,I=m===void 0?!1:m,[f,v]=Y.useState(0),u=a??f;let N;e[0]!==d?(N=U=>{v(U),d?.(U)},e[0]=d,e[1]=N):N=e[1];const h=N,y=o[u]||o[0];let j;e[2]!==y?.server?.remotes?(j=y?.server?.remotes??[],e[2]=y?.server?.remotes,e[3]=j):j=e[3];const g=j;let L;e[4]!==y?.server?.packages?(L=y?.server?.packages??[],e[4]=y?.server?.packages,e[5]=L):L=e[5];const S=L.length>0,_=g.length>0,M=g.findIndex(Bt),x=M>=0?M:0;let J;e[6]!==x||e[7]!==S||e[8]!==_||e[9]!==n||e[10]!==u?(J=()=>{_?n(u,x,void 0):S&&n(u,void 0,0)},e[6]=x,e[7]=S,e[8]=_,e[9]=n,e[10]=u,e[11]=J):J=e[11];const b=J;let R;e[12]!==o||e[13]!==n||e[14]!==h?(R=U=>{h(U);const O=o[U],W=O?.server?.remotes??[],q=O?.server?.packages??[];if(W.length>0){const oe=W.findIndex(At);n(U,oe>=0?oe:0,void 0)}else q.length>0&&n(U,void 0,0)},e[12]=o,e[13]=n,e[14]=h,e[15]=R):R=e[15];const A=R;let B;e[16]!==s.icon||e[17]!==s.name?(B=t.jsx(Te,{icon:s.icon,name:s.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=s.icon,e[17]=s.name,e[18]=B):B=e[18];let K;e[19]!==s.name?(K=t.jsx("h1",{className:"text-3xl font-medium",children:s.name}),e[19]=s.name,e[20]=K):K=e[20];let F;e[21]!==s.verified?(F=s.verified&&t.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=s.verified,e[22]=F):F=e[22];let k;e[23]!==K||e[24]!==F?(k=t.jsxs("div",{className:"flex items-center gap-2",children:[K,F]}),e[23]=K,e[24]=F,e[25]=k):k=e[25];let C;e[26]!==s.shortDescription?(C=s.shortDescription&&t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s.shortDescription}),e[26]=s.shortDescription,e[27]=C):C=e[27];let V;e[28]!==k||e[29]!==C?(V=t.jsxs("div",{className:"flex-1 min-w-0",children:[k,C]}),e[28]=k,e[29]=C,e[30]=V):V=e[30];let D;e[31]!==w||e[32]!==b||e[33]!==A||e[34]!==I||e[35]!==p||e[36]!==o||e[37]!==u||e[38]!==h?(D=w&&!I?t.jsx("div",{className:"shrink-0 flex items-center gap-2",children:o.length>1?t.jsxs("div",{className:"flex",children:[t.jsxs(se,{variant:"default",size:"sm",onClick:b,disabled:p,className:"shrink-0 rounded-r-none cursor-pointer",children:[t.jsx(ve,{size:20}),p?"Connecting...":"Connect"]}),t.jsx(Ce,{versions:o,selectedIndex:u,onSelect:A,isInstalling:p,variant:"outline"})]}):t.jsxs(se,{variant:"default",size:"sm",onClick:b,disabled:o.length===0||p,className:"shrink-0 cursor-pointer",children:[t.jsx(ve,{size:20}),p?"Connecting...":"Connect"]})}):I?o.length>1?t.jsx("div",{className:"shrink-0",children:t.jsx(Ce,{versions:o,selectedIndex:u,onSelect:h,isInstalling:p,variant:"outline",showLabel:!0})}):null:t.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=w,e[32]=b,e[33]=A,e[34]=I,e[35]=p,e[36]=o,e[37]=u,e[38]=h,e[39]=D):D=e[39];let E;e[40]!==V||e[41]!==D?(E=t.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[V,D]}),e[40]=V,e[41]=D,e[42]=E):E=e[42];let z;return e[43]!==E||e[44]!==B?(z=t.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[B,E]}),e[43]=E,e[44]=B,e[45]=z):z=e[45],z}function At(r){return r.type?.toLowerCase()==="http"||r.type?.toLowerCase()==="streamable-http"}function Bt(r){return r.type?.toLowerCase()==="http"||r.type?.toLowerCase()==="streamable-http"}function zt(r){if(!r)return"—";try{const e=new Date(r);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function Ft(r){const e=G.c(47),{data:s,publisherInfo:o,selectedItem:n}=r;let l;e[0]!==s.description?(l=s.description&&t.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[t.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),t.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:s.description})]}),e[0]=s.description,e[1]=l):l=e[1];const c=s.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":s.publisher;let m;e[2]!==o.logo||e[3]!==c?(m=t.jsx(Te,{icon:o.logo,name:c,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=o.logo,e[3]=c,e[4]=m):m=e[4];let a;e[5]!==s.publisher?(a=s.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":s.publisher.charAt(0).toUpperCase()+s.publisher.slice(1),e[5]=s.publisher,e[6]=a):a=e[6];let d;e[7]!==a?(d=t.jsx("div",{className:"font-medium",children:a}),e[7]=a,e[8]=d):d=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=w):w=e[9];let p;e[10]!==d?(p=t.jsxs("div",{children:[d,w]}),e[10]=d,e[11]=p):p=e[11];let I;e[12]!==m||e[13]!==p?(I=t.jsx("div",{className:"px-5 border-b border-border",children:t.jsxs("div",{className:"flex items-center gap-3 py-5",children:[m,p]})}),e[12]=m,e[13]=p,e[14]=I):I=e[14];let f;e[15]!==s.version?(f=s.version&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Version"}),t.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",s.version]})]}),e[15]=s.version,e[16]=f):f=e[16];let v;e[17]!==s.tags?(v=s.tags&&s.tags.length>0&&t.jsxs("div",{className:"flex justify-between items-start text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),t.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:s.tags.map(Ht)})]}),e[17]=s.tags,e[18]=v):v=e[18];let u;e[19]!==s.categories?(u=s.categories&&s.categories.length>0&&t.jsxs("div",{className:"flex justify-between items-start text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),t.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:s.categories.map(Ot)})]}),e[19]=s.categories,e[20]=u):u=e[20];let N;e[21]!==s.connectionType?(N=s.connectionType&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:s.connectionType})]}),e[21]=s.connectionType,e[22]=N):N=e[22];let h;e[23]!==s.schemaVersion?(h=s.schemaVersion&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),t.jsx("span",{className:"text-muted-foreground text-xs",children:s.schemaVersion})]}),e[23]=s.schemaVersion,e[24]=h):h=e[24];let y;e[25]!==s.websiteUrl?(y=s.websiteUrl&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Website"}),t.jsxs("a",{href:s.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[t.jsx("span",{children:"Visit"}),t.jsx(be,{size:14})]})]}),e[25]=s.websiteUrl,e[26]=y):y=e[26];let j;e[27]!==s.repository?(j=s.repository?.url&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Source"}),t.jsxs("a",{href:s.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[t.jsx("span",{children:"GitHub"}),t.jsx(be,{size:14})]})]}),e[27]=s.repository,e[28]=j):j=e[28];let g;e[29]!==v||e[30]!==u||e[31]!==N||e[32]!==h||e[33]!==y||e[34]!==j||e[35]!==f?(g=t.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[f,v,u,N,h,y,j]}),e[29]=v,e[30]=u,e[31]=N,e[32]=h,e[33]=y,e[34]=j,e[35]=f,e[36]=g):g=e[36];let L;e[37]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=L):L=e[37];let T;e[38]!==n.updated_at?(T=zt(n.updated_at),e[38]=n.updated_at,e[39]=T):T=e[39];let S;e[40]!==T?(S=t.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[L,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:T})]}),e[40]=T,e[41]=S):S=e[41];let _;return e[42]!==l||e[43]!==g||e[44]!==S||e[45]!==I?(_=t.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[l,I,g,S]}),e[42]=l,e[43]=g,e[44]=S,e[45]=I,e[46]=_):_=e[46],_}function Ot(r){return t.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:r},r)}function Ht(r){return t.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:r},r)}const Gt=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],qt={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function Kt(r){if(!r)return"Local";try{return new URL(r).hostname}catch{return r}}function Wt(r){if(!r)return"local";try{const e=new URL(r).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function Qt(r){const e=qt[r.toLowerCase()];return e||r.replace(/[-_]/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function Yt(r){if(!r)return"http";const e=r.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function Jt(r){return r.map((e,s)=>{const o=Yt(e.type),n=Kt(e.url),l=Wt(e.url),c=e.title||e.name||Qt(l);return{index:s,protocol:o,url:e.url,hostname:n,serviceName:l,displayName:c,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function Xt(r){const e=G.c(2),{protocol:s,className:o}=r;let n;return e[0]!==o?(n={http:t.jsx(ct,{className:o}),sse:t.jsx(mt,{className:o}),stdio:t.jsx(ft,{className:o})},e[0]=o,e[1]=n):n=e[1],n[s]}function Zt(r){const e=G.c(10),{options:s,selected:o,onSelect:n}=r;if(s.length<=1)return null;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=l):l=e[0];let c;if(e[1]!==n||e[2]!==s||e[3]!==o){let a;e[5]!==n||e[6]!==o?(a=d=>t.jsxs(se,{variant:o===d.value?"default":"outline",size:"sm",onClick:()=>n(d.value),className:"cursor-pointer",children:[t.jsx(Xt,{protocol:d.value==="all"?"http":d.value,className:"w-4 h-4 mr-1"}),d.label]},d.value),e[5]=n,e[6]=o,e[7]=a):a=e[7],c=s.map(a),e[1]=n,e[2]=s,e[3]=o,e[4]=c}else c=e[4];let m;return e[8]!==c?(m=t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l,t.jsx("div",{className:"flex gap-1",children:c})]}),e[8]=c,e[9]=m):m=e[9],m}function es(r){const e=G.c(11),{servers:s,onInstall:o,isInstalling:n,icon:l,mcpName:c,showStdio:m}=r,a=n===void 0?!1:n,d=m===void 0?!1:m,w=d?s:s.filter(os),p=Jt(w),I=p.length<13?"all":"http",[f,v]=Y.useState(I);let u;e:{if(f==="all"){u="all";break e}let x;if(e[0]!==f?(x=b=>b.protocol===f,e[0]=f,e[1]=x):x=e[1],p.some(x)){u=f;break e}if(p.length<13){u="all";break e}u=p[0]?.protocol??"http"}const N=u,h=N==="all"?p:p.filter(x=>x.protocol===N),y=new Set(p.map(rs));let j=Gt.filter(x=>x.value==="all"||y.has(x.value));d||(j=j.filter(ss));const g=y.size<=1?j.filter(ts):j,L="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let T;e[2]!==l||e[3]!==a||e[4]!==c||e[5]!==o?(T=x=>t.jsx(dt,{variant:"server",icon:l??null,displayName:x.displayName,description:x.description??null,hostname:x.hostname,protocol:x.protocol,isInstalling:a,onClick:()=>o({type:x.protocol,url:x.url,name:x.name,title:x.title,description:x.description,_type:x._type,_index:x._index})},`${x.hostname}-${x.protocol}-${x.index}`),e[2]=l,e[3]=a,e[4]=c,e[5]=o,e[6]=T):T=e[6];const S=h.map(T);let _;e[7]!==S?(_=t.jsx("div",{className:L,children:S}),e[7]=S,e[8]=_):_=e[8];let M;return e[9]!==h.length?(M=h.length===0&&t.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=h.length,e[10]=M):M=e[10],t.jsxs("div",{className:"p-5",children:[t.jsx(Zt,{options:g,selected:N,onSelect:v}),_,M]})}function ts(r){return r.value!=="all"}function ss(r){return r.value!=="stdio"}function rs(r){return r.protocol}function os(r){return r.type?.toLowerCase()!=="stdio"}async function Se(r){return(await fe(async()=>{const{default:s}=await import("./purify.es-CovBOfck.js");return{default:s}},[])).default.sanitize(r,{USE_PROFILES:{html:!0},FORBID_TAGS:["style","form"],FORBID_ATTR:["style"]})}function ns(r){const e=G.c(53),{data:s,availableTabs:o,effectiveActiveTabId:n,effectiveTools:l,isLoadingTools:c,onTabChange:m,servers:a,onInstallServer:d,isInstalling:w,mcpIcon:p,mcpName:I,showStdio:f}=r,v=c===void 0?!1:c;let u;e[0]!==a?(u=a===void 0?[]:a,e[0]=a,e[1]=u):u=e[1];const N=u,h=w===void 0?!1:w,y=f===void 0?!1:f;let j;e[2]!==s.readmeMarkdown?(j=s.readmeMarkdown?.trim(),e[2]=s.readmeMarkdown,e[3]=j):j=e[3];const g=!!j;let L;e[4]!==s.readmeUrl?(L=s.readmeUrl?.trim(),e[4]=s.readmeUrl,e[5]=L):L=e[5];const T=!!L;let S;e[6]!==s.readmeMarkdown?(S=ue.storeReadmeUrl(`embedded:${s.readmeMarkdown}`),e[6]=s.readmeMarkdown,e[7]=S):S=e[7];let _;e[8]!==s.readmeMarkdown?(_=async()=>{const q=je.parse(s.readmeMarkdown??"",{async:!1});return Se(q)},e[8]=s.readmeMarkdown,e[9]=_):_=e[9];let M;e[10]!==g||e[11]!==S||e[12]!==_?(M={queryKey:S,queryFn:_,enabled:g,staleTime:1/0},e[10]=g,e[11]=S,e[12]=_,e[13]=M):M=e[13];const{data:x,isLoading:J}=pe(M);let b;e[14]!==s.readmeUrl?(b=ue.storeReadmeUrl(s.readmeUrl),e[14]=s.readmeUrl,e[15]=b):b=e[15];let R;e[16]!==s.readmeUrl?(R=async()=>{if(!s.readmeUrl)return null;const q=await fetch(s.readmeUrl);if(!q.ok)throw new Error(`Failed to fetch README (${q.status})`);const re=await q.text();return Se(je.parse(re,{async:!1}))},e[16]=s.readmeUrl,e[17]=R):R=e[17];const A=T&&!g;let B;e[18]!==b||e[19]!==R||e[20]!==A?(B={queryKey:b,queryFn:R,enabled:A,staleTime:36e5,gcTime:864e5},e[18]=b,e[19]=R,e[20]=A,e[21]=B):B=e[21];const{data:K,isLoading:F}=pe(B),k=x??K??null,C=g&&J||!g&&F;let V;e[22]!==l?(V=l.map(is),e[22]=l,e[23]=V):V=e[23];const D=V;let E;e[24]!==o||e[25]!==n||e[26]!==m?(E=o.length>0&&t.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:t.jsx(at,{tabs:o,activeTab:n,onTabChange:m})}),e[24]=o,e[25]=n,e[26]=m,e[27]=E):E=e[27];let z;e[28]!==n||e[29]!==h||e[30]!==p||e[31]!==I||e[32]!==d||e[33]!==N||e[34]!==y?(z=n==="servers"&&N.length>0&&t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(es,{servers:N,onInstall:q=>d?.(q),isInstalling:h,icon:p,mcpName:I,showStdio:y})}),e[28]=n,e[29]=h,e[30]=p,e[31]=I,e[32]=d,e[33]=N,e[34]=y,e[35]=z):z=e[35];let U;e[36]!==n||e[37]!==l.length||e[38]!==v||e[39]!==D?(U=n==="tools"&&t.jsx("div",{className:"flex flex-col flex-1",children:v?t.jsxs("div",{className:"flex items-center justify-center p-8",children:[t.jsx(ke,{size:24,className:"animate-spin"}),t.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):l.length>0?t.jsx(lt,{tools:D,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):t.jsx(it,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[36]=n,e[37]=l.length,e[38]=v,e[39]=D,e[40]=U):U=e[40];let O;e[41]!==k||e[42]!==C||e[43]!==s.repository||e[44]!==n||e[45]!==g||e[46]!==T?(O=n==="readme"&&t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:g||T?t.jsx(ye,{html:k,isLoading:C}):t.jsx(ye,{repository:s?.repository})}),e[41]=k,e[42]=C,e[43]=s.repository,e[44]=n,e[45]=g,e[46]=T,e[47]=O):O=e[47];let W;return e[48]!==E||e[49]!==z||e[50]!==U||e[51]!==O?(W=t.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[E,z,U,O]}),e[48]=E,e[49]=z,e[50]=U,e[51]=O,e[52]=W):W=e[52],W}function is(r){const e=r;return{name:e.name||"",description:e.description||void 0}}function ls(r,e){if(!r||!e)return;const s=e.toLowerCase();return r.find(o=>o.app_name?.toLowerCase()===s||o.app_id?.toLowerCase()===s||o.title.toLowerCase()===s)||r.find(o=>o.title.toLowerCase().includes(s))}function as(r,e,s,o,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:o?.icon||void 0,count:n??r.length};const l=e.toLowerCase(),c=r.filter(a=>(a._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":a.publisher||a._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===l);return{logo:s?.icon||c[0]?.publisher_logo||c[0]?.icon||void 0,count:c.length}}function cs(r){const e=r._meta?.["mcp.mesh"],s=r._meta?.["io.modelcontextprotocol.registry/official"],o=r.server??{},n=Pt(o?.remotes?.[0]?.type),l=Mt(o?.$schema),c=r.id?.includes("/")?r.id.split("/")[0]:void 0,m=s?"io.modelcontextprotocol.registry/official":r.publisher||e?.scopeName||c||"Unknown",a=Tt(o.repository),d=r.icon||r.image||r.logo||o.icons?.[0]?.src||a||null,w=r.name||r.title||r.server?.title||"Unnamed Item",p=ut(w),I=e?.friendly_name||p,f=e?.mesh_description||r.description||r.summary||o?.description||"",v=e?.short_description||null,u=typeof e?.readme=="string"?e.readme:null,N=typeof e?.readme_url=="string"?e.readme_url:null,h=e?.tags||[],y=e?.categories||[];return{name:I,description:f,shortDescription:v,readmeMarkdown:u,readmeUrl:N,icon:d,verified:r.verified||e?.verified,publisher:m,version:o.version||null,websiteUrl:o.websiteUrl||null,repository:o.repository||null,schemaVersion:l??null,connectionType:n,connectionUrl:o?.remotes?.[0]?.url||null,remoteUrl:o?.remotes?.[0]?.url||null,tags:h,categories:y,tools:r.tools||o.tools||e?.tools||[],models:r.models||o.models||e?.models||[],emails:r.emails||o.emails||e?.emails||[],analytics:r.analytics||o.analytics||e?.analytics,cdn:r.cdn||o.cdn||e?.cdn}}class ds extends Y.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,s){console.error("Store MCP server detail error:",e,s)}render(){return this.state.hasError?t.jsx(Et,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ms(){const{org:r}=_e(),e=Ie(),{appName:s}=Fe({strict:!1}),{registryId:o,serverName:n,stdio:l}=Oe({strict:!1}),[c,m]=St(He.storeShowStdio(),()=>!1),a=l==="true"?!0:l==="false"?!1:c;l!==void 0&&l==="true"!==c&&m(l==="true");const[d,w]=Y.useState(null),[p,I]=Y.useState(null),[f,v]=Y.useState(null),u=yt(),N=jt(),{data:h}=Ge.useSession(),y=bt(N),j=o||y[0]?.id||"",g=Nt(j),L=Lt(g?.tools),T=we(g?.tools??null,"_VERSIONS"),S=we(g?.tools??null,"_GET"),_=!!n;let M="",x={};_?(M=T||S,x={name:n}):(M=L,x={});const J=wt({connectionId:j||null,orgId:r.id}),{data:b}=Ct({client:J,toolName:M,toolArguments:x,select:i=>i.structuredContent??i});let R=[],A=[],B=null;if(b){if(Array.isArray(b))R=b;else if(typeof b=="object"&&b!==null)if("totalCount"in b&&typeof b.totalCount=="number"&&(B=b.totalCount),"item"in b&&b.item){const i=b.item;R=[{id:i.id||"",title:i.title,server:i.server,_meta:i._meta}]}else{let i;"versions"in b&&Array.isArray(b.versions)?i="versions":"servers"in b&&Array.isArray(b.servers)?i="servers":i=Object.keys(b).find(P=>Array.isArray(b[P])),i&&(R=b[i],(i==="versions"||M?.includes("VERSIONS"))&&(A=R))}}const K=(()=>{const i=A.findIndex(P=>P._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0);return i>=0?i:0})(),F=p??K;let k=R.find(i=>{const P=i.name||i.title||i.server?.title||"";return It(P)===s});!k&&n&&(k=R.find(i=>i.id===n||i.server?.name===n||i.name===n||i.title===n));const C=k?cs(k):null,V=(C?.tools?.length||0)>0,D=k?.server?.remotes?.[0]?.url||null,E=!V&&!!D,z=pe({queryKey:ue.remoteMcpTools(D),queryFn:async()=>{if(!D)return[];const{Client:i}=await fe(async()=>{const{Client:X}=await import("./index-DO8fUd54.js").then($=>$.c$);return{Client:X}},__vite__mapDeps([0,1])),{StreamableHTTPClientTransport:P}=await fe(async()=>{const{StreamableHTTPClientTransport:X}=await import("./index-BVSHvvtZ.js");return{StreamableHTTPClientTransport:X}},__vite__mapDeps([2,0,1,3,4,5,6,7,8,9,10,11,12,13])),H=new i({name:"mesh-store",version:"1.0.0"}),Q=new P(new URL(D),{requestInit:{headers:{Accept:"application/json, text/event-stream","Content-Type":"application/json"}}});try{return await H.connect(Q),((await H.listTools()).tools||[]).map($=>({name:$.name,description:$.description}))}finally{await H.close().catch(console.error)}},enabled:E}),U=E&&z.isLoading,O=z.data??[],W=V?C?.tools||[]:O,q=ls(N,C?.publisher),re=C?as(R,C.publisher,q,g??null,B):{count:0},oe=C?.repository?kt(C.repository):null,Pe=k?.server?.remotes??[],Me=k?.server?.packages??[],le=[...Pe.map((i,P)=>({...i,_type:"remote",_index:P})),...Me.map((i,P)=>({type:"stdio",url:void 0,name:i.name||i.identifier,title:i.name||i.identifier?.replace(/^@[^/]+\//,""),description:i.environmentVariables?.length?`Requires ${i.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:P}))],xe=a?le:le.filter(i=>i.type?.toLowerCase()!=="stdio"),he=xe.length>1,Z=[{id:"servers",label:"Servers",count:xe.length,visible:he},{id:"readme",label:"README",visible:!!C?.readmeMarkdown||!!C?.readmeUrl||!!C?.repository&&!!oe},{id:"tools",label:"Tools",count:W.length,visible:V||O.length>0||!!D}].filter(i=>i.visible),Re=Z.find(i=>i.id==="servers")?.id||Z.find(i=>i.id==="readme")?.id||Z[0]?.id||"overview",De=d&&Z.find(i=>i.id===d)?d:Re,ae=async(i,P,H,Q)=>{const X=A[i??0]||k;if(!X||!r||!h?.user?.id)return;const $=_t(X,r.id,h.user.id,{remoteIndex:H===void 0?P??0:void 0,packageIndex:H}),ee=$.connection_type==="STDIO",ne=!!$.connection_url,Be=ee&&$.connection_headers&&typeof $.connection_headers=="object"&&"command"in $.connection_headers;if(!ne&&!Be){me.error("This MCP Server cannot be connected: no connection method available");return}Q&&($.title=Q);try{const{id:te}=await u.create.mutateAsync($);e({to:"/$org/$project/mcps/$connectionId",params:{org:r.slug,project:ie,connectionId:te}})}catch(te){me.error(`Failed to connect MCP Server: ${te instanceof Error?te.message:String(te)}`)}},ce=async(i,P,H)=>{const Q=A[i??0]||k;if(!Q)return;const X=Q.id??Q.title,$=N.filter(ee=>ee.app_name===X||ee.title===Q.title);if($.length>0){const ne=`${Q.title||"MCP Server"} (${$.length+1})`;v({step:"warning",existing:$,pendingArgs:[i,P,H],suggestedName:ne,customName:ne});return}ae(i,P,H)},Ee=()=>{e({to:"/$org/$project/store",params:{org:r.slug,project:ie}})};if(!k)return t.jsx(Ut,{onBack:Ee});if(!C)return null;const Ue=(k?.server?.remotes?.length??0)>0,$e=(k?.server?.packages?.length??0)>0,ge=Ue||$e,Ve=t.jsx(pt,{children:t.jsxs(xt,{children:[t.jsx(Ne,{children:t.jsx(ht,{asChild:!0,children:t.jsx(qe,{to:"/$org/$project/store",params:{org:r.slug,project:ie},children:"Store"})})}),t.jsx(gt,{}),t.jsx(Ne,{children:t.jsx(vt,{children:C.name})})]})}),Ae=(()=>{const i=new URL(`/store/${encodeURIComponent(s||"")}`,window.location.origin);return n&&i.searchParams.set("serverName",n),i.href})();return t.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[f&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:()=>v(null),children:t.jsx("div",{className:"bg-background border rounded-lg shadow-lg p-6 max-w-md w-full mx-4",onClick:i=>i.stopPropagation(),children:f.step==="warning"?t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"text-lg font-semibold mb-2",children:"MCP Already Installed"}),t.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["You already have"," ",t.jsx("strong",{children:f.existing.length})," instance",f.existing.length!==1?"s":""," of this MCP installed:"]}),t.jsx("ul",{className:"text-sm space-y-1 mb-4 max-h-32 overflow-auto",children:f.existing.map(i=>t.jsxs("li",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("span",{className:"font-medium text-foreground",children:i.title}),t.jsxs("span",{className:"text-xs",children:["(",i.created_at?new Date(i.created_at).toLocaleDateString():"—",")"]})]},i.id))}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md border hover:bg-muted/50 transition-colors",onClick:()=>v(null),children:"Cancel"}),t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",onClick:()=>v({...f,step:"rename"}),children:"Install Anyway"})]})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Choose a name"}),t.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Give this instance a different name to distinguish it, or keep the suggested one."}),t.jsx("input",{type:"text",className:"w-full rounded-md border bg-transparent px-3 py-2 text-sm mb-4 focus:outline-none focus:ring-2 focus:ring-primary",value:f.customName,onChange:i=>v({...f,customName:i.target.value}),onKeyDown:i=>{if(i.key==="Enter"){const P=f.customName.trim()||f.suggestedName,H=f.pendingArgs;v(null),ae(...H,P)}},autoFocus:!0}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md border hover:bg-muted/50 transition-colors",onClick:()=>v({...f,step:"warning"}),children:"Back"}),t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",onClick:()=>{const i=f.customName.trim()||f.suggestedName,P=f.pendingArgs;v(null),ae(...P,i)},children:"Install"})]})]})})}),t.jsx($t,{breadcrumb:Ve,shareUrl:Ae}),t.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:t.jsx("div",{className:"h-full",children:t.jsxs("div",{className:"h-full",children:[!ge&&t.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[t.jsx(Rt,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t.jsx(Vt,{data:C,itemVersions:A.length>0?A:[k],onInstall:ce,canInstall:ge,isInstalling:u.create.isPending,hideInstallControls:he,selectedVersionIndex:F,onVersionChange:I}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[t.jsx(Ft,{data:C,publisherInfo:re,selectedItem:k}),t.jsx(ns,{data:C,availableTabs:Z,effectiveActiveTabId:De,effectiveTools:W,isLoadingTools:U,onTabChange:w,servers:le,onInstallServer:i=>{i._type==="remote"?ce(F,i._index,void 0):ce(F,void 0,i._index)},isInstalling:u.create.isPending,mcpIcon:C.icon,mcpName:C.name,showStdio:a})]})]})})})]})}function vr(){const r=G.c(6),{org:e}=_e(),s=Ie();let o;r[0]!==s||r[1]!==e.slug?(o=()=>{s({to:"/$org/$project/store",params:{org:e.slug,project:ie}})},r[0]=s,r[1]=e.slug,r[2]=o):o=r[2];const n=o;let l;r[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Y.Suspense,{fallback:t.jsx(Dt,{}),children:t.jsx(ms,{})}),r[3]=l):l=r[3];let c;return r[4]!==n?(c=t.jsx(ds,{onBack:n,children:l}),r[4]=n,r[5]=c):c=r[5],c}export{vr as default};
@@ -1,3 +0,0 @@
1
- import{r as k,c as oe,z as J,j as s,p as Wt,B as ie,u as Te,f as me,K as ue,o as Nt,D as Xe,n as Ce,bG as vt,bI as It,x as Me,t as Ut,q as Xt,w as le,v as es,E as ts}from"./index-DO8fUd54.js";import{C as ss}from"./collection-display-button-C0A6ba73.js";import{C as De}from"./collection-search-Mtc1qP5K.js";import{P as ve}from"./index-B1uuY7UL.js";import{B as ns,a as os,b as rs,c as is}from"./breadcrumb-pLMl4xjy.js";import{C as ls}from"./collection-table-wrapper-Ccujw2gS.js";import{P as as,D as cs}from"./ai-providers-logos-W57Qm-EN.js";import{I as kt}from"./integration-icon-BrOdBipR.js";import{C as ke}from"./checkbox-D2IG7klY.js";import{i as ds}from"./ArrowLeft-D0Lalw4x.js";import{b as Vt}from"./use-connection-BNGXvSqD.js";import{u as bt}from"./use-members-Cqa4gqXV.js";import{u as it}from"./useQuery-BeFLqBun.js";import{u as Ne}from"./useMutation-CNVq636e.js";import{b as ms,c as us}from"./use-llm-IG8InXvX.js";import{A as Pe}from"./avatar-ChRCLY4k.js";import{B as Ie}from"./badge-C4uZcq7J.js";import{f as Ve,a as ze,b as Ge,c as Be,d as $e,e as Fe,A as Ke,h as He}from"./alert-dialog-DtAWdTyc.js";import{D as zt,f as Gt,a as Bt,b as fs,c as hs,e as gs}from"./dialog-CTFHRhvl.js";import{D as Ct,a as Tt,b as Et,c as nt,e as ps,d as xs,f as bs,h as Cs}from"./dropdown-menu-Cp0O2jCN.js";import{i as Ts}from"./DotsHorizontal-DUoeCjzn.js";import{i as Qe}from"./Loading01-WTkiPysv.js";import{i as Es}from"./Lock01-DqO9uSP7.js";import{s as ot}from"./Plus-Dto-8y6a.js";import{s as $t}from"./Trash01-DkXbOnbi.js";import{i as Ot}from"./X-CNbskBah.js";import{I as js}from"./input-BM9bdg-F.js";import{S as je}from"./switch-DyxdcdWl.js";import{b as Oe,c as Ae,a as ye,T as Se}from"./tooltip-BLTgyg7W.js";import{E as ct}from"./empty-state-SBIKV11G.js";import{a as Ns,F as At,b as yt,c as vs,d as St,f as _t}from"./form-DPPO-3Tw.js";import{S as ft,a as ht,b as gt,c as pt,d as xt}from"./select-RxUFw6pZ.js";import{T as Is}from"./textarea-BLuscN8X.js";import{a as qe,u as Je}from"./constants-B9t4Nuz_.js";import{C as Rt}from"./card-B4dTtsmd.js";import{i as Ft}from"./DotsVertical-BaBvJOuP.js";import{i as Os}from"./Key01-IptFTL_3.js";import{i as Kt}from"./Shield01-CJ-f24yL.js";import{s as Ht}from"./XClose-B0FgAxIQ.js";import{C as dt,e as mt,f as wt,d as As,a as ys,b as Ss,c as _s}from"./command-DRBqjkmt.js";import{a as Rs,b as ws,P as Ls}from"./popover-D1WG-emQ.js";import{t as Ps}from"./ChevronDown-D0TXudCx.js";import"./ArrowDown-B5WC3D5H.js";import"./ArrowUp-tKKJvEkq.js";import"./Check-CuWDIJeM.js";import"./Grid01-Gq7hBl7S.js";import"./List-ySIwqood.js";import"./SearchMd-Kap2MdR9.js";import"./use-local-storage-C3Bo802w.js";import"./ChevronRight-UJRwW9xN.js";import"./table-DyNKuHyS.js";import"./Container-YdffBHg3.js";import"./use-collections-C8rLdQUN.js";import"./index-COM-PDLy.js";import"./label-CnT8WAQY.js";import"./ChevronUp-DXMXl76b.js";import"./index-B_m3AdpY.js";const Qt=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M20 17H4m0 0 4-4m-4 4 4 4M4 7h16m0 0-4-4m4 4-4 4"}));Qt.displayName="SwitchHorizontal01";const qt=[{name:"ORGANIZATION_CREATE",description:"Create a new organization",category:"Organizations"},{name:"ORGANIZATION_LIST",description:"List organizations",category:"Organizations"},{name:"ORGANIZATION_GET",description:"View organization details",category:"Organizations"},{name:"ORGANIZATION_UPDATE",description:"Update organization",category:"Organizations"},{name:"ORGANIZATION_DELETE",description:"Delete organization",category:"Organizations",dangerous:!0},{name:"ORGANIZATION_SETTINGS_GET",description:"View organization settings",category:"Organizations"},{name:"ORGANIZATION_SETTINGS_UPDATE",description:"Update organization settings",category:"Organizations"},{name:"ORGANIZATION_MEMBER_ADD",description:"Add members",category:"Organizations"},{name:"ORGANIZATION_MEMBER_REMOVE",description:"Remove members",category:"Organizations",dangerous:!0},{name:"ORGANIZATION_MEMBER_LIST",description:"List members",category:"Organizations"},{name:"ORGANIZATION_MEMBER_UPDATE_ROLE",description:"Update member roles",category:"Organizations"},{name:"COLLECTION_CONNECTIONS_CREATE",description:"Create connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_LIST",description:"List connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_GET",description:"View connection details",category:"Connections"},{name:"COLLECTION_CONNECTIONS_UPDATE",description:"Update connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_DELETE",description:"Delete connections",category:"Connections",dangerous:!0},{name:"CONNECTION_TEST",description:"Test connections",category:"Connections"},{name:"DATABASES_RUN_SQL",description:"Run SQL queries",category:"Connections",dangerous:!0},{name:"COLLECTION_VIRTUAL_MCP_CREATE",description:"Create virtual MCPs",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_LIST",description:"List virtual MCPs",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_GET",description:"View virtual MCP details",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_UPDATE",description:"Update virtual MCPs",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_DELETE",description:"Delete virtual MCPs",category:"Virtual MCPs",dangerous:!0},{name:"COLLECTION_VIRTUAL_TOOLS_CREATE",description:"Create virtual tools on Virtual MCPs",category:"Virtual Tools"},{name:"COLLECTION_VIRTUAL_TOOLS_LIST",description:"List virtual tools",category:"Virtual Tools"},{name:"COLLECTION_VIRTUAL_TOOLS_GET",description:"View virtual tool details",category:"Virtual Tools"},{name:"COLLECTION_VIRTUAL_TOOLS_UPDATE",description:"Update virtual tools",category:"Virtual Tools"},{name:"COLLECTION_VIRTUAL_TOOLS_DELETE",description:"Delete virtual tools",category:"Virtual Tools",dangerous:!0},{name:"MONITORING_LOGS_LIST",description:"List monitoring logs",category:"Monitoring"},{name:"MONITORING_STATS",description:"View monitoring statistics",category:"Monitoring"},{name:"MONITORING_DASHBOARD_CREATE",description:"Create monitoring dashboards",category:"Monitoring"},{name:"MONITORING_DASHBOARD_GET",description:"View dashboard details",category:"Monitoring"},{name:"MONITORING_DASHBOARD_LIST",description:"List monitoring dashboards",category:"Monitoring"},{name:"MONITORING_DASHBOARD_UPDATE",description:"Update monitoring dashboards",category:"Monitoring"},{name:"MONITORING_DASHBOARD_DELETE",description:"Delete monitoring dashboards",category:"Monitoring",dangerous:!0},{name:"MONITORING_DASHBOARD_QUERY",description:"Query dashboard widget data",category:"Monitoring"},{name:"MONITORING_WIDGET_PREVIEW",description:"Preview widget aggregation",category:"Monitoring"},{name:"API_KEY_CREATE",description:"Create API key",category:"API Keys"},{name:"API_KEY_LIST",description:"List API keys",category:"API Keys"},{name:"API_KEY_UPDATE",description:"Update API key",category:"API Keys"},{name:"API_KEY_DELETE",description:"Delete API key",category:"API Keys",dangerous:!0},{name:"EVENT_PUBLISH",description:"Publish events",category:"Event Bus"},{name:"EVENT_SUBSCRIBE",description:"Subscribe to events",category:"Event Bus"},{name:"EVENT_UNSUBSCRIBE",description:"Unsubscribe from events",category:"Event Bus"},{name:"EVENT_CANCEL",description:"Cancel recurring events",category:"Event Bus"},{name:"EVENT_ACK",description:"Acknowledge event delivery",category:"Event Bus"},{name:"EVENT_SUBSCRIPTION_LIST",description:"List event subscriptions",category:"Event Bus"},{name:"EVENT_SYNC_SUBSCRIPTIONS",description:"Sync subscriptions to desired state",category:"Event Bus"},{name:"USER_GET",description:"Get a user by id",category:"Users"},{name:"CODE_EXECUTION_SEARCH_TOOLS",description:"Search available tools by name or description",category:"Code Execution"},{name:"CODE_EXECUTION_DESCRIBE_TOOLS",description:"Get detailed schemas for specific tools",category:"Code Execution"},{name:"CODE_EXECUTION_RUN_CODE",description:"Run JavaScript code in a sandbox with tool access",category:"Code Execution",dangerous:!0},{name:"COLLECTION_THREADS_CREATE",description:"Create threads",category:"Threads"},{name:"COLLECTION_THREADS_LIST",description:"List threads",category:"Threads"},{name:"COLLECTION_THREADS_GET",description:"View thread details",category:"Threads"},{name:"COLLECTION_THREADS_UPDATE",description:"Update threads",category:"Threads"},{name:"COLLECTION_THREADS_DELETE",description:"Delete threads",category:"Threads",dangerous:!0},{name:"COLLECTION_THREAD_MESSAGES_LIST",description:"List thread messages",category:"Threads"},{name:"TAGS_LIST",description:"List organization tags",category:"Tags"},{name:"TAGS_CREATE",description:"Create organization tag",category:"Tags"},{name:"TAGS_DELETE",description:"Delete organization tag",category:"Tags",dangerous:!0},{name:"MEMBER_TAGS_GET",description:"Get member tags",category:"Tags"},{name:"MEMBER_TAGS_SET",description:"Set member tags",category:"Tags"},{name:"AUTOMATION_CREATE",description:"Create automation",category:"Automations"},{name:"AUTOMATION_GET",description:"View automation details",category:"Automations"},{name:"AUTOMATION_LIST",description:"List automations",category:"Automations"},{name:"AUTOMATION_UPDATE",description:"Update automation",category:"Automations"},{name:"AUTOMATION_DELETE",description:"Delete automation",category:"Automations",dangerous:!0},{name:"AUTOMATION_TRIGGER_ADD",description:"Add trigger to automation",category:"Automations"},{name:"AUTOMATION_TRIGGER_REMOVE",description:"Remove trigger from automation",category:"Automations"},{name:"AUTOMATION_RUN",description:"Manually trigger an automation run",category:"Automations"},{name:"PROJECT_LIST",description:"List projects in organization",category:"Projects"},{name:"PROJECT_GET",description:"View project details",category:"Projects"},{name:"PROJECT_CREATE",description:"Create new project",category:"Projects"},{name:"PROJECT_UPDATE",description:"Update project",category:"Projects"},{name:"PROJECT_DELETE",description:"Delete project",category:"Projects",dangerous:!0},{name:"PROJECT_PLUGIN_CONFIG_GET",description:"View project plugin configuration",category:"Projects"},{name:"PROJECT_PLUGIN_CONFIG_UPDATE",description:"Update project plugin configuration",category:"Projects"},{name:"PROJECT_CONNECTION_LIST",description:"List project connections",category:"Projects"},{name:"PROJECT_CONNECTION_ADD",description:"Add connection to project",category:"Projects"},{name:"PROJECT_CONNECTION_REMOVE",description:"Remove connection from project",category:"Projects"},{name:"PROJECT_PINNED_VIEWS_UPDATE",description:"Update project pinned sidebar views",category:"Projects"},{name:"AI_PROVIDERS_LIST",description:"List available AI providers",category:"AI Providers"},{name:"AI_PROVIDERS_LIST_MODELS",description:"List AI provider models",category:"AI Providers"},{name:"AI_PROVIDERS_ACTIVE",description:"List active AI providers",category:"AI Providers"},{name:"AI_PROVIDER_KEY_CREATE",description:"Store AI provider API key",category:"AI Providers"},{name:"AI_PROVIDER_KEY_LIST",description:"List AI provider API keys",category:"AI Providers"},{name:"AI_PROVIDER_KEY_DELETE",description:"Delete AI provider API key",category:"AI Providers",dangerous:!0},{name:"AI_PROVIDER_OAUTH_URL",description:"Get OAuth URL for provider",category:"AI Providers"},{name:"AI_PROVIDER_OAUTH_EXCHANGE",description:"Exchange OAuth code for API key",category:"AI Providers"}],Ms={ORGANIZATION_CREATE:"Create organization",ORGANIZATION_LIST:"List organizations",ORGANIZATION_GET:"View organization details",ORGANIZATION_UPDATE:"Update organization",ORGANIZATION_DELETE:"Delete organization",ORGANIZATION_SETTINGS_GET:"View organization settings",ORGANIZATION_SETTINGS_UPDATE:"Update organization settings",ORGANIZATION_MEMBER_LIST:"List members",ORGANIZATION_MEMBER_ADD:"Add members",ORGANIZATION_MEMBER_REMOVE:"Remove members",ORGANIZATION_MEMBER_UPDATE_ROLE:"Update member roles",COLLECTION_CONNECTIONS_LIST:"List connections",COLLECTION_CONNECTIONS_GET:"View connection details",COLLECTION_CONNECTIONS_CREATE:"Create connections",COLLECTION_CONNECTIONS_UPDATE:"Update connections",COLLECTION_CONNECTIONS_DELETE:"Delete connections",CONNECTION_TEST:"Test connections",DATABASES_RUN_SQL:"Run SQL queries",COLLECTION_VIRTUAL_MCP_CREATE:"Create virtual MCPs",COLLECTION_VIRTUAL_MCP_LIST:"List virtual MCPs",COLLECTION_VIRTUAL_MCP_GET:"View virtual MCP details",COLLECTION_VIRTUAL_MCP_UPDATE:"Update virtual MCPs",COLLECTION_VIRTUAL_MCP_DELETE:"Delete virtual MCPs",COLLECTION_VIRTUAL_TOOLS_CREATE:"Create virtual tools",COLLECTION_VIRTUAL_TOOLS_LIST:"List virtual tools",COLLECTION_VIRTUAL_TOOLS_GET:"View virtual tool details",COLLECTION_VIRTUAL_TOOLS_UPDATE:"Update virtual tools",COLLECTION_VIRTUAL_TOOLS_DELETE:"Delete virtual tools",MONITORING_LOGS_LIST:"List monitoring logs",MONITORING_STATS:"View monitoring statistics",MONITORING_DASHBOARD_CREATE:"Create monitoring dashboards",MONITORING_DASHBOARD_GET:"View dashboard details",MONITORING_DASHBOARD_LIST:"List monitoring dashboards",MONITORING_DASHBOARD_UPDATE:"Update monitoring dashboards",MONITORING_DASHBOARD_DELETE:"Delete monitoring dashboards",MONITORING_DASHBOARD_QUERY:"Query dashboard widget data",MONITORING_WIDGET_PREVIEW:"Preview widget aggregation",API_KEY_CREATE:"Create API key",API_KEY_LIST:"List API keys",API_KEY_UPDATE:"Update API key",API_KEY_DELETE:"Delete API key",EVENT_PUBLISH:"Publish events",EVENT_SUBSCRIBE:"Subscribe to events",EVENT_UNSUBSCRIBE:"Unsubscribe from events",EVENT_CANCEL:"Cancel recurring events",EVENT_ACK:"Acknowledge event delivery",EVENT_SUBSCRIPTION_LIST:"List event subscriptions",EVENT_SYNC_SUBSCRIPTIONS:"Sync subscriptions to desired state",USER_GET:"Get user by id",CODE_EXECUTION_SEARCH_TOOLS:"Search tools",CODE_EXECUTION_DESCRIBE_TOOLS:"Describe tools",CODE_EXECUTION_RUN_CODE:"Run code",COLLECTION_THREADS_CREATE:"Create threads",COLLECTION_THREADS_LIST:"List threads",COLLECTION_THREADS_GET:"View thread details",COLLECTION_THREADS_UPDATE:"Update threads",COLLECTION_THREADS_DELETE:"Delete threads",COLLECTION_THREAD_MESSAGES_LIST:"List thread messages",TAGS_LIST:"List organization tags",TAGS_CREATE:"Create organization tag",TAGS_DELETE:"Delete organization tag",MEMBER_TAGS_GET:"Get member tags",MEMBER_TAGS_SET:"Set member tags",PROJECT_LIST:"List projects",PROJECT_GET:"View project details",PROJECT_CREATE:"Create project",PROJECT_UPDATE:"Update project",PROJECT_DELETE:"Delete project",PROJECT_PLUGIN_CONFIG_GET:"View plugin config",PROJECT_PLUGIN_CONFIG_UPDATE:"Update plugin config",PROJECT_CONNECTION_LIST:"List project connections",PROJECT_CONNECTION_ADD:"Add project connection",PROJECT_CONNECTION_REMOVE:"Remove project connection",PROJECT_PINNED_VIEWS_UPDATE:"Update pinned views",AUTOMATION_CREATE:"Create automation",AUTOMATION_GET:"View automation details",AUTOMATION_LIST:"List automations",AUTOMATION_UPDATE:"Update automation",AUTOMATION_DELETE:"Delete automation",AUTOMATION_TRIGGER_ADD:"Add trigger",AUTOMATION_TRIGGER_REMOVE:"Remove trigger",AUTOMATION_RUN:"Run automation",AI_PROVIDERS_LIST:"List AI providers",AI_PROVIDERS_LIST_MODELS:"List AI models",AI_PROVIDERS_ACTIVE:"List active providers",AI_PROVIDER_KEY_CREATE:"Create provider key",AI_PROVIDER_KEY_LIST:"List provider keys",AI_PROVIDER_KEY_DELETE:"Delete provider key",AI_PROVIDER_OAUTH_URL:"Get OAuth URL",AI_PROVIDER_OAUTH_EXCHANGE:"Connect via OAuth"};function Ds(){const t={Organizations:[],Connections:[],"Virtual MCPs":[],"Virtual Tools":[],Threads:[],Monitoring:[],Users:[],"API Keys":[],"Event Bus":[],"Code Execution":[],Tags:[],Projects:[],"AI Providers":[],Automations:[]};for(const e of qt)t[e.category]?.push(e);return t}function Us(){return qt.map(t=>({value:t.name,label:Ms[t.name],dangerous:t.dangerous}))}const ks=k.memo(function(e){const n=oe.c(21),{connection:o,isSelected:l,hasToolsEnabled:r,activeToolsCount:d,totalToolsCount:i,onSelect:h,onToggle:p}=e,m=l?"bg-accent/50":"hover:bg-muted/50";let T;n[0]!==m?(T=J("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",m),n[0]=m,n[1]=T):T=n[1];let c;n[2]!==o.icon||n[3]!==o.title?(c=s.jsx(kt,{icon:o.icon,name:o.title,size:"xs"}),n[2]=o.icon,n[3]=o.title,n[4]=c):c=n[4];let E;n[5]!==o.title?(E=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),n[5]=o.title,n[6]=E):E=n[6];let g;n[7]!==h||n[8]!==c||n[9]!==E?(g=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:h,children:[c,E]}),n[7]=h,n[8]=c,n[9]=E,n[10]=g):g=n[10];let j;n[11]!==d||n[12]!==o.tools||n[13]!==r||n[14]!==p||n[15]!==i?(j=o.tools&&o.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[d,"/",i]}),s.jsx(ke,{checked:r,onCheckedChange:p,onClick:Gs})]}),n[11]=d,n[12]=o.tools,n[13]=r,n[14]=p,n[15]=i,n[16]=j):j=n[16];let b;return n[17]!==T||n[18]!==g||n[19]!==j?(b=s.jsxs("div",{className:T,children:[g,j]}),n[17]=T,n[18]=g,n[19]=j,n[20]=b):b=n[20],b}),Vs=k.memo(function(e){const n=oe.c(18),{connectionId:o,tool:l,isSelected:r,onToggle:d}=e,i=`tool-${o}-${l.name}`,h=r?"text-foreground":"text-muted-foreground";let p;n[0]!==h?(p=J("text-sm font-medium",h),n[0]=h,n[1]=p):p=n[1];let m;n[2]!==p||n[3]!==l.name?(m=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:p,children:l.name})}),n[2]=p,n[3]=l.name,n[4]=m):m=n[4];let T;n[5]!==l.description?(T=l.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description}),n[5]=l.description,n[6]=T):T=n[6];let c;n[7]!==m||n[8]!==T?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,T]}),n[7]=m,n[8]=T,n[9]=c):c=n[9];const E=`tool-${o}-${l.name}`;let g;n[10]!==r||n[11]!==d||n[12]!==E?(g=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(ke,{id:E,checked:r,onCheckedChange:d,onClick:Bs})}),n[10]=r,n[11]=d,n[12]=E,n[13]=g):g=n[13];let j;return n[14]!==i||n[15]!==c||n[16]!==g?(j=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:i,children:[c,g]}),n[14]=i,n[15]=c,n[16]=g,n[17]=j):j=n[17],j});function zs({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n}){const[o,l]=k.useState(""),r=k.useDeferredValue(o),[d,i]=k.useState("all"),[h,p]=k.useState(!1),m=k.useRef(new Set(Object.keys(t))),T=Vt({searchTerm:r.trim()||void 0}),c=n?T.filter(f=>f.connection_type!=="VIRTUAL"?!0:Wt(f.connection_url)!==n):T,E=m.current,g=[...E.values()].map(f=>c.find(O=>O.id===f)).filter(f=>f!==void 0),j=c.filter(f=>!E.has(f.id)),b=[...g,...j],I=f=>{const O=t[f];return O!==void 0&&O.length>0},C=b.filter(f=>{if(d==="all")return!0;const O=I(f.id);return d==="selected"?O:d==="unselected"?!O:!0}),[u,A]=k.useState(b[0]?.id??null),N=u?b.find(f=>f.id===u)??null:null,P=N?.tools??[],y=(f,O)=>t[f]?.includes(O)??!1,w=(f,O)=>{const v=t[f]??[],x=v.includes(O),L={...t};if(x){const D=v.filter(z=>z!==O);D.length===0?delete L[f]:L[f]=D}else L[f]=[...v,O];e(L)},M=f=>{const O=b.find(z=>z.id===f);if(!O?.tools)return;const v=t[f]??[],x=O.tools.map(z=>z.name),L=v.length>0&&x.every(z=>v.includes(z)),D={...t};L?delete D[f]:(D[f]=x,A(f)),e(D)},S=f=>{A(f),p(!0)},R=()=>{p(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:J("w-full md:w-80 border-r border-border flex flex-col",h&&"hidden md:flex"),children:[s.jsx(De,{value:o,onChange:l,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>i("all"),className:J("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>i("selected"),className:J("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>i("unselected"),className:J("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:C.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:o?"No connections found":d==="selected"?"No servers selected":d==="unselected"?"No unselected servers":"No connections available"}):s.jsx("div",{className:"p-2 space-y-1",children:C.map(f=>{const O=f.tools?.length??0,v=t[f.id]?.length??0;return s.jsx(ks,{connection:f,isSelected:u===f.id,hasToolsEnabled:I(f.id),activeToolsCount:v,totalToolsCount:O,onSelect:()=>S(f.id),onToggle:()=>M(f.id)},f.id)})})})]}),s.jsx("div",{className:J("flex-1 flex-col",h?"flex":"hidden md:flex"),children:N?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ie,{variant:"ghost",size:"sm",onClick:R,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(ds,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(kt,{icon:N.icon,name:N.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:N.title}),N.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:N.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:P.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:P.map(f=>s.jsx(Vs,{connectionId:N.id,tool:f,isSelected:y(N.id,f.name),onToggle:()=>w(N.id,f.name)},f.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function Gs(t){return t.stopPropagation()}function Bs(t){return t.stopPropagation()}const Lt=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function $s(t){return t.replace(/-/g," ")}function Fs(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const e=[];let n=!1;const o=[];let l=!1;const r=new Set;let d=!1,i=0,h=!1;for(const[p,m]of Object.entries(t)){if(p==="self"){m.includes("*")?n=!0:e.push(...m);continue}if(p==="models"){m.includes("*:*")?h=!0:i=m.length;continue}if(p==="*"){if(l=!0,m.includes("*"))d=!0;else for(const T of m)r.add(T);continue}if(o.push(p),m.includes("*"))d=!0;else for(const T of m)r.add(T)}return{staticPermissions:e,allowsAllStaticPermissions:n,connectionIds:o,allowsAllConnections:l,toolNames:Array.from(r),allowsAllTools:d,modelCount:i,allowsAllModels:h}}function jt(){const{locator:t}=Te(),{data:e,isLoading:n,error:o,refetch:l}=it({queryKey:ue.organizationRoles(t),queryFn:async()=>{try{const i=await me.organization.listRoles();return i?.error?(console.error("[useOrganizationRoles] API error:",i.error),[]):i?.data??[]}catch(i){return console.error("[useOrganizationRoles] Fetch error:",i),[]}},staleTime:3e4}),r=Lt.map(i=>({role:i.value,label:i.label,isBuiltin:i.isBuiltin}));if(e&&Array.isArray(e))for(const i of e){const h=i.role;if(!h||Lt.some(I=>I.value===h))continue;const{staticPermissions:p,allowsAllStaticPermissions:m,connectionIds:T,allowsAllConnections:c,toolNames:E,allowsAllTools:g,modelCount:j,allowsAllModels:b}=Fs(i.permission);r.push({id:i.id,role:h,label:$s(h),isBuiltin:!1,permission:i.permission??void 0,staticPermissionCount:m?-1:p.length,allowsAllStaticPermissions:m,connectionCount:c?-1:T.length,allowsAllConnections:c,toolCount:g?-1:E.length,allowsAllTools:g,modelCount:b?-1:j,allowsAllModels:b})}const d=r.filter(i=>!i.isBuiltin);return{roles:r,customRoles:d,builtinRoles:r.filter(i=>i.isBuiltin),isLoading:n,error:o,refetch:l}}const Ks=Nt({role:Nt({id:Ce().optional(),slug:Ce().optional(),label:Ce()}),allowAllStaticPermissions:It(),staticPermissions:Xe(Ce()),toolSet:vt(Ce(),Xe(Ce())),allowAllModels:It(),modelSet:vt(Ce(),Xe(Ce())),memberIds:Xe(Ce())});function Jt(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}const Hs=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],ut=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function Qs(t){if(!t)return"bg-neutral-400";let e=0;for(let o=0;o<t.length;o++){const l=t.charCodeAt(o);e=(e<<5)-e+l,e=e&e}const n=Math.abs(e)%ut.length;return ut[n]??ut[0]}function et(){return{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function qs(t){const e=oe.c(39),{allowAllStaticPermissions:n,staticPermissions:o,onAllowAllChange:l,onPermissionsChange:r,readOnly:d}=t,i=d===void 0?!1:d,[h,p]=k.useState(""),m=k.useDeferredValue(h);let T,c,E,g,j;if(e[0]!==n||e[1]!==m||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==h||e[6]!==o){const C=Ds(),u=Us(),A=u.filter(R=>R.label.toLowerCase().includes(m.toLowerCase())),N=R=>{if(o.includes(R))r(o.filter(f=>f!==R));else{const f=[...o,R];f.length===u.length?(l(!0),r([])):r(f)}};E="flex flex-col h-full",e[12]!==h?(g=s.jsx("div",{className:"border-b border-border",children:s.jsx(De,{value:h,onChange:p,placeholder:"Search permissions...",className:"border-b-0"})}),e[12]=h,e[13]=g):g=e[13];const P=!i&&"hover:bg-muted/50 cursor-pointer";let y;e[14]!==P?(y=J("flex items-center justify-between px-4 py-3 rounded-lg",P),e[14]=P,e[15]=y):y=e[15];let w;e[16]!==n||e[17]!==l||e[18]!==r||e[19]!==i?(w=()=>{if(i)return;l(!n),r([])},e[16]=n,e[17]=l,e[18]=r,e[19]=i,e[20]=w):w=e[20];let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("span",{className:"text-sm font-medium",children:"All organization permissions"}),e[21]=M):M=e[21];let S;e[22]!==n||e[23]!==l||e[24]!==r||e[25]!==i?(S=s.jsx("div",{onClick:Xs,children:i?s.jsx(Oe,{children:s.jsxs(Ae,{children:[s.jsx(ye,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:n,disabled:i,onCheckedChange:R=>{i||(l(R),r([]))}})})}),s.jsx(Se,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(je,{checked:n,disabled:i,onCheckedChange:R=>{i||(l(R),r([]))}})}),e[22]=n,e[23]=l,e[24]=r,e[25]=i,e[26]=S):S=e[26],e[27]!==S||e[28]!==y||e[29]!==w?(j=s.jsx("div",{className:"border-b border-border",children:s.jsxs("div",{className:y,onClick:w,children:[M,S]})}),e[27]=S,e[28]=y,e[29]=w,e[30]=j):j=e[30],T="flex-1 overflow-auto",c=Object.entries(C).map(R=>{const[f,O]=R,v=A.filter(x=>O.some(L=>L.name===x.value));return v.length===0?null:s.jsxs("div",{className:"mb-6 last:mb-0",children:[s.jsx("h4",{className:"text-sm font-medium p-3 pb-1.5 text-muted-foreground/75",children:f}),s.jsx("div",{className:"space-y-1",children:v.map(x=>s.jsxs("div",{className:J("flex items-center justify-between gap-3 px-4 py-3",!i&&"hover:bg-muted/50 cursor-pointer"),onClick:()=>{if(!i)if(n){l(!1);const L=u.map(Ws);r(L.filter(D=>D!==x.value))}else N(x.value)},children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("span",{className:"text-sm",children:x.label})}),s.jsx("div",{onClick:Ys,children:i?s.jsx(Oe,{children:s.jsxs(Ae,{children:[s.jsx(ye,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:n||o.includes(x.value),disabled:i,onCheckedChange:()=>{if(!i)if(n){l(!1);const L=u.map(Zs);r(L.filter(D=>D!==x.value))}else N(x.value)}})})}),s.jsx(Se,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(je,{checked:n||o.includes(x.value),disabled:i,onCheckedChange:()=>{if(!i)if(n){l(!1);const L=u.map(Js);r(L.filter(D=>D!==x.value))}else N(x.value)}})})]},x.value))})]},f)}),e[0]=n,e[1]=m,e[2]=l,e[3]=r,e[4]=i,e[5]=h,e[6]=o,e[7]=T,e[8]=c,e[9]=E,e[10]=g,e[11]=j}else T=e[7],c=e[8],E=e[9],g=e[10],j=e[11];let b;e[31]!==T||e[32]!==c?(b=s.jsx("div",{className:T,children:c}),e[31]=T,e[32]=c,e[33]=b):b=e[33];let I;return e[34]!==E||e[35]!==g||e[36]!==j||e[37]!==b?(I=s.jsxs("div",{className:E,children:[g,j,b]}),e[34]=E,e[35]=g,e[36]=j,e[37]=b,e[38]=I):I=e[38],I}function Js(t){return t.value}function Zs(t){return t.value}function Ys(t){return t.stopPropagation()}function Ws(t){return t.value}function Xs(t){return t.stopPropagation()}const en={anthropic:"Anthropic",openrouter:"OpenRouter"},Zt=30;function tn(t){const e=oe.c(55),{connection:n,selectedModels:o,allowAllModels:l,onToggleModel:r,onToggleConnectionAll:d,allConnectionModelsSelected:i,searchQuery:h,readOnly:p}=t,[m,T]=k.useState(Zt),c=us(n.id);let E,g,j,b,I,C,u;if(e[0]!==i||e[1]!==l||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==d||e[6]!==r||e[7]!==c||e[8]!==p||e[9]!==h||e[10]!==o||e[11]!==m){u=Symbol.for("react.early_return_sentinel");e:{let y;e[19]!==n.label?(y=U=>({...U,id:U.modelId,provider:n.label}),e[19]=n.label,e[20]=y):y=e[20];const w=c.filter(on).map(y);if(E=h.trim()?w.filter(U=>U.title.toLowerCase().includes(h.toLowerCase())||U.id.toLowerCase().includes(h.toLowerCase())||U.provider?.toLowerCase().includes(h.toLowerCase())):w,E.length===0){u=null;break e}const M=E.slice(0,m);g=E.length>m;const S=l||i||o.includes("*")&&!l||E.every(U=>o.includes(U.id)||o.includes("*"));I="mb-6 last:mb-0";const R=as[n.providerId]??cs;let f;e[21]!==n.providerId||e[22]!==R?(f=s.jsx("img",{src:R,alt:n.providerId,className:"w-4 h-4 rounded-sm"}),e[21]=n.providerId,e[22]=R,e[23]=f):f=e[23];const O=en[n.providerId]??n.providerId;let v;e[24]!==O?(v=s.jsx("h4",{className:"text-sm font-medium text-muted-foreground/75",children:O}),e[24]=O,e[25]=v):v=e[25];let x;e[26]!==n.label?(x=s.jsx("span",{className:"text-xs text-muted-foreground/50",children:n.label}),e[26]=n.label,e[27]=x):x=e[27];let L;e[28]!==v||e[29]!==x?(L=s.jsxs("div",{className:"flex flex-col",children:[v,x]}),e[28]=v,e[29]=x,e[30]=L):L=e[30];let D;e[31]!==L||e[32]!==f?(D=s.jsxs("div",{className:"flex items-center gap-2",children:[f,L]}),e[31]=L,e[32]=f,e[33]=D):D=e[33];const z=!p&&!l&&s.jsx(je,{checked:S,onCheckedChange:()=>d(n.id,w)});e[34]!==D||e[35]!==z?(C=s.jsxs("div",{className:"flex items-center justify-between px-4 py-2",children:[D,z]}),e[34]=D,e[35]=z,e[36]=C):C=e[36],j="space-y-1";let B;e[37]!==l||e[38]!==n.id||e[39]!==r||e[40]!==p||e[41]!==o?(B=U=>{const q=l||o.includes("*")||o.includes(U.id);return s.jsxs("div",{className:J("flex items-center justify-between gap-3 px-4 py-3",!p&&"hover:bg-muted/50 cursor-pointer"),onClick:()=>{p||l||r(n.id,U.id)},children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[U.logo&&s.jsx("img",{src:U.logo,className:"w-4 h-4 shrink-0 rounded-sm",alt:U.title}),s.jsx("span",{className:"text-sm truncate",children:U.title})]}),s.jsx("div",{onClick:nn,children:p?s.jsx(Oe,{children:s.jsxs(Ae,{children:[s.jsx(ye,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:q,disabled:!0})})}),s.jsx(Se,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(je,{checked:q,disabled:p||l,onCheckedChange:()=>{p||l||r(n.id,U.id)}})})]},U.id)},e[37]=l,e[38]=n.id,e[39]=r,e[40]=p,e[41]=o,e[42]=B):B=e[42],b=M.map(B)}e[0]=i,e[1]=l,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=d,e[6]=r,e[7]=c,e[8]=p,e[9]=h,e[10]=o,e[11]=m,e[12]=E,e[13]=g,e[14]=j,e[15]=b,e[16]=I,e[17]=C,e[18]=u}else E=e[12],g=e[13],j=e[14],b=e[15],I=e[16],C=e[17],u=e[18];if(u!==Symbol.for("react.early_return_sentinel"))return u;let A;e[43]!==E||e[44]!==g||e[45]!==m?(A=g&&s.jsxs("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>T(sn),children:["Show more (",E.length-m," remaining)"]}),e[43]=E,e[44]=g,e[45]=m,e[46]=A):A=e[46];let N;e[47]!==j||e[48]!==b||e[49]!==A?(N=s.jsxs("div",{className:j,children:[b,A]}),e[47]=j,e[48]=b,e[49]=A,e[50]=N):N=e[50];let P;return e[51]!==I||e[52]!==C||e[53]!==N?(P=s.jsxs("div",{className:I,children:[C,N]}),e[51]=I,e[52]=C,e[53]=N,e[54]=P):P=e[54],P}function sn(t){return t+Zt}function nn(t){return t.stopPropagation()}function on(t,e,n){return n.findIndex(o=>o.modelId===t.modelId)===e}function rn(){const t=oe.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Qe,{className:"size-4 animate-spin"}),"Loading models..."]}),t[0]=e):e=t[0],e}function ln(t){const e=oe.c(39),{allowAllModels:n,modelSet:o,onAllowAllChange:l,onModelSetChange:r,readOnly:d}=t,i=d===void 0?!1:d,[h,p]=k.useState(""),m=k.useDeferredValue(h),T=ms();let c;e[0]!==o||e[1]!==r?(c=(S,R)=>{const f=o[S]??[],O={...o};if(f.includes(R)){const v=f.filter(x=>x!==R);v.length===0?delete O[S]:O[S]=v}else O[S]=[...f,R];r(O)},e[0]=o,e[1]=r,e[2]=c):c=e[2];const E=c;let g;e[3]!==o||e[4]!==r?(g=(S,R)=>{const f=o[S]??[],O=R.map(cn),v=f.includes("*")||O.every(L=>f.includes(L)),x={...o};v?delete x[S]:x[S]=O,r(x)},e[3]=o,e[4]=r,e[5]=g):g=e[5];const j=g;let b;e[6]!==h?(b=s.jsx("div",{className:"border-b border-border",children:s.jsx(De,{value:h,onChange:p,placeholder:"Search models...",className:"border-b-0"})}),e[6]=h,e[7]=b):b=e[7];const I=!i&&"hover:bg-muted/50 cursor-pointer";let C;e[8]!==I?(C=J("flex items-center justify-between px-4 py-3 rounded-lg",I),e[8]=I,e[9]=C):C=e[9];let u;e[10]!==n||e[11]!==l||e[12]!==r||e[13]!==i?(u=()=>{if(i)return;const S=!n;l(S),S&&r({})},e[10]=n,e[11]=l,e[12]=r,e[13]=i,e[14]=u):u=e[14];let A;e[15]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[15]=A):A=e[15];let N;e[16]!==n||e[17]!==l||e[18]!==r||e[19]!==i?(N=s.jsx("div",{onClick:an,children:i?s.jsx(Oe,{children:s.jsxs(Ae,{children:[s.jsx(ye,{asChild:!0,children:s.jsx("div",{children:s.jsx(je,{checked:n,disabled:!0})})}),s.jsx(Se,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(je,{checked:n,onCheckedChange:S=>{i||(l(S),S&&r({}))}})}),e[16]=n,e[17]=l,e[18]=r,e[19]=i,e[20]=N):N=e[20];let P;e[21]!==C||e[22]!==u||e[23]!==N?(P=s.jsx("div",{className:"border-b border-border",children:s.jsxs("div",{className:C,onClick:u,children:[A,N]})}),e[21]=C,e[22]=u,e[23]=N,e[24]=P):P=e[24];let y;e[25]!==T||e[26]!==n||e[27]!==m||e[28]!==o||e[29]!==i||e[30]!==j||e[31]!==E?(y=T.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):T.map(S=>s.jsx(k.Suspense,{fallback:s.jsx(rn,{}),children:s.jsx(tn,{connection:S,selectedModels:o[S.id]??[],allowAllModels:n,onToggleModel:E,onToggleConnectionAll:j,allConnectionModelsSelected:(o[S.id]??[]).includes("*"),searchQuery:m,readOnly:i})},S.id)),e[25]=T,e[26]=n,e[27]=m,e[28]=o,e[29]=i,e[30]=j,e[31]=E,e[32]=y):y=e[32];let w;e[33]!==y?(w=s.jsx("div",{className:"flex-1 overflow-auto",children:y}),e[33]=y,e[34]=w):w=e[34];let M;return e[35]!==P||e[36]!==w||e[37]!==b?(M=s.jsxs("div",{className:"flex flex-col h-full",children:[b,P,w]}),e[35]=P,e[36]=w,e[37]=b,e[38]=M):M=e[38],M}function an(t){return t.stopPropagation()}function cn(t){return t.id}function dn(t){const e=oe.c(56),{open:n,onOpenChange:o,selectedMemberIds:l,onAddMembers:r}=t,[d,i]=k.useState(""),h=k.useDeferredValue(d);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[0]=p):p=e[0];const[m,T]=k.useState(p),{data:c}=bt();let E,g,j,b,I,C,u,A,N,P,y;if(e[1]!==c?.data?.members||e[2]!==h||e[3]!==r||e[4]!==o||e[5]!==n||e[6]!==m||e[7]!==d||e[8]!==l){const L=c?.data?.members??[];let D;e[20]!==h?(D=G=>{const a=h.toLowerCase();return G.user?.name?.toLowerCase().includes(a)||G.user?.email?.toLowerCase().includes(a)},e[20]=h,e[21]=D):D=e[21];const z=L.filter(D),B=mn;let U;e[22]!==l?(U=G=>l.includes(G),e[22]=l,e[23]=U):U=e[23];const q=U;let ee;e[24]!==m?(ee=G=>{m.includes(G)?T(m.filter(a=>a!==G)):T([...m,G])},e[24]=m,e[25]=ee):ee=e[25];const re=ee;let te;e[26]!==r||e[27]!==o||e[28]!==m?(te=()=>{r(m),T([]),o(!1)},e[26]=r,e[27]=o,e[28]=m,e[29]=te):te=e[29],j=te,g=Ve,P=n,y=o,E=ze,A="sm:max-w-md p-0 overflow-hidden",e[30]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(Ge,{className:"px-6 pt-6",children:[s.jsx(Be,{children:"Add Members to Role"}),s.jsx($e,{children:"Select members to add to this role."})]}),e[30]=N):N=e[30],C="flex flex-col h-80",e[31]!==d?(u=s.jsx(De,{value:d,onChange:i,placeholder:"Search members...",className:"border-b border-t-0 border-x-0 rounded-none"}),e[31]=d,e[32]=u):u=e[32],b="flex-1 overflow-auto",I=z.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:z.map(G=>{const a=B(G),_=q(G.id),$=m.includes(G.id);return s.jsxs("label",{className:J("flex items-center gap-3 p-2 rounded-lg",!a||_?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(ke,{checked:$||_,onCheckedChange:()=>{a&&!_&&re(G.id)},disabled:!a||_}),s.jsx(Pe,{url:G.user?.image??void 0,fallback:Jt(G.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:G.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:G.user?.email})]}),!a&&s.jsx(Ie,{variant:"secondary",className:"shrink-0",children:"Owner"}),_&&a&&s.jsx(Ie,{variant:"outline",className:"shrink-0",children:"Added"})]},G.id)})}),e[1]=c?.data?.members,e[2]=h,e[3]=r,e[4]=o,e[5]=n,e[6]=m,e[7]=d,e[8]=l,e[9]=E,e[10]=g,e[11]=j,e[12]=b,e[13]=I,e[14]=C,e[15]=u,e[16]=A,e[17]=N,e[18]=P,e[19]=y}else E=e[9],g=e[10],j=e[11],b=e[12],I=e[13],C=e[14],u=e[15],A=e[16],N=e[17],P=e[18],y=e[19];let w;e[33]!==b||e[34]!==I?(w=s.jsx("div",{className:b,children:I}),e[33]=b,e[34]=I,e[35]=w):w=e[35];let M;e[36]!==w||e[37]!==C||e[38]!==u?(M=s.jsxs("div",{className:C,children:[u,w]}),e[36]=w,e[37]=C,e[38]=u,e[39]=M):M=e[39];let S;e[40]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ke,{children:"Cancel"}),e[40]=S):S=e[40];const R=m.length===0,f=m.length>0&&`(${m.length})`;let O;e[41]!==j||e[42]!==R||e[43]!==f?(O=s.jsxs(Fe,{className:"px-6 pb-6",children:[S,s.jsxs(He,{onClick:j,disabled:R,children:["Add ",f]})]}),e[41]=j,e[42]=R,e[43]=f,e[44]=O):O=e[44];let v;e[45]!==E||e[46]!==M||e[47]!==O||e[48]!==A||e[49]!==N?(v=s.jsxs(E,{className:A,children:[N,M,O]}),e[45]=E,e[46]=M,e[47]=O,e[48]=A,e[49]=N,e[50]=v):v=e[50];let x;return e[51]!==g||e[52]!==v||e[53]!==P||e[54]!==y?(x=s.jsx(g,{open:P,onOpenChange:y,children:v}),e[51]=g,e[52]=v,e[53]=P,e[54]=y,e[55]=x):x=e[55],x}function mn(t){return t.role!=="owner"}function un(t){const e=oe.c(40),{memberIds:n,onMemberIdsChange:o,readOnly:l}=t,r=l===void 0?!1:l,[d,i]=k.useState(""),h=k.useDeferredValue(d),[p,m]=k.useState(!1),{data:T}=bt();let c,E,g,j,b;if(e[0]!==T?.data?.members||e[1]!==h||e[2]!==n||e[3]!==o||e[4]!==r||e[5]!==d){const A=T?.data?.members??[];let N;e[11]!==n?(N=v=>n.includes(v.id),e[11]=n,e[12]=N):N=e[12];const P=A.filter(N);let y;e[13]!==h?(y=v=>{const x=h.toLowerCase();return v.user?.name?.toLowerCase().includes(x)||v.user?.email?.toLowerCase().includes(x)},e[13]=h,e[14]=y):y=e[14];const w=P.filter(y);let M;e[15]!==n||e[16]!==o?(M=v=>{o(n.filter(x=>x!==v))},e[15]=n,e[16]=o,e[17]=M):M=e[17];const S=M;let R;e[18]!==n||e[19]!==o?(R=v=>{o([...n,...v])},e[18]=n,e[19]=o,e[20]=R):R=e[20],c=R,j="flex flex-col h-full";let f;e[21]!==d?(f=s.jsx(De,{value:d,onChange:i,placeholder:"Search members...",className:"flex-1 border-b-0"}),e[21]=d,e[22]=f):f=e[22];let O;e[23]!==r?(O=r?s.jsx("div",{className:"pr-4",children:s.jsx(Oe,{children:s.jsxs(Ae,{children:[s.jsx(ye,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ie,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(ot,{size:16}),"Add Member"]})})}),s.jsx(Se,{children:s.jsx("p",{children:"Owner membership cannot be changed"})})]})})}):s.jsx("div",{className:"pr-4",children:s.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>m(!0),children:[s.jsx(ot,{size:16}),"Add Member"]})}),e[23]=r,e[24]=O):O=e[24],e[25]!==f||e[26]!==O?(b=s.jsxs("div",{className:"flex items-center border-b border-border",children:[f,O]}),e[25]=f,e[26]=O,e[27]=b):b=e[27],E="flex-1 overflow-auto",g=P.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to this role to grant them the configured permissions."})]})}):w.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',d,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:w.map(v=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(Pe,{url:v.user?.image??void 0,fallback:Jt(v.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:v.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:v.user?.email})]}),r?s.jsx(Oe,{children:s.jsxs(Ae,{children:[s.jsx(ye,{asChild:!0,children:s.jsx("div",{children:s.jsx(ie,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(Ot,{size:16})})})}),s.jsx(Se,{children:s.jsx("p",{children:"Owner membership cannot be changed"})})]})}):s.jsx(ie,{variant:"ghost",size:"sm",onClick:()=>S(v.id),children:s.jsx(Ot,{size:16})})]},v.id))}),e[0]=T?.data?.members,e[1]=h,e[2]=n,e[3]=o,e[4]=r,e[5]=d,e[6]=c,e[7]=E,e[8]=g,e[9]=j,e[10]=b}else c=e[6],E=e[7],g=e[8],j=e[9],b=e[10];let I;e[28]!==E||e[29]!==g?(I=s.jsx("div",{className:E,children:g}),e[28]=E,e[29]=g,e[30]=I):I=e[30];let C;e[31]!==p||e[32]!==c||e[33]!==n?(C=s.jsx(dn,{open:p,onOpenChange:m,selectedMemberIds:n,onAddMembers:c}),e[31]=p,e[32]=c,e[33]=n,e[34]=C):C=e[34];let u;return e[35]!==j||e[36]!==b||e[37]!==I||e[38]!==C?(u=s.jsxs("div",{className:j,children:[b,I,C]}),e[35]=j,e[36]=b,e[37]=I,e[38]=C,e[39]=u):u=e[39],u}function fn(t){const e=oe.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Qe,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let o;return e[1]!==t?(o=s.jsx(k.Suspense,{fallback:n,children:s.jsx(un,{...t})}),e[1]=t,e[2]=o):o=e[2],o}const hn={owner:[],admin:[],user:[]};function tt(t,e){const n=t==="owner"||t==="admin",o=e.filter(l=>l.role===t);return{role:{slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:hn[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:o.map(l=>l.id)}}function gn({trigger:t,onSuccess:e}){const[n,o]=k.useState(!1),[l,r]=k.useState("mcp"),{locator:d}=Te(),i=Me(),h=Vt()??[],{customRoles:p,refetch:m}=jt(),{data:T}=it({queryKey:ue.members(d),queryFn:()=>me.organization.listMembers()}),c=Ut({resolver:Xt(Ks),defaultValues:et()}),E=c.formState.isValid,g=c.formState.isDirty,[j,b]=k.useState(null),[I,C]=k.useState(null),u=!c.watch("role.id")&&!c.watch("role.slug")&&!I,[A,N]=k.useState(null),[P,y]=k.useState(!1),[w,M]=k.useState(null),S=a=>{const _=a.permission||{},$=_.self||[],fe=$.includes("*"),W=fe?[]:$.filter(F=>F!=="*"),X={};for(const[F,se]of Object.entries(_))if(!(F==="self"||F==="models"))if(F==="*")for(const ne of h)se.includes("*")?X[ne.id]=ne.tools?.map(ae=>ae.name)??[]:X[ne.id]=se;else{const ne=h.find(ae=>ae.id===F);ne&&(se.includes("*")?X[F]=ne.tools?.map(ae=>ae.name)??[]:X[F]=se)}const Z=_.models||[],he=Z.length===0||Z.includes("*:*"),Y={};if(!he)for(const F of Z){const se=F.indexOf(":");if(se===-1)continue;const ne=F.slice(0,se),ae=F.slice(se+1);Y[ne]||(Y[ne]=[]),Y[ne].push(ae)}const ce=(T?.data?.members??[]).filter(F=>F.role===a.role).map(F=>F.id);return{role:{id:a.id,slug:a.role,label:a.label},allowAllStaticPermissions:fe,staticPermissions:W,toolSet:X,allowAllModels:he,modelSet:Y,memberIds:ce}},R=a=>{const _=S(a);c.reset(_),b(a.id??null),C(null)},f=()=>{c.reset(et()),b(null),C(null),r("mcp")},O=a=>{g&&E?(M(()=>()=>R(a)),y(!0)):R(a)},v=async()=>{g&&E&&await ee(),f()},x=a=>{if(g&&E)M(()=>()=>{const _=tt(a,T?.data?.members??[]);c.reset(_),C(a),b(null),r("org")}),y(!0);else{const _=tt(a,T?.data?.members??[]);c.reset(_),C(a),b(null),r("org")}},L=a=>{if(!a&&c.formState.isDirty&&E){M(()=>()=>{o(!1),c.reset(et()),C(null)}),y(!0);return}if(o(a),!a)c.reset(et()),C(null),b(null);else{const _=p[0];if(_)R(_);else{const $=tt("user",T?.data?.members??[]);c.reset($),C("user"),b(null),r("org")}}},D=()=>{y(!1),w&&(w(),M(null))},z=a=>{const _={};a.allowAllStaticPermissions?_.self=["*"]:a.staticPermissions.length>0&&(_.self=a.staticPermissions);for(const[$,fe]of Object.entries(a.toolSet))if(fe.length>0){const X=h.find(Z=>Z.id===$)?.tools?.map(Z=>Z.name)??[];X.length>0&&X.every(Z=>fe.includes(Z))?_[$]=["*"]:_[$]=fe}if(a.allowAllModels)_.models=["*:*"];else{const $=[];for(const[fe,W]of Object.entries(a.modelSet))if(W.length>0)for(const X of W)$.push(`${fe}:${X}`);_.models=$}return _},B=Ne({mutationFn:async a=>{const _=z(a),$=a.role.slug||a.role.label.toLowerCase().replace(/\s+/g,"-");if(a.role.slug&&!a.role.id){const X=(T?.data?.members??[]).filter(Y=>Y.role===a.role.slug).map(Y=>Y.id),Z=a.memberIds.filter(Y=>!X.includes(Y)),he=X.filter(Y=>!a.memberIds.includes(Y));for(const Y of Z){const Q=await me.organization.updateMemberRole({memberId:Y,role:[a.role.slug]});if(Q?.error)throw new Error(Q.error.message)}for(const Y of he){const Q=await me.organization.updateMemberRole({memberId:Y,role:["user"]});if(Q?.error)throw new Error(Q.error.message)}return a}else if(a.role.id){const W=await me.organization.updateRole({roleId:a.role.id,data:{permission:_}});if(W?.error)throw new Error(W.error.message);const Z=(T?.data?.members??[]).filter(Q=>Q.role===a.role.slug).map(Q=>Q.id),he=a.memberIds.filter(Q=>!Z.includes(Q)),Y=Z.filter(Q=>!a.memberIds.includes(Q));for(const Q of he){const ce=await me.organization.updateMemberRole({memberId:Q,role:[a.role.slug]});if(ce?.error)throw new Error(ce.error.message)}for(const Q of Y){const ce=await me.organization.updateMemberRole({memberId:Q,role:["user"]});if(ce?.error)throw new Error(ce.error.message)}return a}else{const W=await me.organization.createRole({role:$,permission:_});if(W?.error)throw new Error(W.error.message);for(const X of a.memberIds){const Z=await me.organization.updateMemberRole({memberId:X,role:[$]});if(Z?.error)throw new Error(Z.error.message)}return{...a,role:{...a.role,id:W.data?.roleData?.id,slug:$}}}},onSuccess:(a,_)=>{i.invalidateQueries({queryKey:ue.members(d)}),i.invalidateQueries({queryKey:ue.organizationRoles(d)});const $=!_.role.id&&!_.role.slug,fe=_.role.slug&&!_.role.id;le.success(fe?"Members updated successfully!":$?"Role created successfully!":"Role updated successfully!"),m(),c.reset(a),a.role.id&&b(a.role.id),e?.()},onError:a=>{le.error(a instanceof Error?a.message:"Failed to save role")}}),U=Ne({mutationFn:async a=>{const _=await me.organization.deleteRole({roleId:a});if(_?.error)throw new Error(_.error.message);return _?.data},onSuccess:()=>{if(i.invalidateQueries({queryKey:ue.members(d)}),i.invalidateQueries({queryKey:ue.organizationRoles(d)}),le.success("Role deleted successfully!"),m(),A?.id===j){const a=p.filter(_=>_.id!==A?.id);if(a[0])R(a[0]);else{const _=tt("user",T?.data?.members??[]);c.reset(_),C("user"),b(null),r("org")}}},onError:a=>{le.error(a instanceof Error?a.message:"Failed to delete role")}}),q=B.isPending||U.isPending,ee=async()=>{const a=c.getValues();if(!a.role.label.trim()){le.error("Role name is required"),c.setFocus("role.label");return}await B.mutateAsync(a)},re=c.handleSubmit(a=>{if(!a.role.label.trim()){le.error("Role name is required"),c.setFocus("role.label");return}B.mutate(a)}),te=a=>{a.id&&N({id:a.id,label:a.label})},G=()=>{A?.id&&U.mutate(A.id),N(null)};return s.jsxs(zt,{open:n,onOpenChange:L,children:[s.jsx(Gt,{asChild:!0,children:t}),s.jsx(Bt,{className:"sm:max-w-5xl h-[80vh] max-h-[80vh] flex flex-col p-0 overflow-hidden w-[95vw]",children:s.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 flex-col sm:flex-row",children:[s.jsxs("div",{className:"w-full sm:w-64 sm:border-r border-b sm:border-b-0 border-border flex flex-col bg-background sm:h-full max-h-[40vh] sm:max-h-full",children:[s.jsx("div",{className:"flex-1 overflow-auto px-3.5 py-3.5 pt-3.5",children:s.jsxs("div",{className:"flex flex-col gap-1",children:[Hs.map(a=>{const _=I===a.role;return s.jsxs("div",{className:J("flex items-center gap-2 px-2 py-1.5 rounded-lg overflow-hidden cursor-pointer transition-colors",_?"bg-accent":"hover:bg-muted/50"),onClick:()=>x(a.role),children:[s.jsx("div",{className:J("shrink-0 size-3 rounded-full",a.color)}),s.jsx("p",{className:"text-sm font-medium truncate flex-1",children:a.label}),s.jsx(Es,{size:14,className:"text-muted-foreground shrink-0"})]},a.role)}),p.map(a=>{const _=j===a.id;return s.jsxs("div",{className:J("group flex items-center gap-2 px-2 py-1.5 rounded-lg overflow-hidden transition-colors cursor-pointer",_?"bg-accent":"hover:bg-muted/50"),onClick:()=>O(a),children:[s.jsx("div",{className:J("shrink-0 size-3 rounded-full",Qs(a.label))}),s.jsx("p",{className:"text-sm font-medium truncate flex-1",children:a.label}),s.jsxs(Ct,{children:[s.jsx(Tt,{asChild:!0,children:s.jsx(ie,{variant:"ghost",size:"icon",className:J("size-5 shrink-0 transition-opacity opacity-0 pointer-events-none","group-hover:opacity-100 group-hover:pointer-events-auto",_&&"opacity-100 pointer-events-auto"),onClick:$=>$.stopPropagation(),children:s.jsx(Ts,{size:14})})}),s.jsx(Et,{align:"end",children:s.jsxs(nt,{className:"text-destructive",onClick:$=>{$.stopPropagation(),te(a)},children:[s.jsx($t,{size:16}),"Delete"]})})]})]},a.id)}),u&&s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-lg overflow-hidden bg-accent",children:[s.jsx("div",{className:"shrink-0 size-3 rounded-full bg-neutral-400"}),s.jsx(js,{...c.register("role.label"),placeholder:"Enter role name",className:"flex-1 text-sm font-medium border-0 shadow-none h-auto px-0 py-0 focus-visible:ring-0 bg-transparent",autoFocus:!0}),s.jsx(Ie,{variant:"secondary",className:"shrink-0 text-xs px-1.5 py-0",children:"New"})]})]})}),s.jsx("div",{className:"px-3.5 pb-3.5",children:s.jsxs(ie,{variant:"outline",size:"default",onClick:v,disabled:q||g,className:"w-full h-10",children:[s.jsx(ot,{size:16}),"Create new role"]})})]}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsxs("div",{className:"h-12 border-b border-border px-4 py-3.5 flex items-center gap-2 shrink-0",children:[!I&&s.jsx(ie,{variant:"outline",size:"sm",onClick:()=>r("mcp"),className:J("h-7 rounded-lg px-2 border border-input transition-colors",l==="mcp"?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:"MCP Permissions"}),s.jsx(ie,{variant:"outline",size:"sm",onClick:()=>r("org"),className:J("h-7 rounded-lg px-2 border border-input transition-colors",l==="org"?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:"Organization Permissions"}),s.jsx(ie,{variant:"outline",size:"sm",onClick:()=>r("models"),className:J("h-7 rounded-lg px-2 border border-input transition-colors",l==="models"?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:"Models"}),s.jsx(ie,{variant:"outline",size:"sm",onClick:()=>r("members"),className:J("h-7 rounded-lg px-2 border border-input transition-colors",l==="members"?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:"Members"})]}),s.jsxs("div",{className:"flex-1 overflow-hidden min-h-0",children:[n&&l==="mcp"&&!I&&s.jsx(zs,{toolSet:c.watch("toolSet"),onToolSetChange:a=>c.setValue("toolSet",a,{shouldDirty:!0})}),n&&l==="org"&&s.jsx(qs,{allowAllStaticPermissions:c.watch("allowAllStaticPermissions"),staticPermissions:c.watch("staticPermissions"),onAllowAllChange:a=>c.setValue("allowAllStaticPermissions",a,{shouldDirty:!0}),onPermissionsChange:a=>c.setValue("staticPermissions",a,{shouldDirty:!0}),readOnly:!!I}),n&&l==="models"&&s.jsx(ln,{allowAllModels:c.watch("allowAllModels"),modelSet:c.watch("modelSet"),onAllowAllChange:a=>c.setValue("allowAllModels",a,{shouldDirty:!0}),onModelSetChange:a=>c.setValue("modelSet",a,{shouldDirty:!0}),readOnly:!!I}),n&&l==="members"&&s.jsx(fn,{memberIds:c.watch("memberIds"),onMemberIdsChange:a=>c.setValue("memberIds",a,{shouldDirty:!0}),readOnly:I==="owner"})]}),(!I||I!=="owner")&&s.jsxs("div",{className:"border-t border-border px-5 py-5 flex items-center justify-end gap-2.5 shrink-0",children:[s.jsx(ie,{variant:"outline",onClick:()=>L(!1),disabled:q,className:"h-10",children:"Cancel"}),s.jsx(ie,{onClick:re,disabled:q||!E||!c.formState.isDirty,className:"h-10",children:B.isPending?"Saving...":u?"Create Role":"Save Changes"})]})]})]})}),s.jsx(Ve,{open:A!==null,onOpenChange:a=>!a&&N(null),children:s.jsxs(ze,{children:[s.jsxs(Ge,{children:[s.jsx(Be,{children:"Delete Role"}),s.jsxs($e,{children:['Are you sure you want to delete the "',A?.label,'" role? This action cannot be undone.']})]}),s.jsxs(Fe,{children:[s.jsx(Ke,{children:"Cancel"}),s.jsx(He,{onClick:G,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),s.jsx(Ve,{open:P,onOpenChange:y,children:s.jsxs(ze,{children:[s.jsxs(Ge,{children:[s.jsx(Be,{children:"Discard Changes"}),s.jsx($e,{children:"You have unsaved changes. Are you sure you want to discard them?"})]}),s.jsxs(Fe,{children:[s.jsx(Ke,{onClick:()=>M(null),children:"Keep Editing"}),s.jsx(He,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Discard"})]})]})})]})}const pn=Ce().email("Invalid email address");function xn(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function bn({trigger:t}){const[e,n]=k.useState(!1),{locator:o}=Te(),l=Me(),{data:r}=me.useSession(),d=r?.user?.email,{roles:i,isLoading:h}=jt(),p=i.filter(C=>C.role!=="owner"),m=Ut({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),T=m.watch("emailsText"),c=m.watch("role"),g=xn(T).filter(C=>{const u=pn.safeParse(C).success,A=!d||C!==d.toLowerCase();return u&&A}),j=Ne({mutationFn:async({emails:C,role:u})=>{if(!u)throw new Error("Please select a role");const A=await Promise.allSettled(C.map(async P=>{const y=await me.organization.inviteMember({email:P,role:u});if(y.error)throw new Error(y.error.message);return y.data})),N=A.filter(P=>P.status==="rejected");if(N.length>0)throw new Error(`Failed to invite ${N.length} member${N.length>1?"s":""}`);return A},onSuccess:(C,{emails:u})=>{l.invalidateQueries({queryKey:ue.members(o)}),l.invalidateQueries({queryKey:ue.invitations(o)}),le.success(u.length===1?"Member invited successfully!":`${u.length} members invited successfully!`),m.reset({emailsText:"",role:"user"}),n(!1)},onError:C=>{le.error(C instanceof Error?C.message:"Failed to invite members")}}),b=C=>{if(g.length===0){le.error("Please enter at least one valid email address");return}if(!C.role){le.error("Please select a role");return}j.mutate({emails:g,role:C.role})},I=g.length>0&&!!c;return s.jsxs(zt,{open:e,onOpenChange:n,children:[s.jsx(Gt,{asChild:!0,children:t}),s.jsxs(Bt,{className:"sm:max-w-lg",children:[s.jsx(fs,{children:s.jsx(hs,{children:"Invite members"})}),s.jsx(Ns,{...m,children:s.jsxs("form",{onSubmit:m.handleSubmit(b),className:"space-y-4",children:[s.jsx(At,{control:m.control,name:"emailsText",render:({field:C})=>s.jsxs(yt,{children:[s.jsx(vs,{children:"Email addresses"}),s.jsx(St,{children:s.jsx(Is,{...C,disabled:j.isPending,placeholder:`Enter email addresses separated by commas or new lines
2
- e.g. user1@example.com, user2@example.com
3
- or one per line`,className:"min-h-[120px] resize-none"})}),s.jsx(_t,{})]})}),s.jsx(At,{control:m.control,name:"role",render:({field:C})=>s.jsxs(yt,{children:[s.jsx(St,{children:s.jsxs(ft,{value:C.value,onValueChange:C.onChange,disabled:j.isPending||h,children:[s.jsx(ht,{className:"w-full",children:s.jsx(gt,{placeholder:"Select a role"})}),s.jsx(pt,{children:p.map(u=>{const A=[];return u.isBuiltin||(u.allowsAllStaticPermissions?A.push("Full org access"):u.staticPermissionCount&&u.staticPermissionCount>0&&A.push(`${u.staticPermissionCount} org perm${u.staticPermissionCount!==1?"s":""}`),u.allowsAllConnections?A.push("All connections"):u.connectionCount&&u.connectionCount>0&&A.push(`${u.connectionCount} connection${u.connectionCount!==1?"s":""}`),(u.connectionCount!==0||u.allowsAllConnections)&&(u.allowsAllTools?A.push("all tools"):u.toolCount&&u.toolCount>0&&A.push(`${u.toolCount} tool${u.toolCount!==1?"s":""}`))),s.jsx(xt,{value:u.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:u.label}),!u.isBuiltin&&A.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:A.join(", ")})]})},u.role)})})]})}),s.jsx(_t,{})]})}),s.jsxs(gs,{children:[s.jsx(ie,{variant:"outline",onClick:()=>{m.reset({emailsText:"",role:"user"}),n(!1)},type:"button",disabled:j.isPending,children:"Cancel"}),s.jsx(ie,{type:"submit",disabled:j.isPending||!I,children:j.isPending?"Inviting...":`Invite ${g.length||0} Member${g.length!==1?"s":""}`})]})]})})]})]})}function Cn(){const t=oe.c(9),{org:e,locator:n}=Te();let o;t[0]!==e.id?(o={connectionId:qe,orgId:e.id},t[0]=e.id,t[1]=o):o=t[1];const l=Je(o);let r;t[2]!==n?(r=ue.invitations(n),t[2]=n,t[3]=r):r=t[3];let d;t[4]!==l?(d=async()=>{const h=await l.callTool({name:"ORGANIZATION_GET",arguments:{}});return(h.structuredContent??h)?.invitations??[]},t[4]=l,t[5]=d):d=t[5];let i;return t[6]!==r||t[7]!==d?(i={queryKey:r,queryFn:d},t[6]=r,t[7]=d,t[8]=i):i=t[8],es(i)}function Tn(){const t=oe.c(5),{locator:e}=Te(),n=Me();let o;t[0]!==e||t[1]!==n?(o={mutationFn:jn,onSuccess:()=>{n.invalidateQueries({queryKey:ue.invitations(e)}),le.success("Invitation cancelled")},onError:En},t[0]=e,t[1]=n,t[2]=o):o=t[2];const l=Ne(o);let r;return t[3]!==l?(r={cancel:l},t[3]=l,t[4]=r):r=t[4],r}function En(t){le.error(t instanceof Error?t.message:"Failed to cancel invitation")}async function jn(t){const e=await me.organization.cancelInvitation({invitationId:t});if(e?.error)throw new Error(e.error.message);return e.data}function Nn(){const t=oe.c(9),{org:e,locator:n}=Te();let o;t[0]!==e.id?(o={connectionId:qe,orgId:e.id},t[0]=e.id,t[1]=o):o=t[1];const l=Je(o);let r;t[2]!==n?(r=ue.tags(n),t[2]=n,t[3]=r):r=t[3];let d;t[4]!==l?(d=async()=>{const h=await l.callTool({name:"TAGS_LIST",arguments:{}});return(h.structuredContent??h).tags},t[4]=l,t[5]=d):d=t[5];let i;return t[6]!==r||t[7]!==d?(i={queryKey:r,queryFn:d,staleTime:3e4},t[6]=r,t[7]=d,t[8]=i):i=t[8],it(i)}function vn(){const t=oe.c(10),e=Me(),{org:n,locator:o}=Te();let l;t[0]!==n.id?(l={connectionId:qe,orgId:n.id},t[0]=n.id,t[1]=l):l=t[1];const r=Je(l);let d;t[2]!==r?(d=async p=>{const m=await r.callTool({name:"TAGS_CREATE",arguments:{name:p}});return(m.structuredContent??m).tag},t[2]=r,t[3]=d):d=t[3];let i;t[4]!==o||t[5]!==e?(i=()=>{e.invalidateQueries({queryKey:ue.tags(o)})},t[4]=o,t[5]=e,t[6]=i):i=t[6];let h;return t[7]!==d||t[8]!==i?(h={mutationFn:d,onSuccess:i,onError:In},t[7]=d,t[8]=i,t[9]=h):h=t[9],Ne(h)}function In(t){le.error(t instanceof Error?t.message:"Failed to create tag")}function On(t){const e=oe.c(12),{org:n,locator:o}=Te();let l;e[0]!==n.id?(l={connectionId:qe,orgId:n.id},e[0]=n.id,e[1]=l):l=e[1];const r=Je(l);let d;e[2]!==o||e[3]!==t?(d=ue.memberTags(o,t),e[2]=o,e[3]=t,e[4]=d):d=e[4];let i;e[5]!==r||e[6]!==t?(i=async()=>{const m=await r.callTool({name:"MEMBER_TAGS_GET",arguments:{memberId:t}});return(m.structuredContent??m).tags},e[5]=r,e[6]=t,e[7]=i):i=e[7];const h=!!t;let p;return e[8]!==d||e[9]!==i||e[10]!==h?(p={queryKey:d,queryFn:i,staleTime:3e4,enabled:h},e[8]=d,e[9]=i,e[10]=h,e[11]=p):p=e[11],it(p)}function An(){const t=oe.c(10),e=Me(),{org:n,locator:o}=Te();let l;t[0]!==n.id?(l={connectionId:qe,orgId:n.id},t[0]=n.id,t[1]=l):l=t[1];const r=Je(l);let d;t[2]!==r?(d=async p=>{const{memberId:m,tagIds:T}=p,c=await r.callTool({name:"MEMBER_TAGS_SET",arguments:{memberId:m,tagIds:T}});return c.structuredContent??c},t[2]=r,t[3]=d):d=t[3];let i;t[4]!==o||t[5]!==e?(i=(p,m)=>{e.invalidateQueries({queryKey:ue.memberTags(o,m.memberId)})},t[4]=o,t[5]=e,t[6]=i):i=t[6];let h;return t[7]!==d||t[8]!==i?(h={mutationFn:d,onSuccess:i,onError:yn},t[7]=d,t[8]=i,t[9]=h):h=t[9],Ne(h)}function yn(t){le.error(t instanceof Error?t.message:"Failed to update member tags")}function Yt(t){const e=oe.c(44),{memberId:n,className:o,disabled:l,placeholder:r,maxDisplay:d}=t,i=l===void 0?!1:l,h=r===void 0?"Add tags...":r,p=d===void 0?2:d,[m,T]=k.useState(!1),[c,E]=k.useState(""),{data:g,isLoading:j}=Nn(),b=g===void 0?[]:g,{data:I,isLoading:C}=On(n),u=I===void 0?[]:I,A=vn(),N=An(),P=j||C,y=u.map(_n);let w;e[0]!==c?(w=H=>H.name.toLowerCase().includes(c.toLowerCase()),e[0]=c,e[1]=w):w=e[1];const M=b.filter(w);let S;e[2]!==c?(S=H=>H.name.toLowerCase()===c.toLowerCase(),e[2]=c,e[3]=S):S=e[3];const R=b.find(S),f=c.trim()&&!R,O=async H=>{const be=y.includes(H.id)?y.filter(_e=>_e!==H.id):[...y,H.id];await N.mutateAsync({memberId:n,tagIds:be})},v=async()=>{if(!c.trim())return;const H=await A.mutateAsync(c.trim());await N.mutateAsync({memberId:n,tagIds:[...y,H.id]}),E("")},x=async H=>{const pe=y.filter(be=>be!==H);await N.mutateAsync({memberId:n,tagIds:pe})},L=A.isPending||N.isPending,D=ws;let z;e[4]!==m?(z=()=>T(!m),e[4]=m,e[5]=z):z=e[5];let B;e[6]!==o?(B=J("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",o),e[6]=o,e[7]=B):B=e[7];const U=i||P,q=P?s.jsx(Qe,{size:14,className:"animate-spin text-muted-foreground"}):u.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[u.slice(0,p).map(Sn),u.length>p&&s.jsxs(Ie,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",u.length-p]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:h});let ee;e[8]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(Ps,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=ee):ee=e[8];let re;e[9]!==U||e[10]!==q||e[11]!==z||e[12]!==B?(re=s.jsx(Ls,{asChild:!0,children:s.jsxs(ie,{variant:"ghost",size:"sm",onClick:z,className:B,disabled:U,children:[q,ee]})}),e[9]=U,e[10]=q,e[11]=z,e[12]=B,e[13]=re):re=e[13];const te=Rs,G="w-56 p-0",a="start";let _;e[14]===Symbol.for("react.memo_cache_sentinel")?(_=()=>T(!1),e[14]=_):_=e[14];const $=Ss,fe=!1;let W;e[15]!==c?(W=s.jsx(_s,{placeholder:"Search or create...",value:c,onValueChange:E,className:"h-9"}),e[15]=c,e[16]=W):W=e[16];const X=ys,Z=u.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(dt,{heading:"Selected",children:u.map(H=>s.jsx(mt,{onSelect:()=>O(H),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ke,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:H.name})]}),s.jsx("button",{onClick:pe=>{pe.stopPropagation(),x(H.id)},className:"opacity-50 hover:opacity-100",disabled:L,children:s.jsx(Ht,{size:14})})]})},H.id))}),s.jsx(wt,{})]}),he=dt,Y="Available",Q=M.length===0&&!f&&s.jsx(As,{children:"No tags found."}),ce=M.filter(H=>!y.includes(H.id)).map(H=>s.jsx(mt,{onSelect:()=>O(H),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ke,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:H.name})]})},H.id));let F;e[17]!==he||e[18]!==Q||e[19]!==ce?(F=s.jsxs(he,{heading:Y,children:[Q,ce]}),e[17]=he,e[18]=Q,e[19]=ce,e[20]=F):F=e[20];let se;e[21]!==v||e[22]!==L||e[23]!==c||e[24]!==f?(se=f&&s.jsxs(s.Fragment,{children:[s.jsx(wt,{}),s.jsx(dt,{children:s.jsx(mt,{onSelect:v,className:"cursor-pointer",disabled:L,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[L?s.jsx(Qe,{size:14,className:"animate-spin"}):s.jsx(ot,{size:14}),s.jsxs("span",{children:['Create "',c.trim(),'"']})]})})})]}),e[21]=v,e[22]=L,e[23]=c,e[24]=f,e[25]=se):se=e[25];let ne;e[26]!==X||e[27]!==Z||e[28]!==F||e[29]!==se?(ne=s.jsxs(X,{children:[Z,F,se]}),e[26]=X,e[27]=Z,e[28]=F,e[29]=se,e[30]=ne):ne=e[30];let ae;e[31]!==$||e[32]!==W||e[33]!==ne?(ae=s.jsxs($,{shouldFilter:fe,children:[W,ne]}),e[31]=$,e[32]=W,e[33]=ne,e[34]=ae):ae=e[34];let ge;e[35]!==te||e[36]!==_||e[37]!==ae?(ge=s.jsx(te,{className:G,align:a,onEscapeKeyDown:_,children:ae}),e[35]=te,e[36]=_,e[37]=ae,e[38]=ge):ge=e[38];let Ee;return e[39]!==D||e[40]!==m||e[41]!==re||e[42]!==ge?(Ee=s.jsxs(D,{open:m,onOpenChange:T,children:[re,ge]}),e[39]=D,e[40]=m,e[41]=re,e[42]=ge,e[43]=Ee):Ee=e[43],Ee}function Sn(t){return s.jsx(Ie,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function _n(t){return t.id}const Pt=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],Rn={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function rt(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function wn(t){const e=new Map;for(const[n,o]of Object.entries(Rn))e.set(n,o);for(let n=0;n<t.length;n++){const o=t[n];o&&!e.has(o.role)&&e.set(o.role,Pt[n%Pt.length]??"bg-neutral-400")}return e}function Ln(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function st(t){const e=oe.c(79),{role:n,memberId:o,isOwner:l,roleColorMap:r,selectableRoles:d,onRoleChange:i,size:h,className:p}=t,m=h===void 0?"xs":h;let T,c,E,g,j,b,I,C,u,A,N;if(e[0]!==p||e[1]!==l||e[2]!==o||e[3]!==i||e[4]!==n||e[5]!==r||e[6]!==d||e[7]!==m){N=Symbol.for("react.early_return_sentinel");e:{const v=r.get(n)??"bg-neutral-400";if(l){let x;e[19]!==o||e[20]!==i?(x=G=>i(o,G),e[19]=o,e[20]=i,e[21]=x):x=e[21];let L;e[22]!==n?(L=s.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=L):L=e[23];const D=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:J("size-2 rounded-full shrink-0",v)}),L]});let z;e[24]!==D?(z=s.jsx(gt,{children:D}),e[24]=D,e[25]=z):z=e[25];let B;e[26]!==p||e[27]!==m||e[28]!==z?(B=s.jsx(ht,{size:m,className:p,children:z}),e[26]=p,e[27]=m,e[28]=z,e[29]=B):B=e[29];let U;if(e[30]!==r||e[31]!==d){let G;e[33]!==r?(G=a=>{const _=r.get(a.role)??"bg-neutral-400";return s.jsx(xt,{value:a.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:J("size-3 rounded-full",_)}),s.jsx("span",{className:"capitalize",children:a.label})]})},a.role)},e[33]=r,e[34]=G):G=e[34],U=d.map(G),e[30]=r,e[31]=d,e[32]=U}else U=e[32];let q;e[35]!==U?(q=s.jsx(pt,{children:U}),e[35]=U,e[36]=q):q=e[36];let ee;e[37]!==l||e[38]!==n||e[39]!==x||e[40]!==B||e[41]!==q?(ee=s.jsx(ye,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(ft,{value:n,onValueChange:x,disabled:l,children:[B,q]})})}),e[37]=l,e[38]=n,e[39]=x,e[40]=B,e[41]=q,e[42]=ee):ee=e[42];let re;e[43]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsx(Se,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=re):re=e[43];let te;e[44]!==ee?(te=s.jsx(Oe,{children:s.jsxs(Ae,{children:[ee,re]})}),e[44]=ee,e[45]=te):te=e[45],N=te;break e}E=ft,C=n,e[46]!==o||e[47]!==i?(u=x=>i(o,x),e[46]=o,e[47]=i,e[48]=u):u=e[48],A=l,c=ht,b=m,I=p,T=gt,j="flex items-center gap-2 min-w-0",g=J("size-2 rounded-full shrink-0",v)}e[0]=p,e[1]=l,e[2]=o,e[3]=i,e[4]=n,e[5]=r,e[6]=d,e[7]=m,e[8]=T,e[9]=c,e[10]=E,e[11]=g,e[12]=j,e[13]=b,e[14]=I,e[15]=C,e[16]=u,e[17]=A,e[18]=N}else T=e[8],c=e[9],E=e[10],g=e[11],j=e[12],b=e[13],I=e[14],C=e[15],u=e[16],A=e[17],N=e[18];if(N!==Symbol.for("react.early_return_sentinel"))return N;let P;e[49]!==g?(P=s.jsx("div",{className:g}),e[49]=g,e[50]=P):P=e[50];let y;e[51]!==n?(y=s.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=y):y=e[52];let w;e[53]!==P||e[54]!==y||e[55]!==j?(w=s.jsxs("div",{className:j,children:[P,y]}),e[53]=P,e[54]=y,e[55]=j,e[56]=w):w=e[56];let M;e[57]!==T||e[58]!==w?(M=s.jsx(T,{children:w}),e[57]=T,e[58]=w,e[59]=M):M=e[59];let S;e[60]!==c||e[61]!==M||e[62]!==b||e[63]!==I?(S=s.jsx(c,{size:b,className:I,children:M}),e[60]=c,e[61]=M,e[62]=b,e[63]=I,e[64]=S):S=e[64];let R;if(e[65]!==r||e[66]!==d){let v;e[68]!==r?(v=x=>{const L=r.get(x.role)??"bg-neutral-400";return s.jsx(xt,{value:x.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:J("size-3 rounded-full",L)}),s.jsx("span",{className:"capitalize",children:x.label})]})},x.role)},e[68]=r,e[69]=v):v=e[69],R=d.map(v),e[65]=r,e[66]=d,e[67]=R}else R=e[67];let f;e[70]!==R?(f=s.jsx(pt,{children:R}),e[70]=R,e[71]=f):f=e[71];let O;return e[72]!==E||e[73]!==S||e[74]!==f||e[75]!==C||e[76]!==u||e[77]!==A?(O=s.jsxs(E,{value:C,onValueChange:u,disabled:A,children:[S,f]}),e[72]=E,e[73]=S,e[74]=f,e[75]=C,e[76]=u,e[77]=A,e[78]=O):O=e[78],O}function Mt(t){const e=oe.c(51),{member:n,roles:o,onChangeRole:l,onRemove:r,isUpdating:d}=t,i=d===void 0?!1:d,h=n.role==="owner";let p,m,T,c,E,g,j,b,I;if(e[0]!==h||e[1]!==i||e[2]!==n.id||e[3]!==n.role||e[4]!==l||e[5]!==o){let S;e[15]!==n.role?(S=x=>x.role!==n.role&&x.role!=="owner",e[15]=n.role,e[16]=S):S=e[16];const R=o.filter(S);c=Ct;let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ft,{size:20}),e[17]=f):f=e[17],e[18]!==h?(I=s.jsx(Tt,{asChild:!0,children:s.jsx(ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:h,onClick:Mn,children:f})}),e[18]=h,e[19]=I):I=e[19],T=Et,j="end",b=Pn,m=ps;let O;e[20]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Qt,{size:16}),e[20]=O):O=e[20],e[21]!==i?(g=s.jsxs(xs,{disabled:i,children:[O,"Change Role"]}),e[21]=i,e[22]=g):g=e[22],p=bs;let v;e[23]!==i||e[24]!==n.id||e[25]!==l?(v=x=>{const L=[];return x.isBuiltin||(x.allowsAllStaticPermissions?L.push("Full org access"):x.staticPermissionCount&&x.staticPermissionCount>0&&L.push(`${x.staticPermissionCount} org perm${x.staticPermissionCount!==1?"s":""}`),x.allowsAllConnections?L.push("All connections"):x.connectionCount&&x.connectionCount>0&&L.push(`${x.connectionCount} connection${x.connectionCount!==1?"s":""}`),(x.connectionCount!==0||x.allowsAllConnections)&&(x.allowsAllTools?L.push("all tools"):x.toolCount&&x.toolCount>0&&L.push(`${x.toolCount} tool${x.toolCount!==1?"s":""}`))),s.jsxs(nt,{onClick:D=>{D.stopPropagation(),l(n.id,x.role)},disabled:i,children:[x.isBuiltin?s.jsx(Kt,{size:16}):s.jsx(Os,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:x.label}),!x.isBuiltin&&L.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:L.join(", ")})]})]},x.role)},e[23]=i,e[24]=n.id,e[25]=l,e[26]=v):v=e[26],E=R.map(v),e[0]=h,e[1]=i,e[2]=n.id,e[3]=n.role,e[4]=l,e[5]=o,e[6]=p,e[7]=m,e[8]=T,e[9]=c,e[10]=E,e[11]=g,e[12]=j,e[13]=b,e[14]=I}else p=e[6],m=e[7],T=e[8],c=e[9],E=e[10],g=e[11],j=e[12],b=e[13],I=e[14];let C;e[27]!==p||e[28]!==E?(C=s.jsx(p,{children:E}),e[27]=p,e[28]=E,e[29]=C):C=e[29];let u;e[30]!==m||e[31]!==g||e[32]!==C?(u=s.jsxs(m,{children:[g,C]}),e[30]=m,e[31]=g,e[32]=C,e[33]=u):u=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Cs,{}),e[34]=A):A=e[34];let N;e[35]!==n.id||e[36]!==r?(N=S=>{S.stopPropagation(),r(n.id)},e[35]=n.id,e[36]=r,e[37]=N):N=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx($t,{size:16}),e[38]=P):P=e[38];let y;e[39]!==N?(y=s.jsxs(nt,{variant:"destructive",onClick:N,children:[P,"Remove Member"]}),e[39]=N,e[40]=y):y=e[40];let w;e[41]!==T||e[42]!==y||e[43]!==j||e[44]!==b||e[45]!==u?(w=s.jsxs(T,{align:j,onClick:b,children:[u,A,y]}),e[41]=T,e[42]=y,e[43]=j,e[44]=b,e[45]=u,e[46]=w):w=e[46];let M;return e[47]!==c||e[48]!==w||e[49]!==I?(M=s.jsxs(c,{children:[I,w]}),e[47]=c,e[48]=w,e[49]=I,e[50]=M):M=e[50],M}function Pn(t){return t.stopPropagation()}function Mn(t){return t.stopPropagation()}function Dt(t){const e=oe.c(8),{invitationId:n,onCancel:o,isCancelling:l}=t,r=l===void 0?!1:l;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Tt,{asChild:!0,children:s.jsx(ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Un,children:s.jsx(Ft,{size:20})})}),e[0]=d):d=e[0];let i;e[1]!==n||e[2]!==o?(i=m=>{m.stopPropagation(),o(n)},e[1]=n,e[2]=o,e[3]=i):i=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ht,{size:16}),e[4]=h):h=e[4];let p;return e[5]!==r||e[6]!==i?(p=s.jsxs(Ct,{children:[d,s.jsx(Et,{align:"end",onClick:Dn,children:s.jsxs(nt,{variant:"destructive",onClick:i,disabled:r,children:[h,"Cancel Invitation"]})})]}),e[5]=r,e[6]=i,e[7]=p):p=e[7],p}function Dn(t){return t.stopPropagation()}function Un(t){return t.stopPropagation()}function kn(){const t=oe.c(79),{data:e}=bt(),{data:n}=Cn(),o=Tn(),l=Me(),{locator:r}=Te(),[d,i]=k.useState(null),[h,p]=k.useState(null),[m,T]=k.useState(""),[c,E]=k.useState("table"),[g,j]=k.useState("member"),[b,I]=k.useState("asc"),C=e?.data?.members;let u;t[0]!==g?(u=V=>{g===V?I(Wn):(j(V),I("asc"))},t[0]=g,t[1]=u):u=t[1];const A=u;let N=C??[],P=n??[];if(m){const V=m.toLowerCase();N=N.filter(K=>K.user?.name?.toLowerCase().includes(V)||K.user?.email?.toLowerCase().includes(V)||K.role?.toLowerCase().includes(V)),P=P.filter(K=>K.email?.toLowerCase().includes(V)||K.role?.toLowerCase().includes(V))}if(g&&b){let V;t[2]!==b||t[3]!==g?(V=(K,de)=>{let xe,Ue;e:switch(g){case"member":{xe=K.user?.name||"",Ue=de.user?.name||"";break e}case"role":{xe=K.role||"",Ue=de.role||"";break e}case"joined":{xe=K.createdAt?typeof K.createdAt=="string"?K.createdAt:K.createdAt.toISOString():"",Ue=de.createdAt?typeof de.createdAt=="string"?de.createdAt:de.createdAt.toISOString():"";break e}default:return 0}return b==="asc"?xe.localeCompare(Ue):Ue.localeCompare(xe)},t[2]=b,t[3]=g,t[4]=V):V=t[4],N=[...N].sort(V)}const y=N;let w;t[5]!==r||t[6]!==l?(w={mutationFn:Yn,onSuccess:()=>{l.invalidateQueries({queryKey:ue.members(r)}),le.success("Member has been removed from the organization"),i(null)},onError:Zn},t[5]=r,t[6]=l,t[7]=w):w=t[7];const M=Ne(w);let S;t[8]!==r||t[9]!==l?(S={mutationFn:Jn,onSuccess:()=>{l.invalidateQueries({queryKey:ue.members(r)}),le.success("Member's role has been updated")},onError:qn},t[8]=r,t[9]=l,t[10]=S):S=t[10];const R=Ne(S);let f;t[11]!==r||t[12]!==l?(f={mutationFn:Qn,onSuccess:()=>{l.invalidateQueries({queryKey:ue.invitations(r)}),le.success("Invitation role has been updated")},onError:Hn},t[11]=r,t[12]=l,t[13]=f):f=t[13];const O=Ne(f),{roles:v,customRoles:x}=jt();let L;t[14]!==x?(L=wn(x),t[14]=x,t[15]=L):L=t[15];const D=L;let z;t[16]!==v?(z=v.filter(Kn),t[16]=v,t[17]=z):z=t[17];const B=z;let U;t[18]===Symbol.for("react.memo_cache_sentinel")?(U={id:"member",header:"Member",render:Fn,cellClassName:"flex-1 min-w-0",sortable:!0},t[18]=U):U=t[18];let q;t[19]!==D||t[20]!==B||t[21]!==O||t[22]!==R?(q={id:"role",header:"Role",render:V=>V.type==="member"?s.jsx(st,{role:V.data.role,memberId:V.data.id,isOwner:V.data.role==="owner",roleColorMap:D,selectableRoles:B,onRoleChange:(K,de)=>R.mutate({memberId:K,role:de}),className:"w-36"}):s.jsx(st,{role:V.data.role,memberId:V.data.id,isOwner:!1,roleColorMap:D,selectableRoles:B,onRoleChange:(K,de)=>O.mutate({invitationId:K,role:de,email:V.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[19]=D,t[20]=B,t[21]=O,t[22]=R,t[23]=q):q=t[23];let ee,re;t[24]===Symbol.for("react.memo_cache_sentinel")?(ee={id:"tags",header:"Tags",render:$n,cellClassName:"w-40 shrink-0"},re={id:"joined",header:"Joined",render:Bn,cellClassName:"w-48 shrink-0",sortable:!0},t[24]=ee,t[25]=re):(ee=t[24],re=t[25]);let te;t[26]!==o.cancel.isPending||t[27]!==v||t[28]!==R?(te={id:"actions",header:"",render:V=>V.type==="member"?s.jsx(Mt,{member:V.data,roles:v,onChangeRole:(K,de)=>R.mutate({memberId:K,role:de}),onRemove:i,isUpdating:R.isPending}):s.jsx(Dt,{invitationId:V.data.id,onCancel:p,isCancelling:o.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[26]=o.cancel.isPending,t[27]=v,t[28]=R,t[29]=te):te=t[29];let G;t[30]!==te||t[31]!==q?(G=[U,q,ee,re,te],t[30]=te,t[31]=q,t[32]=G):G=t[32];const a=G;let _;t[33]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(gn,{trigger:s.jsxs(ie,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:[s.jsx(Kt,{size:16}),"Manage Roles"]})}),t[33]=_):_=t[33];let $;t[34]===Symbol.for("react.memo_cache_sentinel")?($=s.jsxs("div",{className:"flex items-center gap-2",children:[_,s.jsx(bn,{trigger:s.jsx(ie,{size:"sm",children:"Invite Member"})})]}),t[34]=$):$=t[34];const fe=$,W=[...y.map(Gn),...P.filter(zn).map(Vn)],X=ve,Z=!!h;let he;t[35]===Symbol.for("react.memo_cache_sentinel")?(he=()=>p(null),t[35]=he):he=t[35];let Y;t[36]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsxs(Ge,{children:[s.jsx(Be,{children:"Cancel Invitation"}),s.jsx($e,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),t[36]=Y):Y=t[36];let Q;t[37]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(Ke,{children:"Keep Invitation"}),t[37]=Q):Q=t[37];let ce;t[38]!==o.cancel||t[39]!==h?(ce=()=>{h&&(o.cancel.mutate(h),p(null))},t[38]=o.cancel,t[39]=h,t[40]=ce):ce=t[40];let F;t[41]!==o.cancel.isPending||t[42]!==ce?(F=s.jsxs(ze,{children:[Y,s.jsxs(Fe,{children:[Q,s.jsx(He,{onClick:ce,disabled:o.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[41]=o.cancel.isPending,t[42]=ce,t[43]=F):F=t[43];let se;t[44]!==Z||t[45]!==F?(se=s.jsx(Ve,{open:Z,onOpenChange:he,children:F}),t[44]=Z,t[45]=F,t[46]=se):se=t[46];const ne=!!d;let ae;t[47]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>i(null),t[47]=ae):ae=t[47];let ge;t[48]===Symbol.for("react.memo_cache_sentinel")?(ge=s.jsxs(Ge,{children:[s.jsx(Be,{children:"Remove Member"}),s.jsx($e,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),t[48]=ge):ge=t[48];let Ee;t[49]===Symbol.for("react.memo_cache_sentinel")?(Ee=s.jsx(Ke,{children:"Cancel"}),t[49]=Ee):Ee=t[49];let H;t[50]!==d||t[51]!==M?(H=()=>d&&M.mutate(d),t[50]=d,t[51]=M,t[52]=H):H=t[52];let pe;t[53]!==M.isPending||t[54]!==H?(pe=s.jsxs(ze,{children:[ge,s.jsxs(Fe,{children:[Ee,s.jsx(He,{onClick:H,disabled:M.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[53]=M.isPending,t[54]=H,t[55]=pe):pe=t[55];let be;t[56]!==ne||t[57]!==pe?(be=s.jsx(Ve,{open:ne,onOpenChange:ae,children:pe}),t[56]=ne,t[57]=pe,t[58]=be):be=t[58];let _e;t[59]===Symbol.for("react.memo_cache_sentinel")?(_e=s.jsx(ve.Header.Left,{children:s.jsx(ns,{children:s.jsx(os,{children:s.jsx(rs,{children:s.jsx(is,{children:"Members"})})})})}),t[59]=_e):_e=t[59];let Ze;t[60]===Symbol.for("react.memo_cache_sentinel")?(Ze=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[60]=Ze):Ze=t[60];let Re;t[61]!==A||t[62]!==b||t[63]!==g||t[64]!==c?(Re=s.jsxs(ve.Header,{children:[_e,s.jsxs(ve.Header.Right,{children:[s.jsx(ss,{viewMode:c,onViewModeChange:E,sortKey:g,sortDirection:b,onSort:A,sortOptions:Ze}),fe]})]}),t[61]=A,t[62]=b,t[63]=g,t[64]=c,t[65]=Re):Re=t[65];let Ye;t[66]===Symbol.for("react.memo_cache_sentinel")?(Ye=V=>{V.key==="Escape"&&(T(""),V.target.blur())},t[66]=Ye):Ye=t[66];let we;t[67]!==m?(we=s.jsx(De,{value:m,onChange:T,placeholder:"Search members...",onKeyDown:Ye}),t[67]=m,t[68]=we):we=t[68];const lt=ve,at=c==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:W.length===0?s.jsx(ct,{title:"No members found",description:m?`No members match "${m}"`:"Invite members to get started."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:W.map(V=>{if(V.type==="invitation")return s.jsxs(Rt,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(Dt,{invitationId:V.data.id,onCancel:p,isCancelling:o.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Pe,{fallback:rt(V.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ie,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(st,{role:V.data.role,memberId:V.data.id,isOwner:!1,roleColorMap:D,selectableRoles:B,onRoleChange:(de,xe)=>O.mutate({invitationId:de,role:xe,email:V.data.email}),className:"w-fit"})]})]})]},`inv-${V.data.id}`);const K=V.data;return s.jsxs(Rt,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(Mt,{member:K,roles:v,onChangeRole:(de,xe)=>R.mutate({memberId:de,role:xe}),onRemove:i,isUpdating:R.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Pe,{url:K.user?.image??void 0,fallback:rt(K.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:K.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:K.user?.email}),s.jsx(st,{role:K.role,memberId:K.id,isOwner:K.role==="owner",roleColorMap:D,selectableRoles:B,onRoleChange:(de,xe)=>R.mutate({memberId:de,role:xe}),className:"w-fit"}),s.jsx(Yt,{memberId:K.id,maxDisplay:3})]})]})]},K.id)})})}):s.jsx(ls,{columns:a,data:W,isLoading:!1,sortKey:g,sortDirection:b,onSort:A,emptyState:m?s.jsx(ct,{title:"No members found",description:`No members match "${m}"`}):s.jsx(ct,{title:"No members found",description:"Invite members to get started."})});let Le;t[69]!==lt.Content||t[70]!==at?(Le=s.jsx(lt.Content,{children:at}),t[69]=lt.Content,t[70]=at,t[71]=Le):Le=t[71];let We;return t[72]!==X||t[73]!==se||t[74]!==be||t[75]!==Re||t[76]!==we||t[77]!==Le?(We=s.jsxs(X,{children:[se,be,Re,we,Le]}),t[72]=X,t[73]=se,t[74]=be,t[75]=Re,t[76]=we,t[77]=Le,t[78]=We):We=t[78],We}function Vn(t){return{type:"invitation",data:t}}function zn(t){return t.status==="pending"}function Gn(t){return{type:"member",data:t}}function Bn(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?Ln(t.data.createdAt):"N/A"}):s.jsx(Ie,{variant:"outline",children:"Pending"})}function $n(t){return t.type==="member"?s.jsx(Yt,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function Fn(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Pe,{url:t.data.user?.image??void 0,fallback:rt(t.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.user?.name||"Unknown"}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Pe,{fallback:rt(t.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function Kn(t){return t.role!=="owner"}function Hn(t){le.error(t instanceof Error?t.message:"Failed to update invitation role")}async function Qn(t){const{invitationId:e,role:n,email:o}=t,l=await me.organization.cancelInvitation({invitationId:e});if(l?.error)throw new Error(l.error.message);const r=await me.organization.inviteMember({email:o,role:n});if(r?.error)throw new Error(r.error.message)}function qn(t){le.error(t instanceof Error?t.message:"Failed to update role")}async function Jn(t){const{memberId:e,role:n}=t,o=await me.organization.updateMemberRole({memberId:e,role:[n]});if(o?.error)throw new Error(o.error.message)}function Zn(t){le.error(t instanceof Error?t.message:"Failed to remove member")}async function Yn(t){const e=await me.organization.removeMember({memberIdOrEmail:t});if(e?.error)throw new Error(e.error.message)}function Wn(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function nr(){const t=oe.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ve,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ts,{fallback:e,children:s.jsx(k.Suspense,{fallback:s.jsx(ve,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Qe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(kn,{})})}),t[1]=n):n=t[1],n}export{nr as default};