decocms 2.291.1 → 2.291.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/client/assets/{AlertCircle-BYbLY8JK.js → AlertCircle-BU25E17i.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-CcXLWn5B.js → ArrowNarrowLeft-DsozI7ul.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-BYnm98Tt.js → ArrowUpRight-wUPlLzWo.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-YokVYrIX.js → CheckCircle-B6ooPL10.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BRURl2T5.js → ChevronDown-BjunjZ96.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-CZmvUfnf.js → ChevronRight-DZ8_B5Zy.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-VkkFTpbv.js → ChevronUp-BcfJms1N.js} +1 -1
  8. package/dist/client/assets/{Container-DQZzI4AA.js → Container-BBbTXyMq.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-D5rWkx3C.js → DotsVertical-ChXlfNDE.js} +1 -1
  10. package/dist/client/assets/{LinkExternal01-tSCOf-pQ.js → LinkExternal01-Bq6E6IiB.js} +1 -1
  11. package/dist/client/assets/{Lock01-CQvbe2FZ.js → Lock01-CT9fVg-M.js} +1 -1
  12. package/dist/client/assets/{Palette-DZWPAJiP.js → Palette-CL1PeBDG.js} +1 -1
  13. package/dist/client/assets/{Play-BwrtIjN9.js → Play-O7Kb3HkD.js} +1 -1
  14. package/dist/client/assets/{Plus-Mx814qi5.js → Plus-BX8KY2Vj.js} +1 -1
  15. package/dist/client/assets/{RefreshCcw01-Bmm2OZFs.js → RefreshCcw01-DtyDEAf2.js} +1 -1
  16. package/dist/client/assets/{SearchMd-CHEkvskM.js → SearchMd-CJm9ITir.js} +1 -1
  17. package/dist/client/assets/{Settings02-dtOggDtm.js → Settings02-0UGyPXgy.js} +1 -1
  18. package/dist/client/assets/{Shield01-BlIkj6ml.js → Shield01-ajX6eCWD.js} +1 -1
  19. package/dist/client/assets/{Star01-CwajHHth.js → Star01-DLcvdqts.js} +1 -1
  20. package/dist/client/assets/{Sun-1eccYZOi.js → Sun-DwH3UR5R.js} +1 -1
  21. package/dist/client/assets/{Tool01-D25llKlN.js → Tool01-Dqe-c7_N.js} +1 -1
  22. package/dist/client/assets/{Trash01-D1oxn083.js → Trash01-CO6PRylN.js} +1 -1
  23. package/dist/client/assets/{User01-Dg6LRSNl.js → User01-JrKdMZpa.js} +1 -1
  24. package/dist/client/assets/{Users03-B2xVime7.js → Users03-DGkdZmwX.js} +1 -1
  25. package/dist/client/assets/{X-BQvMOHsX.js → X-BFKhYElJ.js} +1 -1
  26. package/dist/client/assets/{XCircle-TXbF29VJ.js → XCircle-BCi1SPUb.js} +1 -1
  27. package/dist/client/assets/{XClose-B4M7R7X8.js → XClose-BL1_qV1F.js} +1 -1
  28. package/dist/client/assets/{Zap-CxY8TS-o.js → Zap-Bsssnre4.js} +1 -1
  29. package/dist/client/assets/{ZapSquare-B1TVYj8i.js → ZapSquare-dR2caQ4h.js} +1 -1
  30. package/dist/client/assets/{accordion-CUfbS6Fc.js → accordion-CSdeKGev.js} +1 -1
  31. package/dist/client/assets/{agent-icon-6Uu6lwox.js → agent-icon-BHvp6mzD.js} +1 -1
  32. package/dist/client/assets/{agents-list-Dm4llAHx.js → agents-list-DelQtLci.js} +1 -1
  33. package/dist/client/assets/ai-providers-B3ZQpsvX.js +1 -0
  34. package/dist/client/assets/{alert-dialog-C3PpULXm.js → alert-dialog-7-SyZGSt.js} +1 -1
  35. package/dist/client/assets/{auth-catchall-CbCG99Oq.js → auth-catchall-iqLWQ8B0.js} +1 -1
  36. package/dist/client/assets/{automation-list-row-R7WEZP_X.js → automation-list-row-CGm-OiLc.js} +1 -1
  37. package/dist/client/assets/{automations-BE-SV3bv.js → automations-CYw0JH2e.js} +1 -1
  38. package/dist/client/assets/{avatar-B0cDdI_p.js → avatar-Zzj9UMlL.js} +1 -1
  39. package/dist/client/assets/{badge-BSF0KEBD.js → badge--Lhfsu1W.js} +1 -1
  40. package/dist/client/assets/{brand-context-VMfIPbNw.js → brand-context-YW1Q-eq7.js} +1 -1
  41. package/dist/client/assets/{card-G-uvOmaX.js → card-9GTnJhWp.js} +1 -1
  42. package/dist/client/assets/{chat-context-a-h1Wy9R.js → chat-context-DXvG89K2.js} +2 -2
  43. package/dist/client/assets/{checkbox-BtVeTd73.js → checkbox-duvwt99y.js} +1 -1
  44. package/dist/client/assets/collection-detail-F4_8z6Hn.js +1 -0
  45. package/dist/client/assets/{collection-display-button-Cf7kfBzQ.js → collection-display-button-DinzcNMl.js} +1 -1
  46. package/dist/client/assets/{collection-search-RkDibt87.js → collection-search-BcpKEq0y.js} +1 -1
  47. package/dist/client/assets/{collection-search-LJG0dGzi.js → collection-search-BoQ_EppH.js} +1 -1
  48. package/dist/client/assets/{collection-table-wrapper-DTmKWr0a.js → collection-table-wrapper-Q2gV7sPs.js} +1 -1
  49. package/dist/client/assets/{collection-tabs-B22z1W7w.js → collection-tabs-Dl6rp80p.js} +1 -1
  50. package/dist/client/assets/{collections-BGqKPyxO.js → collections-CtHgOGSI.js} +1 -1
  51. package/dist/client/assets/{command-dXSQcSlQ.js → command-BY-OMlmS.js} +1 -1
  52. package/dist/client/assets/{connection-card-BoKVGqSP.js → connection-card-CxvFxmw2.js} +1 -1
  53. package/dist/client/assets/{connection-detail-BpVjCTHj.js → connection-detail-B2-UvKp7.js} +1 -1
  54. package/dist/client/assets/{connection-form-helpers-BDjJZ0p-.js → connection-form-helpers-skhe2PwK.js} +1 -1
  55. package/dist/client/assets/{connections-CLSd3E4v.js → connections-B9rvBIJs.js} +1 -1
  56. package/dist/client/assets/{constants-D02ovwi8.js → constants-BAzsARw1.js} +1 -1
  57. package/dist/client/assets/{constants-CkE3mXX3.js → constants-Bp8ek76r.js} +1 -1
  58. package/dist/client/assets/{dialog-iad61Myk.js → dialog-C2cBQ0ty.js} +1 -1
  59. package/dist/client/assets/{domain-settings-k6ahG8fL.js → domain-settings-DX4izaPT.js} +1 -1
  60. package/dist/client/assets/{drawer-C5RmZfRn.js → drawer-B_-bDnjD.js} +1 -1
  61. package/dist/client/assets/{dropdown-menu-C-rtkqLf.js → dropdown-menu-DWNG84J5.js} +1 -1
  62. package/dist/client/assets/{dynamic-plugin-layout-8vOtH5cT.js → dynamic-plugin-layout-C-4aN23S.js} +1 -1
  63. package/dist/client/assets/{empty-state-DjHmeRj3.js → empty-state-BKimHCce.js} +1 -1
  64. package/dist/client/assets/{empty-state-C0ZLSTKp.js → empty-state-CLCMWued.js} +1 -1
  65. package/dist/client/assets/{extract-connection-data-CGvP9gW4.js → extract-connection-data-DAdB5U1f.js} +1 -1
  66. package/dist/client/assets/{features-Bd6dY_zE.js → features-CFZqwKf_.js} +1 -1
  67. package/dist/client/assets/{form-338sOp4I.js → form-92QvOiJ_.js} +1 -1
  68. package/dist/client/assets/{general-OtnfMwVI.js → general-CIx8MPEj.js} +1 -1
  69. package/dist/client/assets/{github-repo-picker-BAv1s-16.js → github-repo-picker-CUaU2lz-.js} +1 -1
  70. package/dist/client/assets/{index-B9v7UxaA.js → index-BIYmbFmV.js} +1 -1
  71. package/dist/client/assets/{index-Dm9FQcLA.js → index-BPhQ3efs.js} +1 -1
  72. package/dist/client/assets/{index-COtqJC_1.js → index-BRQ0tifs.js} +1 -1
  73. package/dist/client/assets/{index-DgSb8QXs.js → index-BbevWgzi.js} +1 -1
  74. package/dist/client/assets/{index-BnYwAGzg.js → index-CEfeDibH.js} +4 -4
  75. package/dist/client/assets/{index-D47or-uW.js → index-CTsYITXV.js} +1 -1
  76. package/dist/client/assets/{index-CNpuYwrQ.js → index-CxVUAwST.js} +1 -1
  77. package/dist/client/assets/{index-BG1X1tQ7.js → index-CzXBz_F7.js} +1 -1
  78. package/dist/client/assets/{index-CMjtYUqI.js → index-DNXvVXJy.js} +1 -1
  79. package/dist/client/assets/{index-DqsW5LHB.js → index-Dq226A4w.js} +2 -2
  80. package/dist/client/assets/{infiniteQueryObserver-CFInfc2M.js → infiniteQueryObserver-DAJ1MAYd.js} +1 -1
  81. package/dist/client/assets/{input-DH-CzXJx.js → input-sAl4qpu7.js} +1 -1
  82. package/dist/client/assets/{integration-icon-DJA_3Fr4.js → integration-icon-AZugc3yw.js} +1 -1
  83. package/dist/client/assets/{label-BMXaeGTS.js → label-CgTKL0Kd.js} +1 -1
  84. package/dist/client/assets/{layout-BI4iFO9A.js → layout-irXWDg_F.js} +1 -1
  85. package/dist/client/assets/{login-DyuwfRcj.js → login-D6bW_SwU.js} +1 -1
  86. package/dist/client/assets/{members-BmJR_VlS.js → members-Bl2wPM_1.js} +1 -1
  87. package/dist/client/assets/{monaco-editor-B5JuMABe.js → monaco-editor-C_NWZeTl.js} +1 -1
  88. package/dist/client/assets/{monitoring-stats-row-BY0X8hB4.js → monitoring-stats-row-CvAc2TdA.js} +1 -1
  89. package/dist/client/assets/{oauth-callback-inWmNv4q.js → oauth-callback-CVJgN1AT.js} +1 -1
  90. package/dist/client/assets/{oauth-callback-ai-provider-CBxSFNpp.js → oauth-callback-ai-provider-oXA-Awv1.js} +1 -1
  91. package/dist/client/assets/{onboarding-G7MEDE1s.js → onboarding-BLnL078F.js} +1 -1
  92. package/dist/client/assets/{org-layout-DArAUzhp.js → org-layout-OuwJcURT.js} +1 -1
  93. package/dist/client/assets/{org-plugin-layout-VUKw0cT4.js → org-plugin-layout-BldguEGv.js} +1 -1
  94. package/dist/client/assets/{plugin-empty-state-DQpnGoua.js → plugin-empty-state-CRh8LLke.js} +1 -1
  95. package/dist/client/assets/{plugin-header-TbxBcKQZ.js → plugin-header-DQQsADvB.js} +1 -1
  96. package/dist/client/assets/{plugin-layout-DKyHA-wW.js → plugin-layout-xMoCwh-U.js} +1 -1
  97. package/dist/client/assets/{popover-OC7XhGTw.js → popover-Cl9Q4B_r.js} +1 -1
  98. package/dist/client/assets/{profile-DwshPh0T.js → profile-Dwkg2__q.js} +1 -1
  99. package/dist/client/assets/{project-app-view-CxpGmDTt.js → project-app-view-Ds5KIeD6.js} +1 -1
  100. package/dist/client/assets/registry-BBs0abCV.js +2 -0
  101. package/dist/client/assets/{registry-layout-IXiQGtRE.js → registry-layout-BcsYgVKZ.js} +1 -1
  102. package/dist/client/assets/{required-auth-layout-CBJCEsxt.js → required-auth-layout-3FXLvGi_.js} +1 -1
  103. package/dist/client/assets/{reset-password-B3HQhCgj.js → reset-password-CchTJTF9.js} +1 -1
  104. package/dist/client/assets/{roles-Avtsbj8b.js → roles-5IF_wtdu.js} +1 -1
  105. package/dist/client/assets/{scroll-area-BISJlmBG.js → scroll-area-094tZsTA.js} +1 -1
  106. package/dist/client/assets/{search-input-A-4PeF_2.js → search-input-CIR03_9I.js} +1 -1
  107. package/dist/client/assets/{select-AHhRGkyu.js → select-C3X6ssTw.js} +1 -1
  108. package/dist/client/assets/{select-model-fOLzezFa.js → select-model-BcH4syAI.js} +1 -1
  109. package/dist/client/assets/{settings-layout-BZX4Y4xJ.js → settings-layout-DiCQMM4S.js} +1 -1
  110. package/dist/client/assets/{settings-section-BhzOkUnI.js → settings-section-Q55Fgh-8.js} +1 -1
  111. package/dist/client/assets/{shell-layout-Bd7V-GQY.js → shell-layout-4T5ISWfh.js} +1 -1
  112. package/dist/client/assets/{skeleton-CbxzlXux.js → skeleton-DGdg1BKw.js} +1 -1
  113. package/dist/client/assets/{sso-ouyQ9HV-.js → sso-Coky_69P.js} +1 -1
  114. package/dist/client/assets/{store-DpB4YfFG.js → store-hdsNmYTT.js} +1 -1
  115. package/dist/client/assets/store-registry-DMKzasMp.js +2 -0
  116. package/dist/client/assets/{switch-BLGfVBVR.js → switch-D2IuZl3W.js} +1 -1
  117. package/dist/client/assets/{table-D4DE3XhH.js → table-DMAlnYBn.js} +1 -1
  118. package/dist/client/assets/{tabs-DfV1qdcL.js → tabs-BqcAeZdj.js} +1 -1
  119. package/dist/client/assets/{task-status-_49KQk_a.js → task-status-95rqQaw6.js} +1 -1
  120. package/dist/client/assets/{textarea-JSK2UtRe.js → textarea-B3aDHfMl.js} +1 -1
  121. package/dist/client/assets/{toggle-group-BEFyXqZD.js → toggle-group-CRKBIdwr.js} +1 -1
  122. package/dist/client/assets/{tools-list-DOfn3EJA.js → tools-list-D1jmrWjZ.js} +1 -1
  123. package/dist/client/assets/{types-D3_Ra7Fv.js → types-CmztvBo8.js} +1 -1
  124. package/dist/client/assets/{use-ai-providers-MLk3Pb1b.js → use-ai-providers-DV1XR9hI.js} +1 -1
  125. package/dist/client/assets/{use-collections-CIiKPdXz.js → use-collections-5a3WcFJc.js} +1 -1
  126. package/dist/client/assets/{use-connection-CkaOLOkA.js → use-connection-dg_H_Pr1.js} +1 -1
  127. package/dist/client/assets/{use-copy-DMw5YQy5.js → use-copy-RJi4IuzY.js} +1 -1
  128. package/dist/client/assets/{use-create-virtual-mcp-CoqQQKD_.js → use-create-virtual-mcp-CCwbfx6_.js} +1 -1
  129. package/dist/client/assets/{use-decopilot-events-C20Bt8AR.js → use-decopilot-events-Dzf3hgZq.js} +1 -1
  130. package/dist/client/assets/{use-delete-connection-c6u3Mju0.js → use-delete-connection-D5D7M4ay.js} +1 -1
  131. package/dist/client/assets/{use-infinite-scroll-BAxtK59M.js → use-infinite-scroll-C3Qa6hGW.js} +1 -1
  132. package/dist/client/assets/{use-list-state-WpMLgcH5.js → use-list-state-hDUYjUlU.js} +1 -1
  133. package/dist/client/assets/{use-mcp-tools-B89VuP8B.js → use-mcp-tools-DigN6mZj.js} +1 -1
  134. package/dist/client/assets/{use-members-tE1Czmvr.js → use-members-ChwILPhE.js} +1 -1
  135. package/dist/client/assets/{use-mobile-DtcdfNhs.js → use-mobile-BSlkjiym.js} +1 -1
  136. package/dist/client/assets/{use-navigate-to-agent-51gjX2Pz.js → use-navigate-to-agent-yRpKyeIE.js} +1 -1
  137. package/dist/client/assets/{use-org-sso-CMd7BViF.js → use-org-sso-OgWFYsGG.js} +1 -1
  138. package/dist/client/assets/{use-organization-roles-VhRwvnOU.js → use-organization-roles-AsLd-PIV.js} +1 -1
  139. package/dist/client/assets/{use-organization-settings-BAET96Uw.js → use-organization-settings-dHr-vwwr.js} +1 -1
  140. package/dist/client/assets/{use-registry-connections-yAbn5ElM.js → use-registry-connections-CYHmfgoy.js} +1 -1
  141. package/dist/client/assets/{use-status-sounds-Du7S3ua5.js → use-status-sounds-B12GPbr_.js} +1 -1
  142. package/dist/client/assets/{use-tasks-DZowuTKu.js → use-tasks-CBpkur0D.js} +1 -1
  143. package/dist/client/assets/{use-view-mode-DPPBVyNk.js → use-view-mode-BAlWkrBx.js} +1 -1
  144. package/dist/client/assets/{use-virtual-mcp-aaTK8HuA.js → use-virtual-mcp-CTcuyRU_.js} +1 -1
  145. package/dist/client/assets/useInfiniteQuery-DWgeOHBC.js +1 -0
  146. package/dist/client/assets/useSuspenseInfiniteQuery-B1Hn37mg.js +1 -0
  147. package/dist/client/assets/{user-BGPKZele.js → user-BnSZoTYs.js} +1 -1
  148. package/dist/client/assets/{view-mode-toggle-BRLuTNh9.js → view-mode-toggle-XuC9ujfW.js} +1 -1
  149. package/dist/client/assets/{workflow-iBn2uqrM.js → workflow-CmKE8auY.js} +1 -1
  150. package/dist/client/assets/workflow-detail-DUmWuXHM.js +1 -0
  151. package/dist/client/index.html +1 -1
  152. package/dist/server/cli.js +1 -1
  153. package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
  154. package/dist/server/node_modules/ansi-styles/index.js +223 -0
  155. package/dist/server/node_modules/{slice-ansi → ansi-styles}/license +0 -1
  156. package/dist/server/node_modules/ansi-styles/package.json +54 -0
  157. package/dist/server/node_modules/ansi-styles/readme.md +173 -0
  158. package/dist/server/node_modules/escape-string-regexp/index.d.ts +18 -0
  159. package/dist/server/node_modules/escape-string-regexp/index.js +11 -0
  160. package/dist/server/node_modules/escape-string-regexp/package.json +43 -0
  161. package/dist/server/node_modules/escape-string-regexp/readme.md +29 -0
  162. package/dist/server/node_modules/xtend/.jshintrc +30 -0
  163. package/dist/server/node_modules/{postgres-date/license → xtend/LICENSE} +1 -2
  164. package/dist/server/node_modules/xtend/README.md +32 -0
  165. package/dist/server/node_modules/xtend/immutable.js +19 -0
  166. package/dist/server/node_modules/xtend/mutable.js +17 -0
  167. package/dist/server/node_modules/xtend/package.json +55 -0
  168. package/dist/server/node_modules/xtend/test.js +103 -0
  169. package/package.json +1 -1
  170. package/dist/client/assets/ai-providers-CWrtqiFu.js +0 -1
  171. package/dist/client/assets/collection-detail-CQv-EfCg.js +0 -1
  172. package/dist/client/assets/registry-DZhwyNLq.js +0 -2
  173. package/dist/client/assets/store-registry-DUx3wL94.js +0 -2
  174. package/dist/client/assets/useInfiniteQuery-Emg6p2ky.js +0 -1
  175. package/dist/client/assets/useSuspenseInfiniteQuery-Dfyjunjm.js +0 -1
  176. package/dist/client/assets/workflow-detail-C1edh6mx.js +0 -1
  177. package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
  178. package/dist/server/node_modules/mimic-fn/index.js +0 -13
  179. package/dist/server/node_modules/mimic-fn/package.json +0 -42
  180. package/dist/server/node_modules/mimic-fn/readme.md +0 -69
  181. package/dist/server/node_modules/pg-int8/LICENSE +0 -13
  182. package/dist/server/node_modules/pg-int8/README.md +0 -16
  183. package/dist/server/node_modules/pg-int8/index.js +0 -100
  184. package/dist/server/node_modules/pg-int8/package.json +0 -24
  185. package/dist/server/node_modules/postgres-date/index.js +0 -116
  186. package/dist/server/node_modules/postgres-date/package.json +0 -33
  187. package/dist/server/node_modules/postgres-date/readme.md +0 -49
  188. package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
  189. package/dist/server/node_modules/postgres-interval/index.js +0 -125
  190. package/dist/server/node_modules/postgres-interval/license +0 -21
  191. package/dist/server/node_modules/postgres-interval/package.json +0 -36
  192. package/dist/server/node_modules/postgres-interval/readme.md +0 -48
  193. package/dist/server/node_modules/scheduler/LICENSE +0 -21
  194. package/dist/server/node_modules/scheduler/README.md +0 -9
  195. package/dist/server/node_modules/scheduler/cjs/scheduler-unstable_mock.development.js +0 -414
  196. package/dist/server/node_modules/scheduler/cjs/scheduler-unstable_mock.production.js +0 -406
  197. package/dist/server/node_modules/scheduler/cjs/scheduler-unstable_post_task.development.js +0 -150
  198. package/dist/server/node_modules/scheduler/cjs/scheduler-unstable_post_task.production.js +0 -140
  199. package/dist/server/node_modules/scheduler/cjs/scheduler.development.js +0 -364
  200. package/dist/server/node_modules/scheduler/cjs/scheduler.native.development.js +0 -350
  201. package/dist/server/node_modules/scheduler/cjs/scheduler.native.production.js +0 -330
  202. package/dist/server/node_modules/scheduler/cjs/scheduler.production.js +0 -340
  203. package/dist/server/node_modules/scheduler/index.js +0 -7
  204. package/dist/server/node_modules/scheduler/index.native.js +0 -7
  205. package/dist/server/node_modules/scheduler/package.json +0 -27
  206. package/dist/server/node_modules/scheduler/unstable_mock.js +0 -7
  207. package/dist/server/node_modules/scheduler/unstable_post_task.js +0 -7
  208. package/dist/server/node_modules/slice-ansi/index.d.ts +0 -19
  209. package/dist/server/node_modules/slice-ansi/index.js +0 -260
  210. package/dist/server/node_modules/slice-ansi/package.json +0 -59
  211. package/dist/server/node_modules/slice-ansi/readme.md +0 -54
  212. package/dist/server/node_modules/slice-ansi/tokenize-ansi.js +0 -752
  213. package/dist/server/node_modules/split2/LICENSE +0 -13
  214. package/dist/server/node_modules/split2/README.md +0 -85
  215. package/dist/server/node_modules/split2/bench.js +0 -27
  216. package/dist/server/node_modules/split2/index.js +0 -141
  217. package/dist/server/node_modules/split2/package.json +0 -39
  218. package/dist/server/node_modules/split2/test.js +0 -409
  219. /package/dist/server/node_modules/{mimic-fn → escape-string-regexp}/license +0 -0
