decocms 2.175.1 → 2.175.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/dist/client/assets/{AlertCircle-De9oqjty.js → AlertCircle-Bu9DNwe-.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-BaG4OcCg.js → AlignLeft-CJvAdEi-.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-PFFBPH3j.js → ArrowDown-BrkOB1Av.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-CPWCs_Od.js → ArrowLeft-BLUY3Pjw.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-C6Q-EpUw.js → ArrowUp-Bl5YEbbF.js} +1 -1
  6. package/dist/client/assets/{Check-BfKCyKXX.js → Check-CN56KhoF.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DiRi76qb.js → CheckCircle-B4pYO1ZS.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-ZekLHdFZ.js → CheckDone01-DgXembQE.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-DC3VT092.js → CheckVerified02-BTUqey_K.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-BHMaRWRt.js → ChevronDown-BURkaeCD.js} +1 -1
  11. package/dist/client/assets/{ChevronLeft-0cpA2yNq.js → ChevronLeft-C1fUg8Ja.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-1g9z-Z5h.js → ChevronRight-Df5oEIdG.js} +1 -1
  13. package/dist/client/assets/{ChevronUp-1s_S3eDF.js → ChevronUp-Ql_IhfwF.js} +1 -1
  14. package/dist/client/assets/{Clock-rHd8cQAO.js → Clock-DY1djxCP.js} +1 -1
  15. package/dist/client/assets/{Code01-CoTQP8pZ.js → Code01-ClhNhs6L.js} +1 -1
  16. package/dist/client/assets/{Coins01-D7lfLTbO.js → Coins01-C0DqkhBz.js} +1 -1
  17. package/dist/client/assets/{Container-DwxLlgWA.js → Container-De-pv4QL.js} +1 -1
  18. package/dist/client/assets/{Copy01-CIUDy0Hr.js → Copy01-E3kqWO3T.js} +1 -1
  19. package/dist/client/assets/{Dataflow03-T9TmjQN-.js → Dataflow03-DVfc8SxS.js} +1 -1
  20. package/dist/client/assets/{DotsHorizontal-CmCKbvuJ.js → DotsHorizontal-zFut2S5z.js} +1 -1
  21. package/dist/client/assets/{DotsVertical-Y8XpM2B_.js → DotsVertical-ZWNLrGdE.js} +1 -1
  22. package/dist/client/assets/{Download01-LinNp3zy.js → Download01-D_QoltgV.js} +1 -1
  23. package/dist/client/assets/{Edit01-Dw-lPBk-.js → Edit01-KzFCPjcw.js} +1 -1
  24. package/dist/client/assets/{Edit05-Bx682Mm6.js → Edit05-DFdmrfVO.js} +1 -1
  25. package/dist/client/assets/{Eye-JuDcZhJz.js → Eye-CUyEl5IU.js} +1 -1
  26. package/dist/client/assets/{EyeOff-9_-SJWcU.js → EyeOff-D3iBtnD1.js} +1 -1
  27. package/dist/client/assets/{File02-bFwU_wEK.js → File02-CqU_tyTM.js} +1 -1
  28. package/dist/client/assets/{File06-CU5oU1OI.js → File06-B23HFdp6.js} +1 -1
  29. package/dist/client/assets/{FilterLines-BaTxnUjH.js → FilterLines-B4Jg_hkv.js} +1 -1
  30. package/dist/client/assets/{Globe01-DUjsFcPS.js → Globe01-BAfb6FiF.js} +1 -1
  31. package/dist/client/assets/{Globe02-k3_A41kp.js → Globe02-DAjgLqHS.js} +1 -1
  32. package/dist/client/assets/{Grid01-DBOkAm2V.js → Grid01-B7q4cvPD.js} +1 -1
  33. package/dist/client/assets/{Hash02-gqJDwuju.js → Hash02-BPlWtian.js} +1 -1
  34. package/dist/client/assets/{Home02-DfEb-Myv.js → Home02-BYbFBx09.js} +1 -1
  35. package/dist/client/assets/{Image01-I9pAeT0N.js → Image01-C62qGXSk.js} +1 -1
  36. package/dist/client/assets/{Inbox01-BgDmihAV.js → Inbox01-BF4_faho.js} +1 -1
  37. package/dist/client/assets/{InfoCircle-LX1SVC24.js → InfoCircle-DhO0vGS4.js} +1 -1
  38. package/dist/client/assets/{Key01-DAjAUWfr.js → Key01-Bfc7gsTd.js} +1 -1
  39. package/dist/client/assets/{LayersTwo01-C-XZtFtv.js → LayersTwo01-CsbV79W9.js} +1 -1
  40. package/dist/client/assets/{LayoutLeft-BvuIBX8d.js → LayoutLeft-BjhMzXil.js} +1 -1
  41. package/dist/client/assets/{Link01-q2vhCqdM.js → Link01-CBvOA17k.js} +1 -1
  42. package/dist/client/assets/{LinkExternal01-QGWpvftd.js → LinkExternal01-v1Fp9c9j.js} +1 -1
  43. package/dist/client/assets/{List-CuV23QYs.js → List-DxiRK8pO.js} +1 -1
  44. package/dist/client/assets/{Loading01-BNn4YU_K.js → Loading01-CDOurw-F.js} +1 -1
  45. package/dist/client/assets/{Lock01-DJQX15kR.js → Lock01-jAI5MKWg.js} +1 -1
  46. package/dist/client/assets/{Play-C7yKo0dH.js → Play-DSE8IZVS.js} +1 -1
  47. package/dist/client/assets/{Plus-CT_Gcwl2.js → Plus-OTc7Ql1V.js} +1 -1
  48. package/dist/client/assets/{RefreshCcw01-uL9q48A4.js → RefreshCcw01-QnfLSKau.js} +1 -1
  49. package/dist/client/assets/{Save01-CuwI4Bxq.js → Save01-Df_qJsfN.js} +1 -1
  50. package/dist/client/assets/{SearchMd-BLeX5weN.js → SearchMd-D6jy19cO.js} +1 -1
  51. package/dist/client/assets/{Settings01-2AkYiqYr.js → Settings01-Bl2wNagM.js} +1 -1
  52. package/dist/client/assets/{Shield01-D6IOCC-Z.js → Shield01-B145EOAd.js} +1 -1
  53. package/dist/client/assets/{Terminal-Dlvh4GS2.js → Terminal-D3ILbCbK.js} +1 -1
  54. package/dist/client/assets/{Tool01-CjSIsyxE.js → Tool01-BBVRBzC0.js} +1 -1
  55. package/dist/client/assets/{Trash01-YPQczxci.js → Trash01-DhGTBhjv.js} +1 -1
  56. package/dist/client/assets/{Upload01-BlEN4mwB.js → Upload01-DvtQC2yf.js} +1 -1
  57. package/dist/client/assets/{Users03-B7X28dbt.js → Users03-B2n8Cd76.js} +1 -1
  58. package/dist/client/assets/{X-B_f76BPZ.js → X-DVxsAMCH.js} +1 -1
  59. package/dist/client/assets/{XAxis-Du5m1KMx.js → XAxis-D14vbkR0.js} +1 -1
  60. package/dist/client/assets/{XCircle-DDLf4PgL.js → XCircle-l3Ck-71_.js} +1 -1
  61. package/dist/client/assets/{XClose-eeK1fS1n.js → XClose-C8g1LxXV.js} +1 -1
  62. package/dist/client/assets/{Zap-DHey7Hu_.js → Zap-DUVjsAS1.js} +1 -1
  63. package/dist/client/assets/{agent-connections-preview-D6uKmygR.js → agent-connections-preview-D0-1Au_l.js} +1 -1
  64. package/dist/client/assets/agent-detail-BALBko9m.js +2 -0
  65. package/dist/client/assets/agents-BuGtmP_d.js +1 -0
  66. package/dist/client/assets/ai-providers-logos-NSo4Ckh1.js +1 -0
  67. package/dist/client/assets/{alert-dialog-BVglQjyM.js → alert-dialog-DfOenbUZ.js} +1 -1
  68. package/dist/client/assets/{auth-catchall-Bfllc4Ni.js → auth-catchall-BAl96W8M.js} +1 -1
  69. package/dist/client/assets/automation-detail-D16eCAb7.js +1 -0
  70. package/dist/client/assets/automations-UpOWNkQ6.js +1 -0
  71. package/dist/client/assets/{avatar-OE2URZfM.js → avatar-DexhTB4g.js} +1 -1
  72. package/dist/client/assets/{badge-CAg946Xk.js → badge-C7XTRm7k.js} +1 -1
  73. package/dist/client/assets/{binder-DTBFGqjl.js → binder--omYMrhv.js} +1 -1
  74. package/dist/client/assets/{breadcrumb-aP02JuZO.js → breadcrumb-h9Dq7GJ0.js} +1 -1
  75. package/dist/client/assets/{card-RQxLVCBk.js → card-Cm-keK-z.js} +1 -1
  76. package/dist/client/assets/{chart-D9IwJUjP.js → chart-BkIsuiHb.js} +1 -1
  77. package/dist/client/assets/{checkbox-DLsMmmhu.js → checkbox-B92JdB3t.js} +1 -1
  78. package/dist/client/assets/{collapsible-CGr-TiAc.js → collapsible-B5VFLcG-.js} +1 -1
  79. package/dist/client/assets/{collection-detail-CZQpkHig.js → collection-detail-BUpBhGP1.js} +2 -2
  80. package/dist/client/assets/{collection-display-button-VOymjalV.js → collection-display-button-CEqdF8O7.js} +1 -1
  81. package/dist/client/assets/{collection-search-62vwaqdq.js → collection-search-CPQlTmfx.js} +1 -1
  82. package/dist/client/assets/{collection-table-wrapper-DPJfuSg9.js → collection-table-wrapper-BVpN3w_L.js} +1 -1
  83. package/dist/client/assets/{collection-tabs-FJx5TF4Z.js → collection-tabs-DwGvAiHF.js} +1 -1
  84. package/dist/client/assets/{command-ChmbB2jp.js → command-BYr1e0yf.js} +1 -1
  85. package/dist/client/assets/connect-DKqC06uo.js +1 -0
  86. package/dist/client/assets/{connection-card-D9I87KkT.js → connection-card-BDqdYEuX.js} +1 -1
  87. package/dist/client/assets/connection-detail-CHMgcK2a.js +1 -0
  88. package/dist/client/assets/{connection-status-D_iX92lK.js → connection-status-B854Axgl.js} +1 -1
  89. package/dist/client/assets/connections-DxOgNXy0.js +1 -0
  90. package/dist/client/assets/{constants-XtX-WKGm.js → constants-BZUBXkLq.js} +1 -1
  91. package/dist/client/assets/constants-DgbSVhNJ.js +1 -0
  92. package/dist/client/assets/{context-CtrnP3HC.js → context-GHqlq7Gd.js} +1 -1
  93. package/dist/client/assets/{create-organization-dialog-DlsDrfHE.js → create-organization-dialog-Cum8PmLv.js} +1 -1
  94. package/dist/client/assets/{create-project-dialog-BV-JjiBR.js → create-project-dialog-d10TQ9K8.js} +1 -1
  95. package/dist/client/assets/{danger-B3KgXwQ9.js → danger-qmT_QFAs.js} +1 -1
  96. package/dist/client/assets/{danger-zone-C_4VhnMp.js → danger-zone-daxj8FQE.js} +1 -1
  97. package/dist/client/assets/{dependencies-BHUeYRA7.js → dependencies-sz-4aCSB.js} +1 -1
  98. package/dist/client/assets/{dialog-_XYw8lZC.js → dialog-PlqYdiap.js} +1 -1
  99. package/dist/client/assets/{dropdown-menu-DzFMEBVS.js → dropdown-menu-V8gWmDzD.js} +1 -1
  100. package/dist/client/assets/dynamic-plugin-layout-PDo9TaOG.js +1 -0
  101. package/dist/client/assets/{editable-task-title-B7Ktbs3r.js → editable-task-title-CXa2sXGX.js} +1 -1
  102. package/dist/client/assets/{empty-state-D4GX29pL.js → empty-state-BUpyINsX.js} +1 -1
  103. package/dist/client/assets/{empty-state-AMuFIqs3.js → empty-state-CADB2xYt.js} +1 -1
  104. package/dist/client/assets/{env-vars-editor-DTKmdK-v.js → env-vars-editor-Crsr3jiO.js} +1 -1
  105. package/dist/client/assets/{extract-connection-data-CS_Bn7Ri.js → extract-connection-data-CBWW8njI.js} +1 -1
  106. package/dist/client/assets/{file-browser-OSAi_CZb.js → file-browser-Ba38jp_3.js} +2 -2
  107. package/dist/client/assets/{form-BN7_f2uj.js → form-CnUcVXlu.js} +1 -1
  108. package/dist/client/assets/{general-B9J0F1Xq.js → general-D78WAnZa.js} +1 -1
  109. package/dist/client/assets/{grid-view-BH674f3N.js → grid-view-D92iM48j.js} +1 -1
  110. package/dist/client/assets/{home-Dam4fMEZ.js → home-Dh3Zkl7g.js} +1 -1
  111. package/dist/client/assets/{index-zjV4p_E5.js → index-AtuNXtl1.js} +1 -1
  112. package/dist/client/assets/{index-CuSj4QrF.js → index-BAS3V89m.js} +1 -1
  113. package/dist/client/assets/index-BG9x5ELw.js +25 -0
  114. package/dist/client/assets/index-Bs-gkatC.js +1 -0
  115. package/dist/client/assets/{index-Cn8BPdHZ.js → index-CMdtjEkH.js} +1 -1
  116. package/dist/client/assets/{index-CcA_QriT.js → index-Ce1KA469.js} +1 -1
  117. package/dist/client/assets/index-Ci8WAd55.css +1 -0
  118. package/dist/client/assets/{index-C-NLwTON.js → index-D0LkSlcd.js} +1 -1
  119. package/dist/client/assets/{index-DxP-spTj.js → index-DDOXVfmG.js} +1 -1
  120. package/dist/client/assets/{index-Da9ggy60.js → index-DINW__d9.js} +1 -1
  121. package/dist/client/assets/{index-DsOJvxnb.js → index-SkQC2bL2.js} +3 -3
  122. package/dist/client/assets/{infiniteQueryObserver-BE0Fq7u7.js → infiniteQueryObserver-dFlgfKVl.js} +1 -1
  123. package/dist/client/assets/{input-CUT8DBv1.js → input-C4xXFdLa.js} +1 -1
  124. package/dist/client/assets/{integration-icon-CVxvM4fR.js → integration-icon-9nN5AvVn.js} +1 -1
  125. package/dist/client/assets/{label-iPw5smAw.js → label-B5UIAzjB.js} +1 -1
  126. package/dist/client/assets/layout-C93ItuDu.js +1 -0
  127. package/dist/client/assets/{layout-C2ZnDBkW.js → layout-DIeoK390.js} +1 -1
  128. package/dist/client/assets/{login-DJvdi7W3.js → login-Cum9TENA.js} +1 -1
  129. package/dist/client/assets/{logo-upload-DlKQk0GB.js → logo-upload-HuBGdFvy.js} +1 -1
  130. package/dist/client/assets/{markdown-CKKBcXcE.js → markdown-C7LUMDS1.js} +1 -1
  131. package/dist/client/assets/{mcp-app-renderer-IX_OR3wW.js → mcp-app-renderer-8UT29L5G.js} +1 -1
  132. package/dist/client/assets/{mcp-server-card-Cq5E9kuT.js → mcp-server-card--KsSGXj4.js} +1 -1
  133. package/dist/client/assets/mcp-server-detail-DpFZrrxK.js +2 -0
  134. package/dist/client/assets/members-Cv4ALw5c.js +3 -0
  135. package/dist/client/assets/{monaco-editor-J8rInsT2.js → monaco-editor-CGQB1ouQ.js} +1 -1
  136. package/dist/client/assets/monitoring-dashboard-edit-_8LF_BxB.js +1 -0
  137. package/dist/client/assets/{monitoring-dashboard-view-Dt4aILCV.js → monitoring-dashboard-view-CZdUWDWw.js} +2 -2
  138. package/dist/client/assets/monitoring-jUgSe2al.js +4 -0
  139. package/dist/client/assets/{monitoring-stats-row-Dx_W_1nT.js → monitoring-stats-row-DOJg3snj.js} +1 -1
  140. package/dist/client/assets/{oauth-callback-COUada1q.js → oauth-callback-DUHDiUnV.js} +1 -1
  141. package/dist/client/assets/{oauth-callback-ai-provider-CqS-ybCD.js → oauth-callback-ai-provider-DJ-b74-1.js} +1 -1
  142. package/dist/client/assets/org-ai-providers-DUCq5EUw.js +1 -0
  143. package/dist/client/assets/page-DAq05p7G.js +1 -0
  144. package/dist/client/assets/page-SgyDrWHD.js +1 -0
  145. package/dist/client/assets/{plugin-empty-state-CRLH-_5S.js → plugin-empty-state-CrnlpA9V.js} +1 -1
  146. package/dist/client/assets/{plugin-empty-state-Dt2dvxD9.js → plugin-empty-state-Dnds-DCV.js} +1 -1
  147. package/dist/client/assets/{plugin-header-DLDBKovk.js → plugin-header-C1XYEeTv.js} +1 -1
  148. package/dist/client/assets/{plugin-header-CkWzqJkZ.js → plugin-header-CIduSygp.js} +1 -1
  149. package/dist/client/assets/plugins-CJcJdSWL.js +1 -0
  150. package/dist/client/assets/{popover-CF3EN_0o.js → popover-U_QlVu0r.js} +1 -1
  151. package/dist/client/assets/project-app-view-D9t5-mJm.js +1 -0
  152. package/dist/client/assets/project-layout-BL0jttJZ.js +1 -0
  153. package/dist/client/assets/{project-plugins-DRIvSpW5.js → project-plugins-By0aRQeH.js} +1 -1
  154. package/dist/client/assets/projects-list-C2BO1TYf.js +1 -0
  155. package/dist/client/assets/{registry-layout-MGTBGYDW.js → registry-layout-CNpSd9I3.js} +1 -1
  156. package/dist/client/assets/{registry-utils-Cd3t_Kmp.js → registry-utils-Bi8LTB_e.js} +1 -1
  157. package/dist/client/assets/{reports-layout-Cu0HmCBt.js → reports-layout-DH4L5-lG.js} +1 -1
  158. package/dist/client/assets/{reset-password-Dwr8terU.js → reset-password-BiJO11OF.js} +1 -1
  159. package/dist/client/assets/{resizable-D4LJctEl.js → resizable-XfUJo45G.js} +1 -1
  160. package/dist/client/assets/{save-actions-MzYbolsq.js → save-actions-AenTNPs2.js} +1 -1
  161. package/dist/client/assets/{scroll-area-B5XbONJS.js → scroll-area-BvqSXnHA.js} +1 -1
  162. package/dist/client/assets/{select-DRPG5csU.js → select-Bqr12jkn.js} +1 -1
  163. package/dist/client/assets/{select-virtual-mcp-B8NgSgPI.js → select-virtual-mcp-DorfgjZR.js} +1 -1
  164. package/dist/client/assets/{sheet-BQuKOEiL.js → sheet-D7MnTm5h.js} +1 -1
  165. package/dist/client/assets/shell-layout-F6dMRYN1.js +3 -0
  166. package/dist/client/assets/{sidebar-settings-BqDjI96r.js → sidebar-settings-ZSwNsZur.js} +1 -1
  167. package/dist/client/assets/{skeleton-DJFpR-1P.js → skeleton-xiE088f2.js} +1 -1
  168. package/dist/client/assets/{spinner-CqAVfcvO.js → spinner-Bt_p6wlU.js} +1 -1
  169. package/dist/client/assets/{store-invite-JCf8JSic.js → store-invite-BxsZ0zsl.js} +1 -1
  170. package/dist/client/assets/{switch-BQjzAGvm.js → switch-BIAgKxiJ.js} +1 -1
  171. package/dist/client/assets/{table-DJbHB5IL.js → table-c-SrSmwK.js} +1 -1
  172. package/dist/client/assets/{tabs-CkPDQzeX.js → tabs-CytiJeE2.js} +1 -1
  173. package/dist/client/assets/{task-status-wkv2GdSY.js → task-status-9RY3Ya8o.js} +16 -16
  174. package/dist/client/assets/tasks-C43Ik9tC.js +1 -0
  175. package/dist/client/assets/{tasks-panel-TN0GeEUK.js → tasks-panel-CftcenZ4.js} +1 -1
  176. package/dist/client/assets/{textarea-CTzX43MZ.js → textarea-Buug1Hxe.js} +1 -1
  177. package/dist/client/assets/{time-range-picker-DNJ6dRiN.js → time-range-picker-BlD0TDtN.js} +1 -1
  178. package/dist/client/assets/{toggle-group-y2h19HHT.js → toggle-group-abCGptw4.js} +1 -1
  179. package/dist/client/assets/{tools-list-Db7zzadA.js → tools-list-BdA1jEJI.js} +1 -1
  180. package/dist/client/assets/{tooltip-XyKE4lZa.js → tooltip-Ckpai_jH.js} +1 -1
  181. package/dist/client/assets/{topbar-portal-D3fRQWai.js → topbar-portal-B-Tb-3gt.js} +1 -1
  182. package/dist/client/assets/{types-B3niHy47.js → types-CUEMI47Y.js} +1 -1
  183. package/dist/client/assets/{use-automations-C4CL-jAO.js → use-automations-Cw8FAF0H.js} +1 -1
  184. package/dist/client/assets/{use-binding-BfjFWpEn.js → use-binding-f1akiPTf.js} +1 -1
  185. package/dist/client/assets/{use-collections-DSWhP4jg.js → use-collections-C3CSj681.js} +1 -1
  186. package/dist/client/assets/{use-connection-DmR852Js.js → use-connection-DSkVzqSP.js} +1 -1
  187. package/dist/client/assets/{use-copy-dSR0w-bG.js → use-copy-F9tiQWTi.js} +1 -1
  188. package/dist/client/assets/{use-create-virtual-mcp-DXWAjide.js → use-create-virtual-mcp-C5n2ShE6.js} +1 -1
  189. package/dist/client/assets/{use-infinite-scroll-CvaIKLMy.js → use-infinite-scroll-C1Dhvj0C.js} +1 -1
  190. package/dist/client/assets/{use-install-from-registry-_FQYQGQx.js → use-install-from-registry-BQfcs7M8.js} +1 -1
  191. package/dist/client/assets/{use-list-state-Ck8sSm9J.js → use-list-state-Djxe5eyh.js} +1 -1
  192. package/dist/client/assets/{use-mcp-prompts-C-XU_-dc.js → use-mcp-prompts-D5tu2gbi.js} +1 -1
  193. package/dist/client/assets/{use-mcp-resources-Bxkx1Ub1.js → use-mcp-resources-D0eHe68n.js} +1 -1
  194. package/dist/client/assets/{use-mcp-tools-BXmfFmar.js → use-mcp-tools-DTZxAm-y.js} +1 -1
  195. package/dist/client/assets/{use-members-B-Cx3SpJ.js → use-members-DdPysVve.js} +1 -1
  196. package/dist/client/assets/{use-mobile-O8KVzGuv.js → use-mobile-DqlomLIB.js} +1 -1
  197. package/dist/client/assets/{use-project-Bg5pX2Ab.js → use-project-Cdk7AuZE.js} +1 -1
  198. package/dist/client/assets/{use-store-discovery-DPE_0zuT.js → use-store-discovery-C_al4z4H.js} +1 -1
  199. package/dist/client/assets/{use-view-mode-ve-Q_Sd0.js → use-view-mode-Ag3VBJ77.js} +1 -1
  200. package/dist/client/assets/{use-virtual-mcp-C9XdHCA_.js → use-virtual-mcp-V0XoWMM_.js} +1 -1
  201. package/dist/client/assets/useInfiniteQuery-BXEdoCXW.js +1 -0
  202. package/dist/client/assets/{useMutation-B_cFG709.js → useMutation-CXgAMvoC.js} +1 -1
  203. package/dist/client/assets/useQuery-CtOvMPbo.js +1 -0
  204. package/dist/client/assets/useSuspenseInfiniteQuery-Ds_6ilsi.js +1 -0
  205. package/dist/client/assets/{user-rS26WEu1.js → user-C2BDT4Rq.js} +1 -1
  206. package/dist/client/assets/workflow-Bp2ajWVc.js +1 -0
  207. package/dist/client/index.html +2 -2
  208. package/dist/server/cli.js +243 -243
  209. package/dist/server/node_modules/async-exit-hook/CHANGELOG.md +62 -0
  210. package/dist/server/node_modules/async-exit-hook/index.js +171 -0
  211. package/dist/server/node_modules/async-exit-hook/license +21 -0
  212. package/dist/server/node_modules/async-exit-hook/package.json +66 -0
  213. package/dist/server/node_modules/async-exit-hook/readme.md +118 -0
  214. package/dist/server/node_modules/pg-int8/LICENSE +13 -0
  215. package/dist/server/node_modules/pg-int8/README.md +16 -0
  216. package/dist/server/node_modules/pg-int8/index.js +100 -0
  217. package/dist/server/node_modules/pg-int8/package.json +24 -0
  218. package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
  219. package/dist/server/node_modules/postgres-array/index.js +97 -0
  220. package/dist/server/node_modules/{pg/LICENSE → postgres-array/license} +6 -6
  221. package/dist/server/node_modules/postgres-array/package.json +35 -0
  222. package/dist/server/node_modules/postgres-array/readme.md +43 -0
  223. package/dist/server/node_modules/postgres-bytea/index.js +33 -0
  224. package/dist/server/node_modules/postgres-bytea/license +21 -0
  225. package/dist/server/node_modules/postgres-bytea/package.json +34 -0
  226. package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
  227. package/dist/server/node_modules/postgres-date/index.js +116 -0
  228. package/dist/server/node_modules/postgres-date/license +21 -0
  229. package/dist/server/node_modules/postgres-date/package.json +33 -0
  230. package/dist/server/node_modules/postgres-date/readme.md +49 -0
  231. package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
  232. package/dist/server/node_modules/postgres-interval/index.js +125 -0
  233. package/dist/server/node_modules/postgres-interval/license +21 -0
  234. package/dist/server/node_modules/postgres-interval/package.json +36 -0
  235. package/dist/server/node_modules/postgres-interval/readme.md +48 -0
  236. package/dist/server/node_modules/split2/LICENSE +13 -0
  237. package/dist/server/node_modules/split2/README.md +85 -0
  238. package/dist/server/node_modules/split2/bench.js +27 -0
  239. package/dist/server/node_modules/split2/index.js +141 -0
  240. package/dist/server/node_modules/split2/package.json +39 -0
  241. package/dist/server/node_modules/split2/test.js +409 -0
  242. package/dist/server/server.js +217 -217
  243. package/package.json +1 -1
  244. package/dist/client/assets/agent-detail-BS4g93cA.js +0 -2
  245. package/dist/client/assets/agents-BuWI7PBX.js +0 -1
  246. package/dist/client/assets/ai-providers-logos-W57Qm-EN.js +0 -1
  247. package/dist/client/assets/automation-detail-DNo-sbc_.js +0 -1
  248. package/dist/client/assets/automations-CCXftgU_.js +0 -1
  249. package/dist/client/assets/circle-alert-DCE_cWKa.js +0 -1
  250. package/dist/client/assets/connect-Cak7aHsQ.js +0 -1
  251. package/dist/client/assets/connection-detail-ZRvu6X4P.js +0 -1
  252. package/dist/client/assets/connections-Bi0oPT3Y.js +0 -1
  253. package/dist/client/assets/constants-B4Swgi3d.js +0 -1
  254. package/dist/client/assets/dynamic-plugin-layout-b0Zt6Dxk.js +0 -1
  255. package/dist/client/assets/index-D5cL24p_.css +0 -1
  256. package/dist/client/assets/index-MKlLgXIW.js +0 -25
  257. package/dist/client/assets/index-X4FDee1r.js +0 -1
  258. package/dist/client/assets/layout-CA_pUlCy.js +0 -1
  259. package/dist/client/assets/mcp-server-detail-CTGb-hF0.js +0 -2
  260. package/dist/client/assets/members-CYtrIFR5.js +0 -3
  261. package/dist/client/assets/monitoring-dashboard-edit-6gWIXCOX.js +0 -1
  262. package/dist/client/assets/monitoring-gb_hJ2kW.js +0 -4
  263. package/dist/client/assets/org-ai-providers-BDwPbfg4.js +0 -1
  264. package/dist/client/assets/page-BrXIXidh.js +0 -1
  265. package/dist/client/assets/page-s-fs9Bly.js +0 -1
  266. package/dist/client/assets/plugins-DkI_FXfU.js +0 -1
  267. package/dist/client/assets/project-app-view-Boof680i.js +0 -1
  268. package/dist/client/assets/project-layout-CxwbtNi5.js +0 -1
  269. package/dist/client/assets/projects-list-DmvsbHJl.js +0 -1
  270. package/dist/client/assets/shell-layout-ZGvfzjfQ.js +0 -3
  271. package/dist/client/assets/tasks-zu-x8h5W.js +0 -1
  272. package/dist/client/assets/use-llm-BkLbMZPM.js +0 -1
  273. package/dist/client/assets/use-local-storage-CxC8ozOe.js +0 -1
  274. package/dist/client/assets/useInfiniteQuery-DEfXPFTs.js +0 -1
  275. package/dist/client/assets/useQuery-D2ShO4od.js +0 -1
  276. package/dist/client/assets/useSuspenseInfiniteQuery-CT40dICu.js +0 -1
  277. package/dist/client/assets/workflow-C4-p-dLU.js +0 -1
  278. package/dist/server/node_modules/pg/README.md +0 -95
  279. package/dist/server/node_modules/pg/esm/index.mjs +0 -20
  280. package/dist/server/node_modules/pg/lib/client.js +0 -743
  281. package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
  282. package/dist/server/node_modules/pg/lib/connection.js +0 -221
  283. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
  284. package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
  285. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
  286. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
  287. package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
  288. package/dist/server/node_modules/pg/lib/defaults.js +0 -91
  289. package/dist/server/node_modules/pg/lib/index.js +0 -73
  290. package/dist/server/node_modules/pg/lib/native/client.js +0 -323
  291. package/dist/server/node_modules/pg/lib/native/index.js +0 -2
  292. package/dist/server/node_modules/pg/lib/native/query.js +0 -165
  293. package/dist/server/node_modules/pg/lib/query.js +0 -252
  294. package/dist/server/node_modules/pg/lib/result.js +0 -109
  295. package/dist/server/node_modules/pg/lib/stream.js +0 -83
  296. package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
  297. package/dist/server/node_modules/pg/lib/utils.js +0 -217
  298. package/dist/server/node_modules/pg/package.json +0 -76
