decocms 2.292.1 → 2.293.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/dist/client/assets/{AlertCircle-Cx8oex2u.js → AlertCircle-DnJbX_0w.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-DtpIYMrr.js → ArrowNarrowLeft-M9-X6Sxy.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-BBjaHjTK.js → ArrowUpRight-BQK-oA7E.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-Mywkb82K.js → CheckCircle-BTDGGZJo.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BE0rQ4ho.js → ChevronDown-D098IDk9.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-BVJ2HUMt.js → ChevronRight-DIr3-XeU.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-B2y_5HwX.js → ChevronUp-qt4sL4uC.js} +1 -1
  8. package/dist/client/assets/{Container-CtsNRge8.js → Container-BvdKvtbe.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-BQnGY6Nc.js → DotsVertical-DGFUAKYN.js} +1 -1
  10. package/dist/client/assets/{LinkExternal01-SieYyhiZ.js → LinkExternal01-CS_vTEL0.js} +1 -1
  11. package/dist/client/assets/{Lock01-BrFrkt3t.js → Lock01-DepQhBci.js} +1 -1
  12. package/dist/client/assets/{Palette-2CChK5yr.js → Palette-SeD4BOqL.js} +1 -1
  13. package/dist/client/assets/{Play-BfzIvHVC.js → Play-B2WhNMxb.js} +1 -1
  14. package/dist/client/assets/{Plus-kLSd3TZy.js → Plus-6a_0gFD5.js} +1 -1
  15. package/dist/client/assets/{RefreshCcw01-B-L6FvMp.js → RefreshCcw01-CmGHOB_j.js} +1 -1
  16. package/dist/client/assets/{SearchMd-BfBE-dHK.js → SearchMd-B4RJoOIR.js} +1 -1
  17. package/dist/client/assets/{Settings02-EP4I50bB.js → Settings02-86F4b3dQ.js} +1 -1
  18. package/dist/client/assets/{Shield01-D19-LRUf.js → Shield01-CzaXyqoU.js} +1 -1
  19. package/dist/client/assets/{Star01-MuiWZ8GS.js → Star01-BsL_E8DX.js} +1 -1
  20. package/dist/client/assets/{Sun-CTLobT4y.js → Sun-CoYtwe4c.js} +1 -1
  21. package/dist/client/assets/{Tool01-CeBylvMu.js → Tool01-Cxeqfwwz.js} +1 -1
  22. package/dist/client/assets/{Trash01-BLGcALKg.js → Trash01-Crqeojj8.js} +1 -1
  23. package/dist/client/assets/{User01-BLHrCCyy.js → User01-lfQ-qZIG.js} +1 -1
  24. package/dist/client/assets/{Users03-C3QqJn94.js → Users03-BEcIfaLP.js} +1 -1
  25. package/dist/client/assets/{X-BJbamPEP.js → X-DSm8Y-S-.js} +1 -1
  26. package/dist/client/assets/{XCircle-DP5EGLqX.js → XCircle-D0NNu2cU.js} +1 -1
  27. package/dist/client/assets/{XClose-BRn4UVuG.js → XClose-8tp9nQPE.js} +1 -1
  28. package/dist/client/assets/{Zap-kZUu0No-.js → Zap-GnwBp_Qp.js} +1 -1
  29. package/dist/client/assets/{ZapSquare-B3o6QvJe.js → ZapSquare-DgxRVJjy.js} +1 -1
  30. package/dist/client/assets/accordion-CJq3HBrS.js +1 -0
  31. package/dist/client/assets/agent-icon-DxobcFDr.js +1 -0
  32. package/dist/client/assets/agents-list-eEeKypKu.js +1 -0
  33. package/dist/client/assets/ai-providers-D_bgIPsh.js +1 -0
  34. package/dist/client/assets/{alert-dialog-BFg1HHbW.js → alert-dialog-CscciHzk.js} +2 -2
  35. package/dist/client/assets/{auth-catchall-BPCBowrT.js → auth-catchall-DZZidYw0.js} +1 -1
  36. package/dist/client/assets/{automation-list-row-0e1qSQoQ.js → automation-list-row-Br_pkbGs.js} +1 -1
  37. package/dist/client/assets/automations-Ch3eQvio.js +1 -0
  38. package/dist/client/assets/{avatar-BfSY5CVM.js → avatar-BQ09Qk0Z.js} +1 -1
  39. package/dist/client/assets/{badge-C_B8gNbw.js → badge-Clg4Tzdw.js} +1 -1
  40. package/dist/client/assets/brand-context-DZl3n4iE.js +1 -0
  41. package/dist/client/assets/{card-G6flwhwa.js → card-DUOq7Rl6.js} +1 -1
  42. package/dist/client/assets/chat-context-CfrtTY3a.js +31 -0
  43. package/dist/client/assets/{checkbox-LBmczTXJ.js → checkbox-D2GZcsVt.js} +1 -1
  44. package/dist/client/assets/collection-detail-ChjtG6Ga.js +1 -0
  45. package/dist/client/assets/collection-display-button-BZwsY1Wv.js +1 -0
  46. package/dist/client/assets/{collection-search-DoXoIAYq.js → collection-search-CzSQR8Hb.js} +1 -1
  47. package/dist/client/assets/{collection-search-CsSMb59s.js → collection-search-DW3g3zGc.js} +1 -1
  48. package/dist/client/assets/{collection-table-wrapper-B2fVBjE4.js → collection-table-wrapper-B84Op-Zk.js} +1 -1
  49. package/dist/client/assets/{collection-tabs-CA1SpsaZ.js → collection-tabs-DVyOXsXh.js} +1 -1
  50. package/dist/client/assets/{collections-BAHpsq0P.js → collections-CzE8C7FB.js} +1 -1
  51. package/dist/client/assets/{command-CJYPyBOh.js → command-ChcvD0z3.js} +1 -1
  52. package/dist/client/assets/{connection-card-DZ1fYoPr.js → connection-card-C2vEoZIt.js} +1 -1
  53. package/dist/client/assets/connection-detail-BGY9VwYa.js +1 -0
  54. package/dist/client/assets/connection-form-helpers-CgA-QNzF.js +1 -0
  55. package/dist/client/assets/connections-DRgi7C4U.js +1 -0
  56. package/dist/client/assets/{constants-B-gCw63I.js → constants-CrD_AMxD.js} +1 -1
  57. package/dist/client/assets/{constants-Dw_UtizE.js → constants-nJzh8CYx.js} +2 -2
  58. package/dist/client/assets/{dialog-DjZXbytL.js → dialog-CVDAkUpR.js} +1 -1
  59. package/dist/client/assets/domain-settings-ClmaftJG.js +1 -0
  60. package/dist/client/assets/{drawer-BFBl_9mB.js → drawer-CFg3CiQr.js} +1 -1
  61. package/dist/client/assets/dropdown-menu-gP2-wJTw.js +1 -0
  62. package/dist/client/assets/dynamic-plugin-layout-DZA29J1C.js +1 -0
  63. package/dist/client/assets/{empty-state-CWYR2iH4.js → empty-state-C2PUUqhT.js} +1 -1
  64. package/dist/client/assets/{empty-state-DskpQs8Q.js → empty-state-CPpC79-7.js} +1 -1
  65. package/dist/client/assets/{extract-connection-data-DiYA0QYt.js → extract-connection-data-5g73Imwy.js} +1 -1
  66. package/dist/client/assets/features-CeA9UMCz.js +1 -0
  67. package/dist/client/assets/form-yPmbpUVF.js +1 -0
  68. package/dist/client/assets/general-CX6-dTKZ.js +1 -0
  69. package/dist/client/assets/index-B3vDeqTk.js +1 -0
  70. package/dist/client/assets/{index-Bm_-4bAj.js → index-BYM0cbyk.js} +3 -3
  71. package/dist/client/assets/{index-QvZR-ABK.js → index-BdUJIICa.js} +1 -1
  72. package/dist/client/assets/index-BzSFWy5-.js +189 -0
  73. package/dist/client/assets/index-C3hSkh4S.js +1 -0
  74. package/dist/client/assets/index-CXbGCxBV.js +547 -0
  75. package/dist/client/assets/{index-BnoHDdAn.js → index-CfanpUI7.js} +3 -3
  76. package/dist/client/assets/{index-x18ABRVV.js → index-CqrrK0SQ.js} +1 -1
  77. package/dist/client/assets/{index-DA_fcz0a.js → index-CsTWePfc.js} +1 -1
  78. package/dist/client/assets/index-DImBkhtD.js +1 -0
  79. package/dist/client/assets/index-Dbs2wH7N.js +1 -0
  80. package/dist/client/assets/index-DkZMRzTR.js +1 -0
  81. package/dist/client/assets/index-Dkaetwrr.js +142 -0
  82. package/dist/client/assets/{index-CllFnV9J.js → index-Dlk19fTc.js} +1 -1
  83. package/dist/client/assets/index-b9vWbQjO.js +1 -0
  84. package/dist/client/assets/{index-Bu0xhzLF.js → index-gKZjkMnf.js} +26 -26
  85. package/dist/client/assets/{infiniteQueryObserver-DEk-T30Y.js → infiniteQueryObserver-B9PWohpE.js} +1 -1
  86. package/dist/client/assets/{input-B5aMagwc.js → input-Cet4kRAV.js} +1 -1
  87. package/dist/client/assets/{integration-icon-B5mNngh-.js → integration-icon-BYjt2zM8.js} +1 -1
  88. package/dist/client/assets/{label-Bv4VMaQH.js → label-CaWfIbuT.js} +1 -1
  89. package/dist/client/assets/layout-BgwHTi9m.js +1 -0
  90. package/dist/client/assets/lean-canvas-recruit-modal-CNtMOKiS.js +116 -0
  91. package/dist/client/assets/{login-DFTX50_T.js → login-DDBhfkxa.js} +1 -1
  92. package/dist/client/assets/{members-BbGgTXF7.js → members-CpZry3vM.js} +1 -1
  93. package/dist/client/assets/{monaco-editor-CV15HqlU.js → monaco-editor-D2GSkzL1.js} +1 -1
  94. package/dist/client/assets/{monitoring-stats-row-FCrYNYUL.js → monitoring-stats-row-B9-AgFrN.js} +1 -1
  95. package/dist/client/assets/{oauth-callback-W1x4HvAt.js → oauth-callback-ZTQDmTMI.js} +1 -1
  96. package/dist/client/assets/{oauth-callback-ai-provider-8jGGtkD-.js → oauth-callback-ai-provider-Gd1uARX2.js} +1 -1
  97. package/dist/client/assets/{onboarding-DiKHM7MB.js → onboarding-8fDDt_RN.js} +1 -1
  98. package/dist/client/assets/{org-layout-B-bINoer.js → org-layout-Bw77z4Sw.js} +1 -1
  99. package/dist/client/assets/org-plugin-layout-BIXLREf_.js +1 -0
  100. package/dist/client/assets/{task-status-D3v6N-jY.js → pair-CSF6pLZy.js} +40 -40
  101. package/dist/client/assets/plugin-empty-state-D452cObw.js +1 -0
  102. package/dist/client/assets/plugin-header-DesRdhcy.js +1 -0
  103. package/dist/client/assets/{plugin-layout-2a2a-fWN.js → plugin-layout-cW34W41Y.js} +1 -1
  104. package/dist/client/assets/{popover-CGtNHDEz.js → popover-dpRZqzOJ.js} +1 -1
  105. package/dist/client/assets/profile-AXVJhA8D.js +1 -0
  106. package/dist/client/assets/project-app-view-C0WWCGe_.js +1 -0
  107. package/dist/client/assets/registry-91e7KTfr.js +2 -0
  108. package/dist/client/assets/{registry-layout-YWa06n-y.js → registry-layout-DWruz43b.js} +1 -1
  109. package/dist/client/assets/required-auth-layout-DVgyyuV-.js +1 -0
  110. package/dist/client/assets/{reset-password-CfhsLJCK.js → reset-password-jjqpZRxZ.js} +1 -1
  111. package/dist/client/assets/roles-Bf8vBKyU.js +1 -0
  112. package/dist/client/assets/scroll-area-CH9Vosbx.js +1 -0
  113. package/dist/client/assets/{search-input-DRzVzeWW.js → search-input-BTdLweUR.js} +1 -1
  114. package/dist/client/assets/select-B6R2tTSM.js +1 -0
  115. package/dist/client/assets/{select-model-BdV3Nm5y.js → select-model-BMdrDFa3.js} +1 -1
  116. package/dist/client/assets/settings-layout-CnrVmFqe.js +1 -0
  117. package/dist/client/assets/{settings-section-nyO0fOgx.js → settings-section-Z9FmAPIg.js} +1 -1
  118. package/dist/client/assets/shell-layout-DaB5J-du.js +1 -0
  119. package/dist/client/assets/{skeleton-ClT50YXx.js → skeleton-BhVqr-eG.js} +1 -1
  120. package/dist/client/assets/sso-DZJw-CAn.js +1 -0
  121. package/dist/client/assets/store-D-L6Gt6i.js +1 -0
  122. package/dist/client/assets/store-registry-DdZCk03l.js +2 -0
  123. package/dist/client/assets/{switch-Bp1Tvx2h.js → switch-D_DqyrYW.js} +1 -1
  124. package/dist/client/assets/{table-BL7WuMkY.js → table-D1_6e_tY.js} +1 -1
  125. package/dist/client/assets/{tabs-CNz9F6wL.js → tabs-Bu_QsdLq.js} +1 -1
  126. package/dist/client/assets/task-status-DKnoaN0K.js +1 -0
  127. package/dist/client/assets/{textarea-BxmFQbso.js → textarea-BPX5qWaA.js} +1 -1
  128. package/dist/client/assets/{toggle-group-B4KaadHq.js → toggle-group-BJxlfhsN.js} +1 -1
  129. package/dist/client/assets/tools-list-CjPOU8GA.js +1 -0
  130. package/dist/client/assets/tooltip-DlUl6zVU.js +1 -0
  131. package/dist/client/assets/{types-BtVZ_7jK.js → types-CUVoLk-m.js} +6 -6
  132. package/dist/client/assets/{use-ai-providers-DqhLue8O.js → use-ai-providers-CKSasQTP.js} +1 -1
  133. package/dist/client/assets/{use-collections-CLt7BhQ3.js → use-collections-DKaygmj-.js} +1 -1
  134. package/dist/client/assets/{use-connection-BCV5VAjQ.js → use-connection-DLwIHVYP.js} +1 -1
  135. package/dist/client/assets/{use-copy-CYT1tdMJ.js → use-copy-CLL1wnsg.js} +1 -1
  136. package/dist/client/assets/use-create-virtual-mcp-B693GvUD.js +1 -0
  137. package/dist/client/assets/{use-decopilot-events-BNaQbe7E.js → use-decopilot-events-NXGOEGvZ.js} +1 -1
  138. package/dist/client/assets/{use-delete-connection-YzycomMd.js → use-delete-connection-DN8HxHVx.js} +1 -1
  139. package/dist/client/assets/{use-infinite-scroll-CoMWGssU.js → use-infinite-scroll-B32XN73V.js} +1 -1
  140. package/dist/client/assets/{use-list-state-jiGNrC7M.js → use-list-state-Cwr5OloB.js} +1 -1
  141. package/dist/client/assets/{use-mcp-tools-yi4edHzR.js → use-mcp-tools-CyPVbfii.js} +1 -1
  142. package/dist/client/assets/{use-members-BPb2gPfy.js → use-members-C8bjIWu8.js} +1 -1
  143. package/dist/client/assets/use-navigate-to-agent-DuF5pNCT.js +1 -0
  144. package/dist/client/assets/{use-org-sso-CEfAe1W3.js → use-org-sso-pbiXxD33.js} +1 -1
  145. package/dist/client/assets/{use-organization-roles-1TjtICKp.js → use-organization-roles-7NVaQG9M.js} +1 -1
  146. package/dist/client/assets/{use-organization-settings-B98QP_Ve.js → use-organization-settings-DpXizr85.js} +1 -1
  147. package/dist/client/assets/{use-registry-connections-D0FgXcrs.js → use-registry-connections-BFqaVIUz.js} +1 -1
  148. package/dist/client/assets/{use-status-sounds-B5WhjryL.js → use-status-sounds-DVyydX5_.js} +1 -1
  149. package/dist/client/assets/{use-tasks-COeMfIn8.js → use-tasks-tzb1zUeQ.js} +1 -1
  150. package/dist/client/assets/use-view-mode-D9sT86SW.js +1 -0
  151. package/dist/client/assets/{use-virtual-mcp-CZoeCuBL.js → use-virtual-mcp-SIWEo5E_.js} +1 -1
  152. package/dist/client/assets/useInfiniteQuery-B3rxurAJ.js +1 -0
  153. package/dist/client/assets/useSuspenseInfiniteQuery-KPnhOQU0.js +1 -0
  154. package/dist/client/assets/{user-CWcWoefF.js → user-DxM-AJLw.js} +1 -1
  155. package/dist/client/assets/view-mode-toggle-CussfoqD.js +1 -0
  156. package/dist/client/assets/workflow-a5DJAs_-.js +1 -0
  157. package/dist/client/assets/workflow-detail-DqMXf6Es.js +1 -0
  158. package/dist/client/index.html +1 -1
  159. package/dist/server/cli.js +1 -1
  160. package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
  161. package/dist/server/node_modules/ansi-styles/index.js +223 -0
  162. package/dist/server/node_modules/ansi-styles/license +9 -0
  163. package/dist/server/node_modules/ansi-styles/package.json +54 -0
  164. package/dist/server/node_modules/ansi-styles/readme.md +173 -0
  165. package/dist/server/node_modules/environment/index.d.ts +74 -0
  166. package/dist/server/node_modules/environment/index.js +47 -0
  167. package/dist/server/node_modules/environment/license +9 -0
  168. package/dist/server/node_modules/environment/package.json +74 -0
  169. package/dist/server/node_modules/environment/readme.md +94 -0
  170. package/dist/server/node_modules/escape-string-regexp/index.d.ts +18 -0
  171. package/dist/server/node_modules/escape-string-regexp/index.js +11 -0
  172. package/dist/server/node_modules/escape-string-regexp/license +9 -0
  173. package/dist/server/node_modules/escape-string-regexp/package.json +43 -0
  174. package/dist/server/node_modules/escape-string-regexp/readme.md +29 -0
  175. package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
  176. package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
  177. package/dist/server/node_modules/is-fullwidth-code-point/license +9 -0
  178. package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
  179. package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
  180. package/dist/server/node_modules/is-unicode-supported/index.d.ts +12 -0
  181. package/dist/server/node_modules/is-unicode-supported/index.js +21 -0
  182. package/dist/server/node_modules/is-unicode-supported/license +9 -0
  183. package/dist/server/node_modules/is-unicode-supported/package.json +47 -0
  184. package/dist/server/node_modules/is-unicode-supported/readme.md +35 -0
  185. package/dist/server/node_modules/pg-pool/LICENSE +21 -0
  186. package/dist/server/node_modules/pg-pool/README.md +357 -0
  187. package/dist/server/node_modules/pg-pool/esm/index.mjs +5 -0
  188. package/dist/server/node_modules/pg-pool/index.js +517 -0
  189. package/dist/server/node_modules/pg-pool/package.json +51 -0
  190. package/dist/server/node_modules/string-width/index.d.ts +39 -0
  191. package/dist/server/node_modules/string-width/index.js +82 -0
  192. package/dist/server/node_modules/string-width/license +9 -0
  193. package/dist/server/node_modules/string-width/package.json +64 -0
  194. package/dist/server/node_modules/string-width/readme.md +66 -0
  195. package/package.json +1 -1
  196. package/dist/client/assets/accordion-BP1gqDGq.js +0 -1
  197. package/dist/client/assets/agent-icon-Db8xI2bq.js +0 -1
  198. package/dist/client/assets/agents-list-CKkZAwkG.js +0 -1
  199. package/dist/client/assets/ai-providers-Cnvjm1DV.js +0 -1
  200. package/dist/client/assets/automations-Cr0E7mF8.js +0 -1
  201. package/dist/client/assets/brand-context-DMrJlbv3.js +0 -1
  202. package/dist/client/assets/chat-context-BJBiG4eq.js +0 -30
  203. package/dist/client/assets/collection-detail-D_lV_A0m.js +0 -1
  204. package/dist/client/assets/collection-display-button-BXL1tYdg.js +0 -1
  205. package/dist/client/assets/connection-detail-DGI32gtH.js +0 -1
  206. package/dist/client/assets/connection-form-helpers-Dim-adMo.js +0 -1
  207. package/dist/client/assets/connections-Dl4MUHeU.js +0 -1
  208. package/dist/client/assets/domain-settings-NIhMIJvG.js +0 -1
  209. package/dist/client/assets/dropdown-menu--l1OQ6xu.js +0 -1
  210. package/dist/client/assets/dynamic-plugin-layout-D8kk92gE.js +0 -1
  211. package/dist/client/assets/features-j7f3i077.js +0 -1
  212. package/dist/client/assets/form-BVdbuwTF.js +0 -1
  213. package/dist/client/assets/general-BLunjYWc.js +0 -1
  214. package/dist/client/assets/github-repo-picker-ku0KWxb8.js +0 -116
  215. package/dist/client/assets/index-CHcfXh0a.js +0 -1
  216. package/dist/client/assets/index-ClmOj0lo.js +0 -735
  217. package/dist/client/assets/index-I_6bIMcX.js +0 -1
  218. package/dist/client/assets/layout-ChoVtsz2.js +0 -1
  219. package/dist/client/assets/org-plugin-layout-enuMys5H.js +0 -1
  220. package/dist/client/assets/plugin-empty-state-DCR5r8Zj.js +0 -1
  221. package/dist/client/assets/plugin-header-DX2ycNO6.js +0 -1
  222. package/dist/client/assets/profile-C0rN-ocq.js +0 -1
  223. package/dist/client/assets/project-app-view-CQsZ6NHk.js +0 -1
  224. package/dist/client/assets/registry-BO2q_Gke.js +0 -2
  225. package/dist/client/assets/required-auth-layout-emsOE3qR.js +0 -1
  226. package/dist/client/assets/roles-BDsBxvE0.js +0 -1
  227. package/dist/client/assets/scroll-area-CoWBmpAM.js +0 -142
  228. package/dist/client/assets/select-DerdayxE.js +0 -1
  229. package/dist/client/assets/settings-layout-B3TmxZwq.js +0 -1
  230. package/dist/client/assets/shell-layout-cKwbYqFy.js +0 -1
  231. package/dist/client/assets/sso-DXETt_Ed.js +0 -1
  232. package/dist/client/assets/store-BBgqe7Dc.js +0 -1
  233. package/dist/client/assets/store-registry-DKa8Ghfu.js +0 -2
  234. package/dist/client/assets/tools-list-BNtwzSa4.js +0 -1
  235. package/dist/client/assets/use-create-virtual-mcp-DPW_d2QJ.js +0 -1
  236. package/dist/client/assets/use-mobile-BACO9YYc.js +0 -1
  237. package/dist/client/assets/use-navigate-to-agent-DbPOuTIs.js +0 -1
  238. package/dist/client/assets/use-view-mode-BLlR5qfu.js +0 -1
  239. package/dist/client/assets/useInfiniteQuery-BiAZtptE.js +0 -1
  240. package/dist/client/assets/useSuspenseInfiniteQuery-CPbx6xDm.js +0 -1
  241. package/dist/client/assets/view-mode-toggle-C_B0ABFw.js +0 -1
  242. package/dist/client/assets/workflow-Cq9jV44q.js +0 -1
  243. package/dist/client/assets/workflow-detail-CaiPxMVe.js +0 -1
