decocms 2.306.18 → 2.307.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/dist/client/assets/{AlertCircle-D5P-n_4t.js → AlertCircle-DbSc8_5o.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-Cei5z2C8.js → ArrowNarrowLeft-BzM32upt.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-Dp3G1ifa.js → ArrowUpRight-CVt-dZIr.js} +1 -1
  4. package/dist/client/assets/{Check-CHUfypwG.js → Check-DrgiOcvX.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-CAevZeBb.js → CheckCircle-BQeGxZq_.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-DGxIrQou.js → ChevronDown-C7syIVEM.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-D0NO-NBa.js → ChevronRight-BVkmPfkJ.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-R3D-J8U2.js → ChevronUp-DgBvNG-s.js} +1 -1
  9. package/dist/client/assets/{Container-BOvWwKV4.js → Container-BFBDXadT.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-rqLS7JIj.js → DotsVertical-DullXRlj.js} +1 -1
  11. package/dist/client/assets/{LinkExternal01-BAOljpRH.js → LinkExternal01-eYI9rzDs.js} +1 -1
  12. package/dist/client/assets/{Lock01-D8HWIvFW.js → Lock01-CHD9ynDw.js} +1 -1
  13. package/dist/client/assets/{Palette-DFI0YLk6.js → Palette-D8RZYE5o.js} +1 -1
  14. package/dist/client/assets/{Play-CI6lv5t3.js → Play-DRFVE1h5.js} +1 -1
  15. package/dist/client/assets/{Plus-DyrPdLFx.js → Plus-B6kqhltR.js} +1 -1
  16. package/dist/client/assets/{RefreshCcw01-CGNxI6Ck.js → RefreshCcw01-C_zk4Try.js} +1 -1
  17. package/dist/client/assets/{SearchMd-Xtv0xaPE.js → SearchMd-CEcDQ6LC.js} +1 -1
  18. package/dist/client/assets/{Settings02-CJ_7W7Nn.js → Settings02-Kj5D6IOr.js} +1 -1
  19. package/dist/client/assets/{Shield01-C53xx91N.js → Shield01-3u2o5WX2.js} +1 -1
  20. package/dist/client/assets/{Star01-BuYjjFhM.js → Star01-CcI10YS1.js} +1 -1
  21. package/dist/client/assets/{Sun-C-z27smq.js → Sun-D2L-I4uV.js} +1 -1
  22. package/dist/client/assets/{Tool01-Ce_Me7cD.js → Tool01-CcxU2xyo.js} +1 -1
  23. package/dist/client/assets/{Trash01-Q2vImoqI.js → Trash01-oWeyeakM.js} +1 -1
  24. package/dist/client/assets/{User01-CBFfH1NO.js → User01-axhJYAi5.js} +1 -1
  25. package/dist/client/assets/{Users03-FLHuEcPu.js → Users03-D0nK5Csa.js} +1 -1
  26. package/dist/client/assets/{X-Y4H2YxIf.js → X-Cv85QSif.js} +1 -1
  27. package/dist/client/assets/{XCircle-ABCC_xEK.js → XCircle-DJCAtDKC.js} +1 -1
  28. package/dist/client/assets/{XClose-Dz62x8sU.js → XClose-CxIHxCiH.js} +1 -1
  29. package/dist/client/assets/{Zap-XI7LaIzu.js → Zap-C4uL-K8p.js} +1 -1
  30. package/dist/client/assets/{ZapSquare-rh7PDy43.js → ZapSquare-DtiK8wdw.js} +1 -1
  31. package/dist/client/assets/{accordion-BKGH1GWc.js → accordion-UGg6usF2.js} +1 -1
  32. package/dist/client/assets/{agent-icon-Tpw3Xml_.js → agent-icon-BzMmOj78.js} +1 -1
  33. package/dist/client/assets/{agents-list-BMtx_0ol.js → agents-list-C6qiO6vJ.js} +1 -1
  34. package/dist/client/assets/ai-providers-CFoSyAC9.js +1 -0
  35. package/dist/client/assets/{alert-dialog-Cv_ZG6Li.js → alert-dialog-QZrmovBV.js} +1 -1
  36. package/dist/client/assets/{auth-catchall-CWSY8cPU.js → auth-catchall-CR6Sgyap.js} +1 -1
  37. package/dist/client/assets/{automation-list-row-cjwWU5Jn.js → automation-list-row-DH-SDcWO.js} +1 -1
  38. package/dist/client/assets/{automations-BWSQaVvj.js → automations-C6e5kYWF.js} +1 -1
  39. package/dist/client/assets/{avatar-C5CAYMYh.js → avatar-B0e9QGvS.js} +1 -1
  40. package/dist/client/assets/{badge-DTOCxRAj.js → badge-DBLkzzm7.js} +1 -1
  41. package/dist/client/assets/{brand-context-CPJ-WXdh.js → brand-context-BLmts49n.js} +1 -1
  42. package/dist/client/assets/{card-CmdabgMS.js → card-Cc_5Nm4i.js} +1 -1
  43. package/dist/client/assets/{chat-context-v3shdBDS.js → chat-context-CAvcaW8y.js} +1 -1
  44. package/dist/client/assets/{checkbox-CdfCoEXC.js → checkbox-Ccin5Uy8.js} +1 -1
  45. package/dist/client/assets/{collection-detail-4V9zCrdC.js → collection-detail-De1N_tX0.js} +1 -1
  46. package/dist/client/assets/{collection-display-button-D4lZfaVu.js → collection-display-button-JK5ktJZY.js} +1 -1
  47. package/dist/client/assets/{collection-search-CXt30faC.js → collection-search-CemMAr-C.js} +1 -1
  48. package/dist/client/assets/{collection-search-CtXh96Gm.js → collection-search-xvNZDMEo.js} +1 -1
  49. package/dist/client/assets/{collection-table-wrapper-DfZVmP1H.js → collection-table-wrapper-DeobLSs8.js} +1 -1
  50. package/dist/client/assets/{collection-tabs-C5ZYsU-l.js → collection-tabs-CBcoU2EE.js} +1 -1
  51. package/dist/client/assets/{collections-ECsba_DJ.js → collections-DIe-ggVS.js} +1 -1
  52. package/dist/client/assets/{command-jqyaWRfY.js → command-BmteDSsy.js} +1 -1
  53. package/dist/client/assets/{connection-card-D9YKYwnO.js → connection-card-BfjHOVwg.js} +1 -1
  54. package/dist/client/assets/{connection-detail-DXs485Ka.js → connection-detail-_GH74iyG.js} +1 -1
  55. package/dist/client/assets/{connection-form-helpers-DX9_FJ-7.js → connection-form-helpers-DjBgihPg.js} +1 -1
  56. package/dist/client/assets/{connections-CtYO_Eid.js → connections-Ct9F6eIL.js} +1 -1
  57. package/dist/client/assets/{constants-CmR1uSOF.js → constants-DuZel1ZR.js} +1 -1
  58. package/dist/client/assets/{constants-DULkH_5i.js → constants-d6_CHL4E.js} +1 -1
  59. package/dist/client/assets/{dialog-5eNXtqKl.js → dialog-BFCo_CYj.js} +1 -1
  60. package/dist/client/assets/{domain-settings-Zmfq2b2Q.js → domain-settings-Ci3-H3BP.js} +1 -1
  61. package/dist/client/assets/{drawer-XB2DW5E_.js → drawer-BnPN5suY.js} +1 -1
  62. package/dist/client/assets/{dropdown-menu-B5GSfnIt.js → dropdown-menu-BExiIBkw.js} +1 -1
  63. package/dist/client/assets/{dynamic-plugin-layout-BUFoiyje.js → dynamic-plugin-layout-Cjh43AHC.js} +1 -1
  64. package/dist/client/assets/{empty-state-DFWupnXC.js → empty-state-CDyVpLPt.js} +1 -1
  65. package/dist/client/assets/{empty-state-BzQGAVLh.js → empty-state-DXHvr6ap.js} +1 -1
  66. package/dist/client/assets/{extract-connection-data-eaIPqvNo.js → extract-connection-data-C6jEVYD5.js} +1 -1
  67. package/dist/client/assets/{features-WEkPNtWs.js → features-Buq79_ha.js} +1 -1
  68. package/dist/client/assets/{form-D7WJCWvC.js → form-CH5xE-n6.js} +1 -1
  69. package/dist/client/assets/{general-qMj6waFc.js → general-ppM0bYV1.js} +1 -1
  70. package/dist/client/assets/{index-BC4hQ6Pz.js → index-41AfW-JA.js} +3 -3
  71. package/dist/client/assets/{index-7K7UIKVV.js → index-9UWU9No6.js} +1 -1
  72. package/dist/client/assets/{index-Dx7luzbY.js → index-BGeVy9GY.js} +1 -1
  73. package/dist/client/assets/{index-B5iHWh5E.js → index-BQ5t2bfi.js} +1 -1
  74. package/dist/client/assets/{index-BssrisCo.js → index-BSiW3nl8.js} +1 -1
  75. package/dist/client/assets/{index-DVlsCdud.js → index-Bk6ofpKs.js} +1 -1
  76. package/dist/client/assets/index-Bkthve1H.js +1 -0
  77. package/dist/client/assets/{index-DPpnO2aq.js → index-C7gD7Yqs.js} +1 -1
  78. package/dist/client/assets/index-CpHJcJk3.css +1 -0
  79. package/dist/client/assets/{index-BZOcmiWe.js → index-CuZfM_Nx.js} +2 -2
  80. package/dist/client/assets/{index-RPF-NZ4H.js → index-D24cyaH0.js} +1 -1
  81. package/dist/client/assets/{index-DLVc0mBN.js → index-DdkMHB52.js} +1 -1
  82. package/dist/client/assets/{index-CDXDJ4IA.js → index-Ddp3rt_s.js} +1 -1
  83. package/dist/client/assets/index-Did0bIgZ.js +1 -0
  84. package/dist/client/assets/{index-C77tsMmw.js → index-Dii-GCmL.js} +1 -1
  85. package/dist/client/assets/{index-BtHnxUeh.js → index-EBcdaBr8.js} +1 -1
  86. package/dist/client/assets/{index-BsCdi-Ss.js → index-nyfPDVDX.js} +1 -1
  87. package/dist/client/assets/{infiniteQueryObserver-D2p5_zwx.js → infiniteQueryObserver-C1pZcrRh.js} +1 -1
  88. package/dist/client/assets/{input-CrpFSP0W.js → input-C_nPAOp-.js} +1 -1
  89. package/dist/client/assets/{integration-icon-CVmwF3_e.js → integration-icon-DFF86wgE.js} +1 -1
  90. package/dist/client/assets/{label-B-_20bUy.js → label-0qGP76Je.js} +1 -1
  91. package/dist/client/assets/{layout-CbPXdrhy.js → layout-Cg-JJAW2.js} +1 -1
  92. package/dist/client/assets/{lean-canvas-recruit-modal-BxpDu-kR.js → lean-canvas-recruit-modal-DJIrnHAv.js} +1 -1
  93. package/dist/client/assets/{login-CuUDpoMc.js → login-QRn6NNta.js} +1 -1
  94. package/dist/client/assets/{members-BeDE1Qvs.js → members-CrOCVa1S.js} +1 -1
  95. package/dist/client/assets/{monaco-editor-BmBsVL_8.js → monaco-editor-CUPj5vIp.js} +1 -1
  96. package/dist/client/assets/{monitoring-stats-row-BdLsHbqc.js → monitoring-stats-row-XQB01weB.js} +1 -1
  97. package/dist/client/assets/{oauth-callback-Cz-iMFvk.js → oauth-callback-DAM5kjkH.js} +1 -1
  98. package/dist/client/assets/{oauth-callback-ai-provider-D5sARU9m.js → oauth-callback-ai-provider-CgCOlJOy.js} +1 -1
  99. package/dist/client/assets/{onboarding-B2dI9ERG.js → onboarding-Bnm_Mvex.js} +1 -1
  100. package/dist/client/assets/{org-layout-CBC7ZhZm.js → org-layout-BiIo7gdP.js} +1 -1
  101. package/dist/client/assets/{org-plugin-layout-DHZ0k56l.js → org-plugin-layout-DVNl6fGB.js} +1 -1
  102. package/dist/client/assets/{pair-CAi6xFSC.js → pair-p9PlaPJZ.js} +1 -1
  103. package/dist/client/assets/{plugin-empty-state-DcHczrca.js → plugin-empty-state-BHGFWrS6.js} +1 -1
  104. package/dist/client/assets/{plugin-header-gaZYNLeh.js → plugin-header-C88P-tJ2.js} +1 -1
  105. package/dist/client/assets/{plugin-layout-CvwzX9Qn.js → plugin-layout-CPcZP-wA.js} +1 -1
  106. package/dist/client/assets/{popover-LcCFPFES.js → popover-hf7ez2k5.js} +1 -1
  107. package/dist/client/assets/{profile-BKiR8aSR.js → profile-uzdVVreG.js} +1 -1
  108. package/dist/client/assets/{project-app-view-CJDnIq_9.js → project-app-view-B4nmS6jh.js} +1 -1
  109. package/dist/client/assets/registry-I671gV-G.js +2 -0
  110. package/dist/client/assets/{registry-layout-Cx01KKyS.js → registry-layout-B5xsewRT.js} +1 -1
  111. package/dist/client/assets/{required-auth-layout-Af4UnFi9.js → required-auth-layout-RFd7feEO.js} +1 -1
  112. package/dist/client/assets/{reset-password-BLW7KDI7.js → reset-password-CbMcBO3_.js} +1 -1
  113. package/dist/client/assets/{roles-CNktySuz.js → roles-CgmOYqeB.js} +1 -1
  114. package/dist/client/assets/{scroll-area-BXZ-RbOr.js → scroll-area-CrjN_Hq8.js} +1 -1
  115. package/dist/client/assets/{search-input-BNNV_F6W.js → search-input-BZfc8yTM.js} +1 -1
  116. package/dist/client/assets/{select-DBYBPYY4.js → select-CA9lAVeD.js} +1 -1
  117. package/dist/client/assets/{select-model-CG6HX7bQ.js → select-model-BiPcTGeY.js} +1 -1
  118. package/dist/client/assets/settings-layout-CsjaaAqj.js +1 -0
  119. package/dist/client/assets/{settings-section-B0-S604v.js → settings-section-DcVCikhP.js} +1 -1
  120. package/dist/client/assets/{shell-layout-DKPO37-r.js → shell-layout-D41q7TUN.js} +1 -1
  121. package/dist/client/assets/{skeleton-CrRFtQk0.js → skeleton-Bxpym_Gl.js} +1 -1
  122. package/dist/client/assets/{sso-Bwxm1t61.js → sso-DSPKPWpY.js} +1 -1
  123. package/dist/client/assets/{store-CUewbtbE.js → store-DgqqCI-B.js} +1 -1
  124. package/dist/client/assets/store-registry-hbLzXl0Q.js +2 -0
  125. package/dist/client/assets/{switch-Bwaq8U3c.js → switch-ImKL-UKs.js} +1 -1
  126. package/dist/client/assets/{table-CuBz05JY.js → table-CFZfbeur.js} +1 -1
  127. package/dist/client/assets/{tabs-CFK-4Uvj.js → tabs-Bddmkcqy.js} +1 -1
  128. package/dist/client/assets/{task-status-BsG941tf.js → task-status-1Al2XVQW.js} +1 -1
  129. package/dist/client/assets/{textarea-D7eHvlow.js → textarea-CEA097ZL.js} +1 -1
  130. package/dist/client/assets/{toggle-group-K9WiqSuu.js → toggle-group-21elv4kU.js} +1 -1
  131. package/dist/client/assets/{tools-list-hCGHW9Jl.js → tools-list-Db3JaZBE.js} +1 -1
  132. package/dist/client/assets/{tooltip-CdOJqDy5.js → tooltip-fcHRVDrd.js} +1 -1
  133. package/dist/client/assets/{types-C-mEWZM_.js → types-B9VkwcjF.js} +1 -1
  134. package/dist/client/assets/{use-ai-providers-CLe9OJ_9.js → use-ai-providers-8HO1qKzj.js} +1 -1
  135. package/dist/client/assets/{use-collections-JK0nrhOu.js → use-collections-CmgBwDnE.js} +1 -1
  136. package/dist/client/assets/{use-connection-B5nKWk3Z.js → use-connection-8YOBtIES.js} +1 -1
  137. package/dist/client/assets/{use-copy-EJp5-EOo.js → use-copy-DVbfqYMO.js} +1 -1
  138. package/dist/client/assets/{use-create-virtual-mcp-Q_F8SKCO.js → use-create-virtual-mcp-Ca9QljzN.js} +1 -1
  139. package/dist/client/assets/{use-debounced-autosave-Batv9_51.js → use-debounced-autosave-cQTtzsd7.js} +1 -1
  140. package/dist/client/assets/{use-decopilot-events-CeWCSdOD.js → use-decopilot-events-26nqmOvd.js} +1 -1
  141. package/dist/client/assets/{use-delete-connection-CkxuXNRZ.js → use-delete-connection-DEcCmCjL.js} +1 -1
  142. package/dist/client/assets/{use-infinite-scroll-F6JWUz0y.js → use-infinite-scroll-CFQcQKUz.js} +1 -1
  143. package/dist/client/assets/{use-list-state-CwvWCBhv.js → use-list-state-BPQXkEh5.js} +1 -1
  144. package/dist/client/assets/{use-mcp-tools-DVxd_j8t.js → use-mcp-tools-BZuO59Lt.js} +1 -1
  145. package/dist/client/assets/{use-members-kfmfVai8.js → use-members-Do2-W9GA.js} +1 -1
  146. package/dist/client/assets/{use-navigate-to-agent-CmO0cf8k.js → use-navigate-to-agent-DlRLMfOu.js} +1 -1
  147. package/dist/client/assets/{use-org-auth-client-DahzRa45.js → use-org-auth-client-BMdZmMRF.js} +1 -1
  148. package/dist/client/assets/{use-org-sso-q2q8U5Lz.js → use-org-sso-DUJrkZrg.js} +1 -1
  149. package/dist/client/assets/{use-organization-roles-DxoRIw_w.js → use-organization-roles-BmET_l7M.js} +1 -1
  150. package/dist/client/assets/{use-organization-settings-VQvWdDuI.js → use-organization-settings-B0QeyHfe.js} +1 -1
  151. package/dist/client/assets/{use-registry-connections-D_xn2bCS.js → use-registry-connections-BJWiXnMJ.js} +1 -1
  152. package/dist/client/assets/{use-status-sounds-B0UgOSIP.js → use-status-sounds-BXM6Nr3u.js} +1 -1
  153. package/dist/client/assets/{use-tasks-CSnCGk4W.js → use-tasks-13l0Myf2.js} +1 -1
  154. package/dist/client/assets/{use-view-mode-CIjwNrGA.js → use-view-mode-37XWNqWL.js} +1 -1
  155. package/dist/client/assets/{use-virtual-mcp-BoDRyRzA.js → use-virtual-mcp-DDtoeNWN.js} +1 -1
  156. package/dist/client/assets/useInfiniteQuery-BcXAPLQ9.js +1 -0
  157. package/dist/client/assets/useSuspenseInfiniteQuery-rSWjylTj.js +1 -0
  158. package/dist/client/assets/{user-BZxSHSfd.js → user-Cs3QR2-O.js} +1 -1
  159. package/dist/client/assets/{view-mode-toggle-ChqhIYbZ.js → view-mode-toggle-OExNqfwD.js} +1 -1
  160. package/dist/client/assets/{workflow-QOiCAn4W.js → workflow-BGNjbF_Q.js} +1 -1
  161. package/dist/client/assets/workflow-detail-Bu26I_xz.js +1 -0
  162. package/dist/client/index.html +2 -2
  163. package/dist/client/manifest.webmanifest +1 -0
  164. package/dist/server/cli.js +1 -1
  165. package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
  166. package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
  167. package/dist/server/node_modules/is-fullwidth-code-point/license +9 -0
  168. package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
  169. package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
  170. package/package.json +1 -1
  171. package/dist/client/assets/ai-providers-CPD083hB.js +0 -1
  172. package/dist/client/assets/index-BKEC_fM2.js +0 -1
  173. package/dist/client/assets/index-B_4-KoG_.css +0 -1
  174. package/dist/client/assets/index-DHf5lGYs.js +0 -1
  175. package/dist/client/assets/registry-CW84oX2Y.js +0 -2
  176. package/dist/client/assets/settings-layout-DCSUHSAI.js +0 -1
  177. package/dist/client/assets/store-registry-CGpSuJSg.js +0 -2
  178. package/dist/client/assets/useInfiniteQuery-BdN7n6zj.js +0 -1
  179. package/dist/client/assets/useSuspenseInfiniteQuery-DAeYCHoW.js +0 -1
  180. package/dist/client/assets/workflow-detail-CfhhVDGj.js +0 -1
  181. package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
  182. package/dist/server/node_modules/postgres-array/index.js +0 -97
  183. package/dist/server/node_modules/postgres-array/license +0 -21
  184. package/dist/server/node_modules/postgres-array/package.json +0 -35
  185. package/dist/server/node_modules/postgres-array/readme.md +0 -43
  186. package/dist/server/node_modules/postgres-bytea/index.js +0 -33
  187. package/dist/server/node_modules/postgres-bytea/license +0 -21
  188. package/dist/server/node_modules/postgres-bytea/package.json +0 -34
  189. package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
  190. package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
  191. package/dist/server/node_modules/postgres-interval/index.js +0 -125
  192. package/dist/server/node_modules/postgres-interval/license +0 -21
  193. package/dist/server/node_modules/postgres-interval/package.json +0 -36
  194. package/dist/server/node_modules/postgres-interval/readme.md +0 -48
  195. package/dist/server/node_modules/split2/LICENSE +0 -13
  196. package/dist/server/node_modules/split2/README.md +0 -85
  197. package/dist/server/node_modules/split2/bench.js +0 -27
  198. package/dist/server/node_modules/split2/index.js +0 -141
  199. package/dist/server/node_modules/split2/package.json +0 -39
  200. package/dist/server/node_modules/split2/test.js +0 -409