@@ -0,0 +1 @@
1
+ import{r as v,c as O,f as st,j as s,y as me,w as Je,o as us,n as Ge,e as at,u as ue,x as kt,t as fs,q as ps,K as ut,B as de,c5 as Pt,O as Ie,P as It,S as Ze,g as xs,av as hs}from"./index-SkQC2bL2.js";import{u as Et}from"./use-project-Cdk7AuZE.js";import{D as Ot,a as gs,b as vs,c as Dt,d as Lt}from"./dialog-PlqYdiap.js";import{i as ys}from"./X-DVxsAMCH.js";import{S as ie}from"./skeleton-xiE088f2.js";import{i as bs,u as js,a as Ns,O as Ss}from"./org-ai-providers-DUCq5EUw.js";import{A as Tt}from"./avatar-DexhTB4g.js";import{t as ws,i as rt}from"./Coins01-C0DqkhBz.js";import{t as Cs}from"./Settings01-Bl2wNagM.js";import{t as As}from"./Users03-B2n8Cd76.js";import{i as _s}from"./Zap-DUVjsAS1.js";import{a as ks,b as Ps,c as Is,T as Es}from"./tooltip-Ckpai_jH.js";import{i as Os}from"./Check-CN56KhoF.js";import{a as Ds}from"./Copy01-E3kqWO3T.js";import{S as De}from"./switch-BIAgKxiJ.js";import{S as Ls,a as Ts,d as We,c as zs}from"./select-Bqr12jkn.js";import{i as $s}from"./Code01-ClhNhs6L.js";import{s as zt}from"./RefreshCcw01-QnfLSKau.js";import{i as Ms}from"./Shield01-B145EOAd.js";import{u as Bs}from"./useMutation-CXgAMvoC.js";import{a as Gs,F as Fe,b as Re,c as Ue,d as Ke,f as Ve,e as Ws}from"./form-CnUcVXlu.js";import{I as Pe}from"./input-C4xXFdLa.js";import{L as Fs}from"./logo-upload-HuBGdFvy.js";import{P as Rs}from"./project-plugins-By0aRQeH.js";import{ag as Us,ah as Ks,ai as Vs,M as ne,r as lt,D as $t,u as Me,t as fe,aj as ft,ak as pt,Z as Mt,al as Bt,am as Gt,H as it,c as Be,s as nt,an as Ys,ao as Hs,e as Wt,ap as ot,aq as ct,f as Ft,ar as qs,i as Rt,h as xt,g as Xs,as as Qs,p as Js,R as Zs,S as ea,j as ta,at as sa,k as Ut,l as aa,n as ra,q as la,au as ia,m as na,o as oa,v as ca,L as Le,G as da,w as ht,x as gt,z as ma,a6 as Kt,J as ua,A as Ne,y as fa,av as pa,B as xa,E as ha,F as ga,aw as Ye,ax as Te,ay as J,a2 as Vt,az as va,aA as ya,aB as ba,aa as ja,aC as Na,aD as Sa,ab as wa,aE as Ca,aF as Aa,aG as _a,af as ka,I as Pa,K as Ia,C as Ea,a as Oa,b as Da}from"./chart-BkIsuiHb.js";import{L as _e}from"./label-B5UIAzjB.js";import{B as La}from"./badge-C7XTRm7k.js";import{a as Ta,T as He,b as qe,c as za}from"./tabs-CytiJeE2.js";import{i as $a}from"./AlertCircle-Bu9DNwe-.js";import{s as Yt}from"./Plus-OTc7Ql1V.js";import{u as Ae,a as dt,K as Ma}from"./constants-BZUBXkLq.js";import{b as Ba}from"./use-connection-DSkVzqSP.js";import{b as oe,a as Ht}from"./use-mcp-tools-DTZxAm-y.js";import{u as Ga}from"./use-members-DdPysVve.js";import{c as Wa,A as Fa}from"./use-binding-f1akiPTf.js";import{a as qt,d as ke,g as Ra,A as vt,D as Ua,b as Ka,C as Va,X as Ya}from"./XAxis-D14vbkR0.js";import Ha from"./members-Cv4ALw5c.js";import"./useQuery-CtOvMPbo.js";import"./index-Bs-gkatC.js";import"./EyeOff-D3iBtnD1.js";import"./Eye-CUyEl5IU.js";import"./Key01-Bfc7gsTd.js";import"./Trash01-DhGTBhjv.js";import"./card-Cm-keK-z.js";import"./popover-U_QlVu0r.js";import"./ai-providers-logos-NSo4Ckh1.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./index-AtuNXtl1.js";import"./ChevronUp-Ql_IhfwF.js";import"./ChevronDown-BURkaeCD.js";import"./Upload01-DvtQC2yf.js";import"./Container-De-pv4QL.js";import"./use-install-from-registry-BQfcs7M8.js";import"./extract-connection-data-CBWW8njI.js";import"./constants-DgbSVhNJ.js";import"./registry-utils-Bi8LTB_e.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-CDOurw-F.js";import"./index-CMdtjEkH.js";import"./use-collections-C3CSj681.js";import"./binder--omYMrhv.js";import"./collection-display-button-CEqdF8O7.js";import"./dropdown-menu-V8gWmDzD.js";import"./ChevronRight-Df5oEIdG.js";import"./ArrowDown-BrkOB1Av.js";import"./ArrowUp-Bl5YEbbF.js";import"./Grid01-B7q4cvPD.js";import"./List-DxiRK8pO.js";import"./collection-search-CPQlTmfx.js";import"./SearchMd-D6jy19cO.js";import"./breadcrumb-h9Dq7GJ0.js";import"./collection-table-wrapper-BVpN3w_L.js";import"./table-c-SrSmwK.js";import"./integration-icon-9nN5AvVn.js";import"./checkbox-B92JdB3t.js";import"./ArrowLeft-BLUY3Pjw.js";import"./alert-dialog-DfOenbUZ.js";import"./DotsHorizontal-zFut2S5z.js";import"./Lock01-jAI5MKWg.js";import"./empty-state-BUpyINsX.js";import"./textarea-Buug1Hxe.js";import"./DotsVertical-ZWNLrGdE.js";import"./XClose-C8g1LxXV.js";import"./command-BYr1e0yf.js";import"./index-Ce1KA469.js";const Xt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));Xt.displayName="Bell01";function qa(t){const e=O.c(27),{activeSection:r,onNavigate:a}=t,{data:l}=st.useSession(),i=l?.user,n=i?.image,o=i?.name??"Profile",d=i?.name??"U";let u;e[0]!==d||e[1]!==n?(u=s.jsx(Tt,{url:n,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=n,e[2]=u):u=e[2];let c;e[3]!==o||e[4]!==u?(c={key:"account.profile",label:o,icon:u},e[3]=o,e[4]=u,e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m={key:"account.preferences",label:"Preferences",icon:s.jsx(Cs,{size:14})},e[6]=m):m=e[6];let f;e[7]!==c?(f=[c,m],e[7]=c,e[8]=f):f=e[8];const h=f;let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x={key:"org.general",label:"General",icon:s.jsx(ws,{size:14})},e[9]=x):x=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={key:"org.plugins",label:"Features",icon:s.jsx(_s,{size:14})},e[10]=p):p=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g={key:"org.ai-providers",label:"AI Providers",icon:s.jsx(bs,{size:14})},e[11]=g):g=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y={key:"org.members",label:"Members",icon:s.jsx(As,{size:14})},e[12]=y):y=e[12];let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=[x,p,g,y,{key:"org.billing",label:"Billing",icon:s.jsx(rt,{size:14})}],e[13]=N):N=e[13];const S=N;let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[14]=b):b=e[14];let j;e[15]!==h||e[16]!==r||e[17]!==a?(j=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[b,h.map(k=>s.jsxs("button",{type:"button",onClick:()=>a(k.key),className:me("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===k.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:k.icon}),s.jsx("span",{className:"truncate",children:k.label})]},k.key))]}),e[15]=h,e[16]=r,e[17]=a,e[18]=j):j=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[19]=w):w=e[19];let C;e[20]!==r||e[21]!==a?(C=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[w,S.map(k=>s.jsxs("button",{type:"button",onClick:()=>a(k.key),className:me("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===k.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:k.icon}),s.jsx("span",{className:"truncate",children:k.label})]},k.key))]}),e[20]=r,e[21]=a,e[22]=C):C=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.175.3"]})}),e[23]=_):_=e[23];let A;return e[24]!==j||e[25]!==C?(A=s.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[j,C,_]}),e[24]=j,e[25]=C,e[26]=A):A=e[26],A}function Xa(){const t=O.c(32),{data:e}=st.useSession(),[r,a]=v.useState(!1),l=e?.user,i=l?.image;let n;t[0]!==l?(n=()=>{l?.id&&navigator.clipboard.writeText(l.id).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},t[0]=l,t[1]=n):n=t[1];const o=n;let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=d):d=t[2];const u=l?.name??"U";let c;t[3]!==u||t[4]!==i?(c=s.jsx(Tt,{url:i,fallback:u,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=u,t[4]=i,t[5]=c):c=t[5];const m=l?.name??"User";let f;t[6]!==m?(f=s.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:m}),t[6]=m,t[7]=f):f=t[7];const h=l?.email;let x;t[8]!==h?(x=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:h}),t[8]=h,t[9]=x):x=t[9];let p;t[10]!==f||t[11]!==x?(p=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[f,x]}),t[10]=f,t[11]=x,t[12]=p):p=t[12];let g;t[13]!==c||t[14]!==p?(g=s.jsxs("div",{className:"flex items-center gap-4",children:[c,p]}),t[13]=c,t[14]=p,t[15]=g):g=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=y):y=t[16];let N;t[17]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=N):N=t[17];const S=l?.id;let b;t[18]!==S?(b=s.jsx("span",{className:"font-mono text-sm",children:S}),t[18]=S,t[19]=b):b=t[19];let j;t[20]!==r?(j=r?s.jsx(Os,{size:14,className:"text-green-600 shrink-0"}):s.jsx(Ds,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=j):j=t[21];let w;t[22]!==o||t[23]!==b||t[24]!==j?(w=s.jsx(ks,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[b,j]})}),t[22]=o,t[23]=b,t[24]=j,t[25]=w):w=t[25];let C;t[26]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Ps,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=C):C=t[26];let _;t[27]!==w?(_=s.jsxs("div",{className:"flex flex-col",children:[y,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[N,s.jsx(Is,{children:s.jsxs(Es,{children:[w,C]})})]})]}),t[27]=w,t[28]=_):_=t[28];let A;return t[29]!==_||t[30]!==g?(A=s.jsxs("div",{className:"flex flex-col gap-8",children:[d,g,_]}),t[29]=_,t[30]=g,t[31]=A):A=t[31],A}function Oe(t){const e=O.c(27),{icon:r,label:a,description:l,control:i,onClick:n,disabled:o}=t,d=o?void 0:n,u=n?"button":void 0,c=n&&!o?0:void 0;let m;e[0]!==o||e[1]!==n?(m=n&&!o?j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),n())}:void 0,e[0]=o,e[1]=n,e[2]=m):m=e[2];const f=n&&!o?"pointer":void 0;let h;e[3]!==f?(h={cursor:f},e[3]=f,e[4]=h):h=e[4];let x;e[5]!==r?(x=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=x):x=e[6];let p;e[7]!==a?(p=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[7]=a,e[8]=p):p=e[8];let g;e[9]!==l?(g=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:l}),e[9]=l,e[10]=g):g=e[10];let y;e[11]!==p||e[12]!==g?(y=s.jsxs("div",{className:"min-w-0",children:[p,g]}),e[11]=p,e[12]=g,e[13]=y):y=e[13];let N;e[14]!==y||e[15]!==x?(N=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[x,y]}),e[14]=y,e[15]=x,e[16]=N):N=e[16];let S;e[17]!==i?(S=s.jsx("div",{onClick:Qa,className:"shrink-0",children:i}),e[17]=i,e[18]=S):S=e[18];let b;return e[19]!==d||e[20]!==N||e[21]!==S||e[22]!==u||e[23]!==c||e[24]!==m||e[25]!==h?(b=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:d,role:u,tabIndex:c,onKeyDown:m,style:h,children:[N,S]}),e[19]=d,e[20]=N,e[21]=S,e[22]=u,e[23]=c,e[24]=m,e[25]=h,e[26]=b):b=e[26],b}function Qa(t){return t.stopPropagation()}function yt(){const t=O.c(47),[e,r]=js();let a;t[0]!==r?(a=async P=>{if(P&&await Notification.requestPermission()!=="granted"){Je.error("Notifications denied. Please enable them in your browser settings."),r(er);return}r(E=>({...E,enableNotifications:P}))},t[0]=r,t[1]=a):a=t[1];const l=a;let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=i):i=t[2];let n;t[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx($s,{size:16}),t[3]=n):n=t[3];let o;t[4]!==r?(o=()=>r(Za),t[4]=r,t[5]=o):o=t[5];let d;t[6]!==r?(d=P=>r(E=>({...E,devMode:P})),t[6]=r,t[7]=d):d=t[7];let u;t[8]!==e.devMode||t[9]!==d?(u=s.jsx(De,{checked:e.devMode,onCheckedChange:d}),t[8]=e.devMode,t[9]=d,t[10]=u):u=t[10];let c;t[11]!==o||t[12]!==u?(c=s.jsx(Oe,{icon:n,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:u}),t[11]=o,t[12]=u,t[13]=c):c=t[13];let m;t[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Xt,{size:16}),t[14]=m):m=t[14];let f;t[15]!==l||t[16]!==e.enableNotifications?(f=s.jsx(Oe,{icon:m,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>l(!e.enableNotifications),control:s.jsx(De,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:l})}),t[15]=l,t[16]=e.enableNotifications,t[17]=f):f=t[17];let h;t[18]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(zt,{size:16}),t[18]=h):h=t[18];let x;t[19]!==r?(x=()=>r(Ja),t[19]=r,t[20]=x):x=t[20];let p;t[21]!==r?(p=P=>r(E=>({...E,experimentalAutomations:P})),t[21]=r,t[22]=p):p=t[22];let g;t[23]!==e.experimentalAutomations||t[24]!==p?(g=s.jsx(De,{checked:e.experimentalAutomations,onCheckedChange:p}),t[23]=e.experimentalAutomations,t[24]=p,t[25]=g):g=t[25];let y;t[26]!==x||t[27]!==g?(y=s.jsx(Oe,{icon:h,label:"Experimental: Automations",description:"Enable the Automations feature in the sidebar. This is an experimental feature under active development.",onClick:x,control:g}),t[26]=x,t[27]=g,t[28]=y):y=t[28];let N;t[29]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Ms,{size:16}),t[29]=N):N=t[29];let S;t[30]!==r?(S=P=>r(E=>({...E,toolApprovalLevel:P})),t[30]=r,t[31]=S):S=t[31];let b;t[32]===Symbol.for("react.memo_cache_sentinel")?(b={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[32]=b):b=t[32];const j=b[e.toolApprovalLevel];let w;t[33]!==j?(w=s.jsx(Ts,{className:"w-36",children:s.jsx("span",{children:j})}),t[33]=j,t[34]=w):w=t[34];let C;t[35]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(We,{value:"none",textValue:"Always ask",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Always ask"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[35]=C):C=t[35];let _;t[36]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(We,{value:"readonly",textValue:"Skip read-only",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Skip read-only"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[36]=_):_=t[36];let A;t[37]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsxs(zs,{children:[C,_,s.jsx(We,{value:"yolo",textValue:"Auto-approve all",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Auto-approve all"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[37]=A):A=t[37];let k;t[38]!==e.toolApprovalLevel||t[39]!==S||t[40]!==w?(k=s.jsx(Oe,{icon:N,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(Ls,{value:e.toolApprovalLevel,onValueChange:S,children:[w,A]})}),t[38]=e.toolApprovalLevel,t[39]=S,t[40]=w,t[41]=k):k=t[41];let D;return t[42]!==y||t[43]!==k||t[44]!==c||t[45]!==f?(D=s.jsxs("div",{className:"flex flex-col gap-6",children:[i,s.jsxs("div",{className:"flex flex-col",children:[c,f,y,k]})]}),t[42]=y,t[43]=k,t[44]=c,t[45]=f,t[46]=D):D=t[46],D}function Ja(t){return{...t,experimentalAutomations:!t.experimentalAutomations}}function Za(t){return{...t,devMode:!t.devMode}}function er(t){return{...t,enableNotifications:!1}}const tr=us({name:Ge().min(1,"Name is required").max(255,"Name is too long"),slug:Ge().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:Ge().optional()});function sr(){const t=at(),{org:e,project:r}=ue(),a=kt(),[l,i]=v.useState(!1),n=fs({resolver:ps(tr),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Bs({mutationFn:async c=>{const m={name:c.name,slug:c.slug};c.logo&&(m.logo=c.logo);const f=await st.organization.update({organizationId:e.id,data:m});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:c=>{a.invalidateQueries({queryKey:ut.organizations()}),a.invalidateQueries({queryKey:ut.activeOrganization(e.slug)}),Je.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{Je.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{i(!1)}}),d=c=>{i(!0),o.mutate(c)},u=n.formState.isDirty;return s.jsx(Gs,{...n,children:s.jsxs("form",{onSubmit:n.handleSubmit(d),className:"space-y-6",children:[s.jsx(Fe,{control:n.control,name:"name",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Organization Name"}),s.jsx(Ke,{children:s.jsx(Pe,{placeholder:"My Organization",...c,disabled:l})}),s.jsx(Ve,{})]})}),s.jsx(Fe,{control:n.control,name:"slug",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Organization Slug"}),s.jsx(Ke,{children:s.jsx(Pe,{placeholder:"my-organization",...c,disabled:l,onChange:m=>{const f=m.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(f)}})}),s.jsx(Ws,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(Ve,{})]})}),s.jsx(Fe,{control:n.control,name:"logo",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Logo"}),s.jsx(Ke,{children:s.jsx(Fs,{value:c.value,onChange:c.onChange,name:n.watch("name"),disabled:l})}),s.jsx(Ve,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(de,{type:"submit",disabled:!u||l,className:"min-w-24",children:l?"Saving...":"Save Changes"}),u&&s.jsx(de,{type:"button",variant:"outline",onClick:()=>n.reset(),disabled:l,children:"Cancel"})]})]})})}function ar(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),s.jsx(sr,{})]}),t[0]=e):e=t[0],e}var bt=function(e,r){for(var a=arguments.length,l=new Array(a>2?a-2:0),i=2;i<a;i++)l[i-2]=arguments[i];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var n=0;console.warn(r.replace(/%s/g,()=>l[n++]))}},rr=["x1","y1","x2","y2","key"],lr=["offset"],ir=["xAxisId","yAxisId"],nr=["xAxisId","yAxisId"];function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(r),!0).forEach(function(a){or(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function or(t,e,r){return(e=cr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cr(t){var e=dr(t,"string");return typeof e=="symbol"?e:e+""}function dr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},pe.apply(null,arguments)}function ze(t,e){if(t==null)return{};var r,a,l=mr(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function mr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var ur=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:a,y:l,width:i,height:n,ry:o}=t;return v.createElement("rect",{x:a,y:l,ry:o,width:i,height:n,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Qt(t){var{option:e,lineItemProps:r}=t,a;if(v.isValidElement(e))a=v.cloneElement(e,r);else if(typeof e=="function")a=e(r);else{var l,{x1:i,y1:n,x2:o,y2:d,key:u}=r,c=ze(r,rr),m=(l=it(c))!==null&&l!==void 0?l:{},{offset:f}=m,h=ze(m,lr);a=v.createElement("line",pe({},h,{x1:i,y1:n,x2:o,y2:d,fill:"none",key:u}))}return a}function fr(t){var{x:e,width:r,horizontal:a=!0,horizontalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:i,yAxisId:n}=t,o=ze(t,ir),d=l.map((u,c)=>{var m=Z(Z({},o),{},{x1:e,y1:u,x2:e+r,y2:u,key:"line-".concat(c),index:c});return v.createElement(Qt,{key:"line-".concat(c),option:a,lineItemProps:m})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function pr(t){var{y:e,height:r,vertical:a=!0,verticalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:i,yAxisId:n}=t,o=ze(t,nr),d=l.map((u,c)=>{var m=Z(Z({},o),{},{x1:u,y1:e,x2:u,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(Qt,{option:a,lineItemProps:m,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function xr(t){var{horizontalFill:e,fillOpacity:r,x:a,y:l,width:i,height:n,horizontalPoints:o,horizontal:d=!0}=t;if(!d||!e||!e.length||o==null)return null;var u=o.map(m=>Math.round(m+l-l)).sort((m,f)=>m-f);l!==u[0]&&u.unshift(0);var c=u.map((m,f)=>{var h=u[f+1],x=h==null,p=x?l+n-m:h-m;if(p<=0)return null;var g=f%e.length;return v.createElement("rect",{key:"react-".concat(f),y:m,x:a,height:p,width:i,stroke:"none",fill:e[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function hr(t){var{vertical:e=!0,verticalFill:r,fillOpacity:a,x:l,y:i,width:n,height:o,verticalPoints:d}=t;if(!e||!r||!r.length)return null;var u=d.map(m=>Math.round(m+l-l)).sort((m,f)=>m-f);l!==u[0]&&u.unshift(0);var c=u.map((m,f)=>{var h=u[f+1],x=h==null,p=x?l+n-m:h-m;if(p<=0)return null;var g=f%r.length;return v.createElement("rect",{key:"react-".concat(f),x:m,y:i,width:p,height:o,stroke:"none",fill:r[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var gr=(t,e)=>{var{xAxis:r,width:a,height:l,offset:i}=t;return Bt(qt(Z(Z(Z({},ke),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),i.left,i.left+i.width,e)},vr=(t,e)=>{var{yAxis:r,width:a,height:l,offset:i}=t;return Bt(qt(Z(Z(Z({},ke),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),i.top,i.top+i.height,e)},yr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:$t.grid};function Jt(t){var e=Us(),r=Ks(),a=Vs(),l=Z(Z({},lt(t,yr)),{},{x:ne(t.x)?t.x:a.left,y:ne(t.y)?t.y:a.top,width:ne(t.width)?t.width:a.width,height:ne(t.height)?t.height:a.height}),{xAxisId:i,yAxisId:n,x:o,y:d,width:u,height:c,syncWithTicks:m,horizontalValues:f,verticalValues:h}=l,x=Me(),p=fe(A=>ft(A,"xAxis",i,x)),g=fe(A=>ft(A,"yAxis",n,x));if(!pt(u)||!pt(c)||!ne(o)||!ne(d))return null;var y=l.verticalCoordinatesGenerator||gr,N=l.horizontalCoordinatesGenerator||vr,{horizontalPoints:S,verticalPoints:b}=l;if((!S||!S.length)&&typeof N=="function"){var j=f&&f.length,w=N({yAxis:g?Z(Z({},g),{},{ticks:j?f:g.ticks}):void 0,width:e??u,height:r??c,offset:a},j?!0:m);bt(Array.isArray(w),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof w,"]")),Array.isArray(w)&&(S=w)}if((!b||!b.length)&&typeof y=="function"){var C=h&&h.length,_=y({xAxis:p?Z(Z({},p),{},{ticks:C?h:p.ticks}):void 0,width:e??u,height:r??c,offset:a},C?!0:m);bt(Array.isArray(_),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof _,"]")),Array.isArray(_)&&(b=_)}return v.createElement(Mt,{zIndex:l.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(ur,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),v.createElement(xr,pe({},l,{horizontalPoints:S})),v.createElement(hr,pe({},l,{verticalPoints:b})),v.createElement(fr,pe({},l,{offset:a,horizontalPoints:S,xAxis:p,yAxis:g})),v.createElement(pr,pe({},l,{offset:a,verticalPoints:b,xAxis:p,yAxis:g}))))}Jt.displayName="CartesianGrid";var Zt=(t,e,r)=>Wt(t,"xAxis",ot(t,e),r),es=(t,e,r)=>Ft(t,"xAxis",ot(t,e),r),ts=(t,e,r)=>Wt(t,"yAxis",ct(t,e),r),ss=(t,e,r)=>Ft(t,"yAxis",ct(t,e),r),br=Be([nt,Zt,ts,es,ss],(t,e,r,a,l)=>Rt(t,"xAxis")?xt(e,a,!1):xt(r,l,!1)),jr=(t,e)=>e,as=Be([Xs,jr],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),rs=t=>{var e=nt(t),r=Rt(e,"xAxis");return r?"yAxis":"xAxis"},Nr=(t,e)=>{var r=rs(t);return r==="yAxis"?ct(t,e):ot(t,e)},Sr=(t,e,r)=>Qs(t,rs(t),Nr(t,e),r),wr=Be([as,Sr],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:a}=t,l=qs(t);if(!(a==null||l==null)){var i=(r=e[a])===null||r===void 0?void 0:r.stackedData,n=i?.find(o=>o.key===l);if(n!=null)return n.map(o=>[o[0],o[1]])}}}),Cr=Be([nt,Zt,ts,es,ss,wr,Ys,br,as,Hs],(t,e,r,a,l,i,n,o,d,u)=>{var{chartData:c,dataStartIndex:m,dataEndIndex:f}=n;if(!(d==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||a==null||l==null||a.length===0||l.length===0||o==null)){var{data:h}=d,x;if(h&&h.length>0?x=h:x=c?.slice(m,f+1),x!=null)return Kr({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:l,dataStartIndex:m,areaSettings:d,stackedData:i,displayedData:x,chartBaseValue:u,bandSize:o})}}),Ar=["id"],_r=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xe.apply(null,arguments)}function ls(t,e){if(t==null)return{};var r,a,l=kr(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function kr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(a){Pr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Pr(t,e,r){return(e=Ir(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ir(t){var e=Er(t,"string");return typeof e=="symbol"?e:e+""}function Er(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $e(t,e){return t&&t!=="none"?t:e}var Or=t=>{var{dataKey:e,name:r,stroke:a,fill:l,legendType:i,hide:n}=t;return[{inactive:n,dataKey:e,type:i,color:$e(a,l),value:Ut(r,e),payload:t}]},Dr=v.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:l,fill:i,name:n,hide:o,unit:d,tooltipType:u,id:c}=t,m={dataDefinedOnItem:r,getPosition:ra,settings:{stroke:a,strokeWidth:l,fill:i,dataKey:e,nameKey:void 0,name:Ut(n,e),hide:o,type:u,color:$e(a,i),unit:d,graphicalItemId:c}};return v.createElement(aa,{tooltipEntrySettings:m})});function Lr(t){var{clipPathId:e,points:r,props:a}=t,{needClip:l,dot:i,dataKey:n}=a,o=it(a);return v.createElement(Ua,{points:r,dot:i,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:n,baseProps:o,needClip:l,clipPathId:e})}function Tr(t){var{showLabels:e,children:r,points:a}=t,l=a.map(i=>{var n,o,d={x:(n=i.x)!==null&&n!==void 0?n:0,y:(o=i.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Se(Se({},d),{},{value:i.value,payload:i.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return v.createElement(ha,{value:e?l:void 0},r)}function St(t){var{points:e,baseLine:r,needClip:a,clipPathId:l,props:i}=t,{layout:n,type:o,stroke:d,connectNulls:u,isRange:c}=i,{id:m}=i,f=ls(i,Ar),h=it(f),x=ga(f);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(Le,{clipPath:a?"url(#clipPath-".concat(l,")"):void 0},v.createElement(Ye,xe({},x,{id:m,points:e,connectNulls:u,type:o,baseLine:r,layout:n,stroke:"none",className:"recharts-area-area"})),d!=="none"&&v.createElement(Ye,xe({},h,{className:"recharts-area-curve",layout:n,type:o,connectNulls:u,fill:"none",points:e})),d!=="none"&&c&&Array.isArray(r)&&v.createElement(Ye,xe({},h,{className:"recharts-area-curve",layout:n,type:o,connectNulls:u,fill:"none",points:r}))),v.createElement(Lr,{points:e,props:f,clipPathId:l}))}function zr(t){var e,r,{alpha:a,baseLine:l,points:i,strokeWidth:n}=t,o=(e=i[0])===null||e===void 0?void 0:e.y,d=(r=i[i.length-1])===null||r===void 0?void 0:r.y;if(!Te(o)||!Te(d))return null;var u=a*Math.abs(o-d),c=Math.max(...i.map(m=>m.x||0));return ne(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(m=>m.x||0),c)),ne(c)?v.createElement("rect",{x:0,y:o<d?o:o-u,width:c+(n?parseInt("".concat(n),10):1),height:Math.floor(u)}):null}function $r(t){var e,r,{alpha:a,baseLine:l,points:i,strokeWidth:n}=t,o=(e=i[0])===null||e===void 0?void 0:e.x,d=(r=i[i.length-1])===null||r===void 0?void 0:r.x;if(!Te(o)||!Te(d))return null;var u=a*Math.abs(o-d),c=Math.max(...i.map(m=>m.y||0));return ne(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(m=>m.y||0),c)),ne(c)?v.createElement("rect",{x:o<d?o:o-u,y:0,width:u,height:Math.floor(c+(n?parseInt("".concat(n),10):1))}):null}function Mr(t){var{alpha:e,layout:r,points:a,baseLine:l,strokeWidth:i}=t;return r==="vertical"?v.createElement(zr,{alpha:e,points:a,baseLine:l,strokeWidth:i}):v.createElement($r,{alpha:e,points:a,baseLine:l,strokeWidth:i})}function Br(t){var{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:i}=t,{points:n,baseLine:o,isAnimationActive:d,animationBegin:u,animationDuration:c,animationEasing:m,onAnimationStart:f,onAnimationEnd:h}=a,x=v.useMemo(()=>({points:n,baseLine:o}),[n,o]),p=ma(x,"recharts-area-"),g=Kt(),[y,N]=v.useState(!1),S=!y,b=v.useCallback(()=>{typeof h=="function"&&h(),N(!1)},[h]),j=v.useCallback(()=>{typeof f=="function"&&f(),N(!0)},[f]);if(g==null)return null;var w=l.current,C=i.current;return v.createElement(Tr,{showLabels:S,points:n},a.children,v.createElement(ua,{animationId:p,begin:u,duration:c,isActive:d,easing:m,onAnimationEnd:b,onAnimationStart:j,key:p},_=>{if(w){var A=w.length/n.length,k=_===1?n:n.map((P,E)=>{var T=Math.floor(E*A);if(w[T]){var L=w[T];return Se(Se({},P),{},{x:Ne(L.x,P.x,_),y:Ne(L.y,P.y,_)})}return P}),D;return ne(o)?D=Ne(C,o,_):fa(o)||pa(o)?D=Ne(C,0,_):D=o.map((P,E)=>{var T=Math.floor(E*A);if(Array.isArray(C)&&C[T]){var L=C[T];return Se(Se({},P),{},{x:Ne(L.x,P.x,_),y:Ne(L.y,P.y,_)})}return P}),_>0&&(l.current=k,i.current=D),v.createElement(St,{points:k,baseLine:D,needClip:e,clipPathId:r,props:a})}return _>0&&(l.current=n,i.current=o),v.createElement(Le,null,d&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(Mr,{alpha:_,points:n,baseLine:o,layout:g,strokeWidth:a.strokeWidth}))),v.createElement(Le,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(St,{points:n,baseLine:o,needClip:e,clipPathId:r,props:a})))}),v.createElement(xa,{label:a.label}))}function Gr(t){var{needClip:e,clipPathId:r,props:a}=t,l=v.useRef(null),i=v.useRef();return v.createElement(Br,{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:i})}class Wr extends v.PureComponent{render(){var{hide:e,dot:r,points:a,className:l,top:i,left:n,needClip:o,xAxisId:d,yAxisId:u,width:c,height:m,id:f,baseLine:h,zIndex:x}=this.props;if(e)return null;var p=Pt("recharts-area",l),g=f,{r:y,strokeWidth:N}=Ra(r),S=ca(r),b=y*2+N,j=o?"url(#clipPath-".concat(S?"":"dots-").concat(g,")"):void 0;return v.createElement(Mt,{zIndex:x},v.createElement(Le,{className:p},o&&v.createElement("defs",null,v.createElement(da,{clipPathId:g,xAxisId:d,yAxisId:u}),!S&&v.createElement("clipPath",{id:"clipPath-dots-".concat(g)},v.createElement("rect",{x:n-b/2,y:i-b/2,width:c+b,height:m+b}))),v.createElement(Gr,{needClip:o,clipPathId:g,props:this.props})),v.createElement(vt,{points:a,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:j}),this.props.isRange&&Array.isArray(h)&&v.createElement(vt,{points:h,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:j}))}}var Fr={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:$t.area};function Rr(t){var e,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:i,connectNulls:n,dot:o,fill:d,fillOpacity:u,hide:c,isAnimationActive:m,legendType:f,stroke:h,xAxisId:x,yAxisId:p}=t,g=ls(t,_r),y=la(),N=ia(),{needClip:S}=na(x,p),b=Me(),{points:j,isRange:w,baseLine:C}=(e=fe(E=>Cr(E,t.id,b)))!==null&&e!==void 0?e:{},_=oa();if(y!=="horizontal"&&y!=="vertical"||_==null||N!=="AreaChart"&&N!=="ComposedChart")return null;var{height:A,width:k,x:D,y:P}=_;return!j||!j.length?null:v.createElement(Wr,xe({},g,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:i,baseLine:C,connectNulls:n,dot:o,fill:d,fillOpacity:u,height:A,hide:c,layout:y,isAnimationActive:m,isRange:w,legendType:f,needClip:S,points:j,stroke:h,width:k,left:D,top:P,xAxisId:x,yAxisId:p}))}var Ur=(t,e,r,a,l)=>{var i=r??e;if(ne(i))return i;var n=t==="horizontal"?l:a,o=n.scale.domain();if(n.type==="number"){var d=Math.max(o[0],o[1]),u=Math.min(o[0],o[1]);return i==="dataMin"?u:i==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return i==="dataMin"?o[0]:i==="dataMax"?o[1]:o[0]};function Kr(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:a},stackedData:l,layout:i,chartBaseValue:n,xAxis:o,yAxis:d,displayedData:u,dataStartIndex:c,xAxisTicks:m,yAxisTicks:f,bandSize:h}=t,x=l&&l.length,p=Ur(i,n,r,o,d),g=i==="horizontal",y=!1,N=u.map((b,j)=>{var w,C,_,A;if(x)A=l[c+j];else{var k=ht(b,a);Array.isArray(k)?(A=k,y=!0):A=[p,k]}var D=(w=(C=A)===null||C===void 0?void 0:C[1])!==null&&w!==void 0?w:null,P=D==null||x&&!e&&ht(b,a)==null;if(g){var E;return{x:gt({axis:o,ticks:m,bandSize:h,entry:b,index:j}),y:P?null:(E=d.scale.map(D))!==null&&E!==void 0?E:null,value:A,payload:b}}return{x:P?null:(_=o.scale.map(D))!==null&&_!==void 0?_:null,y:gt({axis:d,ticks:f,bandSize:h,entry:b,index:j}),value:A,payload:b}}),S;return x||y?S=N.map(b=>{var j,w=Array.isArray(b.value)?b.value[0]:null;if(g){var C;return{x:b.x,y:w!=null&&b.y!=null&&(C=d.scale.map(w))!==null&&C!==void 0?C:null,payload:b.payload}}return{x:w!=null&&(j=o.scale.map(w))!==null&&j!==void 0?j:null,y:b.y,payload:b.payload}}):S=g?d.scale.map(p):o.scale.map(p),{points:N,baseLine:S??0,isRange:y}}function Vr(t){var e=lt(t,Fr),r=Me();return v.createElement(Zs,{id:e.id,type:"area"},a=>v.createElement(v.Fragment,null,v.createElement(ea,{legendPayload:Or(e)}),v.createElement(Dr,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),v.createElement(ta,{type:"area",id:a,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:sa(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(Rr,xe({},e,{id:a}))))}var is=v.memo(Vr,Js);is.displayName="Area";var Yr=["type"],Hr=["dangerouslySetInnerHTML","ticks","scale"],qr=["id","scale"];function et(){return et=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},et.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(a){Xr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Xr(t,e,r){return(e=Qr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qr(t){var e=Jr(t,"string");return typeof e=="symbol"?e:e+""}function Jr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tt(t,e){if(t==null)return{};var r,a,l=Zr(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function Zr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function el(t){var e=Vt(),r=v.useRef(null),a=Kt(),{type:l}=t,i=tt(t,Yr),n=ka(a,"yAxis",l),o=v.useMemo(()=>{if(n!=null)return Ct(Ct({},i),{},{type:n})},[n,i]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(va(o)):r.current!==o&&e(ya({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ba(r.current)),r.current=null)},[e]),null}function tl(t){var{yAxisId:e,className:r,width:a,label:l}=t,i=v.useRef(null),n=v.useRef(null),o=fe(ja),d=Me(),u=Vt(),c="yAxis",m=fe(w=>Na(w,e)),f=fe(w=>Sa(w,e)),h=fe(w=>wa(w,c,e,d)),x=fe(w=>Ca(w,e));if(v.useLayoutEffect(()=>{if(!(a!=="auto"||!m||Aa(l)||v.isValidElement(l)||x==null)){var w=i.current;if(w){var C=w.getCalculatedWidth();Math.round(m.width)!==Math.round(C)&&u(_a({id:e,width:C}))}}},[h,m,u,l,e,a,x]),m==null||f==null||x==null)return null;var{dangerouslySetInnerHTML:p,ticks:g,scale:y}=t,N=tt(t,Hr),{id:S,scale:b}=x,j=tt(x,qr);return v.createElement(Va,et({},N,j,{ref:i,labelRef:n,x:f.x,y:f.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:m.width,height:m.height,className:Pt("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:h,axisType:c,axisId:e}))}var sl={allowDataOverflow:J.allowDataOverflow,allowDecimals:J.allowDecimals,allowDuplicatedCategory:J.allowDuplicatedCategory,angle:J.angle,axisLine:ke.axisLine,hide:!1,includeHidden:J.includeHidden,interval:J.interval,label:!1,minTickGap:J.minTickGap,mirror:J.mirror,orientation:J.orientation,padding:J.padding,reversed:J.reversed,scale:J.scale,tick:J.tick,tickCount:J.tickCount,tickLine:ke.tickLine,tickSize:ke.tickSize,type:J.type,niceTicks:J.niceTicks,width:J.width,yAxisId:0},al=t=>{var e=lt(t,sl);return v.createElement(v.Fragment,null,v.createElement(el,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter,niceTicks:e.niceTicks}),v.createElement(tl,e))},ns=v.memo(al,Ka);ns.displayName="YAxis";var rl=["axis"],ll=v.forwardRef((t,e)=>v.createElement(Pa,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:rl,tooltipPayloadSearcher:Ia,categoricalChartProps:t,ref:e}));const we="$.providerMetadata.openrouter.usage.cost";function mt(t){const e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=new Date(r);a.setDate(a.getDate()+1);const l=new Date(r),i=t==="7d"?7:t==="30d"?30:90;return l.setDate(l.getDate()-i),{startDate:l.toISOString(),endDate:a.toISOString()}}function Ce(t){return t.structuredContent}function K(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}const os="gateway-chip-period";function il(){try{const t=localStorage.getItem(os);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function nl(t){try{localStorage.setItem(os,t)}catch{}}const ol={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},cl={daily:"daily",weekly:"weekly",monthly:"monthly"},dl=[5,10,25,50,100],ml=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"none",label:"No reset"}];function ul(t){const e=O.c(51),{open:r,onOpenChange:a,connectionId:l,currentLimitUsd:i,billingMode:n,currentLimitPeriod:o}=t,{org:d}=ue(),[u,c]=v.useState(null),[m,f]=v.useState(""),[h,x]=v.useState(null),[p,g]=v.useState(null),[y,N]=v.useState(o??"none");let S;e[0]!==l||e[1]!==d.id?(S={connectionId:l,orgId:d.id},e[0]=l,e[1]=d.id,e[2]=S):S=e[2];const b=Ae(S);let j;e[3]!==b?(j={client:b},e[3]=b,e[4]=j):j=e[4];const{mutate:w,isPending:C}=Ht(j),_=kt(),A=n==="postpaid";let k;e[5]!==m?(k=m?Number.parseFloat(m):null,e[5]=m,e[6]=k):k=e[6];const P=u??k,E=y==="none"?null:y,T=A&&P!=null&&P===i&&E===o;let L;e[7]!==b?(L=Ma.mcpToolCall(b,"GATEWAY_USAGE",JSON.stringify({})),e[7]=b,e[8]=L):L=e[8];const G=L;let V;e[9]!==G||e[10]!==_?(V=async()=>{await _.invalidateQueries({queryKey:G,exact:!0}),await _.refetchQueries({queryKey:G,exact:!0,type:"active"})},e[9]=G,e[10]=_,e[11]=V):V=e[11];const R=V;let z,$;e[12]!==n||e[13]!==o||e[14]!==i||e[15]!==P||e[16]!==A||e[17]!==y||e[18]!==w||e[19]!==a||e[20]!==R?($=()=>{if(!P||P<=0)return;const B=A?P:i+P;g(null);const ae={limit_usd:B,billing_mode:n,return_url:window.location.href};A&&(ae.limit_period=y),w({name:"GATEWAY_SET_LIMIT",arguments:ae},{onSuccess:async re=>{const te=re.structuredContent;te?.checkout_url||await R(),te?.checkout_url?x(te.checkout_url):z()},onError:re=>{g(re.message??"Failed to update limit.")}})},z=()=>{c(null),f(""),x(null),g(null),N(o??"none"),a(!1)},e[12]=n,e[13]=o,e[14]=i,e[15]=P,e[16]=A,e[17]=y,e[18]=w,e[19]=a,e[20]=R,e[21]=z,e[22]=$):(z=e[21],$=e[22]);const Y=A?"Configure Spending Limit":"Add Credit",H=A?"Set a spending limit for your AI Gateway. The limit resets automatically based on the selected period.":"Choose how much credit to add to your AI Gateway.",M=A?"New limit":"Select amount",U=A?"Set Limit":"Continue";let q;e[23]!==Y?(q=s.jsx(Ot,{children:Y}),e[23]=Y,e[24]=q):q=e[24];let ee;e[25]!==H?(ee=s.jsx(gs,{children:H}),e[25]=H,e[26]=ee):ee=e[26];let W;e[27]!==q||e[28]!==ee?(W=s.jsxs(vs,{children:[q,ee]}),e[27]=q,e[28]=ee,e[29]=W):W=e[29];let F;e[30]!==M||e[31]!==h||e[32]!==U||e[33]!==i||e[34]!==m||e[35]!==P||e[36]!==p||e[37]!==$||e[38]!==C||e[39]!==A||e[40]!==T||e[41]!==y||e[42]!==u?(F=h?s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),s.jsx(de,{asChild:!0,className:"gap-2",children:s.jsxs("a",{href:h,children:[s.jsx(rt,{size:15}),"Complete Payment"]})})]}):s.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:M}),s.jsx("div",{className:"grid grid-cols-5 gap-2",children:dl.map(B=>s.jsxs("button",{type:"button",onClick:()=>{c(B),f("")},className:me("rounded-md border px-3 py-2 text-sm font-medium transition-colors",u===B?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",B]},B))})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:A?"Or enter the exact new limit":"Or enter a custom amount"}),s.jsxs("div",{className:"relative",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),s.jsx(Pe,{id:"custom-amount",type:"number",min:"0.01",step:"0.01",placeholder:"0.00",className:"pl-7",value:m,onChange:B=>{f(B.target.value),c(null)}})]})]}),A&&s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:"Reset period"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:ml.map(B=>{const{value:ae,label:re}=B;return s.jsx("button",{type:"button",onClick:()=>N(ae),className:me("rounded-md border px-2 py-2 text-xs font-medium transition-colors",y===ae?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:re},ae)})})]}),p&&s.jsx("p",{className:"text-xs text-destructive",children:p}),s.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:A?s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:i>0?K(i):"none"})]}):s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:K(i)})]})}),s.jsx(de,{onClick:$,disabled:C||!P||P<=0||T,className:"gap-2",children:C?"Updating...":U})]})]}),e[30]=M,e[31]=h,e[32]=U,e[33]=i,e[34]=m,e[35]=P,e[36]=p,e[37]=$,e[38]=C,e[39]=A,e[40]=T,e[41]=y,e[42]=u,e[43]=F):F=e[43];let X;e[44]!==W||e[45]!==F?(X=s.jsxs(Dt,{className:"sm:max-w-md",children:[W,F]}),e[44]=W,e[45]=F,e[46]=X):X=e[46];let se;return e[47]!==z||e[48]!==r||e[49]!==X?(se=s.jsx(Lt,{open:r,onOpenChange:z,children:X}),e[47]=z,e[48]=r,e[49]=X,e[50]=se):se=e[50],se}function fl(t){const e=O.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:a,estimatedDepletionDate:l,avgDailySpend:i}=r;if(a==null)return null;let n;e[0]!==l?(n=l?new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=l,e[1]=n):n=e[1];const o=n,d=a!==1?"s":"";let u;e[2]!==a||e[3]!==d?(u=s.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",a," day",d," ","remaining"]}),e[2]=a,e[3]=d,e[4]=u):u=e[4];let c;e[5]!==o?(c=o&&s.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=m):m=e[7];let f;e[8]!==i?(f=K(i),e[8]=i,e[9]=f):f=e[9];let h;e[10]!==f?(h=s.jsxs("span",{className:"tabular-nums",children:["avg ",f,"/day"]}),e[10]=f,e[11]=h):h=e[11];let x;e[12]!==r.resetsBeforeDepletion?(x=r.resetsBeforeDepletion&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),s.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=x):x=e[13];const p=ol[r.confidence];let g;e[14]!==p?(g=s.jsx(La,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:p}),e[14]=p,e[15]=g):g=e[15];let y;return e[16]!==g||e[17]!==u||e[18]!==c||e[19]!==h||e[20]!==x?(y=s.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[u,c,m,h,x,g]}),e[16]=g,e[17]=u,e[18]=c,e[19]=h,e[20]=x,e[21]=y):y=e[21],y}function pl(t){const e=O.c(37),{usage:r,limit:a,limitPeriod:l,onConfigureLimit:i,connectionId:n,alert:o}=t,d=a.total!=null&&a.total>0;let u;e[0]!==d||e[1]!==a.remaining||e[2]!==a.total?(u=d?Math.min(100,Math.round((a.total-(a.remaining??0))/a.total*100)):null,e[0]=d,e[1]=a.remaining,e[2]=a.total,e[3]=u):u=e[3];const c=u;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Spending"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[4]=m):m=e[4];let f;e[5]!==r.total?(f=K(r.total),e[5]=r.total,e[6]=f):f=e[6];let h;e[7]!==f?(h=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:f}),e[7]=f,e[8]=h):h=e[8];let x;e[9]!==d||e[10]!==a.total||e[11]!==l?(x=d&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a.total)," limit",l&&s.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-1",children:[s.jsx(zt,{size:10}),cl[l]]})]}),e[9]=d,e[10]=a.total,e[11]=l,e[12]=x):x=e[12];let p;e[13]!==d?(p=!d&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No limit configured"}),e[13]=d,e[14]=p):p=e[14];let g;e[15]!==h||e[16]!==x||e[17]!==p?(g=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,h,x,p]}),e[15]=h,e[16]=x,e[17]=p,e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Yt,{size:16}),e[19]=y):y=e[19];const N=d?"Configure Limit":"Set Limit";let S;e[20]!==i||e[21]!==N?(S=s.jsxs(de,{onClick:i,variant:"outline",className:"gap-2",children:[y,N]}),e[20]=i,e[21]=N,e[22]=S):S=e[22];let b;e[23]!==S||e[24]!==g?(b=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),e[23]=S,e[24]=g,e[25]=b):b=e[25];let j;e[26]!==d||e[27]!==a.reset||e[28]!==c?(j=d&&c!=null&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:me("h-full rounded-full transition-all",c>=90?"bg-destructive":c>=70?"bg-amber-500":"bg-primary"),style:{width:`${c}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c,"% used",a.reset&&s.jsxs("span",{className:"ml-2",children:["· resets ",a.reset]})]})]}),e[26]=d,e[27]=a.reset,e[28]=c,e[29]=j):j=e[29];let w;e[30]!==o||e[31]!==n?(w=s.jsx(cs,{connectionId:n,alert:o,billingMode:"postpaid"}),e[30]=o,e[31]=n,e[32]=w):w=e[32];let C;return e[33]!==b||e[34]!==j||e[35]!==w?(C=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[b,j,w]}),e[33]=b,e[34]=j,e[35]=w,e[36]=C):C=e[36],C}function xl(t){const e=O.c(30),{available:r,total:a,estimation:l,onAddCredit:i,connectionId:n,alert:o}=t,d=a>0?Math.max(0,Math.min(100,(a-r)/a*100)):0;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[0]=u):u=e[0];let c;e[1]!==r?(c=K(r),e[1]=r,e[2]=c):c=e[2];let m;e[3]!==c?(m=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:c}),e[3]=c,e[4]=m):m=e[4];let f;e[5]!==a?(f=a>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a)," total"]}),e[5]=a,e[6]=f):f=e[6];let h;e[7]!==m||e[8]!==f?(h=s.jsxs("div",{className:"flex flex-col gap-1",children:[u,m,f]}),e[7]=m,e[8]=f,e[9]=h):h=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Yt,{size:16}),e[10]=x):x=e[10];let p;e[11]!==i?(p=s.jsxs(de,{onClick:i,className:"gap-2 px-5",children:[x,"Add Credit"]}),e[11]=i,e[12]=p):p=e[12];let g;e[13]!==h||e[14]!==p?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[h,p]}),e[13]=h,e[14]=p,e[15]=g):g=e[15];let y;e[16]!==r||e[17]!==a||e[18]!==d?(y=a>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${d}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[K(Math.max(0,a-r))," used"]})]}),e[16]=r,e[17]=a,e[18]=d,e[19]=y):y=e[19];let N;e[20]!==l?(N=s.jsx(fl,{estimation:l}),e[20]=l,e[21]=N):N=e[21];let S;e[22]!==o||e[23]!==n?(S=s.jsx(cs,{connectionId:n,alert:o,billingMode:"prepaid"}),e[22]=o,e[23]=n,e[24]=S):S=e[24];let b;return e[25]!==N||e[26]!==S||e[27]!==g||e[28]!==y?(b=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[g,y,N,S]}),e[25]=N,e[26]=S,e[27]=g,e[28]=y,e[29]=b):b=e[29],b}function cs(t){const e=O.c(78),{connectionId:r,alert:a,billingMode:l}=t,{org:i}=ue(),[n,o]=v.useState(!1),[d,u]=v.useState(a.enabled),[c,m]=v.useState(String(a.threshold_usd)),[f,h]=v.useState(a.email??""),[x,p]=v.useState(!1),[g,y]=v.useState(null);let N;e[0]!==r||e[1]!==i.id?(N={connectionId:r,orgId:i.id},e[0]=r,e[1]=i.id,e[2]=N):N=e[2];const S=Ae(N);let b;e[3]!==S?(b={client:S},e[3]=S,e[4]=b):b=e[4];const{mutate:j,isPending:w}=Ht(b),C=d!==a.enabled||c!==String(a.threshold_usd)||f!==(a.email??"");let _;e[5]!==f||e[6]!==d||e[7]!==j||e[8]!==c?(_=()=>{y(null),p(!1);const Q=parseFloat(c);if(d&&(!f||!f.includes("@"))){y("A valid email is required to enable alerts.");return}if(Number.isNaN(Q)||Q<=0){y("Threshold must be a positive number.");return}j({name:"GATEWAY_SET_ALERT",arguments:{enabled:d,threshold_usd:Q,...f?{email:f}:{}}},{onSuccess:()=>{p(!0),setTimeout(()=>p(!1),3e3)},onError:he=>{y(he.message??"Failed to save alert config.")}})},e[5]=f,e[6]=d,e[7]=j,e[8]=c,e[9]=_):_=e[9];const A=_,k=l==="postpaid"?"Usage Alert":"Low-Balance Alert",D=l==="postpaid"?"Get notified when spending reaches a threshold":"Get notified when credit drops below a threshold";if(!n){let Q;e[10]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>o(!0),e[10]=Q):Q=e[10];let he;e[11]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx("div",{className:"flex items-center justify-center size-7 rounded-md bg-muted shrink-0",children:s.jsx($a,{size:14,className:"text-muted-foreground"})}),e[11]=he):he=e[11];let ge;e[12]!==k?(ge=s.jsx("p",{className:"text-xs font-medium text-foreground",children:k}),e[12]=k,e[13]=ge):ge=e[13];let ve;e[14]!==a.enabled||e[15]!==a.threshold_usd||e[16]!==l?(ve=a.enabled?l==="postpaid"?`Enabled · Alert at ${K(a.threshold_usd)}`:`Enabled · Alert below ${K(a.threshold_usd)}`:l==="postpaid"?"Get notified before your spending limit runs out":"Get notified before your credit balance runs out",e[14]=a.enabled,e[15]=a.threshold_usd,e[16]=l,e[17]=ve):ve=e[17];let ye;e[18]!==ve?(ye=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:ve}),e[18]=ve,e[19]=ye):ye=e[19];let be;e[20]!==ge||e[21]!==ye?(be=s.jsxs("div",{className:"flex-1 min-w-0",children:[ge,ye]}),e[20]=ge,e[21]=ye,e[22]=be):be=e[22];let je;e[23]!==a.enabled?(je=a.enabled&&s.jsx("span",{className:"shrink-0 rounded-full bg-green-500/15 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",children:"On"}),e[23]=a.enabled,e[24]=je):je=e[24];let Ee;return e[25]!==je||e[26]!==be?(Ee=s.jsxs("button",{type:"button",onClick:Q,className:"mt-4 flex items-center gap-3 rounded-lg border border-dashed border-border/60 px-4 py-3 w-full text-left transition-colors hover:bg-muted/50 hover:border-border",children:[he,be,je]}),e[25]=je,e[26]=be,e[27]=Ee):Ee=e[27],Ee}let P;e[28]!==k?(P=s.jsx("p",{className:"text-xs font-medium text-foreground",children:k}),e[28]=k,e[29]=P):P=e[29];let E;e[30]!==D?(E=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:D}),e[30]=D,e[31]=E):E=e[31];let T;e[32]!==P||e[33]!==E?(T=s.jsxs("div",{children:[P,E]}),e[32]=P,e[33]=E,e[34]=T):T=e[34];let L;e[35]!==d?(L=s.jsx(De,{checked:d,onCheckedChange:u}),e[35]=d,e[36]=L):L=e[36];let G;e[37]!==T||e[38]!==L?(G=s.jsxs("div",{className:"flex items-center justify-between",children:[T,L]}),e[37]=T,e[38]=L,e[39]=G):G=e[39];const V=!d&&"opacity-50 pointer-events-none";let R;e[40]!==V?(R=me("flex flex-col gap-3 transition-opacity",V),e[40]=V,e[41]=R):R=e[41];const z=l==="postpaid"?"Notify at":"Notify below";let $;e[42]!==z?($=s.jsx(_e,{htmlFor:"alert-threshold",className:"text-[11px] text-muted-foreground",children:z}),e[42]=z,e[43]=$):$=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[44]=Y):Y=e[44];let H;e[45]===Symbol.for("react.memo_cache_sentinel")?(H=Q=>m(Q.target.value),e[45]=H):H=e[45];let M;e[46]!==c?(M=s.jsxs("div",{className:"relative",children:[Y,s.jsx(Pe,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"h-8 pl-7 text-xs",value:c,onChange:H})]}),e[46]=c,e[47]=M):M=e[47];let U;e[48]!==$||e[49]!==M?(U=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,M]}),e[48]=$,e[49]=M,e[50]=U):U=e[50];let q;e[51]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(_e,{htmlFor:"alert-email",className:"text-[11px] text-muted-foreground",children:"Notification email"}),e[51]=q):q=e[51];let ee;e[52]===Symbol.for("react.memo_cache_sentinel")?(ee=Q=>h(Q.target.value),e[52]=ee):ee=e[52];let W;e[53]!==f?(W=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,s.jsx(Pe,{id:"alert-email",type:"email",placeholder:"you@example.com",className:"h-8 text-xs",value:f,onChange:ee})]}),e[53]=f,e[54]=W):W=e[54];let F;e[55]!==U||e[56]!==W?(F=s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[U,W]}),e[55]=U,e[56]=W,e[57]=F):F=e[57];let X;e[58]!==g?(X=g&&s.jsx("p",{className:"text-[11px] text-destructive",children:g}),e[58]=g,e[59]=X):X=e[59];let se;e[60]!==R||e[61]!==F||e[62]!==X?(se=s.jsxs("div",{className:R,children:[F,X]}),e[60]=R,e[61]=F,e[62]=X,e[63]=se):se=e[63];let B;e[64]!==x?(B=x&&s.jsx("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Saved"}),e[64]=x,e[65]=B):B=e[65];let ae;e[66]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(de,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>o(!1),children:"Cancel"}),e[66]=ae):ae=e[66];const re=w||!C,te=w?"Saving...":"Save Alert";let le;e[67]!==A||e[68]!==re||e[69]!==te?(le=s.jsx(de,{size:"sm",className:"h-7 text-xs",onClick:A,disabled:re,children:te}),e[67]=A,e[68]=re,e[69]=te,e[70]=le):le=e[70];let ce;e[71]!==B||e[72]!==le?(ce=s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[B,ae,le]}),e[71]=B,e[72]=le,e[73]=ce):ce=e[73];let I;return e[74]!==se||e[75]!==ce||e[76]!==G?(I=s.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-border bg-muted/20 p-4",children:[G,se,ce]}),e[74]=se,e[75]=ce,e[76]=G,e[77]=I):I=e[77],I}const hl={cost:{label:"Cost",color:"var(--chart-1)"}};function gl(){const t=O.c(54),{org:e}=ue(),[r,a]=v.useState("7d");let l;t[0]!==r?(l=mt(r),t[0]=r,t[1]=l):l=t[1];const i=l;let n;t[2]!==e.id?(n={connectionId:dt,orgId:e.id},t[2]=e.id,t[3]=n):n=t[3];const o=Ae(n);let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d={type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},t[4]=d):d=t[4];let u;t[5]!==i?(u={widget:d,timeRange:i,skipCount:!0},t[5]=i,t[6]=u):u=t[6];let c;t[7]!==o||t[8]!==u?(c={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:u,staleTime:6e4,select:Ce},t[7]=o,t[8]=u,t[9]=c):c=t[9];const{data:m}=oe(c);let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"count_all"}},t[10]=f):f=t[10];let h;t[11]!==i?(h={widget:f,timeRange:i,skipCount:!0},t[11]=i,t[12]=h):h=t[12];let x;t[13]!==o||t[14]!==h?(x={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:h,staleTime:6e4,select:Ce},t[13]=o,t[14]=h,t[15]=x):x=t[15];const{data:p}=oe(x);let g;t[16]===Symbol.for("react.memo_cache_sentinel")?(g={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"sum",groupByColumn:"connection_title",limit:10}},t[16]=g):g=t[16];let y;t[17]!==i?(y={widget:g,timeRange:i,skipCount:!0},t[17]=i,t[18]=y):y=t[18];let N;t[19]!==o||t[20]!==y?(N={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:y,staleTime:6e4,select:Ce},t[19]=o,t[20]=y,t[21]=N):N=t[21];const{data:S}=oe(N);let b;t[22]!==m?.timeseries?(b=m?.timeseries??[],t[22]=m?.timeseries,t[23]=b):b=t[23];let j;t[24]!==b?(j=b.map(Sl),t[24]=b,t[25]=j):j=t[25];const w=j;let C;if(t[26]!==p?.value||t[27]!==w||t[28]!==S?.groups||t[29]!==m?.timeseries||t[30]!==r){const _=(m?.timeseries??[]).reduce(Nl,0),A=p?.value??0,k=(S?.groups??[]).filter(jl).sort(bl).slice(0,5),D=r==="7d"?"last 7 days":r==="30d"?"last 30 days":"last 90 days";let P;t[32]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),t[32]=P):P=t[32];const E=K(_);let T;t[33]!==E?(T=s.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:E}),t[33]=E,t[34]=T):T=t[34];let L;t[35]!==D?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:D}),t[35]=D,t[36]=L):L=t[36];let G;t[37]!==T||t[38]!==L?(G=s.jsxs("div",{className:"flex items-baseline gap-2",children:[T,L]}),t[37]=T,t[38]=L,t[39]=G):G=t[39];let V;t[40]!==A?(V=A.toLocaleString(),t[40]=A,t[41]=V):V=t[41];let R;t[42]!==V?(R=s.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[V," tool calls"]}),t[42]=V,t[43]=R):R=t[43];let z;t[44]!==G||t[45]!==R?(z=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[P,G,R]}),t[44]=G,t[45]=R,t[46]=z):z=t[46];let $;t[47]!==r?($=s.jsx(ds,{period:r,onPeriodChange:a}),t[47]=r,t[48]=$):$=t[48];let Y;t[49]!==z||t[50]!==$?(Y=s.jsxs("div",{className:"flex items-center justify-between",children:[z,$]}),t[49]=z,t[50]=$,t[51]=Y):Y=t[51];let H;t[52]!==w?(H=w.length>0?s.jsx(Ea,{config:hl,className:"h-[200px] w-full",children:s.jsxs(ll,{data:w,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"fillCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:"var(--color-cost)",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"var(--color-cost)",stopOpacity:0})]})}),s.jsx(Jt,{vertical:!1,strokeDasharray:"3 3"}),s.jsx(Ya,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11,interval:"preserveStartEnd"}),s.jsx(ns,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:yl}),s.jsx(Oa,{content:s.jsx(Da,{formatter:vl})}),s.jsx(is,{type:"monotone",dataKey:"cost",stroke:"var(--color-cost)",fill:"url(#fillCost)",strokeWidth:2})]})}):s.jsx("div",{className:"h-[200px] flex items-center justify-center text-xs text-muted-foreground",children:"No usage data available for this period"}),t[52]=w,t[53]=H):H=t[53],C=s.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[Y,H,k.length>0&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Cost by Connection"}),s.jsx("div",{className:"flex flex-col gap-1.5",children:k.map((M,U)=>{const q=_>0?Math.min(M.value/_*100,100):0;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:M.key}),s.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:"h-full transition-all duration-500 ease-out rounded-sm",style:{width:`${q}%`,backgroundColor:`var(--chart-${U%5+1})`}})}),s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:K(M.value)})]},M.key)})})]})]}),t[26]=p?.value,t[27]=w,t[28]=S?.groups,t[29]=m?.timeseries,t[30]=r,t[31]=C}else C=t[31];return C}function vl(t){return K(t)}function yl(t){return`$${t}`}function bl(t,e){return e.value-t.value}function jl(t){return t.value>0}function Nl(t,e){return t+e.value}function Sl(t){return{date:new Date(t.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),cost:t.value}}function wl(){const t=O.c(6),[e,r]=v.useState(il);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=u=>{r(u),nl(u)},t[0]=a):a=t[0];const l=a;let i,n;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Sidebar Display Period"}),n=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which usage period is shown in the sidebar when no limit is set."}),t[1]=i,t[2]=n):(i=t[1],n=t[2]);let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=["daily","weekly","monthly"],t[3]=o):o=t[3];let d;return t[4]!==e?(d=s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-5",children:[i,n,s.jsx("div",{className:"flex gap-2 mt-1",children:o.map(u=>s.jsx("button",{type:"button",onClick:()=>l(u),className:me("rounded-md border px-3 py-1.5 text-xs font-medium capitalize transition-colors",e===u?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted text-muted-foreground"),children:u},u))})]}),t[4]=e,t[5]=d):d=t[5],d}function Xe(t){const e=O.c(20),{label:r,value:a,subValue:l,maxValue:i,color:n}=t,o=n===void 0?"bg-chart-1":n;let d;e[0]!==a?(d=parseFloat(a.replace(/[^0-9.]/g,""))||0,e[0]=a,e[1]=d):d=e[1];const u=d,c=i>0?Math.min(u/i*100,100):0;let m;e[2]!==r?(m=s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:r}),e[2]=r,e[3]=m):m=e[3];let f;e[4]!==o?(f=me("h-full transition-all duration-500 ease-out",o),e[4]=o,e[5]=f):f=e[5];const h=`${c}%`;let x;e[6]!==h?(x={width:h},e[6]=h,e[7]=x):x=e[7];let p;e[8]!==f||e[9]!==x?(p=s.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:f,style:x})}),e[8]=f,e[9]=x,e[10]=p):p=e[10];let g;e[11]!==a?(g=s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:a}),e[11]=a,e[12]=g):g=e[12];let y;e[13]!==l?(y=l&&s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-muted-foreground",children:l}),e[13]=l,e[14]=y):y=e[14];let N;return e[15]!==m||e[16]!==p||e[17]!==g||e[18]!==y?(N=s.jsxs("div",{className:"flex items-center gap-2",children:[m,p,g,y]}),e[15]=m,e[16]=p,e[17]=g,e[18]=y,e[19]=N):N=e[19],N}function Qe(t){const e=O.c(8),{title:r,children:a,empty:l}=t;let i;e[0]!==r?(i=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:r}),e[0]=r,e[1]=i):i=e[1];let n;e[2]!==a||e[3]!==l?(n=l?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No data available for this period"}):a,e[2]=a,e[3]=l,e[4]=n):n=e[4];let o;return e[5]!==i||e[6]!==n?(o=s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-5",children:[i,n]}),e[5]=i,e[6]=n,e[7]=o):o=e[7],o}const At={"7d":"7 days","30d":"30 days","90d":"90 days"};function ds(t){const e=O.c(4),{period:r,onPeriodChange:a}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Object.keys(At),e[0]=l):l=e[0];let i;return e[1]!==a||e[2]!==r?(i=s.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5 self-start",children:l.map(n=>s.jsx("button",{type:"button",onClick:()=>a(n),className:me("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",r===n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:At[n]},n))}),e[1]=a,e[2]=r,e[3]=i):i=e[3],i}function _t(t,e){const r=new Map(e.map(a=>[a.key,a.value]));return t.map(a=>({key:a.key,cost:a.value,calls:r.get(a.key)??0})).sort((a,l)=>l.cost-a.cost)}function Cl(){const t=O.c(27),{org:e}=ue(),[r,a]=v.useState("7d"),l=mt(r),{data:i}=Ga(),n=i?.data?.members??[],o=new Map(n.map(El));let d;t[0]!==e.id?(d={connectionId:dt,orgId:e.id},t[0]=e.id,t[1]=d):d=t[1];const u=Ae(d),c=I=>({client:u,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:{widget:{type:"table",source:{path:we,from:"output"},aggregation:{fn:I.fn,...I.groupByColumn&&{groupByColumn:I.groupByColumn},...I.limit&&{limit:I.limit}}},timeRange:l,skipCount:!0},staleTime:6e4,select:Ce}),{data:m,isLoading:f}=oe(c({fn:"sum",groupByColumn:"connection_title",limit:20})),{data:h,isLoading:x}=oe(c({fn:"count_all",groupByColumn:"connection_title",limit:20})),{data:p,isLoading:g}=oe(c({fn:"sum",groupByColumn:"user_id",limit:20})),{data:y,isLoading:N}=oe(c({fn:"count_all",groupByColumn:"user_id",limit:20})),{data:S,isLoading:b}=oe(c({fn:"sum",groupByColumn:"tool_name",limit:20}));let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j={fn:"count_all",groupByColumn:"tool_name",limit:20},t[2]=j):j=t[2];const{data:w,isLoading:C}=oe(c(j));if(f||x||g||N||b||C){let I;t[3]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ie,{className:"h-8 w-48"}),t[3]=I):I=t[3];let Q;return t[4]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsxs("div",{className:"flex flex-col gap-4",children:[I,s.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:Array.from({length:3}).map(Il)})]}),t[4]=Q):Q=t[4],Q}const A=_t(m?.groups??[],h?.groups??[]),k=_t(p?.groups??[],y?.groups??[]).map(I=>({...I,key:o.get(I.key)??I.key})),D=w?.groups??[],P=new Map((S?.groups??[]).map(Pl)),E=D.map(I=>({name:I.key,calls:I.value,cost:P.get(I.key)??0})).sort(kl).slice(0,20),T=A.reduce(_l,0),L=A.reduce(Al,0),G=A[0]?.cost??1,V=k[0]?.cost??1,R=E[0]?.calls??1;let z;t[5]!==r?(z=s.jsx(ds,{period:r,onPeriodChange:a}),t[5]=r,t[6]=z):z=t[6];const $="grid grid-cols-1 gap-4 sm:grid-cols-2",Y=A.length===0,H=A.slice(0,8).map(I=>s.jsx(Xe,{label:I.key,value:K(I.cost),subValue:`${I.calls.toLocaleString()} calls`,maxValue:G,color:"bg-chart-1"},I.key));let M;t[7]!==H?(M=s.jsx("div",{className:"space-y-2.5",children:H}),t[7]=H,t[8]=M):M=t[8];let U;t[9]!==Y||t[10]!==M?(U=s.jsx(Qe,{title:"Cost by Connection",empty:Y,children:M}),t[9]=Y,t[10]=M,t[11]=U):U=t[11];const q=k.length===0,ee=k.slice(0,8).map(I=>s.jsx(Xe,{label:I.key,value:K(I.cost),subValue:`${I.calls.toLocaleString()} calls`,maxValue:V,color:"bg-chart-4"},I.key));let W;t[12]!==ee?(W=s.jsx("div",{className:"space-y-2.5",children:ee}),t[12]=ee,t[13]=W):W=t[13];let F;t[14]!==W||t[15]!==q?(F=s.jsx(Qe,{title:"Cost by User",empty:q,children:W}),t[14]=W,t[15]=q,t[16]=F):F=t[16];const X=Qe,se="Top Tools",B=E.length===0,ae="space-y-2.5",re=E.slice(0,8).map(I=>s.jsx(Xe,{label:I.name,value:I.calls.toLocaleString(),subValue:I.cost>0?K(I.cost):void 0,maxValue:R,color:"bg-chart-3"},I.name));let te;t[17]!==re?(te=s.jsx("div",{className:ae,children:re}),t[17]=re,t[18]=te):te=t[18];let le;t[19]!==X||t[20]!==B||t[21]!==te?(le=s.jsx(X,{title:se,empty:B,children:te}),t[19]=X,t[20]=B,t[21]=te,t[22]=le):le=t[22];let ce;return t[23]!==F||t[24]!==le||t[25]!==U?(ce=s.jsxs("div",{className:$,children:[U,F,le]}),t[23]=F,t[24]=le,t[25]=U,t[26]=ce):ce=t[26],s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex gap-4 text-sm",children:[s.jsxs("span",{className:"text-muted-foreground",children:["Total:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:K(T)})]}),s.jsxs("span",{className:"text-muted-foreground",children:["Calls:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:L.toLocaleString()})]})]}),z]}),ce]})}function Al(t,e){return t+e.calls}function _l(t,e){return t+e.cost}function kl(t,e){return e.calls-t.calls}function Pl(t){return[t.key,t.value]}function Il(t,e){return s.jsx(ie,{className:"h-40 rounded-xl"},e)}function El(t){return[t.userId,t.user.name??t.user.email]}function Ol(t,e){const r=new Map;for(const a of t){const i=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),n=r.get(i)??{cost:0,calls:0};r.set(i,{cost:n.cost+a.value,calls:n.calls})}for(const a of e){const i=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),n=r.get(i)??{cost:0,calls:0};r.set(i,{cost:n.cost,calls:n.calls+a.value})}return Array.from(r.entries()).map(([a,l])=>({month:a,...l})).reverse()}function Dl(){const t=O.c(27),{org:e}=ue();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=mt("90d"),t[0]=r):r=t[0];const a=r;let l;t[1]!==e.id?(l={connectionId:dt,orgId:e.id},t[1]=e.id,t[2]=l):l=t[2];const i=Ae(l);let n;t[3]===Symbol.for("react.memo_cache_sentinel")?(n={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},timeRange:a,skipCount:!0},t[3]=n):n=t[3];let o;t[4]!==i?(o={client:i,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:n,staleTime:6e4,select:Ce},t[4]=i,t[5]=o):o=t[5];const{data:d,isLoading:u}=oe(o);let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"count_all",interval:"1d"}},timeRange:a,skipCount:!0},t[6]=c):c=t[6];let m;t[7]!==i?(m={client:i,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:c,staleTime:6e4,select:Ce},t[7]=i,t[8]=m):m=t[8];const{data:f,isLoading:h}=oe(m);if(u||h){let j;return t[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(ie,{className:"h-8 w-48"}),s.jsx(ie,{className:"h-48 rounded-xl"})]}),t[9]=j):j=t[9],j}let x,p,g,y,N;if(t[10]!==f?.timeseries||t[11]!==d?.timeseries){const j=Ol(d?.timeseries??[],f?.timeseries??[]);N="flex flex-col gap-4",t[17]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Usage history from monitoring logs (last 90 days)"}),t[17]=x):x=t[17],p="flex flex-col gap-3 rounded-xl border border-border bg-card p-5",t[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Monthly Usage"}),t[18]=g):g=t[18],y=j.length===0?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No usage data available for this period"}):s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 pb-1.5 border-b border-border text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:[s.jsx("span",{children:"Month"}),s.jsx("span",{className:"text-right",children:"Cost"}),s.jsx("span",{className:"text-right",children:"Calls"})]}),s.jsx("div",{className:"divide-y divide-border",children:j.map(Ll)})]}),t[10]=f?.timeseries,t[11]=d?.timeseries,t[12]=x,t[13]=p,t[14]=g,t[15]=y,t[16]=N}else x=t[12],p=t[13],g=t[14],y=t[15],N=t[16];let S;t[19]!==p||t[20]!==g||t[21]!==y?(S=s.jsxs("div",{className:p,children:[g,y]}),t[19]=p,t[20]=g,t[21]=y,t[22]=S):S=t[22];let b;return t[23]!==x||t[24]!==S||t[25]!==N?(b=s.jsxs("div",{className:N,children:[x,S]}),t[23]=x,t[24]=S,t[25]=N,t[26]=b):b=t[26],b}function Ll(t){return s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 py-2 text-xs",children:[s.jsx("span",{className:"text-foreground font-medium",children:t.month}),s.jsx("span",{className:"text-right tabular-nums text-foreground",children:K(t.cost)}),s.jsx("span",{className:"text-right tabular-nums text-muted-foreground",children:t.calls.toLocaleString()})]},t.month)}function Tl(t){const e=O.c(31),{connectionId:r}=t,{org:a}=ue(),[l,i]=v.useState(!1);let n;e[0]!==r||e[1]!==a.id?(n={connectionId:r,orgId:a.id},e[0]=r,e[1]=a.id,e[2]=n):n=e[2];const o=Ae(n);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={},e[3]=d):d=e[3];let u;e[4]!==o?(u={client:o,toolName:"GATEWAY_USAGE",toolArguments:d,staleTime:3e4,select:zl},e[4]=o,e[5]=u):u=e[5];const{data:c,isLoading:m}=oe(u);if(m){let k;return e[6]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(ie,{className:"h-36 rounded-xl"}),e[6]=k):k=e[6],k}if(!c)return null;const f=c.limit.remaining??0,h=c.limit.total??0,x=c.usage,p=c.billing.mode,g=c.billing.limitPeriod??null,y=c.estimation??null;let N;e[7]!==c.alert?(N=c.alert??{enabled:!1,threshold_usd:10,email:null},e[7]=c.alert,e[8]=N):N=e[8];const S=N,b=c.limit,j=p==="postpaid"&&(h==null||h===0);let w;e[9]!==S||e[10]!==f||e[11]!==p||e[12]!==r||e[13]!==y||e[14]!==b||e[15]!==g||e[16]!==h||e[17]!==x?(w=p==="postpaid"?s.jsx(pl,{usage:x,limit:b,limitPeriod:g,onConfigureLimit:()=>i(!0),connectionId:r,alert:S}):s.jsx(xl,{available:f,total:h,estimation:y,onAddCredit:()=>i(!0),connectionId:r,alert:S}),e[9]=S,e[10]=f,e[11]=p,e[12]=r,e[13]=y,e[14]=b,e[15]=g,e[16]=h,e[17]=x,e[18]=w):w=e[18];let C;e[19]!==j?(C=j&&s.jsx(wl,{}),e[19]=j,e[20]=C):C=e[20];let _;e[21]!==p||e[22]!==r||e[23]!==l||e[24]!==g||e[25]!==h?(_=s.jsx(ul,{open:l,onOpenChange:i,connectionId:r,currentLimitUsd:h,billingMode:p,currentLimitPeriod:g}),e[21]=p,e[22]=r,e[23]=l,e[24]=g,e[25]=h,e[26]=_):_=e[26];let A;return e[27]!==w||e[28]!==C||e[29]!==_?(A=s.jsxs(s.Fragment,{children:[w,C,_]}),e[27]=w,e[28]=C,e[29]=_,e[30]=A):A=e[30],A}function zl(t){return t.structuredContent}function $l(t){const e=O.c(20),{gatewayConnectionId:r}=t,[a,l]=v.useState("summary");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[0]=i):i=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(Ta,{variant:"underline",children:[s.jsx(He,{value:"summary",variant:"underline",children:"Summary"}),s.jsx(He,{value:"breakdown",variant:"underline",children:"Breakdown"}),s.jsx(He,{value:"history",variant:"underline",children:"History"})]}),e[1]=n):n=e[1];let o;e[2]!==r?(o=r&&s.jsx(Tl,{connectionId:r}),e[2]=r,e[3]=o):o=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(gl,{}),e[4]=d):d=e[4];let u;e[5]!==o?(u=s.jsxs(qe,{value:"summary",className:"flex flex-col gap-4 pt-2",children:[o,d]}),e[5]=o,e[6]=u):u=e[6];let c;e[7]!==a?(c=a==="breakdown"&&s.jsx(Cl,{}),e[7]=a,e[8]=c):c=e[8];let m;e[9]!==c?(m=s.jsx(qe,{value:"breakdown",className:"pt-2",children:c}),e[9]=c,e[10]=m):m=e[10];let f;e[11]!==a?(f=a==="history"&&s.jsx(Dl,{}),e[11]=a,e[12]=f):f=e[12];let h;e[13]!==f?(h=s.jsx(qe,{value:"history",className:"pt-2",children:f}),e[13]=f,e[14]=h):h=e[14];let x;return e[15]!==a||e[16]!==u||e[17]!==m||e[18]!==h?(x=s.jsxs(s.Fragment,{children:[i,s.jsxs(za,{value:a,onValueChange:l,variant:"underline",children:[n,u,m,h]})]}),e[15]=a,e[16]=u,e[17]=m,e[18]=h,e[19]=x):x=e[19],x}function Ml(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{children:[s.jsx(ie,{className:"h-5 w-32"}),s.jsx(ie,{className:"h-4 w-64 mt-1.5"})]}),s.jsx(ie,{className:"h-28 rounded-xl"}),s.jsx(ie,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function Bl(){const t=O.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:s.jsx(rt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-6",children:[e,s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Unable to load billing data. Please try again later."})]})]})]}),t[2]=a):a=t[2],a}class Gl extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?s.jsx(Bl,{}):this.props.children}}function Wl(){const t=O.c(4),e=Ba();let r;t[0]!==e?(r=e.find(Fl),t[0]=e,t[1]=r):r=t[1];const l=r?.id??null;let i;return t[2]!==l?(i=s.jsx($l,{gatewayConnectionId:l}),t[2]=l,t[3]=i):i=t[3],i}function Fl(t){return Wa(t,Fa)}function Rl(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col gap-6",children:s.jsx(Gl,{children:s.jsx(v.Suspense,{fallback:s.jsx(Ml,{}),children:s.jsx(Wl,{})})})}),t[0]=e):e=t[0],e}function Ul(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ha,{}),t[0]=e):e=t[0],e}function ms(){const t=O.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ie,{className:"h-6 w-48"}),r=s.jsx(ie,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(ie,{className:"h-12 w-full"}),s.jsx(ie,{className:"h-12 w-full"})]})]}),t[2]=a):a=t[2],a}function Kl(t){const e=O.c(14),{projectSlug:r,children:a}=t,{org:l}=ue(),{data:i,isLoading:n}=Et(l.id,r);if(n||!i){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ms,{}),e[0]=m):m=e[0],m}const o=r===Ie;let d;e[1]!==i.description||e[2]!==i.enabledPlugins||e[3]!==i.id||e[4]!==i.name||e[5]!==i.organizationId||e[6]!==i.slug||e[7]!==i.ui||e[8]!==o?(d={id:i.id,organizationId:i.organizationId,slug:i.slug,name:i.name,description:i.description,enabledPlugins:i.enabledPlugins,ui:i.ui,isOrgAdmin:o},e[1]=i.description,e[2]=i.enabledPlugins,e[3]=i.id,e[4]=i.name,e[5]=i.organizationId,e[6]=i.slug,e[7]=i.ui,e[8]=o,e[9]=d):d=e[9];const u=d;let c;return e[10]!==a||e[11]!==u||e[12]!==l?(c=s.jsx(It,{org:l,project:u,children:a}),e[10]=a,e[11]=u,e[12]=l,e[13]=c):c=e[13],c}function Vl(t){const e=O.c(8),{section:r}=t;switch(r){case"account.profile":{let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Xa,{}),e[0]=a):a=e[0],a}case"account.preferences":{let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[1]=a):a=e[1],a}case"org.general":{let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ar,{}),e[2]=a):a=e[2],a}case"org.plugins":{let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Kl,{projectSlug:Ie,children:s.jsx(Rs,{})}),e[3]=a):a=e[3],a}case"org.ai-providers":{let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ss,{}),e[4]=a):a=e[4],a}case"org.billing":{let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Rl,{}),e[5]=a):a=e[5],a}case"org.members":{let a;return e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ul,{}),e[6]=a):a=e[6],a}default:{let a;return e[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[7]=a):a=e[7],a}}}function Yl(){const t=O.c(24),{isOpen:e,activeSection:r,open:a,close:l}=Ns();let i;t[0]!==l?(i=y=>!y&&l(),t[0]=l,t[1]=i):i=t[1];let n;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ot,{className:"sr-only",children:"Settings"}),t[2]=n):n=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[3]=o):o=t[3];let d;t[4]!==r||t[5]!==a?(d=s.jsx(v.Suspense,{fallback:o,children:s.jsx(qa,{activeSection:r,onNavigate:a})}),t[4]=r,t[5]=a,t[6]=d):d=t[6];let u,c;t[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ys,{size:16}),c=s.jsx("span",{className:"sr-only",children:"Close"}),t[7]=u,t[8]=c):(u=t[7],c=t[8]);let m;t[9]!==l?(m=s.jsxs("button",{type:"button",onClick:l,className:"absolute top-4 right-4 z-10 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[u,c]}),t[9]=l,t[10]=m):m=t[10];let f;t[11]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ms,{}),t[11]=f):f=t[11];let h;t[12]!==r?(h=s.jsx("div",{className:"p-8",children:s.jsx(v.Suspense,{fallback:f,children:s.jsx(Vl,{section:r})})}),t[12]=r,t[13]=h):h=t[13];let x;t[14]!==m||t[15]!==h?(x=s.jsxs("div",{className:"flex-1 min-w-0 overflow-y-auto relative flex flex-col overflow-hidden",children:[m,h]}),t[14]=m,t[15]=h,t[16]=x):x=t[16];let p;t[17]!==d||t[18]!==x?(p=s.jsxs(Dt,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:[n,s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[d,x]})]}),t[17]=d,t[18]=x,t[19]=p):p=t[19];let g;return t[20]!==e||t[21]!==i||t[22]!==p?(g=s.jsx(Lt,{open:e,onOpenChange:i,children:p}),t[20]=e,t[21]=i,t[22]=p,t[23]=g):g=t[23],g}function Hl(t){const e=O.c(12),{projectSlug:r,orgSlug:a,error:l}=t,i=at();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=n):n=e[0];let o;e[1]!==r?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let d;e[3]!==l.message?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:l.message}),e[3]=l.message,e[4]=d):d=e[4];let u;e[5]!==i||e[6]!==a?(u=s.jsx(de,{variant:"link",onClick:()=>i({to:"/$org/$project",params:{org:a,project:Ie}}),children:"Go to organization home"}),e[5]=i,e[6]=a,e[7]=u):u=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==u?(c=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[n,o,d,u]}),e[8]=o,e[9]=d,e[10]=u,e[11]=c):c=e[11],c}function ql(t){const e=O.c(9),{projectSlug:r,orgSlug:a}=t,l=at();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=i):i=e[0];let n;e[1]!==r?(n=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=n):n=e[2];let o;e[3]!==l||e[4]!==a?(o=s.jsx(de,{variant:"link",onClick:()=>l({to:"/$org/$project",params:{org:a,project:Ie}}),children:"Go to organization home"}),e[3]=l,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==n||e[7]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[i,n,o]}),e[6]=n,e[7]=o,e[8]=d):d=e[8],d}function Xl(){const t=O.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=xs(e),{org:a}=ue(),l=r.org,i=r.project,{data:n,isLoading:o,error:d}=Et(a.id,i);if(o){let p;return t[1]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ze,{}),t[1]=p):p=t[1],p}if(d){let p;return t[2]!==d||t[3]!==l||t[4]!==i?(p=s.jsx(Hl,{projectSlug:i,orgSlug:l,error:d}),t[2]=d,t[3]=l,t[4]=i,t[5]=p):p=t[5],p}if(!n){let p;return t[6]!==l||t[7]!==i?(p=s.jsx(ql,{projectSlug:i,orgSlug:l}),t[6]=l,t[7]=i,t[8]=p):p=t[8],p}const u=n.slug===Ie;let c;t[9]!==n.description||t[10]!==n.enabledPlugins||t[11]!==n.id||t[12]!==n.name||t[13]!==n.organizationId||t[14]!==n.slug||t[15]!==n.ui||t[16]!==u?(c={id:n.id,organizationId:n.organizationId,slug:n.slug,name:n.name,description:n.description,enabledPlugins:n.enabledPlugins,ui:n.ui,isOrgAdmin:u},t[9]=n.description,t[10]=n.enabledPlugins,t[11]=n.id,t[12]=n.name,t[13]=n.organizationId,t[14]=n.slug,t[15]=n.ui,t[16]=u,t[17]=c):c=t[17];const m=c;let f,h;t[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(v.Suspense,{fallback:s.jsx(Ze,{}),children:s.jsx(hs,{})}),h=s.jsx(Yl,{}),t[18]=f,t[19]=h):(f=t[18],h=t[19]);let x;return t[20]!==m||t[21]!==a?(x=s.jsxs(It,{org:a,project:m,children:[f,h]}),t[20]=m,t[21]=a,t[22]=x):x=t[22],x}function In(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(v.Suspense,{fallback:s.jsx(Ze,{}),children:s.jsx(Xl,{})}),t[0]=e):e=t[0],e}export{In as default};
@@ -1 +1 @@
1
- import{r as _,j as n,y as J,B as G,u as V,x as W,w as M,K as q,bh as D,bj as $,c as Q}from"./index-DsOJvxnb.js";import{u as Y}from"./useQuery-D2ShO4od.js";import{u as H}from"./useMutation-B_cFG709.js";import{u as X,a as Z}from"./constants-XtX-WKGm.js";import{S as ee}from"./switch-BQjzAGvm.js";import{L as te}from"./label-iPw5smAw.js";import{n as ne}from"./Container-DwxLlgWA.js";import{b as se}from"./use-connection-DmR852Js.js";import{a as ie,c as re}from"./use-binding-BfjFWpEn.js";import{u as oe}from"./use-install-from-registry-_FQYQGQx.js";import{i as le}from"./Loading01-BNn4YU_K.js";import{s as ae}from"./Plus-CT_Gcwl2.js";import{S as ce,a as de,b as ue,c as me,d as z}from"./select-DRPG5csU.js";function ge({value:o,onValueChange:e,placeholder:r="Select a connection...",binding:l,bindingType:a,onAddNew:y,className:x,disabled:h=!1}){const[j,d]=_.useState(!1),{installByBinding:N,isInstalling:S}=oe(),b=j||S,u=se(),w=ie({connections:u,binding:typeof l=="string"?l:void 0}),C=!l||!u?u??[]:typeof l=="string"?w:Array.isArray(l)&&l.length>0?u.filter(t=>re(t,l)):u,m=(()=>{if(!a?.startsWith("@"))return null;const[t,s]=a.replace("@","").split("/");return t&&s?{scope:t,appName:s}:null})(),P=(()=>{let t=C;const s=Array.isArray(l)&&l.length>0;if(m&&!s&&(t=t.filter(i=>{const c=i.app_name,p=i.metadata?.scopeName;return c===m.appName&&p===m.scope})),o&&!t.some(i=>i.id===o)){const i=u?.find(c=>c.id===o);if(i)return[i,...t]}return t})(),v=a?.startsWith("@"),A=async()=>{if(v&&a){d(!0);try{const t=await N(a);t&&e(t.id)}finally{d(!1)}return}y?.()},g=P.find(t=>t.id===o);return n.jsxs(ce,{value:o??"none",onValueChange:t=>e(t==="none"?null:t),disabled:h,children:[n.jsx(de,{size:"sm",className:J("w-[200px]",x),children:n.jsx(ue,{placeholder:r,children:g?n.jsxs("div",{className:"flex items-center gap-2",children:[g.icon?n.jsx("img",{src:g.icon,alt:g.title,className:"w-4 h-4 rounded shrink-0"}):n.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:g.title.slice(0,1).toUpperCase()}),n.jsx("span",{className:"truncate",children:g.title})]}):r})}),n.jsxs(me,{children:[n.jsx(z,{value:"none",children:"No connection"}),P.length===0?n.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):P.map(t=>n.jsx(z,{value:t.id,children:n.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?n.jsx("img",{src:t.icon,alt:t.title,className:"w-4 h-4 rounded"}):n.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.title.slice(0,1).toUpperCase()}),n.jsx("span",{children:t.title})]})},t.id)),(y||v)&&n.jsx("div",{className:"border-t border-border",children:n.jsx(G,{onPointerDown:t=>t.stopPropagation(),onClick:t=>{t.preventDefault(),t.stopPropagation(),A()},disabled:b||h,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:b?n.jsxs(n.Fragment,{children:[n.jsx(le,{size:16,className:"animate-spin"}),n.jsx("span",{children:"Connecting..."})]}):n.jsxs(n.Fragment,{children:[n.jsx(ae,{size:16}),n.jsx("span",{children:"Add Connection"})]})})})]})]})}const pe=o=>{if(!o||typeof o!="object")return!1;const e=o;return e.type==="text"&&typeof e.text=="string"&&e.text.trim().toLowerCase().startsWith("error")},K=o=>{const e=o.structuredContent??o,r=e&&typeof e=="object"?e:null,l=r?.content?.[0]?.text&&typeof r.content[0].text=="string"?r.content[0].text:null;if(r?.isError)throw new Error(l??"Tool call failed");if(pe(e))throw new Error(e.text);return e};function fe(o){return o.requiresMcpBinding===!0?!0:o.binding!==void 0}function xe(o){const e=Q.c(57),{plugin:r,isEnabled:l,isSaving:a,pendingBinding:y,description:x,label:h,icon:j,projectId:d,client:N,onBindingChange:S,onToggle:b}=o;let u;e[0]!==r?(u=fe(r),e[0]=r,e[1]=u):u=e[1];const w=u;let C;e[2]!==r.id||e[3]!==d?(C=q.projectPluginConfig(d??"",r.id),e[2]=r.id,e[3]=d,e[4]=C):C=e[4];let m;e[5]!==N||e[6]!==r.id||e[7]!==d?(m=async()=>{if(!d)throw new Error("Project ID is required to load plugin config.");const O=await N.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:d,pluginId:r.id}});return K(O)},e[5]=N,e[6]=r.id,e[7]=d,e[8]=m):m=e[8];const P=!!d&&w;let v;e[9]!==C||e[10]!==m||e[11]!==P?(v={queryKey:C,queryFn:m,enabled:P},e[9]=C,e[10]=m,e[11]=P,e[12]=v):v=e[12];const{data:A,isLoading:g}=Y(v),t=A?.config?.connectionId??null,s=y!==void 0?y:t;let i;e[13]!==l||e[14]!==a||e[15]!==b||e[16]!==r.id?(i=()=>!a&&b(r.id,!l),e[13]=l,e[14]=a,e[15]=b,e[16]=r.id,e[17]=i):i=e[17];const c=a?void 0:"pointer";let p;e[18]!==c?(p={cursor:c},e[18]=c,e[19]=p):p=e[19];let f;e[20]!==j?(f=j&&n.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0 [&>svg]:size-4",children:j}),e[20]=j,e[21]=f):f=e[21];let I;e[22]!==h?(I=n.jsx("p",{className:"text-sm font-medium text-foreground",children:h}),e[22]=h,e[23]=I):I=e[23];let E;e[24]!==x?(E=x&&n.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:x}),e[24]=x,e[25]=E):E=e[25];let B;e[26]!==I||e[27]!==E?(B=n.jsxs("div",{className:"min-w-0",children:[I,E]}),e[26]=I,e[27]=E,e[28]=B):B=e[28];let k;e[29]!==B||e[30]!==f?(k=n.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[f,B]}),e[29]=B,e[30]=f,e[31]=k):k=e[31];let T;e[32]!==b||e[33]!==r.id?(T=O=>b(r.id,O),e[32]=b,e[33]=r.id,e[34]=T):T=e[34];let F;e[35]!==l||e[36]!==a||e[37]!==T?(F=n.jsx("div",{onClick:je,className:"shrink-0",children:n.jsx(ee,{checked:l,onCheckedChange:T,disabled:a})}),e[35]=l,e[36]=a,e[37]=T,e[38]=F):F=e[38];let L;e[39]!==k||e[40]!==F?(L=n.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[k,F]}),e[39]=k,e[40]=F,e[41]=L):L=e[41];let U;e[42]!==g||e[43]!==l||e[44]!==a||e[45]!==w||e[46]!==S||e[47]!==r.binding||e[48]!==r.id||e[49]!==s||e[50]!==t?(U=l&&w&&n.jsx("div",{className:"pb-4 pl-7 space-y-2",onClick:he,children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),n.jsx(ge,{value:s??null,onValueChange:O=>S(r.id,O,t),binding:r.binding,placeholder:"Select connection...",className:"w-56",disabled:a||g})]})}),e[42]=g,e[43]=l,e[44]=a,e[45]=w,e[46]=S,e[47]=r.binding,e[48]=r.id,e[49]=s,e[50]=t,e[51]=U):U=e[51];let R;return e[52]!==L||e[53]!==U||e[54]!==i||e[55]!==p?(R=n.jsxs("div",{className:"flex flex-col border-b border-border last:border-0",onClick:i,style:p,children:[L,U]}),e[52]=L,e[53]=U,e[54]=i,e[55]=p,e[56]=R):R=e[56],R}function he(o){return o.stopPropagation()}function je(o){return o.stopPropagation()}function be(){const{org:o,project:e}=V(),r=W(),l=X({connectionId:Z,orgId:o.id}),[a,y]=_.useState({}),[x,h]=_.useState({}),[j,d]=_.useState(!1),N=e.enabledPlugins??[],S=t=>{const s=a[t];return s!==void 0?s:N.includes(t)},b=()=>{const t=new Set(N);for(const[s,i]of Object.entries(a))i?t.add(s):t.delete(s);return Array.from(t)},u=Object.keys(a).length>0||Object.keys(x).length>0,w=(t,s)=>{const i=N.includes(t);y(s===i?c=>{const{[t]:p,...f}=c;return f}:c=>({...c,[t]:s}))},C=(t,s,i)=>{if(s===i){h(c=>{const{[t]:p,...f}=c;return f});return}h(c=>({...c,[t]:s}))},m=H({mutationFn:async t=>{const s=[];if(t.updatePlugins){const i=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:e.id,enabledPlugins:t.enabledPlugins}});s.push(K(i))}if(t.bindingUpdates.length>0){const i=await Promise.all(t.bindingUpdates.map(async({pluginId:c,connectionId:p,settings:f})=>{const I=await l.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:e.id,pluginId:c,connectionId:p,settings:f}});return K(I)}));s.push(...i)}return s},onSuccess:(t,s)=>{s.updatePlugins&&(r.invalidateQueries({queryKey:q.project(o.id,e.slug)}),r.invalidateQueries({queryKey:q.projects(o.id)})),s.bindingUpdates.forEach(({pluginId:i})=>{r.invalidateQueries({queryKey:q.projectPluginConfig(e.id??"",i)})}),y({}),h({}),M.success("Plugins updated successfully")},onError:t=>{M.error("Failed to update plugins: "+(t instanceof Error?t.message:"Unknown error"))},onSettled:()=>{d(!1)}}),P=()=>{d(!0);const t=Object.keys(x).map(s=>{const i=x[s];return{pluginId:s,connectionId:i!==void 0?i:void 0}});m.mutate({enabledPlugins:b(),updatePlugins:Object.keys(a).length>0,bindingUpdates:t})},v=()=>{y({}),h({})},A=t=>{const s=$.find(i=>i.pluginId===t);return s?{label:s.label,icon:s.items[0]?.icon}:null},g=t=>D.find(i=>i.id===t)?.description??null;return D.length===0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-col",children:D.map(t=>{const s=A(t.id),i=g(t.id),c=S(t.id);return n.jsx(xe,{plugin:t,isEnabled:c,isSaving:j,pendingBinding:x[t.id],description:i,label:s?.label??t.id,icon:s?.icon??n.jsx(ne,{size:14}),projectId:e.id,client:l,onBindingChange:C,onToggle:w},t.id)})}),n.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[n.jsx(G,{variant:"outline",onClick:v,disabled:!u||j,children:"Cancel"}),n.jsx(G,{onClick:P,disabled:!u||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}function Le(){const o=Q.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Features"}),n.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Extend your project with built-in capabilities that activate automatically on any connection that supports them."})]}),n.jsx(be,{})]}),o[0]=e):e=o[0],e}export{Le as P};
1
+ import{r as _,j as n,y as J,B as G,u as V,x as W,w as M,K as q,bh as D,bj as $,c as Q}from"./index-SkQC2bL2.js";import{u as Y}from"./useQuery-CtOvMPbo.js";import{u as H}from"./useMutation-CXgAMvoC.js";import{u as X,a as Z}from"./constants-BZUBXkLq.js";import{S as ee}from"./switch-BIAgKxiJ.js";import{L as te}from"./label-B5UIAzjB.js";import{n as ne}from"./Container-De-pv4QL.js";import{b as se}from"./use-connection-DSkVzqSP.js";import{a as ie,c as re}from"./use-binding-f1akiPTf.js";import{u as oe}from"./use-install-from-registry-BQfcs7M8.js";import{i as le}from"./Loading01-CDOurw-F.js";import{s as ae}from"./Plus-OTc7Ql1V.js";import{S as ce,a as de,b as ue,c as me,d as z}from"./select-Bqr12jkn.js";function ge({value:o,onValueChange:e,placeholder:r="Select a connection...",binding:l,bindingType:a,onAddNew:y,className:x,disabled:h=!1}){const[j,d]=_.useState(!1),{installByBinding:N,isInstalling:S}=oe(),b=j||S,u=se(),w=ie({connections:u,binding:typeof l=="string"?l:void 0}),C=!l||!u?u??[]:typeof l=="string"?w:Array.isArray(l)&&l.length>0?u.filter(t=>re(t,l)):u,m=(()=>{if(!a?.startsWith("@"))return null;const[t,s]=a.replace("@","").split("/");return t&&s?{scope:t,appName:s}:null})(),P=(()=>{let t=C;const s=Array.isArray(l)&&l.length>0;if(m&&!s&&(t=t.filter(i=>{const c=i.app_name,p=i.metadata?.scopeName;return c===m.appName&&p===m.scope})),o&&!t.some(i=>i.id===o)){const i=u?.find(c=>c.id===o);if(i)return[i,...t]}return t})(),v=a?.startsWith("@"),A=async()=>{if(v&&a){d(!0);try{const t=await N(a);t&&e(t.id)}finally{d(!1)}return}y?.()},g=P.find(t=>t.id===o);return n.jsxs(ce,{value:o??"none",onValueChange:t=>e(t==="none"?null:t),disabled:h,children:[n.jsx(de,{size:"sm",className:J("w-[200px]",x),children:n.jsx(ue,{placeholder:r,children:g?n.jsxs("div",{className:"flex items-center gap-2",children:[g.icon?n.jsx("img",{src:g.icon,alt:g.title,className:"w-4 h-4 rounded shrink-0"}):n.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:g.title.slice(0,1).toUpperCase()}),n.jsx("span",{className:"truncate",children:g.title})]}):r})}),n.jsxs(me,{children:[n.jsx(z,{value:"none",children:"No connection"}),P.length===0?n.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):P.map(t=>n.jsx(z,{value:t.id,children:n.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?n.jsx("img",{src:t.icon,alt:t.title,className:"w-4 h-4 rounded"}):n.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.title.slice(0,1).toUpperCase()}),n.jsx("span",{children:t.title})]})},t.id)),(y||v)&&n.jsx("div",{className:"border-t border-border",children:n.jsx(G,{onPointerDown:t=>t.stopPropagation(),onClick:t=>{t.preventDefault(),t.stopPropagation(),A()},disabled:b||h,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:b?n.jsxs(n.Fragment,{children:[n.jsx(le,{size:16,className:"animate-spin"}),n.jsx("span",{children:"Connecting..."})]}):n.jsxs(n.Fragment,{children:[n.jsx(ae,{size:16}),n.jsx("span",{children:"Add Connection"})]})})})]})]})}const pe=o=>{if(!o||typeof o!="object")return!1;const e=o;return e.type==="text"&&typeof e.text=="string"&&e.text.trim().toLowerCase().startsWith("error")},K=o=>{const e=o.structuredContent??o,r=e&&typeof e=="object"?e:null,l=r?.content?.[0]?.text&&typeof r.content[0].text=="string"?r.content[0].text:null;if(r?.isError)throw new Error(l??"Tool call failed");if(pe(e))throw new Error(e.text);return e};function fe(o){return o.requiresMcpBinding===!0?!0:o.binding!==void 0}function xe(o){const e=Q.c(57),{plugin:r,isEnabled:l,isSaving:a,pendingBinding:y,description:x,label:h,icon:j,projectId:d,client:N,onBindingChange:S,onToggle:b}=o;let u;e[0]!==r?(u=fe(r),e[0]=r,e[1]=u):u=e[1];const w=u;let C;e[2]!==r.id||e[3]!==d?(C=q.projectPluginConfig(d??"",r.id),e[2]=r.id,e[3]=d,e[4]=C):C=e[4];let m;e[5]!==N||e[6]!==r.id||e[7]!==d?(m=async()=>{if(!d)throw new Error("Project ID is required to load plugin config.");const O=await N.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:d,pluginId:r.id}});return K(O)},e[5]=N,e[6]=r.id,e[7]=d,e[8]=m):m=e[8];const P=!!d&&w;let v;e[9]!==C||e[10]!==m||e[11]!==P?(v={queryKey:C,queryFn:m,enabled:P},e[9]=C,e[10]=m,e[11]=P,e[12]=v):v=e[12];const{data:A,isLoading:g}=Y(v),t=A?.config?.connectionId??null,s=y!==void 0?y:t;let i;e[13]!==l||e[14]!==a||e[15]!==b||e[16]!==r.id?(i=()=>!a&&b(r.id,!l),e[13]=l,e[14]=a,e[15]=b,e[16]=r.id,e[17]=i):i=e[17];const c=a?void 0:"pointer";let p;e[18]!==c?(p={cursor:c},e[18]=c,e[19]=p):p=e[19];let f;e[20]!==j?(f=j&&n.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0 [&>svg]:size-4",children:j}),e[20]=j,e[21]=f):f=e[21];let I;e[22]!==h?(I=n.jsx("p",{className:"text-sm font-medium text-foreground",children:h}),e[22]=h,e[23]=I):I=e[23];let E;e[24]!==x?(E=x&&n.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:x}),e[24]=x,e[25]=E):E=e[25];let B;e[26]!==I||e[27]!==E?(B=n.jsxs("div",{className:"min-w-0",children:[I,E]}),e[26]=I,e[27]=E,e[28]=B):B=e[28];let k;e[29]!==B||e[30]!==f?(k=n.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[f,B]}),e[29]=B,e[30]=f,e[31]=k):k=e[31];let T;e[32]!==b||e[33]!==r.id?(T=O=>b(r.id,O),e[32]=b,e[33]=r.id,e[34]=T):T=e[34];let F;e[35]!==l||e[36]!==a||e[37]!==T?(F=n.jsx("div",{onClick:je,className:"shrink-0",children:n.jsx(ee,{checked:l,onCheckedChange:T,disabled:a})}),e[35]=l,e[36]=a,e[37]=T,e[38]=F):F=e[38];let L;e[39]!==k||e[40]!==F?(L=n.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[k,F]}),e[39]=k,e[40]=F,e[41]=L):L=e[41];let U;e[42]!==g||e[43]!==l||e[44]!==a||e[45]!==w||e[46]!==S||e[47]!==r.binding||e[48]!==r.id||e[49]!==s||e[50]!==t?(U=l&&w&&n.jsx("div",{className:"pb-4 pl-7 space-y-2",onClick:he,children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),n.jsx(ge,{value:s??null,onValueChange:O=>S(r.id,O,t),binding:r.binding,placeholder:"Select connection...",className:"w-56",disabled:a||g})]})}),e[42]=g,e[43]=l,e[44]=a,e[45]=w,e[46]=S,e[47]=r.binding,e[48]=r.id,e[49]=s,e[50]=t,e[51]=U):U=e[51];let R;return e[52]!==L||e[53]!==U||e[54]!==i||e[55]!==p?(R=n.jsxs("div",{className:"flex flex-col border-b border-border last:border-0",onClick:i,style:p,children:[L,U]}),e[52]=L,e[53]=U,e[54]=i,e[55]=p,e[56]=R):R=e[56],R}function he(o){return o.stopPropagation()}function je(o){return o.stopPropagation()}function be(){const{org:o,project:e}=V(),r=W(),l=X({connectionId:Z,orgId:o.id}),[a,y]=_.useState({}),[x,h]=_.useState({}),[j,d]=_.useState(!1),N=e.enabledPlugins??[],S=t=>{const s=a[t];return s!==void 0?s:N.includes(t)},b=()=>{const t=new Set(N);for(const[s,i]of Object.entries(a))i?t.add(s):t.delete(s);return Array.from(t)},u=Object.keys(a).length>0||Object.keys(x).length>0,w=(t,s)=>{const i=N.includes(t);y(s===i?c=>{const{[t]:p,...f}=c;return f}:c=>({...c,[t]:s}))},C=(t,s,i)=>{if(s===i){h(c=>{const{[t]:p,...f}=c;return f});return}h(c=>({...c,[t]:s}))},m=H({mutationFn:async t=>{const s=[];if(t.updatePlugins){const i=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:e.id,enabledPlugins:t.enabledPlugins}});s.push(K(i))}if(t.bindingUpdates.length>0){const i=await Promise.all(t.bindingUpdates.map(async({pluginId:c,connectionId:p,settings:f})=>{const I=await l.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:e.id,pluginId:c,connectionId:p,settings:f}});return K(I)}));s.push(...i)}return s},onSuccess:(t,s)=>{s.updatePlugins&&(r.invalidateQueries({queryKey:q.project(o.id,e.slug)}),r.invalidateQueries({queryKey:q.projects(o.id)})),s.bindingUpdates.forEach(({pluginId:i})=>{r.invalidateQueries({queryKey:q.projectPluginConfig(e.id??"",i)})}),y({}),h({}),M.success("Plugins updated successfully")},onError:t=>{M.error("Failed to update plugins: "+(t instanceof Error?t.message:"Unknown error"))},onSettled:()=>{d(!1)}}),P=()=>{d(!0);const t=Object.keys(x).map(s=>{const i=x[s];return{pluginId:s,connectionId:i!==void 0?i:void 0}});m.mutate({enabledPlugins:b(),updatePlugins:Object.keys(a).length>0,bindingUpdates:t})},v=()=>{y({}),h({})},A=t=>{const s=$.find(i=>i.pluginId===t);return s?{label:s.label,icon:s.items[0]?.icon}:null},g=t=>D.find(i=>i.id===t)?.description??null;return D.length===0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-col",children:D.map(t=>{const s=A(t.id),i=g(t.id),c=S(t.id);return n.jsx(xe,{plugin:t,isEnabled:c,isSaving:j,pendingBinding:x[t.id],description:i,label:s?.label??t.id,icon:s?.icon??n.jsx(ne,{size:14}),projectId:e.id,client:l,onBindingChange:C,onToggle:w},t.id)})}),n.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[n.jsx(G,{variant:"outline",onClick:v,disabled:!u||j,children:"Cancel"}),n.jsx(G,{onClick:P,disabled:!u||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}function Le(){const o=Q.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Features"}),n.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Extend your project with built-in capabilities that activate automatically on any connection that supports them."})]}),n.jsx(be,{})]}),o[0]=e):e=o[0],e}export{Le as P};
@@ -0,0 +1 @@
1
+ import{bi as G,c as O,u as H,y as J,j as s,J as M,r as I,e as V,B as R,O as U}from"./index-SkQC2bL2.js";import{a as q}from"./use-project-Cdk7AuZE.js";import{P as D}from"./index-Bs-gkatC.js";import{C as F}from"./collection-search-CPQlTmfx.js";import{A as K}from"./avatar-DexhTB4g.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as T}from"./empty-state-BUpyINsX.js";import{C as W}from"./create-project-dialog-d10TQ9K8.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-h9Dq7GJ0.js";import"./useQuery-CtOvMPbo.js";import"./constants-BZUBXkLq.js";import"./useMutation-CXgAMvoC.js";import"./tooltip-Ckpai_jH.js";import"./index-AtuNXtl1.js";import"./Loading01-CDOurw-F.js";import"./SearchMd-D6jy19cO.js";import"./input-C4xXFdLa.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-PlqYdiap.js";import"./X-DVxsAMCH.js";import"./form-CnUcVXlu.js";import"./label-B5UIAzjB.js";import"./textarea-Buug1Hxe.js";import"./Check-CN56KhoF.js";import"./ChevronRight-Df5oEIdG.js";const te=G("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function se(t){const e=O.c(58),{project:l,onSettingsClick:c}=t,{org:r}=H(),d=l.ui?.themeColor??"#60a5fa",b=l.ui?.bannerColor??d,m=l.ui?.banner?`url(${l.ui.banner})`:void 0;let i;e[0]!==b||e[1]!==m?(i={backgroundColor:b,backgroundImage:m,backgroundSize:"cover",backgroundPosition:"center"},e[0]=b,e[1]=m,e[2]=i):i=e[2];const _=i;let u;e[3]!==r.slug||e[4]!==l.slug?(u={org:r.slug,project:l.slug},e[3]=r.slug,e[4]=l.slug,e[5]=u):u=e[5];let f;e[6]!==c?(f=B=>{B.preventDefault(),B.stopPropagation(),c?.(B)},e[6]=c,e[7]=f):f=e[7];let x,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=J("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors"),v=s.jsx(te,{className:"size-3.5 text-white"}),e[8]=x,e[9]=v):(x=e[8],v=e[9]);let g;e[10]!==f?(g=s.jsx("button",{type:"button",onClick:f,className:x,children:v}),e[10]=f,e[11]=g):g=e[11];let p;e[12]!==_||e[13]!==g?(p=s.jsx("div",{className:"h-20 relative",style:_,children:g}),e[12]=_,e[13]=g,e[14]=p):p=e[14];let n;e[15]!==l.name||e[16]!==l.ui||e[17]!==d?(n=l.ui?.icon?s.jsx("img",{src:l.ui.icon,alt:"",className:"size-8 rounded-md object-cover"}):s.jsx("div",{className:"size-8 rounded-md flex items-center justify-center",style:{backgroundColor:d},children:s.jsx("span",{className:"text-sm font-medium text-white",children:l.name.charAt(0).toUpperCase()})}),e[15]=l.name,e[16]=l.ui,e[17]=d,e[18]=n):n=e[18];let a;e[19]!==l.name?(a=s.jsx("h3",{className:"font-medium text-base text-foreground truncate",children:l.name}),e[19]=l.name,e[20]=a):a=e[20];let h;e[21]!==l.updatedAt?(h=Q(new Date(l.updatedAt),{addSuffix:!0}),e[21]=l.updatedAt,e[22]=h):h=e[22];let j;e[23]!==h?(j=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Edited"," ",h]}),e[23]=h,e[24]=j):j=e[24];let C;e[25]!==a||e[26]!==j?(C=s.jsxs("div",{className:"flex flex-col",children:[a,j]}),e[25]=a,e[26]=j,e[27]=C):C=e[27];let N;e[28]!==n||e[29]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-4",children:[n,C]}),e[28]=n,e[29]=C,e[30]=N):N=e[30];let k;e[31]!==l.boundConnections?(k=l.boundConnections.slice(0,4).map(le),e[31]=l.boundConnections,e[32]=k):k=e[32];let P;e[33]!==l.boundConnections.length?(P=l.boundConnections.length>4&&s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsxs("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center text-xs text-muted-foreground",children:["+",l.boundConnections.length-4]})}),e[33]=l.boundConnections.length,e[34]=P):P=e[34];let y;e[35]!==k||e[36]!==P?(y=s.jsxs("div",{className:"flex pr-2",children:[k,P]}),e[35]=k,e[36]=P,e[37]=y):y=e[37];const z=r.logo??void 0;let w;e[38]!==r.name||e[39]!==z?(w=s.jsx(K,{url:z,fallback:r.name,size:"2xs",className:"shrink-0 rounded",objectFit:"cover"}),e[38]=r.name,e[39]=z,e[40]=w):w=e[40];let S;e[41]!==r.name?(S=s.jsx("span",{className:"truncate max-w-20",children:r.name}),e[41]=r.name,e[42]=S):S=e[42];let o;e[43]!==w||e[44]!==S?(o=s.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[w,S]}),e[43]=w,e[44]=S,e[45]=o):o=e[45];let L;e[46]!==y||e[47]!==o?(L=s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[y,o]}),e[46]=y,e[47]=o,e[48]=L):L=e[48];let $;e[49]!==N||e[50]!==L?($=s.jsxs("div",{className:"flex flex-col flex-1 justify-between p-4",children:[N,L]}),e[49]=N,e[50]=L,e[51]=$):$=e[51];let A;e[52]!==$||e[53]!==p?(A=s.jsxs("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[p,$]}),e[52]=$,e[53]=p,e[54]=A):A=e[54];let E;return e[55]!==A||e[56]!==u?(E=s.jsx(M,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=E):E=e[57],E}function le(t){return s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsx(re,{connection:t})},t.id)}function re(t){const e=O.c(13),{connection:l}=t;if(l.icon){let m;e[0]!==l.icon||e[1]!==l.title?(m=s.jsx("img",{src:l.icon,alt:l.title,className:"size-4 object-cover"}),e[0]=l.icon,e[1]=l.title,e[2]=m):m=e[2];let i;return e[3]!==l.title||e[4]!==m?(i=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:l.title,children:m}),e[3]=l.title,e[4]=m,e[5]=i):i=e[5],i}const c=l.title;let r;e[6]!==l.title?(r=l.title.charAt(0).toUpperCase(),e[6]=l.title,e[7]=r):r=e[7];let d;e[8]!==r?(d=s.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:r}),e[8]=r,e[9]=d):d=e[9];let b;return e[10]!==l.title||e[11]!==d?(b=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:c,children:d}),e[10]=l.title,e[11]=d,e[12]=b):b=e[12],b}function Ae(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=q(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=V();let _,u,f,x,v,g,p,n,a;if(t[0]!==c||t[1]!==i||t[2]!==e.slug||t[3]!==l||t[4]!==r){const N=l?.filter(ie)?.filter(o=>o.name.toLowerCase().includes(r.toLowerCase())||o.description?.toLowerCase().includes(r.toLowerCase()))??[];let k;t[14]!==i||t[15]!==e.slug?(k=o=>{i({to:"/$org/$project/projects/$slug/settings/general",params:{org:e.slug,project:U,slug:o}})},t[14]=i,t[15]=e.slug,t[16]=k):k=t[16];const P=k;let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m(!0)},t[17]=y):y=t[17];const z=y;u=D;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(D.Header.Left,{children:s.jsx(X,{children:s.jsx(Y,{children:s.jsx(Z,{children:s.jsx(ee,{children:"Projects"})})})})}),t[18]=w):w=t[18],t[19]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(D.Header,{children:[w,s.jsx(D.Header.Right,{children:s.jsx(R,{onClick:z,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Create new project"})})]}),t[19]=n):n=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o=>{o.key==="Escape"&&(d(""),o.target.blur())},t[20]=S):S=t[20],t[21]!==r?(a=s.jsx(F,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=D.Content,f="@container",t[23]!==c?(x=c&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:[...Array(4)].map(oe)})}),t[23]=c,t[24]=x):x=t[24],v=!c&&N.length===0&&r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(T,{title:"No projects found",description:`No projects match "${r}"`})}),g=!c&&N.length===0&&!r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(T,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(R,{onClick:z,children:"Create new project"})})}),p=!c&&N.length>0&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:N.map(o=>s.jsx(se,{project:o,onSettingsClick:()=>P(o.slug)},o.id))})}),t[0]=c,t[1]=i,t[2]=e.slug,t[3]=l,t[4]=r,t[5]=_,t[6]=u,t[7]=f,t[8]=x,t[9]=v,t[10]=g,t[11]=p,t[12]=n,t[13]=a}else _=t[5],u=t[6],f=t[7],x=t[8],v=t[9],g=t[10],p=t[11],n=t[12],a=t[13];let h;t[25]!==_||t[26]!==f||t[27]!==x||t[28]!==v||t[29]!==g||t[30]!==p?(h=s.jsxs(_,{className:f,children:[x,v,g,p]}),t[25]=_,t[26]=f,t[27]=x,t[28]=v,t[29]=g,t[30]=p,t[31]=h):h=t[31];let j;t[32]!==b?(j=s.jsx(W,{open:b,onOpenChange:m}),t[32]=b,t[33]=j):j=t[33];let C;return t[34]!==u||t[35]!==n||t[36]!==a||t[37]!==h||t[38]!==j?(C=s.jsxs(u,{children:[n,a,h,j]}),t[34]=u,t[35]=n,t[36]=a,t[37]=h,t[38]=j,t[39]=C):C=t[39],C}function oe(t,e){return s.jsx("div",{className:"h-[240px] rounded-xl bg-muted animate-pulse"},e)}function ie(t){return t.slug!==U}export{Ae as default};
@@ -1,4 +1,4 @@
1
- import{r as I,c as X,u as de,x as Le,c5 as Ke,j as t,B as G,y as ee,w as H,cj as pn,a as fn,i as gn}from"./index-DsOJvxnb.js";import{i as it}from"./CheckCircle-DiRi76qb.js";import{n as jn}from"./Container-DwxLlgWA.js";import{t as vn}from"./Settings01-2AkYiqYr.js";import{u as Fe}from"./useQuery-D2ShO4od.js";import{u as Ce}from"./useMutation-B_cFG709.js";import{a as pe,u as he,f as gs}from"./constants-XtX-WKGm.js";import{u as js}from"./useInfiniteQuery-DEfXPFTs.js";import{B as F}from"./badge-CAg946Xk.js";import{I as xe}from"./input-CUT8DBv1.js";import{a as Tt,c as Ee,D as It,b as Mt,g as rs,l as is,h as bn}from"./dropdown-menu-DzFMEBVS.js";import{T as vs,a as bs,b as Pt,c as Ie,d as ys,e as Me}from"./table-DJbHB5IL.js";import{T as yn,a as ls}from"./toggle-group-y2h19HHT.js";import{u as Nn}from"./use-view-mode-ve-Q_Sd0.js";import{i as Ht}from"./DotsVertical-Y8XpM2B_.js";import{i as wn}from"./FilterLines-BaTxnUjH.js";import{i as Ns}from"./Globe01-DUjsFcPS.js";import{i as et}from"./Loading01-BNn4YU_K.js";import{i as ws}from"./SearchMd-BLeX5weN.js";import{b as Et,D as Dt,a as $t,e as At,c as Lt,d as Ot}from"./dialog-_XYw8lZC.js";import{i as xt}from"./AlertCircle-De9oqjty.js";import{n as Cn}from"./Download01-LinNp3zy.js";import{i as as}from"./Upload01-BlEN4mwB.js";import{c as ht,b as pt,d as ft,A as gt,h as jt,e as vt,a as bt,f as yt}from"./alert-dialog-BVglQjyM.js";import{C as oe}from"./card-RQxLVCBk.js";import{i as os}from"./CheckVerified02-DC3VT092.js";import{s as wt}from"./Trash01-YPQczxci.js";import{L as re}from"./label-iPw5smAw.js";import{S as Cs,a as _s,b as ks,c as Ss,d as Rt}from"./select-DRPG5csU.js";import{S as Xe}from"./switch-BQjzAGvm.js";import{T as zt}from"./textarea-CTzX43MZ.js";import{i as _n}from"./ArrowLeft-CPWCs_Od.js";import{i as kn,u as Qt,t as Sn}from"./use-copy-dSR0w-bG.js";import{s as Wt}from"./RefreshCcw01-uL9q48A4.js";import{i as Rn}from"./X-B_f76BPZ.js";import{i as Tn}from"./Link01-q2vhCqdM.js";import{t as Rs}from"./ChevronDown-BHMaRWRt.js";import{n as In}from"./ChevronUp-1s_S3eDF.js";import{C as Mn}from"./checkbox-DLsMmmhu.js";import{s as Ts}from"./Eye-JuDcZhJz.js";import{n as Pn}from"./LinkExternal01-QGWpvftd.js";import{i as En}from"./XCircle-DDLf4PgL.js";import{e as Is}from"./use-collections-DSWhP4jg.js";import{b as Ms}from"./use-connection-DmR852Js.js";import{b as Dn,P as $n,a as An}from"./popover-CF3EN_0o.js";import{i as Vt}from"./Check-BfKCyKXX.js";import{a as Kt}from"./Copy01-CIUDy0Hr.js";import{i as Ln}from"./EyeOff-9_-SJWcU.js";import{i as On,a as zn}from"./Save01-CuwI4Bxq.js";import{i as Un}from"./Key01-DAjAUWfr.js";import{s as qn}from"./Plus-CT_Gcwl2.js";import{a as Fn,T as Bn,c as Gn}from"./tooltip-XyKE4lZa.js";import{i as Qn}from"./Play-C7yKo0dH.js";import"./infiniteQueryObserver-BE0Fq7u7.js";import"./ChevronRight-1g9z-Z5h.js";import"./use-mobile-O8KVzGuv.js";import"./index-zjV4p_E5.js";const Ps=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M12.5 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H17c.93 0 1.395 0 1.776-.102a3 3 0 0 0 2.122-2.122C21 18.395 21 17.93 21 17m-2-9V2m-3 3h6M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm4.49 3.418-8.459 7.69c-.476.433-.714.649-.735.836a.5.5 0 0 0 .167.431C6.105 21 6.426 21 7.07 21h9.387c1.44 0 2.159 0 2.724-.242a3 3 0 0 0 1.578-1.578c.242-.565.242-1.285.242-2.724 0-.484 0-.726-.053-.952a2.001 2.001 0 0 0-.374-.778c-.143-.182-.332-.333-.71-.636l-2.797-2.237c-.379-.303-.568-.454-.776-.508a1 1 0 0 0-.557.018c-.205.066-.384.23-.743.555Z"}));Ps.displayName="ImagePlus";const Es=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}),I.createElement("path",{d:"M8 9.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 8 9.04 8 9.6 8h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 8.76 16 9.04 16 9.6v4.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C15.24 16 14.96 16 14.4 16H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 15.24 8 14.96 8 14.4V9.6Z"}));Es.displayName="StopSquare";const Jt=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"m6 6 4.5 4.5M6 6H3L2 3l1-1 3 1v3Zm13.259-3.259-2.628 2.628c-.396.396-.594.594-.668.822a1 1 0 0 0 0 .618c.074.228.272.426.668.822l.238.238c.396.396.594.594.822.668a1 1 0 0 0 .618 0c.228-.074.426-.272.822-.668L21.59 5.41a5.5 5.5 0 0 1-6.16 7.485c-.485-.096-.729-.144-.876-.13a.836.836 0 0 0-.373.114c-.13.07-.261.201-.523.463L6.5 20.5a2.121 2.121 0 0 1-3-3l7.157-7.157c.262-.262.393-.393.463-.524a.836.836 0 0 0 .113-.372c.015-.148-.033-.39-.129-.877a5.5 5.5 0 0 1 8.155-5.83ZM12 15l5.5 5.5a2.121 2.121 0 0 0 3-3l-4.525-4.525a5.475 5.475 0 0 1-.934-.17c-.39-.107-.816-.03-1.101.255L12 15Z"}));Jt.displayName="Tool02";const W={all:["private-registry"],items:()=>[...W.all,"items"],itemsList:(s,e,n,r)=>[...W.items(),"list",{search:s,tags:e,categories:n,limit:r}],item:s=>[...W.items(),"item",s],filters:()=>[...W.all,"filters"],registryConfig:()=>[...W.all,"registry-config"],registryConfigByPlugin:(s,e)=>[...W.registryConfig(),s,e],publishRequests:()=>[...W.all,"publish-requests"],publishRequestsByOrg:s=>[...W.publishRequests(),"org",s],publishRequestsList:(s,e,n)=>[...W.publishRequests(),"list",{status:s??"all",sortBy:e??"created_at",sortDirection:n??"desc"}],publishRequestsListByOrg:(s,e,n,r)=>[...W.publishRequestsByOrg(s),"list",{status:e??"all",sortBy:n??"created_at",sortDirection:r??"desc"}],publishRequestsCount:()=>[...W.publishRequests(),"count"],publishRequestsCountByOrg:s=>[...W.publishRequestsByOrg(s),"count"],publishApiKeys:()=>[...W.all,"publish-api-keys"],monitor:()=>[...W.all,"monitor"],monitorRuns:()=>[...W.monitor(),"runs"],monitorRunsList:s=>[...W.monitorRuns(),"list",{status:s??"all"}],monitorRun:s=>[...W.monitorRuns(),"run",s??"none"],monitorResults:()=>[...W.monitor(),"results"],monitorResultsList:(s,e)=>[...W.monitorResults(),"list",{runId:s??"none",status:e??"all"}],monitorConnections:()=>[...W.monitor(),"connections"],monitorConnectionAuthProbe:s=>[...W.monitorConnections(),"auth-probe",s]};async function Pe(s,e,n){const r=await s.callTool({name:e,arguments:n});if(!r||typeof r!="object")throw new Error(`Invalid tool response for ${e}`);if(r.isError){const o=r.content?.find(l=>l.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return r.structuredContent??r}function Vn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_RUN_START",{config:d}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.monitorRuns()}),e.invalidateQueries({queryKey:W.monitorResults()})])},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Kn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_RUN_CANCEL",{runId:d}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async(d,m)=>{await Promise.all([e.invalidateQueries({queryKey:W.monitorRuns()}),e.invalidateQueries({queryKey:W.monitorRun(m)})])},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Ut(s){const e=X.c(10),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l;e[2]!==s?(l=W.monitorRunsList(s),e[2]=s,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==s?(a=async()=>Pe(o,"REGISTRY_MONITOR_RUN_LIST",{status:s,limit:100}),e[4]=o,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==l||e[8]!==a?(i={queryKey:l,queryFn:a,staleTime:5e3},e[7]=l,e[8]=a,e[9]=i):i=e[9],Fe(i)}function Zt(s){const e=X.c(11),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l;e[2]!==s?(l=W.monitorRun(s),e[2]=s,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==s?(a=async()=>Pe(o,"REGISTRY_MONITOR_RUN_GET",{runId:s}),e[4]=o,e[5]=s,e[6]=a):a=e[6];const i=!!s;let d;return e[7]!==l||e[8]!==a||e[9]!==i?(d={queryKey:l,queryFn:a,enabled:i,refetchInterval:Yn},e[7]=l,e[8]=a,e[9]=i,e[10]=d):d=e[10],Fe(d)}function Yn(s){return s.state.data?.run?.status==="running"?5e3:!1}function Ct(s,e,n){const r=X.c(14),{org:o}=de();let l;r[0]!==o.id?(l={connectionId:pe,orgId:o.id},r[0]=o.id,r[1]=l):l=r[1];const a=he(l);let i;r[2]!==s||r[3]!==e?(i=W.monitorResultsList(s,e),r[2]=s,r[3]=e,r[4]=i):i=r[4];let d;r[5]!==a||r[6]!==s||r[7]!==e?(d=async()=>Pe(a,"REGISTRY_MONITOR_RESULT_LIST",{runId:s,status:e,limit:200,offset:0}),r[5]=a,r[6]=s,r[7]=e,r[8]=d):d=r[8];const m=!!s,u=n==="running"?2500:!1;let x;return r[9]!==i||r[10]!==d||r[11]!==m||r[12]!==u?(x={queryKey:i,queryFn:d,enabled:m,staleTime:5e3,refetchInterval:u},r[9]=i,r[10]=d,r[11]=m,r[12]=u,r[13]=x):x=r[13],Fe(x)}function Ds(){const s=X.c(5),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=W.monitorConnections(),s[2]=o):o=s[2];let l;return s[3]!==r?(l={queryKey:o,queryFn:async()=>Pe(r,"REGISTRY_MONITOR_CONNECTION_LIST",{}),staleTime:1e4},s[3]=r,s[4]=l):l=s[4],Fe(l)}function Hn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async()=>Pe(o,"REGISTRY_MONITOR_CONNECTION_SYNC",{}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.monitorConnections()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Wn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>{const{connectionId:m,authStatus:u}=d;return Pe(o,"REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH",{connectionId:m,authStatus:u})},s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.monitorConnections()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}const cs={monitorMode:"health_check",onFailure:"none",schedule:"manual",cronExpression:"",scheduleEventId:"",perMcpTimeoutMs:3e4,perToolTimeoutMs:1e4,maxAgentSteps:15,testPublicOnly:!1,testPrivateOnly:!1,includePendingRequests:!1,agentContext:"",llmConnectionId:"",llmModelId:""};function $s(){const s=X.c(33),{org:e,project:n}=de();let r;s[0]!==e.id?(r={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=r):r=s[1];const o=he(r),l=Le();let a;s[2]!==n.id?(a=W.registryConfigByPlugin(n.id??"",Ke),s[2]=n.id,s[3]=a):a=s[3];let i;s[4]!==o||s[5]!==n.id?(i=async()=>Pe(o,"PROJECT_PLUGIN_CONFIG_GET",{projectId:n.id,pluginId:Ke}),s[4]=o,s[5]=n.id,s[6]=i):i=s[6];const d=!!n.id;let m;s[7]!==a||s[8]!==i||s[9]!==d?(m={queryKey:a,queryFn:i,enabled:d},s[7]=a,s[8]=i,s[9]=d,s[10]=m):m=s[10];const u=Fe(m),x=u.data?.config?.settings,p=x&&typeof x=="object"?x.testConfig:void 0,c=typeof(x?x.monitorMode??x.testMode:void 0)=="string";let v;s[11]!==p?(v=p??{},s[11]=p,s[12]=v):v=s[12];let b;s[13]!==c||s[14]!==x||s[15]!==p?(b=c&&!p?x:{},s[13]=c,s[14]=x,s[15]=p,s[16]=b):b=s[16];let k;s[17]!==v||s[18]!==b?(k={...cs,...v,...b},s[17]=v,s[18]=b,s[19]=k):k=s[19];const S=k;let y;s[20]!==o||s[21]!==n.id?(y=async R=>{const C=(await Pe(o,"PROJECT_PLUGIN_CONFIG_GET",{projectId:n.id,pluginId:Ke}))?.config?.settings??{};return Pe(o,"PROJECT_PLUGIN_CONFIG_UPDATE",{projectId:n.id,pluginId:Ke,settings:{...C,testConfig:{...cs,...C.testConfig??{},...R}}})},s[20]=o,s[21]=n.id,s[22]=y):y=s[22];let f;s[23]!==n.id||s[24]!==l?(f=async()=>{await l.invalidateQueries({queryKey:W.registryConfigByPlugin(n.id??"",Ke)})},s[23]=n.id,s[24]=l,s[25]=f):f=s[25];let M;s[26]!==y||s[27]!==f?(M={mutationFn:y,onSuccess:f},s[26]=y,s[27]=f,s[28]=M):M=s[28];const g=Ce(M);let w;return s[29]!==u.isLoading||s[30]!==g||s[31]!==S?(w={settings:S,isLoading:u.isLoading,saveMutation:g},s[29]=u.isLoading,s[30]=g,s[31]=S,s[32]=w):w=s[32],w}function Jn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_SCHEDULE_SET",d),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.registryConfig()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Zn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_SCHEDULE_CANCEL",{scheduleEventId:d}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.registryConfig()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Xn(){const s=X.c(3),e=Ut("completed"),n=e.data?.items?.[0]?.id,r=e.data?.items?.[0]?.status,o=Ct(n,"failed",r),l=o.data?.items?.length??0,a=e.isLoading||o.isLoading;let i;return s[0]!==l||s[1]!==a?(i={brokenCount:l,isLoading:a},s[0]=l,s[1]=a,s[2]=i):i=s[2],i}const As=24;function er(s){return s.trim()}async function _e(s,e,n){const r=await s.callTool({name:e,arguments:n});if(!r||typeof r!="object")throw new Error(`Invalid tool response for ${e}`);if(r.isError){const o=r.content?.find(l=>l.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return r.structuredContent??r}function Ls(s){const e=X.c(19),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l,a,i,d;e[2]!==s.categories||e[3]!==s.limit||e[4]!==s.search||e[5]!==s.tags?(a=er(s.search),l=s.limit??As,d=js,i=W.itemsList(a,s.tags,s.categories,l),e[2]=s.categories,e[3]=s.limit,e[4]=s.search,e[5]=s.tags,e[6]=l,e[7]=a,e[8]=i,e[9]=d):(l=e[6],a=e[7],i=e[8],d=e[9]);let m;e[10]!==o||e[11]!==l||e[12]!==s.categories||e[13]!==s.tags||e[14]!==a?(m=async x=>{const{pageParam:p}=x,h=a.length>0?{operator:"or",conditions:[{field:["title"],operator:"contains",value:a},{field:["description"],operator:"contains",value:a},{field:["id"],operator:"contains",value:a},{field:["server","name"],operator:"contains",value:a}]}:void 0;return _e(o,"REGISTRY_ITEM_LIST",{cursor:p,limit:l,tags:s.tags.length?s.tags:void 0,categories:s.categories.length?s.categories:void 0,where:h})},e[10]=o,e[11]=l,e[12]=s.categories,e[13]=s.tags,e[14]=a,e[15]=m):m=e[15];let u;return e[16]!==i||e[17]!==m?(u={queryKey:i,queryFn:m,initialPageParam:void 0,getNextPageParam:tr,staleTime:3e4},e[16]=i,e[17]=m,e[18]=u):u=e[18],d(u)}function tr(s){return s.nextCursor}function sr(){const s=X.c(8),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=W.filters(),s[2]=o):o=s[2];let l;s[3]!==r?(l=async()=>_e(r,"REGISTRY_ITEM_FILTERS",{}),s[3]=r,s[4]=l):l=s[4];let a;s[5]===Symbol.for("react.memo_cache_sentinel")?(a={tags:[],categories:[]},s[5]=a):a=s[5];let i;return s[6]!==l?(i={queryKey:o,queryFn:l,placeholderData:a,staleTime:6e4},s[6]=l,s[7]=i):i=s[7],Fe(i)}function Xt(){const s=X.c(29),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==e?(l=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.items()}),e.invalidateQueries({queryKey:W.filters()})])},s[2]=e,s[3]=l):l=s[3];const a=l;let i;s[4]!==o?(i=async f=>(await _e(o,"REGISTRY_ITEM_CREATE",{data:f})).item,s[4]=o,s[5]=i):i=s[5];let d;s[6]!==a||s[7]!==i?(d={mutationFn:i,onSuccess:a},s[6]=a,s[7]=i,s[8]=d):d=s[8];const m=Ce(d);let u;s[9]!==o?(u=async f=>{const{id:M,data:g}=f;return(await _e(o,"REGISTRY_ITEM_UPDATE",{id:M,data:g})).item},s[9]=o,s[10]=u):u=s[10];let x;s[11]!==a||s[12]!==u?(x={mutationFn:u,onSuccess:a},s[11]=a,s[12]=u,s[13]=x):x=s[13];const p=Ce(x);let h;s[14]!==o?(h=async f=>(await _e(o,"REGISTRY_ITEM_DELETE",{id:f})).item,s[14]=o,s[15]=h):h=s[15];let c;s[16]!==a||s[17]!==h?(c={mutationFn:h,onSuccess:a},s[16]=a,s[17]=h,s[18]=c):c=s[18];const v=Ce(c);let b;s[19]!==o?(b=async f=>_e(o,"REGISTRY_ITEM_BULK_CREATE",{items:f}),s[19]=o,s[20]=b):b=s[20];let k;s[21]!==a||s[22]!==b?(k={mutationFn:b,onSuccess:a},s[21]=a,s[22]=b,s[23]=k):k=s[23];const S=Ce(k);let y;return s[24]!==S||s[25]!==m||s[26]!==v||s[27]!==p?(y={createMutation:m,updateMutation:p,deleteMutation:v,bulkCreateMutation:S},s[24]=S,s[25]=m,s[26]=v,s[27]=p,s[28]=y):y=s[28],y}function qt(s){const e=X.c(37),{org:n,project:r}=de();let o;e[0]!==n.id?(o={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=o):o=e[1];const l=he(o),a=Le();let i;e[2]!==s||e[3]!==r.id?(i=W.registryConfigByPlugin(r.id??"",s),e[2]=s,e[3]=r.id,e[4]=i):i=e[4];let d;e[5]!==l||e[6]!==s||e[7]!==r.id?(d=async()=>_e(l,"PROJECT_PLUGIN_CONFIG_GET",{projectId:r.id,pluginId:s}),e[5]=l,e[6]=s,e[7]=r.id,e[8]=d):d=e[8];const m=!!r.id;let u;e[9]!==i||e[10]!==d||e[11]!==m?(u={queryKey:i,queryFn:d,enabled:m,staleTime:6e4},e[9]=i,e[10]=d,e[11]=m,e[12]=u):u=e[12];const x=Fe(u);let p;e[13]!==l||e[14]!==s||e[15]!==r.id?(p=async A=>{const P=(await _e(l,"PROJECT_PLUGIN_CONFIG_GET",{projectId:r.id,pluginId:s}))?.config?.settings??{};return _e(l,"PROJECT_PLUGIN_CONFIG_UPDATE",{projectId:r.id,pluginId:s,settings:{...P,...A}})},e[13]=l,e[14]=s,e[15]=r.id,e[16]=p):p=e[16];let h;e[17]!==s||e[18]!==r.id||e[19]!==a?(h=async()=>{await a.invalidateQueries({queryKey:W.registryConfigByPlugin(r.id??"",s)})},e[17]=s,e[18]=r.id,e[19]=a,e[20]=h):h=e[20];let c;e[21]!==p||e[22]!==h?(c={mutationFn:p,onSuccess:h},e[21]=p,e[22]=h,e[23]=c):c=e[23];const v=Ce(c),b=x.data?.config?.settings?.registryName??"Private Registry",k=x.data?.config?.settings?.registryIcon??"",S=x.data?.config?.settings?.llmConnectionId??"",y=x.data?.config?.settings?.llmModelId??"",f=x.data?.config?.settings?.acceptPublishRequests??!1,M=x.data?.config?.settings?.requireApiToken??!1,g=x.data?.config?.settings?.storePrivateOnly??!1,w=x.data?.config?.settings?.rateLimitEnabled??!0,E=x.data?.config?.settings?.rateLimitWindow==="minute"?"minute":"hour",C=x.data?.config?.settings?.rateLimitMax,T=typeof C=="number"&&C>=1?Math.floor(C):100;let N;return e[24]!==f||e[25]!==x.isLoading||e[26]!==w||e[27]!==T||e[28]!==E||e[29]!==k||e[30]!==S||e[31]!==y||e[32]!==b||e[33]!==M||e[34]!==v||e[35]!==g?(N={registryName:b,registryIcon:k,registryLLMConnectionId:S,registryLLMModelId:y,acceptPublishRequests:f,requireApiToken:M,storePrivateOnly:g,rateLimitEnabled:w,rateLimitWindow:E,rateLimitMax:T,isLoadingConfig:x.isLoading,saveRegistryConfigMutation:v},e[24]=f,e[25]=x.isLoading,e[26]=w,e[27]=T,e[28]=E,e[29]=k,e[30]=S,e[31]=y,e[32]=b,e[33]=M,e[34]=v,e[35]=g,e[36]=N):N=e[36],N}function nr(s){const e=X.c(15),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l;e[2]!==n.id||e[3]!==s.sortBy||e[4]!==s.sortDirection||e[5]!==s.status?(l=W.publishRequestsListByOrg(n.id,s.status,s.sortBy,s.sortDirection),e[2]=n.id,e[3]=s.sortBy,e[4]=s.sortDirection,e[5]=s.status,e[6]=l):l=e[6];let a;e[7]!==o||e[8]!==s.sortBy||e[9]!==s.sortDirection||e[10]!==s.status?(a=async d=>{const{pageParam:m}=d;return _e(o,"REGISTRY_PUBLISH_REQUEST_LIST",{status:s.status,sortBy:s.sortBy,sortDirection:s.sortDirection,limit:As,offset:m})},e[7]=o,e[8]=s.sortBy,e[9]=s.sortDirection,e[10]=s.status,e[11]=a):a=e[11];let i;return e[12]!==l||e[13]!==a?(i={queryKey:l,queryFn:a,initialPageParam:0,getNextPageParam:rr,staleTime:3e4,refetchOnMount:!0},e[12]=l,e[13]=a,e[14]=i):i=e[14],js(i)}function rr(s,e){const n=e.reduce(ir,0);return n<s.totalCount?n:void 0}function ir(s,e){return s+e.items.length}function lr(){const s=X.c(9),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]!==e.id?(o=W.publishRequestsCountByOrg(e.id),s[2]=e.id,s[3]=o):o=s[3];let l;s[4]!==r?(l=async()=>_e(r,"REGISTRY_PUBLISH_REQUEST_COUNT",{}),s[4]=r,s[5]=l):l=s[5];let a;return s[6]!==o||s[7]!==l?(a={queryKey:o,queryFn:l,staleTime:3e4},s[6]=o,s[7]=l,s[8]=a):a=s[8],Fe(a)}function ar(){const s=X.c(17),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==e?(l=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.publishRequests()})])},s[2]=e,s[3]=l):l=s[3];const a=l;let i;s[4]!==o?(i=async c=>_e(o,"REGISTRY_PUBLISH_REQUEST_REVIEW",c),s[4]=o,s[5]=i):i=s[5];let d;s[6]!==a||s[7]!==i?(d={mutationFn:i,onSuccess:a},s[6]=a,s[7]=i,s[8]=d):d=s[8];const m=Ce(d);let u;s[9]!==o?(u=async c=>_e(o,"REGISTRY_PUBLISH_REQUEST_DELETE",{id:c}),s[9]=o,s[10]=u):u=s[10];let x;s[11]!==a||s[12]!==u?(x={mutationFn:u,onSuccess:a},s[11]=a,s[12]=u,s[13]=x):x=s[13];const p=Ce(x);let h;return s[14]!==p||s[15]!==m?(h={reviewMutation:m,deleteMutation:p},s[14]=p,s[15]=m,s[16]=h):h=s[16],h}function or(){const s=X.c(5),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=W.publishApiKeys(),s[2]=o):o=s[2];let l;return s[3]!==r?(l={queryKey:o,queryFn:async()=>_e(r,"REGISTRY_PUBLISH_API_KEY_LIST",{}),staleTime:3e4},s[3]=r,s[4]=l):l=s[4],Fe(l)}function cr(){const s=X.c(19),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async c=>_e(o,"REGISTRY_PUBLISH_API_KEY_GENERATE",{name:c}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.publishApiKeys()})},s[4]=e,s[5]=a):a=s[5];let i;s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8];const d=Ce(i);let m;s[9]!==o?(m=async c=>_e(o,"REGISTRY_PUBLISH_API_KEY_REVOKE",{keyId:c}),s[9]=o,s[10]=m):m=s[10];let u;s[11]!==e?(u=async()=>{await e.invalidateQueries({queryKey:W.publishApiKeys()})},s[11]=e,s[12]=u):u=s[12];let x;s[13]!==m||s[14]!==u?(x={mutationFn:m,onSuccess:u},s[13]=m,s[14]=u,s[15]=x):x=s[15];const p=Ce(x);let h;return s[16]!==d||s[17]!==p?(h={generateMutation:d,revokeMutation:p},s[16]=d,s[17]=p,s[18]=h):h=s[18],h}function ds(s){return s?s.split(/[;|]/).map(e=>e.trim()).filter(Boolean):[]}function ms(s){const e=[];let n="",r=!1;for(let o=0;o<s.length;o+=1){const l=s[o],a=s[o+1];if(l==='"'){r&&a==='"'?(n+='"',o+=1):r=!r;continue}if(l===","&&!r){e.push(n.trim()),n="";continue}n+=l}return e.push(n.trim()),e}const dr=["id","title"],mr=["id","title","description","remote_url","remote_type","tags","categories","is_public"];function ur(s){const e=s.split(/\r?\n/).map(m=>m.trim()).filter(Boolean);if(e.length<2)return{items:[],warnings:[{line:0,message:"CSV must have a header row and at least one data row"}],skipped:0};const n=ms(e[0]??""),r=new Map,o=[];n.forEach((m,u)=>{const x=m.toLowerCase().trim();x&&r.set(x,u)});for(const m of dr)r.has(m)||o.push({line:1,message:`Missing required column: "${m}"`});for(const m of n){const u=m.toLowerCase().trim();u&&!mr.includes(u)&&o.push({line:1,message:`Unknown column "${m}" will be ignored`})}if(!r.has("id")||!r.has("title"))return{items:[],warnings:o,skipped:0};const l=(m,u)=>{const x=r.get(u);return typeof x=="number"?m[x]??"":""},a=[],i=new Set;let d=0;for(let m=1;m<e.length;m+=1){const u=ms(e[m]??""),x=l(u,"id").trim(),p=l(u,"title").trim();if(!x){o.push({line:m+1,message:"Missing id — row skipped"}),d+=1;continue}if(!p){o.push({line:m+1,message:`Missing title for id="${x}" — row skipped`}),d+=1;continue}if(i.has(x)){o.push({line:m+1,message:`Duplicate id="${x}" — row skipped`}),d+=1;continue}i.add(x);const h=l(u,"description").trim(),c=l(u,"remote_url").trim(),b=l(u,"remote_type").trim().toLowerCase()==="sse"?"sse":"http",k=ds(l(u,"tags")),S=ds(l(u,"categories")),y=l(u,"is_public").trim().toLowerCase(),f=y==="true"||y==="1"||y==="yes";a.push({id:x,title:p,description:h||null,is_public:f,_meta:{"mcp.mesh":{...k.length>0?{tags:k}:{},...S.length>0?{categories:S}:{}}},server:{name:x,title:p,description:h||void 0,remotes:c?[{type:b,url:c}]:[]}})}return{items:a,warnings:o,skipped:d}}const xr=`id,title,description,remote_url,remote_type,tags,categories,is_public
1
+ import{r as I,c as X,u as de,x as Le,c3 as Ke,j as t,B as G,y as ee,w as H,cj as pn,a as fn,i as gn}from"./index-SkQC2bL2.js";import{i as it}from"./CheckCircle-B4pYO1ZS.js";import{n as jn}from"./Container-De-pv4QL.js";import{t as vn}from"./Settings01-Bl2wNagM.js";import{u as Fe}from"./useQuery-CtOvMPbo.js";import{u as Ce}from"./useMutation-CXgAMvoC.js";import{a as pe,u as he,f as gs}from"./constants-BZUBXkLq.js";import{u as js}from"./useInfiniteQuery-BXEdoCXW.js";import{B as F}from"./badge-C7XTRm7k.js";import{I as xe}from"./input-C4xXFdLa.js";import{a as Tt,c as Ee,D as It,b as Mt,g as rs,l as is,h as bn}from"./dropdown-menu-V8gWmDzD.js";import{T as vs,a as bs,b as Pt,c as Ie,d as ys,e as Me}from"./table-c-SrSmwK.js";import{T as yn,a as ls}from"./toggle-group-abCGptw4.js";import{u as Nn}from"./use-view-mode-Ag3VBJ77.js";import{i as Ht}from"./DotsVertical-ZWNLrGdE.js";import{i as wn}from"./FilterLines-B4Jg_hkv.js";import{i as Ns}from"./Globe01-BAfb6FiF.js";import{i as et}from"./Loading01-CDOurw-F.js";import{i as ws}from"./SearchMd-D6jy19cO.js";import{b as Et,D as Dt,a as $t,e as At,c as Lt,d as Ot}from"./dialog-PlqYdiap.js";import{i as xt}from"./AlertCircle-Bu9DNwe-.js";import{n as Cn}from"./Download01-D_QoltgV.js";import{i as as}from"./Upload01-DvtQC2yf.js";import{c as ht,b as pt,d as ft,A as gt,h as jt,e as vt,a as bt,f as yt}from"./alert-dialog-DfOenbUZ.js";import{C as oe}from"./card-Cm-keK-z.js";import{i as os}from"./CheckVerified02-BTUqey_K.js";import{s as wt}from"./Trash01-DhGTBhjv.js";import{L as re}from"./label-B5UIAzjB.js";import{S as Cs,a as _s,b as ks,c as Ss,d as Rt}from"./select-Bqr12jkn.js";import{S as Xe}from"./switch-BIAgKxiJ.js";import{T as zt}from"./textarea-Buug1Hxe.js";import{i as _n}from"./ArrowLeft-BLUY3Pjw.js";import{i as kn,u as Qt,t as Sn}from"./use-copy-F9tiQWTi.js";import{s as Wt}from"./RefreshCcw01-QnfLSKau.js";import{i as Rn}from"./X-DVxsAMCH.js";import{i as Tn}from"./Link01-CBvOA17k.js";import{t as Rs}from"./ChevronDown-BURkaeCD.js";import{n as In}from"./ChevronUp-Ql_IhfwF.js";import{C as Mn}from"./checkbox-B92JdB3t.js";import{s as Ts}from"./Eye-CUyEl5IU.js";import{n as Pn}from"./LinkExternal01-v1Fp9c9j.js";import{i as En}from"./XCircle-l3Ck-71_.js";import{e as Is}from"./use-collections-C3CSj681.js";import{b as Ms}from"./use-connection-DSkVzqSP.js";import{b as Dn,P as $n,a as An}from"./popover-U_QlVu0r.js";import{i as Vt}from"./Check-CN56KhoF.js";import{a as Kt}from"./Copy01-E3kqWO3T.js";import{i as Ln}from"./EyeOff-D3iBtnD1.js";import{i as On,a as zn}from"./Save01-Df_qJsfN.js";import{i as Un}from"./Key01-Bfc7gsTd.js";import{s as qn}from"./Plus-OTc7Ql1V.js";import{a as Fn,b as Bn,T as Gn}from"./tooltip-Ckpai_jH.js";import{i as Qn}from"./Play-DSE8IZVS.js";import"./infiniteQueryObserver-dFlgfKVl.js";import"./ChevronRight-Df5oEIdG.js";import"./use-mobile-DqlomLIB.js";import"./index-AtuNXtl1.js";const Ps=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M12.5 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H17c.93 0 1.395 0 1.776-.102a3 3 0 0 0 2.122-2.122C21 18.395 21 17.93 21 17m-2-9V2m-3 3h6M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm4.49 3.418-8.459 7.69c-.476.433-.714.649-.735.836a.5.5 0 0 0 .167.431C6.105 21 6.426 21 7.07 21h9.387c1.44 0 2.159 0 2.724-.242a3 3 0 0 0 1.578-1.578c.242-.565.242-1.285.242-2.724 0-.484 0-.726-.053-.952a2.001 2.001 0 0 0-.374-.778c-.143-.182-.332-.333-.71-.636l-2.797-2.237c-.379-.303-.568-.454-.776-.508a1 1 0 0 0-.557.018c-.205.066-.384.23-.743.555Z"}));Ps.displayName="ImagePlus";const Es=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}),I.createElement("path",{d:"M8 9.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 8 9.04 8 9.6 8h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 8.76 16 9.04 16 9.6v4.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C15.24 16 14.96 16 14.4 16H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 15.24 8 14.96 8 14.4V9.6Z"}));Es.displayName="StopSquare";const Jt=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"m6 6 4.5 4.5M6 6H3L2 3l1-1 3 1v3Zm13.259-3.259-2.628 2.628c-.396.396-.594.594-.668.822a1 1 0 0 0 0 .618c.074.228.272.426.668.822l.238.238c.396.396.594.594.822.668a1 1 0 0 0 .618 0c.228-.074.426-.272.822-.668L21.59 5.41a5.5 5.5 0 0 1-6.16 7.485c-.485-.096-.729-.144-.876-.13a.836.836 0 0 0-.373.114c-.13.07-.261.201-.523.463L6.5 20.5a2.121 2.121 0 0 1-3-3l7.157-7.157c.262-.262.393-.393.463-.524a.836.836 0 0 0 .113-.372c.015-.148-.033-.39-.129-.877a5.5 5.5 0 0 1 8.155-5.83ZM12 15l5.5 5.5a2.121 2.121 0 0 0 3-3l-4.525-4.525a5.475 5.475 0 0 1-.934-.17c-.39-.107-.816-.03-1.101.255L12 15Z"}));Jt.displayName="Tool02";const W={all:["private-registry"],items:()=>[...W.all,"items"],itemsList:(s,e,n,r)=>[...W.items(),"list",{search:s,tags:e,categories:n,limit:r}],item:s=>[...W.items(),"item",s],filters:()=>[...W.all,"filters"],registryConfig:()=>[...W.all,"registry-config"],registryConfigByPlugin:(s,e)=>[...W.registryConfig(),s,e],publishRequests:()=>[...W.all,"publish-requests"],publishRequestsByOrg:s=>[...W.publishRequests(),"org",s],publishRequestsList:(s,e,n)=>[...W.publishRequests(),"list",{status:s??"all",sortBy:e??"created_at",sortDirection:n??"desc"}],publishRequestsListByOrg:(s,e,n,r)=>[...W.publishRequestsByOrg(s),"list",{status:e??"all",sortBy:n??"created_at",sortDirection:r??"desc"}],publishRequestsCount:()=>[...W.publishRequests(),"count"],publishRequestsCountByOrg:s=>[...W.publishRequestsByOrg(s),"count"],publishApiKeys:()=>[...W.all,"publish-api-keys"],monitor:()=>[...W.all,"monitor"],monitorRuns:()=>[...W.monitor(),"runs"],monitorRunsList:s=>[...W.monitorRuns(),"list",{status:s??"all"}],monitorRun:s=>[...W.monitorRuns(),"run",s??"none"],monitorResults:()=>[...W.monitor(),"results"],monitorResultsList:(s,e)=>[...W.monitorResults(),"list",{runId:s??"none",status:e??"all"}],monitorConnections:()=>[...W.monitor(),"connections"],monitorConnectionAuthProbe:s=>[...W.monitorConnections(),"auth-probe",s]};async function Pe(s,e,n){const r=await s.callTool({name:e,arguments:n});if(!r||typeof r!="object")throw new Error(`Invalid tool response for ${e}`);if(r.isError){const o=r.content?.find(l=>l.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return r.structuredContent??r}function Vn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_RUN_START",{config:d}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.monitorRuns()}),e.invalidateQueries({queryKey:W.monitorResults()})])},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Kn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_RUN_CANCEL",{runId:d}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async(d,m)=>{await Promise.all([e.invalidateQueries({queryKey:W.monitorRuns()}),e.invalidateQueries({queryKey:W.monitorRun(m)})])},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Ut(s){const e=X.c(10),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l;e[2]!==s?(l=W.monitorRunsList(s),e[2]=s,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==s?(a=async()=>Pe(o,"REGISTRY_MONITOR_RUN_LIST",{status:s,limit:100}),e[4]=o,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==l||e[8]!==a?(i={queryKey:l,queryFn:a,staleTime:5e3},e[7]=l,e[8]=a,e[9]=i):i=e[9],Fe(i)}function Zt(s){const e=X.c(11),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l;e[2]!==s?(l=W.monitorRun(s),e[2]=s,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==s?(a=async()=>Pe(o,"REGISTRY_MONITOR_RUN_GET",{runId:s}),e[4]=o,e[5]=s,e[6]=a):a=e[6];const i=!!s;let d;return e[7]!==l||e[8]!==a||e[9]!==i?(d={queryKey:l,queryFn:a,enabled:i,refetchInterval:Yn},e[7]=l,e[8]=a,e[9]=i,e[10]=d):d=e[10],Fe(d)}function Yn(s){return s.state.data?.run?.status==="running"?5e3:!1}function Ct(s,e,n){const r=X.c(14),{org:o}=de();let l;r[0]!==o.id?(l={connectionId:pe,orgId:o.id},r[0]=o.id,r[1]=l):l=r[1];const a=he(l);let i;r[2]!==s||r[3]!==e?(i=W.monitorResultsList(s,e),r[2]=s,r[3]=e,r[4]=i):i=r[4];let d;r[5]!==a||r[6]!==s||r[7]!==e?(d=async()=>Pe(a,"REGISTRY_MONITOR_RESULT_LIST",{runId:s,status:e,limit:200,offset:0}),r[5]=a,r[6]=s,r[7]=e,r[8]=d):d=r[8];const m=!!s,u=n==="running"?2500:!1;let x;return r[9]!==i||r[10]!==d||r[11]!==m||r[12]!==u?(x={queryKey:i,queryFn:d,enabled:m,staleTime:5e3,refetchInterval:u},r[9]=i,r[10]=d,r[11]=m,r[12]=u,r[13]=x):x=r[13],Fe(x)}function Ds(){const s=X.c(5),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=W.monitorConnections(),s[2]=o):o=s[2];let l;return s[3]!==r?(l={queryKey:o,queryFn:async()=>Pe(r,"REGISTRY_MONITOR_CONNECTION_LIST",{}),staleTime:1e4},s[3]=r,s[4]=l):l=s[4],Fe(l)}function Hn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async()=>Pe(o,"REGISTRY_MONITOR_CONNECTION_SYNC",{}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.monitorConnections()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Wn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>{const{connectionId:m,authStatus:u}=d;return Pe(o,"REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH",{connectionId:m,authStatus:u})},s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.monitorConnections()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}const cs={monitorMode:"health_check",onFailure:"none",schedule:"manual",cronExpression:"",scheduleEventId:"",perMcpTimeoutMs:3e4,perToolTimeoutMs:1e4,maxAgentSteps:15,testPublicOnly:!1,testPrivateOnly:!1,includePendingRequests:!1,agentContext:"",llmConnectionId:"",llmModelId:""};function $s(){const s=X.c(33),{org:e,project:n}=de();let r;s[0]!==e.id?(r={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=r):r=s[1];const o=he(r),l=Le();let a;s[2]!==n.id?(a=W.registryConfigByPlugin(n.id??"",Ke),s[2]=n.id,s[3]=a):a=s[3];let i;s[4]!==o||s[5]!==n.id?(i=async()=>Pe(o,"PROJECT_PLUGIN_CONFIG_GET",{projectId:n.id,pluginId:Ke}),s[4]=o,s[5]=n.id,s[6]=i):i=s[6];const d=!!n.id;let m;s[7]!==a||s[8]!==i||s[9]!==d?(m={queryKey:a,queryFn:i,enabled:d},s[7]=a,s[8]=i,s[9]=d,s[10]=m):m=s[10];const u=Fe(m),x=u.data?.config?.settings,p=x&&typeof x=="object"?x.testConfig:void 0,c=typeof(x?x.monitorMode??x.testMode:void 0)=="string";let v;s[11]!==p?(v=p??{},s[11]=p,s[12]=v):v=s[12];let b;s[13]!==c||s[14]!==x||s[15]!==p?(b=c&&!p?x:{},s[13]=c,s[14]=x,s[15]=p,s[16]=b):b=s[16];let k;s[17]!==v||s[18]!==b?(k={...cs,...v,...b},s[17]=v,s[18]=b,s[19]=k):k=s[19];const S=k;let y;s[20]!==o||s[21]!==n.id?(y=async R=>{const C=(await Pe(o,"PROJECT_PLUGIN_CONFIG_GET",{projectId:n.id,pluginId:Ke}))?.config?.settings??{};return Pe(o,"PROJECT_PLUGIN_CONFIG_UPDATE",{projectId:n.id,pluginId:Ke,settings:{...C,testConfig:{...cs,...C.testConfig??{},...R}}})},s[20]=o,s[21]=n.id,s[22]=y):y=s[22];let f;s[23]!==n.id||s[24]!==l?(f=async()=>{await l.invalidateQueries({queryKey:W.registryConfigByPlugin(n.id??"",Ke)})},s[23]=n.id,s[24]=l,s[25]=f):f=s[25];let M;s[26]!==y||s[27]!==f?(M={mutationFn:y,onSuccess:f},s[26]=y,s[27]=f,s[28]=M):M=s[28];const g=Ce(M);let w;return s[29]!==u.isLoading||s[30]!==g||s[31]!==S?(w={settings:S,isLoading:u.isLoading,saveMutation:g},s[29]=u.isLoading,s[30]=g,s[31]=S,s[32]=w):w=s[32],w}function Jn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_SCHEDULE_SET",d),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.registryConfig()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Zn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_SCHEDULE_CANCEL",{scheduleEventId:d}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.registryConfig()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Xn(){const s=X.c(3),e=Ut("completed"),n=e.data?.items?.[0]?.id,r=e.data?.items?.[0]?.status,o=Ct(n,"failed",r),l=o.data?.items?.length??0,a=e.isLoading||o.isLoading;let i;return s[0]!==l||s[1]!==a?(i={brokenCount:l,isLoading:a},s[0]=l,s[1]=a,s[2]=i):i=s[2],i}const As=24;function er(s){return s.trim()}async function _e(s,e,n){const r=await s.callTool({name:e,arguments:n});if(!r||typeof r!="object")throw new Error(`Invalid tool response for ${e}`);if(r.isError){const o=r.content?.find(l=>l.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return r.structuredContent??r}function Ls(s){const e=X.c(19),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l,a,i,d;e[2]!==s.categories||e[3]!==s.limit||e[4]!==s.search||e[5]!==s.tags?(a=er(s.search),l=s.limit??As,d=js,i=W.itemsList(a,s.tags,s.categories,l),e[2]=s.categories,e[3]=s.limit,e[4]=s.search,e[5]=s.tags,e[6]=l,e[7]=a,e[8]=i,e[9]=d):(l=e[6],a=e[7],i=e[8],d=e[9]);let m;e[10]!==o||e[11]!==l||e[12]!==s.categories||e[13]!==s.tags||e[14]!==a?(m=async x=>{const{pageParam:p}=x,h=a.length>0?{operator:"or",conditions:[{field:["title"],operator:"contains",value:a},{field:["description"],operator:"contains",value:a},{field:["id"],operator:"contains",value:a},{field:["server","name"],operator:"contains",value:a}]}:void 0;return _e(o,"REGISTRY_ITEM_LIST",{cursor:p,limit:l,tags:s.tags.length?s.tags:void 0,categories:s.categories.length?s.categories:void 0,where:h})},e[10]=o,e[11]=l,e[12]=s.categories,e[13]=s.tags,e[14]=a,e[15]=m):m=e[15];let u;return e[16]!==i||e[17]!==m?(u={queryKey:i,queryFn:m,initialPageParam:void 0,getNextPageParam:tr,staleTime:3e4},e[16]=i,e[17]=m,e[18]=u):u=e[18],d(u)}function tr(s){return s.nextCursor}function sr(){const s=X.c(8),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=W.filters(),s[2]=o):o=s[2];let l;s[3]!==r?(l=async()=>_e(r,"REGISTRY_ITEM_FILTERS",{}),s[3]=r,s[4]=l):l=s[4];let a;s[5]===Symbol.for("react.memo_cache_sentinel")?(a={tags:[],categories:[]},s[5]=a):a=s[5];let i;return s[6]!==l?(i={queryKey:o,queryFn:l,placeholderData:a,staleTime:6e4},s[6]=l,s[7]=i):i=s[7],Fe(i)}function Xt(){const s=X.c(29),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==e?(l=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.items()}),e.invalidateQueries({queryKey:W.filters()})])},s[2]=e,s[3]=l):l=s[3];const a=l;let i;s[4]!==o?(i=async f=>(await _e(o,"REGISTRY_ITEM_CREATE",{data:f})).item,s[4]=o,s[5]=i):i=s[5];let d;s[6]!==a||s[7]!==i?(d={mutationFn:i,onSuccess:a},s[6]=a,s[7]=i,s[8]=d):d=s[8];const m=Ce(d);let u;s[9]!==o?(u=async f=>{const{id:M,data:g}=f;return(await _e(o,"REGISTRY_ITEM_UPDATE",{id:M,data:g})).item},s[9]=o,s[10]=u):u=s[10];let x;s[11]!==a||s[12]!==u?(x={mutationFn:u,onSuccess:a},s[11]=a,s[12]=u,s[13]=x):x=s[13];const p=Ce(x);let h;s[14]!==o?(h=async f=>(await _e(o,"REGISTRY_ITEM_DELETE",{id:f})).item,s[14]=o,s[15]=h):h=s[15];let c;s[16]!==a||s[17]!==h?(c={mutationFn:h,onSuccess:a},s[16]=a,s[17]=h,s[18]=c):c=s[18];const v=Ce(c);let b;s[19]!==o?(b=async f=>_e(o,"REGISTRY_ITEM_BULK_CREATE",{items:f}),s[19]=o,s[20]=b):b=s[20];let k;s[21]!==a||s[22]!==b?(k={mutationFn:b,onSuccess:a},s[21]=a,s[22]=b,s[23]=k):k=s[23];const S=Ce(k);let y;return s[24]!==S||s[25]!==m||s[26]!==v||s[27]!==p?(y={createMutation:m,updateMutation:p,deleteMutation:v,bulkCreateMutation:S},s[24]=S,s[25]=m,s[26]=v,s[27]=p,s[28]=y):y=s[28],y}function qt(s){const e=X.c(37),{org:n,project:r}=de();let o;e[0]!==n.id?(o={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=o):o=e[1];const l=he(o),a=Le();let i;e[2]!==s||e[3]!==r.id?(i=W.registryConfigByPlugin(r.id??"",s),e[2]=s,e[3]=r.id,e[4]=i):i=e[4];let d;e[5]!==l||e[6]!==s||e[7]!==r.id?(d=async()=>_e(l,"PROJECT_PLUGIN_CONFIG_GET",{projectId:r.id,pluginId:s}),e[5]=l,e[6]=s,e[7]=r.id,e[8]=d):d=e[8];const m=!!r.id;let u;e[9]!==i||e[10]!==d||e[11]!==m?(u={queryKey:i,queryFn:d,enabled:m,staleTime:6e4},e[9]=i,e[10]=d,e[11]=m,e[12]=u):u=e[12];const x=Fe(u);let p;e[13]!==l||e[14]!==s||e[15]!==r.id?(p=async A=>{const P=(await _e(l,"PROJECT_PLUGIN_CONFIG_GET",{projectId:r.id,pluginId:s}))?.config?.settings??{};return _e(l,"PROJECT_PLUGIN_CONFIG_UPDATE",{projectId:r.id,pluginId:s,settings:{...P,...A}})},e[13]=l,e[14]=s,e[15]=r.id,e[16]=p):p=e[16];let h;e[17]!==s||e[18]!==r.id||e[19]!==a?(h=async()=>{await a.invalidateQueries({queryKey:W.registryConfigByPlugin(r.id??"",s)})},e[17]=s,e[18]=r.id,e[19]=a,e[20]=h):h=e[20];let c;e[21]!==p||e[22]!==h?(c={mutationFn:p,onSuccess:h},e[21]=p,e[22]=h,e[23]=c):c=e[23];const v=Ce(c),b=x.data?.config?.settings?.registryName??"Private Registry",k=x.data?.config?.settings?.registryIcon??"",S=x.data?.config?.settings?.llmConnectionId??"",y=x.data?.config?.settings?.llmModelId??"",f=x.data?.config?.settings?.acceptPublishRequests??!1,M=x.data?.config?.settings?.requireApiToken??!1,g=x.data?.config?.settings?.storePrivateOnly??!1,w=x.data?.config?.settings?.rateLimitEnabled??!0,E=x.data?.config?.settings?.rateLimitWindow==="minute"?"minute":"hour",C=x.data?.config?.settings?.rateLimitMax,T=typeof C=="number"&&C>=1?Math.floor(C):100;let N;return e[24]!==f||e[25]!==x.isLoading||e[26]!==w||e[27]!==T||e[28]!==E||e[29]!==k||e[30]!==S||e[31]!==y||e[32]!==b||e[33]!==M||e[34]!==v||e[35]!==g?(N={registryName:b,registryIcon:k,registryLLMConnectionId:S,registryLLMModelId:y,acceptPublishRequests:f,requireApiToken:M,storePrivateOnly:g,rateLimitEnabled:w,rateLimitWindow:E,rateLimitMax:T,isLoadingConfig:x.isLoading,saveRegistryConfigMutation:v},e[24]=f,e[25]=x.isLoading,e[26]=w,e[27]=T,e[28]=E,e[29]=k,e[30]=S,e[31]=y,e[32]=b,e[33]=M,e[34]=v,e[35]=g,e[36]=N):N=e[36],N}function nr(s){const e=X.c(15),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l;e[2]!==n.id||e[3]!==s.sortBy||e[4]!==s.sortDirection||e[5]!==s.status?(l=W.publishRequestsListByOrg(n.id,s.status,s.sortBy,s.sortDirection),e[2]=n.id,e[3]=s.sortBy,e[4]=s.sortDirection,e[5]=s.status,e[6]=l):l=e[6];let a;e[7]!==o||e[8]!==s.sortBy||e[9]!==s.sortDirection||e[10]!==s.status?(a=async d=>{const{pageParam:m}=d;return _e(o,"REGISTRY_PUBLISH_REQUEST_LIST",{status:s.status,sortBy:s.sortBy,sortDirection:s.sortDirection,limit:As,offset:m})},e[7]=o,e[8]=s.sortBy,e[9]=s.sortDirection,e[10]=s.status,e[11]=a):a=e[11];let i;return e[12]!==l||e[13]!==a?(i={queryKey:l,queryFn:a,initialPageParam:0,getNextPageParam:rr,staleTime:3e4,refetchOnMount:!0},e[12]=l,e[13]=a,e[14]=i):i=e[14],js(i)}function rr(s,e){const n=e.reduce(ir,0);return n<s.totalCount?n:void 0}function ir(s,e){return s+e.items.length}function lr(){const s=X.c(9),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]!==e.id?(o=W.publishRequestsCountByOrg(e.id),s[2]=e.id,s[3]=o):o=s[3];let l;s[4]!==r?(l=async()=>_e(r,"REGISTRY_PUBLISH_REQUEST_COUNT",{}),s[4]=r,s[5]=l):l=s[5];let a;return s[6]!==o||s[7]!==l?(a={queryKey:o,queryFn:l,staleTime:3e4},s[6]=o,s[7]=l,s[8]=a):a=s[8],Fe(a)}function ar(){const s=X.c(17),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==e?(l=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.publishRequests()})])},s[2]=e,s[3]=l):l=s[3];const a=l;let i;s[4]!==o?(i=async c=>_e(o,"REGISTRY_PUBLISH_REQUEST_REVIEW",c),s[4]=o,s[5]=i):i=s[5];let d;s[6]!==a||s[7]!==i?(d={mutationFn:i,onSuccess:a},s[6]=a,s[7]=i,s[8]=d):d=s[8];const m=Ce(d);let u;s[9]!==o?(u=async c=>_e(o,"REGISTRY_PUBLISH_REQUEST_DELETE",{id:c}),s[9]=o,s[10]=u):u=s[10];let x;s[11]!==a||s[12]!==u?(x={mutationFn:u,onSuccess:a},s[11]=a,s[12]=u,s[13]=x):x=s[13];const p=Ce(x);let h;return s[14]!==p||s[15]!==m?(h={reviewMutation:m,deleteMutation:p},s[14]=p,s[15]=m,s[16]=h):h=s[16],h}function or(){const s=X.c(5),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=W.publishApiKeys(),s[2]=o):o=s[2];let l;return s[3]!==r?(l={queryKey:o,queryFn:async()=>_e(r,"REGISTRY_PUBLISH_API_KEY_LIST",{}),staleTime:3e4},s[3]=r,s[4]=l):l=s[4],Fe(l)}function cr(){const s=X.c(19),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async c=>_e(o,"REGISTRY_PUBLISH_API_KEY_GENERATE",{name:c}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.publishApiKeys()})},s[4]=e,s[5]=a):a=s[5];let i;s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8];const d=Ce(i);let m;s[9]!==o?(m=async c=>_e(o,"REGISTRY_PUBLISH_API_KEY_REVOKE",{keyId:c}),s[9]=o,s[10]=m):m=s[10];let u;s[11]!==e?(u=async()=>{await e.invalidateQueries({queryKey:W.publishApiKeys()})},s[11]=e,s[12]=u):u=s[12];let x;s[13]!==m||s[14]!==u?(x={mutationFn:m,onSuccess:u},s[13]=m,s[14]=u,s[15]=x):x=s[15];const p=Ce(x);let h;return s[16]!==d||s[17]!==p?(h={generateMutation:d,revokeMutation:p},s[16]=d,s[17]=p,s[18]=h):h=s[18],h}function ds(s){return s?s.split(/[;|]/).map(e=>e.trim()).filter(Boolean):[]}function ms(s){const e=[];let n="",r=!1;for(let o=0;o<s.length;o+=1){const l=s[o],a=s[o+1];if(l==='"'){r&&a==='"'?(n+='"',o+=1):r=!r;continue}if(l===","&&!r){e.push(n.trim()),n="";continue}n+=l}return e.push(n.trim()),e}const dr=["id","title"],mr=["id","title","description","remote_url","remote_type","tags","categories","is_public"];function ur(s){const e=s.split(/\r?\n/).map(m=>m.trim()).filter(Boolean);if(e.length<2)return{items:[],warnings:[{line:0,message:"CSV must have a header row and at least one data row"}],skipped:0};const n=ms(e[0]??""),r=new Map,o=[];n.forEach((m,u)=>{const x=m.toLowerCase().trim();x&&r.set(x,u)});for(const m of dr)r.has(m)||o.push({line:1,message:`Missing required column: "${m}"`});for(const m of n){const u=m.toLowerCase().trim();u&&!mr.includes(u)&&o.push({line:1,message:`Unknown column "${m}" will be ignored`})}if(!r.has("id")||!r.has("title"))return{items:[],warnings:o,skipped:0};const l=(m,u)=>{const x=r.get(u);return typeof x=="number"?m[x]??"":""},a=[],i=new Set;let d=0;for(let m=1;m<e.length;m+=1){const u=ms(e[m]??""),x=l(u,"id").trim(),p=l(u,"title").trim();if(!x){o.push({line:m+1,message:"Missing id — row skipped"}),d+=1;continue}if(!p){o.push({line:m+1,message:`Missing title for id="${x}" — row skipped`}),d+=1;continue}if(i.has(x)){o.push({line:m+1,message:`Duplicate id="${x}" — row skipped`}),d+=1;continue}i.add(x);const h=l(u,"description").trim(),c=l(u,"remote_url").trim(),b=l(u,"remote_type").trim().toLowerCase()==="sse"?"sse":"http",k=ds(l(u,"tags")),S=ds(l(u,"categories")),y=l(u,"is_public").trim().toLowerCase(),f=y==="true"||y==="1"||y==="yes";a.push({id:x,title:p,description:h||null,is_public:f,_meta:{"mcp.mesh":{...k.length>0?{tags:k}:{},...S.length>0?{categories:S}:{}}},server:{name:x,title:p,description:h||void 0,remotes:c?[{type:b,url:c}]:[]}})}return{items:a,warnings:o,skipped:d}}const xr=`id,title,description,remote_url,remote_type,tags,categories,is_public
2
2
  my-mcp-server,My MCP Server,A useful MCP server,https://example.com/mcp,http,ai|tools,productivity,true