@@ -1 +1 @@
1
- import{f as re,s as ce,o as de,r as U,x as me,w as ue,a as fe,t as Y,z as q,K as te,b as ge,j as s,B as H,v as xe,y as Q,e as L,c as pe,aD as he}from"./index-DqsW5LHB.js";import{P as V}from"./index-CMjtYUqI.js";import{A as be}from"./avatar-B0cDdI_p.js";import{I as je}from"./input-DH-CzXJx.js";import{S as X,a as Z,b as W,c as ie,d as ve}from"./settings-section-BhzOkUnI.js";import{D as Se}from"./domain-settings-k6ahG8fL.js";import{u as ye,a as se,D as Ne,c as Ce,S as we,v as _e,K as ze,P as De,d as Pe,C as ke,s as Ae,b as Ie,e as Ee}from"./collection-search-RkDibt87.js";import{W as ee,i as Te}from"./constants-D02ovwi8.js";import{u as le}from"./use-virtual-mcp-aaTK8HuA.js";import{b as Oe,P as Re,a as Fe}from"./popover-OC7XhGTw.js";import{S as Le}from"./skeleton-CbxzlXux.js";import{Q as $e}from"./agent-icon-6Uu6lwox.js";import{s as Me}from"./Plus-Mx814qi5.js";import{a as ae}from"./Users03-B2xVime7.js";import{i as Ke}from"./X-BQvMOHsX.js";import{I as J}from"./integration-icon-DJA_3Fr4.js";import{u as He,c as Ue}from"./use-organization-settings-BAET96Uw.js";import"./use-mobile-DtcdfNhs.js";import"./User01-Dg6LRSNl.js";import"./card-G-uvOmaX.js";import"./ArrowUpRight-BYnm98Tt.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-BLGfVBVR.js";import"./SearchMd-CHEkvskM.js";import"./use-collections-CIiKPdXz.js";import"./AlertCircle-BYbLY8JK.js";import"./Tool01-D25llKlN.js";import"./XClose-B4M7R7X8.js";import"./RefreshCcw01-Bmm2OZFs.js";import"./ArrowNarrowLeft-CcXLWn5B.js";import"./XCircle-TXbF29VJ.js";import"./ZapSquare-B1TVYj8i.js";import"./CheckCircle-YokVYrIX.js";import"./ChevronDown-BRURl2T5.js";import"./ChevronRight-CZmvUfnf.js";import"./ChevronUp-VkkFTpbv.js";import"./DotsVertical-D5rWkx3C.js";import"./Container-DQZzI4AA.js";import"./Star01-CwajHHth.js";import"./Palette-DZWPAJiP.js";import"./LinkExternal01-tSCOf-pQ.js";import"./Lock01-CQvbe2FZ.js";import"./Sun-1eccYZOi.js";import"./Play-BwrtIjN9.js";import"./Settings02-dtOggDtm.js";import"./Shield01-BlIkj6ml.js";import"./Trash01-D1oxn083.js";import"./Zap-CxY8TS-o.js";const qe=xe({name:Q().min(1,"Name is required").max(255,"Name is too long"),slug:Q().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:Q().optional()});function Be(t){const e=L.c(13),{value:a,onChange:i,name:f,disabled:l}=t,n=U.useRef(null);let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=()=>n.current?.click(),e[0]=S):S=e[0];const _=S;let c;e[1]!==i?(c=z=>{const p=z.target.files?.[0];if(!p)return;if(p.size>2097152){q.error("Image must be smaller than 2MB");return}const b=new FileReader;b.onerror=Ge,b.onloadend=()=>{b.result&&i(b.result),n.current&&(n.current.value="")},b.readAsDataURL(p)},e[1]=i,e[2]=c):c=e[2];const g=c;let o;e[3]!==l||e[4]!==g?(o=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:g,className:"hidden",disabled:l}),e[3]=l,e[4]=g,e[5]=o):o=e[5];const u=a||void 0,d=f??"?";let m;e[6]!==u||e[7]!==d?(m=s.jsx(be,{url:u,fallback:d,shape:"square",size:"base"}),e[6]=u,e[7]=d,e[8]=m):m=e[8];let x;return e[9]!==l||e[10]!==o||e[11]!==m?(x=s.jsxs("button",{type:"button",onClick:_,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[o,m]}),e[9]=l,e[10]=o,e[11]=m,e[12]=x):x=e[12],x}function Ge(){return q.error("Failed to read image")}function Ve(){const t=re(),{org:e}=ce(),a=de(),[i,f]=U.useState(!1),l=me({resolver:ue(qe),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),n=fe({mutationFn:async o=>{const u={name:o.name,slug:o.slug};o.logo&&(u.logo=o.logo);const d=await ge.organization.update({organizationId:e.id,data:u});if(d?.error)throw new Error(d.error.message||"Failed to update organization");return d},onSuccess:o=>{Y("organization_settings_updated",{organization_id:e.id,fields:Object.keys(l.formState.dirtyFields)}),a.invalidateQueries({queryKey:te.organizations()}),a.invalidateQueries({queryKey:te.activeOrganization(e.slug)}),q.success("Organization settings updated successfully"),o?.data?.slug&&o.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:o=>{Y("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(l.formState.dirtyFields),error:o instanceof Error?o.message:String(o)}),q.error(o instanceof Error?o.message:"Failed to update organization")},onSettled:()=>{f(!1)}}),S=o=>{f(!0),n.mutate(o)},_=l.formState.isDirty,c=l.formState.errors,g=typeof window<"u"?`${window.location.host}/`:"";return s.jsx("form",{onSubmit:l.handleSubmit(S),className:"flex flex-col gap-3",children:s.jsx(X,{children:s.jsxs(Z,{children:[s.jsx(W,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(Be,{value:l.watch("logo"),onChange:o=>l.setValue("logo",o??"",{shouldDirty:!0}),name:l.watch("name"),disabled:i})}),s.jsx(W,{title:"Name",action:s.jsx(je,{id:"org-name",...l.register("name"),placeholder:"Organization name",disabled:i,className:"w-[280px]"})}),s.jsx(W,{title:"URL",action:s.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[g&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:g}),s.jsx("input",{id:"org-slug",...l.register("slug"),placeholder:"my-organization",disabled:i,className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:o=>{const u=o.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");l.setValue("slug",u,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}})]})}),(c.name||c.slug||c.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[c.name&&s.jsx("p",{className:"text-xs text-destructive",children:c.name.message}),c.slug&&s.jsx("p",{className:"text-xs text-destructive",children:c.slug.message}),c.logo&&s.jsx("p",{className:"text-xs text-destructive",children:c.logo.message})]}),_&&s.jsxs(ie,{children:[s.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:()=>l.reset(),disabled:i,children:"Cancel"}),s.jsx(H,{type:"submit",disabled:i,size:"sm",children:i?"Saving…":"Save"})]})]})})})}const ne=["site-editor","site-diagnostics","ai-image","ai-research"],oe=8;function Qe(t,e,a){const i=e.find(l=>l.id===t);if(i)return{id:i.id,title:i.title,icon:i.icon,kind:"template"};const f=a.find(l=>l.id===t);return f?{id:t,title:f.title,icon:f.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function We(t){const e=L.c(39),{agent:a,onRemove:i}=t;let f;e[0]!==a.id?(f={id:a.id},e[0]=a.id,e[1]=f):f=e[1];const{attributes:l,listeners:n,setNodeRef:S,transform:_,transition:c,isDragging:g}=Pe(f);let o;e[2]!==_?(o=ke.Transform.toString(_),e[2]=_,e[3]=o):o=e[3];const u=g?.5:void 0,d=g?100:void 0;let m;e[4]!==o||e[5]!==u||e[6]!==d||e[7]!==c?(m={transform:o,transition:c,opacity:u,zIndex:d},e[4]=o,e[5]=u,e[6]=d,e[7]=c,e[8]=m):m=e[8];const x=m,z=g&&"shadow-lg";let p;e[9]!==z?(p=pe("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",z),e[9]=z,e[10]=p):p=e[10];const b=`Drag to reorder ${a.title}`;let D;e[11]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx($e,{size:14}),e[11]=D):D=e[11];let A;e[12]!==l||e[13]!==n||e[14]!==b?(A=s.jsx("button",{type:"button",...l,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":b,children:D}),e[12]=l,e[13]=n,e[14]=b,e[15]=A):A=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ae,{size:14}),e[16]=y):y=e[16];let C;e[17]!==a.icon||e[18]!==a.title?(C=s.jsx(J,{icon:a.icon,name:a.title,size:"xs",fallbackIcon:y}),e[17]=a.icon,e[18]=a.title,e[19]=C):C=e[19];let j;e[20]!==a.title?(j=s.jsx("span",{className:"text-sm text-foreground truncate",children:a.title}),e[20]=a.title,e[21]=j):j=e[21];const w=a.kind==="template"?"Template":a.kind==="custom"?"Custom agent":"Unavailable";let h;e[22]!==w?(h=s.jsx("span",{className:"text-xs text-muted-foreground",children:w}),e[22]=w,e[23]=h):h=e[23];let v;e[24]!==j||e[25]!==h?(v=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[j,h]}),e[24]=j,e[25]=h,e[26]=v):v=e[26];const I=`Remove ${a.title}`;let P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(Ke,{size:14}),e[27]=P):P=e[27];let N;e[28]!==i||e[29]!==I?(N=s.jsx("button",{type:"button",onClick:i,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":I,children:P}),e[28]=i,e[29]=I,e[30]=N):N=e[30];let k;return e[31]!==S||e[32]!==x||e[33]!==A||e[34]!==C||e[35]!==v||e[36]!==N||e[37]!==p?(k=s.jsxs("div",{ref:S,style:x,className:p,children:[A,C,v,N]}),e[31]=S,e[32]=x,e[33]=A,e[34]=C,e[35]=v,e[36]=N,e[37]=p,e[38]=k):k=e[38],k}function Ye(t){const e=L.c(48),{selectedIds:a,onAdd:i}=t,[f,l]=U.useState(!1),[n,S]=U.useState(""),_=le();let c;e[0]!==a?(c=new Set(a),e[0]=a,e[1]=c):c=e[1];const g=c;let o,u,d,m,x,z,p,b,D,A,y,C,j;if(e[2]!==_||e[3]!==i||e[4]!==f||e[5]!==n||e[6]!==g){const P=n.toLowerCase();m=ee.filter(r=>!g.has(r.id)&&(!n||r.title.toLowerCase().includes(P)));let N;e[20]!==g?(N=r=>r.id!==null&&!Te(r.id)&&!g.has(r.id),e[20]=g,e[21]=N):N=e[21],d=_.filter(N).filter(r=>!n||r.title.toLowerCase().includes(P));let k;e[22]!==i?(k=r=>{i(r),l(!1),S("")},e[22]=i,e[23]=k):k=e[23];const T=k;u=Oe,C=f,j=l,e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Re,{asChild:!0,children:s.jsxs(H,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Me,{size:14}),"Add agent"]})}),e[24]=x):x=e[24],o=Fe,D="w-[320px] p-0 overflow-hidden",A="start",e[25]!==n?(y=s.jsx(Ee,{value:n,onChange:S,placeholder:"Search agents..."}),e[25]=n,e[26]=y):y=e[26],z="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",p=m.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Templates"}),m.map(r=>s.jsxs("button",{type:"button",onClick:()=>T(r.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:r.icon,name:r.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:r.title})]},r.id))]}),b=d.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Custom agents"}),d.map(r=>s.jsxs("button",{type:"button",onClick:()=>T(r.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:r.icon,name:r.title,size:"xs",fallbackIcon:s.jsx(ae,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:r.title})]},r.id))]}),e[2]=_,e[3]=i,e[4]=f,e[5]=n,e[6]=g,e[7]=o,e[8]=u,e[9]=d,e[10]=m,e[11]=x,e[12]=z,e[13]=p,e[14]=b,e[15]=D,e[16]=A,e[17]=y,e[18]=C,e[19]=j}else o=e[7],u=e[8],d=e[9],m=e[10],x=e[11],z=e[12],p=e[13],b=e[14],D=e[15],A=e[16],y=e[17],C=e[18],j=e[19];let w;e[27]!==d||e[28]!==m.length||e[29]!==n?(w=m.length===0&&d.length===0&&s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),e[27]=d,e[28]=m.length,e[29]=n,e[30]=w):w=e[30];let h;e[31]!==w||e[32]!==z||e[33]!==p||e[34]!==b?(h=s.jsxs("div",{className:z,children:[p,b,w]}),e[31]=w,e[32]=z,e[33]=p,e[34]=b,e[35]=h):h=e[35];let v;e[36]!==o||e[37]!==h||e[38]!==D||e[39]!==A||e[40]!==y?(v=s.jsxs(o,{className:D,align:A,children:[y,h]}),e[36]=o,e[37]=h,e[38]=D,e[39]=A,e[40]=y,e[41]=v):v=e[41];let I;return e[42]!==u||e[43]!==x||e[44]!==v||e[45]!==C||e[46]!==j?(I=s.jsxs(u,{open:C,onOpenChange:j,children:[x,v]}),e[42]=u,e[43]=x,e[44]=v,e[45]=C,e[46]=j,e[47]=I):I=e[47],I}function Je(){const t=L.c(61),e=He(),a=le(),i=Ue();let f;t[0]!==e?.ids?(f=e?.ids??[...ne],t[0]=e?.ids,t[1]=f):f=t[1];const l=f,[n,S]=U.useState(l);let _;t[2]!==n||t[3]!==l?(_=n.length!==l.length||n.some((E,O)=>E!==l[O]),t[2]=n,t[3]=l,t[4]=_):_=t[4];const c=_;let g;t[5]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:5}},t[5]=g):g=t[5];let o;t[6]===Symbol.for("react.memo_cache_sentinel")?(o={coordinateGetter:Ae},t[6]=o):o=t[6];const u=ye(se(De,g),se(ze,o));let d;t[7]!==n?(d=E=>{const{active:O,over:R}=E;if(!R||O.id===R.id)return;const F=n.indexOf(O.id),G=n.indexOf(R.id);F===-1||G===-1||S(Ie([...n],F,G))},t[7]=n,t[8]=d):d=t[8];const m=d;let x;t[9]!==n?(x=E=>{n.includes(E)||S([...n,E])},t[9]=n,t[10]=x):x=t[10];const z=x;let p;t[11]!==n?(p=E=>{S(n.filter(O=>O!==E))},t[11]=n,t[12]=p):p=t[12];const b=p;let D;t[13]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{S([...ne])},t[13]=D):D=t[13];const A=D;let y;t[14]!==n||t[15]!==i?(y=()=>{i.mutate({ids:n},{onSuccess:()=>{Y("default_home_agents_updated",{count:n.length,template_count:n.filter(Ze).length}),q.success("Default home agents updated")},onError:Xe})},t[14]=n,t[15]=i,t[16]=y):y=t[16];const C=y;let j,w,h,v,I,P,N;if(t[17]!==a||t[18]!==n||t[19]!==m||t[20]!==b||t[21]!==u||t[22]!==i.isPending){let E;t[30]!==a?(E=F=>Qe(F,ee,a),t[30]=a,t[31]=E):E=t[31];const O=n.map(E);h=Math.max(0,n.length-oe),w=X,I="Default home agents";let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(he,{size:14}),t[32]=R):R=t[32],t[33]!==i.isPending?(P=s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:A,disabled:i.isPending,children:[R,"Reset defaults"]}),t[33]=i.isPending,t[34]=P):P=t[34],j=Z,N="px-5 py-5 flex flex-col gap-3",v=O.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(Ne,{sensors:u,collisionDetection:Ce,onDragEnd:m,children:s.jsx(we,{items:n,strategy:_e,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:O.map((F,G)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[G===oe&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(We,{agent:F,onRemove:()=>b(F.id)})]},F.id))})})}),t[17]=a,t[18]=n,t[19]=m,t[20]=b,t[21]=u,t[22]=i.isPending,t[23]=j,t[24]=w,t[25]=h,t[26]=v,t[27]=I,t[28]=P,t[29]=N}else j=t[23],w=t[24],h=t[25],v=t[26],I=t[27],P=t[28],N=t[29];let k;t[35]!==n||t[36]!==z?(k=s.jsx(Ye,{selectedIds:n,onAdd:z}),t[35]=n,t[36]=z,t[37]=k):k=t[37];let T;t[38]!==h?(T=h>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[h," agent",h===1?"":"s"," won't fit on the home view"]}),t[38]=h,t[39]=T):T=t[39];let r;t[40]!==k||t[41]!==T?(r=s.jsxs("div",{className:"flex items-center justify-between",children:[k,T]}),t[40]=k,t[41]=T,t[42]=r):r=t[42];let $;t[43]!==v||t[44]!==r||t[45]!==N?($=s.jsxs("div",{className:N,children:[v,r]}),t[43]=v,t[44]=r,t[45]=N,t[46]=$):$=t[46];let M;t[47]!==C||t[48]!==l||t[49]!==c||t[50]!==i.isPending?(M=c&&s.jsxs(ie,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>S(l),disabled:i.isPending,children:"Cancel"}),s.jsx(H,{type:"button",onClick:C,disabled:i.isPending,children:i.isPending?"Saving…":"Save"})]}),t[47]=C,t[48]=l,t[49]=c,t[50]=i.isPending,t[51]=M):M=t[51];let K;t[52]!==j||t[53]!==$||t[54]!==M?(K=s.jsxs(j,{children:[$,M]}),t[52]=j,t[53]=$,t[54]=M,t[55]=K):K=t[55];let B;return t[56]!==w||t[57]!==I||t[58]!==P||t[59]!==K?(B=s.jsx(w,{title:I,actions:P,children:K}),t[56]=w,t[57]=I,t[58]=P,t[59]=K,t[60]=B):B=t[60],B}function Xe(t){q.error(t instanceof Error?t.message:"Failed to update default home agents")}function Ze(t){return ee.some(e=>e.id===t)}function et(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X,{title:"Default home agents",children:s.jsx(Z,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(tt)})})}),t[0]=e):e=t[0],e}function tt(t,e){return s.jsx(Le,{className:"h-12 w-full rounded-lg"},e)}function st(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(U.Suspense,{fallback:s.jsx(et,{}),children:s.jsx(Je,{})}),t[0]=e):e=t[0],e}function nt(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(V,{children:s.jsx(V.Content,{children:s.jsx(V.Body,{children:s.jsxs(ve,{children:[s.jsx(V.Title,{children:"Organization"}),s.jsx(Ve,{}),s.jsx(Se,{}),s.jsx(st,{})]})})})}),t[0]=e):e=t[0],e}function Xt(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(nt,{}),t[0]=e):e=t[0],e}export{Xt as default};
1
+ import{f as re,s as ce,o as de,r as U,x as me,w as ue,a as fe,t as Y,z as q,K as te,b as ge,j as s,B as H,v as xe,y as Q,e as L,c as pe,aD as he}from"./index-Dq226A4w.js";import{P as V}from"./index-DNXvVXJy.js";import{A as be}from"./avatar-Zzj9UMlL.js";import{I as je}from"./input-sAl4qpu7.js";import{S as X,a as Z,b as W,c as ie,d as ve}from"./settings-section-Q55Fgh-8.js";import{D as Se}from"./domain-settings-DX4izaPT.js";import{u as ye,a as se,D as Ne,c as Ce,S as we,v as _e,K as ze,P as De,d as Pe,C as ke,s as Ae,b as Ie,e as Ee}from"./collection-search-BcpKEq0y.js";import{W as ee,i as Te}from"./constants-BAzsARw1.js";import{u as le}from"./use-virtual-mcp-CTcuyRU_.js";import{b as Oe,P as Re,a as Fe}from"./popover-Cl9Q4B_r.js";import{S as Le}from"./skeleton-DGdg1BKw.js";import{Q as $e}from"./agent-icon-BHvp6mzD.js";import{s as Me}from"./Plus-BX8KY2Vj.js";import{a as ae}from"./Users03-DGkdZmwX.js";import{i as Ke}from"./X-BFKhYElJ.js";import{I as J}from"./integration-icon-AZugc3yw.js";import{u as He,c as Ue}from"./use-organization-settings-dHr-vwwr.js";import"./use-mobile-BSlkjiym.js";import"./User01-JrKdMZpa.js";import"./card-9GTnJhWp.js";import"./ArrowUpRight-wUPlLzWo.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-D2IuZl3W.js";import"./SearchMd-CJm9ITir.js";import"./use-collections-5a3WcFJc.js";import"./AlertCircle-BU25E17i.js";import"./Tool01-Dqe-c7_N.js";import"./XClose-BL1_qV1F.js";import"./RefreshCcw01-DtyDEAf2.js";import"./ArrowNarrowLeft-DsozI7ul.js";import"./XCircle-BCi1SPUb.js";import"./ZapSquare-dR2caQ4h.js";import"./CheckCircle-B6ooPL10.js";import"./ChevronDown-BjunjZ96.js";import"./ChevronRight-DZ8_B5Zy.js";import"./ChevronUp-BcfJms1N.js";import"./DotsVertical-ChXlfNDE.js";import"./Container-BBbTXyMq.js";import"./Star01-DLcvdqts.js";import"./Palette-CL1PeBDG.js";import"./LinkExternal01-Bq6E6IiB.js";import"./Lock01-CT9fVg-M.js";import"./Sun-DwH3UR5R.js";import"./Play-O7Kb3HkD.js";import"./Settings02-0UGyPXgy.js";import"./Shield01-ajX6eCWD.js";import"./Trash01-CO6PRylN.js";import"./Zap-Bsssnre4.js";const qe=xe({name:Q().min(1,"Name is required").max(255,"Name is too long"),slug:Q().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:Q().optional()});function Be(t){const e=L.c(13),{value:a,onChange:i,name:f,disabled:l}=t,n=U.useRef(null);let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=()=>n.current?.click(),e[0]=S):S=e[0];const _=S;let c;e[1]!==i?(c=z=>{const p=z.target.files?.[0];if(!p)return;if(p.size>2097152){q.error("Image must be smaller than 2MB");return}const b=new FileReader;b.onerror=Ge,b.onloadend=()=>{b.result&&i(b.result),n.current&&(n.current.value="")},b.readAsDataURL(p)},e[1]=i,e[2]=c):c=e[2];const g=c;let o;e[3]!==l||e[4]!==g?(o=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:g,className:"hidden",disabled:l}),e[3]=l,e[4]=g,e[5]=o):o=e[5];const u=a||void 0,d=f??"?";let m;e[6]!==u||e[7]!==d?(m=s.jsx(be,{url:u,fallback:d,shape:"square",size:"base"}),e[6]=u,e[7]=d,e[8]=m):m=e[8];let x;return e[9]!==l||e[10]!==o||e[11]!==m?(x=s.jsxs("button",{type:"button",onClick:_,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[o,m]}),e[9]=l,e[10]=o,e[11]=m,e[12]=x):x=e[12],x}function Ge(){return q.error("Failed to read image")}function Ve(){const t=re(),{org:e}=ce(),a=de(),[i,f]=U.useState(!1),l=me({resolver:ue(qe),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),n=fe({mutationFn:async o=>{const u={name:o.name,slug:o.slug};o.logo&&(u.logo=o.logo);const d=await ge.organization.update({organizationId:e.id,data:u});if(d?.error)throw new Error(d.error.message||"Failed to update organization");return d},onSuccess:o=>{Y("organization_settings_updated",{organization_id:e.id,fields:Object.keys(l.formState.dirtyFields)}),a.invalidateQueries({queryKey:te.organizations()}),a.invalidateQueries({queryKey:te.activeOrganization(e.slug)}),q.success("Organization settings updated successfully"),o?.data?.slug&&o.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:o=>{Y("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(l.formState.dirtyFields),error:o instanceof Error?o.message:String(o)}),q.error(o instanceof Error?o.message:"Failed to update organization")},onSettled:()=>{f(!1)}}),S=o=>{f(!0),n.mutate(o)},_=l.formState.isDirty,c=l.formState.errors,g=typeof window<"u"?`${window.location.host}/`:"";return s.jsx("form",{onSubmit:l.handleSubmit(S),className:"flex flex-col gap-3",children:s.jsx(X,{children:s.jsxs(Z,{children:[s.jsx(W,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(Be,{value:l.watch("logo"),onChange:o=>l.setValue("logo",o??"",{shouldDirty:!0}),name:l.watch("name"),disabled:i})}),s.jsx(W,{title:"Name",action:s.jsx(je,{id:"org-name",...l.register("name"),placeholder:"Organization name",disabled:i,className:"w-[280px]"})}),s.jsx(W,{title:"URL",action:s.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[g&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:g}),s.jsx("input",{id:"org-slug",...l.register("slug"),placeholder:"my-organization",disabled:i,className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:o=>{const u=o.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");l.setValue("slug",u,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}})]})}),(c.name||c.slug||c.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[c.name&&s.jsx("p",{className:"text-xs text-destructive",children:c.name.message}),c.slug&&s.jsx("p",{className:"text-xs text-destructive",children:c.slug.message}),c.logo&&s.jsx("p",{className:"text-xs text-destructive",children:c.logo.message})]}),_&&s.jsxs(ie,{children:[s.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:()=>l.reset(),disabled:i,children:"Cancel"}),s.jsx(H,{type:"submit",disabled:i,size:"sm",children:i?"Saving…":"Save"})]})]})})})}const ne=["site-editor","site-diagnostics","ai-image","ai-research"],oe=8;function Qe(t,e,a){const i=e.find(l=>l.id===t);if(i)return{id:i.id,title:i.title,icon:i.icon,kind:"template"};const f=a.find(l=>l.id===t);return f?{id:t,title:f.title,icon:f.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function We(t){const e=L.c(39),{agent:a,onRemove:i}=t;let f;e[0]!==a.id?(f={id:a.id},e[0]=a.id,e[1]=f):f=e[1];const{attributes:l,listeners:n,setNodeRef:S,transform:_,transition:c,isDragging:g}=Pe(f);let o;e[2]!==_?(o=ke.Transform.toString(_),e[2]=_,e[3]=o):o=e[3];const u=g?.5:void 0,d=g?100:void 0;let m;e[4]!==o||e[5]!==u||e[6]!==d||e[7]!==c?(m={transform:o,transition:c,opacity:u,zIndex:d},e[4]=o,e[5]=u,e[6]=d,e[7]=c,e[8]=m):m=e[8];const x=m,z=g&&"shadow-lg";let p;e[9]!==z?(p=pe("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",z),e[9]=z,e[10]=p):p=e[10];const b=`Drag to reorder ${a.title}`;let D;e[11]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx($e,{size:14}),e[11]=D):D=e[11];let A;e[12]!==l||e[13]!==n||e[14]!==b?(A=s.jsx("button",{type:"button",...l,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":b,children:D}),e[12]=l,e[13]=n,e[14]=b,e[15]=A):A=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ae,{size:14}),e[16]=y):y=e[16];let C;e[17]!==a.icon||e[18]!==a.title?(C=s.jsx(J,{icon:a.icon,name:a.title,size:"xs",fallbackIcon:y}),e[17]=a.icon,e[18]=a.title,e[19]=C):C=e[19];let j;e[20]!==a.title?(j=s.jsx("span",{className:"text-sm text-foreground truncate",children:a.title}),e[20]=a.title,e[21]=j):j=e[21];const w=a.kind==="template"?"Template":a.kind==="custom"?"Custom agent":"Unavailable";let h;e[22]!==w?(h=s.jsx("span",{className:"text-xs text-muted-foreground",children:w}),e[22]=w,e[23]=h):h=e[23];let v;e[24]!==j||e[25]!==h?(v=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[j,h]}),e[24]=j,e[25]=h,e[26]=v):v=e[26];const I=`Remove ${a.title}`;let P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(Ke,{size:14}),e[27]=P):P=e[27];let N;e[28]!==i||e[29]!==I?(N=s.jsx("button",{type:"button",onClick:i,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":I,children:P}),e[28]=i,e[29]=I,e[30]=N):N=e[30];let k;return e[31]!==S||e[32]!==x||e[33]!==A||e[34]!==C||e[35]!==v||e[36]!==N||e[37]!==p?(k=s.jsxs("div",{ref:S,style:x,className:p,children:[A,C,v,N]}),e[31]=S,e[32]=x,e[33]=A,e[34]=C,e[35]=v,e[36]=N,e[37]=p,e[38]=k):k=e[38],k}function Ye(t){const e=L.c(48),{selectedIds:a,onAdd:i}=t,[f,l]=U.useState(!1),[n,S]=U.useState(""),_=le();let c;e[0]!==a?(c=new Set(a),e[0]=a,e[1]=c):c=e[1];const g=c;let o,u,d,m,x,z,p,b,D,A,y,C,j;if(e[2]!==_||e[3]!==i||e[4]!==f||e[5]!==n||e[6]!==g){const P=n.toLowerCase();m=ee.filter(r=>!g.has(r.id)&&(!n||r.title.toLowerCase().includes(P)));let N;e[20]!==g?(N=r=>r.id!==null&&!Te(r.id)&&!g.has(r.id),e[20]=g,e[21]=N):N=e[21],d=_.filter(N).filter(r=>!n||r.title.toLowerCase().includes(P));let k;e[22]!==i?(k=r=>{i(r),l(!1),S("")},e[22]=i,e[23]=k):k=e[23];const T=k;u=Oe,C=f,j=l,e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Re,{asChild:!0,children:s.jsxs(H,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Me,{size:14}),"Add agent"]})}),e[24]=x):x=e[24],o=Fe,D="w-[320px] p-0 overflow-hidden",A="start",e[25]!==n?(y=s.jsx(Ee,{value:n,onChange:S,placeholder:"Search agents..."}),e[25]=n,e[26]=y):y=e[26],z="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",p=m.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Templates"}),m.map(r=>s.jsxs("button",{type:"button",onClick:()=>T(r.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:r.icon,name:r.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:r.title})]},r.id))]}),b=d.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Custom agents"}),d.map(r=>s.jsxs("button",{type:"button",onClick:()=>T(r.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:r.icon,name:r.title,size:"xs",fallbackIcon:s.jsx(ae,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:r.title})]},r.id))]}),e[2]=_,e[3]=i,e[4]=f,e[5]=n,e[6]=g,e[7]=o,e[8]=u,e[9]=d,e[10]=m,e[11]=x,e[12]=z,e[13]=p,e[14]=b,e[15]=D,e[16]=A,e[17]=y,e[18]=C,e[19]=j}else o=e[7],u=e[8],d=e[9],m=e[10],x=e[11],z=e[12],p=e[13],b=e[14],D=e[15],A=e[16],y=e[17],C=e[18],j=e[19];let w;e[27]!==d||e[28]!==m.length||e[29]!==n?(w=m.length===0&&d.length===0&&s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),e[27]=d,e[28]=m.length,e[29]=n,e[30]=w):w=e[30];let h;e[31]!==w||e[32]!==z||e[33]!==p||e[34]!==b?(h=s.jsxs("div",{className:z,children:[p,b,w]}),e[31]=w,e[32]=z,e[33]=p,e[34]=b,e[35]=h):h=e[35];let v;e[36]!==o||e[37]!==h||e[38]!==D||e[39]!==A||e[40]!==y?(v=s.jsxs(o,{className:D,align:A,children:[y,h]}),e[36]=o,e[37]=h,e[38]=D,e[39]=A,e[40]=y,e[41]=v):v=e[41];let I;return e[42]!==u||e[43]!==x||e[44]!==v||e[45]!==C||e[46]!==j?(I=s.jsxs(u,{open:C,onOpenChange:j,children:[x,v]}),e[42]=u,e[43]=x,e[44]=v,e[45]=C,e[46]=j,e[47]=I):I=e[47],I}function Je(){const t=L.c(61),e=He(),a=le(),i=Ue();let f;t[0]!==e?.ids?(f=e?.ids??[...ne],t[0]=e?.ids,t[1]=f):f=t[1];const l=f,[n,S]=U.useState(l);let _;t[2]!==n||t[3]!==l?(_=n.length!==l.length||n.some((E,O)=>E!==l[O]),t[2]=n,t[3]=l,t[4]=_):_=t[4];const c=_;let g;t[5]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:5}},t[5]=g):g=t[5];let o;t[6]===Symbol.for("react.memo_cache_sentinel")?(o={coordinateGetter:Ae},t[6]=o):o=t[6];const u=ye(se(De,g),se(ze,o));let d;t[7]!==n?(d=E=>{const{active:O,over:R}=E;if(!R||O.id===R.id)return;const F=n.indexOf(O.id),G=n.indexOf(R.id);F===-1||G===-1||S(Ie([...n],F,G))},t[7]=n,t[8]=d):d=t[8];const m=d;let x;t[9]!==n?(x=E=>{n.includes(E)||S([...n,E])},t[9]=n,t[10]=x):x=t[10];const z=x;let p;t[11]!==n?(p=E=>{S(n.filter(O=>O!==E))},t[11]=n,t[12]=p):p=t[12];const b=p;let D;t[13]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{S([...ne])},t[13]=D):D=t[13];const A=D;let y;t[14]!==n||t[15]!==i?(y=()=>{i.mutate({ids:n},{onSuccess:()=>{Y("default_home_agents_updated",{count:n.length,template_count:n.filter(Ze).length}),q.success("Default home agents updated")},onError:Xe})},t[14]=n,t[15]=i,t[16]=y):y=t[16];const C=y;let j,w,h,v,I,P,N;if(t[17]!==a||t[18]!==n||t[19]!==m||t[20]!==b||t[21]!==u||t[22]!==i.isPending){let E;t[30]!==a?(E=F=>Qe(F,ee,a),t[30]=a,t[31]=E):E=t[31];const O=n.map(E);h=Math.max(0,n.length-oe),w=X,I="Default home agents";let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(he,{size:14}),t[32]=R):R=t[32],t[33]!==i.isPending?(P=s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:A,disabled:i.isPending,children:[R,"Reset defaults"]}),t[33]=i.isPending,t[34]=P):P=t[34],j=Z,N="px-5 py-5 flex flex-col gap-3",v=O.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(Ne,{sensors:u,collisionDetection:Ce,onDragEnd:m,children:s.jsx(we,{items:n,strategy:_e,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:O.map((F,G)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[G===oe&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(We,{agent:F,onRemove:()=>b(F.id)})]},F.id))})})}),t[17]=a,t[18]=n,t[19]=m,t[20]=b,t[21]=u,t[22]=i.isPending,t[23]=j,t[24]=w,t[25]=h,t[26]=v,t[27]=I,t[28]=P,t[29]=N}else j=t[23],w=t[24],h=t[25],v=t[26],I=t[27],P=t[28],N=t[29];let k;t[35]!==n||t[36]!==z?(k=s.jsx(Ye,{selectedIds:n,onAdd:z}),t[35]=n,t[36]=z,t[37]=k):k=t[37];let T;t[38]!==h?(T=h>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[h," agent",h===1?"":"s"," won't fit on the home view"]}),t[38]=h,t[39]=T):T=t[39];let r;t[40]!==k||t[41]!==T?(r=s.jsxs("div",{className:"flex items-center justify-between",children:[k,T]}),t[40]=k,t[41]=T,t[42]=r):r=t[42];let $;t[43]!==v||t[44]!==r||t[45]!==N?($=s.jsxs("div",{className:N,children:[v,r]}),t[43]=v,t[44]=r,t[45]=N,t[46]=$):$=t[46];let M;t[47]!==C||t[48]!==l||t[49]!==c||t[50]!==i.isPending?(M=c&&s.jsxs(ie,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>S(l),disabled:i.isPending,children:"Cancel"}),s.jsx(H,{type:"button",onClick:C,disabled:i.isPending,children:i.isPending?"Saving…":"Save"})]}),t[47]=C,t[48]=l,t[49]=c,t[50]=i.isPending,t[51]=M):M=t[51];let K;t[52]!==j||t[53]!==$||t[54]!==M?(K=s.jsxs(j,{children:[$,M]}),t[52]=j,t[53]=$,t[54]=M,t[55]=K):K=t[55];let B;return t[56]!==w||t[57]!==I||t[58]!==P||t[59]!==K?(B=s.jsx(w,{title:I,actions:P,children:K}),t[56]=w,t[57]=I,t[58]=P,t[59]=K,t[60]=B):B=t[60],B}function Xe(t){q.error(t instanceof Error?t.message:"Failed to update default home agents")}function Ze(t){return ee.some(e=>e.id===t)}function et(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X,{title:"Default home agents",children:s.jsx(Z,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(tt)})})}),t[0]=e):e=t[0],e}function tt(t,e){return s.jsx(Le,{className:"h-12 w-full rounded-lg"},e)}function st(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(U.Suspense,{fallback:s.jsx(et,{}),children:s.jsx(Je,{})}),t[0]=e):e=t[0],e}function nt(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(V,{children:s.jsx(V.Content,{children:s.jsx(V.Body,{children:s.jsxs(ve,{children:[s.jsx(V.Title,{children:"Organization"}),s.jsx(Ve,{}),s.jsx(Se,{}),s.jsx(st,{})]})})})}),t[0]=e):e=t[0],e}function Xt(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(nt,{}),t[0]=e):e=t[0],e}export{Xt as default};
@@ -1,4 +1,4 @@
1
- import{e as M,s as z,o as ve,b as ze,r as O,K as ne,n as Fe,a as He,j as t,c as he,B as oe,t as V,z as ie,f as We,a0 as Je,a1 as Xe,az as je,C as Ze,l as xe,V as et}from"./index-DqsW5LHB.js";import{S as re,u as $,d as we,W as Be,j as ye}from"./constants-D02ovwi8.js";import{u as Ne}from"./use-navigate-to-agent-51gjX2Pz.js";import{c as ce,d as le,a as de,D as ue,b as tt}from"./dialog-iad61Myk.js";import{i as Ae}from"./RefreshCcw01-Bmm2OZFs.js";import{C as qe}from"./collection-search-LJG0dGzi.js";import{c as Ee,b as Se,D as Oe,a as Le}from"./drawer-C5RmZfRn.js";import{u as Re}from"./use-mobile-DtcdfNhs.js";import{I as Me}from"./integration-icon-DJA_3Fr4.js";import{a as ke,u as nt}from"./use-connection-CkaOLOkA.js";import{u as st,d as Qe}from"./use-mcp-tools-B89VuP8B.js";import{b as Ue,u as it}from"./use-virtual-mcp-aaTK8HuA.js";import{C as ot}from"./checkbox-BtVeTd73.js";import{i as at}from"./Lock01-CQvbe2FZ.js";import{F as rt}from"./agent-icon-6Uu6lwox.js";import{e as ct}from"./extract-connection-data-CGvP9gW4.js";function lt(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function dt(){const i=await fetch("/api/deco-sites");if(!i.ok){const e=await i.json().catch(()=>({}));throw new Error(e.error??`Failed to load sites (${i.status})`)}return i.json()}function Kt(i){const e=M.c(65),{open:n,onOpenChange:a,onBack:c}=i,{org:s}=z(),l=Ne(),m=ve(),{data:f}=ze.useSession(),[x,h]=O.useState(null),[T,d]=O.useState("");let u;e[0]!==s.id?(u={connectionId:re,orgId:s.id},e[0]=s.id,e[1]=u):u=e[1];const p=$(u);let r;e[2]!==f?.user?.email?(r=ne.decoSites(f?.user?.email),e[2]=f?.user?.email,e[3]=r):r=e[3];const g=n&&!!f?.user?.email;let C;e[4]!==r||e[5]!==g?(C={queryKey:r,queryFn:dt,enabled:g,staleTime:6e4,retry:!1},e[4]=r,e[5]=g,e[6]=C):C=e[6];const{data:_,isLoading:N,error:b}=Fe(C),I=_?.sites??[];let o;e[7]!==a?(o=w=>{w||(h(null),d("")),a(w)},e[7]=a,e[8]=o):o=e[8];const y=o;let A;e[9]!==T?(A=w=>w.name.toLowerCase().includes(T.toLowerCase())||w.domains?.[0]?.domain.toLowerCase().includes(T.toLowerCase()),e[9]=T,e[10]=A):A=e[10];const v=I.filter(A),E=!x||v.some(w=>w.name===x);let j;e[11]!==p||e[12]!==s.id?(j=async w=>{V("deco_site_import_started",{site_name:w});const G=await fetch("/api/deco-sites/connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:w,orgId:s.id})}),D=await G.json().catch(ft);if(!G.ok)throw new Error(D.error??`Failed to create connection (${G.status})`);const L=D.connId;if(!L)throw new Error("Server did not return a connection ID");const ge=D.icon??null,te=lt(w),Pe=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:w,description:"Imported from deco.cx",pinned:!0,icon:ge??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],ui:{banner:null,bannerColor:"#22C55E",icon:ge,themeColor:"#22C55E",slug:te,pinnedViews:[{connectionId:L,toolName:"file_explorer",label:"Preview",icon:null},{connectionId:L,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:L,toolName:"get_monitor_data",label:"Monitor",icon:null},{connectionId:L,toolName:"list_pull_requests",label:"Pull Requests",icon:null},{connectionId:L,toolName:"list_releases",label:"Releases",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:L,toolName:"file_explorer"}}}},connections:[{connection_id:L}]}}}),Ge=Pe.structuredContent??Pe;return{slug:te,virtualMcpId:Ge.item.id,connId:L,item:Ge.item}},e[11]=p,e[12]=s.id,e[13]=j):j=e[13];let S;e[14]!==p||e[15]!==y||e[16]!==l||e[17]!==s.id||e[18]!==m?(S=w=>{const{slug:G,virtualMcpId:D,item:L}=w;V("deco_site_import_succeeded",{site_name:L.title,virtual_mcp_id:D,slug:G}),m.setQueryData(ne.collectionItem(p,s.id,"","VIRTUAL_MCP",D),{item:L}),m.invalidateQueries({predicate:ge=>{const te=ge.queryKey;return te[1]===s.id&&te[3]==="collection"&&te[4]==="VIRTUAL_MCP"}}),m.invalidateQueries({queryKey:ne.projects(s.id)}),ie.success(`Imported ${G} from deco.cx`),y(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(D)},e[14]=p,e[15]=y,e[16]=l,e[17]=s.id,e[18]=m,e[19]=S):S=e[19];let k;e[20]!==j||e[21]!==S?(k={mutationFn:j,onSuccess:S,onError:mt},e[20]=j,e[21]=S,e[22]=k):k=e[22];const U=He(k),F=le,se=ce,R="sm:max-w-[900px] p-0 gap-0 overflow-hidden";let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(de,{className:"sr-only",children:t.jsx(ue,{children:"Import from deco.cx"})}),e[23]=P):P=e[23];let H;e[24]!==c?(H=c&&t.jsx("button",{type:"button",onClick:c,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:t.jsx(Ae,{size:18})}),e[24]=c,e[25]=H):H=e[25];let me;e[26]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"}),e[26]=me):me=e[26];let B;e[27]!==H?(B=t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[H,me]}),e[27]=H,e[28]=B):B=e[28];let fe;e[29]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w.key==="Escape"&&d("")},e[29]=fe):fe=e[29];let q;e[30]!==T?(q=t.jsx("div",{children:t.jsx(qe,{value:T,onChange:d,placeholder:"Search sites...",onKeyDown:fe})}),e[30]=T,e[31]=q):q=e[31];const Ke="pb-0 min-h-[300px]";let Q;e[32]!==N?(Q=N&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),e[32]=N,e[33]=Q):Q=e[33];const _e=!N&&!b&&I.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),Ce=!N&&I.length>0&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[v.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",T,"”"]}),v.map(w=>{const G=w.domains?.find(ut)?.domain??w.domains?.[0]?.domain,D=x===w.name;return t.jsxs("button",{type:"button",onClick:()=>h(w.name),className:he("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",D?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[t.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:w.thumb_url?t.jsx("img",{src:w.thumb_url,alt:w.name,className:"w-full h-full object-cover",loading:"lazy"}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsxs("div",{className:"px-4 py-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:w.name}),G&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:G})]})]},w.name)})]});let Y;e[34]!==Q||e[35]!==_e||e[36]!==Ce?(Y=t.jsxs("div",{className:Ke,children:[Q,_e,Ce]}),e[34]=Q,e[35]=_e,e[36]=Ce,e[37]=Y):Y=e[37];let K;e[38]!==y?(K=()=>y(!1),e[38]=y,e[39]=K):K=e[39];let W;e[40]!==U.isPending||e[41]!==K?(W=t.jsx(oe,{variant:"outline",onClick:K,disabled:U.isPending,children:"Cancel"}),e[40]=U.isPending,e[41]=K,e[42]=W):W=e[42];const Ie=!x||!E||U.isPending||N;let J;e[43]!==U||e[44]!==x?(J=()=>x&&U.mutate(x),e[43]=U,e[44]=x,e[45]=J):J=e[45];const Te=U.isPending?"Importing...":"Import";let X;e[46]!==Ie||e[47]!==J||e[48]!==Te?(X=t.jsx(oe,{disabled:Ie,onClick:J,children:Te}),e[46]=Ie,e[47]=J,e[48]=Te,e[49]=X):X=e[49];let Z;e[50]!==W||e[51]!==X?(Z=t.jsxs(tt,{className:"px-8 py-5 border-t border-border",children:[W,X]}),e[50]=W,e[51]=X,e[52]=Z):Z=e[52];let ee;e[53]!==se||e[54]!==P||e[55]!==B||e[56]!==q||e[57]!==Y||e[58]!==Z?(ee=t.jsxs(se,{className:R,children:[P,B,q,Y,Z]}),e[53]=se,e[54]=P,e[55]=B,e[56]=q,e[57]=Y,e[58]=Z,e[59]=ee):ee=e[59];let pe;return e[60]!==F||e[61]!==y||e[62]!==n||e[63]!==ee?(pe=t.jsx(F,{open:n,onOpenChange:y,children:ee}),e[60]=F,e[61]=y,e[62]=n,e[63]=ee,e[64]=pe):pe=e[64],pe}function ut(i){return i.production}function mt(i){V("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),ie.error("Import failed: "+(i instanceof Error?i.message:"Unknown error"))}function ft(){return{}}function Ye(i,e){const n=M.c(11),{org:a}=z();let c;n[0]!==a.id?(c=we.REGISTRY(a.id),n[0]=a.id,n[1]=c):c=n[1];const s=c;let l;n[2]!==a.id||n[3]!==s?(l={connectionId:s,orgId:a.id},n[2]=a.id,n[3]=s,n[4]=l):l=n[4];const m=$(l);let f;n[5]!==i?(f={name:i},n[5]=i,n[6]=f):f=n[6];const x=e?.enabled??!0;let h;return n[7]!==m||n[8]!==f||n[9]!==x?(h={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:f,enabled:x,staleTime:3e5,select:pt},n[7]=m,n[8]=f,n[9]=x,n[10]=h):h=n[10],st(h)}function pt(i){return i.structuredContent?.item??null}const gt=["Full HAR capture with cache, TTFB, and request analysis","Screenshot capture for visual inspection","Page discovery via sitemap, navigation, and link crawling","SEO audit — meta tags, structured data, robots.txt","Third-party script inventory and size analysis","Dead link detection across the entire site","Deco-specific diagnostics (?__d debug mode)"];function De(i){const e=M.c(7),{onRecruit:n,isRecruiting:a,isLoading:c}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a blackbox diagnostics agent that tests your storefront from the outside — no internal access needed. Give it a URL and it produces a detailed performance and health report."}),e[0]=s):s=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=l):l=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx("ul",{className:"space-y-1.5",children:gt.map(ht)})]}),e[2]=m):m=e[2];const f=a||c,x=a?"Setting up...":"Add Site Diagnostics";let h;return e[3]!==n||e[4]!==f||e[5]!==x?(h=t.jsxs("div",{className:"flex flex-col gap-6",children:[s,m,t.jsx(oe,{onClick:n,disabled:f,className:"w-full cursor-pointer",children:x})]}),e[3]=n,e[4]=f,e[5]=x,e[6]=h):h=e[6],h}function ht(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),i]},i)}function Wt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(I=>I.id==="site-diagnostics"),{data:u,isLoading:p}=Ye(d.appId,{enabled:i}),r=u?.title||u?.server?.title||u?.server?.name||d.title,g=u?.server?.icons?.[0]?.src??d.icon,C=u?.server?.description??null,_=t.jsx(Me,{icon:g,name:r,size:"sm"}),N=async()=>{if(u){if(n){e(!1),s(n.id);return}T(!0);try{const I=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:d.appId},limit:1,offset:0}});let o;const A=I?.structuredContent?.items?.find(E=>E.app_id===d.appId);if(A)o=A.id;else{const E=u.server?.remotes?.[0]?.url;if(!E)throw new Error("Registry item is missing a remote URL for site-diagnostics");o=(await l.create.mutateAsync({title:r,description:C,icon:u.server?.icons?.[0]?.src??d.icon,connection_type:"HTTP",connection_url:E,app_name:u.server?.name??"site-diagnostics",app_id:d.appId,metadata:{type:"site-diagnostics",source:"store",registry_item_id:d.appId,verified:!0}})).id}const v=await m.create.mutateAsync({title:r,description:C,icon:g,status:"active",connections:[{connection_id:o,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"site-diagnostics",instructions:null,ui:{pinnedViews:[{connectionId:o,toolName:"diagnose",label:"diagnose",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:o,toolName:"diagnose"}}}}});V("agent_recruit_confirmed",{template_id:"site-diagnostics",agent_id:v.id}),e(!1),s(v.id)}catch(I){V("agent_recruit_failed",{template_id:"site-diagnostics",error:I instanceof Error?I.message:String(I)}),console.error("Failed to create Site Diagnostics agent:",I)}finally{T(!1)}}},b=`Add ${r}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(Le,{className:"text-xl font-semibold",children:b})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(ue,{className:"text-xl font-semibold",children:b})]})}),t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})]})})}const xt="https://sites-lean-canva.decocache.com/api/mcp",Nt=["Build and update Lean Canvas business models visually","Interactive grid UI with all 9 canvas sections","Iterative updates — add information as you discover it","Covers: Problem, Solution, Key Metrics, Unique Value Proposition","Covers: Channels, Customer Segments, Cost Structure, Revenue Streams","Unfair Advantage analysis"];function Ve(i){const e=M.c(7),{onRecruit:n,isRecruiting:a}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a Lean Canvas agent that helps you build and iterate on your business model. Describe your idea and it produces a visual, structured canvas."}),e[0]=c):c=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"space-y-2",children:[s,t.jsx("ul",{className:"space-y-1.5",children:Nt.map(_t)})]}),e[2]=l):l=e[2];const m=a?"Setting up...":"Add Lean Canvas";let f;return e[3]!==a||e[4]!==n||e[5]!==m?(f=t.jsxs("div",{className:"flex flex-col gap-6",children:[c,l,t.jsx(oe,{onClick:n,disabled:a,className:"w-full cursor-pointer",children:m})]}),e[3]=a,e[4]=n,e[5]=m,e[6]=f):f=e[6],f}function _t(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),i]},i)}function Jt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(g=>g.id==="lean-canvas"),u=t.jsx(Me,{icon:d.icon,name:d.title,size:"sm"}),p=async()=>{if(n){e(!1),s(n.id);return}T(!0);try{const g=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:"lean-canvas"},limit:1,offset:0}});let C;const N=g?.structuredContent?.items?.find(o=>o.app_id==="lean-canvas"),b=we.SELF(c.id);N?C=N.id:C=(await l.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,connection_type:"HTTP",connection_url:xt,app_name:"lean-canvas",app_id:"lean-canvas",configuration_state:{OBJECT_STORAGE:{__type:"@deco/object-storage",value:b}},metadata:{type:"lean-canvas",source:"store",verified:!0}})).id;const I=await m.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,status:"active",connections:[{connection_id:C,selected_tools:null,selected_resources:null,selected_prompts:null},{connection_id:b,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"lean-canvas",instructions:null,ui:{pinnedViews:[{connectionId:C,toolName:"lean_canvas",label:"lean_canvas",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:C,toolName:"lean_canvas"}}}}});V("agent_recruit_confirmed",{template_id:"lean-canvas",agent_id:I.id}),e(!1),s(I.id)}catch(g){V("agent_recruit_failed",{template_id:"lean-canvas",error:g instanceof Error?g.message:String(g)}),console.error("Failed to create Lean Canvas agent:",g)}finally{T(!1)}},r=`Add ${d.title}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(Le,{className:"text-xl font-semibold",children:r})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(Ve,{onRecruit:p,isRecruiting:h})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(ue,{className:"text-xl font-semibold",children:r})]})}),t.jsx(Ve,{onRecruit:p,isRecruiting:h})]})})}const Ct=`<role>
1
+ import{e as M,s as z,o as ve,b as ze,r as O,K as ne,n as Fe,a as He,j as t,c as he,B as oe,t as V,z as ie,f as We,a0 as Je,a1 as Xe,az as je,C as Ze,l as xe,V as et}from"./index-Dq226A4w.js";import{S as re,u as $,d as we,W as Be,j as ye}from"./constants-BAzsARw1.js";import{u as Ne}from"./use-navigate-to-agent-yRpKyeIE.js";import{c as ce,d as le,a as de,D as ue,b as tt}from"./dialog-C2cBQ0ty.js";import{i as Ae}from"./RefreshCcw01-DtyDEAf2.js";import{C as qe}from"./collection-search-BoQ_EppH.js";import{c as Ee,b as Se,D as Oe,a as Le}from"./drawer-B_-bDnjD.js";import{u as Re}from"./use-mobile-BSlkjiym.js";import{I as Me}from"./integration-icon-AZugc3yw.js";import{a as ke,u as nt}from"./use-connection-dg_H_Pr1.js";import{u as st,d as Qe}from"./use-mcp-tools-DigN6mZj.js";import{b as Ue,u as it}from"./use-virtual-mcp-CTcuyRU_.js";import{C as ot}from"./checkbox-duvwt99y.js";import{i as at}from"./Lock01-CT9fVg-M.js";import{F as rt}from"./agent-icon-BHvp6mzD.js";import{e as ct}from"./extract-connection-data-DAdB5U1f.js";function lt(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function dt(){const i=await fetch("/api/deco-sites");if(!i.ok){const e=await i.json().catch(()=>({}));throw new Error(e.error??`Failed to load sites (${i.status})`)}return i.json()}function Kt(i){const e=M.c(65),{open:n,onOpenChange:a,onBack:c}=i,{org:s}=z(),l=Ne(),m=ve(),{data:f}=ze.useSession(),[x,h]=O.useState(null),[T,d]=O.useState("");let u;e[0]!==s.id?(u={connectionId:re,orgId:s.id},e[0]=s.id,e[1]=u):u=e[1];const p=$(u);let r;e[2]!==f?.user?.email?(r=ne.decoSites(f?.user?.email),e[2]=f?.user?.email,e[3]=r):r=e[3];const g=n&&!!f?.user?.email;let C;e[4]!==r||e[5]!==g?(C={queryKey:r,queryFn:dt,enabled:g,staleTime:6e4,retry:!1},e[4]=r,e[5]=g,e[6]=C):C=e[6];const{data:_,isLoading:N,error:b}=Fe(C),I=_?.sites??[];let o;e[7]!==a?(o=w=>{w||(h(null),d("")),a(w)},e[7]=a,e[8]=o):o=e[8];const y=o;let A;e[9]!==T?(A=w=>w.name.toLowerCase().includes(T.toLowerCase())||w.domains?.[0]?.domain.toLowerCase().includes(T.toLowerCase()),e[9]=T,e[10]=A):A=e[10];const v=I.filter(A),E=!x||v.some(w=>w.name===x);let j;e[11]!==p||e[12]!==s.id?(j=async w=>{V("deco_site_import_started",{site_name:w});const G=await fetch("/api/deco-sites/connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:w,orgId:s.id})}),D=await G.json().catch(ft);if(!G.ok)throw new Error(D.error??`Failed to create connection (${G.status})`);const L=D.connId;if(!L)throw new Error("Server did not return a connection ID");const ge=D.icon??null,te=lt(w),Pe=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:w,description:"Imported from deco.cx",pinned:!0,icon:ge??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],ui:{banner:null,bannerColor:"#22C55E",icon:ge,themeColor:"#22C55E",slug:te,pinnedViews:[{connectionId:L,toolName:"file_explorer",label:"Preview",icon:null},{connectionId:L,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:L,toolName:"get_monitor_data",label:"Monitor",icon:null},{connectionId:L,toolName:"list_pull_requests",label:"Pull Requests",icon:null},{connectionId:L,toolName:"list_releases",label:"Releases",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:L,toolName:"file_explorer"}}}},connections:[{connection_id:L}]}}}),Ge=Pe.structuredContent??Pe;return{slug:te,virtualMcpId:Ge.item.id,connId:L,item:Ge.item}},e[11]=p,e[12]=s.id,e[13]=j):j=e[13];let S;e[14]!==p||e[15]!==y||e[16]!==l||e[17]!==s.id||e[18]!==m?(S=w=>{const{slug:G,virtualMcpId:D,item:L}=w;V("deco_site_import_succeeded",{site_name:L.title,virtual_mcp_id:D,slug:G}),m.setQueryData(ne.collectionItem(p,s.id,"","VIRTUAL_MCP",D),{item:L}),m.invalidateQueries({predicate:ge=>{const te=ge.queryKey;return te[1]===s.id&&te[3]==="collection"&&te[4]==="VIRTUAL_MCP"}}),m.invalidateQueries({queryKey:ne.projects(s.id)}),ie.success(`Imported ${G} from deco.cx`),y(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(D)},e[14]=p,e[15]=y,e[16]=l,e[17]=s.id,e[18]=m,e[19]=S):S=e[19];let k;e[20]!==j||e[21]!==S?(k={mutationFn:j,onSuccess:S,onError:mt},e[20]=j,e[21]=S,e[22]=k):k=e[22];const U=He(k),F=le,se=ce,R="sm:max-w-[900px] p-0 gap-0 overflow-hidden";let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(de,{className:"sr-only",children:t.jsx(ue,{children:"Import from deco.cx"})}),e[23]=P):P=e[23];let H;e[24]!==c?(H=c&&t.jsx("button",{type:"button",onClick:c,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:t.jsx(Ae,{size:18})}),e[24]=c,e[25]=H):H=e[25];let me;e[26]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"}),e[26]=me):me=e[26];let B;e[27]!==H?(B=t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[H,me]}),e[27]=H,e[28]=B):B=e[28];let fe;e[29]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w.key==="Escape"&&d("")},e[29]=fe):fe=e[29];let q;e[30]!==T?(q=t.jsx("div",{children:t.jsx(qe,{value:T,onChange:d,placeholder:"Search sites...",onKeyDown:fe})}),e[30]=T,e[31]=q):q=e[31];const Ke="pb-0 min-h-[300px]";let Q;e[32]!==N?(Q=N&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),e[32]=N,e[33]=Q):Q=e[33];const _e=!N&&!b&&I.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),Ce=!N&&I.length>0&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[v.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",T,"”"]}),v.map(w=>{const G=w.domains?.find(ut)?.domain??w.domains?.[0]?.domain,D=x===w.name;return t.jsxs("button",{type:"button",onClick:()=>h(w.name),className:he("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",D?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[t.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:w.thumb_url?t.jsx("img",{src:w.thumb_url,alt:w.name,className:"w-full h-full object-cover",loading:"lazy"}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsxs("div",{className:"px-4 py-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:w.name}),G&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:G})]})]},w.name)})]});let Y;e[34]!==Q||e[35]!==_e||e[36]!==Ce?(Y=t.jsxs("div",{className:Ke,children:[Q,_e,Ce]}),e[34]=Q,e[35]=_e,e[36]=Ce,e[37]=Y):Y=e[37];let K;e[38]!==y?(K=()=>y(!1),e[38]=y,e[39]=K):K=e[39];let W;e[40]!==U.isPending||e[41]!==K?(W=t.jsx(oe,{variant:"outline",onClick:K,disabled:U.isPending,children:"Cancel"}),e[40]=U.isPending,e[41]=K,e[42]=W):W=e[42];const Ie=!x||!E||U.isPending||N;let J;e[43]!==U||e[44]!==x?(J=()=>x&&U.mutate(x),e[43]=U,e[44]=x,e[45]=J):J=e[45];const Te=U.isPending?"Importing...":"Import";let X;e[46]!==Ie||e[47]!==J||e[48]!==Te?(X=t.jsx(oe,{disabled:Ie,onClick:J,children:Te}),e[46]=Ie,e[47]=J,e[48]=Te,e[49]=X):X=e[49];let Z;e[50]!==W||e[51]!==X?(Z=t.jsxs(tt,{className:"px-8 py-5 border-t border-border",children:[W,X]}),e[50]=W,e[51]=X,e[52]=Z):Z=e[52];let ee;e[53]!==se||e[54]!==P||e[55]!==B||e[56]!==q||e[57]!==Y||e[58]!==Z?(ee=t.jsxs(se,{className:R,children:[P,B,q,Y,Z]}),e[53]=se,e[54]=P,e[55]=B,e[56]=q,e[57]=Y,e[58]=Z,e[59]=ee):ee=e[59];let pe;return e[60]!==F||e[61]!==y||e[62]!==n||e[63]!==ee?(pe=t.jsx(F,{open:n,onOpenChange:y,children:ee}),e[60]=F,e[61]=y,e[62]=n,e[63]=ee,e[64]=pe):pe=e[64],pe}function ut(i){return i.production}function mt(i){V("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),ie.error("Import failed: "+(i instanceof Error?i.message:"Unknown error"))}function ft(){return{}}function Ye(i,e){const n=M.c(11),{org:a}=z();let c;n[0]!==a.id?(c=we.REGISTRY(a.id),n[0]=a.id,n[1]=c):c=n[1];const s=c;let l;n[2]!==a.id||n[3]!==s?(l={connectionId:s,orgId:a.id},n[2]=a.id,n[3]=s,n[4]=l):l=n[4];const m=$(l);let f;n[5]!==i?(f={name:i},n[5]=i,n[6]=f):f=n[6];const x=e?.enabled??!0;let h;return n[7]!==m||n[8]!==f||n[9]!==x?(h={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:f,enabled:x,staleTime:3e5,select:pt},n[7]=m,n[8]=f,n[9]=x,n[10]=h):h=n[10],st(h)}function pt(i){return i.structuredContent?.item??null}const gt=["Full HAR capture with cache, TTFB, and request analysis","Screenshot capture for visual inspection","Page discovery via sitemap, navigation, and link crawling","SEO audit — meta tags, structured data, robots.txt","Third-party script inventory and size analysis","Dead link detection across the entire site","Deco-specific diagnostics (?__d debug mode)"];function De(i){const e=M.c(7),{onRecruit:n,isRecruiting:a,isLoading:c}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a blackbox diagnostics agent that tests your storefront from the outside — no internal access needed. Give it a URL and it produces a detailed performance and health report."}),e[0]=s):s=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=l):l=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx("ul",{className:"space-y-1.5",children:gt.map(ht)})]}),e[2]=m):m=e[2];const f=a||c,x=a?"Setting up...":"Add Site Diagnostics";let h;return e[3]!==n||e[4]!==f||e[5]!==x?(h=t.jsxs("div",{className:"flex flex-col gap-6",children:[s,m,t.jsx(oe,{onClick:n,disabled:f,className:"w-full cursor-pointer",children:x})]}),e[3]=n,e[4]=f,e[5]=x,e[6]=h):h=e[6],h}function ht(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),i]},i)}function Wt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(I=>I.id==="site-diagnostics"),{data:u,isLoading:p}=Ye(d.appId,{enabled:i}),r=u?.title||u?.server?.title||u?.server?.name||d.title,g=u?.server?.icons?.[0]?.src??d.icon,C=u?.server?.description??null,_=t.jsx(Me,{icon:g,name:r,size:"sm"}),N=async()=>{if(u){if(n){e(!1),s(n.id);return}T(!0);try{const I=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:d.appId},limit:1,offset:0}});let o;const A=I?.structuredContent?.items?.find(E=>E.app_id===d.appId);if(A)o=A.id;else{const E=u.server?.remotes?.[0]?.url;if(!E)throw new Error("Registry item is missing a remote URL for site-diagnostics");o=(await l.create.mutateAsync({title:r,description:C,icon:u.server?.icons?.[0]?.src??d.icon,connection_type:"HTTP",connection_url:E,app_name:u.server?.name??"site-diagnostics",app_id:d.appId,metadata:{type:"site-diagnostics",source:"store",registry_item_id:d.appId,verified:!0}})).id}const v=await m.create.mutateAsync({title:r,description:C,icon:g,status:"active",connections:[{connection_id:o,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"site-diagnostics",instructions:null,ui:{pinnedViews:[{connectionId:o,toolName:"diagnose",label:"diagnose",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:o,toolName:"diagnose"}}}}});V("agent_recruit_confirmed",{template_id:"site-diagnostics",agent_id:v.id}),e(!1),s(v.id)}catch(I){V("agent_recruit_failed",{template_id:"site-diagnostics",error:I instanceof Error?I.message:String(I)}),console.error("Failed to create Site Diagnostics agent:",I)}finally{T(!1)}}},b=`Add ${r}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(Le,{className:"text-xl font-semibold",children:b})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(ue,{className:"text-xl font-semibold",children:b})]})}),t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})]})})}const xt="https://sites-lean-canva.decocache.com/api/mcp",Nt=["Build and update Lean Canvas business models visually","Interactive grid UI with all 9 canvas sections","Iterative updates — add information as you discover it","Covers: Problem, Solution, Key Metrics, Unique Value Proposition","Covers: Channels, Customer Segments, Cost Structure, Revenue Streams","Unfair Advantage analysis"];function Ve(i){const e=M.c(7),{onRecruit:n,isRecruiting:a}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a Lean Canvas agent that helps you build and iterate on your business model. Describe your idea and it produces a visual, structured canvas."}),e[0]=c):c=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"space-y-2",children:[s,t.jsx("ul",{className:"space-y-1.5",children:Nt.map(_t)})]}),e[2]=l):l=e[2];const m=a?"Setting up...":"Add Lean Canvas";let f;return e[3]!==a||e[4]!==n||e[5]!==m?(f=t.jsxs("div",{className:"flex flex-col gap-6",children:[c,l,t.jsx(oe,{onClick:n,disabled:a,className:"w-full cursor-pointer",children:m})]}),e[3]=a,e[4]=n,e[5]=m,e[6]=f):f=e[6],f}function _t(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),i]},i)}function Jt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(g=>g.id==="lean-canvas"),u=t.jsx(Me,{icon:d.icon,name:d.title,size:"sm"}),p=async()=>{if(n){e(!1),s(n.id);return}T(!0);try{const g=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:"lean-canvas"},limit:1,offset:0}});let C;const N=g?.structuredContent?.items?.find(o=>o.app_id==="lean-canvas"),b=we.SELF(c.id);N?C=N.id:C=(await l.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,connection_type:"HTTP",connection_url:xt,app_name:"lean-canvas",app_id:"lean-canvas",configuration_state:{OBJECT_STORAGE:{__type:"@deco/object-storage",value:b}},metadata:{type:"lean-canvas",source:"store",verified:!0}})).id;const I=await m.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,status:"active",connections:[{connection_id:C,selected_tools:null,selected_resources:null,selected_prompts:null},{connection_id:b,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"lean-canvas",instructions:null,ui:{pinnedViews:[{connectionId:C,toolName:"lean_canvas",label:"lean_canvas",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:C,toolName:"lean_canvas"}}}}});V("agent_recruit_confirmed",{template_id:"lean-canvas",agent_id:I.id}),e(!1),s(I.id)}catch(g){V("agent_recruit_failed",{template_id:"lean-canvas",error:g instanceof Error?g.message:String(g)}),console.error("Failed to create Lean Canvas agent:",g)}finally{T(!1)}},r=`Add ${d.title}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(Le,{className:"text-xl font-semibold",children:r})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(Ve,{onRecruit:p,isRecruiting:h})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(ue,{className:"text-xl font-semibold",children:r})]})}),t.jsx(Ve,{onRecruit:p,isRecruiting:h})]})})}const Ct=`<role>
2
2
  You are the Agent Manager. You create, configure, and maintain agents (Virtual MCPs) in this workspace.
3
3
  </role>
4
4
 
@@ -1 +1 @@
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-DqsW5LHB.js";import{E as Be}from"./empty-state-C0ZLSTKp.js";import{i as $t,u as zt}from"./constants-D02ovwi8.js";import{c as Lt}from"./use-mcp-tools-B89VuP8B.js";import{A as Fe,u as Ut}from"./agent-icon-6Uu6lwox.js";import{i as Kt,a as Gt}from"./SearchMd-CHEkvskM.js";import{a as Wt,u as qt,b as Ht}from"./use-connection-CkaOLOkA.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-COtqJC_1.js";import{B as xn,c as bn}from"./collections-BGqKPyxO.js";import{i as gn,c as vn,b as yn,e as jn}from"./extract-connection-data-CGvP9gW4.js";import{u as wn}from"./use-registry-connections-yAbn5ElM.js";import{a as Sn}from"./use-organization-settings-BAET96Uw.js";import{s as Nn}from"./Plus-Mx814qi5.js";import{e as $e,a as Cn,c as kn,d as _n,S as Rn,b as In}from"./select-AHhRGkyu.js";import"./index-Dm9FQcLA.js";import{_ as te}from"./index-D47or-uW.js";import{I as Tn}from"./input-DH-CzXJx.js";import{P as Dn,a as An,b as En}from"./popover-OC7XhGTw.js";import{u as Pn,b as Bn,a as Fn,T as Mn,c as On}from"./use-mobile-DtcdfNhs.js";import{u as Vn}from"./use-virtual-mcp-aaTK8HuA.js";import{i as $n}from"./ChevronDown-BRURl2T5.js";import{a as zn}from"./Users03-B2xVime7.js";import{u as Ln}from"./use-create-virtual-mcp-CoqQQKD_.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
+ 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-Dq226A4w.js";import{E as Be}from"./empty-state-CLCMWued.js";import{i as $t,u as zt}from"./constants-BAzsARw1.js";import{c as Lt}from"./use-mcp-tools-DigN6mZj.js";import{A as Fe,u as Ut}from"./agent-icon-BHvp6mzD.js";import{i as Kt,a as Gt}from"./SearchMd-CJm9ITir.js";import{a as Wt,u as qt,b as Ht}from"./use-connection-dg_H_Pr1.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-BRQ0tifs.js";import{B as xn,c as bn}from"./collections-CtHgOGSI.js";import{i as gn,c as vn,b as yn,e as jn}from"./extract-connection-data-DAdB5U1f.js";import{u as wn}from"./use-registry-connections-CYHmfgoy.js";import{a as Sn}from"./use-organization-settings-dHr-vwwr.js";import{s as Nn}from"./Plus-BX8KY2Vj.js";import{e as $e,a as Cn,c as kn,d as _n,S as Rn,b as In}from"./select-C3X6ssTw.js";import"./index-BPhQ3efs.js";import{_ as te}from"./index-CTsYITXV.js";import{I as Tn}from"./input-sAl4qpu7.js";import{P as Dn,a as An,b as En}from"./popover-Cl9Q4B_r.js";import{u as Pn,b as Bn,a as Fn,T as Mn,c as On}from"./use-mobile-BSlkjiym.js";import{u as Vn}from"./use-virtual-mcp-CTcuyRU_.js";import{i as $n}from"./ChevronDown-BjunjZ96.js";import{a as zn}from"./Users03-DGkdZmwX.js";import{u as Ln}from"./use-create-virtual-mcp-CCwbfx6_.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};