@@ -1 +0,0 @@
1
- import{v as C,aI as Y,aJ as W,y as m,aK as O,_ as ke,a_ as L,a$ as Re,aC as $,b0 as Ct,s as he,b as kt,z as ae,r as j,j as n,b1 as _t,b2 as Rt,aY as Ie,aX as xe,aF as It,b3 as Tt,b4 as Dt,b5 as At,aS as Te,aT as De,aV as Et,ah as J,b6 as X,aQ as Pt,ai as q,aR as Ae,aW as Bt,ao as be,b7 as Ee,b8 as Pe,b9 as Ft,e as V,c as ge,B as le,l as ve,f as Mt,E as Ot,aL as Vt}from"./index-Bu0xhzLF.js";import{E as Be}from"./empty-state-DskpQs8Q.js";import{i as $t,u as zt}from"./constants-Dw_UtizE.js";import{c as Lt}from"./use-mcp-tools-yi4edHzR.js";import{A as Fe,u as Ut}from"./agent-icon-Db8xI2bq.js";import{i as Kt,a as Gt}from"./SearchMd-BfBE-dHK.js";import{a as Wt,u as qt,b as Ht}from"./use-connection-BCV5VAjQ.js";import{F as Yt,T as Z,g as oe,a as Q,b as ye,c as Jt,d as ee,e as Xt,S as Zt,R as Qt,f as en,h as tn,i as nn,t as sn,j as Me,k as rn,l as on,A as an,s as ln,m as cn,n as je,o as Oe,p as dn,q as un,r as re,u as H,v as Ve,w as mn,x as pn,y as ue,z as fn,B as hn}from"./index-CllFnV9J.js";import{B as xn,c as bn}from"./collections-BAHpsq0P.js";import{i as gn,c as vn,b as yn,e as jn}from"./extract-connection-data-DiYA0QYt.js";import{u as wn}from"./use-registry-connections-D0FgXcrs.js";import{a as Sn}from"./use-organization-settings-B98QP_Ve.js";import{s as Nn}from"./Plus-kLSd3TZy.js";import{e as $e,a as Cn,c as kn,d as _n,S as Rn,b as In}from"./select-DerdayxE.js";import"./index-QvZR-ABK.js";import{_ as te}from"./index-DA_fcz0a.js";import{I as Tn}from"./input-B5aMagwc.js";import{P as Dn,a as An,b as En}from"./popover-CGtNHDEz.js";import{u as Pn,b as Bn,a as Fn,T as Mn,c as On}from"./use-mobile-BACO9YYc.js";import{u as Vn}from"./use-virtual-mcp-CZoeCuBL.js";import{i as $n}from"./ChevronDown-BE0rQ4ho.js";import{a as zn}from"./Users03-C3QqJn94.js";import{u as Ln}from"./use-create-virtual-mcp-DPW_d2QJ.js";function Un(t){return{isImplementedBy:e=>{for(const s of t){const r=typeof s.name=="string"?new RegExp(`^${s.name}$`):s.name,o=e.find(i=>r.test(i.name));if(!(!o&&s.opt)&&!o)return!1}return!0}}}const Kn=C({id:m(),name:m(),description:m().optional(),inputSchema:Y(m(),W()),outputSchema:Y(m(),W()).optional()}),Gn=xn.extend({_meta:C({"io.decocms":C({id:m(),verified:L(),scopeName:m(),appName:m(),friendlyName:m().nullable().optional(),metadata:Y(m(),W()).nullable().optional(),publishedAt:m().datetime().optional(),updatedAt:m().datetime().optional(),tools:O(Kn).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:C({$schema:m().optional(),_meta:Y(m(),W()).optional(),name:m().describe("The server name (scope/app)"),title:m().optional().describe("User-friendly title"),description:m().optional().describe("Server description"),icons:O(C({src:m(),mimeType:m().optional(),sizes:O(m()).optional(),theme:ke(["light","dark"]).optional()})).optional(),remotes:O(C({type:ke(["http","stdio","sse"]),url:m().optional(),headers:O(W()).optional()})).optional(),packages:O(W()).optional(),repository:C({url:m(),source:m().optional(),subfolder:m().optional()}).optional(),version:m().optional(),websiteUrl:m().optional()})});bn("registry_app",Gn,{readOnly:!0});const Wn=C({specversion:Re("1.0").describe("CloudEvents specification version"),id:m().describe("Unique identifier for this event (UUID recommended)"),source:m().describe("Connection ID of the event publisher"),type:m().describe("Event type (e.g., 'order.created', 'user.signup')"),time:m().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:m().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:m().optional().default("application/json").describe("Content type of the data attribute"),dataschema:m().url().optional().describe("URI to the schema for the data attribute"),data:W().optional().describe("Event payload (any JSON value)")});C({events:O(Wn).min(1).describe("Batch of CloudEvents to process")});const qn=C({success:L().optional().describe("Whether this event was processed successfully"),error:m().optional().describe("Error message for this event"),retryAfter:$().int().positive().optional().describe("Re-deliver this event after this many ms")});C({success:L().optional().describe("Batch success - applies to events not in results"),error:m().optional().describe("Batch error message - applies to events not in results"),processedCount:$().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:$().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:Y(m(),qn).optional().describe("Per-event results keyed by event ID")});C({type:m().min(1).max(255).describe("Event type identifier"),subject:m().max(255).optional().describe("Subject/resource identifier (e.g., order ID)"),data:W().optional().describe("Event payload"),deliverAt:m().datetime().optional().describe("Scheduled delivery time (ISO 8601). Omit for immediate delivery."),cron:m().max(100).optional().describe("Cron expression for recurring delivery. Use EVENT_CANCEL to stop.")});C({id:m().describe("Unique event ID"),type:m().describe("Event type"),source:m().describe("Source connection ID"),time:m().describe("Event timestamp")});C({eventType:m().min(1).max(255).describe("Event type to subscribe to"),publisher:m().optional().describe("Filter events by publisher connection ID"),filter:m().max(1e3).optional().describe("JSONPath filter expression on event data")});C({subscription:C({id:m().describe("Subscription ID"),connectionId:m().describe("Subscriber connection ID"),eventType:m().describe("Event type pattern"),publisher:m().nullable().describe("Publisher connection filter"),filter:m().nullable().describe("JSONPath filter expression"),enabled:L().describe("Whether subscription is enabled"),createdAt:m().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:m().datetime().describe("Updated timestamp (ISO 8601)")})});const Hn=C({eventType:m().min(1).max(255).describe("Event type to subscribe to"),publisher:m().optional().describe("Filter events by publisher connection ID"),filter:m().max(1e3).optional().describe("JSONPath filter expression on event data")}),Yn=C({id:m().describe("Subscription ID"),connectionId:m().describe("Subscriber connection ID"),eventType:m().describe("Event type pattern"),publisher:m().nullable().describe("Publisher connection filter"),filter:m().nullable().describe("JSONPath filter expression"),enabled:L().describe("Whether subscription is enabled"),createdAt:m().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:m().datetime().describe("Updated timestamp (ISO 8601)")});C({subscriptions:O(Hn).describe("Desired subscriptions - system will create/update/delete to match")});C({created:$().int().min(0).describe("Number of subscriptions created"),updated:$().int().min(0).describe("Number of subscriptions with filter updated"),deleted:$().int().min(0).describe("Number of subscriptions removed"),unchanged:$().int().min(0).describe("Number of subscriptions unchanged"),subscriptions:O(Yn).describe("Current subscriptions after sync")});C({subscriptionId:m().describe("Subscription ID to remove")});C({success:L().describe("Whether unsubscribe was successful"),subscriptionId:m().describe("Subscription ID that was removed")});C({eventId:m().describe("Event ID to cancel")});C({success:L().describe("Whether cancellation was successful"),eventId:m().describe("Event ID that was cancelled")});C({eventId:m().describe("Event ID to acknowledge")});C({success:L().describe("Whether ACK was successful"),eventId:m().describe("Event ID that was acknowledged")});const Jn=C({type:Re("string"),enum:O(m()).optional(),description:m().optional()}),Xn=C({type:m(),description:m(),paramsSchema:Y(m(),Jn)});C({});C({triggers:O(Xn)});C({type:m(),params:Y(m(),m()),enabled:L(),callbackUrl:Ct().optional(),callbackToken:m().min(1).optional()});C({success:L()});C({prefix:m().optional().describe("Filter objects by prefix (e.g., 'folder/' for folder contents)"),maxKeys:$().optional().default(1e3).describe("Maximum number of keys to return (default: 1000)"),continuationToken:m().optional().describe("Token for pagination from previous response"),delimiter:m().optional().describe("Delimiter for grouping keys (typically '/'). When set, commonPrefixes returns folder paths.")});C({objects:O(C({key:m().describe("Object key/path"),size:$().describe("Object size in bytes"),lastModified:m().describe("Last modified timestamp"),etag:m().describe("Entity tag for the object")})),nextContinuationToken:m().optional().describe("Token for fetching next page of results"),isTruncated:L().describe("Whether there are more results available"),commonPrefixes:O(m()).optional().describe("Folder paths when delimiter is used (e.g., ['photos/2024/', 'photos/2025/'])")});C({key:m().describe("Object key/path to get metadata for")});C({contentType:m().optional().describe("MIME type of the object"),contentLength:$().describe("Size of the object in bytes"),lastModified:m().describe("Last modified timestamp"),etag:m().describe("Entity tag for the object"),metadata:Y(m(),m()).optional().describe("Custom metadata key-value pairs")});C({key:m().describe("Object key/path to generate URL for"),expiresIn:$().optional().describe("URL expiration time in seconds (default: from state config or 3600)")});C({url:m().describe("Presigned URL for downloading the object"),expiresIn:$().describe("Expiration time in seconds that was used")});C({key:m().describe("Object key/path for the upload"),expiresIn:$().optional().describe("URL expiration time in seconds (default: from state config or 3600)"),contentType:m().optional().describe("MIME type for the object being uploaded")});C({url:m().describe("Presigned URL for uploading the object"),expiresIn:$().describe("Expiration time in seconds that was used")});C({key:m().describe("Object key/path to delete")});C({success:L().describe("Whether the deletion was successful"),key:m().describe("The key that was deleted")});C({keys:O(m()).max(1e3).describe("Array of object keys/paths to delete (max 1000)")});C({deleted:O(m()).describe("Array of successfully deleted keys"),errors:O(C({key:m(),message:m()})).describe("Array of errors for failed deletions")});const Zn=C({primary:m().optional().describe("Primary brand color (hex)"),secondary:m().optional().describe("Secondary brand color (hex)"),accent:m().optional().describe("Accent / highlight color (hex)"),background:m().optional().describe("Background color (hex)"),foreground:m().optional().describe("Foreground / text color (hex)")}),Qn=C({heading:m().optional().describe("Font family for headings"),body:m().optional().describe("Font family for body text"),code:m().optional().describe("Font family for code / monospace")}),es=C({logo:m().optional().describe("Logo URL"),favicon:m().optional().describe("Favicon URL"),ogImage:m().optional().describe("Open Graph image URL")}),ts=C({id:m(),name:m().describe("Brand / company name"),domain:m().optional().describe("Company domain (e.g. example.com)"),colors:Zn.optional().describe("Semantic color palette"),fonts:Qn.optional().describe("Font families by role"),assets:es.optional().describe("Visual identity assets"),overview:m().optional().describe("Company overview / description"),tagline:m().optional().describe("Brand tagline"),tone:m().optional().describe("Tone of voice description"),metadata:Y(m(),W()).optional().describe("Extra design tokens and metadata")});C({id:m().optional().describe("Brand ID. Omit to get the default brand.")});C({});C({items:O(ts)});const ns={"@deco/event-bus":"EVENT_BUS","@deco/llm":"LLMS","@deco/trigger":"TRIGGER","@deco/object-storage":"OBJECT_STORAGE","@deco/brand":"BRAND"};function ss(t){if(t)return ns[t]}function Yo(t,e){const s=t.tools;if(!s||s.length===0)return!1;const r=s.map(a=>({name:a.name,inputSchema:a.inputSchema})),o=e.map(a=>({name:a.name,inputSchema:a.inputSchema,opt:a.opt}));return Un(o).isImplementedBy(r)}function rs(t){return t.startsWith("@")?t:`@${t}`}function os(){const{org:t}=he(),{data:e}=kt.useSession(),s=Wt(),r=wn(),o=Sn(),i=r.filter(c=>o(c.id));return{installByBinding:async c=>{if(!t||!e?.user?.id){ae.error("Not authenticated");return}const u=rs(c),p=(await Promise.all(i.map(async g=>{const v=gn(g.id,t.id);try{const y=await vn(g.id,t.id,v,{where:{appName:u}});return yn(y??[])[0]??null}catch{return null}}))).find(g=>g!==null);if(!p){ae.error(`MCP Server not found in registry: ${c}`);return}const l=jn(p,t.id,e.user.id),d=l.connection_type==="STDIO",b=!!l.connection_url,h=d&&l.connection_headers&&typeof l.connection_headers=="object"&&"command"in l.connection_headers;if(!b&&!h){ae.error("This MCP Server cannot be connected: no connection method available");return}return await s.create.mutateAsync(l),{id:l.id,connection:l}},isInstalling:s.create.isPending}}function is(t){return j.forwardRef(({fields:e,widgets:s,templates:r,...o},i)=>(e={...t?.fields,...e},s={...t?.widgets,...s},r={...t?.templates,...r,ButtonTemplates:{...t?.templates?.ButtonTemplates,...r?.ButtonTemplates}},n.jsx(Yt,{...t,...o,fields:e,widgets:s,templates:r,ref:i})))}const as=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ls=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,s,r)=>r?r.toUpperCase():s.toLowerCase()),_e=t=>{const e=ls(t);return e.charAt(0).toUpperCase()+e.slice(1)},ze=(...t)=>t.filter((e,s,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===s).join(" ").trim(),cs=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var ds={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const us=j.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...c},u)=>j.createElement("svg",{ref:u,...ds,width:e,height:e,stroke:t,strokeWidth:r?Number(s)*24/Number(e):s,className:ze("lucide",o),...!i&&!cs(c)&&{"aria-hidden":"true"},...c},[...a.map(([f,p])=>j.createElement(f,p)),...Array.isArray(i)?i:[i]]));const K=(t,e)=>{const s=j.forwardRef(({className:r,...o},i)=>j.createElement(us,{ref:i,iconNode:e,className:ze(`lucide-${as(_e(t))}`,`lucide-${t}`,r),...o}));return s.displayName=_e(t),s};const ms=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ps=K("check",ms);const fs=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Le=K("chevron-down",fs);const hs=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],xs=K("chevron-up",hs);const bs=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],gs=K("circle-alert",bs);const vs=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],Ue=K("circle-plus",vs);const ys=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],js=K("circle",ys);const ws=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Ss=K("copy",ws);const Ns=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Cs=K("search",Ns);const ks=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],_s=K("trash-2",ks);const Rs=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ke=K("x",Rs);function I(...t){return _t(Rt(t))}const Is=xe("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",xs:"h-6 rounded-md gap-1 px-2 has-[>svg]:px-2",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function we({className:t,variant:e,size:s,asChild:r=!1,...o}){const i=r?Ie:"button";return n.jsx(i,{"data-slot":"button",className:I(Is({variant:e,size:s,className:t})),...o})}function Ts({uiSchema:t,registry:e,className:s,...r}){const{translateString:o}=e;return n.jsx("div",{className:"p-0 m-0",children:n.jsxs(we,{...r,className:I("w-fit gap-2",s),variant:"outline",type:"button",children:[n.jsx(Ue,{size:16})," ",o(Z.AddItemButton)]})})}function Ds(t){const{children:e,buttonsProps:s,displayLabel:r,hasDescription:o,hasToolbar:i,uiSchema:a,registry:c}=t,u=oe(a),f=Q("ArrayFieldItemButtonsTemplate",c,u),p=o?-6:22;return n.jsx("div",{children:n.jsxs("div",{className:"mb-2 flex flex-row flex-wrap items-center",children:[n.jsx("div",{className:"grow shrink",children:e}),n.jsx("div",{className:"flex items-end justify-end p-0.5",children:i&&n.jsx("div",{className:"flex gap-2",style:{marginLeft:"5px",marginTop:r?`${p}px`:void 0},children:n.jsx(f,{...s})})})]})})}function As(t){const{canAdd:e,disabled:s,fieldPathId:r,uiSchema:o,items:i,optionalDataControl:a,onAddClick:c,readonly:u,registry:f,required:p,schema:l,title:d}=t,b=oe(o),h=Q("ArrayFieldDescriptionTemplate",f,b),g=Q("ArrayFieldTitleTemplate",f,b),v=!u&&!s,{ButtonTemplates:{AddButton:y}}=f.templates;return n.jsx("div",{children:n.jsx("div",{className:"m-0 flex p-0",children:n.jsxs("div",{className:"m-0 w-full p-0",children:[n.jsx(g,{fieldPathId:r,title:b.title||d,schema:l,uiSchema:o,required:p,registry:f,optionalDataControl:v?a:void 0}),n.jsx(h,{fieldPathId:r,description:b.description||l.description,schema:l,uiSchema:o,registry:f}),n.jsxs("div",{className:"p-0 m-0 w-full mb-2",children:[v?void 0:a,i,e&&n.jsx("div",{className:"mt-2 flex justify-end",children:n.jsx(y,{id:ye(r,"add"),className:"rjsf-array-item-add",onClick:c,disabled:s||u,uiSchema:o,registry:f})})]},`array-item-list-${r.$id}`)]})})})}function Ge({className:t,type:e,...s}){return n.jsx("input",{type:e,"data-slot":"input",className:I("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...s})}function Es({id:t,htmlName:e,placeholder:s,required:r,readonly:o,disabled:i,type:a,value:c,onChange:u,onChangeOverride:f,onBlur:p,onFocus:l,autofocus:d,options:b,schema:h,rawErrors:g=[],children:v,extraProps:y,className:x,registry:w}){const{ClearButton:N}=w.templates.ButtonTemplates,R={...y,...Jt(h,a,b)},k=({target:{value:E}})=>u(E===""?b.emptyValue:E),S=({target:E})=>p(t,E&&E.value),_=({target:E})=>l(t,E&&E.value),D=j.useCallback(E=>{var T;E.preventDefault(),E.stopPropagation(),u((T=b.emptyValue)!==null&&T!==void 0?T:"")},[u,b.emptyValue]);return n.jsxs("div",{className:"p-0.5",children:[n.jsx(Ge,{id:t,name:e||t,type:a,placeholder:s,autoFocus:d,required:r,disabled:i,readOnly:o,className:I({"border-destructive focus-visible:ring-0":g.length>0},x),list:h.examples?Xt(t):void 0,...R,value:c||c===0?c:"",onChange:f||k,onBlur:S,onFocus:_,"aria-describedby":ee(t,!!h.examples)}),b.allowClearTextInputs&&!o&&!i&&c&&n.jsx(N,{onClick:D,registry:w}),v,n.jsx(Zt,{id:t,schema:h})]})}function Ps({id:t,description:e,registry:s,uiSchema:r}){return e?n.jsx("div",{children:n.jsx("div",{id:t,className:"text-sm text-muted-foreground",children:n.jsx(Qt,{description:e,registry:s,uiSchema:r})})}):null}const Bs=xe("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function Fs({className:t,variant:e,...s}){return n.jsx("div",{"data-slot":"alert",role:"alert",className:I(Bs({variant:e}),t),...s})}function Ms({className:t,...e}){return n.jsx("div",{"data-slot":"alert-title",className:I("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...e})}function Os({className:t,...e}){return n.jsx("div",{"data-slot":"alert-description",className:I("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...e})}function Vs({errors:t,registry:e}){const{translateString:s}=e;return n.jsxs(Fs,{variant:"destructive",className:"mb-2",children:[n.jsx(gs,{className:"h-4 w-4"}),n.jsx(Ms,{children:s(Z.ErrorsLabel)}),n.jsx(Os,{className:"flex flex-col gap-1",children:t.map((r,o)=>n.jsxs("span",{children:["• ",r.stack]},o))})]})}function $s(t){const{errors:e=[],fieldPathId:s}=t;if(e.length===0)return null;const r=en(s);return n.jsx("div",{className:"flex flex-col gap-1",id:r,children:e.map((o,i)=>n.jsx("span",{className:"text-xs font-medium text-destructive mb-1",children:o},i))})}function zs(t){const{fieldPathId:e,help:s,uiSchema:r,registry:o,hasErrors:i}=t;return s?n.jsx("span",{className:I("text-xs font-medium text-muted-foreground",{"text-destructive":i}),id:nn(e),children:n.jsx(tn,{help:s,registry:o,uiSchema:r})}):null}function Ls({id:t,children:e,displayLabel:s,rawErrors:r=[],errors:o,help:i,description:a,rawDescription:c,classNames:u,style:f,disabled:p,label:l,hidden:d,onKeyRename:b,onKeyRenameBlur:h,onRemoveProperty:g,readonly:v,required:y,schema:x,uiSchema:w,registry:N}){const R=oe(w),k=Q("WrapIfAdditionalTemplate",N,R);if(d)return n.jsx("div",{className:"hidden",children:e});const S=R.widget==="checkbox";return n.jsx(k,{classNames:u,style:f,disabled:p,id:t,label:l,displayLabel:s,onKeyRename:b,onKeyRenameBlur:h,onRemoveProperty:g,rawDescription:c,readonly:v,required:y,schema:x,uiSchema:w,registry:N,children:n.jsxs("div",{className:"flex flex-col gap-2",children:[s&&!S&&n.jsxs("label",{className:I("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{" text-destructive":r.length>0}),htmlFor:t,children:[l,y?"*":null]}),e,s&&c&&!S&&n.jsx("span",{className:I("text-xs font-medium text-muted-foreground",{" text-destructive":r.length>0}),children:a}),o,i]})})}function Us(t){const{children:e,column:s,className:r,...o}=t;return n.jsx("div",{className:I("grid gap-2",r),...o,children:e})}function ne(t){const{icon:e,iconType:s,className:r,uiSchema:o,registry:i,...a}=t;return n.jsx(we,{size:"icon",variant:"outline",className:r,...a,type:"button",children:e})}function Ks(t){const{registry:{translateString:e}}=t;return n.jsx(ne,{title:e(Z.CopyButton),...t,icon:n.jsx(Ss,{className:"h-4 w-4"})})}function Gs(t){const{registry:{translateString:e}}=t;return n.jsx(ne,{title:e(Z.MoveDownButton),...t,icon:n.jsx(Le,{className:"h-4 w-4"})})}function Ws(t){const{registry:{translateString:e}}=t;return n.jsx(ne,{title:e(Z.MoveUpButton),...t,icon:n.jsx(xs,{className:"h-4 w-4"})})}function We(t){const{registry:{translateString:e}}=t;return n.jsx(ne,{title:e(Z.RemoveButton),...t,className:"border-destructive",icon:n.jsx(_s,{className:"h-4 w-4 stroke-destructive"})})}function qs(t){const{registry:{translateString:e}}=t;return n.jsx(ne,{title:e(Z.ClearButton),...t,icon:n.jsx(Ke,{})})}function Hs({selector:t,optionSchemaField:e}){return n.jsxs("div",{className:I("p-4 border rounded-md bg-background shadow-sm"),children:[n.jsx("div",{className:I("mb-4"),children:t}),e]})}function Ys({description:t,title:e,properties:s,required:r,uiSchema:o,fieldPathId:i,schema:a,formData:c,optionalDataControl:u,onAddProperty:f,disabled:p,readonly:l,registry:d}){const b=oe(o),h=Q("TitleFieldTemplate",d,b),g=Q("DescriptionFieldTemplate",d,b),v=!l&&!p,{ButtonTemplates:{AddButton:y}}=d.templates;return n.jsxs(n.Fragment,{children:[e&&n.jsx(h,{id:sn(i),title:e,required:r,schema:a,uiSchema:o,registry:d,optionalDataControl:v?u:void 0}),t&&n.jsx(g,{id:Me(i),description:t,schema:a,uiSchema:o,registry:d}),n.jsxs("div",{className:"flex flex-col gap-2",children:[v?void 0:u,s.map((x,w)=>n.jsx("div",{className:`${x.hidden?"hidden":""} flex`,children:n.jsx("div",{className:"w-full",children:x.content})},w)),rn(a,o,c)?n.jsx("div",{className:"mt-2 flex justify-end",children:n.jsx(y,{id:ye(i,"add"),onClick:f,disabled:p||l,className:"rjsf-object-property-expand",uiSchema:o,registry:d})}):null]})]})}function Js(t){const{id:e,registry:s,label:r,onAddClick:o,onRemoveClick:i}=t;return o?n.jsx(ne,{id:e,registry:s,className:"rjsf-add-optional-data",onClick:o,title:r,icon:n.jsx(Ue,{}),size:"xs"}):i?n.jsx(We,{id:e,registry:s,className:"rjsf-remove-optional-data",onClick:i,title:r,size:"xs"}):n.jsx("em",{id:e,children:r})}function Xs(t){const{submitText:e,norender:s,props:r}=on(t.uiSchema);return s?null:n.jsx("div",{children:n.jsx(we,{type:"submit",...r,className:I("my-2",r?.className),children:e})})}function qe({className:t,orientation:e="horizontal",decorative:s=!0,...r}){return n.jsx(It,{"data-slot":"separator",decorative:s,orientation:e,className:I("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}function Zs({id:t,title:e,uiSchema:s,optionalDataControl:r}){const o=oe(s);let i=n.jsx("h5",{children:o.title||e});return r&&(i=n.jsxs("div",{className:"flex flex-row",children:[n.jsx("div",{className:"flex-grow",children:i}),n.jsx("div",{className:"flex",children:r})]})),n.jsxs("div",{id:t,className:"my-1 flex flex-col gap-0.5",children:[i,n.jsx(qe,{dir:"horizontal",style:{height:"1px"},className:"my-1"})]})}function Qs({classNames:t,style:e,children:s,disabled:r,id:o,label:i,displayLabel:a,onRemoveProperty:c,onKeyRenameBlur:u,rawDescription:f,readonly:p,required:l,schema:d,uiSchema:b,registry:h}){const{templates:g,translateString:v}=h,{RemoveButton:y}=g.ButtonTemplates,x=v(Z.KeyLabel,[i]);if(!(an in d))return n.jsx("div",{className:t,style:e,children:s});const R=a?22+(f?-28:0):0,k=`${o}-key`;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:`grid grid-cols-12 col-span-12 items-center gap-2 ${t}`,style:e,children:[n.jsx("div",{className:"grid gap-2 col-span-5",children:n.jsxs("div",{className:"flex flex-col gap-2",children:[a&&n.jsx("label",{htmlFor:k,className:"text-sm font-medium text-muted-foreground leading-none",children:x}),n.jsx("div",{className:"pl-0.5",children:n.jsx(Ge,{required:l,defaultValue:i,disabled:r||p,id:k,name:k,onBlur:p?void 0:u,type:"text",className:"w-full border shadow-sm"},i)}),!!f&&n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n.jsx("div",{className:"text-sm text-muted-foreground",children:" "})})]})}),n.jsx("div",{className:"grid gap-2 col-span-6 pr-0.5",children:s}),n.jsx("div",{className:"grid gap-2 col-span-1",style:{marginTop:`${R}px`},children:n.jsx(y,{id:ye(o,"remove"),iconType:"block",className:"rjsf-object-property-remove w-full",disabled:r||p,onClick:c,uiSchema:b,registry:h})})]}),n.jsx(qe,{dir:"horizontal",className:"mt-2"})]})}function er(){return{ArrayFieldItemTemplate:Ds,ArrayFieldTemplate:As,BaseInputTemplate:Es,ButtonTemplates:{AddButton:Ts,CopyButton:Ks,MoveDownButton:Gs,MoveUpButton:Ws,RemoveButton:We,SubmitButton:Xs,ClearButton:qs},DescriptionFieldTemplate:Ps,ErrorListTemplate:Vs,FieldErrorTemplate:$s,FieldHelpTemplate:zs,FieldTemplate:Ls,GridTemplate:Us,MultiSchemaFieldTemplate:Hs,ObjectFieldTemplate:Ys,OptionalDataControlsTemplate:Js,TitleFieldTemplate:Zs,WrapIfAdditionalTemplate:Qs}}function tr(t,e){if(t==null)return{};var s={},r=Object.keys(t),o,i;for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(s[o]=t[o]);return s}var nr=["color"],sr=j.forwardRef(function(t,e){var s=t.color,r=s===void 0?"currentColor":s,o=tr(t,nr);return j.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),j.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function He({className:t,...e}){return n.jsx(Tt,{"data-slot":"checkbox",className:I("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:n.jsx(Dt,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:n.jsx(sr,{className:"size-3.5"})})})}function Se({className:t,...e}){return n.jsx(At,{"data-slot":"label",className:I("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function rr(t){const{id:e,htmlName:s,value:r,disabled:o,readonly:i,label:a,hideLabel:c,schema:u,autofocus:f,options:p,onChange:l,onBlur:d,onFocus:b,registry:h,uiSchema:g,className:v}=t,y=ln(u),x=Q("DescriptionFieldTemplate",h,p),w=S=>l(S),N=()=>d(e,r),R=()=>b(e,r),k=p.description||u.description;return n.jsxs("div",{className:`relative ${o||i?"cursor-not-allowed opacity-50":""}`,"aria-describedby":ee(e),children:[!c&&k&&n.jsx(x,{id:Me(e),description:k,schema:u,uiSchema:g,registry:h}),n.jsxs("div",{className:"flex items-center gap-2 my-2",children:[n.jsx(He,{id:e,name:s||e,checked:typeof r>"u"?!1:!!r,required:y,disabled:o||i,autoFocus:f,onCheckedChange:w,onBlur:N,onFocus:R,className:v}),n.jsx(Se,{className:"leading-tight",htmlFor:e,children:cn(a,c||!a)})]})]})}function or({id:t,htmlName:e,disabled:s,options:r,value:o,autofocus:i,readonly:a,required:c,onChange:u,onBlur:f,onFocus:p,className:l}){const{enumOptions:d,enumDisabled:b,inline:h,emptyValue:g}=r,v=je(r),y=Array.isArray(o)?o:[o],x=({target:N})=>f(t,H(N&&N.value,d,v,g)),w=({target:N})=>p(t,H(N&&N.value,d,v,g));return n.jsx("div",{className:I({"flex flex-col gap-2":!h,"flex flex-row gap-4 flex-wrap":h}),children:Array.isArray(d)&&d.map((N,R)=>{const k=Oe(N.value,y),S=Array.isArray(b)&&b.indexOf(N.value)!==-1,_=re(t,R);return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(He,{id:_,name:e||t,required:c,disabled:s||S||a,onCheckedChange:D=>{u(D?dn(R,y,d):un(R,y,d))},className:l,checked:k,autoFocus:i&&R===0,onBlur:x,onFocus:w,"aria-describedby":ee(t)}),n.jsx(Se,{className:"leading-tight",htmlFor:re(t,R),children:N.label})]},_)})})}var Ne="Radio",[ir,Ye]=be(Ne),[ar,lr]=ir(Ne),Je=j.forwardRef((t,e)=>{const{__scopeRadio:s,name:r,checked:o=!1,required:i,disabled:a,value:c="on",onCheck:u,form:f,...p}=t,[l,d]=j.useState(null),b=X(e,v=>d(v)),h=j.useRef(!1),g=l?f||!!l.closest("form"):!0;return n.jsxs(ar,{scope:s,checked:o,disabled:a,children:[n.jsx(J.button,{type:"button",role:"radio","aria-checked":o,"data-state":et(o),"data-disabled":a?"":void 0,disabled:a,value:c,...p,ref:b,onClick:q(t.onClick,v=>{o||u?.(),g&&(h.current=v.isPropagationStopped(),h.current||v.stopPropagation())})}),g&&n.jsx(Qe,{control:l,bubbles:!h.current,name:r,value:c,checked:o,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});Je.displayName=Ne;var Xe="RadioIndicator",Ze=j.forwardRef((t,e)=>{const{__scopeRadio:s,forceMount:r,...o}=t,i=lr(Xe,s);return n.jsx(Bt,{present:r||i.checked,children:n.jsx(J.span,{"data-state":et(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:e})})});Ze.displayName=Xe;var cr="RadioBubbleInput",Qe=j.forwardRef(({__scopeRadio:t,control:e,checked:s,bubbles:r=!0,...o},i)=>{const a=j.useRef(null),c=X(a,i),u=Ee(s),f=Pe(e);return j.useEffect(()=>{const p=a.current;if(!p)return;const l=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(l,"checked").set;if(u!==s&&b){const h=new Event("click",{bubbles:r});b.call(p,s),p.dispatchEvent(h)}},[u,s,r]),n.jsx(J.input,{type:"radio","aria-hidden":!0,defaultChecked:s,...o,tabIndex:-1,ref:c,style:{...o.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Qe.displayName=cr;function et(t){return t?"checked":"unchecked"}var dr=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ce="RadioGroup",[ur]=be(ce,[Ae,Ye]),tt=Ae(),nt=Ye(),[mr,pr]=ur(ce),st=j.forwardRef((t,e)=>{const{__scopeRadioGroup:s,name:r,defaultValue:o,value:i,required:a=!1,disabled:c=!1,orientation:u,dir:f,loop:p=!0,onValueChange:l,...d}=t,b=tt(s),h=Te(f),[g,v]=De({prop:i,defaultProp:o??null,onChange:l,caller:ce});return n.jsx(mr,{scope:s,name:r,required:a,disabled:c,value:g,onValueChange:v,children:n.jsx(Et,{asChild:!0,...b,orientation:u,dir:h,loop:p,children:n.jsx(J.div,{role:"radiogroup","aria-required":a,"aria-orientation":u,"data-disabled":c?"":void 0,dir:h,...d,ref:e})})})});st.displayName=ce;var rt="RadioGroupItem",ot=j.forwardRef((t,e)=>{const{__scopeRadioGroup:s,disabled:r,...o}=t,i=pr(rt,s),a=i.disabled||r,c=tt(s),u=nt(s),f=j.useRef(null),p=X(e,f),l=i.value===o.value,d=j.useRef(!1);return j.useEffect(()=>{const b=g=>{dr.includes(g.key)&&(d.current=!0)},h=()=>d.current=!1;return document.addEventListener("keydown",b),document.addEventListener("keyup",h),()=>{document.removeEventListener("keydown",b),document.removeEventListener("keyup",h)}},[]),n.jsx(Pt,{asChild:!0,...c,focusable:!a,active:l,children:n.jsx(Je,{disabled:a,required:i.required,checked:l,...u,...o,name:i.name,ref:p,onCheck:()=>i.onValueChange(o.value),onKeyDown:q(b=>{b.key==="Enter"&&b.preventDefault()}),onFocus:q(o.onFocus,()=>{d.current&&f.current?.click()})})})});ot.displayName=rt;var fr="RadioGroupIndicator",it=j.forwardRef((t,e)=>{const{__scopeRadioGroup:s,...r}=t,o=nt(s);return n.jsx(Ze,{...o,...r,ref:e})});it.displayName=fr;var hr=st,xr=ot,br=it;function gr({className:t,...e}){return n.jsx(hr,{"data-slot":"radio-group",className:I("grid gap-3",t),...e})}function vr({className:t,...e}){return n.jsx(xr,{"data-slot":"radio-group-item",className:I("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:n.jsx(br,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:n.jsx(js,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function yr({id:t,options:e,value:s,required:r,disabled:o,readonly:i,onChange:a,onBlur:c,onFocus:u,className:f}){const{enumOptions:p,enumDisabled:l,emptyValue:d}=e,b=je(e),h=x=>a(H(x,p,b,d)),g=({target:x})=>c(t,H(x&&x.value,p,b,d)),v=({target:x})=>u(t,H(x&&x.value,p,b,d)),y=!!(e&&e.inline);return n.jsx("div",{className:"mb-0",children:n.jsx(gr,{defaultValue:s?.toString(),required:r,disabled:o||i,onValueChange:x=>{h(x)},onBlur:g,onFocus:v,"aria-describedby":ee(t),orientation:y?"horizontal":"vertical",className:I("flex flex-wrap",{"flex-col":!y},f),children:Array.isArray(p)&&p.map((x,w)=>{const N=Array.isArray(l)&&l.indexOf(x.value)!==-1,R=Oe(x.value,s);return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(vr,{checked:R,value:Ve(x.value,w,b),id:re(t,w),disabled:N}),n.jsx(Se,{className:"leading-tight",htmlFor:re(t,w),children:x.label})]},re(t,w))})})})}var at=["PageUp","PageDown"],lt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ct={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},se="Slider",[me,jr,wr]=Ft(se),[dt]=be(se,[wr]),[Sr,de]=dt(se),ut=j.forwardRef((t,e)=>{const{name:s,min:r=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:f=[r],value:p,onValueChange:l=()=>{},onValueCommit:d=()=>{},inverted:b=!1,form:h,...g}=t,v=j.useRef(new Set),y=j.useRef(0),w=a==="horizontal"?Nr:Cr,[N=[],R]=De({prop:p,defaultProp:f,onChange:T=>{[...v.current][y.current]?.focus(),l(T)}}),k=j.useRef(N);function S(T){const A=Tr(N,T);E(T,A)}function _(T){E(T,y.current)}function D(){const T=k.current[y.current];N[y.current]!==T&&d(N)}function E(T,A,{commit:P}={commit:!1}){const F=Pr(i),M=Br(Math.round((T-r)/i)*i+r,F),B=$e(M,[r,o]);R((z=[])=>{const U=Rr(z,B,A);if(Er(U,u*i)){y.current=U.indexOf(B);const G=String(U)!==String(z);return G&&P&&d(U),G?U:z}else return z})}return n.jsx(Sr,{scope:t.__scopeSlider,name:s,disabled:c,min:r,max:o,valueIndexToChangeRef:y,thumbs:v.current,values:N,orientation:a,form:h,children:n.jsx(me.Provider,{scope:t.__scopeSlider,children:n.jsx(me.Slot,{scope:t.__scopeSlider,children:n.jsx(w,{"aria-disabled":c,"data-disabled":c?"":void 0,...g,ref:e,onPointerDown:q(g.onPointerDown,()=>{c||(k.current=N)}),min:r,max:o,inverted:b,onSlideStart:c?void 0:S,onSlideMove:c?void 0:_,onSlideEnd:c?void 0:D,onHomeKeyDown:()=>!c&&E(r,0,{commit:!0}),onEndKeyDown:()=>!c&&E(o,N.length-1,{commit:!0}),onStepKeyDown:({event:T,direction:A})=>{if(!c){const M=at.includes(T.key)||T.shiftKey&&lt.includes(T.key)?10:1,B=y.current,z=N[B],U=i*M*A;E(z+U,B,{commit:!0})}}})})})})});ut.displayName=se;var[mt,pt]=dt(se,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Nr=j.forwardRef((t,e)=>{const{min:s,max:r,dir:o,inverted:i,onSlideStart:a,onSlideMove:c,onSlideEnd:u,onStepKeyDown:f,...p}=t,[l,d]=j.useState(null),b=X(e,w=>d(w)),h=j.useRef(void 0),g=Te(o),v=g==="ltr",y=v&&!i||!v&&i;function x(w){const N=h.current||l.getBoundingClientRect(),R=[0,N.width],S=Ce(R,y?[s,r]:[r,s]);return h.current=N,S(w-N.left)}return n.jsx(mt,{scope:t.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:n.jsx(ft,{dir:g,"data-orientation":"horizontal",...p,ref:b,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const N=x(w.clientX);a?.(N)},onSlideMove:w=>{const N=x(w.clientX);c?.(N)},onSlideEnd:()=>{h.current=void 0,u?.()},onStepKeyDown:w=>{const R=ct[y?"from-left":"from-right"].includes(w.key);f?.({event:w,direction:R?-1:1})}})})}),Cr=j.forwardRef((t,e)=>{const{min:s,max:r,inverted:o,onSlideStart:i,onSlideMove:a,onSlideEnd:c,onStepKeyDown:u,...f}=t,p=j.useRef(null),l=X(e,p),d=j.useRef(void 0),b=!o;function h(g){const v=d.current||p.current.getBoundingClientRect(),y=[0,v.height],w=Ce(y,b?[r,s]:[s,r]);return d.current=v,w(g-v.top)}return n.jsx(mt,{scope:t.__scopeSlider,startEdge:b?"bottom":"top",endEdge:b?"top":"bottom",size:"height",direction:b?1:-1,children:n.jsx(ft,{"data-orientation":"vertical",...f,ref:l,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const v=h(g.clientY);i?.(v)},onSlideMove:g=>{const v=h(g.clientY);a?.(v)},onSlideEnd:()=>{d.current=void 0,c?.()},onStepKeyDown:g=>{const y=ct[b?"from-bottom":"from-top"].includes(g.key);u?.({event:g,direction:y?-1:1})}})})}),ft=j.forwardRef((t,e)=>{const{__scopeSlider:s,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:c,onStepKeyDown:u,...f}=t,p=de(se,s);return n.jsx(J.span,{...f,ref:e,onKeyDown:q(t.onKeyDown,l=>{l.key==="Home"?(a(l),l.preventDefault()):l.key==="End"?(c(l),l.preventDefault()):at.concat(lt).includes(l.key)&&(u(l),l.preventDefault())}),onPointerDown:q(t.onPointerDown,l=>{const d=l.target;d.setPointerCapture(l.pointerId),l.preventDefault(),p.thumbs.has(d)?d.focus():r(l)}),onPointerMove:q(t.onPointerMove,l=>{l.target.hasPointerCapture(l.pointerId)&&o(l)}),onPointerUp:q(t.onPointerUp,l=>{const d=l.target;d.hasPointerCapture(l.pointerId)&&(d.releasePointerCapture(l.pointerId),i(l))})})}),ht="SliderTrack",xt=j.forwardRef((t,e)=>{const{__scopeSlider:s,...r}=t,o=de(ht,s);return n.jsx(J.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:e})});xt.displayName=ht;var pe="SliderRange",bt=j.forwardRef((t,e)=>{const{__scopeSlider:s,...r}=t,o=de(pe,s),i=pt(pe,s),a=j.useRef(null),c=X(e,a),u=o.values.length,f=o.values.map(d=>yt(d,o.min,o.max)),p=u>1?Math.min(...f):0,l=100-Math.max(...f);return n.jsx(J.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:c,style:{...t.style,[i.startEdge]:p+"%",[i.endEdge]:l+"%"}})});bt.displayName=pe;var fe="SliderThumb",gt=j.forwardRef((t,e)=>{const s=jr(t.__scopeSlider),[r,o]=j.useState(null),i=X(e,c=>o(c)),a=j.useMemo(()=>r?s().findIndex(c=>c.ref.current===r):-1,[s,r]);return n.jsx(kr,{...t,ref:i,index:a})}),kr=j.forwardRef((t,e)=>{const{__scopeSlider:s,index:r,name:o,...i}=t,a=de(fe,s),c=pt(fe,s),[u,f]=j.useState(null),p=X(e,x=>f(x)),l=u?a.form||!!u.closest("form"):!0,d=Pe(u),b=a.values[r],h=b===void 0?0:yt(b,a.min,a.max),g=Ir(r,a.values.length),v=d?.[c.size],y=v?Dr(v,h,c.direction):0;return j.useEffect(()=>{if(u)return a.thumbs.add(u),()=>{a.thumbs.delete(u)}},[u,a.thumbs]),n.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${h}% + ${y}px)`},children:[n.jsx(me.ItemSlot,{scope:t.__scopeSlider,children:n.jsx(J.span,{role:"slider","aria-label":t["aria-label"]||g,"aria-valuemin":a.min,"aria-valuenow":b,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:p,style:b===void 0?{display:"none"}:t.style,onFocus:q(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),l&&n.jsx(vt,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:b},r)]})});gt.displayName=fe;var _r="RadioBubbleInput",vt=j.forwardRef(({__scopeSlider:t,value:e,...s},r)=>{const o=j.useRef(null),i=X(o,r),a=Ee(e);return j.useEffect(()=>{const c=o.current;if(!c)return;const u=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==e&&p){const l=new Event("input",{bubbles:!0});p.call(c,e),c.dispatchEvent(l)}},[a,e]),n.jsx(J.input,{style:{display:"none"},...s,ref:i,defaultValue:e})});vt.displayName=_r;function Rr(t=[],e,s){const r=[...t];return r[s]=e,r.sort((o,i)=>o-i)}function yt(t,e,s){const i=100/(s-e)*(t-e);return $e(i,[0,100])}function Ir(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function Tr(t,e){if(t.length===1)return 0;const s=t.map(o=>Math.abs(o-e)),r=Math.min(...s);return s.indexOf(r)}function Dr(t,e,s){const r=t/2,i=Ce([0,50],[0,r]);return(r-i(e)*s)*s}function Ar(t){return t.slice(0,-1).map((e,s)=>t[s+1]-e)}function Er(t,e){if(e>0){const s=Ar(t);return Math.min(...s)>=e}return!0}function Ce(t,e){return s=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(s-t[0])}}function Pr(t){return(String(t).split(".")[1]||"").length}function Br(t,e){const s=Math.pow(10,e);return Math.round(t*s)/s}var Fr=ut,Mr=xt,Or=bt,Vr=gt;function $r({className:t,defaultValue:e,value:s,min:r=0,max:o=100,...i}){const a=j.useMemo(()=>Array.isArray(s)?s:Array.isArray(e)?e:[r,o],[s,e,r,o]);return n.jsxs(Fr,{"data-slot":"slider",defaultValue:e,value:s,min:r,max:o,className:I("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...i,children:[n.jsx(Mr,{"data-slot":"slider-track",className:I("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:n.jsx(Or,{"data-slot":"slider-range",className:I("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:a.length},(c,u)=>n.jsx(Vr,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},u))]})}const zr=["name","min","max","step","orientation","disabled","defaultValue","value","onValueChange","className","dir","inverted","minStepsBetweenThumbs"];function Lr({value:t,readonly:e,disabled:s,options:r,schema:o,onChange:i,label:a,id:c}){const u=l=>i(l[0]),f={...mn(o)},p={id:c,...pn(r.props||{},zr)};return n.jsxs(n.Fragment,{children:[n.jsx($r,{disabled:s||e,min:f.min,max:f.max,step:f.step,value:[t],onValueChange:u,...p,"aria-describedby":ee(c)}),t]})}const Ur=xe("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Kr({className:t,variant:e,asChild:s=!1,...r}){const o=s?Ie:"span";return n.jsx(o,{"data-slot":"badge",className:I(Ur({variant:e}),t),...r})}const jt=j.forwardRef(({className:t,...e},s)=>n.jsx(te,{ref:s,"data-slot":"command",className:I("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...e})),Gr=j.forwardRef(({className:t,...e},s)=>n.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[n.jsx(Cs,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),n.jsx(te.Input,{ref:s,className:I("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));Gr.displayName=te.Input.displayName;function wt({className:t,...e}){return n.jsx(te.List,{"data-slot":"command-list",className:I("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...e})}function St({className:t,...e}){return n.jsx(te.Group,{"data-slot":"command-group",className:I("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...e})}function Nt({className:t,...e}){return n.jsx(te.Item,{"data-slot":"command-item",className:I("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...e})}function Wr({multiple:t,items:e=[],selected:s,onValueChange:r,autoFocus:o=!1,disabled:i=!1,ariaDescribedby:a,ariaPlaceholder:c,onFocus:u,onBlur:f,className:p,id:l}){const d=j.useRef(null),[b,h]=j.useState(!1),[g,v]=j.useState(""),y=j.useMemo(()=>e.filter(S=>s.some(_=>ue(S.value,_))),[e,s]),x=j.useMemo(()=>e.filter(S=>!y.some(_=>ue(_.value,S.value))),[e,y]),w=j.useCallback(S=>{if(i)return;const _=y.filter(D=>!ue(D.value,S.value));r?.(_.map(D=>D.index))},[y,r,i]),N=j.useCallback(S=>{if(!(i||!d.current||d.current.value!==""))if(S.key==="Delete"||S.key==="Backspace"){const _=y.slice(0,-1);r?.(_.map(D=>D.index))}else S.key==="Escape"&&d.current.blur()},[y,r,i]),R=j.useCallback(S=>{if(i)return;v("");const _=t?[...y,S]:[S];r?.(_.map(D=>D.index))},[t,y,r,i]),k=j.useCallback(S=>{i||h(!0),u?.(S)},[i,u]);return n.jsxs(jt,{onKeyDown:N,className:I("overflow-visible bg-transparent",p),autoFocus:o,"aria-disabled":i,onBlur:f,onFocus:k,"aria-describedby":a,"aria-placeholder":c,children:[n.jsx("div",{className:I("group border border-input px-3 py-2 text-sm ring-offset-background rounded-md focus-within:ring-1 focus-within:ring-ring focus-within:ring-offset-1",i&&"opacity-50 cursor-not-allowed"),children:n.jsxs("div",{className:"flex gap-1 flex-wrap",children:[y.map(S=>n.jsxs(Kr,{variant:"secondary",children:[S.label,n.jsx("button",{type:"button",className:"rtl:mr-1 ltr:ml-1 ring-offset-background rounded-full outline-none focus:ring-1 focus:ring-ring focus:ring-offset-1",onKeyDown:_=>_.key==="Enter"&&!i&&w(S),onMouseDown:_=>{_.preventDefault(),_.stopPropagation()},onClick:()=>w(S),disabled:i,children:n.jsx(Ke,{className:I("h-3 w-3 text-muted-foreground hover:text-foreground",i&&"pointer-events-none")})})]},S.value)),n.jsx(te.Input,{ref:d,value:g,onValueChange:v,onBlur:()=>h(!1),onFocus:()=>!i&&h(!0),placeholder:"Select ...",className:"rtl:mr-2 ltr:ml-2 bg-transparent outline-none placeholder:text-muted-foreground flex-1",disabled:i,"aria-controls":`command-item-input-${l}`,"aria-labelledby":`command-item-input-${l}`,id:`command-item-input-${l}`})]})}),b&&!i&&x.length>0&&n.jsx("div",{className:"relative mt-2",children:n.jsx("div",{className:"absolute w-full z-10 top-0 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",children:n.jsx(St,{className:"h-full overflow-auto",children:n.jsx(wt,{children:x.map(S=>n.jsx(Nt,{disabled:S.disabled,onMouseDown:_=>{_.preventDefault(),_.stopPropagation()},"aria-controls":`${S.value}-command-item`,"aria-labelledby":`${S.value}-command-item`,id:`${S.value}-command-item`,onSelect:()=>R(S),className:"cursor-pointer",children:S.label},`${S.value}-command-item`))})})})})]})}function qr({items:t,selected:e,onValueChange:s,autoFocus:r=!1,disabled:o=!1,required:i=!1,placeholder:a="Select...",ariaDescribedby:c,ariaPlaceholder:u,onFocus:f,onBlur:p,className:l}){const[d,b]=j.useState(!1),h=t?.find(x=>x.value===e),g=j.useRef(null),v=j.useRef(null);j.useEffect(()=>{d&&g.current&&requestAnimationFrame(()=>{var x;(x=g.current)===null||x===void 0||x.scrollIntoView({block:"nearest"})})},[d]);const y=x=>{v.current&&!v.current.contains(x.relatedTarget)&&b(!1),p?.(x)};return n.jsxs(jt,{ref:v,className:I("overflow-visible bg-transparent",l),autoFocus:r,"aria-disabled":o,onBlur:y,onFocus:f,"aria-describedby":c,"aria-placeholder":u,children:[n.jsxs("div",{onClick:()=>!o&&b(!d),className:I("flex h-9 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",!h&&i&&"border-red-500",o&&"opacity-50 cursor-not-allowed",l),children:[n.jsx("span",{className:I("flex-1 line-clamp-1",!h&&"text-muted-foreground"),children:h?.label||a}),n.jsx(Le,{className:"h-4 w-4 opacity-50"})]}),n.jsx("div",{className:"relative",children:d&&t&&t.length>0?n.jsx("div",{style:{top:"0.5rem"},className:"absolute w-full z-10 rounded-md border bg-popover text-popover-foreground shadow-md outline-none",children:n.jsx(St,{className:"h-full overflow-auto",children:n.jsx(wt,{children:t.map(x=>n.jsxs(Nt,{ref:x.value===e?g:void 0,onMouseDown:w=>{w.preventDefault(),w.stopPropagation()},onSelect:()=>{x.disabled||(s?.(x.value),b(!1))},className:I("cursor-pointer relative flex items-center justify-between rounded-sm py-1.5 gap-2 rtl:flex-row-reverse",x.value===e&&"font-semibold",x.disabled&&"opacity-50 cursor-not-allowed"),children:[n.jsx("span",{children:x.label}),n.jsx("span",{className:"flex h-3.5 w-3.5 items-center justify-center",children:x.value===e&&n.jsx(ps,{className:"h-4 w-4"})})]},x.value))})})}):null})]})}function Hr({id:t,options:e,required:s,disabled:r,readonly:o,value:i,multiple:a,autofocus:c,onChange:u,onBlur:f,onFocus:p,placeholder:l,rawErrors:d=[],className:b}){const{enumOptions:h,enumDisabled:g,emptyValue:v}=e,y=je(e),x=()=>{p(t,H(i,h,y,v))},w=()=>{f(t,H(i,h,y,v))},N=h?.map(({value:k,label:S},_)=>({value:a?k:Ve(k,_,y),label:S,index:_,disabled:Array.isArray(g)&&g.includes(k)})),R=I({"border-destructive":d.length>0},b);return n.jsx("div",{className:"p-0.5",children:a?n.jsx(Wr,{id:t,autoFocus:c,disabled:r||o,multiple:!0,className:R,items:N,selected:i,onValueChange:k=>{u(H(k.map(String),h,y,v))},onFocus:x,onBlur:w}):n.jsx(qr,{items:N,selected:fn(i,h,!1,y,""),onValueChange:k=>{u(H(k,h,y,v))},autoFocus:c,disabled:r||o,required:s,placeholder:l,className:R,onFocus:x,onBlur:w,ariaDescribedby:ee(t)})})}function Yr({className:t,...e}){return n.jsx("textarea",{"data-slot":"textarea",className:I("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...e})}function Jr({id:t,htmlName:e,placeholder:s,value:r,required:o,disabled:i,autofocus:a,readonly:c,onBlur:u,onFocus:f,onChange:p,options:l,className:d}){const b=({target:{value:v}})=>p(v===""?l.emptyValue:v),h=({target:v})=>u(t,v&&v.value),g=({target:v})=>f(t,v&&v.value);return n.jsx("div",{className:"flex p-0.5",children:n.jsx(Yr,{id:t,name:e||t,placeholder:s,disabled:i,readOnly:c,value:r??"",required:o,autoFocus:a,rows:l.rows||5,onChange:b,onBlur:h,onFocus:g,"aria-describedby":ee(t),className:d})})}function Xr(){return{CheckboxWidget:rr,CheckboxesWidget:or,RadioWidget:yr,RangeWidget:Lr,SelectWidget:Hr,TextareaWidget:Jr}}function Zr(){return{templates:er(),widgets:Xr()}}function Qr(){return is(Zr())}const eo=Qr();function to(t){const e=V.c(21),{virtualMcp:s,isSelected:r}=t,o=r&&"bg-accent";let i;e[0]!==o?(i=ge("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl transition-colors",o),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==s.icon||e[3]!==s.title?(a=n.jsx(Fe,{icon:s.icon,name:s.title,size:"sm"}),e[2]=s.icon,e[3]=s.title,e[4]=a):a=e[4];let c;e[5]!==s.title?(c=n.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[5]=s.title,e[6]=c):c=e[6];let u;e[7]!==r?(u=r&&n.jsx($n,{size:16,className:"text-foreground shrink-0"}),e[7]=r,e[8]=u):u=e[8];let f;e[9]!==c||e[10]!==u?(f=n.jsxs("div",{className:"flex items-center justify-between",children:[c,u]}),e[9]=c,e[10]=u,e[11]=f):f=e[11];let p;e[12]!==s.description?(p=s.description&&n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:s.description}),e[12]=s.description,e[13]=p):p=e[13];let l;e[14]!==f||e[15]!==p?(l=n.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[f,p]}),e[14]=f,e[15]=p,e[16]=l):l=e[16];let d;return e[17]!==i||e[18]!==a||e[19]!==l?(d=n.jsxs("div",{className:i,children:[a,l]}),e[17]=i,e[18]=a,e[19]=l,e[20]=d):d=e[20],d}function no(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center justify-center py-12",children:n.jsx(ve,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}function so(t){const e=V.c(33),{selectedVirtualMcpId:s,onVirtualMcpChange:r,searchInputRef:o}=t,i=Vn(),[a,c]=j.useState(""),u=j.useRef(null),f=o??u;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={navigateOnCreate:!0},e[0]=p):p=e[0];const{createVirtualMCP:l,isCreating:d}=Ln(p);let b,h,g,v;if(e[1]!==l||e[2]!==f||e[3]!==d||e[4]!==r||e[5]!==a||e[6]!==s||e[7]!==i){let w;e:{const A=i.filter(ro);if(!a.trim()){w=A;break e}const P=a.toLowerCase();w=A.filter(F=>F.title.toLowerCase().includes(P)||F.description?.toLowerCase().includes(P))}const N=w;let R;e[12]!==r?(R=A=>{r(A),c("")},e[12]=r,e[13]=R):R=e[13];const k=R;g="flex flex-col max-h-[min(400px,60dvh)]";let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(Kt,{size:16,className:"text-muted-foreground pointer-events-none shrink-0"}),e[14]=S):S=e[14];let _;e[15]===Symbol.for("react.memo_cache_sentinel")?(_=A=>c(A.target.value),e[15]=_):_=e[15];let D;e[16]!==f||e[17]!==a?(D=n.jsx(Tn,{ref:f,type:"text",placeholder:"Search for an agent...",value:a,onChange:_,className:"flex-1 h-8 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none p-0"}),e[16]=f,e[17]=a,e[18]=D):D=e[18];const E=d?"Creating...":"Create Agent";let T;e[19]!==l||e[20]!==d||e[21]!==E?(T=n.jsx(le,{onClick:l,variant:"outline",size:"sm",className:"h-8 px-3 rounded-lg text-sm font-medium shrink-0",disabled:d,children:E}),e[19]=l,e[20]=d,e[21]=E,e[22]=T):T=e[22],e[23]!==D||e[24]!==T?(v=n.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:n.jsxs("div",{className:"relative flex items-center gap-2",children:[S,D,T]})}),e[23]=D,e[24]=T,e[25]=v):v=e[25],b="overflow-y-auto p-1.5 flex-1 min-h-0 [touch-action:pan-y]",h=N.length>0?n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-0.5",children:N.map(A=>n.jsx("div",{role:"button",tabIndex:0,onClick:()=>k(A.id),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),k(A.id))},className:"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-xl",children:n.jsx(to,{virtualMcp:A,isSelected:A.id===s})},A.id))}):n.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"}),e[1]=l,e[2]=f,e[3]=d,e[4]=r,e[5]=a,e[6]=s,e[7]=i,e[8]=b,e[9]=h,e[10]=g,e[11]=v}else b=e[8],h=e[9],g=e[10],v=e[11];let y;e[26]!==b||e[27]!==h?(y=n.jsx("div",{className:b,children:h}),e[26]=b,e[27]=h,e[28]=y):y=e[28];let x;return e[29]!==g||e[30]!==v||e[31]!==y?(x=n.jsxs("div",{className:g,children:[v,y]}),e[29]=g,e[30]=v,e[31]=y,e[32]=x):x=e[32],x}function ro(t){return!t.id||!$t(t.id)}function oo(t){const e=V.c(3);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(no,{}),e[0]=s):s=e[0];let r;return e[1]!==t?(r=n.jsx(j.Suspense,{fallback:s,children:n.jsx(so,{...t})}),e[1]=t,e[2]=r):r=e[2],r}function io(t){const e=V.c(32),{selectedVirtualMcpId:s,selectedVirtualMcp:r,onVirtualMcpChange:o,className:i,placeholder:a,showTooltip:c,disabled:u}=t,f=a===void 0?"Select Agent":a,p=c===void 0?!0:c,l=u===void 0?!1:u,[d,b]=j.useState(!1),h=j.useRef(null);let g;e[0]!==o?(g=B=>{o(B),b(!1)},e[0]=o,e[1]=g):g=e[1];const v=g,y=Pn();let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=B=>{b(B)},e[2]=x):x=e[2];const w=x;let N,R;e[3]!==y||e[4]!==d?(N=()=>{d&&!y&&setTimeout(()=>{h.current?.focus()},0)},R=[d,y],e[3]=y,e[4]=d,e[5]=N,e[6]=R):(N=e[5],R=e[6]),j.useEffect(N,R);const k=l?!1:d,S=l?void 0:w,_=l?"cursor-not-allowed opacity-50":"cursor-pointer hover:text-muted-foreground";let D;e[7]!==i||e[8]!==_?(D=ge("relative flex items-center justify-center size-8 rounded-lg text-muted-foreground/75 transition-colors shrink-0",_,i),e[7]=i,e[8]=_,e[9]=D):D=e[9];let E;e[10]!==r?(E=r?n.jsx(Fe,{icon:r.icon,name:r.title,size:"sm",className:"absolute inset-0 size-full"}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:"agent-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[n.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),n.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),n.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),n.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"7.5",stroke:"url(#agent-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),n.jsx(zn,{size:16})]}),e[10]=r,e[11]=E):E=e[11];let T;e[12]!==l||e[13]!==f||e[14]!==D||e[15]!==E?(T=n.jsx(Fn,{asChild:!0,children:n.jsx(Dn,{asChild:!0,children:n.jsx("button",{type:"button",disabled:l,className:D,"aria-label":f,children:E})})}),e[12]=l,e[13]=f,e[14]=D,e[15]=E,e[16]=T):T=e[16];let A;e[17]!==d||e[18]!==r?.title||e[19]!==p?(A=p&&!d&&n.jsx(Bn,{side:"top",className:"text-xs",children:r?.title??"Choose an agent to chat with"}),e[17]=d,e[18]=r?.title,e[19]=p,e[20]=A):A=e[20];let P;e[21]!==T||e[22]!==A?(P=n.jsx(Mn,{children:n.jsxs(On,{children:[T,A]})}),e[21]=T,e[22]=A,e[23]=P):P=e[23];let F;e[24]!==v||e[25]!==s?(F=n.jsx(An,{className:"w-[min(550px,calc(100vw-2rem))] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,collisionPadding:16,children:n.jsx(oo,{selectedVirtualMcpId:s,onVirtualMcpChange:v,searchInputRef:h})}),e[24]=v,e[25]=s,e[26]=F):F=e[26];let M;return e[27]!==P||e[28]!==F||e[29]!==k||e[30]!==S?(M=n.jsxs(En,{open:k,onOpenChange:S,children:[P,F]}),e[27]=P,e[28]=F,e[29]=k,e[30]=S,e[31]=M):M=e[31],M}function ao(t){const e=t.properties;if(!e)return!1;const s=e.__type,r=e.__binding;return!!(s?.const||r?.const)}function lo(t){const e=t.properties;if(!e)return{};const s=e.__type,r=e.__binding;return{bindingType:s?.const,bindingSchema:r?.const}}function co(t){const e=V.c(10),{bindingSchema:s,bindingType:r,currentValue:o,onValueChange:i,placeholder:a,onAddNew:c,className:u}=t;let f;e[0]!==r?(f=ss(r),e[0]=r,e[1]=f):f=e[1];const l=f??(typeof s=="string"?s:s??void 0);let d;return e[2]!==r||e[3]!==u||e[4]!==o||e[5]!==c||e[6]!==i||e[7]!==a||e[8]!==l?(d=n.jsx(uo,{value:o,onValueChange:i,placeholder:a,binding:l,bindingType:r,onAddNew:c,className:u}),e[2]=r,e[3]=u,e[4]=o,e[5]=c,e[6]=i,e[7]=a,e[8]=l,e[9]=d):d=e[9],d}function uo({value:t,onValueChange:e,placeholder:s="Select a connection...",binding:r,bindingType:o,onAddNew:i,className:a}){const[c,u]=j.useState(!1),{installByBinding:f,isInstalling:p}=os(),l=c||p,d=r?void 0:o||void 0,b=qt(r?{binding:r}:d?{filters:[{column:"app_name",value:d}]}:{}),h=Ht(t&&!b.some(x=>x.id===t)?t:void 0),g=h?[h,...b]:b,v=o?.startsWith("@"),y=async()=>{if(v&&o){u(!0);try{const x=await f(o);x&&e(x.id)}catch(x){const w=x instanceof Error?x.message:String(x);ae.error(`Failed to connect MCP: ${w}`)}finally{u(!1)}return}i?.()};return n.jsxs(Cn,{value:t,onValueChange:e,children:[n.jsx(kn,{size:"sm",className:ge("w-[200px]",a),children:n.jsx(_n,{placeholder:s})}),n.jsxs(Rn,{children:[g.length===0?n.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No connections found"}):g.map(x=>n.jsx(In,{value:x.id,children:n.jsxs("div",{className:"flex items-center gap-2",children:[x.icon?n.jsx("img",{src:x.icon,alt:x.title,className:"w-4 h-4 rounded"}):n.jsx("div",{className:"w-4 h-4 rounded bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.title.slice(0,1).toUpperCase()}),n.jsx("span",{children:x.title})]})},x.id)),(i||v)&&n.jsx("div",{className:"border-t border-border",children:n.jsx(le,{onClick:x=>{x.preventDefault(),x.stopPropagation(),y()},disabled:l,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:l?n.jsxs(n.Fragment,{children:[n.jsx(ve,{size:16,className:"animate-spin"}),n.jsx("span",{children:"Connecting..."})]}):n.jsxs(n.Fragment,{children:[n.jsx(Nn,{size:16}),n.jsx("span",{children:"Custom Connection"})]})})})]})]})}function mo(t){const e=V.c(49),{schema:s,formData:r,title:o,description:i,registry:a}=t,c=a.formContext,u=o||"",f=o||"";if(ao(s)){const d=s;let b;e[0]!==d?(b=lo(d),e[0]=d,e[1]=b):b=e[1];const{bindingType:h,bindingSchema:g}=b,y=(c?.formData?.[u]?.value??r?.value)||"";let x;e[2]!==h||e[3]!==u||e[4]!==c||e[5]!==r?(x=M=>{const B={...r,value:M??"",...h&&{__type:h}};c?.onFieldChange(u,B)},e[2]=h,e[3]=u,e[4]=c,e[5]=r,e[6]=x):x=e[6];const w=x,N=fo;let R;e[7]!==f||e[8]!==u||e[9]!==o?(R=N(o||f||u),e[7]=f,e[8]=u,e[9]=o,e[10]=R):R=e[10];const k=R;if(h==="@deco/agent"){let M;e[11]!==k?(M=n.jsx("label",{className:"text-sm font-medium truncate block",children:k}),e[11]=k,e[12]=M):M=e[12];let B;e[13]!==i?(B=i&&n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[13]=i,e[14]=B):B=e[14];let z;e[15]!==M||e[16]!==B?(z=n.jsxs("div",{className:"flex-1 min-w-0",children:[M,B]}),e[15]=M,e[16]=B,e[17]=z):z=e[17];const U=y||void 0;let G;e[18]!==w||e[19]!==U?(G=n.jsx(io,{selectedVirtualMcpId:U,onVirtualMcpChange:w,variant:"bordered",placeholder:"Select Agent",className:"w-[200px] shrink-0"}),e[18]=w,e[19]=U,e[20]=G):G=e[20];let ie;return e[21]!==z||e[22]!==G?(ie=n.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[z,G]}),e[21]=z,e[22]=G,e[23]=ie):ie=e[23],ie}let S;e[24]!==k?(S=n.jsx("label",{className:"text-sm font-medium truncate block",children:k}),e[24]=k,e[25]=S):S=e[25];let _;e[26]!==i?(_=i&&n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[26]=i,e[27]=_):_=e[27];let D;e[28]!==S||e[29]!==_?(D=n.jsxs("div",{className:"flex-1 min-w-0",children:[S,_]}),e[28]=S,e[29]=_,e[30]=D):D=e[30];let E;e[31]!==k?(E=k.toLowerCase(),e[31]=k,e[32]=E):E=e[32];const T=`Select ${E}...`;let A;e[33]!==c?(A=()=>c?.onAddNew(),e[33]=c,e[34]=A):A=e[34];let P;e[35]!==g||e[36]!==h||e[37]!==y||e[38]!==w||e[39]!==T||e[40]!==A?(P=n.jsx(co,{bindingSchema:g,bindingType:h,currentValue:y,onValueChange:w,placeholder:T,onAddNew:A,className:"w-[200px] shrink-0"}),e[35]=g,e[36]=h,e[37]=y,e[38]=w,e[39]=T,e[40]=A,e[41]=P):P=e[41];let F;return e[42]!==P||e[43]!==D?(F=n.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[D,P]}),e[42]=P,e[43]=D,e[44]=F):F=e[44],F}let p;e[45]!==t.properties?(p=t.properties.map(po),e[45]=t.properties,e[46]=p):p=e[46];let l;return e[47]!==p?(l=n.jsx("div",{className:"flex flex-col gap-4",children:p}),e[47]=p,e[48]=l):l=e[48],l}function po(t){return t.content}function fo(t){return t.toLowerCase().replace(/_/g," ").replace(/\b\w/g,ho)}function ho(t){return t.toUpperCase()}function xo(t){const e=V.c(13),{label:s,children:r,description:o,id:i,schema:a}=t;if(i.includes("__type")||i.includes("__binding"))return null;if(a.type==="object")return r;let c;e[0]!==i||e[1]!==s?(c=s&&n.jsx("label",{className:"text-sm font-medium truncate block",htmlFor:i,children:s}),e[0]=i,e[1]=s,e[2]=c):c=e[2];let u;e[3]!==o?(u=o&&n.jsx("div",{className:"text-xs text-muted-foreground truncate",children:o}),e[3]=o,e[4]=u):u=e[4];let f;e[5]!==c||e[6]!==u?(f=n.jsxs("div",{className:"flex-1 min-w-0",children:[c,u]}),e[5]=c,e[6]=u,e[7]=f):f=e[7];let p;e[8]!==r?(p=n.jsx("div",{className:"w-[200px] shrink-0",children:r}),e[8]=r,e[9]=p):p=e[9];let l;return e[10]!==f||e[11]!==p?(l=n.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[f,p]}),e[10]=f,e[11]=p,e[12]=l):l=e[12],l}const bo={ObjectFieldTemplate:mo,FieldTemplate:xo};function go(t){const e=V.c(19),{formKey:s,formState:r,onFormStateChange:o,stateSchema:i}=t,{org:a}=he(),c=Mt();let u;e[0]!==o?(u=x=>{x.formData&&o(x.formData)},e[0]=o,e[1]=u):u=e[1];const f=u;let p;e[2]!==r||e[3]!==o?(p=(x,w)=>{const N={...r,[x]:w};o(N)},e[2]=r,e[3]=o,e[4]=p):p=e[4];const l=p;let d;e[5]!==c||e[6]!==a?(d=()=>{c({to:"/$org/settings/connections",params:{org:a.slug},search:{action:"create"}})},e[5]=c,e[6]=a,e[7]=d):d=e[7];const b=d;let h;e[8]!==r||e[9]!==b||e[10]!==l?(h={onFieldChange:l,formData:r,onAddNew:b},e[8]=r,e[9]=b,e[10]=l,e[11]=h):h=e[11];const g=h;let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(n.Fragment,{}),e[12]=v):v=e[12];let y;return e[13]!==g||e[14]!==s||e[15]!==r||e[16]!==f||e[17]!==i?(y=n.jsx("div",{className:"flex flex-col h-full overflow-auto",children:n.jsx(eo,{schema:i,validator:hn,formData:r,onChange:f,formContext:g,liveValidate:!1,showErrorList:!1,templates:bo,children:v},s)}),e[13]=g,e[14]=s,e[15]=r,e[16]=f,e[17]=i,e[18]=y):y=e[18],y}function vo(t){const e=V.c(13),{org:s}=he();let r;e[0]!==t||e[1]!==s.id?(r={connectionId:t,orgId:s.id},e[0]=t,e[1]=s.id,e[2]=r):r=e[2];const o=zt(r);let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={},e[3]=i):i=e[3];let a;e[4]!==o?(a={client:o,toolName:"MCP_CONFIGURATION",toolArguments:i,select:yo},e[4]=o,e[5]=a):a=e[5];const{data:c}=Lt(a);let u;e[6]!==c.stateSchema?(u=c.stateSchema??{type:"object",properties:{}},e[6]=c.stateSchema,e[7]=u):u=e[7];const f=u;let p;e[8]!==c.scopes?(p=c.scopes??[],e[8]=c.scopes,e[9]=p):p=e[9];const l=p;let d;return e[10]!==l||e[11]!==f?(d={stateSchema:f,scopes:l},e[10]=l,e[11]=f,e[12]=d):d=e[12],d}function yo(t){return t.structuredContent??t}function jo(t){const e=V.c(4),{onAuthenticate:s,buttonText:r}=t,o=r===void 0?"Authenticate":r;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("h3",{className:"text-sm font-semibold",children:"Authentication Required"}),n.jsx("p",{className:"text-xs text-muted-foreground max-w-md text-center",children:"This connection requires OAuth authentication to access resources."})]}),e[0]=i):i=e[0];let a;return e[1]!==o||e[2]!==s?(a=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[i,n.jsx(le,{onClick:s,size:"default",children:o})]})}),e[1]=o,e[2]=s,e[3]=a):a=e[3],a}function wo(t){const e=V.c(7),{hasReadme:s,onViewReadme:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Gt,{size:36,className:"text-muted-foreground"}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("h3",{className:"text-sm font-semibold",children:"Manual Authentication Required"}),n.jsx("p",{className:"text-xs text-muted-foreground max-w-md text-center",children:"This server requires an API key or token that must be configured manually. Check the server's documentation for instructions on obtaining credentials."})]}),e[1]=i):i=e[1];let a;e[2]!==s||e[3]!==r?(a=s&&r&&n.jsxs(le,{onClick:r,variant:"outline",size:"lg",children:[n.jsx(Ut,{size:18,className:"mr-2"}),"View README"]}),e[2]=s,e[3]=r,e[4]=a):a=e[4];let c;return e[5]!==a?(c=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[o,i,a]})}),e[5]=a,e[6]=c):c=e[6],c}function So(){const t=V.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/empty-state-error.svg",alt:"",width:160,height:160,"aria-hidden":"true"}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[e,n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("h3",{className:"text-lg font-semibold",children:"Server Error"}),n.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"The MCP server is currently experiencing issues. Please try again later or check the server's status."})]})]})}),t[1]=s):s=t[1],s}function No(t){const e=V.c(12),{connection:s,form:r}=t,{stateSchema:o}=vo(s.id);let i;e[0]!==r.control?(i={control:r.control,name:"configuration_state"},e[0]=r.control,e[1]=i):i=e[1];const a=Vt(i);let c;e[2]!==r?(c=d=>{r.setValue("configuration_state",d,{shouldDirty:!0})},e[2]=r,e[3]=c):c=e[3];const u=c;if(!(o&&o.properties&&typeof o.properties=="object"&&Object.keys(o.properties).length>0)){let d;return e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Be,{image:n.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[4]=d):d=e[4],d}let p;e[5]!==a?(p=a??{},e[5]=a,e[6]=p):p=e[6];let l;return e[7]!==s.id||e[8]!==u||e[9]!==o||e[10]!==p?(l=n.jsx("div",{className:"flex-1 overflow-auto",children:n.jsx(go,{formKey:s.id,stateSchema:o,formState:p,onFormStateChange:u})}),e[7]=s.id,e[8]=u,e[9]=o,e[10]=p,e[11]=l):l=e[11],l}function Co(t){const e=V.c(11),{connection:s,form:r,hasMcpBinding:o,isMCPAuthenticated:i,supportsOAuth:a,isServerError:c,onAuthenticate:u,onViewReadme:f}=t,l=!!s?.metadata?.repository?.url;if(!i){if(c){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(So,{}),e[0]=g):g=e[0],g}if(a){let g;return e[1]!==u?(g=n.jsx(jo,{onAuthenticate:u}),e[1]=u,e[2]=g):g=e[2],g}let h;return e[3]!==l||e[4]!==f?(h=n.jsx(wo,{hasReadme:l,onViewReadme:f}),e[3]=l,e[4]=f,e[5]=h):h=e[5],h}if(!o){let h;return e[6]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Be,{image:n.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[6]=h):h=e[6],h}let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(ve,{size:32,className:"animate-spin text-muted-foreground"})}),e[7]=d):d=e[7];let b;return e[8]!==s||e[9]!==r?(b=n.jsx(Ot,{children:n.jsx(j.Suspense,{fallback:d,children:n.jsx(No,{connection:s,form:r})})}),e[8]=s,e[9]=r,e[10]=b):b=e[10],b}function Jo(t){const e=V.c(2);let s;return e[0]!==t?(s=n.jsx("div",{className:"flex-1 flex h-full",children:n.jsx(Co,{...t})}),e[0]=t,e[1]=s):s=e[1],s}export{wo as M,jo as O,Jo as S,Yo as c};
@@ -1 +0,0 @@
1
- import{e as C,r as i,c as A,j as a,J as V}from"./index-Bu0xhzLF.js";import{P as E}from"./index-CHcfXh0a.js";const H=i.createContext(null);function q(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.tabsEl)return null;let c;return e[0]!==l||e[1]!==s.tabsEl?(c=V.createPortal(l,s.tabsEl),e[0]=l,e[1]=s.tabsEl,e[2]=c):c=e[2],c}function D(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.actionsEl)return null;let c;return e[0]!==l||e[1]!==s.actionsEl?(c=V.createPortal(l,s.actionsEl),e[0]=l,e[1]=s.actionsEl,e[2]=c):c=e[2],c}const z=D;function B(x){const e=C.c(21),{children:l,breadcrumb:s,hideHeader:c}=x;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={leftEl:null,tabsEl:null,actionsEl:null},e[0]=b):b=e[0];const[w,g]=i.useState(b),N=i.useRef(null),P=i.useRef(null),L=i.useRef(null);let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=t=>{N.current=t,t&&g(n=>n.leftEl===t?n:{...n,leftEl:t})},e[1]=h):h=e[1];const $=h;let R;e[2]===Symbol.for("react.memo_cache_sentinel")?(R=t=>{P.current=t,t&&g(n=>n.tabsEl===t?n:{...n,tabsEl:t})},e[2]=R):R=e[2];const _=R;let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t=>{L.current=t,t&&g(n=>n.actionsEl===t?n:{...n,actionsEl:t})},e[3]=d):d=e[3];const k=d,p=c&&"hidden";let o;e[4]!==p?(o=A(p),e[4]=p,e[5]=o):o=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx("div",{ref:$,className:"flex items-center gap-2 min-w-0"}),e[6]=j):j=e[6];let r;e[7]!==s?(r=a.jsxs(E.Header.Left,{children:[s,j]}),e[7]=s,e[8]=r):r=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsxs(E.Header.Right,{children:[a.jsx("div",{ref:_,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),a.jsx("div",{ref:k,className:"flex items-center gap-2 shrink-0"})]}),e[9]=y):y=e[9];let f;e[10]!==o||e[11]!==r?(f=a.jsxs(E.Header,{className:o,children:[r,y]}),e[10]=o,e[11]=r,e[12]=f):f=e[12];let m;e[13]!==l?(m=a.jsx(E.Content,{children:l}),e[13]=l,e[14]=m):m=e[14];let u;e[15]!==f||e[16]!==m?(u=a.jsxs(E,{children:[f,m]}),e[15]=f,e[16]=m,e[17]=u):u=e[17];let S;return e[18]!==w||e[19]!==u?(S=a.jsx(H,{value:w,children:u}),e[18]=w,e[19]=u,e[20]=S):S=e[20],S}export{B as V,z as a,q as b};
@@ -1 +0,0 @@
1
- import{e as f,g as p,bM as x,j as r,r as c,l as u}from"./index-Bu0xhzLF.js";import{P as g}from"./plugin-layout-2a2a-fWN.js";import"./use-connection-BCV5VAjQ.js";import"./use-collections-CLt7BhQ3.js";import"./constants-Dw_UtizE.js";import"./Settings02-EP4I50bB.js";import"./index-CHcfXh0a.js";import"./use-mobile-BACO9YYc.js";import"./X-BJbamPEP.js";function _(){const e=f.c(13);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/plugins/$pluginId"},e[0]=i):i=e[0];const{pluginId:s}=p(i);let l;e[1]!==s?(l=x.find(n=>n.id===s),e[1]=s,e[2]=l):l=e[2];const t=l;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r.jsx(u,{size:32,className:"animate-spin text-muted-foreground mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=n):n=e[3];let d;return e[4]!==t.bindingName||e[5]!==t.renderEmptyState||e[6]!==t.renderHeader?(d=r.jsx(c.Suspense,{fallback:n,children:r.jsx(g,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState})}),e[4]=t.bindingName,e[5]=t.renderEmptyState,e[6]=t.renderHeader,e[7]=d):d=e[7],d}const a=t?.LayoutComponent;if(!a){let n;return e[8]!==s?(n=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsxs("p",{className:"text-sm text-muted-foreground",children:['Plugin "',s,'" not found']})}),e[8]=s,e[9]=n):n=e[9],n}let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r.jsx(u,{size:32,className:"animate-spin text-muted-foreground mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[10]=m):m=e[10];let o;return e[11]!==a?(o=r.jsx(c.Suspense,{fallback:m,children:r.jsx(a,{})}),e[11]=a,e[12]=o):o=e[12],o}export{_ as default};
@@ -1 +0,0 @@
1
- import{e as o,j as t,a8 as a}from"./index-Bu0xhzLF.js";function r(){const s=o.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(a,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),s[0]=e):e=s[0],e}export{r as default};
@@ -1 +0,0 @@
1
- import{e as S,j as s,r as w,a8 as y}from"./index-Bu0xhzLF.js";import{i as R,t as _}from"./ChevronDown-BE0rQ4ho.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function O(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{O as default};
@@ -1 +0,0 @@
1
- import{e as E,j as t,b as G,r as R,B as V,C as B,t as f,z as I}from"./index-Bu0xhzLF.js";import{P as z}from"./index-CHcfXh0a.js";import{A as U}from"./avatar-BfSY5CVM.js";import{S as T}from"./switch-Bp1Tvx2h.js";import{a as H,c as Y,b as q,S as F}from"./select-DerdayxE.js";import{T as K,a as L}from"./toggle-group-B4KaadHq.js";import{I as J}from"./input-B5aMagwc.js";import{n as M,a as O,i as Q}from"./Sun-CTLobT4y.js";import{i as W}from"./Play-BfzIvHVC.js";import{p as X,q as Z}from"./question-004-sINsf4GQ.js";import"./index-x18ABRVV.js";import{d as ee,S as $,a as D,b as h,c as te}from"./settings-section-nyO0fOgx.js";import"./use-mobile-BACO9YYc.js";import"./X-BJbamPEP.js";import"./User01-BLHrCCyy.js";import"./ChevronDown-BE0rQ4ho.js";import"./ChevronUp-B2y_5HwX.js";import"./card-G6flwhwa.js";import"./ArrowUpRight-BBjaHjTK.js";function ie(){const{data:e,isPending:i}=G.useSession(),n=e?.user,l=n?.image,[s,o]=R.useState(null),[a,c]=R.useState(!1),m=s??n?.name??"",p=s!==null&&s!==(n?.name??""),u=async()=>{if(p){c(!0);try{await G.updateUser({name:m}),f("profile_updated",{fields:["name"]}),o(null),I.success("Profile updated")}catch{I.error("Failed to update profile")}finally{c(!1)}}};return i?null:t.jsx($,{children:t.jsxs(D,{children:[t.jsx(h,{title:"Avatar",action:t.jsx(U,{url:l,fallback:n?.name??"U",shape:"circle",size:"base"})}),t.jsx(h,{title:"Display name",action:t.jsx(J,{id:"display-name",value:m,onChange:d=>o(d.target.value),onKeyDown:d=>{d.key==="Enter"&&u()},placeholder:"Your name",className:"w-[280px]"})}),t.jsx(h,{title:"Email",action:t.jsx("span",{className:"text-sm text-muted-foreground",children:n?.email})}),p&&t.jsxs(te,{children:[t.jsx(V,{variant:"outline",size:"sm",onClick:()=>o(null),disabled:a,children:"Cancel"}),t.jsx(V,{onClick:u,disabled:a,size:"sm",children:a?"Saving…":"Save"})]})]})})}function ne(){const e=E.c(48),[i,n]=B();let l;e[0]!==n?(l=async r=>{if(r&&await Notification.requestPermission()!=="granted"){f("preferences_notifications_permission_denied"),I.error("Notifications denied. Please enable them in your browser settings."),n(ae);return}f("preferences_notifications_toggled",{enabled:r}),n(x=>({...x,enableNotifications:r}))},e[0]=n,e[1]=l):l=e[1];const s=l;let o;e[2]!==n?(o=r=>{r&&(f("preferences_theme_changed",{to_value:r}),n(x=>({...x,theme:r})))},e[2]=n,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(L,{value:"light","aria-label":"Light theme",children:t.jsx(M,{size:14})}),e[4]=a):a=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(L,{value:"dark","aria-label":"Dark theme",children:t.jsx(O,{size:14})}),e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(L,{value:"system","aria-label":"System theme",children:t.jsx(Q,{size:14})}),e[6]=m):m=e[6];let p;e[7]!==i.theme||e[8]!==o?(p=t.jsx(h,{title:"Theme",description:"Your preferred color scheme.",action:t.jsxs(K,{type:"single",size:"sm",variant:"outline",value:i.theme,onValueChange:o,children:[a,c,m]})}),e[7]=i.theme,e[8]=o,e[9]=p):p=e[9];let u;e[10]!==s||e[11]!==i.enableNotifications?(u=typeof Notification<"u"?()=>s(!i.enableNotifications):void 0,e[10]=s,e[11]=i.enableNotifications,e[12]=u):u=e[12];let d;e[13]!==s||e[14]!==i.enableNotifications?(d=t.jsx(T,{disabled:typeof Notification>"u",checked:i.enableNotifications,onCheckedChange:s}),e[13]=s,e[14]=i.enableNotifications,e[15]=d):d=e[15];let b;e[16]!==u||e[17]!==d?(b=t.jsx(h,{title:"Notifications",description:"Receive browser notifications for important events.",onClick:u,action:d}),e[16]=u,e[17]=d,e[18]=b):b=e[18];let v;e[19]!==i.enableSounds||e[20]!==n?(v=()=>{f("preferences_sounds_toggled",{enabled:!i.enableSounds}),n(le)},e[19]=i.enableSounds,e[20]=n,e[21]=v):v=e[21];let P;e[22]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("button",{type:"button","aria-label":"Preview notification sound",onClick:se,className:"size-6 rounded flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors cursor-pointer",children:t.jsx(W,{size:11})}),e[22]=P):P=e[22];let g;e[23]!==n?(g=r=>{f("preferences_sounds_toggled",{enabled:r}),n(x=>({...x,enableSounds:r}))},e[23]=n,e[24]=g):g=e[24];let j;e[25]!==i.enableSounds||e[26]!==g?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[P,t.jsx(T,{checked:i.enableSounds,onCheckedChange:g})]}),e[25]=i.enableSounds,e[26]=g,e[27]=j):j=e[27];let _;e[28]!==j||e[29]!==v?(_=t.jsx(h,{title:"Sounds",description:"Play sounds for agent actions and notifications.",onClick:v,action:j}),e[28]=j,e[29]=v,e[30]=_):_=e[30];let S;e[31]!==n?(S=r=>{f("preferences_tool_approval_changed",{to_value:r}),n(x=>({...x,toolApprovalLevel:r}))},e[31]=n,e[32]=S):S=e[32];let y;e[33]!==i.toolApprovalLevel?(y={readonly:"Ask before edit",auto:"Auto approve"}[i.toolApprovalLevel]??"Ask before edit",e[33]=i.toolApprovalLevel,e[34]=y):y=e[34];let N;e[35]!==y?(N=t.jsx(Y,{className:"w-36 h-7 text-xs",children:t.jsx("span",{children:y})}),e[35]=y,e[36]=N):N=e[36];let A;e[37]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(q,{value:"readonly",textValue:"Ask before edit",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Ask before edit"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),e[37]=A):A=e[37];let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsxs(F,{children:[A,t.jsx(q,{value:"auto",textValue:"Auto approve",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Auto approve"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all without approval"})]})})]}),e[38]=k):k=e[38];let C;e[39]!==i.toolApprovalLevel||e[40]!==S||e[41]!==N?(C=t.jsx(h,{title:"Tool Approval",description:"Control how tools are approved before execution.",action:t.jsxs(H,{value:i.toolApprovalLevel,onValueChange:S,children:[N,k]})}),e[39]=i.toolApprovalLevel,e[40]=S,e[41]=N,e[42]=C):C=e[42];let w;return e[43]!==_||e[44]!==C||e[45]!==p||e[46]!==b?(w=t.jsx($,{title:"Preferences",children:t.jsxs(D,{children:[p,b,_,C]})}),e[43]=_,e[44]=C,e[45]=p,e[46]=b,e[47]=w):w=e[47],w}function se(){f("preferences_sounds_previewed"),X(Z.dataUri).catch(oe)}function oe(){}function le(e){return{...e,enableSounds:!e.enableSounds}}function ae(e){return{...e,enableNotifications:!1}}function re(){const e=E.c(11),[i,n]=B();let l;e[0]!==i.experimental_vibecode||e[1]!==n?(l=()=>{f("preferences_experimental_vibecode_toggled",{enabled:!i.experimental_vibecode}),n(ce)},e[0]=i.experimental_vibecode,e[1]=n,e[2]=l):l=e[2];let s;e[3]!==n?(s=c=>{f("preferences_experimental_vibecode_toggled",{enabled:c}),n(m=>({...m,experimental_vibecode:c}))},e[3]=n,e[4]=s):s=e[4];let o;e[5]!==i.experimental_vibecode||e[6]!==s?(o=t.jsx(T,{checked:i.experimental_vibecode,onCheckedChange:s}),e[5]=i.experimental_vibecode,e[6]=s,e[7]=o):o=e[7];let a;return e[8]!==l||e[9]!==o?(a=t.jsx($,{title:"Experimental",children:t.jsx(D,{children:t.jsx(h,{title:"Import from GitHub",description:"Enable importing agents from GitHub repositories.",onClick:l,action:o})})}),e[8]=l,e[9]=o,e[10]=a):a=e[10],a}function ce(e){return{...e,experimental_vibecode:!e.experimental_vibecode}}function de(){const e=E.c(1);let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{children:t.jsx(z.Content,{children:t.jsx(z.Body,{children:t.jsxs(ee,{children:[t.jsx(z.Title,{children:"Profile & Preferences"}),t.jsx(ie,{}),t.jsx(ne,{}),t.jsx(re,{})]})})})}),e[0]=i):i=e[0],i}function ze(){const e=E.c(1);let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(de,{}),e[0]=i):i=e[0],i}export{ze as default};
@@ -1 +0,0 @@
1
- import{e as H,s as O,j as N}from"./index-Bu0xhzLF.js";import{a as $,g as b,s as v}from"./task-status-D3v6N-jY.js";import{u as L}from"./constants-Dw_UtizE.js";import{a as q,c as B}from"./use-mcp-tools-yi4edHzR.js";import{c as Y}from"./content-blocks-o63cs2vh.js";import{g as k,M as G,b as E}from"./types-BtVZ_7jK.js";import{e as V,u as z}from"./chat-context-BJBiG4eq.js";import{u as F}from"./shell-layout-cKwbYqFy.js";import"./agent-icon-Db8xI2bq.js";import"./AlertCircle-Cx8oex2u.js";import"./Tool01-CeBylvMu.js";import"./XClose-BRn4UVuG.js";import"./RefreshCcw01-B-L6FvMp.js";import"./ArrowNarrowLeft-DtpIYMrr.js";import"./XCircle-DP5EGLqX.js";import"./ArrowUpRight-BBjaHjTK.js";import"./ZapSquare-B3o6QvJe.js";import"./Users03-C3QqJn94.js";import"./CheckCircle-Mywkb82K.js";import"./ChevronDown-BE0rQ4ho.js";import"./ChevronRight-BVJ2HUMt.js";import"./ChevronUp-B2y_5HwX.js";import"./DotsVertical-BQnGY6Nc.js";import"./Container-CtsNRge8.js";import"./Star01-MuiWZ8GS.js";import"./Palette-2CChK5yr.js";import"./SearchMd-BfBE-dHK.js";import"./index-CHcfXh0a.js";import"./use-mobile-BACO9YYc.js";import"./X-BJbamPEP.js";import"./LinkExternal01-SieYyhiZ.js";import"./Lock01-BrFrkt3t.js";import"./Sun-CTLobT4y.js";import"./Play-BfzIvHVC.js";import"./Plus-kLSd3TZy.js";import"./Settings02-EP4I50bB.js";import"./Shield01-D19-LRUf.js";import"./Trash01-BLGcALKg.js";import"./User01-BLHrCCyy.js";import"./Zap-kZUu0No-.js";import"./scroll-area-CoWBmpAM.js";import"./select-DerdayxE.js";import"./use-copy-CYT1tdMJ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-DjZXbytL.js";import"./integration-icon-B5mNngh-.js";import"./use-virtual-mcp-CZoeCuBL.js";import"./use-collections-CLt7BhQ3.js";import"./use-ai-providers-DqhLue8O.js";import"./use-decopilot-events-BNaQbe7E.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-COeMfIn8.js";import"./use-organization-settings-B98QP_Ve.js";import"./required-auth-layout-emsOE3qR.js";import"./use-org-sso-CEfAe1W3.js";const J={};function K(U){const t=H.c(37),{client:s,resourceURI:P,tool:e,connectionId:p,orgId:l,args:a}=U,{sendMessage:c}=V(),{setAppContext:u,clearAppContext:g}=z(),{setChatOpen:d,openTab:r}=F(),n=`${p}:${e.name}`;let o;t[0]!==r?(o=h=>h==="inline"?(r("0"),"inline"):"fullscreen",t[0]=r,t[1]=o):o=t[1];const f=o,m=a??J;let i;t[2]!==s||t[3]!==e.name||t[4]!==m?(i={client:s,toolName:e.name,toolArguments:m},t[2]=s,t[3]=e.name,t[4]=m,t[5]=i):i=t[5];const{data:T}=B(i);let R;if(t[6]!==e._meta||t[7]!==e.name){const h=b(e._meta);R=v(e.name,h),t[6]=e._meta,t[7]=e.name,t[8]=R}else R=t[8];const S=R;let x;t[9]!==e.inputSchema?(x=e.inputSchema??{type:"object"},t[9]=e.inputSchema,t[10]=x):x=t[10];let A;t[11]!==S||t[12]!==x||t[13]!==e?(A={...e,name:S,inputSchema:x},t[11]=S,t[12]=x,t[13]=e,t[14]=A):A=t[14];const y=A;let _;t[15]!==c||t[16]!==d?(_=h=>{const w=Y(h.content);w.content.length>0&&(d(!0),c({tiptapDoc:w}))},t[15]=c,t[16]=d,t[17]=_):_=t[17];const D=_;let C;t[18]!==y?(C={tool:y},t[18]=y,t[19]=C):C=t[19];let I;t[20]!==u||t[21]!==n?(I=h=>u(n,h),t[20]=u,t[21]=n,t[22]=I):I=t[22];let M;t[23]!==g||t[24]!==n?(M=()=>g(n),t[23]=g,t[24]=n,t[25]=M):M=t[25];let j;return t[26]!==s||t[27]!==D||t[28]!==f||t[29]!==l||t[30]!==P||t[31]!==C||t[32]!==I||t[33]!==M||t[34]!==m||t[35]!==T?(j=N.jsx(G,{resourceURI:P,orgId:l,toolInfo:C,toolInput:m,toolResult:T,displayMode:"fullscreen",minHeight:E.fullscreen.minHeight,maxHeight:E.fullscreen.maxHeight,client:s,onMessage:D,onUpdateModelContext:I,onTeardown:M,onRequestDisplayMode:f,className:"h-full"}),t[26]=s,t[27]=D,t[28]=f,t[29]=l,t[30]=P,t[31]=C,t[32]=I,t[33]=M,t[34]=m,t[35]=T,t[36]=j):j=t[36],j}function Wt(U){const t=H.c(22),{connectionId:s,toolName:P,args:e}=U,{org:p}=O();let l;t[0]!==s||t[1]!==p.id?(l={connectionId:s,orgId:p.id},t[0]=s,t[1]=p.id,t[2]=l):l=t[2];const a=L(l);let c;t[3]!==a?(c={client:a},t[3]=a,t[4]=c):c=t[4];const{data:u}=q(c),g=decodeURIComponent(P);let d;t[5]!==g?(d=$(g),t[5]=g,t[6]=d):d=t[6];const r=d;let n,o;if(t[7]!==r||t[8]!==u.tools){let i;t[11]!==r?(i=T=>T.name===r,t[11]=r,t[12]=i):i=t[12],o=u.tools.find(i),n=o?._meta?k(o._meta):void 0,t[7]=r,t[8]=u.tools,t[9]=n,t[10]=o}else n=t[9],o=t[10];const f=n;if(!o||!f){let i;return t[13]!==r?(i=N.jsx("div",{className:"flex items-center justify-center h-full w-full",children:N.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',r,'" not found or has no UI']})}),t[13]=r,t[14]=i):i=t[14],i}let m;return t[15]!==e||t[16]!==a||t[17]!==s||t[18]!==p.id||t[19]!==f||t[20]!==o?(m=N.jsx(K,{client:a,resourceURI:f,tool:o,connectionId:s,orgId:p.id,args:e}),t[15]=e,t[16]=a,t[17]=s,t[18]=p.id,t[19]=f,t[20]=o,t[21]=m):m=t[21],m}export{Wt as AppViewContent};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-YWa06n-y.js","assets/index-Bu0xhzLF.js","assets/index-BZi9riJ2.css","assets/ArrowNarrowLeft-DtpIYMrr.js","assets/CheckCircle-Mywkb82K.js","assets/Container-CtsNRge8.js","assets/Settings02-EP4I50bB.js","assets/XCircle-DP5EGLqX.js","assets/constants-Dw_UtizE.js","assets/useInfiniteQuery-BiAZtptE.js","assets/infiniteQueryObserver-DEk-T30Y.js","assets/badge-C_B8gNbw.js","assets/input-B5aMagwc.js","assets/dropdown-menu--l1OQ6xu.js","assets/ChevronDown-BE0rQ4ho.js","assets/ChevronRight-BVJ2HUMt.js","assets/DotsVertical-BQnGY6Nc.js","assets/table-BL7WuMkY.js","assets/toggle-group-B4KaadHq.js","assets/use-view-mode-BLlR5qfu.js","assets/use-mobile-BACO9YYc.js","assets/SearchMd-BfBE-dHK.js","assets/dialog-DjZXbytL.js","assets/X-BJbamPEP.js","assets/AlertCircle-Cx8oex2u.js","assets/alert-dialog-BFg1HHbW.js","assets/card-G6flwhwa.js","assets/Trash01-BLGcALKg.js","assets/label-Bv4VMaQH.js","assets/select-DerdayxE.js","assets/ChevronUp-B2y_5HwX.js","assets/switch-Bp1Tvx2h.js","assets/textarea-BxmFQbso.js","assets/RefreshCcw01-B-L6FvMp.js","assets/checkbox-LBmczTXJ.js","assets/LinkExternal01-SieYyhiZ.js","assets/use-copy-CYT1tdMJ.js","assets/Plus-kLSd3TZy.js","assets/Play-BfzIvHVC.js"])))=>i.map(i=>d[i]);
2
- import{e as a,j as t,r,l as i,aE as o}from"./index-Bu0xhzLF.js";const n=r.lazy(()=>o(()=>import("./registry-layout-YWa06n-y.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38])));function c(){const s=a.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(r.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(i,{size:20,className:"animate-spin text-muted-foreground"})}),children:t.jsx(n,{})}),s[0]=e):e=s[0],e}export{c as default};
@@ -1 +0,0 @@
1
- import{e as c,j as i,A as a,S as u,h,k as f,a4 as m,N as x}from"./index-Bu0xhzLF.js";function g(){const t=c.c(5),s=m().location.href;let r;t[0]!==s?(r=s==="/login"||s.startsWith("/login?"),t[0]=s,t[1]=r):r=t[1];const n=r;let o;if(t[2]!==s||t[3]!==n){const l=n?{}:{next:s};o=i.jsx(x,{to:"/login",search:l,replace:!0}),t[2]=s,t[3]=n,t[4]=o}else o=t[4];return o}function d(t){const e=c.c(6),{children:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(a,{children:i.jsx(u,{})}),e[0]=r):r=e[0];let n;e[1]!==s?(n=i.jsx(h,{children:s}),e[1]=s,e[2]=n):n=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(f,{children:i.jsx(g,{})}),e[3]=o):o=e[3];let l;return e[4]!==n?(l=i.jsxs(i.Fragment,{children:[r,n,o]}),e[4]=n,e[5]=l):l=e[5],l}export{d as R};
@@ -1 +0,0 @@
1
- import{r as k,s as Re,K as ce,aM as it,j as s,c as H,l as _e,B as ne,e as q,n as Ge,o as De,x as rt,w as ot,a as we,z as pe,t as Ae,b as re,v as ye,aK as he,y as se,aI as Le,a_ as ve,E as lt,f as at,d as ct}from"./index-Bu0xhzLF.js";import{u as dt}from"./use-organization-roles-1TjtICKp.js";import{B as fe}from"./badge-C_B8gNbw.js";import{f as Ue,a as ke,b as Ve,c as Be,d as ze,A as Ye,e as $e,g as He}from"./alert-dialog-BFg1HHbW.js";import{c as mt,d as ut,e as gt,D as Et}from"./dropdown-menu--l1OQ6xu.js";import{i as Tt}from"./DotsVertical-BQnGY6Nc.js";import{i as Ke}from"./Lock01-BrFrkt3t.js";import{s as Ce}from"./Plus-kLSd3TZy.js";import{s as pt}from"./Trash01-BLGcALKg.js";import{C as ft}from"./collection-table-wrapper-B2fVBjE4.js";import{P as te}from"./index-CHcfXh0a.js";import{E as je}from"./empty-state-DskpQs8Q.js";import{S as Se}from"./search-input-DRzVzeWW.js";import{P as Fe,D as Qe}from"./ai-providers-logos-D6a8kmGH.js";import{I as be}from"./integration-icon-B5mNngh-.js";import{u as _t}from"./use-infinite-scroll-CoMWGssU.js";import{C as Oe}from"./checkbox-LBmczTXJ.js";import{i as It}from"./RefreshCcw01-B-L6FvMp.js";import{u as ht}from"./useSuspenseInfiniteQuery-CPbx6xDm.js";import{u as Rt,S as xt}from"./constants-Dw_UtizE.js";import{C as Nt}from"./collection-search-DoXoIAYq.js";import{u as Ze}from"./use-members-BPb2gPfy.js";import{u as Ct}from"./use-connection-BCV5VAjQ.js";import{u as At,c as St}from"./use-ai-providers-DqhLue8O.js";import{A as qe}from"./avatar-BfSY5CVM.js";import{S as oe}from"./switch-Bp1Tvx2h.js";import{T as ue,c as ge,a as Ee,b as Te}from"./use-mobile-BACO9YYc.js";import{t as bt}from"./ChevronDown-BE0rQ4ho.js";import{i as Ot}from"./ChevronRight-BVJ2HUMt.js";import{a as yt}from"./SearchMd-BfBE-dHK.js";import{i as Pe}from"./X-BJbamPEP.js";import"./table-BL7WuMkY.js";import"./XClose-BRn4UVuG.js";import"./Container-CtsNRge8.js";import"./agent-icon-Db8xI2bq.js";import"./AlertCircle-Cx8oex2u.js";import"./Tool01-CeBylvMu.js";import"./ArrowNarrowLeft-DtpIYMrr.js";import"./XCircle-DP5EGLqX.js";import"./ArrowUpRight-BBjaHjTK.js";import"./ZapSquare-B3o6QvJe.js";import"./Users03-C3QqJn94.js";import"./CheckCircle-Mywkb82K.js";import"./ChevronUp-B2y_5HwX.js";import"./Star01-MuiWZ8GS.js";import"./Palette-2CChK5yr.js";import"./LinkExternal01-SieYyhiZ.js";import"./Sun-CTLobT4y.js";import"./Play-BfzIvHVC.js";import"./Settings02-EP4I50bB.js";import"./Shield01-D19-LRUf.js";import"./User01-BLHrCCyy.js";import"./Zap-kZUu0No-.js";import"./infiniteQueryObserver-DEk-T30Y.js";import"./use-collections-CLt7BhQ3.js";const Xe=[{name:"ORGANIZATION_CREATE",description:"Create a new organization",category:"Organizations"},{name:"ORGANIZATION_LIST",description:"List organizations",category:"Organizations"},{name:"ORGANIZATION_GET",description:"View organization details",category:"Organizations"},{name:"ORGANIZATION_UPDATE",description:"Update organization",category:"Organizations"},{name:"ORGANIZATION_DELETE",description:"Delete organization",category:"Organizations",dangerous:!0},{name:"ORGANIZATION_SETTINGS_GET",description:"View organization settings",category:"Organizations"},{name:"ORGANIZATION_SETTINGS_UPDATE",description:"Update organization settings",category:"Organizations"},{name:"BRAND_CONTEXT_LIST",description:"List brand contexts",category:"Organizations"},{name:"BRAND_CONTEXT_GET",description:"View brand context",category:"Organizations"},{name:"BRAND_CONTEXT_CREATE",description:"Create brand context",category:"Organizations"},{name:"BRAND_CONTEXT_UPDATE",description:"Update brand context",category:"Organizations"},{name:"BRAND_CONTEXT_DELETE",description:"Delete brand context",category:"Organizations",dangerous:!0},{name:"BRAND_CONTEXT_EXTRACT",description:"Extract brand context from website",category:"Organizations"},{name:"BRAND_GET",description:"Get brand (binding)",category:"Organizations"},{name:"BRAND_LIST",description:"List brands (binding)",category:"Organizations"},{name:"ORGANIZATION_DOMAIN_GET",description:"Get organization domain claim",category:"Organizations"},{name:"ORGANIZATION_DOMAIN_SET",description:"Set organization domain claim",category:"Organizations"},{name:"ORGANIZATION_DOMAIN_UPDATE",description:"Update organization domain settings",category:"Organizations"},{name:"ORGANIZATION_DOMAIN_CLEAR",description:"Clear organization domain claim",category:"Organizations"},{name:"ORGANIZATION_MEMBER_ADD",description:"Add members",category:"Organizations"},{name:"ORGANIZATION_MEMBER_REMOVE",description:"Remove members",category:"Organizations",dangerous:!0},{name:"ORGANIZATION_MEMBER_LIST",description:"List members",category:"Organizations"},{name:"ORGANIZATION_MEMBER_UPDATE_ROLE",description:"Update member roles",category:"Organizations"},{name:"COLLECTION_CONNECTIONS_CREATE",description:"Create connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_LIST",description:"List connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_GET",description:"View connection details",category:"Connections"},{name:"COLLECTION_CONNECTIONS_UPDATE",description:"Update connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_DELETE",description:"Delete connections",category:"Connections",dangerous:!0},{name:"CONNECTION_TEST",description:"Test connections",category:"Connections"},{name:"DATABASES_RUN_SQL",description:"Run SQL queries",category:"Connections",dangerous:!0},{name:"COLLECTION_VIRTUAL_MCP_CREATE",description:"Create virtual MCPs",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_LIST",description:"List virtual MCPs",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_GET",description:"View virtual MCP details",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_UPDATE",description:"Update virtual MCPs",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_DELETE",description:"Delete virtual MCPs",category:"Virtual MCPs",dangerous:!0},{name:"MONITORING_LOG_GET",description:"View monitoring log details",category:"Monitoring"},{name:"MONITORING_LOGS_LIST",description:"List monitoring logs",category:"Monitoring"},{name:"MONITORING_STATS",description:"View monitoring statistics",category:"Monitoring"},{name:"API_KEY_CREATE",description:"Create API key",category:"API Keys"},{name:"API_KEY_LIST",description:"List API keys",category:"API Keys"},{name:"API_KEY_UPDATE",description:"Update API key",category:"API Keys"},{name:"API_KEY_DELETE",description:"Delete API key",category:"API Keys",dangerous:!0},{name:"EVENT_PUBLISH",description:"Publish events",category:"Event Bus"},{name:"EVENT_SUBSCRIBE",description:"Subscribe to events",category:"Event Bus"},{name:"EVENT_UNSUBSCRIBE",description:"Unsubscribe from events",category:"Event Bus"},{name:"EVENT_CANCEL",description:"Cancel recurring events",category:"Event Bus"},{name:"EVENT_ACK",description:"Acknowledge event delivery",category:"Event Bus"},{name:"EVENT_SUBSCRIPTION_LIST",description:"List event subscriptions",category:"Event Bus"},{name:"EVENT_SYNC_SUBSCRIPTIONS",description:"Sync subscriptions to desired state",category:"Event Bus"},{name:"USER_GET",description:"Get a user by id",category:"Users"},{name:"COLLECTION_THREADS_CREATE",description:"Create threads",category:"Threads"},{name:"COLLECTION_THREADS_LIST",description:"List threads",category:"Threads"},{name:"COLLECTION_THREADS_GET",description:"View thread details",category:"Threads"},{name:"COLLECTION_THREADS_UPDATE",description:"Update threads",category:"Threads"},{name:"COLLECTION_THREADS_DELETE",description:"Delete threads",category:"Threads",dangerous:!0},{name:"COLLECTION_THREAD_MESSAGES_LIST",description:"List thread messages",category:"Threads"},{name:"TAGS_LIST",description:"List organization tags",category:"Tags"},{name:"TAGS_CREATE",description:"Create organization tag",category:"Tags"},{name:"TAGS_DELETE",description:"Delete organization tag",category:"Tags",dangerous:!0},{name:"MEMBER_TAGS_GET",description:"Get member tags",category:"Tags"},{name:"MEMBER_TAGS_SET",description:"Set member tags",category:"Tags"},{name:"AUTOMATION_CREATE",description:"Create automation",category:"Automations"},{name:"AUTOMATION_GET",description:"View automation details",category:"Automations"},{name:"AUTOMATION_LIST",description:"List automations",category:"Automations"},{name:"AUTOMATION_UPDATE",description:"Update automation",category:"Automations"},{name:"AUTOMATION_DELETE",description:"Delete automation",category:"Automations",dangerous:!0},{name:"AUTOMATION_TRIGGER_ADD",description:"Add trigger to automation",category:"Automations"},{name:"AUTOMATION_TRIGGER_REMOVE",description:"Remove trigger from automation",category:"Automations"},{name:"AUTOMATION_RUN",description:"Manually trigger an automation run",category:"Automations"},{name:"VIRTUAL_MCP_PLUGIN_CONFIG_GET",description:"View virtual MCP plugin configuration",category:"Virtual MCPs"},{name:"VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE",description:"Update virtual MCP plugin configuration",category:"Virtual MCPs"},{name:"VIRTUAL_MCP_PINNED_VIEWS_UPDATE",description:"Update virtual MCP pinned sidebar views",category:"Virtual MCPs"},{name:"AI_PROVIDERS_LIST",description:"List available AI providers",category:"AI Providers"},{name:"AI_PROVIDERS_LIST_MODELS",description:"List AI provider models",category:"AI Providers"},{name:"AI_PROVIDERS_ACTIVE",description:"List active AI providers",category:"AI Providers"},{name:"AI_PROVIDER_KEY_CREATE",description:"Store AI provider API key",category:"AI Providers"},{name:"AI_PROVIDER_KEY_LIST",description:"List AI provider API keys",category:"AI Providers"},{name:"AI_PROVIDER_KEY_DELETE",description:"Delete AI provider API key",category:"AI Providers",dangerous:!0},{name:"AI_PROVIDER_OAUTH_URL",description:"Get OAuth URL for provider",category:"AI Providers"},{name:"AI_PROVIDER_OAUTH_EXCHANGE",description:"Exchange OAuth code for API key",category:"AI Providers"},{name:"AI_PROVIDER_PROVISION_KEY",description:"Auto-provision API key for a provider",category:"AI Providers"},{name:"AI_PROVIDER_TOPUP_URL",description:"Get checkout URL to top up provider credits",category:"AI Providers"},{name:"AI_PROVIDER_CREDITS",description:"Get current credit balance for a provider",category:"AI Providers"},{name:"AI_PROVIDER_CLI_ACTIVATE",description:"Activate Claude Code via local CLI",category:"AI Providers"},{name:"LIST_OBJECTS",description:"List objects in storage",category:"Object Storage"},{name:"GET_OBJECT_METADATA",description:"Get object metadata",category:"Object Storage"},{name:"GET_PRESIGNED_URL",description:"Generate download URL",category:"Object Storage"},{name:"PUT_PRESIGNED_URL",description:"Generate upload URL",category:"Object Storage"},{name:"DELETE_OBJECT",description:"Delete object",category:"Object Storage",dangerous:!0},{name:"DELETE_OBJECTS",description:"Delete multiple objects",category:"Object Storage",dangerous:!0},{name:"COLLECTION_REGISTRY_APP_LIST",description:"List registry apps",category:"Registry"},{name:"COLLECTION_REGISTRY_APP_GET",description:"Get registry app details",category:"Registry"},{name:"COLLECTION_REGISTRY_APP_VERSIONS",description:"List registry app versions",category:"Registry"},{name:"COLLECTION_REGISTRY_APP_FILTERS",description:"Get registry app filters",category:"Registry"},{name:"REGISTRY_ITEM_LIST",description:"List private registry items",category:"Registry"},{name:"REGISTRY_ITEM_SEARCH",description:"Search registry items",category:"Registry"},{name:"REGISTRY_ITEM_GET",description:"Get registry item details",category:"Registry"},{name:"REGISTRY_ITEM_VERSIONS",description:"List registry item versions",category:"Registry"},{name:"REGISTRY_ITEM_CREATE",description:"Create registry item",category:"Registry"},{name:"REGISTRY_ITEM_BULK_CREATE",description:"Bulk create registry items",category:"Registry"},{name:"REGISTRY_ITEM_UPDATE",description:"Update registry item",category:"Registry"},{name:"REGISTRY_ITEM_DELETE",description:"Delete registry item",category:"Registry",dangerous:!0},{name:"REGISTRY_ITEM_FILTERS",description:"Get registry item filters",category:"Registry"},{name:"REGISTRY_DISCOVER_TOOLS",description:"Discover tools from MCP server",category:"Registry"},{name:"REGISTRY_AI_GENERATE",description:"AI-generate registry content",category:"Registry"},{name:"REGISTRY_PUBLISH_REQUEST_LIST",description:"List publish requests",category:"Registry"},{name:"REGISTRY_PUBLISH_REQUEST_REVIEW",description:"Review publish request",category:"Registry"},{name:"REGISTRY_PUBLISH_REQUEST_COUNT",description:"Count pending publish requests",category:"Registry"},{name:"REGISTRY_PUBLISH_REQUEST_DELETE",description:"Delete publish request",category:"Registry",dangerous:!0},{name:"REGISTRY_PUBLISH_API_KEY_GENERATE",description:"Generate publish API key",category:"Registry"},{name:"REGISTRY_PUBLISH_API_KEY_LIST",description:"List publish API keys",category:"Registry"},{name:"REGISTRY_PUBLISH_API_KEY_REVOKE",description:"Revoke publish API key",category:"Registry",dangerous:!0},{name:"REGISTRY_MONITOR_RUN_START",description:"Start monitor run",category:"Registry"},{name:"REGISTRY_MONITOR_RUN_LIST",description:"List monitor runs",category:"Registry"},{name:"REGISTRY_MONITOR_RUN_GET",description:"Get monitor run details",category:"Registry"},{name:"REGISTRY_MONITOR_RUN_CANCEL",description:"Cancel monitor run",category:"Registry"},{name:"REGISTRY_MONITOR_RESULT_LIST",description:"List monitor results",category:"Registry"},{name:"REGISTRY_MONITOR_CONNECTION_LIST",description:"List monitor connections",category:"Registry"},{name:"REGISTRY_MONITOR_CONNECTION_SYNC",description:"Sync monitor connections",category:"Registry"},{name:"REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH",description:"Update monitor connection auth",category:"Registry"},{name:"REGISTRY_MONITOR_SCHEDULE_SET",description:"Set monitor schedule",category:"Registry"},{name:"REGISTRY_MONITOR_SCHEDULE_CANCEL",description:"Cancel monitor schedule",category:"Registry"},{name:"VM_START",description:"Start a Freestyle VM with dev server preview",category:"VM"},{name:"VM_DELETE",description:"Stop and delete a Freestyle VM",category:"VM"},{name:"GITHUB_LIST_USER_ORGS",description:"List GitHub user's personal account and organizations",category:"GitHub"}],Lt={ORGANIZATION_CREATE:"Create organization",ORGANIZATION_LIST:"List organizations",ORGANIZATION_GET:"View organization details",ORGANIZATION_UPDATE:"Update organization",ORGANIZATION_DELETE:"Delete organization",ORGANIZATION_SETTINGS_GET:"View organization settings",ORGANIZATION_SETTINGS_UPDATE:"Update organization settings",BRAND_CONTEXT_LIST:"List brand contexts",BRAND_CONTEXT_GET:"View brand context",BRAND_CONTEXT_CREATE:"Create brand context",BRAND_CONTEXT_UPDATE:"Update brand context",BRAND_CONTEXT_DELETE:"Delete brand context",BRAND_CONTEXT_EXTRACT:"Extract brand from website",BRAND_GET:"Get brand",BRAND_LIST:"List brands",ORGANIZATION_DOMAIN_GET:"Get domain claim",ORGANIZATION_DOMAIN_SET:"Set domain claim",ORGANIZATION_DOMAIN_UPDATE:"Update domain settings",ORGANIZATION_DOMAIN_CLEAR:"Clear domain claim",ORGANIZATION_MEMBER_LIST:"List members",ORGANIZATION_MEMBER_ADD:"Add members",ORGANIZATION_MEMBER_REMOVE:"Remove members",ORGANIZATION_MEMBER_UPDATE_ROLE:"Update member roles",COLLECTION_CONNECTIONS_LIST:"List connections",COLLECTION_CONNECTIONS_GET:"View connection details",COLLECTION_CONNECTIONS_CREATE:"Create connections",COLLECTION_CONNECTIONS_UPDATE:"Update connections",COLLECTION_CONNECTIONS_DELETE:"Delete connections",CONNECTION_TEST:"Test connections",DATABASES_RUN_SQL:"Run SQL queries",COLLECTION_VIRTUAL_MCP_CREATE:"Create virtual MCPs",COLLECTION_VIRTUAL_MCP_LIST:"List virtual MCPs",COLLECTION_VIRTUAL_MCP_GET:"View virtual MCP details",COLLECTION_VIRTUAL_MCP_UPDATE:"Update virtual MCPs",COLLECTION_VIRTUAL_MCP_DELETE:"Delete virtual MCPs",MONITORING_LOG_GET:"View monitoring log details",MONITORING_LOGS_LIST:"List monitoring logs",MONITORING_STATS:"View monitoring statistics",API_KEY_CREATE:"Create API key",API_KEY_LIST:"List API keys",API_KEY_UPDATE:"Update API key",API_KEY_DELETE:"Delete API key",EVENT_PUBLISH:"Publish events",EVENT_SUBSCRIBE:"Subscribe to events",EVENT_UNSUBSCRIBE:"Unsubscribe from events",EVENT_CANCEL:"Cancel recurring events",EVENT_ACK:"Acknowledge event delivery",EVENT_SUBSCRIPTION_LIST:"List event subscriptions",EVENT_SYNC_SUBSCRIPTIONS:"Sync subscriptions to desired state",USER_GET:"Get user by id",COLLECTION_THREADS_CREATE:"Create threads",COLLECTION_THREADS_LIST:"List threads",COLLECTION_THREADS_GET:"View thread details",COLLECTION_THREADS_UPDATE:"Update threads",COLLECTION_THREADS_DELETE:"Delete threads",COLLECTION_THREAD_MESSAGES_LIST:"List thread messages",TAGS_LIST:"List organization tags",TAGS_CREATE:"Create organization tag",TAGS_DELETE:"Delete organization tag",MEMBER_TAGS_GET:"Get member tags",MEMBER_TAGS_SET:"Set member tags",VIRTUAL_MCP_PLUGIN_CONFIG_GET:"View plugin config",VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE:"Update plugin config",VIRTUAL_MCP_PINNED_VIEWS_UPDATE:"Update pinned views",AUTOMATION_CREATE:"Create automation",AUTOMATION_GET:"View automation details",AUTOMATION_LIST:"List automations",AUTOMATION_UPDATE:"Update automation",AUTOMATION_DELETE:"Delete automation",AUTOMATION_TRIGGER_ADD:"Add trigger",AUTOMATION_TRIGGER_REMOVE:"Remove trigger",AUTOMATION_RUN:"Run automation",AI_PROVIDERS_LIST:"List AI providers",AI_PROVIDERS_LIST_MODELS:"List AI models",AI_PROVIDERS_ACTIVE:"List active providers",AI_PROVIDER_KEY_CREATE:"Create provider key",AI_PROVIDER_KEY_LIST:"List provider keys",AI_PROVIDER_KEY_DELETE:"Delete provider key",AI_PROVIDER_OAUTH_URL:"Get OAuth URL",AI_PROVIDER_OAUTH_EXCHANGE:"Connect via OAuth",AI_PROVIDER_PROVISION_KEY:"Auto-provision key",AI_PROVIDER_TOPUP_URL:"Get top-up checkout URL",AI_PROVIDER_CREDITS:"Get credit balance",AI_PROVIDER_CLI_ACTIVATE:"Activate Claude Code CLI",LIST_OBJECTS:"List objects",GET_OBJECT_METADATA:"Get object metadata",GET_PRESIGNED_URL:"Generate download URL",PUT_PRESIGNED_URL:"Generate upload URL",DELETE_OBJECT:"Delete object",DELETE_OBJECTS:"Delete multiple objects",COLLECTION_REGISTRY_APP_LIST:"List registry apps",COLLECTION_REGISTRY_APP_GET:"Get registry app",COLLECTION_REGISTRY_APP_VERSIONS:"List registry app versions",COLLECTION_REGISTRY_APP_FILTERS:"Get registry filters",REGISTRY_ITEM_LIST:"List registry items",REGISTRY_ITEM_SEARCH:"Search registry",REGISTRY_ITEM_GET:"Get registry item",REGISTRY_ITEM_VERSIONS:"List item versions",REGISTRY_ITEM_CREATE:"Create registry item",REGISTRY_ITEM_BULK_CREATE:"Bulk create items",REGISTRY_ITEM_UPDATE:"Update registry item",REGISTRY_ITEM_DELETE:"Delete registry item",REGISTRY_ITEM_FILTERS:"Get item filters",REGISTRY_DISCOVER_TOOLS:"Discover tools",REGISTRY_AI_GENERATE:"AI generate content",REGISTRY_PUBLISH_REQUEST_LIST:"List publish requests",REGISTRY_PUBLISH_REQUEST_REVIEW:"Review publish request",REGISTRY_PUBLISH_REQUEST_COUNT:"Count publish requests",REGISTRY_PUBLISH_REQUEST_DELETE:"Delete publish request",REGISTRY_PUBLISH_API_KEY_GENERATE:"Generate API key",REGISTRY_PUBLISH_API_KEY_LIST:"List API keys",REGISTRY_PUBLISH_API_KEY_REVOKE:"Revoke API key",REGISTRY_MONITOR_RUN_START:"Start monitor run",REGISTRY_MONITOR_RUN_LIST:"List monitor runs",REGISTRY_MONITOR_RUN_GET:"Get monitor run",REGISTRY_MONITOR_RUN_CANCEL:"Cancel monitor run",REGISTRY_MONITOR_RESULT_LIST:"List monitor results",REGISTRY_MONITOR_CONNECTION_LIST:"List monitor connections",REGISTRY_MONITOR_CONNECTION_SYNC:"Sync monitor connections",REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH:"Update connection auth",REGISTRY_MONITOR_SCHEDULE_SET:"Set monitor schedule",REGISTRY_MONITOR_SCHEDULE_CANCEL:"Cancel monitor schedule",VM_START:"Start VM preview",VM_DELETE:"Delete VM preview",GITHUB_LIST_USER_ORGS:"List GitHub user orgs"};function vt(){const t={Organizations:[],Connections:[],"Virtual MCPs":[],Threads:[],Monitoring:[],Users:[],"API Keys":[],"Event Bus":[],Tags:[],"AI Providers":[],Automations:[],"Object Storage":[],Registry:[],GitHub:[],VM:[]};for(const e of Xe)t[e.category]?.push(e);return t}function jt(){return Xe.map(t=>({value:t.name,label:Lt[t.name],dangerous:t.dangerous}))}const Pt=k.memo(function(e){const n=q.c(21),{connection:i,isSelected:o,hasToolsEnabled:c,activeToolsCount:u,totalToolsCount:f,onSelect:d,onToggle:T}=e,g=o?"bg-accent/50":"hover:bg-muted/50";let r;n[0]!==g?(r=H("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",g),n[0]=g,n[1]=r):r=n[1];let E;n[2]!==i.icon||n[3]!==i.title?(E=s.jsx(be,{icon:i.icon,name:i.title,size:"xs"}),n[2]=i.icon,n[3]=i.title,n[4]=E):E=n[4];let a;n[5]!==i.title?(a=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.title})}),n[5]=i.title,n[6]=a):a=n[6];let m;n[7]!==d||n[8]!==E||n[9]!==a?(m=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:d,children:[E,a]}),n[7]=d,n[8]=E,n[9]=a,n[10]=m):m=n[10];let _;n[11]!==u||n[12]!==i.tools||n[13]!==c||n[14]!==T||n[15]!==f?(_=i.tools&&i.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[u,"/",f]}),s.jsx(Oe,{checked:c,onCheckedChange:T,onClick:Dt})]}),n[11]=u,n[12]=i.tools,n[13]=c,n[14]=T,n[15]=f,n[16]=_):_=n[16];let x;return n[17]!==r||n[18]!==m||n[19]!==_?(x=s.jsxs("div",{className:r,children:[m,_]}),n[17]=r,n[18]=m,n[19]=_,n[20]=x):x=n[20],x}),Mt=k.memo(function(e){const n=q.c(18),{connectionId:i,tool:o,isSelected:c,onToggle:u}=e,f=`tool-${i}-${o.name}`,d=c?"text-foreground":"text-muted-foreground";let T;n[0]!==d?(T=H("text-sm font-medium",d),n[0]=d,n[1]=T):T=n[1];let g;n[2]!==T||n[3]!==o.name?(g=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:T,children:o.name})}),n[2]=T,n[3]=o.name,n[4]=g):g=n[4];let r;n[5]!==o.description?(r=o.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:o.description}),n[5]=o.description,n[6]=r):r=n[6];let E;n[7]!==g||n[8]!==r?(E=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,r]}),n[7]=g,n[8]=r,n[9]=E):E=n[9];const a=`tool-${i}-${o.name}`;let m;n[10]!==c||n[11]!==u||n[12]!==a?(m=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(Oe,{id:a,checked:c,onCheckedChange:u,onClick:wt})}),n[10]=c,n[11]=u,n[12]=a,n[13]=m):m=n[13];let _;return n[14]!==f||n[15]!==E||n[16]!==m?(_=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:f,children:[E,m]}),n[14]=f,n[15]=E,n[16]=m,n[17]=_):_=n[17],_});function Gt({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n,searchQuery:i}){const[o,c]=k.useState(""),u=i!==void 0?i:o,f=k.useDeferredValue(u),[d,T]=k.useState("all"),[g,r]=k.useState(!1),E=k.useRef(new Set(Object.keys(t))),{org:a}=Re(),m=Rt({connectionId:xt,orgId:a.id}),_=100,x=f.trim(),C=x?{operator:"or",conditions:[{field:["title"],operator:"contains",value:x},{field:["description"],operator:"contains",value:x}]}:void 0,v=!!n,A={...C&&{where:C},orderBy:[{field:["updated_at"],direction:"asc"}],limit:_,offset:0,...v&&{include_virtual:!0}},y=JSON.stringify(A),{data:S,fetchNextPage:N,hasNextPage:p,isFetchingNextPage:b}=ht({queryKey:ce.collectionListInfinite(m,a.id,"","CONNECTIONS",y),queryFn:async({pageParam:I=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...C&&{where:C},orderBy:[{field:["updated_at"],direction:"asc"}],limit:_,offset:I,...v&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(I,U)=>{if(I?.hasMore)return U.reduce((K,ee)=>K+(ee?.items?.length??0),0)},staleTime:3e4}),l=S?.pages.flatMap(I=>I?.items??[])??[],h=_t(N,p??!1,b),P=n?l.filter(I=>I.connection_type!=="VIRTUAL"?!0:it(I.connection_url)!==n):l,j=E.current,R=[...j.values()].map(I=>P.find(U=>U.id===I)).filter(I=>I!==void 0),O=P.filter(I=>!j.has(I.id)),M=[...R,...O],Y=I=>{const U=t[I];return U!==void 0&&U.length>0},z=M.filter(I=>{if(d==="all")return!0;const U=Y(I.id);return d==="selected"?U:d==="unselected"?!U:!0}),[D,w]=k.useState(M[0]?.id??null),L=D?M.find(I=>I.id===D)??null:null,V=L?.tools??[],$=(I,U)=>t[I]?.includes(U)??!1,Q=(I,U)=>{const K=t[I]??[],ee=K.includes(U),Z={...t};if(ee){const J=K.filter(F=>F!==U);J.length===0?delete Z[I]:Z[I]=J}else Z[I]=[...K,U];e(Z)},X=I=>{const U=M.find(F=>F.id===I);if(!U?.tools)return;const K=t[I]??[],ee=U.tools.map(F=>F.name),Z=K.length>0&&ee.every(F=>K.includes(F)),J={...t};Z?delete J[I]:(J[I]=ee,w(I)),e(J)},W=I=>{w(I),r(!0)},ie=()=>{r(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:H("w-full md:w-80 border-r border-border flex flex-col",g&&"hidden md:flex"),children:[i===void 0&&s.jsx(Nt,{value:o,onChange:c,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>T("all"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>T("selected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>T("unselected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:z.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:u?"No connections found":d==="selected"?"No servers selected":d==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[z.map(I=>{const U=I.tools?.length??0,K=t[I.id]?.length??0;return s.jsx(Pt,{connection:I,isSelected:D===I.id,hasToolsEnabled:Y(I.id),activeToolsCount:K,totalToolsCount:U,onSelect:()=>W(I.id),onToggle:()=>X(I.id)},I.id)}),s.jsx("div",{ref:h,className:"h-4"}),b&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(_e,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:H("flex-1 flex-col",g?"flex":"hidden md:flex"),children:L?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ne,{variant:"ghost",size:"sm",onClick:ie,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(It,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(be,{icon:L.icon,name:L.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:L.title}),L.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:L.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:V.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:V.map(I=>s.jsx(Mt,{connectionId:L.id,tool:I,isSelected:$(L.id,I.name),onToggle:()=>Q(L.id,I.name)},I.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function Dt(t){return t.stopPropagation()}function wt(t){return t.stopPropagation()}const xe=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],Ut={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Je(t){if(!t)return"bg-neutral-400";let e=0;for(let i=0;i<t.length;i++){const o=t.charCodeAt(i);e=(e<<5)-e+o,e=e&e}const n=Math.abs(e)%xe.length;return xe[n]??xe[0]}function Me(t,e){return e?Ut[t]??"bg-neutral-400":Je(t)}const kt=ye({role:ye({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:ve(),staticPermissions:he(se()),toolSet:Le(se(),he(se())),allowAllModels:ve(),modelSet:Le(se(),he(se())),memberIds:he(se())});function We(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Vt(t){const e=q.c(34),{allowAllStaticPermissions:n,staticPermissions:i,onAllowAllChange:o,onPermissionsChange:c,readOnly:u,searchQuery:f}=t,d=u===void 0?!1:u,T=k.useDeferredValue(f);let g,r,E,a;if(e[0]!==n||e[1]!==T||e[2]!==o||e[3]!==c||e[4]!==d||e[5]!==i){const x=vt(),C=jt(),v=C.filter(l=>l.label.toLowerCase().includes(T.toLowerCase())),A=l=>{if(i.includes(l))c(i.filter(h=>h!==l));else{const h=[...i,l];h.length===C.length?(o(!0),c([])):c(h)}};E="flex flex-col h-full";const y=!d&&"hover:bg-muted/50 cursor-pointer";let S;e[10]!==y?(S=H("flex items-center justify-between px-4 py-3",y),e[10]=y,e[11]=S):S=e[11];let N;e[12]!==n||e[13]!==o||e[14]!==c||e[15]!==d?(N=()=>{d||(o(!n),c([]))},e[12]=n,e[13]=o,e[14]=c,e[15]=d,e[16]=N):N=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("span",{className:"text-sm font-medium",children:"All organization permissions"}),e[17]=p):p=e[17];let b;e[18]!==n||e[19]!==o||e[20]!==c||e[21]!==d?(b=s.jsx("div",{onClick:Kt,children:d?s.jsx(ue,{children:s.jsxs(ge,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(oe,{checked:n,disabled:!0,onCheckedChange:Ht})})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(oe,{checked:n,onCheckedChange:l=>{o(l),c([])}})}),e[18]=n,e[19]=o,e[20]=c,e[21]=d,e[22]=b):b=e[22],e[23]!==b||e[24]!==S||e[25]!==N?(a=s.jsx("div",{className:"border-b border-border",children:s.jsxs("div",{className:S,onClick:N,children:[p,b]})}),e[23]=b,e[24]=S,e[25]=N,e[26]=a):a=e[26],g="flex-1 overflow-auto",r=Object.entries(x).map(l=>{const[h,P]=l,j=v.filter(R=>P.some(O=>O.name===R.value));return j.length===0?null:s.jsxs("div",{className:"mb-6 last:mb-0",children:[s.jsx("h4",{className:"text-sm font-medium p-3 pb-1.5 text-muted-foreground/75",children:h}),s.jsx("div",{className:"space-y-1",children:j.map(R=>s.jsxs("div",{className:H("flex items-center justify-between gap-3 px-4 py-3",!d&&"hover:bg-muted/50 cursor-pointer"),onClick:()=>{d||(n?(o(!1),c(C.map($t).filter(O=>O!==R.value))):A(R.value))},children:[s.jsx("span",{className:"text-sm flex-1 min-w-0",children:R.label}),s.jsx("div",{onClick:Yt,children:d?s.jsx(ue,{children:s.jsxs(ge,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(oe,{checked:n||i.includes(R.value),disabled:!0,onCheckedChange:zt})})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(oe,{checked:n||i.includes(R.value),onCheckedChange:()=>{n?(o(!1),c(C.map(Bt).filter(O=>O!==R.value))):A(R.value)}})})]},R.value))})]},h)}),e[0]=n,e[1]=T,e[2]=o,e[3]=c,e[4]=d,e[5]=i,e[6]=g,e[7]=r,e[8]=E,e[9]=a}else g=e[6],r=e[7],E=e[8],a=e[9];let m;e[27]!==g||e[28]!==r?(m=s.jsx("div",{className:g,children:r}),e[27]=g,e[28]=r,e[29]=m):m=e[29];let _;return e[30]!==E||e[31]!==a||e[32]!==m?(_=s.jsxs("div",{className:E,children:[a,m]}),e[30]=E,e[31]=a,e[32]=m,e[33]=_):_=e[33],_}function Bt(t){return t.value}function zt(){}function Yt(t){return t.stopPropagation()}function $t(t){return t.value}function Ht(){}function Kt(t){return t.stopPropagation()}const et={anthropic:"Anthropic",openrouter:"OpenRouter"},Ft={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Qt(t,e){const n=t.indexOf("/"),i=n>0?t.slice(0,n):e;return i.startsWith("~")?i.slice(1):i}function Zt(t){return Ft[t]??et[t]??t}function qt(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const tt=30;function Xt(t){const e=q.c(44),{connectionId:n,subProviderId:i,subProviderName:o,groupLogo:c,models:u,allConnectionModelIds:f,selectedModels:d,allowAllModels:T,allConnectionModelsSelected:g,onToggleModel:r,onExitAllowAll:E,readOnly:a,defaultExpanded:m}=t,[_,x]=k.useState(m),C=m||_,v=x,[A,y]=k.useState(tt);let S;e[0]!==g||e[1]!==T||e[2]!==d?(S=h=>T||g||d.includes("*")||d.includes(h),e[0]=g,e[1]=T,e[2]=d,e[3]=S):S=e[3];const N=S;let p;if(e[4]!==N||e[5]!==u){let h;e[7]!==N?(h=P=>N(P.id),e[7]=N,e[8]=h):h=e[8],p=u.filter(h),e[4]=N,e[5]=u,e[6]=p}else p=e[6];const b=p.length;let l;if(e[9]!==f||e[10]!==T||e[11]!==n||e[12]!==b||e[13]!==C||e[14]!==c||e[15]!==N||e[16]!==u||e[17]!==E||e[18]!==r||e[19]!==a||e[20]!==i||e[21]!==o||e[22]!==A){const h=u.slice(0,A),P=u.length>A;let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=()=>v(ts),e[24]=j):j=e[24];const R=c??Fe[i]??Qe;let O;e[25]!==o||e[26]!==R?(O=s.jsx(be,{icon:R,name:o,size:"sm"}),e[25]=o,e[26]=R,e[27]=O):O=e[27];let M;e[28]!==o?(M=s.jsx("span",{className:"text-sm font-medium truncate",children:o}),e[28]=o,e[29]=M):M=e[29];let Y;e[30]!==O||e[31]!==M?(Y=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[O,M]}),e[30]=O,e[31]=M,e[32]=Y):Y=e[32];let z;e[33]!==b||e[34]!==u.length?(z=s.jsxs(fe,{variant:"secondary",className:"text-xs text-muted-foreground",children:[b,"/",u.length," enabled"]}),e[33]=b,e[34]=u.length,e[35]=z):z=e[35];let D;e[36]!==C?(D=C?s.jsx(bt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Ot,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=C,e[37]=D):D=e[37];let w;e[38]!==D||e[39]!==z?(w=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[z,D]}),e[38]=D,e[39]=z,e[40]=w):w=e[40];let L;e[41]!==w||e[42]!==Y?(L=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:j,children:[Y,w]}),e[41]=w,e[42]=Y,e[43]=L):L=e[43],l=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[L,C&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[h.map(V=>{const $=N(V.id),Q=()=>{if(!a){if(T){E(n,f,V.id);return}r(n,V.id)}};return s.jsxs("div",{className:H("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!a&&"hover:bg-muted/50 cursor-pointer"),onClick:Q,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:V.title})}),s.jsx("div",{onClick:es,children:a?s.jsx(ue,{children:s.jsxs(ge,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(oe,{checked:$,disabled:!0,onCheckedChange:Wt})})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(oe,{checked:$,onCheckedChange:Q})})]},V.id)}),P&&s.jsxs("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>y(Jt),children:["Show more (",u.length-A," remaining)"]})]})]}),e[9]=f,e[10]=T,e[11]=n,e[12]=b,e[13]=C,e[14]=c,e[15]=N,e[16]=u,e[17]=E,e[18]=r,e[19]=a,e[20]=i,e[21]=o,e[22]=A,e[23]=l}else l=e[23];return l}function Jt(t){return t+tt}function Wt(){}function es(t){return t.stopPropagation()}function ts(t){return!t}function ss(t){const e=q.c(33),{connection:n,selectedModels:i,allowAllModels:o,onToggleModel:c,onExitAllowAll:u,allConnectionModelsSelected:f,searchQuery:d,readOnly:T}=t,g=St(n.id);let r,E,a,m,_;if(e[0]!==f||e[1]!==o||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==u||e[6]!==c||e[7]!==g||e[8]!==T||e[9]!==d||e[10]!==i){_=Symbol.for("react.early_return_sentinel");e:{let v;e[16]!==n.label?(v=R=>({...R,id:R.modelId,provider:n.label}),e[16]=n.label,e[17]=v):v=e[17];const A=g.filter(os).map(v),y=d.trim().toLowerCase(),S=y?A.filter(R=>R.title.toLowerCase().includes(y)||R.id.toLowerCase().includes(y)||R.provider?.toLowerCase().includes(y)):A;if(S.length===0){_=null;break e}const N=new Map;for(const R of S){const O=Qt(R.id,n.providerId),M=N.get(O)??{models:[],logo:null};M.models.push({id:R.id,title:qt(R.title),logo:R.logo}),!M.logo&&R.logo&&(M.logo=R.logo),N.set(O,M)}const p=Array.from(N.entries()).map(rs).sort(is),b=p.length===1||y.length>0;a="flex flex-col gap-3";const l=Fe[n.providerId]??Qe;let h;e[18]!==n.providerId||e[19]!==l?(h=s.jsx("img",{src:l,alt:n.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=n.providerId,e[19]=l,e[20]=h):h=e[20];const P=et[n.providerId]??n.providerId;let j;e[21]!==P?(j=s.jsx("h4",{className:"text-sm font-medium",children:P}),e[21]=P,e[22]=j):j=e[22],e[23]!==j||e[24]!==h?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[h,j]}),e[23]=j,e[24]=h,e[25]=m):m=e[25],r="flex flex-col gap-3",E=p.map(R=>s.jsx(Xt,{connectionId:n.id,subProviderId:R.id,subProviderName:R.name,groupLogo:R.logo,models:R.models,allConnectionModelIds:A.map(ns),selectedModels:i,allowAllModels:o,allConnectionModelsSelected:f,onToggleModel:c,onExitAllowAll:u,readOnly:T,defaultExpanded:b},R.id))}e[0]=f,e[1]=o,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=u,e[6]=c,e[7]=g,e[8]=T,e[9]=d,e[10]=i,e[11]=r,e[12]=E,e[13]=a,e[14]=m,e[15]=_}else r=e[11],E=e[12],a=e[13],m=e[14],_=e[15];if(_!==Symbol.for("react.early_return_sentinel"))return _;let x;e[26]!==r||e[27]!==E?(x=s.jsx("div",{className:r,children:E}),e[26]=r,e[27]=E,e[28]=x):x=e[28];let C;return e[29]!==a||e[30]!==m||e[31]!==x?(C=s.jsxs("div",{className:a,children:[m,x]}),e[29]=a,e[30]=m,e[31]=x,e[32]=C):C=e[32],C}function ns(t){return t.id}function is(t,e){return t.name.localeCompare(e.name)}function rs(t){const[e,n]=t;return{id:e,name:Zt(e),logo:n.logo,models:n.models}}function os(t,e,n){return n.findIndex(i=>i.modelId===t.modelId)===e}function ls(t){const e=q.c(35),{allowAllModels:n,modelSet:i,onAllowAllChange:o,onModelSetChange:c,readOnly:u,searchQuery:f}=t,d=u===void 0?!1:u,T=k.useDeferredValue(f),g=At();let r;e[0]!==i||e[1]!==c?(r=(p,b)=>{const l=i[p]??[],h={...i};if(l.includes(b)){const P=l.filter(j=>j!==b);P.length===0?delete h[p]:h[p]=P}else h[p]=[...l,b];c(h)},e[0]=i,e[1]=c,e[2]=r):r=e[2];const E=r;let a;e[3]!==i||e[4]!==o||e[5]!==c?(a=(p,b,l)=>{o(!1),c({...i,[p]:b.filter(h=>h!==l)})},e[3]=i,e[4]=o,e[5]=c,e[6]=a):a=e[6];const m=a,_=!d&&"hover:bg-muted/50 cursor-pointer";let x;e[7]!==_?(x=H("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",_),e[7]=_,e[8]=x):x=e[8];let C;e[9]!==n||e[10]!==o||e[11]!==c||e[12]!==d?(C=()=>{if(d)return;const p=!n;o(p),p&&c({})},e[9]=n,e[10]=o,e[11]=c,e[12]=d,e[13]=C):C=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[14]=v):v=e[14];let A;e[15]!==n||e[16]!==o||e[17]!==c||e[18]!==d?(A=s.jsx("div",{onClick:cs,children:d?s.jsx(ue,{children:s.jsxs(ge,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(oe,{checked:n,disabled:!0,onCheckedChange:as})})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(oe,{checked:n,onCheckedChange:p=>{o(p),p&&c({})}})}),e[15]=n,e[16]=o,e[17]=c,e[18]=d,e[19]=A):A=e[19];let y;e[20]!==x||e[21]!==C||e[22]!==A?(y=s.jsxs("div",{className:x,onClick:C,children:[v,A]}),e[20]=x,e[21]=C,e[22]=A,e[23]=y):y=e[23];let S;e[24]!==g||e[25]!==n||e[26]!==T||e[27]!==m||e[28]!==i||e[29]!==d||e[30]!==E?(S=g.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):g.map(p=>s.jsx(k.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_e,{className:"size-4 animate-spin"}),"Loading models..."]}),children:s.jsx(ss,{connection:p,selectedModels:i[p.id]??[],allowAllModels:n,onToggleModel:E,onExitAllowAll:m,allConnectionModelsSelected:(i[p.id]??[]).includes("*"),searchQuery:T,readOnly:d})},p.id)),e[24]=g,e[25]=n,e[26]=T,e[27]=m,e[28]=i,e[29]=d,e[30]=E,e[31]=S):S=e[31];let N;return e[32]!==S||e[33]!==y?(N=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[y,S]}),e[32]=S,e[33]=y,e[34]=N):N=e[34],N}function as(){}function cs(t){return t.stopPropagation()}function ds(t){const e=q.c(52),{open:n,onOpenChange:i,selectedMemberIds:o,onAddMembers:c}=t,[u,f]=k.useState(""),d=k.useDeferredValue(u);let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=[],e[0]=T):T=e[0];const[g,r]=k.useState(T),{data:E}=Ze();let a,m,_,x,C,v,A,y,S,N,p;if(e[1]!==E?.data?.members||e[2]!==d||e[3]!==c||e[4]!==i||e[5]!==n||e[6]!==g||e[7]!==u||e[8]!==o){const Y=E?.data?.members??[];let z;e[20]!==d?(z=L=>{const V=d.toLowerCase();return L.user?.name?.toLowerCase().includes(V)||L.user?.email?.toLowerCase().includes(V)},e[20]=d,e[21]=z):z=e[21];const D=Y.filter(z);let w;e[22]!==c||e[23]!==i||e[24]!==g?(w=()=>{c(g),r([]),i(!1)},e[22]=c,e[23]=i,e[24]=g,e[25]=w):w=e[25],_=w,m=Ue,N=n,p=i,a=ke,y="sm:max-w-md p-0 overflow-hidden",e[26]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs(Ve,{className:"px-6 pt-6",children:[s.jsx(Be,{children:"Add Members to Role"}),s.jsx(ze,{children:"Select members to add to this role."})]}),e[26]=S):S=e[26],v="flex flex-col h-80",e[27]!==u?(A=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Se,{value:u,onChange:f,placeholder:"Search members...",className:"w-full"})}),e[27]=u,e[28]=A):A=e[28],x="flex-1 overflow-auto",C=D.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:u?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:D.map(L=>{const V=L.role!=="owner",$=o.includes(L.id),Q=g.includes(L.id);return s.jsxs("label",{className:H("flex items-center gap-3 p-2 rounded-lg",!V||$?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(Oe,{checked:Q||$,onCheckedChange:()=>{!V||$||r(X=>X.includes(L.id)?X.filter(W=>W!==L.id):[...X,L.id])},disabled:!V||$}),s.jsx(qe,{url:L.user?.image??void 0,fallback:We(L.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:L.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:L.user?.email})]}),!V&&s.jsx(fe,{variant:"secondary",className:"shrink-0",children:"Owner"}),$&&V&&s.jsx(fe,{variant:"outline",className:"shrink-0",children:"Added"})]},L.id)})}),e[1]=E?.data?.members,e[2]=d,e[3]=c,e[4]=i,e[5]=n,e[6]=g,e[7]=u,e[8]=o,e[9]=a,e[10]=m,e[11]=_,e[12]=x,e[13]=C,e[14]=v,e[15]=A,e[16]=y,e[17]=S,e[18]=N,e[19]=p}else a=e[9],m=e[10],_=e[11],x=e[12],C=e[13],v=e[14],A=e[15],y=e[16],S=e[17],N=e[18],p=e[19];let b;e[29]!==x||e[30]!==C?(b=s.jsx("div",{className:x,children:C}),e[29]=x,e[30]=C,e[31]=b):b=e[31];let l;e[32]!==b||e[33]!==v||e[34]!==A?(l=s.jsxs("div",{className:v,children:[A,b]}),e[32]=b,e[33]=v,e[34]=A,e[35]=l):l=e[35];let h;e[36]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ye,{children:"Cancel"}),e[36]=h):h=e[36];const P=g.length===0,j=g.length>0&&`(${g.length})`;let R;e[37]!==_||e[38]!==P||e[39]!==j?(R=s.jsxs($e,{className:"px-6 pb-6",children:[h,s.jsxs(He,{onClick:_,disabled:P,children:["Add ",j]})]}),e[37]=_,e[38]=P,e[39]=j,e[40]=R):R=e[40];let O;e[41]!==a||e[42]!==l||e[43]!==R||e[44]!==y||e[45]!==S?(O=s.jsxs(a,{className:y,children:[S,l,R]}),e[41]=a,e[42]=l,e[43]=R,e[44]=y,e[45]=S,e[46]=O):O=e[46];let M;return e[47]!==m||e[48]!==O||e[49]!==N||e[50]!==p?(M=s.jsx(m,{open:N,onOpenChange:p,children:O}),e[47]=m,e[48]=O,e[49]=N,e[50]=p,e[51]=M):M=e[51],M}function ms(t){const e=q.c(28),{memberIds:n,onMemberIdsChange:i,readOnly:o,searchQuery:c,addMemberDialogOpen:u,onAddMemberDialogOpenChange:f}=t,d=o===void 0?!1:o,T=k.useDeferredValue(c),{data:g}=Ze();let r,E,a;if(e[0]!==g?.data?.members||e[1]!==T||e[2]!==n||e[3]!==i||e[4]!==d||e[5]!==c){const v=g?.data?.members??[];let A;e[9]!==n?(A=p=>n.includes(p.id),e[9]=n,e[10]=A):A=e[10];const y=v.filter(A);let S;e[11]!==T?(S=p=>{const b=T.toLowerCase();return p.user?.name?.toLowerCase().includes(b)||p.user?.email?.toLowerCase().includes(b)},e[11]=T,e[12]=S):S=e[12];const N=y.filter(S);a="flex flex-col h-full",r="flex-1 overflow-auto",E=y.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to grant them the configured permissions."})]})}):N.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',c,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:N.map(p=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(qe,{url:p.user?.image??void 0,fallback:We(p.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:p.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:p.user?.email})]}),d?s.jsx(ue,{children:s.jsxs(ge,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(ne,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(Pe,{size:16})})})}),s.jsx(Te,{children:s.jsx("p",{children:"Owner membership cannot be changed"})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>i(n.filter(b=>b!==p.id)),children:s.jsx(Pe,{size:16})})]},p.id))}),e[0]=g?.data?.members,e[1]=T,e[2]=n,e[3]=i,e[4]=d,e[5]=c,e[6]=r,e[7]=E,e[8]=a}else r=e[6],E=e[7],a=e[8];let m;e[13]!==r||e[14]!==E?(m=s.jsx("div",{className:r,children:E}),e[13]=r,e[14]=E,e[15]=m):m=e[15];let _;e[16]!==n||e[17]!==i?(_=v=>i([...n,...v]),e[16]=n,e[17]=i,e[18]=_):_=e[18];let x;e[19]!==u||e[20]!==n||e[21]!==f||e[22]!==_?(x=s.jsx(ds,{open:u,onOpenChange:f,selectedMemberIds:n,onAddMembers:_}),e[19]=u,e[20]=n,e[21]=f,e[22]=_,e[23]=x):x=e[23];let C;return e[24]!==a||e[25]!==m||e[26]!==x?(C=s.jsxs("div",{className:a,children:[m,x]}),e[24]=a,e[25]=m,e[26]=x,e[27]=C):C=e[27],C}function us(t){const e=q.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(_e,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let i;return e[1]!==t?(i=s.jsx(k.Suspense,{fallback:n,children:s.jsx(ms,{...t})}),e[1]=t,e[2]=i):i=e[2],i}const gs={owner:[],admin:[],user:[]};function Es(t,e){const n=t==="owner"||t==="admin";return{role:{slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:gs[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(i=>i.role===t).map(i=>i.id)}}function Ts(t,e,n){const i=t.permission||{},o=i.self||[],c=o.includes("*"),u=c?[]:o.filter(r=>r!=="*"),f={};for(const[r,E]of Object.entries(i))if(!(r==="self"||r==="models"))if(r==="*")for(const a of n)f[a.id]=E.includes("*")?a.tools?.map(m=>m.name)??[]:E;else{const a=n.find(m=>m.id===r);a&&(f[r]=E.includes("*")?a.tools?.map(m=>m.name)??[]:E)}const d=i.models||[],T=d.length===0||d.includes("*:*"),g={};if(!T)for(const r of d){const E=r.indexOf(":");if(E===-1)continue;const a=r.slice(0,E),m=r.slice(E+1);g[a]||(g[a]=[]),g[a].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:c,staticPermissions:u,toolSet:f,allowAllModels:T,modelSet:g,memberIds:e.filter(r=>r.role===t.role).map(r=>r.id)}}function ps(t,e){const n={};t.allowAllStaticPermissions?n.self=["*"]:t.staticPermissions.length>0&&(n.self=t.staticPermissions);for(const[i,o]of Object.entries(t.toolSet))if(o.length>0){const u=e.find(f=>f.id===i)?.tools?.map(f=>f.name)??[];n[i]=u.length>0&&u.every(f=>o.includes(f))?["*"]:o}if(t.allowAllModels)n.models=["*:*"];else{const i=[];for(const[o,c]of Object.entries(t.modelSet))for(const u of c)i.push(`${o}:${u}`);i.length>0&&(n.models=i)}return n}function fs(t,e,n){return t.kind==="builtin"?Es(t.role,e):t.kind==="custom"?Ts(t.role,e,n):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function _s(t){const e=q.c(5),{readOnly:n,onOpen:i}=t;if(n){let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ne,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Ce,{size:16}),"Add Member"]})})}),e[0]=u):u=e[0];let f;return e[1]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ue,{children:s.jsxs(ge,{children:[u,s.jsx(Te,{children:s.jsx("p",{children:"Owner membership cannot be changed"})})]})}),e[1]=f):f=e[1],f}let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ce,{size:16}),e[2]=o):o=e[2];let c;return e[3]!==i?(c=s.jsxs(ne,{variant:"outline",size:"sm",onClick:i,children:[o,"Add Member"]}),e[3]=i,e[4]=c):c=e[4],c}function Is(t){const e=q.c(11),{locator:n}=Re(),i=Ct();let o;e[0]!==n?(o=ce.members(n),e[0]=n,e[1]=o):o=e[1];let c;e[2]!==o?(c={queryKey:o,queryFn:hs},e[2]=o,e[3]=c):c=e[3];const{data:u,isPending:f}=Ge(c);if(f||!i){let r;return e[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(_e,{size:32,className:"animate-spin text-muted-foreground"})})}),e[4]=r):r=e[4],r}let d;e[5]!==u?.data?.members?(d=u?.data?.members??[],e[5]=u?.data?.members,e[6]=d):d=e[6];const T=d;let g;return e[7]!==i||e[8]!==T||e[9]!==t?(g=s.jsx(Rs,{...t,members:T,connections:i}),e[7]=i,e[8]=T,e[9]=t,e[10]=g):g=e[10],g}function hs(){return re.organization.listMembers()}function Rs({target:t,onBack:e,onSaved:n,members:i,connections:o}){const{locator:c}=Re(),u=De(),f=t.kind==="builtin",d=t.kind==="new",[T,g]=k.useState(f?"org":"mcp"),r=rt({resolver:ot(kt),defaultValues:fs(t,i,o)}),E=r.formState.isValid,a=r.formState.isDirty,m=we({mutationFn:async l=>{const h=ps(l,o),P=l.role.slug||l.role.label.toLowerCase().replace(/\s+/g,"-"),j=l.role.slug&&!l.role.id,R=async O=>{const M=i.filter(D=>D.role===O).map(D=>D.id),Y=l.memberIds.filter(D=>!M.includes(D)),z=M.filter(D=>!l.memberIds.includes(D));for(const D of Y){const w=await re.organization.updateMemberRole({memberId:D,role:[O]});if(w?.error)throw new Error(w.error.message??"Something went wrong")}for(const D of z){const w=await re.organization.updateMemberRole({memberId:D,role:["user"]});if(w?.error)throw new Error(w.error.message??"Something went wrong")}};if(j)return await R(l.role.slug),l;if(l.role.id){const O=await re.organization.updateRole({roleId:l.role.id,data:{permission:h}});if(O?.error)throw new Error(O.error.message??"Something went wrong");return await R(l.role.slug),l}else{const O=await re.organization.createRole({role:P,permission:h});if(O?.error)throw new Error(O.error.message??"Something went wrong");for(const M of l.memberIds){const Y=await re.organization.updateMemberRole({memberId:M,role:[P]});if(Y?.error)throw new Error(Y.error.message)}return{...l,role:{...l.role,id:O.data?.roleData?.id,slug:P}}}},onSuccess:(l,h)=>{u.invalidateQueries({queryKey:ce.members(c)}),u.invalidateQueries({queryKey:ce.organizationRoles(c)});const P=!h.role.id&&!h.role.slug,j=h.role.slug&&!h.role.id;Ae(j?"role_members_updated":P?"role_created":"role_updated",{role_slug:h.role.slug??null}),pe.success(j?"Members updated successfully!":P?"Role created successfully!":"Role updated successfully!"),r.reset(l),n(l.role.id)},onError:l=>{pe.error(l instanceof Error?l.message:"Failed to save role")}}),_=r.handleSubmit(l=>{if(!l.role.label.trim()){pe.error("Role name is required"),r.setFocus("role.label");return}m.mutate(l)}),x=!f||t.kind==="builtin"&&t.role!=="owner",C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...f?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[A,y]=k.useState(""),[S,N]=k.useState(!1),p=l=>{g(l),y("")},b={mcp:"Search MCP servers...",org:"Search permissions...",models:"Search models...",members:"Search members..."};return s.jsx(te,{children:s.jsxs(te.Content,{className:"flex flex-col overflow-hidden",children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(te.Title,{actions:x&&s.jsxs(s.Fragment,{children:[s.jsx(ne,{variant:"outline",size:"sm",onClick:e,disabled:m.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:_,disabled:m.isPending||!E||!a,children:m.isPending?"Saving...":d?"Create Role":"Save Changes"})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:H("size-2.5 rounded-full shrink-0",t.kind==="builtin"?Me(t.role,!0):t.kind==="custom"?Me(t.role.role,!1):Je(r.watch("role.label")))}),f?s.jsx(Ke,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(yt,{size:16,className:"text-muted-foreground shrink-0"}),d?s.jsx("input",{...r.register("role.label"),placeholder:"Role name",className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:!0}):s.jsx("span",{className:"truncate",children:C})]})}),s.jsx("div",{className:"flex items-center gap-2",children:v.map(l=>s.jsx("button",{type:"button",onClick:()=>p(l.id),className:H("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",T===l.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:l.label},l.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Se,{value:A,onChange:y,placeholder:b[T]??"Search...",className:"w-full md:w-[375px]"}),T==="members"&&s.jsx(_s,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>N(!0)})]})]})}),s.jsx("div",{className:"flex-1 min-h-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",children:s.jsxs("div",{className:H("h-full overflow-hidden",T!=="models"&&"border border-border rounded-xl bg-card"),children:[T==="mcp"&&!f&&s.jsx(Gt,{toolSet:r.watch("toolSet"),onToolSetChange:l=>r.setValue("toolSet",l,{shouldDirty:!0}),searchQuery:A}),T==="org"&&s.jsx(Vt,{allowAllStaticPermissions:r.watch("allowAllStaticPermissions"),staticPermissions:r.watch("staticPermissions"),onAllowAllChange:l=>r.setValue("allowAllStaticPermissions",l,{shouldDirty:!0}),onPermissionsChange:l=>r.setValue("staticPermissions",l,{shouldDirty:!0}),readOnly:f,searchQuery:A}),T==="models"&&s.jsx(ls,{allowAllModels:r.watch("allowAllModels"),modelSet:r.watch("modelSet"),onAllowAllChange:l=>r.setValue("allowAllModels",l,{shouldDirty:!0}),onModelSetChange:l=>r.setValue("modelSet",l,{shouldDirty:!0}),readOnly:f,searchQuery:A}),T==="members"&&s.jsx(us,{memberIds:r.watch("memberIds"),onMemberIdsChange:l=>r.setValue("memberIds",l,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&t.role==="owner",searchQuery:A,addMemberDialogOpen:S,onAddMemberDialogOpenChange:N})]})})]})})}function xs(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}const Ns=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Ne=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function Cs(t){if(!t)return"bg-neutral-400";let e=0;for(let i=0;i<t.length;i++){const o=t.charCodeAt(i);e=(e<<5)-e+o,e=e&e}const n=Math.abs(e)%Ne.length;return Ne[n]??Ne[0]}const As={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ss(t,e){return e?As[t]??"bg-neutral-400":Cs(t)}function bs(){const t=q.c(72),[e,n]=k.useState(""),[i,o]=k.useState(null),c=at();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[0]=u):u=t[0];const{role:f}=ct(u),{locator:d}=Re(),T=De(),{customRoles:g,refetch:r}=dt();let E;t[1]!==c?(E=G=>c({to:".",search:B=>({...B,role:G})}),t[1]=c,t[2]=E):E=t[2];const a=E;let m;e:{if(!f){m=null;break e}if(f==="new"){m={kind:"new"};break e}if(f.startsWith("builtin-")){m={kind:"builtin",role:f.slice(8)};break e}let G;t[3]!==f?(G=le=>le.id===f,t[3]=f,t[4]=G):G=t[4];const B=g.find(G);m=B?{kind:"custom",role:B}:null}const _=m;let x;t[5]!==d?(x=ce.members(d),t[5]=d,t[6]=x):x=t[6];let C;t[7]!==x?(C={queryKey:x,queryFn:Ds},t[7]=x,t[8]=C):C=t[8];const{data:v}=Ge(C);let A;t[9]!==v?.data?.members?(A=v?.data?.members??[],t[9]=v?.data?.members,t[10]=A):A=t[10];const y=A;let S;t[11]!==y?(S=G=>y.filter(B=>B.role===G).length,t[11]=y,t[12]=S):S=t[12];const N=S;let p;if(t[13]!==g||t[14]!==N||t[15]!==e){let G;t[17]!==N?(G=ae=>({kind:"builtin",role:{...ae,memberCount:N(ae.role)}}),t[17]=N,t[18]=G):G=t[18];const B=Ns.map(G);let le;t[19]!==N?(le=ae=>({kind:"custom",role:{...ae,memberCount:N(ae.role)}}),t[19]=N,t[20]=le):le=t[20];const st=g.map(le);if(p=[...B,...st],e){const ae=e.toLowerCase();p=p.filter(nt=>nt.role.label.toLowerCase().includes(ae))}t[13]=g,t[14]=N,t[15]=e,t[16]=p}else p=t[16];const b=we({mutationFn:Gs,onSuccess:(G,B)=>{Ae("role_deleted",{role_id:B}),T.invalidateQueries({queryKey:ce.members(d)}),T.invalidateQueries({queryKey:ce.organizationRoles(d)}),pe.success("Role deleted successfully!"),r(),_?.kind==="custom"&&_.role.id===B&&a(void 0)},onError:Ms});let l,h,P,j;t[21]===Symbol.for("react.memo_cache_sentinel")?(h={id:"role",header:"Role",render:Ps,cellClassName:"flex-1 min-w-0",sortable:!0},P={id:"type",header:"Type",render:js,cellClassName:"w-28 shrink-0"},j={id:"permissions",header:"Permissions",render:vs,cellClassName:"flex-1 min-w-0"},l={id:"members",header:"Members",render:Ls,cellClassName:"w-24 shrink-0"},t[21]=l,t[22]=h,t[23]=P,t[24]=j):(l=t[21],h=t[22],P=t[23],j=t[24]);let R;t[25]===Symbol.for("react.memo_cache_sentinel")?(R=[h,P,j,l,{id:"actions",header:"",render:G=>G.kind==="builtin"?null:s.jsxs(mt,{children:[s.jsx(ut,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ys,children:s.jsx(Tt,{size:16})})}),s.jsx(gt,{align:"end",onClick:Os,children:s.jsxs(Et,{variant:"destructive",onClick:()=>{const B=G.role;B.id&&o({id:B.id,label:B.label})},children:[s.jsx(pt,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[25]=R):R=t[25];const O=R;let M;t[26]!==a?(M=G=>{if(G.kind==="builtin")a(`builtin-${G.role.role}`);else{const B=G.role;a(B.id)}},t[26]=a,t[27]=M):M=t[27];const Y=M;if(_){let G;t[28]!==a?(G=()=>a(void 0),t[28]=a,t[29]=G):G=t[29];let B;return t[30]!==r||t[31]!==a?(B=()=>{r(),a(void 0)},t[30]=r,t[31]=a,t[32]=B):B=t[32],s.jsx(Is,{target:_,onBack:G,onSaved:B},xs(_))}let z;t[33]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(te.Title,{children:"Roles"}),t[33]=z):z=t[33];let D;t[34]===Symbol.for("react.memo_cache_sentinel")?(D=G=>{G.key==="Escape"&&(n(""),G.target.blur())},t[34]=D):D=t[34];let w;t[35]!==e?(w=s.jsx(Se,{value:e,onChange:n,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:D}),t[35]=e,t[36]=w):w=t[36];let L;t[37]!==a?(L=()=>a("new"),t[37]=a,t[38]=L):L=t[38];let V;t[39]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(Ce,{size:16}),t[39]=V):V=t[39];let $;t[40]!==L?($=s.jsxs(ne,{onClick:L,children:[V,"Create Role"]}),t[40]=L,t[41]=$):$=t[41];let Q;t[42]!==w||t[43]!==$?(Q=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[w,$]}),t[42]=w,t[43]=$,t[44]=Q):Q=t[44];let X;t[45]!==e?(X=e?s.jsx(je,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(je,{title:"No roles",description:"Create a role to get started."}),t[45]=e,t[46]=X):X=t[46];let W;t[47]!==p||t[48]!==O||t[49]!==Y||t[50]!==X?(W=s.jsx(ft,{columns:O,data:p,isLoading:!1,onRowClick:Y,emptyState:X}),t[47]=p,t[48]=O,t[49]=Y,t[50]=X,t[51]=W):W=t[51];let ie;t[52]!==Q||t[53]!==W?(ie=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[z,Q,W]})})}),t[52]=Q,t[53]=W,t[54]=ie):ie=t[54];const I=i!==null;let U;t[55]===Symbol.for("react.memo_cache_sentinel")?(U=G=>!G&&o(null),t[55]=U):U=t[55];let K;t[56]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Be,{children:"Delete Role"}),t[56]=K):K=t[56];const ee=i?.label;let Z;t[57]!==ee?(Z=s.jsxs(Ve,{children:[K,s.jsxs(ze,{children:['Are you sure you want to delete the "',ee,'" role? This action cannot be undone.']})]}),t[57]=ee,t[58]=Z):Z=t[58];let J;t[59]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(Ye,{children:"Cancel"}),t[59]=J):J=t[59];let F;t[60]!==b||t[61]!==i?(F=s.jsxs($e,{children:[J,s.jsx(He,{onClick:()=>{i?.id&&b.mutate(i.id),o(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[60]=b,t[61]=i,t[62]=F):F=t[62];let de;t[63]!==Z||t[64]!==F?(de=s.jsxs(ke,{children:[Z,F]}),t[63]=Z,t[64]=F,t[65]=de):de=t[65];let me;t[66]!==I||t[67]!==de?(me=s.jsx(Ue,{open:I,onOpenChange:U,children:de}),t[66]=I,t[67]=de,t[68]=me):me=t[68];let Ie;return t[69]!==ie||t[70]!==me?(Ie=s.jsxs(te,{children:[ie,me]}),t[69]=ie,t[70]=me,t[71]=Ie):Ie=t[71],Ie}function Os(t){return t.stopPropagation()}function ys(t){return t.stopPropagation()}function Ls(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function vs(t){if(t.kind==="builtin")return t.role.role==="owner"||t.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"Full access"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:"Basic access"});const e=t.role,n=[];return e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.length>0?n.join(", "):"No permissions"})}function js(t){return t.kind==="builtin"?s.jsx(fe,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(fe,{variant:"outline",className:"text-xs",children:"Custom"})}function Ps(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:H("size-2.5 rounded-full shrink-0",Ss(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(Ke,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ms(t,e){Ae("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),pe.error(t instanceof Error?t.message:"Failed to delete role")}async function Gs(t){const e=await re.organization.deleteRole({roleId:t});if(e?.error)throw new Error(e.error.message);return e?.data}function Ds(){return re.organization.listMembers()}function kn(){const t=q.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load roles"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(lt,{fallback:e,children:s.jsx(k.Suspense,{fallback:s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(_e,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(bs,{})})}),t[1]=n):n=t[1],n}export{kn as default};