@@ -1 +1 @@
1
- import{e as b,s as k,o as E,bM as P,j as i,X as K,aG as _,K as S,x as q}from"./index-BZOcmiWe.js";import{P as x}from"./index-B5iHWh5E.js";import{d as I}from"./use-organization-settings-VQvWdDuI.js";import{S as Q}from"./switch-Bwaq8U3c.js";import{n as R}from"./Container-BOvWwKV4.js";import{b as w,S as z,a as F,d as M}from"./settings-section-B0-S604v.js";import"./tooltip-CdOJqDy5.js";import"./X-Y4H2YxIf.js";import"./constants-DULkH_5i.js";import"./card-CmdabgMS.js";import"./ArrowUpRight-Dp3G1ifa.js";function N(){const e=b.c(17),{org:t,project:s}=k(),o=E();let u;e[0]!==s.enabledPlugins?(u=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=u):u=e[1];const c=u,l=I();let m;e[2]!==t||e[3]!==s.slug||e[4]!==o?(m=()=>{o.invalidateQueries({queryKey:S.project(t.id,s.slug)}),o.invalidateQueries({queryKey:S.projects(t.id)}),o.invalidateQueries({predicate:n=>{const r=n.queryKey;return r[1]===t.id&&r[3]==="collection"&&r[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=o,e[5]=m):m=e[5];const j=m;let g;e[6]!==j||e[7]!==l||e[8]!==c?(g=(n,r)=>{const d=new Set(c);r?d.add(n):d.delete(n),l.mutate({enabled_plugins:Array.from(d)},{onSuccess:j,onError:A})},e[6]=j,e[7]=l,e[8]=c,e[9]=g):g=e[9];const p=g,y=$,C=U;if(P.length===0){let n;return e[10]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=n):n=e[10],n}let a;e[11]!==p||e[12]!==l||e[13]!==c?(a=P.map(n=>{const r=y(n.id),d=C(n.id),h=c.includes(n.id);return i.jsx(w,{title:r?.label??n.id,description:d??void 0,icon:i.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:r?.icon??i.jsx(R,{size:14})}),onClick:()=>!l.isPending&&p(n.id,!h),action:i.jsx(Q,{checked:h,onCheckedChange:v=>p(n.id,v),disabled:l.isPending,onClick:T})},n.id)}),e[11]=p,e[12]=l,e[13]=c,e[14]=a):a=e[14];let f;return e[15]!==a?(f=i.jsx(z,{children:i.jsx(F,{children:a})}),e[15]=a,e[16]=f):f=e[16],f}function T(e){return e.stopPropagation()}function U(e){return P.find(s=>s.id===e)?.description??null}function $(e){const t=K.find(o=>o.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=_.find(o=>o.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function A(e){q.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function D(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(x,{children:i.jsx(x.Content,{children:i.jsx(x.Body,{children:i.jsxs(M,{children:[i.jsx(x.Title,{children:"Plugins"}),i.jsx(N,{})]})})})}),e[0]=t):t=e[0],t}function ee(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(D,{}),e[0]=t):t=e[0],t}export{ee as default};
1
+ import{e as b,s as k,o as E,bM as P,j as i,X as K,aG as _,K as S,x as q}from"./index-CuZfM_Nx.js";import{P as x}from"./index-BQ5t2bfi.js";import{d as I}from"./use-organization-settings-B0QeyHfe.js";import{S as Q}from"./switch-ImKL-UKs.js";import{n as R}from"./Container-BFBDXadT.js";import{b as w,S as z,a as F,d as M}from"./settings-section-DcVCikhP.js";import"./tooltip-fcHRVDrd.js";import"./X-Cv85QSif.js";import"./constants-d6_CHL4E.js";import"./card-Cc_5Nm4i.js";import"./ArrowUpRight-CVt-dZIr.js";function N(){const e=b.c(17),{org:t,project:s}=k(),o=E();let u;e[0]!==s.enabledPlugins?(u=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=u):u=e[1];const c=u,l=I();let m;e[2]!==t||e[3]!==s.slug||e[4]!==o?(m=()=>{o.invalidateQueries({queryKey:S.project(t.id,s.slug)}),o.invalidateQueries({queryKey:S.projects(t.id)}),o.invalidateQueries({predicate:n=>{const r=n.queryKey;return r[1]===t.id&&r[3]==="collection"&&r[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=o,e[5]=m):m=e[5];const j=m;let g;e[6]!==j||e[7]!==l||e[8]!==c?(g=(n,r)=>{const d=new Set(c);r?d.add(n):d.delete(n),l.mutate({enabled_plugins:Array.from(d)},{onSuccess:j,onError:A})},e[6]=j,e[7]=l,e[8]=c,e[9]=g):g=e[9];const p=g,y=$,C=U;if(P.length===0){let n;return e[10]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=n):n=e[10],n}let a;e[11]!==p||e[12]!==l||e[13]!==c?(a=P.map(n=>{const r=y(n.id),d=C(n.id),h=c.includes(n.id);return i.jsx(w,{title:r?.label??n.id,description:d??void 0,icon:i.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:r?.icon??i.jsx(R,{size:14})}),onClick:()=>!l.isPending&&p(n.id,!h),action:i.jsx(Q,{checked:h,onCheckedChange:v=>p(n.id,v),disabled:l.isPending,onClick:T})},n.id)}),e[11]=p,e[12]=l,e[13]=c,e[14]=a):a=e[14];let f;return e[15]!==a?(f=i.jsx(z,{children:i.jsx(F,{children:a})}),e[15]=a,e[16]=f):f=e[16],f}function T(e){return e.stopPropagation()}function U(e){return P.find(s=>s.id===e)?.description??null}function $(e){const t=K.find(o=>o.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=_.find(o=>o.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function A(e){q.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function D(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(x,{children:i.jsx(x.Content,{children:i.jsx(x.Body,{children:i.jsxs(M,{children:[i.jsx(x.Title,{children:"Plugins"}),i.jsx(N,{})]})})})}),e[0]=t):t=e[0],t}function ee(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(D,{}),e[0]=t):t=e[0],t}export{ee as default};
@@ -1 +1 @@
1
- import{bW as b,e as f,j as c,D as C,r as d,c as p,aY as j,bX as v,bY as h}from"./index-BZOcmiWe.js";import{L as N}from"./label-B-_20bUy.js";const E=b,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(C,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(j,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,y as e,R as f};
1
+ import{bW as b,e as f,j as c,D as C,r as d,c as p,aY as j,bX as v,bY as h}from"./index-CuZfM_Nx.js";import{L as N}from"./label-0qGP76Je.js";const E=b,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(C,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(j,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,y as e,R as f};
@@ -1 +1 @@
1
- import{f as re,s as ce,o as de,z as me,C as ue,a as fe,t as Y,x as K,K as te,j as s,D as se,H as ge,J as W,e as $,r as H,B as G,c as xe,M as pe}from"./index-BZOcmiWe.js";import{P as V}from"./index-B5iHWh5E.js";import{u as he}from"./use-org-auth-client-DahzRa45.js";import{u as je}from"./use-debounced-autosave-Batv9_51.js";import{A as be}from"./avatar-C5CAYMYh.js";import{I as ve}from"./input-CrpFSP0W.js";import{S as X,a as Z,b as Q,c as Se,d as ye}from"./settings-section-B0-S604v.js";import{D as Ne}from"./domain-settings-Zmfq2b2Q.js";import{u as Ce,a as ne,D as we,c as _e,S as ze,v as De,K as Ae,P as Pe,d as ke,C as Ie,s as Ee,b as Te,e as Oe}from"./collection-search-CtXh96Gm.js";import{W as ee,i as Re}from"./constants-DULkH_5i.js";import{b as le}from"./use-virtual-mcp-BoDRyRzA.js";import{b as Le,P as $e,a as Fe}from"./popover-LcCFPFES.js";import{S as Me}from"./skeleton-CrRFtQk0.js";import{y as Be}from"./agent-icon-Tpw3Xml_.js";import{s as He}from"./Plus-DyrPdLFx.js";import{a as ae}from"./Users03-FLHuEcPu.js";import{i as Ke}from"./X-Y4H2YxIf.js";import{I as J}from"./integration-icon-CVmwF3_e.js";import{u as Ue,c as qe}from"./use-organization-settings-VQvWdDuI.js";import"./tooltip-CdOJqDy5.js";import"./User01-CBFfH1NO.js";import"./card-CmdabgMS.js";import"./ArrowUpRight-Dp3G1ifa.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-Bwaq8U3c.js";import"./SearchMd-Xtv0xaPE.js";import"./use-collections-JK0nrhOu.js";import"./AlertCircle-D5P-n_4t.js";import"./Tool01-Ce_Me7cD.js";import"./XClose-Dz62x8sU.js";import"./RefreshCcw01-CGNxI6Ck.js";import"./ArrowNarrowLeft-Cei5z2C8.js";import"./XCircle-ABCC_xEK.js";import"./ZapSquare-rh7PDy43.js";import"./CheckCircle-CAevZeBb.js";import"./Check-CHUfypwG.js";import"./ChevronDown-DGxIrQou.js";import"./ChevronRight-D0NO-NBa.js";import"./ChevronUp-R3D-J8U2.js";import"./DotsVertical-rqLS7JIj.js";import"./Container-BOvWwKV4.js";import"./Star01-BuYjjFhM.js";import"./Palette-DFI0YLk6.js";import"./LinkExternal01-BAOljpRH.js";import"./Lock01-D8HWIvFW.js";import"./Sun-C-z27smq.js";import"./Play-CI6lv5t3.js";import"./Settings02-CJ_7W7Nn.js";import"./Shield01-C53xx91N.js";import"./Trash01-Q2vImoqI.js";import"./Zap-XI7LaIzu.js";const Ve=ge({name:W().min(1,"Name is required").max(255,"Name is too long"),slug:W().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:W().optional()});function Ge(t){const e=$.c(13),{value:a,onChange:l,name:r,disabled:d}=t,n=H.useRef(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=()=>n.current?.click(),e[0]=h):h=e[0];const m=h;let b;e[1]!==l?(b=z=>{const x=z.target.files?.[0];if(!x)return;if(x.size>2097152){K.error("Image must be smaller than 2MB");return}const v=new FileReader;v.onerror=We,v.onloadend=()=>{v.result&&l(v.result),n.current&&(n.current.value="")},v.readAsDataURL(x)},e[1]=l,e[2]=b):b=e[2];const o=b;let i;e[3]!==d||e[4]!==o?(i=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:d}),e[3]=d,e[4]=o,e[5]=i):i=e[5];const u=a||void 0,j=r??"?";let f;e[6]!==u||e[7]!==j?(f=s.jsx(be,{url:u,fallback:j,shape:"square",size:"base"}),e[6]=u,e[7]=j,e[8]=f):f=e[8];let g;return e[9]!==d||e[10]!==i||e[11]!==f?(g=s.jsxs("button",{type:"button",onClick:m,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[i,f]}),e[9]=d,e[10]=i,e[11]=f,e[12]=g):g=e[12],g}function We(){return K.error("Failed to read image")}function Qe(){const t=re(),{org:e}=ce(),a=he(),l=de(),r=me({resolver:ue(Ve),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),d=fe({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo&&(i.logo=o.logo);const u=await a.organization.update({data:i});if(u?.error)throw new Error(u.error.message||"Failed to update organization");return u},onSuccess:(o,i)=>{Y("organization_settings_updated",{organization_id:e.id,fields:Object.keys(i)}),l.invalidateQueries({queryKey:te.organizations()}),l.invalidateQueries({queryKey:te.activeOrganization(e.slug)}),o?.data?.slug&&o.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:(o,i)=>{Y("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(i),error:o instanceof Error?o.message:String(o)}),K.error(o instanceof Error?o.message:"Failed to update organization")}}),{schedule:n,flush:h}=je({save:async()=>{!r.formState.isDirty||!await r.trigger()||await d.mutateAsync(r.getValues())}}),m=r.formState.errors,b=typeof window<"u"?`${window.location.host}/`:"";return s.jsx(X,{children:s.jsxs(Z,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(Ge,{value:r.watch("logo"),onChange:o=>{r.setValue("logo",o??"",{shouldDirty:!0}),h()},name:r.watch("name")})}),s.jsx(Q,{title:"Name",action:s.jsx(se,{control:r.control,name:"name",render:({field:o})=>s.jsx(ve,{id:"org-name",...o,onChange:i=>{o.onChange(i),n()},onBlur:()=>{o.onBlur(),h()},placeholder:"Organization name",className:"w-[280px]"})})}),s.jsx(Q,{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:[b&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:b}),s.jsx(se,{control:r.control,name:"slug",render:({field:o})=>s.jsx("input",{id:"org-slug",value:o.value??"",name:o.name,ref:o.ref,placeholder:"my-organization",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:i=>{const u=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");r.setValue("slug",u,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),n()},onBlur:()=>{o.onBlur(),h()}})})]})}),(m.name||m.slug||m.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[m.name&&s.jsx("p",{className:"text-xs text-destructive",children:m.name.message}),m.slug&&s.jsx("p",{className:"text-xs text-destructive",children:m.slug.message}),m.logo&&s.jsx("p",{className:"text-xs text-destructive",children:m.logo.message})]})]})})}const oe=["site-editor","site-diagnostics","ai-image","ai-research"],ie=8;function Ye(t,e,a){const l=e.find(d=>d.id===t);if(l)return{id:l.id,title:l.title,icon:l.icon,kind:"template"};const r=a.find(d=>d.id===t);return r?{id:t,title:r.title,icon:r.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function Je(t){const e=$.c(39),{agent:a,onRemove:l}=t;let r;e[0]!==a.id?(r={id:a.id},e[0]=a.id,e[1]=r):r=e[1];const{attributes:d,listeners:n,setNodeRef:h,transform:m,transition:b,isDragging:o}=ke(r);let i;e[2]!==m?(i=Ie.Transform.toString(m),e[2]=m,e[3]=i):i=e[3];const u=o?.5:void 0,j=o?100:void 0;let f;e[4]!==i||e[5]!==u||e[6]!==j||e[7]!==b?(f={transform:i,transition:b,opacity:u,zIndex:j},e[4]=i,e[5]=u,e[6]=j,e[7]=b,e[8]=f):f=e[8];const g=f,z=o&&"shadow-lg";let x;e[9]!==z?(x=xe("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",z),e[9]=z,e[10]=x):x=e[10];const v=`Drag to reorder ${a.title}`;let D;e[11]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Be,{size:14}),e[11]=D):D=e[11];let k;e[12]!==d||e[13]!==n||e[14]!==v?(k=s.jsx("button",{type:"button",...d,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":v,children:D}),e[12]=d,e[13]=n,e[14]=v,e[15]=k):k=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ae,{size:14}),e[16]=N):N=e[16];let w;e[17]!==a.icon||e[18]!==a.title?(w=s.jsx(J,{icon:a.icon,name:a.title,size:"xs",fallbackIcon:N}),e[17]=a.icon,e[18]=a.title,e[19]=w):w=e[19];let S;e[20]!==a.title?(S=s.jsx("span",{className:"text-sm text-foreground truncate",children:a.title}),e[20]=a.title,e[21]=S):S=e[21];const _=a.kind==="template"?"Template":a.kind==="custom"?"Custom agent":"Unavailable";let p;e[22]!==_?(p=s.jsx("span",{className:"text-xs text-muted-foreground",children:_}),e[22]=_,e[23]=p):p=e[23];let y;e[24]!==S||e[25]!==p?(y=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[S,p]}),e[24]=S,e[25]=p,e[26]=y):y=e[26];const I=`Remove ${a.title}`;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ke,{size:14}),e[27]=A):A=e[27];let C;e[28]!==l||e[29]!==I?(C=s.jsx("button",{type:"button",onClick:l,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":I,children:A}),e[28]=l,e[29]=I,e[30]=C):C=e[30];let P;return e[31]!==h||e[32]!==g||e[33]!==k||e[34]!==w||e[35]!==y||e[36]!==C||e[37]!==x?(P=s.jsxs("div",{ref:h,style:g,className:x,children:[k,w,y,C]}),e[31]=h,e[32]=g,e[33]=k,e[34]=w,e[35]=y,e[36]=C,e[37]=x,e[38]=P):P=e[38],P}function Xe(t){const e=$.c(48),{selectedIds:a,onAdd:l}=t,[r,d]=H.useState(!1),[n,h]=H.useState(""),m=le();let b;e[0]!==a?(b=new Set(a),e[0]=a,e[1]=b):b=e[1];const o=b;let i,u,j,f,g,z,x,v,D,k,N,w,S;if(e[2]!==m||e[3]!==l||e[4]!==r||e[5]!==n||e[6]!==o){const A=n.toLowerCase();f=ee.filter(c=>!o.has(c.id)&&(!n||c.title.toLowerCase().includes(A)));let C;e[20]!==o?(C=c=>c.id!==null&&!Re(c.id)&&!o.has(c.id),e[20]=o,e[21]=C):C=e[21],j=m.filter(C).filter(c=>!n||c.title.toLowerCase().includes(A));let P;e[22]!==l?(P=c=>{l(c),d(!1),h("")},e[22]=l,e[23]=P):P=e[23];const T=P;u=Le,w=r,S=d,e[24]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx($e,{asChild:!0,children:s.jsxs(G,{type:"button",variant:"outline",size:"sm",children:[s.jsx(He,{size:14}),"Add agent"]})}),e[24]=g):g=e[24],i=Fe,D="w-[320px] p-0 overflow-hidden",k="start",e[25]!==n?(N=s.jsx(Oe,{value:n,onChange:h,placeholder:"Search agents..."}),e[25]=n,e[26]=N):N=e[26],z="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",x=f.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"}),f.map(c=>s.jsxs("button",{type:"button",onClick:()=>T(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:c.icon,name:c.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),v=j.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"}),j.map(c=>s.jsxs("button",{type:"button",onClick:()=>T(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:c.icon,name:c.title,size:"xs",fallbackIcon:s.jsx(ae,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),e[2]=m,e[3]=l,e[4]=r,e[5]=n,e[6]=o,e[7]=i,e[8]=u,e[9]=j,e[10]=f,e[11]=g,e[12]=z,e[13]=x,e[14]=v,e[15]=D,e[16]=k,e[17]=N,e[18]=w,e[19]=S}else i=e[7],u=e[8],j=e[9],f=e[10],g=e[11],z=e[12],x=e[13],v=e[14],D=e[15],k=e[16],N=e[17],w=e[18],S=e[19];let _;e[27]!==j||e[28]!==f.length||e[29]!==n?(_=f.length===0&&j.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]=j,e[28]=f.length,e[29]=n,e[30]=_):_=e[30];let p;e[31]!==_||e[32]!==z||e[33]!==x||e[34]!==v?(p=s.jsxs("div",{className:z,children:[x,v,_]}),e[31]=_,e[32]=z,e[33]=x,e[34]=v,e[35]=p):p=e[35];let y;e[36]!==i||e[37]!==p||e[38]!==D||e[39]!==k||e[40]!==N?(y=s.jsxs(i,{className:D,align:k,children:[N,p]}),e[36]=i,e[37]=p,e[38]=D,e[39]=k,e[40]=N,e[41]=y):y=e[41];let I;return e[42]!==u||e[43]!==g||e[44]!==y||e[45]!==w||e[46]!==S?(I=s.jsxs(u,{open:w,onOpenChange:S,children:[g,y]}),e[42]=u,e[43]=g,e[44]=y,e[45]=w,e[46]=S,e[47]=I):I=e[47],I}function Ze(){const t=$.c(61),e=Ue(),a=le(),l=qe();let r;t[0]!==e?.ids?(r=e?.ids??[...oe],t[0]=e?.ids,t[1]=r):r=t[1];const d=r,[n,h]=H.useState(d);let m;t[2]!==n||t[3]!==d?(m=n.length!==d.length||n.some((E,O)=>E!==d[O]),t[2]=n,t[3]=d,t[4]=m):m=t[4];const b=m;let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o={activationConstraint:{distance:5}},t[5]=o):o=t[5];let i;t[6]===Symbol.for("react.memo_cache_sentinel")?(i={coordinateGetter:Ee},t[6]=i):i=t[6];const u=Ce(ne(Pe,o),ne(Ae,i));let j;t[7]!==n?(j=E=>{const{active:O,over:R}=E;if(!R||O.id===R.id)return;const L=n.indexOf(O.id),q=n.indexOf(R.id);L===-1||q===-1||h(Te([...n],L,q))},t[7]=n,t[8]=j):j=t[8];const f=j;let g;t[9]!==n?(g=E=>{n.includes(E)||h([...n,E])},t[9]=n,t[10]=g):g=t[10];const z=g;let x;t[11]!==n?(x=E=>{h(n.filter(O=>O!==E))},t[11]=n,t[12]=x):x=t[12];const v=x;let D;t[13]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{h([...oe])},t[13]=D):D=t[13];const k=D;let N;t[14]!==n||t[15]!==l?(N=()=>{l.mutate({ids:n},{onSuccess:()=>{Y("default_home_agents_updated",{count:n.length,template_count:n.filter(tt).length}),K.success("Default home agents updated")},onError:et})},t[14]=n,t[15]=l,t[16]=N):N=t[16];const w=N;let S,_,p,y,I,A,C;if(t[17]!==a||t[18]!==n||t[19]!==f||t[20]!==v||t[21]!==u||t[22]!==l.isPending){let E;t[30]!==a?(E=L=>Ye(L,ee,a),t[30]=a,t[31]=E):E=t[31];const O=n.map(E);p=Math.max(0,n.length-ie),_=X,I="Default home agents";let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(pe,{size:14}),t[32]=R):R=t[32],t[33]!==l.isPending?(A=s.jsxs(G,{type:"button",variant:"ghost",size:"sm",onClick:k,disabled:l.isPending,children:[R,"Reset defaults"]}),t[33]=l.isPending,t[34]=A):A=t[34],S=Z,C="px-5 py-5 flex flex-col gap-3",y=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(we,{sensors:u,collisionDetection:_e,onDragEnd:f,children:s.jsx(ze,{items:n,strategy:De,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:O.map((L,q)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q===ie&&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(Je,{agent:L,onRemove:()=>v(L.id)})]},L.id))})})}),t[17]=a,t[18]=n,t[19]=f,t[20]=v,t[21]=u,t[22]=l.isPending,t[23]=S,t[24]=_,t[25]=p,t[26]=y,t[27]=I,t[28]=A,t[29]=C}else S=t[23],_=t[24],p=t[25],y=t[26],I=t[27],A=t[28],C=t[29];let P;t[35]!==n||t[36]!==z?(P=s.jsx(Xe,{selectedIds:n,onAdd:z}),t[35]=n,t[36]=z,t[37]=P):P=t[37];let T;t[38]!==p?(T=p>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[p," agent",p===1?"":"s"," won't fit on the home view"]}),t[38]=p,t[39]=T):T=t[39];let c;t[40]!==P||t[41]!==T?(c=s.jsxs("div",{className:"flex items-center justify-between",children:[P,T]}),t[40]=P,t[41]=T,t[42]=c):c=t[42];let F;t[43]!==y||t[44]!==c||t[45]!==C?(F=s.jsxs("div",{className:C,children:[y,c]}),t[43]=y,t[44]=c,t[45]=C,t[46]=F):F=t[46];let M;t[47]!==w||t[48]!==d||t[49]!==b||t[50]!==l.isPending?(M=b&&s.jsxs(Se,{children:[s.jsx(G,{type:"button",variant:"outline",onClick:()=>h(d),disabled:l.isPending,children:"Cancel"}),s.jsx(G,{type:"button",onClick:w,disabled:l.isPending,children:l.isPending?"Saving…":"Save"})]}),t[47]=w,t[48]=d,t[49]=b,t[50]=l.isPending,t[51]=M):M=t[51];let B;t[52]!==S||t[53]!==F||t[54]!==M?(B=s.jsxs(S,{children:[F,M]}),t[52]=S,t[53]=F,t[54]=M,t[55]=B):B=t[55];let U;return t[56]!==_||t[57]!==I||t[58]!==A||t[59]!==B?(U=s.jsx(_,{title:I,actions:A,children:B}),t[56]=_,t[57]=I,t[58]=A,t[59]=B,t[60]=U):U=t[60],U}function et(t){K.error(t instanceof Error?t.message:"Failed to update default home agents")}function tt(t){return ee.some(e=>e.id===t)}function st(){const t=$.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(nt)})})}),t[0]=e):e=t[0],e}function nt(t,e){return s.jsx(Me,{className:"h-12 w-full rounded-lg"},e)}function ot(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(H.Suspense,{fallback:s.jsx(st,{}),children:s.jsx(Ze,{})}),t[0]=e):e=t[0],e}function it(){const t=$.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(ye,{children:[s.jsx(V.Title,{children:"Organization"}),s.jsx(Qe,{}),s.jsx(Ne,{}),s.jsx(ot,{})]})})})}),t[0]=e):e=t[0],e}function ns(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(it,{}),t[0]=e):e=t[0],e}export{ns as default};
1
+ import{f as re,s as ce,o as de,z as me,C as ue,a as fe,t as Y,x as K,K as te,j as s,D as se,H as ge,J as W,e as $,r as H,B as G,c as xe,M as pe}from"./index-CuZfM_Nx.js";import{P as V}from"./index-BQ5t2bfi.js";import{u as he}from"./use-org-auth-client-BMdZmMRF.js";import{u as je}from"./use-debounced-autosave-cQTtzsd7.js";import{A as be}from"./avatar-B0e9QGvS.js";import{I as ve}from"./input-C_nPAOp-.js";import{S as X,a as Z,b as Q,c as Se,d as ye}from"./settings-section-DcVCikhP.js";import{D as Ne}from"./domain-settings-Ci3-H3BP.js";import{u as Ce,a as ne,D as we,c as _e,S as ze,v as De,K as Ae,P as Pe,d as ke,C as Ie,s as Ee,b as Te,e as Oe}from"./collection-search-xvNZDMEo.js";import{W as ee,i as Re}from"./constants-d6_CHL4E.js";import{b as le}from"./use-virtual-mcp-DDtoeNWN.js";import{b as Le,P as $e,a as Fe}from"./popover-hf7ez2k5.js";import{S as Me}from"./skeleton-Bxpym_Gl.js";import{y as Be}from"./agent-icon-BzMmOj78.js";import{s as He}from"./Plus-B6kqhltR.js";import{a as ae}from"./Users03-D0nK5Csa.js";import{i as Ke}from"./X-Cv85QSif.js";import{I as J}from"./integration-icon-DFF86wgE.js";import{u as Ue,c as qe}from"./use-organization-settings-B0QeyHfe.js";import"./tooltip-fcHRVDrd.js";import"./User01-axhJYAi5.js";import"./card-Cc_5Nm4i.js";import"./ArrowUpRight-CVt-dZIr.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-ImKL-UKs.js";import"./SearchMd-CEcDQ6LC.js";import"./use-collections-CmgBwDnE.js";import"./AlertCircle-DbSc8_5o.js";import"./Tool01-CcxU2xyo.js";import"./XClose-CxIHxCiH.js";import"./RefreshCcw01-C_zk4Try.js";import"./ArrowNarrowLeft-BzM32upt.js";import"./XCircle-DJCAtDKC.js";import"./ZapSquare-DtiK8wdw.js";import"./CheckCircle-BQeGxZq_.js";import"./Check-DrgiOcvX.js";import"./ChevronDown-C7syIVEM.js";import"./ChevronRight-BVkmPfkJ.js";import"./ChevronUp-DgBvNG-s.js";import"./DotsVertical-DullXRlj.js";import"./Container-BFBDXadT.js";import"./Star01-CcI10YS1.js";import"./Palette-D8RZYE5o.js";import"./LinkExternal01-eYI9rzDs.js";import"./Lock01-CHD9ynDw.js";import"./Sun-D2L-I4uV.js";import"./Play-DRFVE1h5.js";import"./Settings02-Kj5D6IOr.js";import"./Shield01-3u2o5WX2.js";import"./Trash01-oWeyeakM.js";import"./Zap-C4uL-K8p.js";const Ve=ge({name:W().min(1,"Name is required").max(255,"Name is too long"),slug:W().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:W().optional()});function Ge(t){const e=$.c(13),{value:a,onChange:l,name:r,disabled:d}=t,n=H.useRef(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=()=>n.current?.click(),e[0]=h):h=e[0];const m=h;let b;e[1]!==l?(b=z=>{const x=z.target.files?.[0];if(!x)return;if(x.size>2097152){K.error("Image must be smaller than 2MB");return}const v=new FileReader;v.onerror=We,v.onloadend=()=>{v.result&&l(v.result),n.current&&(n.current.value="")},v.readAsDataURL(x)},e[1]=l,e[2]=b):b=e[2];const o=b;let i;e[3]!==d||e[4]!==o?(i=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:d}),e[3]=d,e[4]=o,e[5]=i):i=e[5];const u=a||void 0,j=r??"?";let f;e[6]!==u||e[7]!==j?(f=s.jsx(be,{url:u,fallback:j,shape:"square",size:"base"}),e[6]=u,e[7]=j,e[8]=f):f=e[8];let g;return e[9]!==d||e[10]!==i||e[11]!==f?(g=s.jsxs("button",{type:"button",onClick:m,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[i,f]}),e[9]=d,e[10]=i,e[11]=f,e[12]=g):g=e[12],g}function We(){return K.error("Failed to read image")}function Qe(){const t=re(),{org:e}=ce(),a=he(),l=de(),r=me({resolver:ue(Ve),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),d=fe({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo&&(i.logo=o.logo);const u=await a.organization.update({data:i});if(u?.error)throw new Error(u.error.message||"Failed to update organization");return u},onSuccess:(o,i)=>{Y("organization_settings_updated",{organization_id:e.id,fields:Object.keys(i)}),l.invalidateQueries({queryKey:te.organizations()}),l.invalidateQueries({queryKey:te.activeOrganization(e.slug)}),o?.data?.slug&&o.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:(o,i)=>{Y("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(i),error:o instanceof Error?o.message:String(o)}),K.error(o instanceof Error?o.message:"Failed to update organization")}}),{schedule:n,flush:h}=je({save:async()=>{!r.formState.isDirty||!await r.trigger()||await d.mutateAsync(r.getValues())}}),m=r.formState.errors,b=typeof window<"u"?`${window.location.host}/`:"";return s.jsx(X,{children:s.jsxs(Z,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(Ge,{value:r.watch("logo"),onChange:o=>{r.setValue("logo",o??"",{shouldDirty:!0}),h()},name:r.watch("name")})}),s.jsx(Q,{title:"Name",action:s.jsx(se,{control:r.control,name:"name",render:({field:o})=>s.jsx(ve,{id:"org-name",...o,onChange:i=>{o.onChange(i),n()},onBlur:()=>{o.onBlur(),h()},placeholder:"Organization name",className:"w-[280px]"})})}),s.jsx(Q,{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:[b&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:b}),s.jsx(se,{control:r.control,name:"slug",render:({field:o})=>s.jsx("input",{id:"org-slug",value:o.value??"",name:o.name,ref:o.ref,placeholder:"my-organization",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:i=>{const u=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");r.setValue("slug",u,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),n()},onBlur:()=>{o.onBlur(),h()}})})]})}),(m.name||m.slug||m.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[m.name&&s.jsx("p",{className:"text-xs text-destructive",children:m.name.message}),m.slug&&s.jsx("p",{className:"text-xs text-destructive",children:m.slug.message}),m.logo&&s.jsx("p",{className:"text-xs text-destructive",children:m.logo.message})]})]})})}const oe=["site-editor","site-diagnostics","ai-image","ai-research"],ie=8;function Ye(t,e,a){const l=e.find(d=>d.id===t);if(l)return{id:l.id,title:l.title,icon:l.icon,kind:"template"};const r=a.find(d=>d.id===t);return r?{id:t,title:r.title,icon:r.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function Je(t){const e=$.c(39),{agent:a,onRemove:l}=t;let r;e[0]!==a.id?(r={id:a.id},e[0]=a.id,e[1]=r):r=e[1];const{attributes:d,listeners:n,setNodeRef:h,transform:m,transition:b,isDragging:o}=ke(r);let i;e[2]!==m?(i=Ie.Transform.toString(m),e[2]=m,e[3]=i):i=e[3];const u=o?.5:void 0,j=o?100:void 0;let f;e[4]!==i||e[5]!==u||e[6]!==j||e[7]!==b?(f={transform:i,transition:b,opacity:u,zIndex:j},e[4]=i,e[5]=u,e[6]=j,e[7]=b,e[8]=f):f=e[8];const g=f,z=o&&"shadow-lg";let x;e[9]!==z?(x=xe("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",z),e[9]=z,e[10]=x):x=e[10];const v=`Drag to reorder ${a.title}`;let D;e[11]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Be,{size:14}),e[11]=D):D=e[11];let k;e[12]!==d||e[13]!==n||e[14]!==v?(k=s.jsx("button",{type:"button",...d,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":v,children:D}),e[12]=d,e[13]=n,e[14]=v,e[15]=k):k=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ae,{size:14}),e[16]=N):N=e[16];let w;e[17]!==a.icon||e[18]!==a.title?(w=s.jsx(J,{icon:a.icon,name:a.title,size:"xs",fallbackIcon:N}),e[17]=a.icon,e[18]=a.title,e[19]=w):w=e[19];let S;e[20]!==a.title?(S=s.jsx("span",{className:"text-sm text-foreground truncate",children:a.title}),e[20]=a.title,e[21]=S):S=e[21];const _=a.kind==="template"?"Template":a.kind==="custom"?"Custom agent":"Unavailable";let p;e[22]!==_?(p=s.jsx("span",{className:"text-xs text-muted-foreground",children:_}),e[22]=_,e[23]=p):p=e[23];let y;e[24]!==S||e[25]!==p?(y=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[S,p]}),e[24]=S,e[25]=p,e[26]=y):y=e[26];const I=`Remove ${a.title}`;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ke,{size:14}),e[27]=A):A=e[27];let C;e[28]!==l||e[29]!==I?(C=s.jsx("button",{type:"button",onClick:l,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":I,children:A}),e[28]=l,e[29]=I,e[30]=C):C=e[30];let P;return e[31]!==h||e[32]!==g||e[33]!==k||e[34]!==w||e[35]!==y||e[36]!==C||e[37]!==x?(P=s.jsxs("div",{ref:h,style:g,className:x,children:[k,w,y,C]}),e[31]=h,e[32]=g,e[33]=k,e[34]=w,e[35]=y,e[36]=C,e[37]=x,e[38]=P):P=e[38],P}function Xe(t){const e=$.c(48),{selectedIds:a,onAdd:l}=t,[r,d]=H.useState(!1),[n,h]=H.useState(""),m=le();let b;e[0]!==a?(b=new Set(a),e[0]=a,e[1]=b):b=e[1];const o=b;let i,u,j,f,g,z,x,v,D,k,N,w,S;if(e[2]!==m||e[3]!==l||e[4]!==r||e[5]!==n||e[6]!==o){const A=n.toLowerCase();f=ee.filter(c=>!o.has(c.id)&&(!n||c.title.toLowerCase().includes(A)));let C;e[20]!==o?(C=c=>c.id!==null&&!Re(c.id)&&!o.has(c.id),e[20]=o,e[21]=C):C=e[21],j=m.filter(C).filter(c=>!n||c.title.toLowerCase().includes(A));let P;e[22]!==l?(P=c=>{l(c),d(!1),h("")},e[22]=l,e[23]=P):P=e[23];const T=P;u=Le,w=r,S=d,e[24]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx($e,{asChild:!0,children:s.jsxs(G,{type:"button",variant:"outline",size:"sm",children:[s.jsx(He,{size:14}),"Add agent"]})}),e[24]=g):g=e[24],i=Fe,D="w-[320px] p-0 overflow-hidden",k="start",e[25]!==n?(N=s.jsx(Oe,{value:n,onChange:h,placeholder:"Search agents..."}),e[25]=n,e[26]=N):N=e[26],z="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",x=f.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"}),f.map(c=>s.jsxs("button",{type:"button",onClick:()=>T(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:c.icon,name:c.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),v=j.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"}),j.map(c=>s.jsxs("button",{type:"button",onClick:()=>T(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:c.icon,name:c.title,size:"xs",fallbackIcon:s.jsx(ae,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),e[2]=m,e[3]=l,e[4]=r,e[5]=n,e[6]=o,e[7]=i,e[8]=u,e[9]=j,e[10]=f,e[11]=g,e[12]=z,e[13]=x,e[14]=v,e[15]=D,e[16]=k,e[17]=N,e[18]=w,e[19]=S}else i=e[7],u=e[8],j=e[9],f=e[10],g=e[11],z=e[12],x=e[13],v=e[14],D=e[15],k=e[16],N=e[17],w=e[18],S=e[19];let _;e[27]!==j||e[28]!==f.length||e[29]!==n?(_=f.length===0&&j.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]=j,e[28]=f.length,e[29]=n,e[30]=_):_=e[30];let p;e[31]!==_||e[32]!==z||e[33]!==x||e[34]!==v?(p=s.jsxs("div",{className:z,children:[x,v,_]}),e[31]=_,e[32]=z,e[33]=x,e[34]=v,e[35]=p):p=e[35];let y;e[36]!==i||e[37]!==p||e[38]!==D||e[39]!==k||e[40]!==N?(y=s.jsxs(i,{className:D,align:k,children:[N,p]}),e[36]=i,e[37]=p,e[38]=D,e[39]=k,e[40]=N,e[41]=y):y=e[41];let I;return e[42]!==u||e[43]!==g||e[44]!==y||e[45]!==w||e[46]!==S?(I=s.jsxs(u,{open:w,onOpenChange:S,children:[g,y]}),e[42]=u,e[43]=g,e[44]=y,e[45]=w,e[46]=S,e[47]=I):I=e[47],I}function Ze(){const t=$.c(61),e=Ue(),a=le(),l=qe();let r;t[0]!==e?.ids?(r=e?.ids??[...oe],t[0]=e?.ids,t[1]=r):r=t[1];const d=r,[n,h]=H.useState(d);let m;t[2]!==n||t[3]!==d?(m=n.length!==d.length||n.some((E,O)=>E!==d[O]),t[2]=n,t[3]=d,t[4]=m):m=t[4];const b=m;let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o={activationConstraint:{distance:5}},t[5]=o):o=t[5];let i;t[6]===Symbol.for("react.memo_cache_sentinel")?(i={coordinateGetter:Ee},t[6]=i):i=t[6];const u=Ce(ne(Pe,o),ne(Ae,i));let j;t[7]!==n?(j=E=>{const{active:O,over:R}=E;if(!R||O.id===R.id)return;const L=n.indexOf(O.id),q=n.indexOf(R.id);L===-1||q===-1||h(Te([...n],L,q))},t[7]=n,t[8]=j):j=t[8];const f=j;let g;t[9]!==n?(g=E=>{n.includes(E)||h([...n,E])},t[9]=n,t[10]=g):g=t[10];const z=g;let x;t[11]!==n?(x=E=>{h(n.filter(O=>O!==E))},t[11]=n,t[12]=x):x=t[12];const v=x;let D;t[13]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{h([...oe])},t[13]=D):D=t[13];const k=D;let N;t[14]!==n||t[15]!==l?(N=()=>{l.mutate({ids:n},{onSuccess:()=>{Y("default_home_agents_updated",{count:n.length,template_count:n.filter(tt).length}),K.success("Default home agents updated")},onError:et})},t[14]=n,t[15]=l,t[16]=N):N=t[16];const w=N;let S,_,p,y,I,A,C;if(t[17]!==a||t[18]!==n||t[19]!==f||t[20]!==v||t[21]!==u||t[22]!==l.isPending){let E;t[30]!==a?(E=L=>Ye(L,ee,a),t[30]=a,t[31]=E):E=t[31];const O=n.map(E);p=Math.max(0,n.length-ie),_=X,I="Default home agents";let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(pe,{size:14}),t[32]=R):R=t[32],t[33]!==l.isPending?(A=s.jsxs(G,{type:"button",variant:"ghost",size:"sm",onClick:k,disabled:l.isPending,children:[R,"Reset defaults"]}),t[33]=l.isPending,t[34]=A):A=t[34],S=Z,C="px-5 py-5 flex flex-col gap-3",y=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(we,{sensors:u,collisionDetection:_e,onDragEnd:f,children:s.jsx(ze,{items:n,strategy:De,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:O.map((L,q)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q===ie&&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(Je,{agent:L,onRemove:()=>v(L.id)})]},L.id))})})}),t[17]=a,t[18]=n,t[19]=f,t[20]=v,t[21]=u,t[22]=l.isPending,t[23]=S,t[24]=_,t[25]=p,t[26]=y,t[27]=I,t[28]=A,t[29]=C}else S=t[23],_=t[24],p=t[25],y=t[26],I=t[27],A=t[28],C=t[29];let P;t[35]!==n||t[36]!==z?(P=s.jsx(Xe,{selectedIds:n,onAdd:z}),t[35]=n,t[36]=z,t[37]=P):P=t[37];let T;t[38]!==p?(T=p>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[p," agent",p===1?"":"s"," won't fit on the home view"]}),t[38]=p,t[39]=T):T=t[39];let c;t[40]!==P||t[41]!==T?(c=s.jsxs("div",{className:"flex items-center justify-between",children:[P,T]}),t[40]=P,t[41]=T,t[42]=c):c=t[42];let F;t[43]!==y||t[44]!==c||t[45]!==C?(F=s.jsxs("div",{className:C,children:[y,c]}),t[43]=y,t[44]=c,t[45]=C,t[46]=F):F=t[46];let M;t[47]!==w||t[48]!==d||t[49]!==b||t[50]!==l.isPending?(M=b&&s.jsxs(Se,{children:[s.jsx(G,{type:"button",variant:"outline",onClick:()=>h(d),disabled:l.isPending,children:"Cancel"}),s.jsx(G,{type:"button",onClick:w,disabled:l.isPending,children:l.isPending?"Saving…":"Save"})]}),t[47]=w,t[48]=d,t[49]=b,t[50]=l.isPending,t[51]=M):M=t[51];let B;t[52]!==S||t[53]!==F||t[54]!==M?(B=s.jsxs(S,{children:[F,M]}),t[52]=S,t[53]=F,t[54]=M,t[55]=B):B=t[55];let U;return t[56]!==_||t[57]!==I||t[58]!==A||t[59]!==B?(U=s.jsx(_,{title:I,actions:A,children:B}),t[56]=_,t[57]=I,t[58]=A,t[59]=B,t[60]=U):U=t[60],U}function et(t){K.error(t instanceof Error?t.message:"Failed to update default home agents")}function tt(t){return ee.some(e=>e.id===t)}function st(){const t=$.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(nt)})})}),t[0]=e):e=t[0],e}function nt(t,e){return s.jsx(Me,{className:"h-12 w-full rounded-lg"},e)}function ot(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(H.Suspense,{fallback:s.jsx(st,{}),children:s.jsx(Ze,{})}),t[0]=e):e=t[0],e}function it(){const t=$.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(ye,{children:[s.jsx(V.Title,{children:"Organization"}),s.jsx(Qe,{}),s.jsx(Ne,{}),s.jsx(ot,{})]})})})}),t[0]=e):e=t[0],e}function ns(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(it,{}),t[0]=e):e=t[0],e}export{ns as default};