3
3
  another-server,Another Server,Another useful server,https://example2.com/mcp,http,data|analytics,data-processing,false`;function hr(){const s=new Blob([xr],{type:"text/csv;charset=utf-8"}),e=URL.createObjectURL(s),n=document.createElement("a");n.href=e,n.download="registry-import-template.csv",n.click(),URL.revokeObjectURL(e)}function pr(s){const e=X.c(63),{open:n,onOpenChange:r,isImporting:o,onImport:l}=s,a=o===void 0?!1:o,[i,d]=I.useState(null),[m,u]=I.useState(null),[x,p]=I.useState(null),h=I.useRef(null);let c;e[0]!==r?(c=Z=>{r(Z),Z||(d(null),u(null),p(null),h.current&&(h.current.value=""))},e[0]=r,e[1]=c):c=e[1];const v=c;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=async Z=>{if(!Z)return;p(Z.name),u(null);const ce=await Z.text();d(ur(ce))},e[2]=b):b=e[2];const k=b;let S;e[3]!==l||e[4]!==i?(S=async()=>{if(!i?.items.length)return;const Z=await l(i.items);u(Z)},e[3]=l,e[4]=i,e[5]=S):S=e[5];const y=S;let f;e[6]!==i?.items?(f=i?.items??[],e[6]=i?.items,e[7]=f):f=e[7];const M=f;let g;e[8]!==i?.warnings?(g=i?.warnings??[],e[8]=i?.warnings,e[9]=g):g=e[9];const w=g;let R;e[10]!==w?(R=w.some(vr),e[10]=w,e[11]=R):R=e[11];const E=R,C=m!==null;let T;e[12]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsxs(Et,{children:[t.jsx(Dt,{children:"Import MCP Servers from CSV"}),t.jsx($t,{children:"Upload a CSV file to bulk-import MCP servers into the registry."})]}),e[12]=T):T=e[12];let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=()=>h.current?.click(),e[13]=N):N=e[13];let A;e[14]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(as,{size:14}),e[14]=A):A=e[14];const L=x?"Change file":"Choose CSV file";let P;e[15]!==a||e[16]!==L?(P=t.jsxs(G,{variant:"outline",size:"sm",className:"gap-1.5",onClick:N,disabled:a,children:[A,L]}),e[15]=a,e[16]=L,e[17]=P):P=e[17];let D;e[18]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("input",{ref:h,type:"file",accept:".csv,text/csv",className:"hidden",onChange:Z=>k(Z.target.files?.[0]??null)}),e[18]=D):D=e[18];let $;e[19]!==x?($=x&&t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:x}),e[19]=x,e[20]=$):$=e[20];let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"flex-1"}),e[21]=z):z=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(G,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-muted-foreground",onClick:hr,children:[t.jsx(Cn,{size:14}),"Download template"]}),e[22]=O):O=e[22];let B;e[23]!==P||e[24]!==$?(B=t.jsxs("div",{className:"flex items-center gap-3",children:[P,D,$,z,O]}),e[23]=P,e[24]=$,e[25]=B):B=e[25];let Q;e[26]!==w?(Q=w.length>0&&t.jsx("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 dark:border-yellow-900 dark:bg-yellow-950/30 p-3 grid gap-1",children:w.map(jr)}),e[26]=w,e[27]=Q):Q=e[27];let j;e[28]!==M||e[29]!==i?(j=M.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium",children:"Preview"}),t.jsxs(F,{variant:"secondary",children:[M.length," items"]}),i?.skipped?t.jsxs(F,{variant:"outline",className:"text-yellow-600",children:[i.skipped," skipped"]}):null]}),t.jsx("div",{className:"border rounded-lg overflow-hidden",children:t.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:t.jsxs(vs,{children:[t.jsx(bs,{children:t.jsxs(Pt,{children:[t.jsx(Ie,{className:"w-[140px]",children:"ID"}),t.jsx(Ie,{children:"Title"}),t.jsx(Ie,{children:"Remote URL"}),t.jsx(Ie,{className:"w-[80px] text-center",children:"Public"}),t.jsx(Ie,{children:"Tags"})]})}),t.jsx(ys,{children:M.map(gr)})]})})})]}),e[28]=M,e[29]=i,e[30]=j):j=e[30];let U;e[31]!==m?(U=m&&t.jsxs("div",{className:"rounded-lg border p-3 grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[t.jsx(it,{size:16,className:"text-emerald-600"}),"Imported ",m.created," item(s) successfully"]}),m.errors.length>0&&t.jsx("div",{className:"grid gap-1 mt-1",children:m.errors.map(fr)})]}),e[31]=m,e[32]=U):U=e[32];let K;e[33]!==C||e[34]!==i?(K=!i&&!C&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[t.jsx(as,{size:32,className:"text-muted-foreground/40 mb-3"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a CSV file or download the template to get started."}),t.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Required columns: ",t.jsx("code",{children:"id"}),", ",t.jsx("code",{children:"title"}),". Optional:"," ",t.jsx("code",{children:"description"}),", ",t.jsx("code",{children:"remote_url"}),","," ",t.jsx("code",{children:"remote_type"}),", ",t.jsx("code",{children:"tags"}),","," ",t.jsx("code",{children:"categories"}),", ",t.jsx("code",{children:"is_public"}),"."]}),t.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Use ",t.jsx("code",{children:"|"})," or ",t.jsx("code",{children:";"})," to separate multiple tags/categories within a cell."]})]}),e[33]=C,e[34]=i,e[35]=K):K=e[35];let te;e[36]!==B||e[37]!==Q||e[38]!==j||e[39]!==U||e[40]!==K?(te=t.jsxs("div",{className:"flex-1 overflow-y-auto grid gap-4 pr-1",children:[B,Q,j,U,K]}),e[36]=B,e[37]=Q,e[38]=j,e[39]=U,e[40]=K,e[41]=te):te=e[41];let se;e[42]!==v?(se=()=>v(!1),e[42]=v,e[43]=se):se=e[43];const le=C?"Done":"Cancel";let ae;e[44]!==se||e[45]!==le?(ae=t.jsx(G,{variant:"outline",onClick:se,children:le}),e[44]=se,e[45]=le,e[46]=ae):ae=e[46];let me;e[47]!==y||e[48]!==E||e[49]!==C||e[50]!==a||e[51]!==M.length?(me=!C&&t.jsx(G,{onClick:y,disabled:a||M.length===0||E,children:a?"Importing...":`Import ${M.length} item(s)`}),e[47]=y,e[48]=E,e[49]=C,e[50]=a,e[51]=M.length,e[52]=me):me=e[52];let ue;e[53]!==ae||e[54]!==me?(ue=t.jsxs(At,{className:"gap-2 sm:gap-0",children:[ae,me]}),e[53]=ae,e[54]=me,e[55]=ue):ue=e[55];let _;e[56]!==te||e[57]!==ue?(_=t.jsxs(Lt,{className:"sm:max-w-3xl max-h-[85vh] flex flex-col",children:[T,te,ue]}),e[56]=te,e[57]=ue,e[58]=_):_=e[58];let J;return e[59]!==v||e[60]!==n||e[61]!==_?(J=t.jsx(Ot,{open:n,onOpenChange:v,children:_}),e[59]=v,e[60]=n,e[61]=_,e[62]=J):J=e[62],J}function fr(s){return t.jsxs("p",{className:"text-xs text-destructive flex items-start gap-1.5",children:[t.jsx(xt,{size:12,className:"shrink-0 mt-0.5"}),t.jsxs("span",{children:[t.jsx("span",{className:"font-mono",children:s.id}),": ",s.error]})]},s.id)}function gr(s){return t.jsxs(Pt,{children:[t.jsx(Me,{className:"font-mono text-xs",children:s.id}),t.jsx(Me,{className:"text-sm",children:s.title}),t.jsx(Me,{className:"text-xs text-muted-foreground max-w-[200px] truncate",children:s.server.remotes?.[0]?.url??t.jsx("span",{className:"italic",children:"none"})}),t.jsx(Me,{className:"text-center",children:s.is_public?t.jsx(F,{variant:"secondary",className:"text-[10px] bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400",children:"Yes"}):t.jsx("span",{className:"text-xs text-muted-foreground",children:"No"})}),t.jsx(Me,{className:"text-xs text-muted-foreground",children:(s._meta?.["mcp.mesh"]?.tags??[]).join(", ")||"-"})]},s.id)}function jr(s,e){return t.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-400 flex items-start gap-1.5",children:[t.jsx(xt,{size:12,className:"shrink-0 mt-0.5"}),t.jsxs("span",{children:[s.line>0&&t.jsxs("span",{className:"font-mono text-[10px] mr-1",children:["Line ",s.line,":"]}),s.message]})]},`${s.line}-${e}`)}function vr(s){return s.message.startsWith("Missing required column:")}function br(s){const e=X.c(19),{open:n,onOpenChange:r,title:o,isDeleting:l,onConfirm:a}=s,i=l===void 0?!1:l;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(ht,{children:"Delete registry item?"}),e[0]=d):d=e[0];let m;e[1]!==o?(m=t.jsxs(pt,{children:[d,t.jsxs(ft,{children:["This action cannot be undone. Item ",t.jsx("strong",{children:o})," will be permanently removed from this private registry."]})]}),e[1]=o,e[2]=m):m=e[2];let u;e[3]!==i?(u=t.jsx(gt,{disabled:i,children:"Cancel"}),e[3]=i,e[4]=u):u=e[4];const x=i?"Deleting...":"Delete";let p;e[5]!==i||e[6]!==a||e[7]!==x?(p=t.jsx(jt,{disabled:i,onClick:a,children:x}),e[5]=i,e[6]=a,e[7]=x,e[8]=p):p=e[8];let h;e[9]!==u||e[10]!==p?(h=t.jsxs(vt,{children:[u,p]}),e[9]=u,e[10]=p,e[11]=h):h=e[11];let c;e[12]!==m||e[13]!==h?(c=t.jsxs(bt,{children:[m,h]}),e[12]=m,e[13]=h,e[14]=c):c=e[14];let v;return e[15]!==r||e[16]!==n||e[17]!==c?(v=t.jsx(yt,{open:n,onOpenChange:r,children:c}),e[15]=r,e[16]=n,e[17]=c,e[18]=v):v=e[18],v}function yr(s){const[e]=s.id.split("/");return e??"provider"}function Nr(s){return s._meta?.["mcp.mesh"]?.tags??[]}function wr(s){return s._meta?.["mcp.mesh"]?.categories??[]}function Cr(s){return s.server?.icons?.[0]?.src??null}function _r(s){const e=X.c(77),{item:n,onEdit:r,onDelete:o,onToggleVerified:l,onToggleOfficial:a}=s;let i;e[0]!==n?(i=Cr(n),e[0]=n,e[1]=i):i=e[1];const d=i,m=n._meta?.["mcp.mesh"]?.verified===!0,u=n._meta?.["mcp.mesh"]?.official===!0;let x;e[2]!==n?(x=[...Nr(n),...wr(n)],e[2]=n,e[3]=x):x=e[3];const p=x;let h;e[4]!==p?(h=p.slice(0,3),e[4]=p,e[5]=h):h=e[5];const c=h,v=Math.max(0,p.length-c.length);let b;e[6]!==d||e[7]!==n.title?(b=t.jsx("div",{className:"size-10 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:d?t.jsx("img",{src:d,alt:n.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:n.title.charAt(0).toUpperCase()})}),e[6]=d,e[7]=n.title,e[8]=b):b=e[8];let k;e[9]!==n.title?(k=t.jsx("p",{className:"font-medium truncate",children:n.title}),e[9]=n.title,e[10]=k):k=e[10];let S;e[11]!==n?(S=yr(n),e[11]=n,e[12]=S):S=e[12];let y;e[13]!==S?(y=t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S}),e[13]=S,e[14]=y):y=e[14];let f;e[15]!==n.is_public?(f=n.is_public?t.jsxs(F,{variant:"default",className:"gap-1",children:[t.jsx(Ns,{size:10}),"Public"]}):t.jsx(F,{variant:"secondary",children:"Private"}),e[15]=n.is_public,e[16]=f):f=e[16];let M;e[17]!==u?(M=u&&t.jsxs(F,{variant:"outline",className:"gap-1 text-primary",children:[t.jsx(os,{size:10}),"Official"]}),e[17]=u,e[18]=M):M=e[18];let g;e[19]!==u||e[20]!==m?(g=!u&&m&&t.jsxs(F,{variant:"outline",className:"gap-1 text-success",children:[t.jsx(os,{size:10}),"Verified"]}),e[19]=u,e[20]=m,e[21]=g):g=e[21];let w;e[22]!==g||e[23]!==y||e[24]!==f||e[25]!==M?(w=t.jsxs("div",{className:"flex items-center gap-2",children:[y,f,M,g]}),e[22]=g,e[23]=y,e[24]=f,e[25]=M,e[26]=w):w=e[26];let R;e[27]!==w||e[28]!==k?(R=t.jsxs("div",{className:"min-w-0 flex-1",children:[k,w]}),e[27]=w,e[28]=k,e[29]=R):R=e[29];let E;e[30]!==R||e[31]!==b?(E=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[b,R]}),e[30]=R,e[31]=b,e[32]=E):E=e[32];let C;e[33]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Tt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:t.jsx(Ht,{size:18})})}),e[33]=C):C=e[33];let T;e[34]!==n||e[35]!==r?(T=t.jsx(Ee,{onClick:()=>r(n),children:"Edit"}),e[34]=n,e[35]=r,e[36]=T):T=e[36];let N;e[37]!==n||e[38]!==l?(N=()=>l(n),e[37]=n,e[38]=l,e[39]=N):N=e[39];const A=m?"Unmark as Verified":"Mark as Verified";let L;e[40]!==N||e[41]!==A?(L=t.jsx(Ee,{onClick:N,children:A}),e[40]=N,e[41]=A,e[42]=L):L=e[42];let P;e[43]!==n||e[44]!==a?(P=()=>a(n),e[43]=n,e[44]=a,e[45]=P):P=e[45];const D=u?"Unmark as Official":"Mark as Official";let $;e[46]!==P||e[47]!==D?($=t.jsx(Ee,{onClick:P,children:D}),e[46]=P,e[47]=D,e[48]=$):$=e[48];let z;e[49]!==n||e[50]!==o?(z=()=>o(n),e[49]=n,e[50]=o,e[51]=z):z=e[51];let O;e[52]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(wt,{size:14}),e[52]=O):O=e[52];let B;e[53]!==z?(B=t.jsxs(Ee,{variant:"destructive",onClick:z,children:[O,"Delete"]}),e[53]=z,e[54]=B):B=e[54];let Q;e[55]!==T||e[56]!==L||e[57]!==$||e[58]!==B?(Q=t.jsxs(It,{children:[C,t.jsxs(Mt,{align:"end",children:[T,L,$,B]})]}),e[55]=T,e[56]=L,e[57]=$,e[58]=B,e[59]=Q):Q=e[59];let j;e[60]!==E||e[61]!==Q?(j=t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[E,Q]}),e[60]=E,e[61]=Q,e[62]=j):j=e[62];const U=n._meta?.["mcp.mesh"]?.short_description||n.description||n.server.description||"No description provided.";let K;e[63]!==U?(K=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 min-h-10",children:U}),e[63]=U,e[64]=K):K=e[64];let te;e[65]!==n.id||e[66]!==c?(te=c.map(me=>t.jsx(F,{variant:"secondary",children:me},`${n.id}-badge-${me}`)),e[65]=n.id,e[66]=c,e[67]=te):te=e[67];let se;e[68]!==v?(se=v>0&&t.jsxs(F,{variant:"outline",children:["+",v]}),e[68]=v,e[69]=se):se=e[69];let le;e[70]!==te||e[71]!==se?(le=t.jsxs("div",{className:"flex flex-wrap gap-1",children:[te,se]}),e[70]=te,e[71]=se,e[72]=le):le=e[72];let ae;return e[73]!==j||e[74]!==K||e[75]!==le?(ae=t.jsxs(oe,{className:"p-4 gap-4 transition-colors hover:bg-muted/50",children:[j,K,le]}),e[73]=j,e[74]=K,e[75]=le,e[76]=ae):ae=e[76],ae}function Os(s){const e=X.c(27),{value:n,onChange:r,onFileUpload:o,error:l,isUploading:a}=s,i=a===void 0?!1:a,[d,m]=I.useState(!1),[u,x]=I.useState(!1),p=I.useRef(null);let h;e[0]!==i?(h=T=>{T.preventDefault(),i||m(!0)},e[0]=i,e[1]=h):h=e[1];const c=h;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=T=>{T.preventDefault(),m(!1)},e[2]=v):v=e[2];const b=v;let k;e[3]!==i||e[4]!==o?(k=async T=>{if(T.preventDefault(),m(!1),i)return;const N=T.dataTransfer.files[0];N&&await o(N)},e[3]=i,e[4]=o,e[5]=k):k=e[5];const S=k;let y;e[6]!==i||e[7]!==o?(y=async T=>{const N=T.target.files?.[0];N&&!i&&await o(N),T.target.value=""},e[6]=i,e[7]=o,e[8]=y):y=e[8];const f=y,M=n.length>0;let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(re,{children:"Image"}),e[9]=g):g=e[9];let w;e[10]!==c||e[11]!==S||e[12]!==M||e[13]!==d||e[14]!==i||e[15]!==r||e[16]!==u||e[17]!==n?(w=M?t.jsx("div",{className:"relative group min-h-[180px] rounded-xl border border-border overflow-hidden bg-muted/10",children:t.jsxs("div",{className:"flex items-center gap-3 p-3 h-full",children:[t.jsx("div",{className:"size-20 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:t.jsx("img",{src:n,alt:"Preview",className:"w-full h-full object-cover"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n}),t.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>p.current?.click(),disabled:i,children:[t.jsx(Wt,{className:"size-3"}),"Change"]}),t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 text-destructive hover:text-destructive",onClick:()=>{r(""),x(!1)},disabled:i,children:[t.jsx(wt,{className:"size-3"}),"Remove"]})]})]})]})}):i?t.jsxs("div",{className:"relative min-h-[180px] rounded-xl border border-border bg-muted/10 flex flex-col items-center justify-center gap-3",children:[t.jsx(et,{className:"size-8 animate-spin text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Uploading image..."})]}):t.jsxs("div",{className:ee("relative min-h-[180px] rounded-xl border-2 border-dashed transition-colors cursor-pointer flex flex-col",d?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/40 hover:bg-muted/30"),onDragOver:c,onDragLeave:b,onDrop:S,onClick:()=>p.current?.click(),children:[t.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-6 px-4 flex-1",children:[t.jsx("div",{className:ee("size-10 rounded-lg flex items-center justify-center transition-colors",d?"bg-primary/10 text-primary":"bg-muted/50 text-muted-foreground"),children:t.jsx(Ps,{size:20})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:d?"Drop image here":"Click or drag to upload"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"PNG, JPG, SVG up to 2MB"})]})]}),u?t.jsx("div",{className:"border-t border-border px-3 py-2",onClick:kr,children:t.jsx(xe,{placeholder:"https://example.com/logo.png",value:n,className:"text-xs h-8",onChange:T=>r(T.target.value)})}):t.jsx("div",{className:"border-t border-border px-4 py-2",children:t.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors w-full justify-center",onClick:T=>{T.stopPropagation(),x(!0)},children:[t.jsx(Tn,{className:"size-3"}),"Or paste an image URL"]})})]}),e[10]=c,e[11]=S,e[12]=M,e[13]=d,e[14]=i,e[15]=r,e[16]=u,e[17]=n,e[18]=w):w=e[18];let R;e[19]!==f?(R=t.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:f}),e[19]=f,e[20]=R):R=e[20];let E;e[21]!==l?(E=l&&t.jsx("p",{className:"text-xs text-destructive",children:l}),e[21]=l,e[22]=E):E=e[22];let C;return e[23]!==w||e[24]!==R||e[25]!==E?(C=t.jsxs("div",{className:"grid gap-1.5",children:[g,w,R,E]}),e[23]=w,e[24]=R,e[25]=E,e[26]=C):C=e[26],C}function kr(s){return s.stopPropagation()}function zs(){const[s,e]=I.useState("idle"),[n,r]=I.useState(null),{org:o}=de(),l=he({connectionId:pe,orgId:o.id});return{discover:async(d,m)=>{if(!d)return null;e("loading"),r(null);try{const u=await l.callTool({name:"REGISTRY_DISCOVER_TOOLS",arguments:{url:d,type:m==="sse"?"sse":"http"}}),x=u.structuredContent??u;if(u.isError){const p=u.content?.find(h=>h.type==="text")?.text??"Tool returned an error";return r(p),e("error"),null}return x.error?Sr(x.error)?(r(x.error),e("auth_required"),null):(r(x.error),e("error"),null):!x.tools||x.tools.length===0?(r("No tools found on this MCP server."),e("error"),null):(e("success"),x.tools)}catch(u){const x=u instanceof Error?u.message:String(u);return r(x||"Could not discover tools."),e("error"),null}},discoverStatus:s,discoverError:n,resetDiscover:()=>{e("idle"),r(null)}}}function Sr(s){const e=s.toLowerCase();return e.includes("authentication")||e.includes("unauthorized")||e.includes("credentials")}function Rr(s){const e=X.c(54),{tools:n,onChange:r,remoteUrl:o,remoteType:l,externalDiscoverStatus:a,externalDiscoverError:i}=s,[d,m]=I.useState(n.length>0),{discover:u,discoverStatus:x,discoverError:p,resetDiscover:h}=zs(),c=a??x,v=i??p;let b;e[0]!==u||e[1]!==r||e[2]!==l||e[3]!==o?(b=async()=>{if(!o)return;const O=await u(o,l??"http");O&&(r(O),m(!0))},e[0]=u,e[1]=r,e[2]=l,e[3]=o,e[4]=b):b=e[4];const k=b;let S;e[5]!==r||e[6]!==h?(S=()=>{r([]),h()},e[5]=r,e[6]=h,e[7]=S):S=e[7];const y=S;let f;e[8]!==d?(f=()=>m(!d),e[8]=d,e[9]=f):f=e[9];let M,g;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Jt,{size:14,className:"text-muted-foreground"}),g=t.jsx("span",{children:"Tools"}),e[10]=M,e[11]=g):(M=e[10],g=e[11]);let w;e[12]!==n.length?(w=n.length>0&&t.jsx(F,{variant:"secondary",className:"text-xs px-1.5 py-0",children:n.length}),e[12]=n.length,e[13]=w):w=e[13];let R;e[14]!==d?(R=d?t.jsx(In,{size:14,className:"text-muted-foreground"}):t.jsx(Rs,{size:14,className:"text-muted-foreground"}),e[14]=d,e[15]=R):R=e[15];let E;e[16]!==f||e[17]!==w||e[18]!==R?(E=t.jsxs("button",{type:"button",className:"flex items-center gap-2 text-sm font-medium cursor-pointer",onClick:f,children:[M,g,w,R]}),e[16]=f,e[17]=w,e[18]=R,e[19]=E):E=e[19];let C;e[20]!==y||e[21]!==n.length?(C=n.length>0&&t.jsxs(G,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 text-muted-foreground",onClick:y,children:[t.jsx(wt,{size:12}),"Clear"]}),e[20]=y,e[21]=n.length,e[22]=C):C=e[22];let T;e[23]!==c||e[24]!==k||e[25]!==o||e[26]!==n.length?(T=o&&t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 border-green-500/30 text-green-600 dark:text-green-400 shadow-[0_0_8px_rgba(34,197,94,0.3)] hover:shadow-[0_0_14px_rgba(34,197,94,0.5)] hover:border-green-500/50 transition-all",onClick:k,disabled:c==="loading",children:[c==="loading"?t.jsx(et,{size:12,className:"animate-spin"}):t.jsx(Wt,{size:12}),c==="loading"?"Discovering...":n.length>0?"Refresh":"Auto-discover"]}),e[23]=c,e[24]=k,e[25]=o,e[26]=n.length,e[27]=T):T=e[27];let N;e[28]!==T||e[29]!==C?(N=t.jsxs("div",{className:"flex items-center gap-2",children:[C,T]}),e[28]=T,e[29]=C,e[30]=N):N=e[30];let A;e[31]!==N||e[32]!==E?(A=t.jsxs("div",{className:"flex items-center justify-between",children:[E,N]}),e[31]=N,e[32]=E,e[33]=A):A=e[33];let L;e[34]!==c||e[35]!==n.length?(L=c==="success"&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-600 dark:text-green-400 bg-green-50 dark:bg-green-950/30 rounded-lg px-3 py-2",children:[t.jsx(it,{size:14,className:"shrink-0"}),t.jsxs("span",{children:["Discovered ",n.length," tool",n.length!==1?"s":""," ","successfully."]})]}),e[34]=c,e[35]=n.length,e[36]=L):L=e[36];let P;e[37]!==v||e[38]!==c?(P=c==="error"&&v&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:[t.jsx(xt,{size:14,className:"shrink-0"}),t.jsx("span",{children:v})]}),e[37]=v,e[38]=c,e[39]=P):P=e[39];let D;e[40]!==d||e[41]!==n?(D=d&&n.length>0&&t.jsx("div",{className:"rounded-xl border border-border divide-y divide-border overflow-hidden max-h-48 overflow-y-auto",children:n.map(Tr)}),e[40]=d,e[41]=n,e[42]=D):D=e[42];let $;e[43]!==c||e[44]!==d||e[45]!==o||e[46]!==n.length?($=d&&n.length===0&&c==="idle"&&t.jsx("p",{className:"text-xs text-muted-foreground px-1",children:o?'Click "Auto-discover" to load tools from the MCP server.':"Add a Remote URL first, then tools can be auto-discovered."}),e[43]=c,e[44]=d,e[45]=o,e[46]=n.length,e[47]=$):$=e[47];let z;return e[48]!==A||e[49]!==L||e[50]!==P||e[51]!==D||e[52]!==$?(z=t.jsxs("div",{className:"space-y-3",children:[A,L,P,D,$]}),e[48]=A,e[49]=L,e[50]=P,e[51]=D,e[52]=$,e[53]=z):z=e[53],z}function Tr(s){return t.jsx("div",{className:"flex items-center gap-3 px-3 py-2",children:t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-mono truncate",children:s.name}),s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description})]})},s.name)}function Us(s){const{org:e}=de(),[n,r]=I.useState(!1),l=typeof window<"u"&&window.location.hostname==="localhost"?`${e.id}_dev-assets`:null,a=he({connectionId:l??"noop",orgId:e.id});return{uploadImage:async(d,m)=>{if(!l)return H.error("Image upload requires an object-storage connection. Configure one in plugin settings."),null;if(!d.type.startsWith("image/"))return H.error("Only image files are supported"),null;if(d.size>5*1024*1024)return H.error("Image size must be less than 5MB"),null;r(!0);try{const u=await a.callTool({name:"PUT_PRESIGNED_URL",arguments:{key:m,contentType:d.type}}),x=u.structuredContent?.url||u.url;if(!x)throw new Error("Failed to get presigned URL");const p=await fetch(x,{method:"PUT",body:d,headers:{"Content-Type":d.type}});if(!p.ok)throw new Error(`Upload failed: ${p.statusText}`);const h=await a.callTool({name:"GET_PRESIGNED_URL",arguments:{key:m,expiresIn:31536e3}}),c=h.structuredContent?.url||h.url;if(!c)throw new Error("Failed to get public URL");return c}catch(u){return console.error("Image upload failed:",u),H.error(u instanceof Error?u.message:"Failed to upload image. Please try again."),null}finally{r(!1)}},isUploading:n}}function Ir(){const{org:s}=de(),[e,n]=I.useState(null),r=I.useRef(0),o=he({connectionId:pe,orgId:s.id});return{generate:async a=>{r.current+=1,n(a.type);try{const i=await o.callTool({name:"REGISTRY_AI_GENERATE",arguments:a});if(i.isError){const d=i.content?.find(m=>m.type==="text")?.text??"Failed to generate content";throw new Error(d)}return i.structuredContent??i}finally{r.current-=1,r.current===0&&n(null)}},loadingType:e,isGenerating:e!==null}}const Mr=new Set(["http","sse","stdio"]),Pr=/^[a-z0-9]+(?:[/-][a-z0-9._-]+)*$/,us=["internal","automation","support","sales","ops","ai"],qs=["productivity","communication","customer-support","development","data","operations"],Er=["Essentials","Details","Advanced"],nt="h-7 text-xs border-green-500/30 text-green-600 dark:text-green-400 shadow-[0_0_8px_rgba(34,197,94,0.3)] hover:shadow-[0_0_14px_rgba(34,197,94,0.5)] hover:border-green-500/50 transition-all";function xs(s){return s.replace(/^https?:\/\//i,"").trim()}function rt(s){const e=s.trim();return e?/^https?:\/\//i.test(e)?e:`https://${e}`:""}function Ye(s){return s.trim().toLowerCase()}function Nt(s){return Array.from(new Set(s.map(Ye).filter(e=>e.length>0)))}function Ze(s){return s.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function Dr(s){const e=X.c(4),{current:n}=s;let r;e[0]!==n?(r=Er.map((l,a)=>{const i=a+1,d=i===n,m=i<n;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[a>0&&t.jsx("div",{className:ee("w-4 h-px",m?"bg-primary":"bg-border")}),t.jsxs("div",{className:ee("flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs transition-colors",d?"bg-primary/10 text-primary font-medium":m?"text-primary":"text-muted-foreground"),children:[t.jsx("span",{className:ee("size-5 rounded-full inline-flex items-center justify-center text-[10px] font-semibold shrink-0",d?"bg-primary text-primary-foreground":m?"bg-primary/20 text-primary":"bg-muted text-muted-foreground"),children:i}),t.jsx("span",{className:"hidden sm:inline",children:l})]})]},l)}),e[0]=n,e[1]=r):r=e[1];let o;return e[2]!==r?(o=t.jsx("div",{className:"flex items-center gap-1.5",children:r}),e[2]=r,e[3]=o):o=e[3],o}function $r(s){const e=X.c(28),{id:n,label:r,values:o,availableOptions:l,placeholder:a,onChange:i}=s,[d,m]=I.useState(""),[u,x]=I.useState(!1);let p,h,c,v,b;if(e[0]!==l||e[1]!==n||e[2]!==d||e[3]!==u||e[4]!==r||e[5]!==i||e[6]!==a||e[7]!==o){const y=Nt(l),f=Nt(o),M=new Set(f),g=Ye(d),w=y.filter(P=>!M.has(P)).filter(P=>g?P.includes(g):!0).slice(0,8),R=P=>{const D=Ye(P);!D||M.has(D)||i([...f,D])},E=P=>{i(f.filter(D=>D!==P))},C=()=>{const P=d.split(/[,\n;]/).map(Ye).filter(Boolean);if(P.length===0)return;const D=[...f];for(const $ of P)D.includes($)||D.push($);i(D),m("")},T=g;v="grid gap-2",e[13]!==n||e[14]!==r?(b=t.jsx(re,{htmlFor:n,children:r}),e[13]=n,e[14]=r,e[15]=b):b=e[15],p="relative";let N;e[16]!==n?(N=()=>{const P=document.getElementById(n);P instanceof HTMLInputElement&&P.focus()},e[16]=n,e[17]=N):N=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=()=>x(!0),e[18]=A):A=e[18];let L;e[19]===Symbol.for("react.memo_cache_sentinel")?(L=P=>m(P.target.value),e[19]=L):L=e[19],h=t.jsx("div",{className:"min-h-9 w-full rounded-xl border border-input bg-background px-2.5 py-1.5 text-sm focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",onClick:N,children:t.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[f.map(P=>t.jsxs(F,{variant:"secondary",className:"gap-1",children:[P,t.jsx("button",{type:"button",onClick:D=>{D.preventDefault(),D.stopPropagation(),E(P)},children:t.jsx(Rn,{size:12})})]},`${n}-${P}`)),t.jsx("input",{id:n,className:"flex-1 min-w-[120px] bg-transparent outline-none border-none text-sm",placeholder:f.length?"":a,value:d,onFocus:A,onBlur:()=>{x(!1),C()},onChange:L,onKeyDown:P=>{if(P.key==="Enter"||P.key===","){P.preventDefault(),C();return}P.key==="Backspace"&&!d&&f.length&&E(f[f.length-1]??"")}})]})}),c=u&&t.jsx("div",{className:"absolute z-50 mt-1 w-full rounded-xl border border-border bg-background shadow-lg max-h-56 overflow-y-auto",children:w.length>0?w.map(P=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:Lr,onClick:()=>{R(P),m("")},children:P},`${n}-suggestion-${P}`)):T?t.jsxs("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:Ar,onClick:()=>{R(T),m("")},children:['Create "',T,'"']}):t.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:"Type to search or create."})}),e[0]=l,e[1]=n,e[2]=d,e[3]=u,e[4]=r,e[5]=i,e[6]=a,e[7]=o,e[8]=p,e[9]=h,e[10]=c,e[11]=v,e[12]=b}else p=e[8],h=e[9],c=e[10],v=e[11],b=e[12];let k;e[20]!==p||e[21]!==h||e[22]!==c?(k=t.jsxs("div",{className:p,children:[h,c]}),e[20]=p,e[21]=h,e[22]=c,e[23]=k):k=e[23];let S;return e[24]!==v||e[25]!==b||e[26]!==k?(S=t.jsxs("div",{className:v,children:[b,k]}),e[24]=v,e[25]=b,e[26]=k,e[27]=S):S=e[27],S}function Ar(s){return s.preventDefault()}function Lr(s){return s.preventDefault()}function Or({id:s,value:e,availableOptions:n,onChange:r}){const[o,l]=I.useState(e),[a,i]=I.useState(!1),d=I.useRef(e);d.current!==e&&(d.current=e,l(e));const m=Nt([...qs,...n,e]).filter(Boolean),u=Ye(o),x=m.filter(h=>u?h.includes(u):!0).slice(0,8),p=h=>{const c=Ye(h);r(c),l(c),i(!1)};return t.jsxs("div",{className:"grid gap-2",children:[t.jsx(re,{htmlFor:s,children:"Category"}),t.jsxs("div",{className:"relative",children:[t.jsx(xe,{id:s,className:"h-9 text-sm",placeholder:"Select or create category",value:o,onFocus:()=>{l(e),i(!0)},onBlur:()=>{p(o)},onChange:h=>l(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),p(o))}}),e&&t.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground hover:text-foreground",onMouseDown:h=>h.preventDefault(),onClick:()=>{r(""),l("")},children:"clear"}),a&&t.jsx("div",{className:"absolute z-50 mt-1 w-full rounded-xl border border-border bg-background shadow-lg max-h-56 overflow-y-auto",children:x.length>0?x.map(h=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:c=>c.preventDefault(),onClick:()=>p(h),children:h},`${s}-${h}`)):u?t.jsxs("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:h=>h.preventDefault(),onClick:()=>p(u),children:['Create "',u,'"']}):t.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:"Type to search or create."})})]})]})}function zr({open:s,onOpenChange:e,item:n,draft:r,availableTags:o=[],availableCategories:l=[],defaultLLMConnectionId:a="",defaultLLMModelId:i="",isSubmitting:d=!1,onSubmit:m}){const{org:u}=de(),{uploadImage:x,isUploading:p}=Us(),{generate:h,loadingType:c}=Ir(),{discover:v,discoverStatus:b,discoverError:k,resetDiscover:S}=zs(),y=!!n,f=r?._meta?.["mcp.mesh"],M=n?.title??r?.title??"",g=n?.id?.split("/")[0]??r?.id?.split("/")[0]??"",w=n?.description??r?.description??"",R=n?._meta?.["mcp.mesh"]?.short_description??f?.short_description??"",E=n?._meta?.["mcp.mesh"]?.owner??f?.owner??"",C=n?.server?.repository?.url??r?.server?.repository?.url??"",T=n?._meta?.["mcp.mesh"]?.readme??f?.readme??"",N=n?._meta?.["mcp.mesh"]?.readme_url??f?.readme_url??"",A=xs(n?.server?.remotes?.[0]?.url??r?.server?.remotes?.[0]?.url??""),L=n?.server?.remotes?.[0]?.type??r?.server?.remotes?.[0]?.type??"http",P=n?._meta?.["mcp.mesh"]?.tags??f?.tags??[],D=n?._meta?.["mcp.mesh"]?.categories?.[0]??f?.categories?.[0]??"",$=n?.server?.icons?.[0]?.src??r?.server?.icons?.[0]?.src??"",z=n?._meta?.["mcp.mesh"]?.tools??f?.tools??[],O=n?.is_public??r?.is_public??!1,B=n?._meta?.["mcp.mesh"]?.verified??f?.verified??!1,Q=n?._meta?.["mcp.mesh"]?.official??f?.official??!1,[j,U]=I.useState(1),[K,te]=I.useState(M),[se,le]=I.useState(g),[ae,me]=I.useState(w),[ue,_]=I.useState(R),[J,Z]=I.useState(E),[ce,fe]=I.useState(C),[ke,ye]=I.useState(T),[ie,De]=I.useState(N),[Te,$e]=I.useState(T?"content":"link"),[ne,je]=I.useState(A),[Ne,be]=I.useState(L),[Oe,Ae]=I.useState(P),[Se,Be]=I.useState(D),[He,lt]=I.useState($),[we,tt]=I.useState(z),[V,ge]=I.useState(O),[st,Ge]=I.useState(B),[_t,at]=I.useState(Q),[ve,ot]=I.useState({}),We=!!(a&&i),es=()=>{U(1),te(M),le(g),me(w),_(R),Z(E),fe(C),ye(T),De(N),$e(T?"content":"link"),je(A),be(L),Ae(P),Be(D),lt($),tt(z),ge(O),Ge(B),at(Q),ot({}),S(),kt.current="",Qe.current&&(clearTimeout(Qe.current),Qe.current=null)},Ks=async q=>{if(!q)return;const Y=y?n?.id:`${se}/${K}`.toLowerCase(),Re=Ze(Y||"temp"),ze=q.name.split(".").pop()||"png",Ue=`registry/${u.id}/${Re}/icon.${ze}`,Je=await x(q,Ue);Je?(lt(Je),ot(qe=>({...qe,imageUrl:void 0}))):ot(qe=>({...qe,imageUrl:"Failed to upload image. Please try again."}))},Qe=I.useRef(null),kt=I.useRef(""),Ft=I.useRef(Ne);Ft.current=Ne;const ts=q=>{!q&&Qe.current&&(clearTimeout(Qe.current),Qe.current=null),e(q),q||es()},Ys=async()=>{const q=rt(ne);if(!q)return;kt.current=q;const Y=await v(q,Ft.current);Y&&tt(Y)},Hs=q=>{Qe.current&&clearTimeout(Qe.current);const Y=rt(q);!Y||Y===kt.current||q.includes(".")&&(Qe.current=setTimeout(async()=>{kt.current=Y;const Re=await v(Y,Ft.current);Re&&tt(Re)},800))},ct=()=>We?{llmConnectionId:a,modelId:i}:null,dt=()=>({name:K.trim(),provider:se.trim(),url:rt(ne),owner:J.trim(),repositoryUrl:ce.trim(),description:ae.trim(),shortDescription:ue.trim(),tags:Oe,categories:Se?[Se]:[],availableTags:[...us,...o],availableCategories:[...qs,...l],tools:we}),Ws=async()=>{const q=ct();if(!q)return;const Y=await h({...q,type:"description",context:dt()});Y.result&&me(Y.result.slice(0,1500))},Js=async()=>{const q=ct();if(!q)return;const Y=await h({...q,type:"short_description",context:dt()});Y.result&&_(Y.result.slice(0,160))},Zs=async()=>{const q=ct();if(!q)return;const Y=await h({...q,type:"tags",context:dt()});Y.items?.length&&Ae(Nt(Y.items))},Xs=async()=>{const q=ct();if(!q)return;const Y=await h({...q,type:"categories",context:dt()});Y.items?.[0]&&Be(Ye(Y.items[0]))},en=async()=>{const q=ct();if(!q)return;const Y=await h({...q,type:"readme",context:dt()});Y.result&&(ye(Y.result.slice(0,5e4)),$e("content"))},ss=q=>{const Y={};if(q===1){const Re=Ze(se),ze=Ze(K),Ue=`${Re}/${ze}`;K.trim()||(Y.title="Name is required."),y||(Re?ze?Pr.test(Ue)||(Y.provider="Use lowercase letters/numbers and separators '/' or '-'."):Y.title="Name must contain valid characters.":Y.provider="Provider is required.");const Je=rt(ne),qe=Ne.trim().toLowerCase();if(qe!=="stdio"&&Je)try{const mt=new URL(Je);["http:","https:"].includes(mt.protocol)||(Y.remoteUrl="Remote URL must be http(s).")}catch{Y.remoteUrl="Remote URL is invalid."}if(qe&&!Mr.has(qe)&&(Y.remoteType="Remote type must be: http, sse or stdio."),He.trim()&&!He.trim().startsWith("data:image/"))try{const Bt=new URL(He.trim());["http:","https:"].includes(Bt.protocol)||(Y.imageUrl="Image URL must be http(s).")}catch{Y.imageUrl="Image URL is invalid."}}if(q===2&&(ae.length>1500&&(Y.description="Description must be 1500 characters or less."),ue.trim().length>160&&(Y.shortDescription="Short description must be 160 characters or less.")),q===3){const Re=ie.trim();if(Re)try{const Ue=new URL(Re);["http:","https:"].includes(Ue.protocol)||(Y.readmeUrl="README URL must be http(s).")}catch{Y.readmeUrl="README URL is invalid."}ke.trim().length>5e4&&(Y.readme="README must be 50 000 characters or less.");const ze=ce.trim();if(ze)try{const Ue=new URL(ze);["http:","https:"].includes(Ue.protocol)||(Y.repositoryUrl="Repository URL must be http(s).")}catch{Y.repositoryUrl="Repository URL is invalid."}}return ot(Y),Object.values(Y).every(Re=>Re===void 0)},tn=()=>{ss(j)&&j<3&&U(j+1)},sn=()=>{j>1&&U(j-1)},nn=async()=>{if(!ss(3))return;const q=K.trim(),Y=Ze(se),Re=Ze(q),ze=`${Y}/${Re}`,Ue=rt(ne),Je=Ne.trim().toLowerCase(),qe=He.trim(),mt=ce.trim(),Bt=ue.trim(),on=ke.trim(),cn=ie.trim(),dn=Nt(Oe),mn=Se?[Ye(Se)]:[],un=n?n.server?.name??n.id:"",xn=(y?un:ze).trim(),Gt=ae.trim(),hn=J.trim(),ns={title:q,description:Gt.length>0?Gt:null,is_public:V,_meta:{"mcp.mesh":{verified:st,official:_t,tags:dn,categories:mn,short_description:Bt||null,owner:hn||null,readme:on||null,readme_url:cn||null,...we.length>0?{tools:we}:{}}},server:{name:xn,title:q,description:Gt||void 0,icons:qe?[{src:qe}]:[],repository:mt?{url:mt}:void 0,remotes:Ue?[{type:Je||"http",url:Ue}]:[]}};if(y&&n){await m({id:n.id,data:ns}),e(!1);return}await m({id:ze,...ns}),e(!1),es()},rn=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"row-span-2 grid gap-3 content-start",children:[t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(re,{htmlFor:"registry-item-provider",children:"Provider"}),t.jsx(xe,{id:"registry-item-provider",className:"h-9 text-sm",placeholder:"acme",value:se,onChange:q=>le(q.target.value),disabled:y}),!y&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Item ID:"," ",t.jsx("span",{className:"font-mono",children:`${Ze(se)||"provider"}/${Ze(K)||"name"}`})]}),ve.provider&&t.jsx("p",{className:"text-xs text-destructive",children:ve.provider})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(re,{htmlFor:"registry-item-title",children:"Name"}),t.jsx(xe,{id:"registry-item-title",className:"h-9 text-sm",placeholder:"Internal MCP",value:K,onChange:q=>te(q.target.value)}),ve.title&&t.jsx("p",{className:"text-xs text-destructive",children:ve.title})]})]}),t.jsx("div",{className:"row-span-2 content-start",children:t.jsx(Os,{value:He,onChange:q=>{lt(q),ot(Y=>({...Y,imageUrl:void 0}))},onFileUpload:Ks,error:ve.imageUrl,isUploading:p})}),t.jsxs("div",{className:"col-span-2 grid gap-1.5",children:[t.jsx(re,{htmlFor:"registry-remote-url",children:"Remote URL"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex-1 flex items-center rounded-xl border border-input px-3",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground mr-1",children:"https://"}),t.jsx("input",{id:"registry-remote-url",className:"flex-1 h-9 bg-transparent outline-none text-sm",placeholder:"example.com/mcp",value:ne,onChange:q=>{const Y=xs(q.target.value);je(Y),Hs(Y)}})]}),t.jsxs(Cs,{value:Ne,onValueChange:be,children:[t.jsx(_s,{id:"registry-remote-type",className:"w-[90px] h-9 shrink-0",children:t.jsx(ks,{placeholder:"Type"})}),t.jsxs(Ss,{children:[t.jsx(Rt,{value:"http",children:"http"}),t.jsx(Rt,{value:"sse",children:"sse"}),t.jsx(Rt,{value:"stdio",children:"stdio"})]})]})]}),ve.remoteUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ve.remoteUrl}),ve.remoteType&&t.jsx("p",{className:"text-xs text-destructive",children:ve.remoteType})]}),ne.trim()&&t.jsxs("div",{className:"col-span-2 space-y-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:ee(nt,"gap-1.5"),onClick:Ys,disabled:b==="loading",children:[b==="loading"?t.jsx(et,{size:12,className:"animate-spin"}):t.jsx(Wt,{size:12}),b==="loading"?"Discovering tools...":we.length>0?"Re-discover tools":"Discover tools from URL"]}),we.length>0&&b!=="loading"&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[we.length," tool",we.length!==1?"s":""," loaded"]})]}),b==="success"&&we.length>0&&t.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-50 dark:bg-green-950/20 px-3 py-2 space-y-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-600 dark:text-green-400",children:[t.jsx(it,{size:14,className:"shrink-0"}),t.jsxs("span",{className:"font-medium",children:[we.length," tool",we.length!==1?"s":""," discovered"]})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[we.slice(0,8).map(q=>t.jsx(F,{variant:"secondary",className:"text-[10px] px-1.5 py-0 font-mono",children:q.name},q.name)),we.length>8&&t.jsxs("span",{className:"text-[10px] text-muted-foreground self-center",children:["+",we.length-8," more"]})]}),t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"These tools will enrich AI-generated descriptions, tags and categories in the next step."})]}),b==="auth_required"&&k&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/20 border border-amber-500/20 rounded-lg px-3 py-2",children:[t.jsx(xt,{size:14,className:"shrink-0"}),t.jsx("span",{children:"This server requires authentication. The connection is valid but tools cannot be listed without credentials."})]}),b==="error"&&k&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:[t.jsx(xt,{size:14,className:"shrink-0"}),t.jsx("span",{children:k})]})]})]}),ln=t.jsxs("div",{className:"grid gap-3",children:[t.jsxs("div",{className:"grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(re,{htmlFor:"registry-item-short-description",children:"Short Description"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:[ue.length,"/160"]}),We&&t.jsx(G,{type:"button",variant:"outline",size:"sm",className:nt,disabled:c==="short_description",onClick:Js,children:c==="short_description"?"Generating...":"AI Generate"})]})]}),t.jsx(xe,{id:"registry-item-short-description",className:"h-9 text-sm",placeholder:"Short summary for the store card",value:ue,maxLength:160,onChange:q=>_(q.target.value)}),ve.shortDescription&&t.jsx("p",{className:"text-xs text-destructive",children:ve.shortDescription})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(re,{htmlFor:"registry-item-description",children:"Description"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:[ae.length,"/1500"]}),We&&t.jsx(G,{type:"button",variant:"outline",size:"sm",className:nt,disabled:c==="description",onClick:Ws,children:c==="description"?"Generating...":"AI Generate"})]})]}),t.jsx(zt,{id:"registry-item-description",className:"text-sm max-h-28 overflow-y-auto resize-none",placeholder:"Brief description of this MCP server",rows:2,value:ae,onChange:q=>me(q.target.value)}),ve.description&&t.jsx("p",{className:"text-xs text-destructive",children:ve.description})]}),t.jsx("div",{className:"border-t border-border"}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"grid content-start gap-2",children:[t.jsx(Or,{id:"registry-category",value:Se,availableOptions:l,onChange:Be}),We&&t.jsx(G,{type:"button",variant:"outline",size:"sm",className:ee(nt,"justify-self-start"),disabled:c==="categories",onClick:Xs,children:c==="categories"?"Suggesting...":"AI Suggest"})]}),t.jsxs("div",{className:"grid content-start gap-2",children:[t.jsx($r,{id:"registry-tags",label:"Tags",values:Oe,availableOptions:[...us,...o],placeholder:"Type and press Enter or comma",onChange:Ae}),We&&t.jsx(G,{type:"button",variant:"outline",size:"sm",className:ee(nt,"justify-self-start"),disabled:c==="tags",onClick:Zs,children:c==="tags"?"Suggesting...":"AI Suggest"})]})]}),t.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border px-4 py-3",children:[t.jsxs("div",{className:"grid gap-0.5",children:[t.jsx(re,{htmlFor:"registry-is-public",className:"text-sm",children:"Public"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Make this MCP visible in the public store URL."})]}),t.jsx(Xe,{id:"registry-is-public",checked:V,onCheckedChange:ge})]}),t.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border px-4 py-3",children:[t.jsxs("div",{className:"grid gap-0.5",children:[t.jsx(re,{htmlFor:"registry-is-verified",className:"text-sm",children:"Verified"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Curated and approved by deco."})]}),t.jsx(Xe,{id:"registry-is-verified",checked:st,onCheckedChange:Ge})]}),t.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border px-4 py-3",children:[t.jsxs("div",{className:"grid gap-0.5",children:[t.jsx(re,{htmlFor:"registry-is-official",className:"text-sm",children:"Official"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Made and hosted by the service provider."})]}),t.jsx(Xe,{id:"registry-is-official",checked:_t,onCheckedChange:at})]})]}),an=t.jsxs("div",{className:"grid gap-3",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(re,{htmlFor:"registry-item-owner",children:"Owner (optional)"}),t.jsx(xe,{id:"registry-item-owner",className:"h-9 text-sm",placeholder:"Team, company, or responsible person",value:J,onChange:q=>Z(q.target.value)})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(re,{htmlFor:"registry-item-repository-url",children:"Repository URL (optional)"}),t.jsx(xe,{id:"registry-item-repository-url",className:"h-9 text-sm",placeholder:"https://github.com/org/repo",value:ce,onChange:q=>fe(q.target.value)}),ve.repositoryUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ve.repositoryUrl})]})]}),t.jsxs("div",{className:"rounded-xl border border-border p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(re,{children:"README"}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[ke.length,"/50000"]})]}),t.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5",children:(We?["link","content","generate"]:["link","content"]).map(q=>t.jsx("button",{type:"button",className:ee("px-2.5 py-1 text-xs rounded-md",Te===q?"bg-primary text-primary-foreground":"text-muted-foreground"),onClick:()=>$e(q),children:q==="link"?"Link":q==="content"?"Content":"Generate"},q))}),Te==="link"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(xe,{className:"h-9 text-sm",placeholder:"https://raw.githubusercontent.com/org/repo/main/README.md",value:ie,onChange:q=>De(q.target.value)}),ve.readmeUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ve.readmeUrl})]}),Te==="content"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(zt,{className:"text-sm max-h-48 overflow-y-auto resize-none",placeholder:`# README
4
4