decocms 3.78.0 → 3.79.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 (222) hide show
  1. package/dist/client/assets/{AlertCircle-Caru_t3W.js → AlertCircle-CKei65yQ.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-B2Dt0814.js → ArrowUpRight-BygwtcZ2.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-CpjuZYS5.js → CheckCircle-BZlFJbF8.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-DeW1WG4N.js → ChevronDown-DXOZkIso.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-DhtKqfYa.js → ChevronLeft-DPLHregZ.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-DSC2aiCG.js → ChevronRight-BkBgwZxs.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-CiZNoBS5.js → ChevronUp-BCwumcyZ.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-CAFbny0A.js → DotsVertical-DQDEDjEX.js} +1 -1
  9. package/dist/client/assets/{Eye-BSAOg3tU.js → Eye-IocHlobo.js} +1 -1
  10. package/dist/client/assets/{FilterLines-BWsEA6cc.js → FilterLines-dauCx8Za.js} +1 -1
  11. package/dist/client/assets/{Globe01-B8cJAk0V.js → Globe01-CQy0Cxa-.js} +1 -1
  12. package/dist/client/assets/{Globe04-BHoeDf9U.js → Globe04-CBuYvlRn.js} +1 -1
  13. package/dist/client/assets/{HardDrive-Ca-rpUZp.js → HardDrive-DSj8WeP3.js} +1 -1
  14. package/dist/client/assets/{Key01-hqliL23I.js → Key01-ktWRCkRP.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-DfLCxQJZ.js → LayoutLeft-TAhoC2xE.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-C-uuQSHY.js → LinkExternal01-BenQb5F0.js} +1 -1
  17. package/dist/client/assets/{Monitor01-C4mUj5DO.js → Monitor01-CF5y8J9X.js} +1 -1
  18. package/dist/client/assets/{Palette-BqPdnSvn.js → Palette-ZSzAttfE.js} +1 -1
  19. package/dist/client/assets/{Play-u3Xpo-3H.js → Play-BrJBHlm8.js} +1 -1
  20. package/dist/client/assets/{Plus-e8vsh1yI.js → Plus-DptVePQj.js} +1 -1
  21. package/dist/client/assets/{SearchMd-pbTyIZQ0.js → SearchMd-DmrRiPsU.js} +1 -1
  22. package/dist/client/assets/{Settings02-1OASYAA8.js → Settings02-BynaGT2l.js} +1 -1
  23. package/dist/client/assets/{Shield01-BZP4Q_Vm.js → Shield01-CGOi4o3B.js} +1 -1
  24. package/dist/client/assets/{Star01-BokvC0Yc.js → Star01-G7bzpuzw.js} +1 -1
  25. package/dist/client/assets/{Stars01-CM7BslwP.js → Stars01-BxW6Ze_W.js} +1 -1
  26. package/dist/client/assets/{Stars02-DTDItJ62.js → Stars02-CJJhFv2L.js} +1 -1
  27. package/dist/client/assets/{Sun-CO5Z2lcQ.js → Sun-CUZqy0kq.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-DCwdrg-O.js → SwitchHorizontal01-D04vL0_f.js} +1 -1
  29. package/dist/client/assets/{Tool01-BDvWQGEc.js → Tool01-hkwqrr6Q.js} +1 -1
  30. package/dist/client/assets/{Trash01-C3khOwsb.js → Trash01-Ds3jbDQE.js} +1 -1
  31. package/dist/client/assets/{Upload01-BWq8M5mQ.js → Upload01-Cuswrale.js} +1 -1
  32. package/dist/client/assets/{User01-B5NDreK2.js → User01-DJhz4tmk.js} +1 -1
  33. package/dist/client/assets/{Users01-BM4ZmEbl.js → Users01-D1GekRvz.js} +1 -1
  34. package/dist/client/assets/{Users03-DPSOJZh_.js → Users03-CjtA3d84.js} +1 -1
  35. package/dist/client/assets/{X-CdcmL6WW.js → X-CvnlrpyG.js} +1 -1
  36. package/dist/client/assets/{XCircle-YOrPaSTA.js → XCircle-CTJX6MKF.js} +1 -1
  37. package/dist/client/assets/{XClose-B1WSb9MQ.js → XClose-BbKrO-bh.js} +1 -1
  38. package/dist/client/assets/{Zap-CJ80I152.js → Zap-B-ccy6C4.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-CgWRLEJy.js → ZapSquare-bUJqwnW3.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-OytsIYD1.js → ZoomOut-DRnFWZo9.js} +1 -1
  41. package/dist/client/assets/{access-gate-DqzudH0L.js → access-gate-CAr_jPZ4.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-kp6f6erO.js → add-section-modal-DpjAnzTC.js} +1 -1
  43. package/dist/client/assets/{agent-icon-DY5w59uF.js → agent-icon-BB2_1lHd.js} +1 -1
  44. package/dist/client/assets/{agents-list-DDHbeg5p.js → agents-list-DhbMkPNU.js} +1 -1
  45. package/dist/client/assets/{ai-providers-P8q844Dm.js → ai-providers-B6285-0G.js} +1 -1
  46. package/dist/client/assets/{alert-FbljLOaQ.js → alert-B39DYg6q.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-BO7X_BMw.js → alert-dialog-gK63ktIU.js} +1 -1
  48. package/dist/client/assets/{app-editor-C4YX8u15.js → app-editor-CB02ERjc.js} +1 -1
  49. package/dist/client/assets/{auth-DpDDb6PJ.js → auth-DxKMCtEO.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-BwEPZ9sp.js → auth-catchall-DAcTzerO.js} +1 -1
  51. package/dist/client/assets/auth-entry-Bu3ut1b9.js +1 -0
  52. package/dist/client/assets/{auth-split-layout-6kbG-q9M.js → auth-split-layout-Bo7x5X53.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-SkR5Q2kF.js → authenticate-and-persist-oauth-CXYJ_57C.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-BZROLPDh.js → automation-list-row-BYfl9414.js} +1 -1
  55. package/dist/client/assets/{automation-runs-VqVE_yW9.js → automation-runs-DiHYOI-G.js} +1 -1
  56. package/dist/client/assets/{automations-1DiKFOBq.js → automations-Bqn5XkdY.js} +1 -1
  57. package/dist/client/assets/{avatar-C7RfbSV0.js → avatar-CfKY2_hs.js} +1 -1
  58. package/dist/client/assets/{badge-S-QCOrNN.js → badge-tlnu_6T3.js} +1 -1
  59. package/dist/client/assets/{block-document-CLeG1P-N.js → block-document-D35IO4X3.js} +1 -1
  60. package/dist/client/assets/{brand-context-GZiNd5v6.js → brand-context-CkTeGoic.js} +1 -1
  61. package/dist/client/assets/{buckets-DTeRBDWJ.js → buckets-CDBAN8NB.js} +1 -1
  62. package/dist/client/assets/{calendar-katBc34c.js → calendar-CaxcRF1k.js} +1 -1
  63. package/dist/client/assets/{capability-load-error-D72JLeT1.js → capability-load-error-Bab-5zvo.js} +1 -1
  64. package/dist/client/assets/{card-B0EjU25K.js → card-DU2I8eHH.js} +1 -1
  65. package/dist/client/assets/category-editor-CL_UxJoz.js +1 -0
  66. package/dist/client/assets/{chat-context-DdkEgZ9_.js → chat-context-CdOsOHQ0.js} +1 -1
  67. package/dist/client/assets/{checkbox-DbzbLYfL.js → checkbox-H7xxQ3iC.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-C9MRaugF.js → cli-auth-success-K-z0R_Ah.js} +1 -1
  69. package/dist/client/assets/{collection-detail-DU1VM1YR.js → collection-detail-C5Wn5oY4.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-BNnw7G4D.js → collection-display-button-DTs9IB7s.js} +1 -1
  71. package/dist/client/assets/{collection-search-hESxl20y.js → collection-search-ClGGT1KV.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-99Rq6QsS.js → collection-tabs-xD0Ry7Iv.js} +1 -1
  73. package/dist/client/assets/{command-DJiJXkzC.js → command-CLZq7t6J.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-3oBhw9NK.js +1 -0
  75. package/dist/client/assets/{connect-desktop-dialog-DR4-xhbf.js → connect-desktop-dialog-BCsFp2qg.js} +1 -1
  76. package/dist/client/assets/{connection-card-CJjprKft.js → connection-card-CrUjfVJB.js} +1 -1
  77. package/dist/client/assets/{connection-detail-DZAfgvu2.js → connection-detail-BaKSwWVH.js} +1 -1
  78. package/dist/client/assets/{connection-form-helpers-DT5c99yt.js → connection-form-helpers-BqpyRjgd.js} +1 -1
  79. package/dist/client/assets/{connections-B3yso__h.js → connections-W9DsG8aw.js} +1 -1
  80. package/dist/client/assets/{context-menu-B3oZHh4c.js → context-menu-CqLno4KJ.js} +1 -1
  81. package/dist/client/assets/{decopilot-KvFscv5D.js → decopilot-B2PnahSO.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-C9VeVJ93.js → decopilot-sse-pool-D8ZetksK.js} +1 -1
  83. package/dist/client/assets/{dialog-jX6bYdqO.js → dialog-9Dal6l7D.js} +1 -1
  84. package/dist/client/assets/{domain-settings-DSTf_XC1.js → domain-settings-L_Aj9ndM.js} +1 -1
  85. package/dist/client/assets/{drawer-EgN8HzIq.js → drawer-DW4IYbB1.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-BOrPFviJ.js → dropdown-menu-DveShRRm.js} +1 -1
  87. package/dist/client/assets/{empty-state-BZIY4ETU.js → empty-state-b7tnb7q2.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-Dz1SJTDF.js → extract-connection-data-BL81V9PY.js} +1 -1
  89. package/dist/client/assets/{file-explorer-CtIkaECZ.js → file-explorer-0kznGCON.js} +1 -1
  90. package/dist/client/assets/{file-type-icon-CiTHpOyi.js → file-type-icon-hjib5alc.js} +1 -1
  91. package/dist/client/assets/{files-D4cQybZ3.js → files-x3Ne7hb6.js} +1 -1
  92. package/dist/client/assets/{form-D-Lg2Vno.js → form-6Nre8f-k.js} +1 -1
  93. package/dist/client/assets/{general-BLLTGXVC.js → general-BuYCdj0r.js} +1 -1
  94. package/dist/client/assets/{github-repo-picker-BtGY0bTC.js → github-repo-picker-CdGt5INt.js} +1 -1
  95. package/dist/client/assets/{hooks-Bq2gpnHq.js → hooks-Gm6nJHH5.js} +1 -1
  96. package/dist/client/assets/{image-field-CopsGD8K.js → image-field-CfVmwwEw.js} +1 -1
  97. package/dist/client/assets/{import-from-deco-dialog-DTeSs8zZ.js → import-from-deco-dialog-COzfTmtE.js} +1 -1
  98. package/dist/client/assets/{index-OWX18MdF.js → index-ARPJar1Z.js} +1 -1
  99. package/dist/client/assets/{index-an-q9BoC.js → index-BsTDFmrB.js} +1 -1
  100. package/dist/client/assets/{index-B_T2Tm_n.js → index-C5uKx36f.js} +1 -1
  101. package/dist/client/assets/{index-D9cso_OE.js → index-C6QaS0Zh.js} +3 -3
  102. package/dist/client/assets/{index-DjsYubVL.js → index-CaL7muMy.js} +1 -1
  103. package/dist/client/assets/{index-DsuFa3M3.js → index-DB4Y8lPy.js} +1 -1
  104. package/dist/client/assets/{index-TfVSao84.js → index-DXWbUTbb.js} +1 -1
  105. package/dist/client/assets/index-DYNdZRHD.css +1 -0
  106. package/dist/client/assets/{index-CwCkKeIW.js → index-DcLVAN0f.js} +1 -1
  107. package/dist/client/assets/{index-CApC7A2-.js → index-DllFGtwL.js} +1 -1
  108. package/dist/client/assets/{index-BIlZxD1s.js → index-SIbEiNOY.js} +1 -1
  109. package/dist/client/assets/{index-FMQJTdgj.js → index-_NByWM-i.js} +1 -1
  110. package/dist/client/assets/{index-CpN1_PlS.js → index-gAhVY6Qu.js} +1 -1
  111. package/dist/client/assets/{index-DJ0Ge3cT.js → index-ki8HSB2c.js} +4 -4
  112. package/dist/client/assets/{index-redirect-B5cnslmT.js → index-redirect-ChQQXx0A.js} +1 -1
  113. package/dist/client/assets/{index-BMuKOY-R.js → index-royGCF58.js} +1 -1
  114. package/dist/client/assets/{input-aftZq0qp.js → input-szhd6Snj.js} +1 -1
  115. package/dist/client/assets/integration-icon-XSMgSpds.js +1 -0
  116. package/dist/client/assets/{label-BlTB1rsr.js → label-Bjb_vEVQ.js} +1 -1
  117. package/dist/client/assets/{login-DwqD6H9f.js → login-C6SDd68X.js} +1 -1
  118. package/dist/client/assets/{mcp-oauth-DYo7_iWt.js → mcp-oauth-8Oqz2kjD.js} +1 -1
  119. package/dist/client/assets/{members-BAmGZs_l.js → members-BZMsTuPj.js} +1 -1
  120. package/dist/client/assets/{monaco-editor-dFjmNtXr.js → monaco-editor-Bzp2tCW_.js} +1 -1
  121. package/dist/client/assets/{monitoring-stats-row-DXzyXSPo.js → monitoring-stats-row-Q-gDhXN7.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-BnUvVOzM.js → oauth-callback-C41rH1zN.js} +1 -1
  123. package/dist/client/assets/{oauth-callback-ai-provider-CtGpymDw.js → oauth-callback-ai-provider-L9Z7KnVB.js} +1 -1
  124. package/dist/client/assets/{onboarding-tHyZv_uW.js → onboarding-sxFOChym.js} +1 -1
  125. package/dist/client/assets/{org-install-BJnctrXU.js → org-install-DjUJMgS3.js} +1 -1
  126. package/dist/client/assets/{org-layout-DgadVfYy.js → org-layout-C4CQO9nz.js} +1 -1
  127. package/dist/client/assets/{organization-choice-HfpQcKxS.js → organization-choice-CPVuyoim.js} +1 -1
  128. package/dist/client/assets/{page-seo-form-j7a8Z1BY.js → page-seo-form--ih05Y7N.js} +1 -1
  129. package/dist/client/assets/page-seo-sheet-BGthAy6g.js +1 -0
  130. package/dist/client/assets/{popover-D43tJ8in.js → popover-CJ-idfVW.js} +1 -1
  131. package/dist/client/assets/{post-editor-XU3B2wmV.js → post-editor-BhGUUjQx.js} +1 -1
  132. package/dist/client/assets/{preview-dialog-BrHmAwG0.js → preview-dialog-WfNb4k8L.js} +1 -1
  133. package/dist/client/assets/{primitives-BRyBxVlk.js → primitives-BmQhQ3Bl.js} +1 -1
  134. package/dist/client/assets/{profile-CLM3LuOb.js → profile-C2hbZXR_.js} +1 -1
  135. package/dist/client/assets/project-app-view-QWISlKTP.js +1 -0
  136. package/dist/client/assets/record-editor-D9nFQqRP.js +1 -0
  137. package/dist/client/assets/registry-C4EXobcg.js +2 -0
  138. package/dist/client/assets/{registry-layout-pqx5X3wF.js → registry-layout-BSbINHnj.js} +1 -1
  139. package/dist/client/assets/{require-capability-BQ22Wt23.js → require-capability-D2kIyw8V.js} +1 -1
  140. package/dist/client/assets/{required-auth-layout-wApn6jVI.js → required-auth-layout-BbLd1LMa.js} +1 -1
  141. package/dist/client/assets/{reset-password-deaGgEkO.js → reset-password-lidTRlgJ.js} +1 -1
  142. package/dist/client/assets/{roles-RG2bRHsu.js → roles-7cj_C6tf.js} +1 -1
  143. package/dist/client/assets/save-referenced-block-Dw7QM0hK.js +1 -0
  144. package/dist/client/assets/{save-status-BiRx7JAD.js → save-status-BkW3fzUs.js} +1 -1
  145. package/dist/client/assets/{schema-form-sBBUMk07.js → schema-form-Cg7Lxy8-.js} +1 -1
  146. package/dist/client/assets/{scroll-area-BSGl-_zx.js → scroll-area-Dz-FqKWj.js} +1 -1
  147. package/dist/client/assets/{search-input-Cn14rzZS.js → search-input-DjVPTtCb.js} +1 -1
  148. package/dist/client/assets/{secrets-D-nSpmHI.js → secrets-BJZgSFDD.js} +1 -1
  149. package/dist/client/assets/{sections-editor-NjvzZlHu.js → sections-editor-ez2BbDtS.js} +1 -1
  150. package/dist/client/assets/{select-BGb-ZPds.js → select-FwtHY18v.js} +1 -1
  151. package/dist/client/assets/{select-model-C_rVNd_q.js → select-model-Bf7O5MiJ.js} +1 -1
  152. package/dist/client/assets/{seo-editor-Bvd2538m.js → seo-editor-BtQCMu5l.js} +1 -1
  153. package/dist/client/assets/{settings-layout-CrGAcHuU.js → settings-layout-DDlBA-ta.js} +1 -1
  154. package/dist/client/assets/{settings-section-Bc3yjWcB.js → settings-section-PIk2gDH0.js} +1 -1
  155. package/dist/client/assets/{sheet-HFHR_AuU.js → sheet-BvSpiY2r.js} +1 -1
  156. package/dist/client/assets/{shell-controls-HLzK4I7E.js → shell-controls-C08RpHmT.js} +1 -1
  157. package/dist/client/assets/{shell-layout-LI1vyNzj.js → shell-layout-BWQLmjyW.js} +1 -1
  158. package/dist/client/assets/{shell-route-loading-BDOpNoYP.js → shell-route-loading-Cf96p6By.js} +1 -1
  159. package/dist/client/assets/{sidebar-BGJoJ5IQ.js → sidebar-LVNues-1.js} +1 -1
  160. package/dist/client/assets/{skeleton-hFHnIcZ0.js → skeleton-B8_-zyKb.js} +1 -1
  161. package/dist/client/assets/{sortable.esm-DIVJmvz6.js → sortable.esm-DHMK7_tT.js} +1 -1
  162. package/dist/client/assets/{sso-Bn468zRH.js → sso-CRuWYtBt.js} +1 -1
  163. package/dist/client/assets/{store-DytIJvdt.js → store-73nRfAHP.js} +1 -1
  164. package/dist/client/assets/store-registry-Dj2QFrh5.js +2 -0
  165. package/dist/client/assets/{studio-tools-eP_o-Bzq.js → studio-tools-CJMVZA0W.js} +1 -1
  166. package/dist/client/assets/{switch-DalcHZ66.js → switch-YOR9drgK.js} +1 -1
  167. package/dist/client/assets/{table-CnWjZkvw.js → table-COWO-rWc.js} +1 -1
  168. package/dist/client/assets/{tabs-BhJfCfA3.js → tabs-CsXXbMGG.js} +1 -1
  169. package/dist/client/assets/{task-status-BwSSlnug.js → task-status-D4qDcTy4.js} +1 -1
  170. package/dist/client/assets/{textarea-DTW1SKGc.js → textarea-BTbunR8j.js} +1 -1
  171. package/dist/client/assets/{toggle-group-CRnMovNn.js → toggle-group-CSMS4HAA.js} +1 -1
  172. package/dist/client/assets/{toolbar-BVgga9fW.js → toolbar-CvxN3T7P.js} +1 -1
  173. package/dist/client/assets/{tooltip-DVHwyu-W.js → tooltip-BdbfQCYl.js} +1 -1
  174. package/dist/client/assets/{types-B1E3Ybp7.js → types-D18PqArI.js} +1 -1
  175. package/dist/client/assets/{use-ai-providers-DP8qFD8W.js → use-ai-providers-CiBlqHeC.js} +1 -1
  176. package/dist/client/assets/{use-automations-QBk1wzKE.js → use-automations-44dHfXzj.js} +1 -1
  177. package/dist/client/assets/{use-capability-D3mzXNBE.js → use-capability-DH5i0nun.js} +1 -1
  178. package/dist/client/assets/{use-clock-tick-YCiBQpNz.js → use-clock-tick-bD6VBNNM.js} +1 -1
  179. package/dist/client/assets/{use-collections-sgcijgPQ.js → use-collections-DaAI2dS_.js} +1 -1
  180. package/dist/client/assets/{use-connection-CFC8WumP.js → use-connection-z93iohVP.js} +1 -1
  181. package/dist/client/assets/{use-copy-BVyzmTt4.js → use-copy-_XYMvM2G.js} +1 -1
  182. package/dist/client/assets/{use-create-virtual-mcp-40n1TbuY.js → use-create-virtual-mcp-BA4rAHKP.js} +1 -1
  183. package/dist/client/assets/{use-debounced-autosave-tiHawAIR.js → use-debounced-autosave-CaWQv8Ap.js} +1 -1
  184. package/dist/client/assets/{use-deco-credits-C1ftH3If.js → use-deco-credits-C3sjfJyT.js} +1 -1
  185. package/dist/client/assets/{use-delete-connection-CUd76KVl.js → use-delete-connection-ftKt28t_.js} +1 -1
  186. package/dist/client/assets/{use-file-configs-C2ceyi4L.js → use-file-configs-CS1kf1Mx.js} +1 -1
  187. package/dist/client/assets/{use-infinite-scroll-CvmJXJdB.js → use-infinite-scroll-CUe3Elw1.js} +1 -1
  188. package/dist/client/assets/{use-join-requests-CRlCmWm0.js → use-join-requests-iCFOb_l5.js} +1 -1
  189. package/dist/client/assets/{use-mcp-client-DFe1X8lW.js → use-mcp-client-DZQbnef-.js} +1 -1
  190. package/dist/client/assets/{use-mcp-prompts-4cCmLVZX.js → use-mcp-prompts-CDHTi3et.js} +1 -1
  191. package/dist/client/assets/{use-mcp-tools-DI9Jj-_Y.js → use-mcp-tools-DOD2Zkcv.js} +1 -1
  192. package/dist/client/assets/{use-members-KDk_htTJ.js → use-members-Cgp-qtNm.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-D9iFw7Zt.js → use-navigate-to-agent-DUbEZuBm.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-SaCcE0Qc.js → use-org-auth-client-TLh9Nsd6.js} +1 -1
  195. package/dist/client/assets/{use-org-sso-4n2o97PC.js → use-org-sso-BhXMb9mL.js} +1 -1
  196. package/dist/client/assets/{use-organization-roles-BXjlJlvC.js → use-organization-roles-Dua0G_kp.js} +1 -1
  197. package/dist/client/assets/{use-organization-settings-CJJ_tXSe.js → use-organization-settings-Bjk_kH1I.js} +1 -1
  198. package/dist/client/assets/{use-registry-connections-DGZtDiY8.js → use-registry-connections-DfipPXqa.js} +1 -1
  199. package/dist/client/assets/{use-secrets-DOmnFlDE.js → use-secrets-DCPSjnYq.js} +1 -1
  200. package/dist/client/assets/{use-status-sounds-C7IKQ0M3.js → use-status-sounds-DFtMiuOm.js} +1 -1
  201. package/dist/client/assets/{use-view-mode-5sHRttq3.js → use-view-mode-tunDtZ1F.js} +1 -1
  202. package/dist/client/assets/{use-virtual-mcp-Dt17nZX7.js → use-virtual-mcp-BCkbHrLW.js} +1 -1
  203. package/dist/client/assets/useInfiniteQuery-CX9x55X-.js +1 -0
  204. package/dist/client/assets/useSuspenseInfiniteQuery-C_SaQkGF.js +1 -0
  205. package/dist/client/assets/{variant-calendar-DBaInJsx.js → variant-calendar-hE6C_kQd.js} +1 -1
  206. package/dist/client/assets/{view-mode-toggle-dVNz8sR0.js → view-mode-toggle-B1Thrh1l.js} +1 -1
  207. package/dist/client/index.html +2 -2
  208. package/dist/server/cli.js +1 -1
  209. package/package.json +1 -1
  210. package/dist/client/assets/auth-entry-9rxagxJL.js +0 -1
  211. package/dist/client/assets/category-editor-C-xyYK6m.js +0 -1
  212. package/dist/client/assets/commerce-onboarding-YO2BywhJ.js +0 -1
  213. package/dist/client/assets/index-BITgxoqa.css +0 -1
  214. package/dist/client/assets/integration-icon-Dn8UgHow.js +0 -1
  215. package/dist/client/assets/page-seo-sheet-C5rR31Cs.js +0 -1
  216. package/dist/client/assets/project-app-view-Bojee27q.js +0 -1
  217. package/dist/client/assets/record-editor-Cb2nxa0o.js +0 -1
  218. package/dist/client/assets/registry-DJ2WJB-k.js +0 -2
  219. package/dist/client/assets/save-referenced-block-B0RkutY2.js +0 -1
  220. package/dist/client/assets/store-registry-C32JZ3Yi.js +0 -2
  221. package/dist/client/assets/useInfiniteQuery-LattvRM6.js +0 -1
  222. package/dist/client/assets/useSuspenseInfiniteQuery-JNoud7Ca.js +0 -1
@@ -1 +1 @@
1
- import{r as n,ai as q,cz as R,cA as Ee,cB as ke,cC as Se,bR as xe,cD as j}from"./index-D9cso_OE.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...B}=t,H=q(),ne=q(),N=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(N);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),T=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:N,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),O=m.getAttribute("id");return((g=e.get(O))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],O=le(S,y);r.current.filtered.items.set(g,O),O>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?Ne(s,V):Te(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:e=>{var o;(o=B.onKeyDown)==null||o.call(B,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:T},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:B,onSelect:H,forceMount:ne,keywords:N,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Be=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Oe=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Oe,Item:Ve,Input:Be,Group:je,Separator:Le,Dialog:ze,Empty:Ue,Loading:He});function Ne(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Te(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
1
+ import{r as n,ai as q,cz as R,cA as Ee,cB as ke,cC as Se,bR as xe,cD as j}from"./index-C6QaS0Zh.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...B}=t,H=q(),ne=q(),N=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(N);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),T=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:N,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),O=m.getAttribute("id");return((g=e.get(O))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],O=le(S,y);r.current.filtered.items.set(g,O),O>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?Ne(s,V):Te(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:e=>{var o;(o=B.onKeyDown)==null||o.call(B,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:T},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:B,onSelect:H,forceMount:ne,keywords:N,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Be=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Oe=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Oe,Item:Ve,Input:Be,Group:je,Separator:Le,Dialog:ze,Empty:Ue,Loading:He});function Ne(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Te(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
@@ -1 +1 @@
1
- import{c as j,v as $,K as q,a5 as H,a6 as V,ac as z,j as n,r as R,ah as W,$ as Q,bb as Y,P as x,W as C,b9 as J,Q as I,ba as _,V as X,U as k,bJ as Z,bI as ee}from"./index-D9cso_OE.js";import{i as oe}from"./mcp-oauth-DYo7_iWt.js";import{B as P}from"./badge-S-QCOrNN.js";import{b as w,T as E,a as S,c as te}from"./tooltip-DVHwyu-W.js";import{g as re}from"./types-B1E3Ybp7.js";import{s as ae}from"./Eye-BSAOg3tU.js";import{s as se}from"./Star01-BokvC0Yc.js";import{ab as ne}from"./agent-icon-DY5w59uF.js";function ke(d){const e=j.c(11),{connectionId:t}=d,{org:a}=$();let o,r,s;e[0]!==t||e[1]!==a.slug?(o=new URL(`/api/${a.slug}/mcp/${t}`,window.location.origin),s=H,r=q.isMCPAuthenticated(o.href,null),e[0]=t,e[1]=a.slug,e[2]=o,e[3]=r,e[4]=s):(o=e[2],r=e[3],s=e[4]);let i;e[5]!==o||e[6]!==a.id?(i=()=>oe({url:o.href,token:null,orgId:a.id}),e[5]=o,e[6]=a.id,e[7]=i):i=e[7];let c;e[8]!==r||e[9]!==i?(c={queryKey:r,queryFn:i},e[8]=r,e[9]=i,e[10]=c):c=e[10];const{data:l}=s(c);return l}const ie=[{key:"readOnlyHint",label:"Read-only",Icon:ae,variant:"secondary"},{key:"destructiveHint",label:"Destructive",Icon:V,variant:"destructive"},{key:"idempotentHint",label:"Idempotent",Icon:z,variant:"secondary"},{key:"openWorldHint",label:"Open-world",Icon:se,variant:"outline"}];function Pe(d){const e=j.c(18),{annotations:t,_meta:a}=d;let o;e[0]!==a?(o=re(a),e[0]=a,e[1]=o):o=e[1];const r=!!o;let s,i,c,l,p;if(e[2]!==t||e[3]!==r){p=Symbol.for("react.early_return_sentinel");e:{const f=t?ie.filter(m=>t[m.key]===!0):[];if(f.length===0&&!r){p=null;break e}s=te,i="flex gap-1 flex-nowrap",e[9]!==r?(c=r&&n.jsxs(w,{children:[n.jsx(E,{asChild:!0,children:n.jsx(P,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:n.jsx(ne,{})})}),n.jsx(S,{children:"Interactive"})]}),e[9]=r,e[10]=c):c=e[10],l=f.map(ce)}e[2]=t,e[3]=r,e[4]=s,e[5]=i,e[6]=c,e[7]=l,e[8]=p}else s=e[4],i=e[5],c=e[6],l=e[7],p=e[8];if(p!==Symbol.for("react.early_return_sentinel"))return p;let u;e[11]!==i||e[12]!==c||e[13]!==l?(u=n.jsxs("div",{className:i,children:[c,l]}),e[11]=i,e[12]=c,e[13]=l,e[14]=u):u=e[14];let v;return e[15]!==s||e[16]!==u?(v=n.jsx(s,{children:u}),e[15]=s,e[16]=u,e[17]=v):v=e[17],v}function ce(d){const{label:e,Icon:t,variant:a}=d;return n.jsxs(w,{children:[n.jsx(E,{asChild:!0,children:n.jsx(P,{asChild:!0,variant:a,className:"size-6 p-1",children:n.jsx(t,{})})}),n.jsx(S,{children:e})]},e)}var g="Radio",[de,A]=k(g),[le,ue]=de(g),N=R.forwardRef((d,e)=>{const{__scopeRadio:t,name:a,checked:o=!1,required:r,disabled:s,value:i="on",onCheck:c,form:l,...p}=d,[u,v]=R.useState(null),f=C(e,y=>v(y)),m=R.useRef(!1),h=u?l||!!u.closest("form"):!0;return n.jsxs(le,{scope:t,checked:o,disabled:s,children:[n.jsx(x.button,{type:"button",role:"radio","aria-checked":o,"data-state":O(o),"data-disabled":s?"":void 0,disabled:s,value:i,...p,ref:f,onClick:I(d.onClick,y=>{o||c?.(),h&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),h&&n.jsx(D,{control:u,bubbles:!m.current,name:a,value:i,checked:o,required:r,disabled:s,form:l,style:{transform:"translateX(-100%)"}})]})});N.displayName=g;var G="RadioIndicator",T=R.forwardRef((d,e)=>{const{__scopeRadio:t,forceMount:a,...o}=d,r=ue(G,t);return n.jsx(X,{present:a||r.checked,children:n.jsx(x.span,{"data-state":O(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:e})})});T.displayName=G;var pe="RadioBubbleInput",D=R.forwardRef(({__scopeRadio:d,control:e,checked:t,bubbles:a=!0,...o},r)=>{const s=R.useRef(null),i=C(s,r),c=Z(t),l=ee(e);return R.useEffect(()=>{const p=s.current;if(!p)return;const u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(c!==t&&f){const m=new Event("click",{bubbles:a});f.call(p,t),p.dispatchEvent(m)}},[c,t,a]),n.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});D.displayName=pe;function O(d){return d?"checked":"unchecked"}var fe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],b="RadioGroup",[ve]=k(b,[_,A]),M=_(),U=A(),[me,Re]=ve(b),B=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,name:a,defaultValue:o,value:r,required:s=!1,disabled:i=!1,orientation:c,dir:l,loop:p=!0,onValueChange:u,...v}=d,f=M(t),m=W(l),[h,y]=Q({prop:r,defaultProp:o??null,onChange:u,caller:b});return n.jsx(me,{scope:t,name:a,required:s,disabled:i,value:h,onValueChange:y,children:n.jsx(Y,{asChild:!0,...f,orientation:c,dir:m,loop:p,children:n.jsx(x.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":i?"":void 0,dir:m,...v,ref:e})})})});B.displayName=b;var F="RadioGroupItem",K=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,disabled:a,...o}=d,r=Re(F,t),s=r.disabled||a,i=M(t),c=U(t),l=R.useRef(null),p=C(e,l),u=r.value===o.value,v=R.useRef(!1);return R.useEffect(()=>{const f=h=>{fe.includes(h.key)&&(v.current=!0)},m=()=>v.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",m)}},[]),n.jsx(J,{asChild:!0,...i,focusable:!s,active:u,children:n.jsx(N,{disabled:s,required:r.required,checked:u,...c,...o,name:r.name,ref:p,onCheck:()=>r.onValueChange(o.value),onKeyDown:I(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:I(o.onFocus,()=>{v.current&&l.current?.click()})})})});K.displayName=F;var he="RadioGroupIndicator",L=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,...a}=d,o=U(t);return n.jsx(T,{...o,...a,ref:e})});L.displayName=he;var we=B,Ee=K,Se=L;export{Ee as I,we as R,Pe as T,Se as a,ke as u};
1
+ import{c as j,v as $,K as q,a5 as H,a6 as V,ac as z,j as n,r as R,ah as W,$ as Q,bb as Y,P as x,W as C,b9 as J,Q as I,ba as _,V as X,U as k,bJ as Z,bI as ee}from"./index-C6QaS0Zh.js";import{i as oe}from"./mcp-oauth-8Oqz2kjD.js";import{B as P}from"./badge-tlnu_6T3.js";import{b as w,T as E,a as S,c as te}from"./tooltip-BdbfQCYl.js";import{g as re}from"./types-D18PqArI.js";import{s as ae}from"./Eye-IocHlobo.js";import{s as se}from"./Star01-G7bzpuzw.js";import{ab as ne}from"./agent-icon-BB2_1lHd.js";function ke(d){const e=j.c(11),{connectionId:t}=d,{org:a}=$();let o,r,s;e[0]!==t||e[1]!==a.slug?(o=new URL(`/api/${a.slug}/mcp/${t}`,window.location.origin),s=H,r=q.isMCPAuthenticated(o.href,null),e[0]=t,e[1]=a.slug,e[2]=o,e[3]=r,e[4]=s):(o=e[2],r=e[3],s=e[4]);let i;e[5]!==o||e[6]!==a.id?(i=()=>oe({url:o.href,token:null,orgId:a.id}),e[5]=o,e[6]=a.id,e[7]=i):i=e[7];let c;e[8]!==r||e[9]!==i?(c={queryKey:r,queryFn:i},e[8]=r,e[9]=i,e[10]=c):c=e[10];const{data:l}=s(c);return l}const ie=[{key:"readOnlyHint",label:"Read-only",Icon:ae,variant:"secondary"},{key:"destructiveHint",label:"Destructive",Icon:V,variant:"destructive"},{key:"idempotentHint",label:"Idempotent",Icon:z,variant:"secondary"},{key:"openWorldHint",label:"Open-world",Icon:se,variant:"outline"}];function Pe(d){const e=j.c(18),{annotations:t,_meta:a}=d;let o;e[0]!==a?(o=re(a),e[0]=a,e[1]=o):o=e[1];const r=!!o;let s,i,c,l,p;if(e[2]!==t||e[3]!==r){p=Symbol.for("react.early_return_sentinel");e:{const f=t?ie.filter(m=>t[m.key]===!0):[];if(f.length===0&&!r){p=null;break e}s=te,i="flex gap-1 flex-nowrap",e[9]!==r?(c=r&&n.jsxs(w,{children:[n.jsx(E,{asChild:!0,children:n.jsx(P,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:n.jsx(ne,{})})}),n.jsx(S,{children:"Interactive"})]}),e[9]=r,e[10]=c):c=e[10],l=f.map(ce)}e[2]=t,e[3]=r,e[4]=s,e[5]=i,e[6]=c,e[7]=l,e[8]=p}else s=e[4],i=e[5],c=e[6],l=e[7],p=e[8];if(p!==Symbol.for("react.early_return_sentinel"))return p;let u;e[11]!==i||e[12]!==c||e[13]!==l?(u=n.jsxs("div",{className:i,children:[c,l]}),e[11]=i,e[12]=c,e[13]=l,e[14]=u):u=e[14];let v;return e[15]!==s||e[16]!==u?(v=n.jsx(s,{children:u}),e[15]=s,e[16]=u,e[17]=v):v=e[17],v}function ce(d){const{label:e,Icon:t,variant:a}=d;return n.jsxs(w,{children:[n.jsx(E,{asChild:!0,children:n.jsx(P,{asChild:!0,variant:a,className:"size-6 p-1",children:n.jsx(t,{})})}),n.jsx(S,{children:e})]},e)}var g="Radio",[de,A]=k(g),[le,ue]=de(g),N=R.forwardRef((d,e)=>{const{__scopeRadio:t,name:a,checked:o=!1,required:r,disabled:s,value:i="on",onCheck:c,form:l,...p}=d,[u,v]=R.useState(null),f=C(e,y=>v(y)),m=R.useRef(!1),h=u?l||!!u.closest("form"):!0;return n.jsxs(le,{scope:t,checked:o,disabled:s,children:[n.jsx(x.button,{type:"button",role:"radio","aria-checked":o,"data-state":O(o),"data-disabled":s?"":void 0,disabled:s,value:i,...p,ref:f,onClick:I(d.onClick,y=>{o||c?.(),h&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),h&&n.jsx(D,{control:u,bubbles:!m.current,name:a,value:i,checked:o,required:r,disabled:s,form:l,style:{transform:"translateX(-100%)"}})]})});N.displayName=g;var G="RadioIndicator",T=R.forwardRef((d,e)=>{const{__scopeRadio:t,forceMount:a,...o}=d,r=ue(G,t);return n.jsx(X,{present:a||r.checked,children:n.jsx(x.span,{"data-state":O(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:e})})});T.displayName=G;var pe="RadioBubbleInput",D=R.forwardRef(({__scopeRadio:d,control:e,checked:t,bubbles:a=!0,...o},r)=>{const s=R.useRef(null),i=C(s,r),c=Z(t),l=ee(e);return R.useEffect(()=>{const p=s.current;if(!p)return;const u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(c!==t&&f){const m=new Event("click",{bubbles:a});f.call(p,t),p.dispatchEvent(m)}},[c,t,a]),n.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});D.displayName=pe;function O(d){return d?"checked":"unchecked"}var fe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],b="RadioGroup",[ve]=k(b,[_,A]),M=_(),U=A(),[me,Re]=ve(b),B=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,name:a,defaultValue:o,value:r,required:s=!1,disabled:i=!1,orientation:c,dir:l,loop:p=!0,onValueChange:u,...v}=d,f=M(t),m=W(l),[h,y]=Q({prop:r,defaultProp:o??null,onChange:u,caller:b});return n.jsx(me,{scope:t,name:a,required:s,disabled:i,value:h,onValueChange:y,children:n.jsx(Y,{asChild:!0,...f,orientation:c,dir:m,loop:p,children:n.jsx(x.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":i?"":void 0,dir:m,...v,ref:e})})})});B.displayName=b;var F="RadioGroupItem",K=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,disabled:a,...o}=d,r=Re(F,t),s=r.disabled||a,i=M(t),c=U(t),l=R.useRef(null),p=C(e,l),u=r.value===o.value,v=R.useRef(!1);return R.useEffect(()=>{const f=h=>{fe.includes(h.key)&&(v.current=!0)},m=()=>v.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",m)}},[]),n.jsx(J,{asChild:!0,...i,focusable:!s,active:u,children:n.jsx(N,{disabled:s,required:r.required,checked:u,...c,...o,name:r.name,ref:p,onCheck:()=>r.onValueChange(o.value),onKeyDown:I(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:I(o.onFocus,()=>{v.current&&l.current?.click()})})})});K.displayName=F;var he="RadioGroupIndicator",L=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,...a}=d,o=U(t);return n.jsx(T,{...o,...a,ref:e})});L.displayName=he;var we=B,Ee=K,Se=L;export{Ee as I,we as R,Pe as T,Se as a,ke as u};
@@ -1,4 +1,4 @@
1
- import{r as a,af as R}from"./index-D9cso_OE.js";function re(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function me(e){if(Array.isArray(e))return e}function be(e,t,r){return(t=Se(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,c,s=[],f=!0,p=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(f=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);f=!0);}catch(j){p=!0,o=j}finally{try{if(!f&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(p)throw o}}return s}}function we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as a,af as R}from"./index-C6QaS0Zh.js";function re(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function me(e){if(Array.isArray(e))return e}function be(e,t,r){return(t=Se(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,c,s=[],f=!0,p=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(f=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);f=!0);}catch(j){p=!0,o=j}finally{try{if(!f&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(p)throw o}}return s}}function we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ne(Object(r),!0).forEach(function(n){be(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oe(e,t){if(e==null)return{};var r,n,o=je(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function je(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Me(e,t){return me(e)||ye(e,t)||Ee(e,t)||we()}function Pe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Se(e){var t=Pe(e,"string");return typeof t=="symbol"?t:t+""}function Ee(e,t){if(e){if(typeof e=="string")return re(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(e,t):void 0}}function Re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ie(Object(r),!0).forEach(function(n){Re(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ie(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,i){return i(o)},n)}}function A(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,s=new Array(c),f=0;f<c;f++)s[f]=arguments[f];return t.apply(r,[].concat(o,s))}}}function F(e){return{}.toString.call(e).includes("Object")}function Te(e){return!Object.keys(e).length}function D(e){return typeof e=="function"}function Ce(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Le(e,t){return F(t)||P("changeType"),Object.keys(t).some(function(r){return!Ce(e,r)})&&P("changeField"),t}function Ae(e){D(e)||P("selectorType")}function $e(e){D(e)||F(e)||P("handlerType"),F(e)&&Object.values(e).some(function(t){return!D(t)})&&P("handlersType")}function De(e){e||P("initialIsRequired"),F(e)||P("initialType"),Te(e)&&P("initialContent")}function Ve(e,t){throw new Error(e[t]||e.default)}var xe={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},P=A(Ve)(xe),q={changes:Le,selector:Ae,handler:$e,initial:De};function Ne(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};q.initial(e),q.handler(t);var r={current:e},n=A(Fe)(r,t),o=A(ze)(r),i=A(q.changes)(e),c=A(qe)(r);function s(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(j){return j};return q.selector(p),p(r.current)}function f(p){Ie(n,o,i,c)(p)}return[s,f]}function qe(e,t){return D(t)?t(e.current):t}function ze(e,t){return e.current=ae(ae({},e.current),t),t}function Fe(e,t,r){return D(t)?t(e.current):Object.keys(r).forEach(function(n){var o;return(o=t[n])===null||o===void 0?void 0:o.call(t,e.current[n])}),r}var Ue={create:Ne},He={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function We(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,s=new Array(c),f=0;f<c;f++)s[f]=arguments[f];return t.apply(r,[].concat(o,s))}}}function Be(e){return{}.toString.call(e).includes("Object")}function Ke(e){return e||ue("configIsRequired"),Be(e)||ue("configType"),e.urls?(Ge(),{paths:{vs:e.urls.monacoBase}}):e}function Ge(){console.warn(ce.deprecation)}function Ye(e,t){throw new Error(e[t]||e.default)}var ce={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
3
3
  You are using deprecated way of configuration.
4
4
 
@@ -1,4 +1,4 @@
1
- import{c as le,r as K,b as yt,v as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,a6 as rs,u as ls,q as xt,a2 as os}from"./index-D9cso_OE.js";import{S as as}from"./search-input-Cn14rzZS.js";import{P as De}from"./index-DsuFa3M3.js";import{E as St}from"./empty-state-BZIY4ETU.js";import{R as ns}from"./require-capability-BQ22Wt23.js";import{J as Tt,S as is}from"./scroll-area-BSGl-_zx.js";import{u as vt}from"./use-connection-CFC8WumP.js";import{g as Pt}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-S-QCOrNN.js";import{P as ct,a as dt,b as mt}from"./popover-D43tJ8in.js";import{b as Ze,T as et,a as tt}from"./tooltip-DVHwyu-W.js";import{i as ft,n as cs}from"./ChevronUp-CiZNoBS5.js";import{a as Xe}from"./Eye-BSAOg3tU.js";import{n as Mt}from"./Globe01-B8cJAk0V.js";import{i as At}from"./FilterLines-BWsEA6cc.js";import{i as ds}from"./Key01-hqliL23I.js";import{i as ms}from"./Play-u3Xpo-3H.js";import{ac as us,P as xs,M as fs}from"./agent-icon-DY5w59uF.js";import{M as _t}from"./monaco-editor-dFjmNtXr.js";import{u as ps}from"./use-members-KDk_htTJ.js";import{S as hs,u as gs,W as js}from"./use-mcp-client-DFe1X8lW.js";import{u as vs}from"./use-virtual-mcp-Dt17nZX7.js";import{n as Qe}from"./XCircle-YOrPaSTA.js";import{c as Ns}from"./SwitchHorizontal01-DCwdrg-O.js";import{s as bs}from"./Plus-e8vsh1yI.js";import{s as ys}from"./Trash01-C3khOwsb.js";import{I as Ge}from"./input-aftZq0qp.js";import{g as ws,b as Dt,f as st,a as Vt,c as pt,d as Ss,e as Lt,h as Ut,A as Is,T as Cs,i as ks,M as ht}from"./automation-runs-VqVE_yW9.js";import{b as lt,c as ot,S as at,a as $e,d as nt}from"./select-BGb-ZPds.js";import{t as Kt}from"./ChevronDown-DeW1WG4N.js";import{s as Ts}from"./Stars02-DTDItJ62.js";import{C as Ms}from"./calendar-katBc34c.js";import{T as _s}from"./textarea-DTW1SKGc.js";import{C as qt}from"./collection-tabs-99Rq6QsS.js";import{S as Ds}from"./switch-DalcHZ66.js";import{L as Ls}from"./label-BlTB1rsr.js";import{I as qe}from"./integration-icon-Dn8UgHow.js";import{A as Bt}from"./avatar-C7RfbSV0.js";import{A as Fs,a as Rs,b as $s}from"./alert-FbljLOaQ.js";import{C as Ht}from"./card-B0EjU25K.js";import{K as Me}from"./monitoring-stats-row-DXzyXSPo.js";import{u as Jt}from"./studio-tools-eP_o-Bzq.js";import{u as zs}from"./useSuspenseInfiniteQuery-JNoud7Ca.js";import{b as Os,S as Es,c as Ps,d as As}from"./sheet-HFHR_AuU.js";import{T as Fe,a as ut,b as Gt,c as Qt,d as Wt,e as ae}from"./table-CnWjZkvw.js";import{u as Vs}from"./use-infinite-scroll-CvmJXJdB.js";import{c as Us,b as Ks}from"./use-automations-QBk1wzKE.js";import"./SearchMd-pbTyIZQ0.js";import"./sidebar-BGJoJ5IQ.js";import"./LayoutLeft-DfLCxQJZ.js";import"./use-capability-D3mzXNBE.js";import"./access-gate-DqzudH0L.js";import"./capability-load-error-D72JLeT1.js";import"./Stars01-CM7BslwP.js";import"./ChevronRight-DSC2aiCG.js";import"./use-clock-tick-YCiBQpNz.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BVyzmTt4.js";import"./file-type-icon-CiTHpOyi.js";import"./dialog-jX6bYdqO.js";import"./X-CdcmL6WW.js";import"./ZoomOut-OytsIYD1.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-B1E3Ybp7.js";import"./chat-context-DdkEgZ9_.js";import"./hooks-Bq2gpnHq.js";import"./decopilot-sse-pool-C9VeVJ93.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-DP8qFD8W.js";import"./use-organization-settings-CJJ_tXSe.js";import"./AlertCircle-Caru_t3W.js";import"./Star01-BokvC0Yc.js";import"./XClose-B1WSb9MQ.js";import"./ZapSquare-CgWRLEJy.js";import"./Tool01-BDvWQGEc.js";import"./Monitor01-C4mUj5DO.js";import"./Upload01-BWq8M5mQ.js";import"./shell-layout-LI1vyNzj.js";import"./Users03-DPSOJZh_.js";import"./CheckCircle-CpjuZYS5.js";import"./Zap-CJ80I152.js";import"./required-auth-layout-wApn6jVI.js";import"./use-org-sso-4n2o97PC.js";import"./LinkExternal01-C-uuQSHY.js";import"./ArrowUpRight-B2Dt0814.js";import"./Palette-BqPdnSvn.js";import"./use-navigate-to-agent-D9iFw7Zt.js";import"./use-mcp-prompts-4cCmLVZX.js";import"./form-D-Lg2Vno.js";import"./use-collections-sgcijgPQ.js";import"./Settings02-1OASYAA8.js";import"./ChevronLeft-DhtKqfYa.js";import"./DotsVertical-CAFbny0A.js";import"./Globe04-BHoeDf9U.js";import"./HardDrive-Ca-rpUZp.js";import"./Sun-CO5Z2lcQ.js";import"./Shield01-BZP4Q_Vm.js";import"./User01-B5NDreK2.js";import"./Users01-BM4ZmEbl.js";import"./index-BIlZxD1s.js";import"./use-org-auth-client-SaCcE0Qc.js";import"./auth-DpDDb6PJ.js";import"./useInfiniteQuery-LattvRM6.js";import"./task-status-BwSSlnug.js";import"./checkbox-DbzbLYfL.js";import"./command-DJiJXkzC.js";import"./index-CwCkKeIW.js";import"./index-B_T2Tm_n.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Re(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
1
+ import{c as le,r as K,b as yt,v as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,a6 as rs,u as ls,q as xt,a2 as os}from"./index-C6QaS0Zh.js";import{S as as}from"./search-input-DjVPTtCb.js";import{P as De}from"./index-DB4Y8lPy.js";import{E as St}from"./empty-state-b7tnb7q2.js";import{R as ns}from"./require-capability-D2kIyw8V.js";import{J as Tt,S as is}from"./scroll-area-Dz-FqKWj.js";import{u as vt}from"./use-connection-z93iohVP.js";import{g as Pt}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-tlnu_6T3.js";import{P as ct,a as dt,b as mt}from"./popover-CJ-idfVW.js";import{b as Ze,T as et,a as tt}from"./tooltip-BdbfQCYl.js";import{i as ft,n as cs}from"./ChevronUp-BCwumcyZ.js";import{a as Xe}from"./Eye-IocHlobo.js";import{n as Mt}from"./Globe01-CQy0Cxa-.js";import{i as At}from"./FilterLines-dauCx8Za.js";import{i as ds}from"./Key01-ktWRCkRP.js";import{i as ms}from"./Play-BrJBHlm8.js";import{ac as us,P as xs,M as fs}from"./agent-icon-BB2_1lHd.js";import{M as _t}from"./monaco-editor-Bzp2tCW_.js";import{u as ps}from"./use-members-Cgp-qtNm.js";import{S as hs,u as gs,W as js}from"./use-mcp-client-DZQbnef-.js";import{u as vs}from"./use-virtual-mcp-BCkbHrLW.js";import{n as Qe}from"./XCircle-CTJX6MKF.js";import{c as Ns}from"./SwitchHorizontal01-D04vL0_f.js";import{s as bs}from"./Plus-DptVePQj.js";import{s as ys}from"./Trash01-Ds3jbDQE.js";import{I as Ge}from"./input-szhd6Snj.js";import{g as ws,b as Dt,f as st,a as Vt,c as pt,d as Ss,e as Lt,h as Ut,A as Is,T as Cs,i as ks,M as ht}from"./automation-runs-DiHYOI-G.js";import{b as lt,c as ot,S as at,a as $e,d as nt}from"./select-FwtHY18v.js";import{t as Kt}from"./ChevronDown-DXOZkIso.js";import{s as Ts}from"./Stars02-CJJhFv2L.js";import{C as Ms}from"./calendar-CaxcRF1k.js";import{T as _s}from"./textarea-BTbunR8j.js";import{C as qt}from"./collection-tabs-xD0Ry7Iv.js";import{S as Ds}from"./switch-YOR9drgK.js";import{L as Ls}from"./label-Bjb_vEVQ.js";import{I as qe}from"./integration-icon-XSMgSpds.js";import{A as Bt}from"./avatar-CfKY2_hs.js";import{A as Fs,a as Rs,b as $s}from"./alert-B39DYg6q.js";import{C as Ht}from"./card-DU2I8eHH.js";import{K as Me}from"./monitoring-stats-row-Q-gDhXN7.js";import{u as Jt}from"./studio-tools-CJMVZA0W.js";import{u as zs}from"./useSuspenseInfiniteQuery-C_SaQkGF.js";import{b as Os,S as Es,c as Ps,d as As}from"./sheet-BvSpiY2r.js";import{T as Fe,a as ut,b as Gt,c as Qt,d as Wt,e as ae}from"./table-COWO-rWc.js";import{u as Vs}from"./use-infinite-scroll-CUe3Elw1.js";import{c as Us,b as Ks}from"./use-automations-44dHfXzj.js";import"./SearchMd-DmrRiPsU.js";import"./sidebar-LVNues-1.js";import"./LayoutLeft-TAhoC2xE.js";import"./use-capability-DH5i0nun.js";import"./access-gate-CAr_jPZ4.js";import"./capability-load-error-Bab-5zvo.js";import"./Stars01-BxW6Ze_W.js";import"./ChevronRight-BkBgwZxs.js";import"./use-clock-tick-bD6VBNNM.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-_XYMvM2G.js";import"./file-type-icon-hjib5alc.js";import"./dialog-9Dal6l7D.js";import"./X-CvnlrpyG.js";import"./ZoomOut-DRnFWZo9.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-D18PqArI.js";import"./chat-context-CdOsOHQ0.js";import"./hooks-Gm6nJHH5.js";import"./decopilot-sse-pool-D8ZetksK.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CiBlqHeC.js";import"./use-organization-settings-Bjk_kH1I.js";import"./AlertCircle-CKei65yQ.js";import"./Star01-G7bzpuzw.js";import"./XClose-BbKrO-bh.js";import"./ZapSquare-bUJqwnW3.js";import"./Tool01-hkwqrr6Q.js";import"./Monitor01-CF5y8J9X.js";import"./Upload01-Cuswrale.js";import"./shell-layout-BWQLmjyW.js";import"./Users03-CjtA3d84.js";import"./CheckCircle-BZlFJbF8.js";import"./Zap-B-ccy6C4.js";import"./required-auth-layout-BbLd1LMa.js";import"./use-org-sso-BhXMb9mL.js";import"./LinkExternal01-BenQb5F0.js";import"./ArrowUpRight-BygwtcZ2.js";import"./Palette-ZSzAttfE.js";import"./use-navigate-to-agent-DUbEZuBm.js";import"./use-mcp-prompts-CDHTi3et.js";import"./form-6Nre8f-k.js";import"./use-collections-DaAI2dS_.js";import"./Settings02-BynaGT2l.js";import"./ChevronLeft-DPLHregZ.js";import"./DotsVertical-DQDEDjEX.js";import"./Globe04-CBuYvlRn.js";import"./HardDrive-DSj8WeP3.js";import"./Sun-CUZqy0kq.js";import"./Shield01-CGOi4o3B.js";import"./User01-DJhz4tmk.js";import"./Users01-D1GekRvz.js";import"./index-SIbEiNOY.js";import"./use-org-auth-client-TLh9Nsd6.js";import"./auth-DxKMCtEO.js";import"./useInfiniteQuery-CX9x55X-.js";import"./task-status-D4qDcTy4.js";import"./checkbox-H7xxQ3iC.js";import"./command-CLZq7t6J.js";import"./index-DcLVAN0f.js";import"./index-C5uKx36f.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Re(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
2
  `)}function Ft(s){return s.trim()?s.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...l]=e.split("=");return{key:r||"",operator:"eq",value:l.join("=")}}if(e.includes("~")){const[r,...l]=e.split("~");return{key:r||"",operator:"contains",value:l.join("~")}}if(e.includes("@")){const[r,...l]=e.split("@");return{key:r||"",operator:"in",value:l.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Bs(s){const e={},r={},l=[],a={};for(const o of s)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(r[o.key]=`%${o.value}%`);break;case"exists":l.push(o.key);break;case"in":o.value&&(a[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:l.length>0?l:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Rt(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=Nt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,Nt.maxJsonRenderSize)+`
4
4
 
@@ -1 +1 @@
1
- import{al as ot,am as he,an as lt,ao as at,ap as Oe,m as le,aq as ct,ar as dt,r as $,as as mt,at as ut,au as ft,av as ht,aw as Se,ax as pt,ay as xt,az as gt,c as k,j as n,v as J,l as G,i as ae,aA as Z,t as U,K as te,k as se,B as Y,d as bt,a6 as yt,a2 as vt,a as jt}from"./index-D9cso_OE.js";import{u as be}from"./tooltip-DVHwyu-W.js";import{i as wt,u as ce,m as Nt,a as St,S as Ct}from"./use-mcp-client-DFe1X8lW.js";import{u as _t,b as It,v as Tt,a as kt}from"./use-virtual-mcp-Dt17nZX7.js";import{i as $t}from"./ChevronUp-CiZNoBS5.js";import{e as At,A as de,Q as Et,a0 as Ot,D as Pt,k as Mt}from"./agent-icon-DY5w59uF.js";import{s as ye}from"./Plus-e8vsh1yI.js";import{i as Pe}from"./X-CdcmL6WW.js";import{C as re}from"./index-OWX18MdF.js";import{b as zt}from"./chat-context-DdkEgZ9_.js";import{N as Rt}from"./decopilot-KvFscv5D.js";import{u as Me,a as oe,K as ze,P as Re,D as Le,c as Lt,S as Ht,v as Dt,b as Ft,C as Ut,s as Qt,d as Bt,e as qt,f as Vt}from"./sortable.esm-DIVJmvz6.js";import{g as Kt,u as Wt,d as Gt,h as Jt}from"./use-deco-credits-C1ftH3If.js";import{u as He,a as De,o as Xt}from"./use-organization-settings-CJJ_tXSe.js";import{c as ve,b as Zt,h as Yt}from"./shell-layout-LI1vyNzj.js";import{I as Fe}from"./input-aftZq0qp.js";import{S as es,t as je,P as ts,h as ss,s as ns,g as is}from"./scroll-area-BSGl-_zx.js";import{S as rs,a as os,b as ls,c as as,d as cs}from"./sheet-HFHR_AuU.js";import{S as H}from"./skeleton-hFHnIcZ0.js";import{t as Ue}from"./ChevronDown-DeW1WG4N.js";import{c as Qe}from"./ZoomOut-OytsIYD1.js";import{g as Be,M as ds}from"./types-B1E3Ybp7.js";import{I as qe}from"./integration-icon-Dn8UgHow.js";import{b as ms,c as us,S as fs,a as Ce,d as hs}from"./select-BGb-ZPds.js";import{T as ps}from"./textarea-DTW1SKGc.js";import{u as Ve}from"./studio-tools-eP_o-Bzq.js";import{a as xs}from"./use-mcp-tools-DI9Jj-_Y.js";import{i as gs}from"./XCircle-YOrPaSTA.js";import{f as bs}from"./tab-id-BptcWVWa.js";import{g as ys}from"./use-mcp-prompts-4cCmLVZX.js";import{u as vs,w as js}from"./hooks-Bq2gpnHq.js";import{a as ws,g as Ns,c as Ss,b as Cs,D as _s}from"./dropdown-menu-BOrPFviJ.js";import{s as Is}from"./Trash01-C3khOwsb.js";import{a as Ts,u as ks}from"./use-ai-providers-DP8qFD8W.js";import{u as $s}from"./connect-desktop-dialog-DR4-xhbf.js";import{a as As}from"./toolbar-BVgga9fW.js";import"./auth-DpDDb6PJ.js";import"./use-collections-sgcijgPQ.js";import"./AlertCircle-Caru_t3W.js";import"./Tool01-BDvWQGEc.js";import"./SwitchHorizontal01-DCwdrg-O.js";import"./Settings02-1OASYAA8.js";import"./ArrowUpRight-B2Dt0814.js";import"./ZapSquare-CgWRLEJy.js";import"./Users03-DPSOJZh_.js";import"./CheckCircle-CpjuZYS5.js";import"./ChevronLeft-DhtKqfYa.js";import"./ChevronRight-DSC2aiCG.js";import"./DotsVertical-CAFbny0A.js";import"./Stars02-DTDItJ62.js";import"./Eye-BSAOg3tU.js";import"./Globe01-B8cJAk0V.js";import"./FilterLines-BWsEA6cc.js";import"./Star01-BokvC0Yc.js";import"./Globe04-BHoeDf9U.js";import"./HardDrive-Ca-rpUZp.js";import"./Key01-hqliL23I.js";import"./LayoutLeft-DfLCxQJZ.js";import"./LinkExternal01-C-uuQSHY.js";import"./Monitor01-C4mUj5DO.js";import"./Sun-CO5Z2lcQ.js";import"./Palette-BqPdnSvn.js";import"./Play-u3Xpo-3H.js";import"./SearchMd-pbTyIZQ0.js";import"./Shield01-BZP4Q_Vm.js";import"./Stars01-CM7BslwP.js";import"./Upload01-BWq8M5mQ.js";import"./User01-B5NDreK2.js";import"./Users01-BM4ZmEbl.js";import"./XClose-B1WSb9MQ.js";import"./Zap-CJ80I152.js";import"./dialog-jX6bYdqO.js";import"./drawer-EgN8HzIq.js";import"./collection-search-hESxl20y.js";import"./form-D-Lg2Vno.js";import"./label-BlTB1rsr.js";import"./tabs-BhJfCfA3.js";import"./toggle-group-CRnMovNn.js";import"./popover-D43tJ8in.js";import"./command-DJiJXkzC.js";import"./index-CwCkKeIW.js";import"./useInfiniteQuery-LattvRM6.js";import"./use-infinite-scroll-CvmJXJdB.js";import"./question-004-sINsf4GQ.js";import"./checkbox-DbzbLYfL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-C7RfbSV0.js";import"./settings-section-Bc3yjWcB.js";import"./card-B0EjU25K.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CJjprKft.js";import"./use-registry-connections-DGZtDiY8.js";import"./use-connection-CFC8WumP.js";import"./extract-connection-data-Dz1SJTDF.js";import"./collection-tabs-99Rq6QsS.js";import"./badge-S-QCOrNN.js";import"./connection-form-helpers-DT5c99yt.js";import"./authenticate-and-persist-oauth-SkR5Q2kF.js";import"./mcp-oauth-DYo7_iWt.js";import"./useSuspenseInfiniteQuery-JNoud7Ca.js";import"./required-auth-layout-wApn6jVI.js";import"./use-org-sso-4n2o97PC.js";import"./use-clock-tick-YCiBQpNz.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BVyzmTt4.js";import"./file-type-icon-CiTHpOyi.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-D9iFw7Zt.js";import"./decopilot-sse-pool-C9VeVJ93.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function _e(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function Es(t,e,s){const r=t.slice(0);return r[e]=s,r}var Os=class extends ot{#i;#e;#r;#n;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#i=t,this.#n=s,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(t=>{t.subscribe(e=>{this.#f(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(t=>{t.destroy()})}setQueries(t,e){this.#r=t,this.#n=e,he.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const i=r.map(c=>c.observer),o=i.map(c=>c.getCurrentResult()),l=s.length!==i.length,d=i.some((c,u)=>c!==s[u]),a=l||d,m=a?!0:o.some((c,u)=>{const f=this.#e[u];return!f||!lt(c,f)});!a&&!m||(a&&(this.#c=r,this.#t=i),this.#e=o,this.hasListeners()&&(a&&(_e(s,i).forEach(c=>{c.destroy()}),_e(i,s).forEach(c=>{c.subscribe(u=>{this.#f(c,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(t=>t.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(t,e){const s=this.#u(t),r=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),i=s.map(o=>o.defaultedQueryOptions.queryHash);return[r,o=>this.#m(o??r,e,i),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const i=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,o=>{e.forEach(l=>{l.observer.trackProp(o)})})})}#m(t,e,s){if(e){const r=this.#a,i=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((o,l)=>o!==r[l]));return(!this.#s||this.#e!==this.#l||i||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=at(this.#s,e(t))),this.#s}return t}#p(){return this.#n?.combine!==void 0&&this.#t.some((t,e)=>t.options.suspense&&this.#e[e]?.data===void 0)}#u(t){const e=new Map;this.#t.forEach(r=>{const i=r.options.queryHash;if(!i)return;const o=e.get(i);o?o.push(r):e.set(i,[r])});const s=[];return t.forEach(r=>{const i=this.#i.defaultQueryOptions(r),l=e.get(i.queryHash)?.shift()??new Oe(this.#i,i);s.push({defaultedQueryOptions:i,observer:l})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=Es(this.#e,s,e),this.#h())}#h(){if(this.hasListeners()){const t=this.#d(this.#e,this.#c),e=this.#p(),s=this.#s,r=e?s:this.#m(t,this.#n?.combine);(e||s!==r)&&he.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function Ps({queries:t,...e},s){const r=le(s),i=ct(),o=dt(),l=$.useMemo(()=>t.map(p=>{const g=r.defaultQueryOptions(p);return g._optimisticResults=i?"isRestoring":"optimistic",g}),[t,r,i]);l.forEach(p=>{mt(p);const g=r.getQueryCache().get(p.queryHash);ut(p,o,g)}),ft(o);const[d]=$.useState(()=>new Os(r,l,e)),[a,m,c]=d.getOptimisticResult(l,e.combine),u=!i&&e.subscribed!==!1;$.useSyncExternalStore($.useCallback(p=>u?d.subscribe(he.batchCalls(p)):ht,[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,e)},[l,e,d]);const h=a.some((p,g)=>Se(l[g],p))?a.flatMap((p,g)=>{const y=l[g];if(y&&Se(y,p)){const j=new Oe(r,y);return pt(y,j,o)}return[]}):[];if(h.length>0)throw Promise.all(h);const x=a.find((p,g)=>{const y=l[g];return y&&xt({result:p,errorResetBoundary:o,throwOnError:y.throwOnError,query:r.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(x?.error)throw x.error;return m(c())}function Ms(t,e){return Ps({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:gt,enabled:!0,placeholderData:void 0}))},e)}function Ke(t){const e=k.c(11),{properties:s,required:r,values:i,onChange:o}=t;let l;e[0]!==r?(l=r??[],e[0]=r,e[1]=l):l=e[1];let d;e[2]!==l?(d=new Set(l),e[2]=l,e[3]=d):d=e[3];const a=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==o||e[7]!==a||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,h]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,a.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:h.type})]}),h.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:h.description}),n.jsx(zs,{type:h.type,fieldKey:f,value:i[f],onChange:x=>o(f,x)})]},f)})}),e[6]=o,e[7]=a,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function zs(t){const e=k.c(19),{type:s,fieldKey:r,value:i,onChange:o}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==o?(u=x=>o(x.target.value),e[0]=o,e[1]=u):u=e[1];const f=`Enter ${r} as JSON…`;let h;return e[2]!==c||e[3]!==u||e[4]!==f?(h=n.jsx(ps,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=h):h=e[5],h}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==o?(u=p=>o(p==="true"),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(ms,{className:"h-7 text-xs",children:n.jsx(us,{placeholder:"Select…"})}),e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(fs,{children:[n.jsx(Ce,{value:"true",children:"true"}),n.jsx(Ce,{value:"false",children:"false"})]}),e[9]=h):h=e[9];let x;return e[10]!==c||e[11]!==u?(x=n.jsxs(hs,{value:c,onValueChange:u,children:[f,h]}),e[10]=c,e[11]=u,e[12]=x):x=e[12],x}const l=i??"";let d;e[13]!==o?(d=c=>o(c.target.value),e[13]=o,e[14]=d):d=e[14];const a=`Enter ${r}…`;let m;return e[15]!==l||e[16]!==d||e[17]!==a?(m=n.jsx(Fe,{className:"h-7 text-xs",value:l,onChange:d,placeholder:a}),e[15]=l,e[16]=d,e[17]=a,e[18]=m):m=e[18],m}const ne=8;function Rs(t){const e=k.c(16),{open:s,onOpenChange:r}=t,[i,o]=$.useState("");let l,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(rs,{children:"Manage home"}),d=n.jsx(os,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=l,e[1]=d):(l=e[0],d=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(At,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=a):a=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=p=>o(p.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(ls,{className:"px-5 py-4 border-b border-border",children:[l,d,n.jsxs("div",{className:"relative mt-3",children:[a,n.jsx(Fe,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(hn,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(es,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx($.Suspense,{fallback:u,children:n.jsx(Hs,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let h;e[9]!==c||e[10]!==f?(h=n.jsxs(as,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=h):h=e[11];let x;return e[12]!==r||e[13]!==s||e[14]!==h?(x=n.jsx(cs,{open:s,onOpenChange:r,children:h}),e[12]=r,e[13]=s,e[14]=h,e[15]=x):x=e[15],x}function Ls(t){const e=k.c(32),{org:s}=J(),r=He();let i;e[0]!==r?.ids?(i=r?.ids??[],e[0]=r?.ids,e[1]=i):i=e[1];const o=i,l=De(),d=It(),a=le();let m;e[2]!==s||e[3]!==a?(m=()=>a.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=a,e[4]=m):m=e[4];const c=m;let u;e[5]!==o?(u=C=>o.includes(C),e[5]=o,e[6]=u):u=e[6];const f=u;let h;e[7]!==o||e[8]!==t?(h=t?o.filter(C=>t.has(C)).length:o.length,e[7]=o,e[8]=t,e[9]=h):h=e[9];const p=h>=ne;let g;e[10]!==p||e[11]!==f||e[12]!==l?(g=C=>f(C)||p?Promise.resolve():l.apply(I=>I.includes(C)?null:[...I,C]),e[10]=p,e[11]=f,e[12]=l,e[13]=g):g=e[13];const y=g;let j;e[14]!==l?(j=C=>l.apply(I=>I.filter(T=>T!==C)),e[14]=l,e[15]=j):j=e[15];const w=j;let v;e[16]!==l?(v=C=>l.apply(()=>C),e[16]=l,e[17]=v):v=e[17];const b=v;let N;e[18]!==d||e[19]!==p||e[20]!==f||e[21]!==c||e[22]!==l?(N=async(C,I)=>{await d.update.mutateAsync({id:C.id,data:{metadata:I}}),!f(C.id)&&!p&&await l.apply(T=>T.includes(C.id)?null:[...T,C.id]),await c()},e[18]=d,e[19]=p,e[20]=f,e[21]=c,e[22]=l,e[23]=N):N=e[23];const S=N;let _;return e[24]!==y||e[25]!==p||e[26]!==o||e[27]!==f||e[28]!==w||e[29]!==b||e[30]!==S?(_={homeIds:o,isOnHome:f,atLimit:p,addAgent:y,removeAgent:w,reorder:b,saveAgentMetadata:S},e[24]=y,e[25]=p,e[26]=o,e[27]=f,e[28]=w,e[29]=b,e[30]=S,e[31]=_):_=e[31],_}function Hs(t){const e=k.c(21),{search:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const i=_t(r);let o;e[1]!==i?(o=new Set(i.map(Bs)),e[1]=i,e[2]=o):o=e[2];const l=Ls(o);let d,a,m;if(e[3]!==i||e[4]!==l||e[5]!==s){const p=new Map(i.map(Qs));d=s.trim().toLowerCase();const g=w=>!d||w.title?.toLowerCase().includes(d);a=l.homeIds.map(w=>p.get(w)).filter(Us).filter(g);const y=Kt(i);let j;e[9]!==l?(j=w=>!l.isOnHome(w.id),e[9]=l,e[10]=j):j=e[10],m=i.filter(Fs).filter(w=>!y.has(w.id)).filter(j).filter(g).sort(Ds),e[3]=i,e[4]=l,e[5]=s,e[6]=d,e[7]=a,e[8]=m}else d=e[6],a=e[7],m=e[8];const c=m;let u;e[11]!==l||e[12]!==a?(u=n.jsx(qs,{home:l,agents:a}),e[11]=l,e[12]=a,e[13]=u):u=e[13];const f=!!d;let h;e[14]!==c||e[15]!==l||e[16]!==f?(h=n.jsx(Ws,{home:l,agents:c,hasSearch:f}),e[14]=c,e[15]=l,e[16]=f,e[17]=h):h=e[17];let x;return e[18]!==u||e[19]!==h?(x=n.jsxs(n.Fragment,{children:[u,h]}),e[18]=u,e[19]=h,e[20]=x):x=e[20],x}function Ds(t,e){return(t.title??"").localeCompare(e.title??"")}function Fs(t){return t.id&&!wt(t.id)}function Us(t){return!!t}function Qs(t){return[t.id,t]}function Bs(t){return t.id}function We(t){const e=k.c(7),{title:s,hint:r}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=r&&n.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==i||e[5]!==o?(l=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,o]}),e[4]=i,e[5]=o,e[6]=l):l=e[6],l}function qs(t){const e=k.c(14),{home:s,agents:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={coordinateGetter:Qt},e[1]=o):o=e[1];const l=Me(oe(Re,i),oe(ze,o));let d;e[2]!==s?(d=h=>{const{active:x,over:p}=h;if(!p||x.id===p.id)return;const g=s.homeIds,y=g.indexOf(x.id),j=g.indexOf(p.id);y===-1||j===-1||s.reorder(Bt([...g],y,j)).catch(Ks)},e[2]=s,e[3]=d):d=e[3];const a=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(We,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==s||e[9]!==l?(u=r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Le,{sensors:l,collisionDetection:Lt,onDragEnd:a,children:n.jsx(Ht,{items:r.map(Vs),strategy:Dt,children:n.jsx("div",{className:"flex flex-col gap-1",children:r.map(h=>n.jsx(Js,{agent:h,home:s},h.id))})})}),e[6]=r,e[7]=a,e[8]=s,e[9]=l,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Vs(t){return t.id}function Ks(){return U.error("Couldn't reorder home — please try again.")}function Ws(t){const e=k.c(6),{home:s,agents:r,hasSearch:i}=t,[o,l]=$.useState(20);let d;if(e[0]!==r||e[1]!==i||e[2]!==s||e[3]!==o){const a=r.slice(0,o);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(We,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:a.map(c=>n.jsx(Ys,{agent:c,home:s},c.id))}),r.length>o&&n.jsxs("button",{type:"button",onClick:()=>l(Gs),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",r.length-o,")"]})]})]}),e[0]=r,e[1]=i,e[2]=s,e[3]=o,e[4]=d}else d=e[4];return d}function Gs(t){return t+20}function Ge(t){const e=Z(t.metadata?.ui).filter(o=>!!o.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&i.push(`${r} prompt${r===1?"":"s"}`),r===0&&i.push("prompts off"),i.join(" · ")}function Js(t){const e=k.c(57),{agent:s,home:r}=t,[i,o]=$.useState(!1);let l;e[0]!==s.id?(l={id:s.id},e[0]=s.id,e[1]=l):l=e[1];const{attributes:d,listeners:a,setNodeRef:m,transform:c,transition:u,isDragging:f}=Ft(l),h=Ge(s)||"Quick access";let x;e[2]!==c?(x=Ut.Transform.toString(c),e[2]=c,e[3]=x):x=e[3];const p=f?.5:void 0,g=f?100:void 0;let y;e[4]!==x||e[5]!==p||e[6]!==g||e[7]!==u?(y={transform:x,transition:u,opacity:p,zIndex:g},e[4]=x,e[5]=p,e[6]=g,e[7]=u,e[8]=y):y=e[8];const j=y,w=f&&"shadow-lg";let v;e[9]!==w?(v=G("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=v):v=e[10];const b=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Qe,{size:14}),e[11]=N):N=e[11];let S;e[12]!==d||e[13]!==a||e[14]!==b?(S=n.jsx("button",{type:"button",...d,...a,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":b,children:N}),e[12]=d,e[13]=a,e[14]=b,e[15]=S):S=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(Zs),e[16]=_):_=e[16];const C=s.title??s.id;let I;e[17]!==s.icon||e[18]!==C?(I=n.jsx(de,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=I):I=e[19];const T=s.title??s.id;let E;e[20]!==T?(E=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=E):E=e[21];let P;e[22]!==h?(P=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:h}),e[22]=h,e[23]=P):P=e[23];let M;e[24]!==E||e[25]!==P?(M=n.jsxs("div",{className:"min-w-0 flex-1",children:[E,P]}),e[24]=E,e[25]=P,e[26]=M):M=e[26];const Q=i&&"rotate-180";let z;e[27]!==Q?(z=G("shrink-0 text-muted-foreground transition-transform",Q),e[27]=Q,e[28]=z):z=e[28];let R;e[29]!==z?(R=n.jsx(Ue,{size:16,className:z}),e[29]=z,e[30]=R):R=e[30];let q;e[31]!==i||e[32]!==I||e[33]!==M||e[34]!==R?(q=n.jsxs("button",{type:"button",onClick:_,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,M,R]}),e[31]=i,e[32]=I,e[33]=M,e[34]=R,e[35]=q):q=e[35];let A;e[36]!==s.id||e[37]!==r?(A=()=>r.removeAgent(s.id).catch(Xs),e[36]=s.id,e[37]=r,e[38]=A):A=e[38];const B=`Remove ${s.title??s.id} from home`;let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Pe,{size:14}),e[39]=L):L=e[39];let O;e[40]!==A||e[41]!==B?(O=n.jsx("button",{type:"button",onClick:A,"aria-label":B,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:L}),e[40]=A,e[41]=B,e[42]=O):O=e[42];let D;e[43]!==S||e[44]!==q||e[45]!==O?(D=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,q,O]}),e[43]=S,e[44]=q,e[45]=O,e[46]=D):D=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==r?(F=i&&n.jsx(Je,{agent:s,home:r}),e[47]=s,e[48]=i,e[49]=r,e[50]=F):F=e[50];let K;return e[51]!==m||e[52]!==j||e[53]!==D||e[54]!==F||e[55]!==v?(K=n.jsxs("div",{ref:m,style:j,className:v,children:[D,F]}),e[51]=m,e[52]=j,e[53]=D,e[54]=F,e[55]=v,e[56]=K):K=e[56],K}function Xs(){return U.error("Couldn't remove from home — please try again.")}function Zs(t){return!t}function Ys({agent:t,home:e}){const[s,r]=$.useState(!1),[i,o]=$.useState(!1),l=Ge(t),d=async()=>{if(!e.atLimit){o(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{o(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>r(a=>!a),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(de,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),l&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:l})]}),n.jsx(Ue,{size:16,className:G("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(ae,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(Je,{agent:t,home:e})]})}function Je(t){const e=k.c(17),{agent:s,home:r}=t,i=s.metadata?.ui;let o;e[0]!==i?(o=Z(i),e[0]=i,e[1]=o):o=e[1];const l=o;let d;e[2]!==s.connections?(d=(s.connections??[]).map(en).sort(),e[2]=s.connections,e[3]=d):d=e[3];const a=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==a||e[6]!==r||e[7]!==l?(c=n.jsx(sn,{agent:s,home:r,connectionIds:a,pinnedTiles:l}),e[4]=s,e[5]=a,e[6]=r,e[7]=l,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(tn,{}),e[9]=u):u=e[9];const f=m??null;let h;e[10]!==s||e[11]!==r||e[12]!==f?(h=n.jsx($.Suspense,{fallback:u,children:n.jsx(an,{agent:s,home:r,curated:f})}),e[10]=s,e[11]=r,e[12]=f,e[13]=h):h=e[13];let x;return e[14]!==c||e[15]!==h?(x=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,h]}),e[14]=c,e[15]=h,e[16]=x):x=e[16],x}function en(t){return t.connection_id}function tn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(H,{className:"h-8 w-full"}),n.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function sn({agent:t,home:e,connectionIds:s,pinnedTiles:r}){const i=Ve(),{data:o,isLoading:l}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),h=(f?.tools??[]).flatMap(x=>{const p=Be(x._meta);return p?[{name:x.name,description:x.description,resourceUri:p,inputSchema:x.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:h}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(l)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!o||o.length===0)return null;const d=new Map;for(const c of o)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const a=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=r.some(c=>!!a(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),r.map(c=>{const u=a(c);return u?n.jsx(on,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),o.map(c=>c.uiTools.map(u=>n.jsx(ln,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function Xe(t,e){const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;if((o==="object"||o==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[r]=JSON.parse(i)}catch{return null}}else if((o==="number"||o==="integer")&&typeof i=="string"){if(!i.trim())continue;s[r]=Number(i)}else i!==""&&i!=null&&(s[r]=i)}return s}function nn(t,e){if(!t||!e)return{};const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;(o==="object"||o==="array")&&i!=null&&typeof i!="string"?s[r]=JSON.stringify(i,null,2):s[r]=i}return s}function rn(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,r])=>{const i=typeof r=="object"?JSON.stringify(r):String(r);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function on({agent:t,home:e,connection:s,tool:r,tile:i}){const[o,l]=$.useState(!1),[d,a]=$.useState(!1),m=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[c,u]=$.useState(()=>nn(i.toolInput,r.inputSchema?.properties)),f=async()=>{l(!0);try{const p=Z(t.metadata?.ui),g=i.tileId?p.filter(j=>j.tileId!==i.tileId):p.filter(j=>j!==i),y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:g}};await e.saveAgentMetadata(t,y),a(!1)}catch(p){console.error("[home-tiles] failed to remove tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},h=async()=>{l(!0);try{let p;if(m&&r.inputSchema?.properties){const w=Xe(c,r.inputSchema.properties);if(!w){U.error("Invalid JSON in one of the fields — please fix it."),l(!1);return}Object.keys(w).length>0&&(p=w)}const y=Z(t.metadata?.ui).map(w=>(i.tileId?w.tileId===i.tileId:w===i)?{...w,toolInput:p}:w),j={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,j),a(!1)}catch(p){console.error("[home-tiles] failed to save tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},x=rn(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(r.name)}),x&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:x})]}),m&&n.jsx("button",{type:"button",onClick:()=>a(p=>!p),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(Et,{size:14})}),n.jsx(we,{isPinned:!0,submitting:o,onClick:f,label:"Remove from home"})]}),d&&m&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:c,onChange:(p,g)=>u(y=>({...y,[p]:g}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>a(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:o,onClick:h,children:o?n.jsx(ae,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function ln({agent:t,home:e,connection:s,tool:r}){const[i,o]=$.useState(!1),[l,d]=$.useState(!1),a=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(a&&!l){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{o(!0);try{let h;if(a&&r.inputSchema?.properties){const y=Xe(m,r.inputSchema.properties);if(!y){U.error("Invalid JSON in one of the fields — please fix it."),o(!1);return}Object.keys(y).length>0&&(h=y)}const p=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:r.resourceUri,toolName:r.name,...h?{toolInput:h}:{}}],g={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:p}};await e.saveAgentMetadata(t,g),d(!1),c({})}catch(h){console.error("[home-tiles] failed to add tile",h),U.error("Couldn't update home — please try again.")}finally{o(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(r.name)}),n.jsx(we,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),l&&a&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:m,onChange:(h,x)=>c(p=>({...p,[h]:x}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(ae,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function we(t){const e=k.c(11),{isPinned:s,submitting:r,onClick:i,label:o}=t,l=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==l?(d=G("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",l),e[0]=l,e[1]=d):d=e[1];let a;e[2]!==s||e[3]!==r?(a=r?n.jsx(ae,{size:12,className:"animate-spin"}):s?n.jsx(Ot,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=r,e[4]=a):a=e[4];let m;return e[5]!==o||e[6]!==i||e[7]!==r||e[8]!==d||e[9]!==a?(m=n.jsx("button",{type:"button",onClick:i,disabled:r,"aria-label":o,title:o,className:d,children:a}),e[5]=o,e[6]=i,e[7]=r,e[8]=d,e[9]=a,e[10]=m):m=e[10],m}function an(t){const e=k.c(32),{agent:s,home:r,curated:i}=t,{org:o}=J();let l;e[0]!==s.id||e[1]!==o.id||e[2]!==o.slug?(l={connectionId:s.id,orgId:o.id,orgSlug:o.slug},e[0]=s.id,e[1]=o.id,e[2]=o.slug,e[3]=l):l=e[3];const d=ce(l);let a;e[4]!==s.id||e[5]!==o.id?(a=te.agentPrompts(o.id,s.id),e[4]=s.id,e[5]=o.id,e[6]=a):a=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:b}=await d.listPrompts();return b.map(un)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==a||e[10]!==m?(c={queryKey:a,queryFn:m,staleTime:3e4,retry:!1},e[9]=a,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:h}=se(c),x=ve(o.slug);let p,g;if(e[12]!==s.id||e[13]!==u||e[14]!==x.prompts){let b;e[17]!==s.id?(b=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=b):b=e[18],p=x.prompts.filter(b).map(mn);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],g=[...N];for(const S of p)g.some(_=>_.name===S.name)||g.push(S);e[12]=s.id,e[13]=u,e[14]=x.prompts,e[15]=p,e[16]=g}else p=e[15],g=e[16];if(f&&p.length===0){let b;return e[21]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=b):b=e[21],b}if(h&&p.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,h),null;if(g.length===0)return null;let y;e[22]!==i||e[23]!==g?(y=i??g.map(dn),e[22]=i,e[23]=g,e[24]=y):y=e[24];let j;e[25]!==y?(j=new Set(y),e[25]=y,e[26]=j):j=e[26];const w=j;let v;return e[27]!==s||e[28]!==r||e[29]!==g||e[30]!==w?(v=n.jsx("div",{className:"flex flex-col gap-0.5",children:g.map(b=>n.jsx(fn,{agent:s,home:r,prompt:b,allPromptNames:g.map(cn),isPinned:w.has(b.name)},b.name))}),e[27]=s,e[28]=r,e[29]=g,e[30]=w,e[31]=v):v=e[31],v}function cn(t){return t.name}function dn(t){return t.name}function mn(t){return{name:t.promptName,title:t.title,description:t.description}}function un(t){return{name:t.name,title:t.title,description:t.description}}function fn({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:i}){const[o,l]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}l(!0);try{const a=t.metadata?.ui?.homePrompts;let m;Array.isArray(a)?m=i?a.filter(u=>u!==s.name):[...a,s.name]:m=i?r.filter(u=>u!==s.name):r;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),U.error("Couldn't update home — please try again.")}finally{l(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(we,{isPinned:i,submitting:o,onClick:d,label:i?"Remove from home":"Add to home"})]})}function hn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},pn)}),t[0]=e):e=t[0],e}function pn(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ze=`home-board.layout.v${ee}`;function Ye(t){return`home-board.layout.v${ee}.${t}`}const et={version:ee,tiles:{},hidden:[]};function pe(t){return!t||t.version!==ee?et:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function xn(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function gn(t){try{const e=localStorage.getItem(Ye(t));return e?pe(JSON.parse(e)):void 0}catch{return}}function Ie(t,e){try{localStorage.setItem(Ye(t),JSON.stringify(e))}catch{}}async function Te(t,e){if(!(await fetch(`/api/${t}/kv/${Ze}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function bn(t){const e=k.c(24),s=le();let r;e[0]!==t?(r=te.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const i=r;let o;e[2]!==t?(o=gn(t),e[2]=t,e[3]=o):o=e[3];const l=o;let d;e[4]!==l||e[5]!==t?(d=async()=>{const y=await fetch(`/api/${t}/kv/${Ze}`);if(y.status===404)return l&&xn(l)?(await Te(t,l),l):et;if(!y.ok)throw new Error("Failed to load board layout");const j=await y.json(),w=pe(j.value);return Ie(t,w),w},e[4]=l,e[5]=t,e[6]=d):d=e[6];let a;e[7]!==l||e[8]!==i||e[9]!==d?(a={queryKey:i,queryFn:d,initialData:l,staleTime:0,refetchOnWindowFocus:!1},e[7]=l,e[8]=i,e[9]=d,e[10]=a):a=e[10];const{data:m,isLoading:c}=se(a);let u;e[11]!==t?(u={mutationFn:y=>Te(t,y)},e[11]=t,e[12]=u):u=e[12];const f=bt(u);let h;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(h=y=>{Ie(t,y),s.setQueryData(i,y),f.mutate(y)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=h):h=e[17];const x=h;let p;e[18]!==m?(p=pe(m),e[18]=m,e[19]=p):p=e[19];let g;return e[20]!==c||e[21]!==x||e[22]!==p?(g={layout:p,isLoading:c,save:x},e[20]=c,e[21]=x,e[22]=p,e[23]=g):g=e[23],g}const tt=$.createContext(null);function yn(t){const e=k.c(24),{children:s}=t,{org:r}=J(),i=bn(r.slug),[o,l]=$.useState(!1),[d,a]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{a(i.layout),l(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),l(!1)},e[2]=u):u=e[2];const f=u;let h;e[3]!==d||e[4]!==i?(h=()=>{d&&i.save(d),a(null),l(!1)},e[3]=d,e[4]=i,e[5]=h):h=e[5];const x=h,p=o&&d!==null,g=p?d:i.layout;let y;e[6]!==d||e[7]!==p||e[8]!==i.layout?(y=p?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=p,e[8]=i.layout,e[9]=y):y=e[9];const j=y;let w;e[10]!==o||e[11]!==i?(w=S=>{o?a(S):i.save(S)},e[10]=o,e[11]=i,e[12]=w):w=e[12];const v=w;let b;e[13]!==v||e[14]!==c||e[15]!==j||e[16]!==o||e[17]!==g||e[18]!==x||e[19]!==i.isLoading?(b={isEditMode:o,enter:c,cancel:f,save:x,hasChanges:j,layout:g,isLayoutLoading:i.isLoading,commitLayout:v},e[13]=v,e[14]=c,e[15]=j,e[16]=o,e[17]=g,e[18]=x,e[19]=i.isLoading,e[20]=b):b=e[20];let N;return e[21]!==s||e[22]!==b?(N=n.jsx(tt.Provider,{value:b,children:s}),e[21]=s,e[22]=b,e[23]=N):N=e[23],N}function st(){const t=$.useContext(tt);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function vn({agentId:t}){const{org:e,locator:s}=J(),r=ce({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=vs(),{setTaskId:o}=Zt(),[l,d]=$.useState(null),[a,m]=$.useState(!1),c=$.useRef(!1),u=async(g,y)=>{if(!r){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const j=await ys(r,g.name,y),w={type:"doc",content:[{type:"paragraph",content:[ss({id:g.name,name:ns(g.name,is(g._meta)),metadata:j.messages,char:"/",kind:"prompt",args:y}),{type:"text",text:" "}]}]},v=crypto.randomUUID();js(sessionStorage,s,v,{tiptapDoc:w}),await i({id:v,virtual_mcp_id:t}),o(v,t,{autosend:!0})}catch(j){console.error("[start-thread-from-prompt] failed",j),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async g=>{if(!c.current){if(g.arguments&&g.arguments.length>0){d(g);return}await u(g)}},h=async g=>{if(!l)return;const y=l;d(null),await u(y,g)};return{start:f,startBlank:async g=>{if(!c.current){c.current=!0,m(!0);try{const y=crypto.randomUUID();await i({id:y,virtual_mcp_id:t}),o(y,t,g?.main?{main:g.main}:void 0)}catch(y){console.error("[start-thread-from-prompt] startBlank failed",y),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(ts,{prompt:l,setPrompt:g=>d(g),onSubmit:h}),dialogPrompt:l,starting:a}}const V=4,W=100,ke=12,jn=5,wn={w:2,h:2};class xe extends $.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(yt,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function Nn(t){const e=k.c(72),{tiles:s,isEditMode:r,renderTile:i,onMove:o,onResize:l,onRemove:d}=t,a=be(),m=$.useRef(null),[c,u]=$.useState(null),[f,h]=$.useState(null);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={activationConstraint:{distance:4}},e[0]=x):x=e[0];const p=Me(oe(Re,x),oe(ze)),g=s.reduce(Sn,0),y=r?Math.max(g+2,4):Math.max(g,1);let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/V,cellHeight:W}:null},e[1]=j):j=e[1];const w=j;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=A=>{u(String(A.active.id)),h(w())},e[2]=v):v=e[2];const b=v;let N;e[3]!==f||e[4]!==o||e[5]!==s?(N=A=>{const B=String(A.active.id),L=f??w();if(u(null),h(null),!L||L.cellWidth<=0)return;const O=s.find(K=>K.id===B);if(!O)return;const D=Math.round(A.delta.x/L.cellWidth),F=Math.round(A.delta.y/L.cellHeight);D===0&&F===0||o(B,{x:O.x+D,y:O.y+F})},e[3]=f,e[4]=o,e[5]=s,e[6]=N):N=e[6];const S=N;if(a){let A;if(e[7]!==i||e[8]!==s){let L;e[10]!==i?(L=O=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:W},children:n.jsx(xe,{children:i(O)})},O.id),e[10]=i,e[11]=L):L=e[11],A=s.map(L),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let B;return e[12]!==A?(B=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=B):B=e[13],B}let _,C,I,T,E,P,M,Q,z;if(e[14]!==c||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==d||e[19]!==l||e[20]!==i||e[21]!==p||e[22]!==s||e[23]!==y){const A=c?s.find(X=>X.id===c):null;C=Le,Q=p,z=b,I=S;const B=y*W,L=r?W*4:W;let O;e[33]!==B||e[34]!==L?(O={height:B,minHeight:L},e[33]=B,e[34]=L,e[35]=O):O=e[35];let D;e[36]!==r||e[37]!==s||e[38]!==y?(D=r&&n.jsx(Cn,{rows:y,tiles:s}),e[36]=r,e[37]=s,e[38]=y,e[39]=D):D=e[39];let F;if(e[40]!==c||e[41]!==r||e[42]!==d||e[43]!==l||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==r||e[49]!==d||e[50]!==l||e[51]!==i?(X=ie=>n.jsx(In,{tile:ie,isEditMode:r,isDragging:c===ie.id,onResize:l,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=r,e[49]=d,e[50]=l,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=r,e[42]=d,e[43]=l,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==O||e[54]!==D||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:O,children:[D,F]}),e[53]=O,e[54]=D,e[55]=F,e[56]=T):T=e[56],_=qt,E=null;const K=A&&f?A.w*f.cellWidth-ke:void 0,me=A&&f?A.h*f.cellHeight-ke:void 0;e[57]!==K||e[58]!==me?(P={width:K,height:me},e[57]=K,e[58]=me,e[59]=P):P=e[59],M=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(xe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=r,e[17]=S,e[18]=d,e[19]=l,e[20]=i,e[21]=p,e[22]=s,e[23]=y,e[24]=_,e[25]=C,e[26]=I,e[27]=T,e[28]=E,e[29]=P,e[30]=M,e[31]=Q,e[32]=z}else _=e[24],C=e[25],I=e[26],T=e[27],E=e[28],P=e[29],M=e[30],Q=e[31],z=e[32];let R;e[60]!==_||e[61]!==E||e[62]!==P||e[63]!==M?(R=n.jsx(_,{dropAnimation:E,style:P,children:M}),e[60]=_,e[61]=E,e[62]=P,e[63]=M,e[64]=R):R=e[64];let q;return e[65]!==C||e[66]!==I||e[67]!==T||e[68]!==R||e[69]!==Q||e[70]!==z?(q=n.jsxs(C,{sensors:Q,onDragStart:z,onDragEnd:I,children:[T,R]}),e[65]=C,e[66]=I,e[67]=T,e[68]=R,e[69]=Q,e[70]=z,e[71]=q):q=e[71],q}function Sn(t,e){return Math.max(t,e.y+e.h)}function Cn(t){const e=k.c(7),{rows:s,tiles:r}=t;let i;e[0]!==r?(i=(a,m)=>r.some(c=>a>=c.x&&a<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=r,e[1]=i):i=e[1];const o=i;let l;if(e[2]!==o||e[3]!==s){l=[];for(let a=0;a<s;a++)for(let m=0;m<V;m++)o(m,a)||l.push({x:m,y:a});e[2]=o,e[3]=s,e[4]=l}else l=e[4];let d;return e[5]!==l?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:l.map(_n)}),e[5]=l,e[6]=d):d=e[6],d}function _n(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/V*100}%`,top:t.y*W,width:`${1/V*100}%`,height:W},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function In(t){const e=k.c(31),{tile:s,isEditMode:r,isDragging:i,onResize:o,onRemove:l,children:d}=t,a=!r;let m;e[0]!==a||e[1]!==s.id?(m={id:s.id,disabled:a},e[0]=a,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:h}=Vt(m),x=`${s.x/V*100}%`,p=`${s.w/V*100}%`,g=s.y*W,y=s.h*W,j=h||i,w=!j&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=j&&"opacity-30";let b;e[3]!==w||e[4]!==v?(b=G("absolute p-1 will-change-[left,top,width,height,opacity]",w,v),e[3]=w,e[4]=v,e[5]=b):b=e[5];let N;e[6]!==y||e[7]!==x||e[8]!==g||e[9]!==p?(N={left:x,top:g,width:p,height:y},e[6]=y,e[7]=x,e[8]=g,e[9]=p,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let _;e[11]!==S?(_=G("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=_):_=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==l||e[17]!==o||e[18]!==s?(C=r&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(Qe,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(Tn,{tile:s,onResize:o,onRemove:l})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=l,e[17]=o,e[18]=s,e[19]=C):C=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(xe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==_||e[24]!==C?(T=n.jsxs("div",{className:_,children:[C,I]}),e[22]=I,e[23]=_,e[24]=C,e[25]=T):T=e[25];let E;return e[26]!==c||e[27]!==T||e[28]!==b||e[29]!==N?(E=n.jsx("div",{ref:c,className:b,style:N,children:T}),e[26]=c,e[27]=T,e[28]=b,e[29]=N,e[30]=E):E=e[30],E}function Tn(t){const e=k.c(20),{tile:s,onResize:r,onRemove:i}=t,[o,l]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ws,{asChild:!0,children:n.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:n.jsx(Pt,{size:16})})}),e[0]=d):d=e[0];let a;e[1]!==r||e[2]!==s.id?(a=g=>{r(s.id,g),l(!1)},e[1]=r,e[2]=s.id,e[3]=a):a=e[3];let m;e[4]!==a||e[5]!==s?(m=n.jsx(kn,{tile:s,onPick:a}),e[4]=a,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ns,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Is,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let h;e[12]!==u?(h=n.jsxs(Ss,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=h):h=e[13];let x;e[14]!==m||e[15]!==h?(x=n.jsxs(Cs,{align:"end",className:"w-auto",children:[m,c,h]}),e[14]=m,e[15]=h,e[16]=x):x=e[16];let p;return e[17]!==o||e[18]!==x?(p=n.jsxs(_s,{open:o,onOpenChange:l,children:[d,x]}),e[17]=o,e[18]=x,e[19]=p):p=e[19],p}function kn(t){const e=k.c(19),{tile:s,onPick:r}=t,i=s.minW??1,o=s.minH??1,[l,d]=$.useState(null);let a;e[0]!==l||e[1]!==s.h||e[2]!==s.w?(a=l??{w:s.w,h:s.h},e[0]=l,e[1]=s.h,e[2]=s.w,e[3]=a):a=e[3];const m=a;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,h;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${V}, 1.25rem)`},h=()=>d(null),e[8]=f,e[9]=h):(f=e[8],h=e[9]);let x;e[10]!==m.h||e[11]!==m.w||e[12]!==o||e[13]!==i||e[14]!==r?(x=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:h,children:Array.from({length:jn},(g,y)=>Array.from({length:V},(j,w)=>{const v=w+1,b=y+1,N=v<i||b<o,S=v<=m.w&&b<=m.h;return n.jsx("button",{type:"button",disabled:N,"aria-label":`${v} by ${b}`,onPointerEnter:()=>d({w:v,h:b}),onClick:()=>r({w:v,h:b}),className:G("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",N?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${v}x${b}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=o,e[13]=i,e[14]=r,e[15]=x):x=e[15];let p;return e[16]!==u||e[17]!==x?(p=n.jsxs("div",{className:"px-2 py-1.5",children:[u,x]}),e[16]=u,e[17]=x,e[18]=p):p=e[18],p}function $n(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function ge(t,e,s){for(let r=0;r<100;r++)for(let i=0;i<=V-e;i++){let o=!0;for(let l=0;l<s&&o;l++)for(let d=0;d<e&&o;d++)$n(t,i+d,r+l)&&(o=!1);if(o)return{x:i,y:r}}return{x:0,y:0}}function ue(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(V,t)),i=Math.max(s.h,Math.min(6,e));return{w:r,h:i}}function fe(t,e,s){const r=Math.max(0,Math.min(V-s,t)),i=Math.max(0,e);return{x:r,y:i}}function An(t,e,s){const r=t.find(a=>a.id===e);if(!r)return t;const i=t.filter(a=>a.id!==e),o=i.find(a=>s.x>=a.x&&s.x<a.x+a.w&&s.y>=a.y&&s.y<a.y+a.h);if(o&&o.w===r.w&&o.h===r.h)return t.map(a=>a.id===e?{...a,x:o.x,y:o.y}:a.id===o.id?{...a,x:r.x,y:r.y}:a);const d=[{...r,x:s.x,y:s.y}];for(const a of i){const m=ge(d,a.w,a.h);d.push({...a,x:m.x,y:m.y})}return d}function En(t){const e=k.c(35),{layout:s,isLayoutLoading:r,commitLayout:i}=st();let o;e[0]!==s.hidden?(o=new Set(s.hidden),e[0]=s.hidden,e[1]=o):o=e[1];const l=o;let d,a;if(e[2]!==t||e[3]!==l||e[4]!==s.tiles){a=[];let j;e[7]!==l?(j=v=>v.pinned||!l.has(v.id),e[7]=l,e[8]=j):j=e[8];const w=t.filter(j);d=new Map;for(const v of t)v.minSize&&d.set(v.id,v.minSize);for(const v of w){const b=s.tiles[v.id];if(!b)continue;const N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),{x:C,y:I}=fe(b.x,b.y,S);a.push({id:v.id,x:C,y:I,w:S,h:_,minW:N?.w,minH:N?.h})}for(const v of w){if(a.some(I=>I.id===v.id))continue;const b=v.defaultSize??wn,N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),C=ge(a,S,_);a.push({id:v.id,x:C.x,y:C.y,w:S,h:_,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=l,e[4]=s.tiles,e[5]=d,e[6]=a}else d=e[5],a=e[6];let m;e[9]!==t?(m=new Set(t.map(On)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(j,w)=>{const v={};for(const b of j)v[b.id]={x:b.x,y:b.y,w:b.w,h:b.h};i({version:ee,tiles:v,hidden:w.filter(b=>c.has(b))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let h;e[14]!==a?(h={visible:a},e[14]=a,e[15]=h):h=e[15];let x;e[16]!==f||e[17]!==s||e[18]!==a?(x=(j,w)=>{const v=a.find(S=>S.id===j);if(!v)return;const b=fe(w.x,w.y,v.w);if(b.x===v.x&&b.y===v.y)return;const N=An(a,j,b);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=a,e[19]=x):x=e[19];let p;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==a?(p=(j,w)=>{const v=a.find(T=>T.id===j);if(!v)return;const b=d.get(j),{w:N,h:S}=ue(w.w,w.h,b);if(N===v.w&&S===v.h)return;const _={...v,w:N,h:S,x:fe(v.x,v.y,N).x},C=a.filter(T=>T.id!==j),I=[_];for(const T of C){const E=ge(I,T.w,T.h);I.push({...T,x:E.x,y:E.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=a,e[24]=p):p=e[24];let g;e[25]!==f||e[26]!==s||e[27]!==a?(g=j=>{const w=a.filter(v=>v.id!==j);f(w,Array.from(new Set([...s.hidden,j])))},e[25]=f,e[26]=s,e[27]=a,e[28]=g):g=e[28];let y;return e[29]!==r||e[30]!==h||e[31]!==x||e[32]!==p||e[33]!==g?(y={snapshot:h,isLoading:r,moveTile:x,resizeTile:p,hideTile:g},e[29]=r,e[30]=h,e[31]=x,e[32]=p,e[33]=g,e[34]=y):y=e[34],y}function On(t){return t.id}const Pn={w:2,h:4},Mn={w:1,h:2},zn={w:1,h:1};function Rn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function Ln(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function Hn(t){return t.promptName?t.agentName:t.description}function Dn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function nt(t){const e=k.c(14),{org:s}=J();let r;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(r=Nt({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=r):r=e[3];const{data:i}=se(r),o=!!i&&!t.toolName;let l;e[4]!==i||e[5]!==o?(l={client:i,enabled:o},e[4]=i,e[5]=o,e[6]=l):l=e[6];const{data:d}=xs(l);let a;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(a=t.toolName??d?.tools.find(u=>Be(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=a):a=e[10];const m=a;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?bs(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:i,dialog:o,starting:l}=vn(s);let d;e[2]!==r||e[3]!==i?(d=c=>{if(!c.promptName){i();return}r(Dn(c))},e[2]=r,e[3]=i,e[4]=d):d=e[4];const a=d;let m;return e[5]!==o||e[6]!==a||e[7]!==i||e[8]!==l?(m={open:a,startBlank:i,dialog:o,starting:l},e[5]=o,e[6]=a,e[7]=i,e[8]=l,e[9]=m):m=e[9],m}function Fn(t){const e=k.c(32),{entry:s,isEditMode:r}=t,{open:i,dialog:o,starting:l}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const a=l||r,m=!r&&"cursor-pointer transition-colors hover:bg-accent/40",c=r&&"cursor-default pl-12",u=l&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=G("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let h;e[7]!==s.agentIcon||e[8]!==s.agentName?(h=n.jsx(de,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=h):h=e[9];let x;e[10]!==s.title?(x=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=x):x=e[11];let p;e[12]!==s?(p=Hn(s),e[12]=s,e[13]=p):p=e[13];let g;e[14]!==p?(g=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:p}),e[14]=p,e[15]=g):g=e[15];let y;e[16]!==g||e[17]!==x?(y=n.jsxs("div",{className:"min-w-0 flex-1",children:[x,g]}),e[16]=g,e[17]=x,e[18]=y):y=e[18];let j;e[19]!==r?(j=!r&&n.jsx(gs,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=r,e[20]=j):j=e[20];let w;e[21]!==l||e[22]!==d||e[23]!==y||e[24]!==j||e[25]!==a||e[26]!==f||e[27]!==h?(w=n.jsxs("button",{type:"button",onClick:d,disabled:a,"aria-busy":l,className:f,children:[h,y,j]}),e[21]=l,e[22]=d,e[23]=y,e[24]=j,e[25]=a,e[26]=f,e[27]=h,e[28]=w):w=e[28];let v;return e[29]!==o||e[30]!==w?(v=n.jsxs(n.Fragment,{children:[w,o]}),e[29]=o,e[30]=w,e[31]=v):v=e[31],v}function Un(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},Qn)}),t[0]=e):e=t[0],e}function Qn(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(H,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Bn(t){const e=k.c(17),{tile:s,prompts:r,isEditMode:i,tileWidth:o}=t,{org:l}=J(),{open:d,startBlank:a,dialog:m,starting:c}=Ne(s.agentId),u=r.filter(qn),f=nt(s),h="relative flex h-full w-full flex-col p-3";let x;e[0]!==i||e[1]!==f||e[2]!==a||e[3]!==c?(x=!i&&n.jsx("button",{type:"button",onClick:()=>{a(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=a,e[3]=c,e[4]=x):x=e[4];const p="flex min-h-0 flex-1 gap-3 overflow-hidden";let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Kn,{}),e[5]=g):g=e[5];let y;e[6]!==l.id||e[7]!==l.slug||e[8]!==s?(y=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:g,children:n.jsx(Vn,{tile:s,orgId:l.id,orgSlug:l.slug})})}),e[6]=l.id,e[7]=l.slug,e[8]=s,e[9]=y):y=e[9];const j=u.length>0&&!i&&o>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(b=>n.jsx("button",{type:"button",onClick:()=>d(b),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let w;e[10]!==y||e[11]!==j?(w=n.jsxs("div",{className:p,children:[y,j]}),e[10]=y,e[11]=j,e[12]=w):w=e[12];let v;return e[13]!==m||e[14]!==x||e[15]!==w?(v=n.jsxs("div",{className:h,children:[x,w,m]}),e[13]=m,e[14]=x,e[15]=w,e[16]=v):v=e[16],v}function qn(t){return!!t.promptName}function Vn(t){const e=k.c(13),{tile:s,orgId:r,orgSlug:i}=t;let o;e[0]!==r||e[1]!==i||e[2]!==s.connectionId?(o={connectionId:s.connectionId,orgId:r,orgSlug:i},e[0]=r,e[1]=i,e[2]=s.connectionId,e[3]=o):o=e[3];const l=ce(o),d=s.minHeight??200,a=s.maxHeight??4e3;let m;return e[4]!==l||e[5]!==r||e[6]!==i||e[7]!==d||e[8]!==a||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(ds,{resourceURI:s.resourceUri,orgId:r,orgSlug:i,connectionId:s.connectionId,client:l,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:a,className:"h-full"}),e[4]=l,e[5]=r,e[6]=i,e[7]=d,e[8]=a,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function Kn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Wn(t){const e=k.c(14),{icon:s,name:r}=t;let i;e[0]!==s||e[1]!==r?(i=n.jsx(de,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=i):i=e[2];let o;e[3]!==r?(o=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=l):l=e[5];let d;e[6]!==o?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[o,l]}),e[6]=o,e[7]=d):d=e[7];let a;e[8]!==i||e[9]!==d?(a=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=a):a=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==a?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,m]}),e[12]=a,e[13]=c):c=e[13],c}function Gn(t){const e=k.c(10),{tile:s,prompts:r,isEditMode:i}=t,{open:o,startBlank:l,dialog:d,starting:a}=Ne(s.agentId),m=r.filter(Jn),c=nt(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==l?(f=()=>{l(c?{main:c}:void 0)},e[0]=c,e[1]=l,e[2]=f):f=e[2];const h=a||i;let x;e[3]!==f||e[4]!==h?(x=n.jsx("button",{type:"button",onClick:f,disabled:h,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=h,e[5]=x):x=e[5];const p=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(y=>n.jsx("button",{type:"button",onClick:()=>!i&&o(y),disabled:a,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:y.title})},y.promptName))});let g;return e[6]!==d||e[7]!==x||e[8]!==p?(g=n.jsxs("div",{className:u,children:[x,p,d]}),e[6]=d,e[7]=x,e[8]=p,e[9]=g):g=e[9],g}function Jn(t){return!!t.promptName}function it({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:r,tiles:i}=ve(e.slug),o=He()?.ids??[],l=new Set(o),d=De(),a=Ve(),m=le(),c=new Set(i.map(b=>b.agentId)),u=new Map;for(const b of r){const N=u.get(b.agentId);N?N.push(b):u.set(b.agentId,[b])}const f=r.filter(b=>!c.has(b.agentId)),h=[...i.map(b=>({kind:"tile",id:Ln(b),data:b})),...f.map(b=>({kind:"prompt",id:Rn(b),data:b}))],x=new Map(h.map(b=>[b.id,b])),p=En(h.map(b=>({id:b.id,defaultSize:b.kind==="tile"?Pn:zn,minSize:b.kind==="tile"?Mn:void 0,pinned:l.has(b.data.agentId)}))),g=b=>{d.apply(N=>N.filter(S=>S!==b)).catch(()=>U.error("Couldn't remove from home — please try again."))},y=async b=>{if(i.filter(S=>S.agentId===b.agentId).length<=1){g(b.agentId);return}try{const _=(await a.call("COLLECTION_VIRTUAL_MCP_GET",{id:b.agentId})).item;if(!_)throw new Error("Agent not found");const C=Z(_.metadata?.ui),I=b.tileId?C.filter(T=>T.tileId!==b.tileId):C.filter(T=>T.connectionId!==b.connectionId||T.resourceUri!==b.resourceUri);await a.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:b.agentId,data:{metadata:{..._.metadata??{},ui:{..._.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},j=b=>{const N=x.get(b);if(N){if(!l.has(N.data.agentId)){p.hideTile(b);return}N.kind==="tile"?y(N.data):g(N.data.agentId)}},w=b=>{const N=x.get(b.id);if(!N)return null;if(N.kind==="tile"){const S=u.get(N.data.agentId)??[];return n.jsx(vt,{fallback:n.jsx(Gn,{tile:N.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(Wn,{icon:N.data.agentIcon,name:N.data.agentName}),children:n.jsx(Bn,{tile:N.data,prompts:S,isEditMode:t,tileWidth:b.w})})})}return n.jsx(Fn,{entry:N.data,isEditMode:t})};return s||p.isLoading?n.jsx(Un,{}):p.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(Nn,{tiles:p.snapshot.visible,isEditMode:t,renderTile:w,onMove:p.moveTile,onResize:p.resizeTile,onRemove:j})})}function Xn(t){const e=k.c(2),{prompts:s,tiles:r}=ve(t),i=r.length>0||s.length>0;let o;return e[0]!==i?(o={hasVisibleTiles:i},e[0]=i,e[1]=o):o=e[1],o}const $e=420,Ae=305;function rt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:$e}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:$e}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ae}}),t[2]=r):r=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ae}})]}),t[3]=i):i=t[3],i}function Ee(){const t=k.c(33),{data:e}=jt.useSession(),{org:s}=J(),r=be(),i=$s(),{selectedVirtualMcp:o}=zt();let l;t[0]!==s.id?(l=St(s.id),t[0]=s.id,t[1]=l):l=t[1];const a=o??l;let m;t[2]!==s.slug?(m=Yt(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:Ct,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ce(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=Ts(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let h;t[10]!==s.id||t[11]!==s.slug?(h=Xt(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=h):h=t[12];let x;t[13]!==a.id||t[14]!==s.id||t[15]!==u?(x=Tt(s.id,a.id,u),t[13]=a.id,t[14]=s.id,t[15]=u,t[16]=x):x=t[16];let p;t[17]!==f||t[18]!==h||t[19]!==x?(p={queries:[f,h,x]},t[17]=f,t[18]=h,t[19]=x,t[20]=p):p=t[20],Ms(p);const g=ks(),y=kt(a.id),{hasDecoKey:j,isZeroBalance:w,isInitialFreeCredit:v,balanceDollars:b,hasOnlyDecoProvider:N}=Wt(),{hasVisibleTiles:S}=Xn(s.slug),_=Gt(y?.metadata);if(g.length===0&&!(_&&Jt(i))){let R;return t[21]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Rt,{})})}),t[21]=R):R=t[21],R}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const T=I,E=j&&v&&b!=null,P=j&&w&&N;let M;t[24]!==b||t[25]!==E||t[26]!==P?(M=E?n.jsx(re.CreditsEyebrow,{balanceDollars:b}):P?n.jsx(re.NoCreditsEyebrow,{}):null,t[24]=b,t[25]=E,t[26]=P,t[27]=M):M=t[27];const Q=M;let z;return t[28]!==Q||t[29]!==S||t[30]!==r||t[31]!==T?(z=n.jsx(yn,{children:r?n.jsx(Zn,{eyebrow:Q,userName:T}):n.jsx(Yn,{eyebrow:Q,userName:T,hasVisibleTiles:S})}),t[28]=Q,t[29]=S,t[30]=r,t[31]=T,t[32]=z):z=t[32],z}function Zn(t){const e=k.c(12),{eyebrow:s,userName:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(rt,{}),e[0]=i):i=e[0];let o;e[1]!==s?(o=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=o):o=e[2];let l;e[3]!==r?(l=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=l):l=e[4];let d;e[5]!==o||e[6]!==l?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[o,l]}),e[5]=o,e[6]=l,e[7]=d):d=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(re.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(it,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,a,m]}),e[10]=d,e[11]=c):c=e[11],c}function Yn(t){const e=k.c(32),{eyebrow:s,userName:r,hasVisibleTiles:i}=t,{isEditMode:o,enter:l,save:d,cancel:a,hasChanges:m}=st(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let h;e[1]!==a||e[2]!==l||e[3]!==m||e[4]!==o||e[5]!==d?(h=n.jsx(As.Right,{children:n.jsx(ei,{isEditMode:o,hasChanges:m,onEnter:l,onSave:d,onCancel:a,onAddTile:f})}),e[1]=a,e[2]=l,e[3]=m,e[4]=o,e[5]=d,e[6]=h):h=e[6];let x;e[7]!==c?(x=n.jsx(Rs,{open:c,onOpenChange:u}),e[7]=c,e[8]=x):x=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(rt,{}),e[9]=p):p=e[9];const g=i||o?"pt-32":"flex-1 justify-center";let y;e[10]!==g?(y=G("relative flex flex-col items-center px-10 pb-4",g),e[10]=g,e[11]=y):y=e[11];let j;e[12]!==s?(j=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=j):j=e[13];let w;e[14]!==r?(w=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let v;e[16]!==j||e[17]!==w?(v=n.jsxs("div",{className:"text-center mb-10",children:[j,w]}),e[16]=j,e[17]=w,e[18]=v):v=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"relative w-full",children:[n.jsx(ti,{}),n.jsx(re.Input,{showConnectionsBanner:!0})]}),e[19]=b):b=e[19];let N;e[20]!==v?(N=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,b]}),e[20]=v,e[21]=N):N=e[21];let S;e[22]!==o?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(it,{isEditMode:o})}),e[22]=o,e[23]=S):S=e[23];let _;e[24]!==N||e[25]!==S||e[26]!==y?(_=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[p,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:y,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=y,e[27]=_):_=e[27];let C;return e[28]!==_||e[29]!==h||e[30]!==x?(C=n.jsxs(n.Fragment,{children:[h,x,_]}),e[28]=_,e[29]=h,e[30]=x,e[31]=C):C=e[31],C}function ei(t){const e=k.c(17),{isEditMode:s,hasChanges:r,onEnter:i,onSave:o,onCancel:l,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Pe,{size:14}),e[3]=f):f=e[3];let h;e[4]!==l?(h=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:l,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=l,e[5]=h):h=e[5];const x=!r;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx($t,{size:14}),e[6]=p):p=e[6];let g;e[7]!==o||e[8]!==x?(g=n.jsxs(Y,{size:"sm",onClick:o,disabled:x,className:"gap-1.5 h-7 text-xs",children:[p,"Save"]}),e[7]=o,e[8]=x,e[9]=g):g=e[9];let y;return e[10]!==u||e[11]!==h||e[12]!==g?(y=n.jsxs(n.Fragment,{children:[u,h,g]}),e[10]=u,e[11]=h,e[12]=g,e[13]=y):y=e[13],y}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Mt,{size:14}),e[14]=a):a=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[a,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function ti(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function ro(){const t=k.c(2);if(be()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{ro as default};
1
+ import{al as ot,am as he,an as lt,ao as at,ap as Oe,m as le,aq as ct,ar as dt,r as $,as as mt,at as ut,au as ft,av as ht,aw as Se,ax as pt,ay as xt,az as gt,c as k,j as n,v as J,l as G,i as ae,aA as Z,t as U,K as te,k as se,B as Y,d as bt,a6 as yt,a2 as vt,a as jt}from"./index-C6QaS0Zh.js";import{u as be}from"./tooltip-BdbfQCYl.js";import{i as wt,u as ce,m as Nt,a as St,S as Ct}from"./use-mcp-client-DZQbnef-.js";import{u as _t,b as It,v as Tt,a as kt}from"./use-virtual-mcp-BCkbHrLW.js";import{i as $t}from"./ChevronUp-BCwumcyZ.js";import{e as At,A as de,Q as Et,a0 as Ot,D as Pt,k as Mt}from"./agent-icon-BB2_1lHd.js";import{s as ye}from"./Plus-DptVePQj.js";import{i as Pe}from"./X-CvnlrpyG.js";import{C as re}from"./index-ARPJar1Z.js";import{b as zt}from"./chat-context-CdOsOHQ0.js";import{N as Rt}from"./decopilot-B2PnahSO.js";import{u as Me,a as oe,K as ze,P as Re,D as Le,c as Lt,S as Ht,v as Dt,b as Ft,C as Ut,s as Qt,d as Bt,e as qt,f as Vt}from"./sortable.esm-DHMK7_tT.js";import{g as Kt,u as Wt,d as Gt,h as Jt}from"./use-deco-credits-C3sjfJyT.js";import{u as He,a as De,o as Xt}from"./use-organization-settings-Bjk_kH1I.js";import{c as ve,b as Zt,h as Yt}from"./shell-layout-BWQLmjyW.js";import{I as Fe}from"./input-szhd6Snj.js";import{S as es,t as je,P as ts,h as ss,s as ns,g as is}from"./scroll-area-Dz-FqKWj.js";import{S as rs,a as os,b as ls,c as as,d as cs}from"./sheet-BvSpiY2r.js";import{S as H}from"./skeleton-B8_-zyKb.js";import{t as Ue}from"./ChevronDown-DXOZkIso.js";import{c as Qe}from"./ZoomOut-DRnFWZo9.js";import{g as Be,M as ds}from"./types-D18PqArI.js";import{I as qe}from"./integration-icon-XSMgSpds.js";import{b as ms,c as us,S as fs,a as Ce,d as hs}from"./select-FwtHY18v.js";import{T as ps}from"./textarea-BTbunR8j.js";import{u as Ve}from"./studio-tools-CJMVZA0W.js";import{a as xs}from"./use-mcp-tools-DOD2Zkcv.js";import{i as gs}from"./XCircle-CTJX6MKF.js";import{f as bs}from"./tab-id-BptcWVWa.js";import{g as ys}from"./use-mcp-prompts-CDHTi3et.js";import{u as vs,w as js}from"./hooks-Gm6nJHH5.js";import{a as ws,g as Ns,c as Ss,b as Cs,D as _s}from"./dropdown-menu-DveShRRm.js";import{s as Is}from"./Trash01-Ds3jbDQE.js";import{a as Ts,u as ks}from"./use-ai-providers-CiBlqHeC.js";import{u as $s}from"./connect-desktop-dialog-BCsFp2qg.js";import{a as As}from"./toolbar-CvxN3T7P.js";import"./auth-DxKMCtEO.js";import"./use-collections-DaAI2dS_.js";import"./AlertCircle-CKei65yQ.js";import"./Tool01-hkwqrr6Q.js";import"./SwitchHorizontal01-D04vL0_f.js";import"./Settings02-BynaGT2l.js";import"./ArrowUpRight-BygwtcZ2.js";import"./ZapSquare-bUJqwnW3.js";import"./Users03-CjtA3d84.js";import"./CheckCircle-BZlFJbF8.js";import"./ChevronLeft-DPLHregZ.js";import"./ChevronRight-BkBgwZxs.js";import"./DotsVertical-DQDEDjEX.js";import"./Stars02-CJJhFv2L.js";import"./Eye-IocHlobo.js";import"./Globe01-CQy0Cxa-.js";import"./FilterLines-dauCx8Za.js";import"./Star01-G7bzpuzw.js";import"./Globe04-CBuYvlRn.js";import"./HardDrive-DSj8WeP3.js";import"./Key01-ktWRCkRP.js";import"./LayoutLeft-TAhoC2xE.js";import"./LinkExternal01-BenQb5F0.js";import"./Monitor01-CF5y8J9X.js";import"./Sun-CUZqy0kq.js";import"./Palette-ZSzAttfE.js";import"./Play-BrJBHlm8.js";import"./SearchMd-DmrRiPsU.js";import"./Shield01-CGOi4o3B.js";import"./Stars01-BxW6Ze_W.js";import"./Upload01-Cuswrale.js";import"./User01-DJhz4tmk.js";import"./Users01-D1GekRvz.js";import"./XClose-BbKrO-bh.js";import"./Zap-B-ccy6C4.js";import"./dialog-9Dal6l7D.js";import"./drawer-DW4IYbB1.js";import"./collection-search-ClGGT1KV.js";import"./form-6Nre8f-k.js";import"./label-Bjb_vEVQ.js";import"./tabs-CsXXbMGG.js";import"./toggle-group-CSMS4HAA.js";import"./popover-CJ-idfVW.js";import"./command-CLZq7t6J.js";import"./index-DcLVAN0f.js";import"./useInfiniteQuery-CX9x55X-.js";import"./use-infinite-scroll-CUe3Elw1.js";import"./question-004-sINsf4GQ.js";import"./checkbox-H7xxQ3iC.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-CfKY2_hs.js";import"./settings-section-PIk2gDH0.js";import"./card-DU2I8eHH.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CrUjfVJB.js";import"./use-registry-connections-DfipPXqa.js";import"./use-connection-z93iohVP.js";import"./extract-connection-data-BL81V9PY.js";import"./collection-tabs-xD0Ry7Iv.js";import"./badge-tlnu_6T3.js";import"./connection-form-helpers-BqpyRjgd.js";import"./authenticate-and-persist-oauth-CXYJ_57C.js";import"./mcp-oauth-8Oqz2kjD.js";import"./useSuspenseInfiniteQuery-C_SaQkGF.js";import"./required-auth-layout-BbLd1LMa.js";import"./use-org-sso-BhXMb9mL.js";import"./use-clock-tick-bD6VBNNM.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-_XYMvM2G.js";import"./file-type-icon-hjib5alc.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-DUbEZuBm.js";import"./decopilot-sse-pool-D8ZetksK.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function _e(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function Es(t,e,s){const r=t.slice(0);return r[e]=s,r}var Os=class extends ot{#i;#e;#r;#n;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#i=t,this.#n=s,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(t=>{t.subscribe(e=>{this.#f(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(t=>{t.destroy()})}setQueries(t,e){this.#r=t,this.#n=e,he.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const i=r.map(c=>c.observer),o=i.map(c=>c.getCurrentResult()),l=s.length!==i.length,d=i.some((c,u)=>c!==s[u]),a=l||d,m=a?!0:o.some((c,u)=>{const f=this.#e[u];return!f||!lt(c,f)});!a&&!m||(a&&(this.#c=r,this.#t=i),this.#e=o,this.hasListeners()&&(a&&(_e(s,i).forEach(c=>{c.destroy()}),_e(i,s).forEach(c=>{c.subscribe(u=>{this.#f(c,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(t=>t.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(t,e){const s=this.#u(t),r=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),i=s.map(o=>o.defaultedQueryOptions.queryHash);return[r,o=>this.#m(o??r,e,i),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const i=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,o=>{e.forEach(l=>{l.observer.trackProp(o)})})})}#m(t,e,s){if(e){const r=this.#a,i=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((o,l)=>o!==r[l]));return(!this.#s||this.#e!==this.#l||i||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=at(this.#s,e(t))),this.#s}return t}#p(){return this.#n?.combine!==void 0&&this.#t.some((t,e)=>t.options.suspense&&this.#e[e]?.data===void 0)}#u(t){const e=new Map;this.#t.forEach(r=>{const i=r.options.queryHash;if(!i)return;const o=e.get(i);o?o.push(r):e.set(i,[r])});const s=[];return t.forEach(r=>{const i=this.#i.defaultQueryOptions(r),l=e.get(i.queryHash)?.shift()??new Oe(this.#i,i);s.push({defaultedQueryOptions:i,observer:l})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=Es(this.#e,s,e),this.#h())}#h(){if(this.hasListeners()){const t=this.#d(this.#e,this.#c),e=this.#p(),s=this.#s,r=e?s:this.#m(t,this.#n?.combine);(e||s!==r)&&he.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function Ps({queries:t,...e},s){const r=le(s),i=ct(),o=dt(),l=$.useMemo(()=>t.map(p=>{const g=r.defaultQueryOptions(p);return g._optimisticResults=i?"isRestoring":"optimistic",g}),[t,r,i]);l.forEach(p=>{mt(p);const g=r.getQueryCache().get(p.queryHash);ut(p,o,g)}),ft(o);const[d]=$.useState(()=>new Os(r,l,e)),[a,m,c]=d.getOptimisticResult(l,e.combine),u=!i&&e.subscribed!==!1;$.useSyncExternalStore($.useCallback(p=>u?d.subscribe(he.batchCalls(p)):ht,[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,e)},[l,e,d]);const h=a.some((p,g)=>Se(l[g],p))?a.flatMap((p,g)=>{const y=l[g];if(y&&Se(y,p)){const j=new Oe(r,y);return pt(y,j,o)}return[]}):[];if(h.length>0)throw Promise.all(h);const x=a.find((p,g)=>{const y=l[g];return y&&xt({result:p,errorResetBoundary:o,throwOnError:y.throwOnError,query:r.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(x?.error)throw x.error;return m(c())}function Ms(t,e){return Ps({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:gt,enabled:!0,placeholderData:void 0}))},e)}function Ke(t){const e=k.c(11),{properties:s,required:r,values:i,onChange:o}=t;let l;e[0]!==r?(l=r??[],e[0]=r,e[1]=l):l=e[1];let d;e[2]!==l?(d=new Set(l),e[2]=l,e[3]=d):d=e[3];const a=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==o||e[7]!==a||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,h]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,a.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:h.type})]}),h.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:h.description}),n.jsx(zs,{type:h.type,fieldKey:f,value:i[f],onChange:x=>o(f,x)})]},f)})}),e[6]=o,e[7]=a,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function zs(t){const e=k.c(19),{type:s,fieldKey:r,value:i,onChange:o}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==o?(u=x=>o(x.target.value),e[0]=o,e[1]=u):u=e[1];const f=`Enter ${r} as JSON…`;let h;return e[2]!==c||e[3]!==u||e[4]!==f?(h=n.jsx(ps,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=h):h=e[5],h}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==o?(u=p=>o(p==="true"),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(ms,{className:"h-7 text-xs",children:n.jsx(us,{placeholder:"Select…"})}),e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(fs,{children:[n.jsx(Ce,{value:"true",children:"true"}),n.jsx(Ce,{value:"false",children:"false"})]}),e[9]=h):h=e[9];let x;return e[10]!==c||e[11]!==u?(x=n.jsxs(hs,{value:c,onValueChange:u,children:[f,h]}),e[10]=c,e[11]=u,e[12]=x):x=e[12],x}const l=i??"";let d;e[13]!==o?(d=c=>o(c.target.value),e[13]=o,e[14]=d):d=e[14];const a=`Enter ${r}…`;let m;return e[15]!==l||e[16]!==d||e[17]!==a?(m=n.jsx(Fe,{className:"h-7 text-xs",value:l,onChange:d,placeholder:a}),e[15]=l,e[16]=d,e[17]=a,e[18]=m):m=e[18],m}const ne=8;function Rs(t){const e=k.c(16),{open:s,onOpenChange:r}=t,[i,o]=$.useState("");let l,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(rs,{children:"Manage home"}),d=n.jsx(os,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=l,e[1]=d):(l=e[0],d=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(At,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=a):a=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=p=>o(p.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(ls,{className:"px-5 py-4 border-b border-border",children:[l,d,n.jsxs("div",{className:"relative mt-3",children:[a,n.jsx(Fe,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(hn,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(es,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx($.Suspense,{fallback:u,children:n.jsx(Hs,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let h;e[9]!==c||e[10]!==f?(h=n.jsxs(as,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=h):h=e[11];let x;return e[12]!==r||e[13]!==s||e[14]!==h?(x=n.jsx(cs,{open:s,onOpenChange:r,children:h}),e[12]=r,e[13]=s,e[14]=h,e[15]=x):x=e[15],x}function Ls(t){const e=k.c(32),{org:s}=J(),r=He();let i;e[0]!==r?.ids?(i=r?.ids??[],e[0]=r?.ids,e[1]=i):i=e[1];const o=i,l=De(),d=It(),a=le();let m;e[2]!==s||e[3]!==a?(m=()=>a.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=a,e[4]=m):m=e[4];const c=m;let u;e[5]!==o?(u=C=>o.includes(C),e[5]=o,e[6]=u):u=e[6];const f=u;let h;e[7]!==o||e[8]!==t?(h=t?o.filter(C=>t.has(C)).length:o.length,e[7]=o,e[8]=t,e[9]=h):h=e[9];const p=h>=ne;let g;e[10]!==p||e[11]!==f||e[12]!==l?(g=C=>f(C)||p?Promise.resolve():l.apply(I=>I.includes(C)?null:[...I,C]),e[10]=p,e[11]=f,e[12]=l,e[13]=g):g=e[13];const y=g;let j;e[14]!==l?(j=C=>l.apply(I=>I.filter(T=>T!==C)),e[14]=l,e[15]=j):j=e[15];const w=j;let v;e[16]!==l?(v=C=>l.apply(()=>C),e[16]=l,e[17]=v):v=e[17];const b=v;let N;e[18]!==d||e[19]!==p||e[20]!==f||e[21]!==c||e[22]!==l?(N=async(C,I)=>{await d.update.mutateAsync({id:C.id,data:{metadata:I}}),!f(C.id)&&!p&&await l.apply(T=>T.includes(C.id)?null:[...T,C.id]),await c()},e[18]=d,e[19]=p,e[20]=f,e[21]=c,e[22]=l,e[23]=N):N=e[23];const S=N;let _;return e[24]!==y||e[25]!==p||e[26]!==o||e[27]!==f||e[28]!==w||e[29]!==b||e[30]!==S?(_={homeIds:o,isOnHome:f,atLimit:p,addAgent:y,removeAgent:w,reorder:b,saveAgentMetadata:S},e[24]=y,e[25]=p,e[26]=o,e[27]=f,e[28]=w,e[29]=b,e[30]=S,e[31]=_):_=e[31],_}function Hs(t){const e=k.c(21),{search:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const i=_t(r);let o;e[1]!==i?(o=new Set(i.map(Bs)),e[1]=i,e[2]=o):o=e[2];const l=Ls(o);let d,a,m;if(e[3]!==i||e[4]!==l||e[5]!==s){const p=new Map(i.map(Qs));d=s.trim().toLowerCase();const g=w=>!d||w.title?.toLowerCase().includes(d);a=l.homeIds.map(w=>p.get(w)).filter(Us).filter(g);const y=Kt(i);let j;e[9]!==l?(j=w=>!l.isOnHome(w.id),e[9]=l,e[10]=j):j=e[10],m=i.filter(Fs).filter(w=>!y.has(w.id)).filter(j).filter(g).sort(Ds),e[3]=i,e[4]=l,e[5]=s,e[6]=d,e[7]=a,e[8]=m}else d=e[6],a=e[7],m=e[8];const c=m;let u;e[11]!==l||e[12]!==a?(u=n.jsx(qs,{home:l,agents:a}),e[11]=l,e[12]=a,e[13]=u):u=e[13];const f=!!d;let h;e[14]!==c||e[15]!==l||e[16]!==f?(h=n.jsx(Ws,{home:l,agents:c,hasSearch:f}),e[14]=c,e[15]=l,e[16]=f,e[17]=h):h=e[17];let x;return e[18]!==u||e[19]!==h?(x=n.jsxs(n.Fragment,{children:[u,h]}),e[18]=u,e[19]=h,e[20]=x):x=e[20],x}function Ds(t,e){return(t.title??"").localeCompare(e.title??"")}function Fs(t){return t.id&&!wt(t.id)}function Us(t){return!!t}function Qs(t){return[t.id,t]}function Bs(t){return t.id}function We(t){const e=k.c(7),{title:s,hint:r}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=r&&n.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==i||e[5]!==o?(l=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,o]}),e[4]=i,e[5]=o,e[6]=l):l=e[6],l}function qs(t){const e=k.c(14),{home:s,agents:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={coordinateGetter:Qt},e[1]=o):o=e[1];const l=Me(oe(Re,i),oe(ze,o));let d;e[2]!==s?(d=h=>{const{active:x,over:p}=h;if(!p||x.id===p.id)return;const g=s.homeIds,y=g.indexOf(x.id),j=g.indexOf(p.id);y===-1||j===-1||s.reorder(Bt([...g],y,j)).catch(Ks)},e[2]=s,e[3]=d):d=e[3];const a=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(We,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==s||e[9]!==l?(u=r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Le,{sensors:l,collisionDetection:Lt,onDragEnd:a,children:n.jsx(Ht,{items:r.map(Vs),strategy:Dt,children:n.jsx("div",{className:"flex flex-col gap-1",children:r.map(h=>n.jsx(Js,{agent:h,home:s},h.id))})})}),e[6]=r,e[7]=a,e[8]=s,e[9]=l,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Vs(t){return t.id}function Ks(){return U.error("Couldn't reorder home — please try again.")}function Ws(t){const e=k.c(6),{home:s,agents:r,hasSearch:i}=t,[o,l]=$.useState(20);let d;if(e[0]!==r||e[1]!==i||e[2]!==s||e[3]!==o){const a=r.slice(0,o);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(We,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:a.map(c=>n.jsx(Ys,{agent:c,home:s},c.id))}),r.length>o&&n.jsxs("button",{type:"button",onClick:()=>l(Gs),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",r.length-o,")"]})]})]}),e[0]=r,e[1]=i,e[2]=s,e[3]=o,e[4]=d}else d=e[4];return d}function Gs(t){return t+20}function Ge(t){const e=Z(t.metadata?.ui).filter(o=>!!o.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&i.push(`${r} prompt${r===1?"":"s"}`),r===0&&i.push("prompts off"),i.join(" · ")}function Js(t){const e=k.c(57),{agent:s,home:r}=t,[i,o]=$.useState(!1);let l;e[0]!==s.id?(l={id:s.id},e[0]=s.id,e[1]=l):l=e[1];const{attributes:d,listeners:a,setNodeRef:m,transform:c,transition:u,isDragging:f}=Ft(l),h=Ge(s)||"Quick access";let x;e[2]!==c?(x=Ut.Transform.toString(c),e[2]=c,e[3]=x):x=e[3];const p=f?.5:void 0,g=f?100:void 0;let y;e[4]!==x||e[5]!==p||e[6]!==g||e[7]!==u?(y={transform:x,transition:u,opacity:p,zIndex:g},e[4]=x,e[5]=p,e[6]=g,e[7]=u,e[8]=y):y=e[8];const j=y,w=f&&"shadow-lg";let v;e[9]!==w?(v=G("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=v):v=e[10];const b=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Qe,{size:14}),e[11]=N):N=e[11];let S;e[12]!==d||e[13]!==a||e[14]!==b?(S=n.jsx("button",{type:"button",...d,...a,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":b,children:N}),e[12]=d,e[13]=a,e[14]=b,e[15]=S):S=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(Zs),e[16]=_):_=e[16];const C=s.title??s.id;let I;e[17]!==s.icon||e[18]!==C?(I=n.jsx(de,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=I):I=e[19];const T=s.title??s.id;let E;e[20]!==T?(E=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=E):E=e[21];let P;e[22]!==h?(P=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:h}),e[22]=h,e[23]=P):P=e[23];let M;e[24]!==E||e[25]!==P?(M=n.jsxs("div",{className:"min-w-0 flex-1",children:[E,P]}),e[24]=E,e[25]=P,e[26]=M):M=e[26];const Q=i&&"rotate-180";let z;e[27]!==Q?(z=G("shrink-0 text-muted-foreground transition-transform",Q),e[27]=Q,e[28]=z):z=e[28];let R;e[29]!==z?(R=n.jsx(Ue,{size:16,className:z}),e[29]=z,e[30]=R):R=e[30];let q;e[31]!==i||e[32]!==I||e[33]!==M||e[34]!==R?(q=n.jsxs("button",{type:"button",onClick:_,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,M,R]}),e[31]=i,e[32]=I,e[33]=M,e[34]=R,e[35]=q):q=e[35];let A;e[36]!==s.id||e[37]!==r?(A=()=>r.removeAgent(s.id).catch(Xs),e[36]=s.id,e[37]=r,e[38]=A):A=e[38];const B=`Remove ${s.title??s.id} from home`;let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Pe,{size:14}),e[39]=L):L=e[39];let O;e[40]!==A||e[41]!==B?(O=n.jsx("button",{type:"button",onClick:A,"aria-label":B,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:L}),e[40]=A,e[41]=B,e[42]=O):O=e[42];let D;e[43]!==S||e[44]!==q||e[45]!==O?(D=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,q,O]}),e[43]=S,e[44]=q,e[45]=O,e[46]=D):D=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==r?(F=i&&n.jsx(Je,{agent:s,home:r}),e[47]=s,e[48]=i,e[49]=r,e[50]=F):F=e[50];let K;return e[51]!==m||e[52]!==j||e[53]!==D||e[54]!==F||e[55]!==v?(K=n.jsxs("div",{ref:m,style:j,className:v,children:[D,F]}),e[51]=m,e[52]=j,e[53]=D,e[54]=F,e[55]=v,e[56]=K):K=e[56],K}function Xs(){return U.error("Couldn't remove from home — please try again.")}function Zs(t){return!t}function Ys({agent:t,home:e}){const[s,r]=$.useState(!1),[i,o]=$.useState(!1),l=Ge(t),d=async()=>{if(!e.atLimit){o(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{o(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>r(a=>!a),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(de,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),l&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:l})]}),n.jsx(Ue,{size:16,className:G("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(ae,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(Je,{agent:t,home:e})]})}function Je(t){const e=k.c(17),{agent:s,home:r}=t,i=s.metadata?.ui;let o;e[0]!==i?(o=Z(i),e[0]=i,e[1]=o):o=e[1];const l=o;let d;e[2]!==s.connections?(d=(s.connections??[]).map(en).sort(),e[2]=s.connections,e[3]=d):d=e[3];const a=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==a||e[6]!==r||e[7]!==l?(c=n.jsx(sn,{agent:s,home:r,connectionIds:a,pinnedTiles:l}),e[4]=s,e[5]=a,e[6]=r,e[7]=l,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(tn,{}),e[9]=u):u=e[9];const f=m??null;let h;e[10]!==s||e[11]!==r||e[12]!==f?(h=n.jsx($.Suspense,{fallback:u,children:n.jsx(an,{agent:s,home:r,curated:f})}),e[10]=s,e[11]=r,e[12]=f,e[13]=h):h=e[13];let x;return e[14]!==c||e[15]!==h?(x=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,h]}),e[14]=c,e[15]=h,e[16]=x):x=e[16],x}function en(t){return t.connection_id}function tn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(H,{className:"h-8 w-full"}),n.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function sn({agent:t,home:e,connectionIds:s,pinnedTiles:r}){const i=Ve(),{data:o,isLoading:l}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),h=(f?.tools??[]).flatMap(x=>{const p=Be(x._meta);return p?[{name:x.name,description:x.description,resourceUri:p,inputSchema:x.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:h}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(l)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!o||o.length===0)return null;const d=new Map;for(const c of o)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const a=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=r.some(c=>!!a(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),r.map(c=>{const u=a(c);return u?n.jsx(on,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),o.map(c=>c.uiTools.map(u=>n.jsx(ln,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function Xe(t,e){const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;if((o==="object"||o==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[r]=JSON.parse(i)}catch{return null}}else if((o==="number"||o==="integer")&&typeof i=="string"){if(!i.trim())continue;s[r]=Number(i)}else i!==""&&i!=null&&(s[r]=i)}return s}function nn(t,e){if(!t||!e)return{};const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;(o==="object"||o==="array")&&i!=null&&typeof i!="string"?s[r]=JSON.stringify(i,null,2):s[r]=i}return s}function rn(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,r])=>{const i=typeof r=="object"?JSON.stringify(r):String(r);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function on({agent:t,home:e,connection:s,tool:r,tile:i}){const[o,l]=$.useState(!1),[d,a]=$.useState(!1),m=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[c,u]=$.useState(()=>nn(i.toolInput,r.inputSchema?.properties)),f=async()=>{l(!0);try{const p=Z(t.metadata?.ui),g=i.tileId?p.filter(j=>j.tileId!==i.tileId):p.filter(j=>j!==i),y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:g}};await e.saveAgentMetadata(t,y),a(!1)}catch(p){console.error("[home-tiles] failed to remove tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},h=async()=>{l(!0);try{let p;if(m&&r.inputSchema?.properties){const w=Xe(c,r.inputSchema.properties);if(!w){U.error("Invalid JSON in one of the fields — please fix it."),l(!1);return}Object.keys(w).length>0&&(p=w)}const y=Z(t.metadata?.ui).map(w=>(i.tileId?w.tileId===i.tileId:w===i)?{...w,toolInput:p}:w),j={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,j),a(!1)}catch(p){console.error("[home-tiles] failed to save tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},x=rn(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(r.name)}),x&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:x})]}),m&&n.jsx("button",{type:"button",onClick:()=>a(p=>!p),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(Et,{size:14})}),n.jsx(we,{isPinned:!0,submitting:o,onClick:f,label:"Remove from home"})]}),d&&m&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:c,onChange:(p,g)=>u(y=>({...y,[p]:g}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>a(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:o,onClick:h,children:o?n.jsx(ae,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function ln({agent:t,home:e,connection:s,tool:r}){const[i,o]=$.useState(!1),[l,d]=$.useState(!1),a=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(a&&!l){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{o(!0);try{let h;if(a&&r.inputSchema?.properties){const y=Xe(m,r.inputSchema.properties);if(!y){U.error("Invalid JSON in one of the fields — please fix it."),o(!1);return}Object.keys(y).length>0&&(h=y)}const p=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:r.resourceUri,toolName:r.name,...h?{toolInput:h}:{}}],g={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:p}};await e.saveAgentMetadata(t,g),d(!1),c({})}catch(h){console.error("[home-tiles] failed to add tile",h),U.error("Couldn't update home — please try again.")}finally{o(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(r.name)}),n.jsx(we,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),l&&a&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:m,onChange:(h,x)=>c(p=>({...p,[h]:x}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(ae,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function we(t){const e=k.c(11),{isPinned:s,submitting:r,onClick:i,label:o}=t,l=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==l?(d=G("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",l),e[0]=l,e[1]=d):d=e[1];let a;e[2]!==s||e[3]!==r?(a=r?n.jsx(ae,{size:12,className:"animate-spin"}):s?n.jsx(Ot,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=r,e[4]=a):a=e[4];let m;return e[5]!==o||e[6]!==i||e[7]!==r||e[8]!==d||e[9]!==a?(m=n.jsx("button",{type:"button",onClick:i,disabled:r,"aria-label":o,title:o,className:d,children:a}),e[5]=o,e[6]=i,e[7]=r,e[8]=d,e[9]=a,e[10]=m):m=e[10],m}function an(t){const e=k.c(32),{agent:s,home:r,curated:i}=t,{org:o}=J();let l;e[0]!==s.id||e[1]!==o.id||e[2]!==o.slug?(l={connectionId:s.id,orgId:o.id,orgSlug:o.slug},e[0]=s.id,e[1]=o.id,e[2]=o.slug,e[3]=l):l=e[3];const d=ce(l);let a;e[4]!==s.id||e[5]!==o.id?(a=te.agentPrompts(o.id,s.id),e[4]=s.id,e[5]=o.id,e[6]=a):a=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:b}=await d.listPrompts();return b.map(un)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==a||e[10]!==m?(c={queryKey:a,queryFn:m,staleTime:3e4,retry:!1},e[9]=a,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:h}=se(c),x=ve(o.slug);let p,g;if(e[12]!==s.id||e[13]!==u||e[14]!==x.prompts){let b;e[17]!==s.id?(b=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=b):b=e[18],p=x.prompts.filter(b).map(mn);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],g=[...N];for(const S of p)g.some(_=>_.name===S.name)||g.push(S);e[12]=s.id,e[13]=u,e[14]=x.prompts,e[15]=p,e[16]=g}else p=e[15],g=e[16];if(f&&p.length===0){let b;return e[21]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=b):b=e[21],b}if(h&&p.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,h),null;if(g.length===0)return null;let y;e[22]!==i||e[23]!==g?(y=i??g.map(dn),e[22]=i,e[23]=g,e[24]=y):y=e[24];let j;e[25]!==y?(j=new Set(y),e[25]=y,e[26]=j):j=e[26];const w=j;let v;return e[27]!==s||e[28]!==r||e[29]!==g||e[30]!==w?(v=n.jsx("div",{className:"flex flex-col gap-0.5",children:g.map(b=>n.jsx(fn,{agent:s,home:r,prompt:b,allPromptNames:g.map(cn),isPinned:w.has(b.name)},b.name))}),e[27]=s,e[28]=r,e[29]=g,e[30]=w,e[31]=v):v=e[31],v}function cn(t){return t.name}function dn(t){return t.name}function mn(t){return{name:t.promptName,title:t.title,description:t.description}}function un(t){return{name:t.name,title:t.title,description:t.description}}function fn({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:i}){const[o,l]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}l(!0);try{const a=t.metadata?.ui?.homePrompts;let m;Array.isArray(a)?m=i?a.filter(u=>u!==s.name):[...a,s.name]:m=i?r.filter(u=>u!==s.name):r;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),U.error("Couldn't update home — please try again.")}finally{l(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(we,{isPinned:i,submitting:o,onClick:d,label:i?"Remove from home":"Add to home"})]})}function hn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},pn)}),t[0]=e):e=t[0],e}function pn(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ze=`home-board.layout.v${ee}`;function Ye(t){return`home-board.layout.v${ee}.${t}`}const et={version:ee,tiles:{},hidden:[]};function pe(t){return!t||t.version!==ee?et:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function xn(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function gn(t){try{const e=localStorage.getItem(Ye(t));return e?pe(JSON.parse(e)):void 0}catch{return}}function Ie(t,e){try{localStorage.setItem(Ye(t),JSON.stringify(e))}catch{}}async function Te(t,e){if(!(await fetch(`/api/${t}/kv/${Ze}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function bn(t){const e=k.c(24),s=le();let r;e[0]!==t?(r=te.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const i=r;let o;e[2]!==t?(o=gn(t),e[2]=t,e[3]=o):o=e[3];const l=o;let d;e[4]!==l||e[5]!==t?(d=async()=>{const y=await fetch(`/api/${t}/kv/${Ze}`);if(y.status===404)return l&&xn(l)?(await Te(t,l),l):et;if(!y.ok)throw new Error("Failed to load board layout");const j=await y.json(),w=pe(j.value);return Ie(t,w),w},e[4]=l,e[5]=t,e[6]=d):d=e[6];let a;e[7]!==l||e[8]!==i||e[9]!==d?(a={queryKey:i,queryFn:d,initialData:l,staleTime:0,refetchOnWindowFocus:!1},e[7]=l,e[8]=i,e[9]=d,e[10]=a):a=e[10];const{data:m,isLoading:c}=se(a);let u;e[11]!==t?(u={mutationFn:y=>Te(t,y)},e[11]=t,e[12]=u):u=e[12];const f=bt(u);let h;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(h=y=>{Ie(t,y),s.setQueryData(i,y),f.mutate(y)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=h):h=e[17];const x=h;let p;e[18]!==m?(p=pe(m),e[18]=m,e[19]=p):p=e[19];let g;return e[20]!==c||e[21]!==x||e[22]!==p?(g={layout:p,isLoading:c,save:x},e[20]=c,e[21]=x,e[22]=p,e[23]=g):g=e[23],g}const tt=$.createContext(null);function yn(t){const e=k.c(24),{children:s}=t,{org:r}=J(),i=bn(r.slug),[o,l]=$.useState(!1),[d,a]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{a(i.layout),l(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),l(!1)},e[2]=u):u=e[2];const f=u;let h;e[3]!==d||e[4]!==i?(h=()=>{d&&i.save(d),a(null),l(!1)},e[3]=d,e[4]=i,e[5]=h):h=e[5];const x=h,p=o&&d!==null,g=p?d:i.layout;let y;e[6]!==d||e[7]!==p||e[8]!==i.layout?(y=p?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=p,e[8]=i.layout,e[9]=y):y=e[9];const j=y;let w;e[10]!==o||e[11]!==i?(w=S=>{o?a(S):i.save(S)},e[10]=o,e[11]=i,e[12]=w):w=e[12];const v=w;let b;e[13]!==v||e[14]!==c||e[15]!==j||e[16]!==o||e[17]!==g||e[18]!==x||e[19]!==i.isLoading?(b={isEditMode:o,enter:c,cancel:f,save:x,hasChanges:j,layout:g,isLayoutLoading:i.isLoading,commitLayout:v},e[13]=v,e[14]=c,e[15]=j,e[16]=o,e[17]=g,e[18]=x,e[19]=i.isLoading,e[20]=b):b=e[20];let N;return e[21]!==s||e[22]!==b?(N=n.jsx(tt.Provider,{value:b,children:s}),e[21]=s,e[22]=b,e[23]=N):N=e[23],N}function st(){const t=$.useContext(tt);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function vn({agentId:t}){const{org:e,locator:s}=J(),r=ce({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=vs(),{setTaskId:o}=Zt(),[l,d]=$.useState(null),[a,m]=$.useState(!1),c=$.useRef(!1),u=async(g,y)=>{if(!r){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const j=await ys(r,g.name,y),w={type:"doc",content:[{type:"paragraph",content:[ss({id:g.name,name:ns(g.name,is(g._meta)),metadata:j.messages,char:"/",kind:"prompt",args:y}),{type:"text",text:" "}]}]},v=crypto.randomUUID();js(sessionStorage,s,v,{tiptapDoc:w}),await i({id:v,virtual_mcp_id:t}),o(v,t,{autosend:!0})}catch(j){console.error("[start-thread-from-prompt] failed",j),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async g=>{if(!c.current){if(g.arguments&&g.arguments.length>0){d(g);return}await u(g)}},h=async g=>{if(!l)return;const y=l;d(null),await u(y,g)};return{start:f,startBlank:async g=>{if(!c.current){c.current=!0,m(!0);try{const y=crypto.randomUUID();await i({id:y,virtual_mcp_id:t}),o(y,t,g?.main?{main:g.main}:void 0)}catch(y){console.error("[start-thread-from-prompt] startBlank failed",y),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(ts,{prompt:l,setPrompt:g=>d(g),onSubmit:h}),dialogPrompt:l,starting:a}}const V=4,W=100,ke=12,jn=5,wn={w:2,h:2};class xe extends $.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(yt,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function Nn(t){const e=k.c(72),{tiles:s,isEditMode:r,renderTile:i,onMove:o,onResize:l,onRemove:d}=t,a=be(),m=$.useRef(null),[c,u]=$.useState(null),[f,h]=$.useState(null);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={activationConstraint:{distance:4}},e[0]=x):x=e[0];const p=Me(oe(Re,x),oe(ze)),g=s.reduce(Sn,0),y=r?Math.max(g+2,4):Math.max(g,1);let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/V,cellHeight:W}:null},e[1]=j):j=e[1];const w=j;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=A=>{u(String(A.active.id)),h(w())},e[2]=v):v=e[2];const b=v;let N;e[3]!==f||e[4]!==o||e[5]!==s?(N=A=>{const B=String(A.active.id),L=f??w();if(u(null),h(null),!L||L.cellWidth<=0)return;const O=s.find(K=>K.id===B);if(!O)return;const D=Math.round(A.delta.x/L.cellWidth),F=Math.round(A.delta.y/L.cellHeight);D===0&&F===0||o(B,{x:O.x+D,y:O.y+F})},e[3]=f,e[4]=o,e[5]=s,e[6]=N):N=e[6];const S=N;if(a){let A;if(e[7]!==i||e[8]!==s){let L;e[10]!==i?(L=O=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:W},children:n.jsx(xe,{children:i(O)})},O.id),e[10]=i,e[11]=L):L=e[11],A=s.map(L),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let B;return e[12]!==A?(B=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=B):B=e[13],B}let _,C,I,T,E,P,M,Q,z;if(e[14]!==c||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==d||e[19]!==l||e[20]!==i||e[21]!==p||e[22]!==s||e[23]!==y){const A=c?s.find(X=>X.id===c):null;C=Le,Q=p,z=b,I=S;const B=y*W,L=r?W*4:W;let O;e[33]!==B||e[34]!==L?(O={height:B,minHeight:L},e[33]=B,e[34]=L,e[35]=O):O=e[35];let D;e[36]!==r||e[37]!==s||e[38]!==y?(D=r&&n.jsx(Cn,{rows:y,tiles:s}),e[36]=r,e[37]=s,e[38]=y,e[39]=D):D=e[39];let F;if(e[40]!==c||e[41]!==r||e[42]!==d||e[43]!==l||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==r||e[49]!==d||e[50]!==l||e[51]!==i?(X=ie=>n.jsx(In,{tile:ie,isEditMode:r,isDragging:c===ie.id,onResize:l,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=r,e[49]=d,e[50]=l,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=r,e[42]=d,e[43]=l,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==O||e[54]!==D||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:O,children:[D,F]}),e[53]=O,e[54]=D,e[55]=F,e[56]=T):T=e[56],_=qt,E=null;const K=A&&f?A.w*f.cellWidth-ke:void 0,me=A&&f?A.h*f.cellHeight-ke:void 0;e[57]!==K||e[58]!==me?(P={width:K,height:me},e[57]=K,e[58]=me,e[59]=P):P=e[59],M=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(xe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=r,e[17]=S,e[18]=d,e[19]=l,e[20]=i,e[21]=p,e[22]=s,e[23]=y,e[24]=_,e[25]=C,e[26]=I,e[27]=T,e[28]=E,e[29]=P,e[30]=M,e[31]=Q,e[32]=z}else _=e[24],C=e[25],I=e[26],T=e[27],E=e[28],P=e[29],M=e[30],Q=e[31],z=e[32];let R;e[60]!==_||e[61]!==E||e[62]!==P||e[63]!==M?(R=n.jsx(_,{dropAnimation:E,style:P,children:M}),e[60]=_,e[61]=E,e[62]=P,e[63]=M,e[64]=R):R=e[64];let q;return e[65]!==C||e[66]!==I||e[67]!==T||e[68]!==R||e[69]!==Q||e[70]!==z?(q=n.jsxs(C,{sensors:Q,onDragStart:z,onDragEnd:I,children:[T,R]}),e[65]=C,e[66]=I,e[67]=T,e[68]=R,e[69]=Q,e[70]=z,e[71]=q):q=e[71],q}function Sn(t,e){return Math.max(t,e.y+e.h)}function Cn(t){const e=k.c(7),{rows:s,tiles:r}=t;let i;e[0]!==r?(i=(a,m)=>r.some(c=>a>=c.x&&a<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=r,e[1]=i):i=e[1];const o=i;let l;if(e[2]!==o||e[3]!==s){l=[];for(let a=0;a<s;a++)for(let m=0;m<V;m++)o(m,a)||l.push({x:m,y:a});e[2]=o,e[3]=s,e[4]=l}else l=e[4];let d;return e[5]!==l?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:l.map(_n)}),e[5]=l,e[6]=d):d=e[6],d}function _n(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/V*100}%`,top:t.y*W,width:`${1/V*100}%`,height:W},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function In(t){const e=k.c(31),{tile:s,isEditMode:r,isDragging:i,onResize:o,onRemove:l,children:d}=t,a=!r;let m;e[0]!==a||e[1]!==s.id?(m={id:s.id,disabled:a},e[0]=a,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:h}=Vt(m),x=`${s.x/V*100}%`,p=`${s.w/V*100}%`,g=s.y*W,y=s.h*W,j=h||i,w=!j&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=j&&"opacity-30";let b;e[3]!==w||e[4]!==v?(b=G("absolute p-1 will-change-[left,top,width,height,opacity]",w,v),e[3]=w,e[4]=v,e[5]=b):b=e[5];let N;e[6]!==y||e[7]!==x||e[8]!==g||e[9]!==p?(N={left:x,top:g,width:p,height:y},e[6]=y,e[7]=x,e[8]=g,e[9]=p,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let _;e[11]!==S?(_=G("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=_):_=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==l||e[17]!==o||e[18]!==s?(C=r&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(Qe,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(Tn,{tile:s,onResize:o,onRemove:l})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=l,e[17]=o,e[18]=s,e[19]=C):C=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(xe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==_||e[24]!==C?(T=n.jsxs("div",{className:_,children:[C,I]}),e[22]=I,e[23]=_,e[24]=C,e[25]=T):T=e[25];let E;return e[26]!==c||e[27]!==T||e[28]!==b||e[29]!==N?(E=n.jsx("div",{ref:c,className:b,style:N,children:T}),e[26]=c,e[27]=T,e[28]=b,e[29]=N,e[30]=E):E=e[30],E}function Tn(t){const e=k.c(20),{tile:s,onResize:r,onRemove:i}=t,[o,l]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ws,{asChild:!0,children:n.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:n.jsx(Pt,{size:16})})}),e[0]=d):d=e[0];let a;e[1]!==r||e[2]!==s.id?(a=g=>{r(s.id,g),l(!1)},e[1]=r,e[2]=s.id,e[3]=a):a=e[3];let m;e[4]!==a||e[5]!==s?(m=n.jsx(kn,{tile:s,onPick:a}),e[4]=a,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ns,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Is,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let h;e[12]!==u?(h=n.jsxs(Ss,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=h):h=e[13];let x;e[14]!==m||e[15]!==h?(x=n.jsxs(Cs,{align:"end",className:"w-auto",children:[m,c,h]}),e[14]=m,e[15]=h,e[16]=x):x=e[16];let p;return e[17]!==o||e[18]!==x?(p=n.jsxs(_s,{open:o,onOpenChange:l,children:[d,x]}),e[17]=o,e[18]=x,e[19]=p):p=e[19],p}function kn(t){const e=k.c(19),{tile:s,onPick:r}=t,i=s.minW??1,o=s.minH??1,[l,d]=$.useState(null);let a;e[0]!==l||e[1]!==s.h||e[2]!==s.w?(a=l??{w:s.w,h:s.h},e[0]=l,e[1]=s.h,e[2]=s.w,e[3]=a):a=e[3];const m=a;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,h;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${V}, 1.25rem)`},h=()=>d(null),e[8]=f,e[9]=h):(f=e[8],h=e[9]);let x;e[10]!==m.h||e[11]!==m.w||e[12]!==o||e[13]!==i||e[14]!==r?(x=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:h,children:Array.from({length:jn},(g,y)=>Array.from({length:V},(j,w)=>{const v=w+1,b=y+1,N=v<i||b<o,S=v<=m.w&&b<=m.h;return n.jsx("button",{type:"button",disabled:N,"aria-label":`${v} by ${b}`,onPointerEnter:()=>d({w:v,h:b}),onClick:()=>r({w:v,h:b}),className:G("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",N?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${v}x${b}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=o,e[13]=i,e[14]=r,e[15]=x):x=e[15];let p;return e[16]!==u||e[17]!==x?(p=n.jsxs("div",{className:"px-2 py-1.5",children:[u,x]}),e[16]=u,e[17]=x,e[18]=p):p=e[18],p}function $n(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function ge(t,e,s){for(let r=0;r<100;r++)for(let i=0;i<=V-e;i++){let o=!0;for(let l=0;l<s&&o;l++)for(let d=0;d<e&&o;d++)$n(t,i+d,r+l)&&(o=!1);if(o)return{x:i,y:r}}return{x:0,y:0}}function ue(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(V,t)),i=Math.max(s.h,Math.min(6,e));return{w:r,h:i}}function fe(t,e,s){const r=Math.max(0,Math.min(V-s,t)),i=Math.max(0,e);return{x:r,y:i}}function An(t,e,s){const r=t.find(a=>a.id===e);if(!r)return t;const i=t.filter(a=>a.id!==e),o=i.find(a=>s.x>=a.x&&s.x<a.x+a.w&&s.y>=a.y&&s.y<a.y+a.h);if(o&&o.w===r.w&&o.h===r.h)return t.map(a=>a.id===e?{...a,x:o.x,y:o.y}:a.id===o.id?{...a,x:r.x,y:r.y}:a);const d=[{...r,x:s.x,y:s.y}];for(const a of i){const m=ge(d,a.w,a.h);d.push({...a,x:m.x,y:m.y})}return d}function En(t){const e=k.c(35),{layout:s,isLayoutLoading:r,commitLayout:i}=st();let o;e[0]!==s.hidden?(o=new Set(s.hidden),e[0]=s.hidden,e[1]=o):o=e[1];const l=o;let d,a;if(e[2]!==t||e[3]!==l||e[4]!==s.tiles){a=[];let j;e[7]!==l?(j=v=>v.pinned||!l.has(v.id),e[7]=l,e[8]=j):j=e[8];const w=t.filter(j);d=new Map;for(const v of t)v.minSize&&d.set(v.id,v.minSize);for(const v of w){const b=s.tiles[v.id];if(!b)continue;const N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),{x:C,y:I}=fe(b.x,b.y,S);a.push({id:v.id,x:C,y:I,w:S,h:_,minW:N?.w,minH:N?.h})}for(const v of w){if(a.some(I=>I.id===v.id))continue;const b=v.defaultSize??wn,N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),C=ge(a,S,_);a.push({id:v.id,x:C.x,y:C.y,w:S,h:_,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=l,e[4]=s.tiles,e[5]=d,e[6]=a}else d=e[5],a=e[6];let m;e[9]!==t?(m=new Set(t.map(On)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(j,w)=>{const v={};for(const b of j)v[b.id]={x:b.x,y:b.y,w:b.w,h:b.h};i({version:ee,tiles:v,hidden:w.filter(b=>c.has(b))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let h;e[14]!==a?(h={visible:a},e[14]=a,e[15]=h):h=e[15];let x;e[16]!==f||e[17]!==s||e[18]!==a?(x=(j,w)=>{const v=a.find(S=>S.id===j);if(!v)return;const b=fe(w.x,w.y,v.w);if(b.x===v.x&&b.y===v.y)return;const N=An(a,j,b);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=a,e[19]=x):x=e[19];let p;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==a?(p=(j,w)=>{const v=a.find(T=>T.id===j);if(!v)return;const b=d.get(j),{w:N,h:S}=ue(w.w,w.h,b);if(N===v.w&&S===v.h)return;const _={...v,w:N,h:S,x:fe(v.x,v.y,N).x},C=a.filter(T=>T.id!==j),I=[_];for(const T of C){const E=ge(I,T.w,T.h);I.push({...T,x:E.x,y:E.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=a,e[24]=p):p=e[24];let g;e[25]!==f||e[26]!==s||e[27]!==a?(g=j=>{const w=a.filter(v=>v.id!==j);f(w,Array.from(new Set([...s.hidden,j])))},e[25]=f,e[26]=s,e[27]=a,e[28]=g):g=e[28];let y;return e[29]!==r||e[30]!==h||e[31]!==x||e[32]!==p||e[33]!==g?(y={snapshot:h,isLoading:r,moveTile:x,resizeTile:p,hideTile:g},e[29]=r,e[30]=h,e[31]=x,e[32]=p,e[33]=g,e[34]=y):y=e[34],y}function On(t){return t.id}const Pn={w:2,h:4},Mn={w:1,h:2},zn={w:1,h:1};function Rn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function Ln(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function Hn(t){return t.promptName?t.agentName:t.description}function Dn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function nt(t){const e=k.c(14),{org:s}=J();let r;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(r=Nt({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=r):r=e[3];const{data:i}=se(r),o=!!i&&!t.toolName;let l;e[4]!==i||e[5]!==o?(l={client:i,enabled:o},e[4]=i,e[5]=o,e[6]=l):l=e[6];const{data:d}=xs(l);let a;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(a=t.toolName??d?.tools.find(u=>Be(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=a):a=e[10];const m=a;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?bs(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:i,dialog:o,starting:l}=vn(s);let d;e[2]!==r||e[3]!==i?(d=c=>{if(!c.promptName){i();return}r(Dn(c))},e[2]=r,e[3]=i,e[4]=d):d=e[4];const a=d;let m;return e[5]!==o||e[6]!==a||e[7]!==i||e[8]!==l?(m={open:a,startBlank:i,dialog:o,starting:l},e[5]=o,e[6]=a,e[7]=i,e[8]=l,e[9]=m):m=e[9],m}function Fn(t){const e=k.c(32),{entry:s,isEditMode:r}=t,{open:i,dialog:o,starting:l}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const a=l||r,m=!r&&"cursor-pointer transition-colors hover:bg-accent/40",c=r&&"cursor-default pl-12",u=l&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=G("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let h;e[7]!==s.agentIcon||e[8]!==s.agentName?(h=n.jsx(de,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=h):h=e[9];let x;e[10]!==s.title?(x=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=x):x=e[11];let p;e[12]!==s?(p=Hn(s),e[12]=s,e[13]=p):p=e[13];let g;e[14]!==p?(g=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:p}),e[14]=p,e[15]=g):g=e[15];let y;e[16]!==g||e[17]!==x?(y=n.jsxs("div",{className:"min-w-0 flex-1",children:[x,g]}),e[16]=g,e[17]=x,e[18]=y):y=e[18];let j;e[19]!==r?(j=!r&&n.jsx(gs,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=r,e[20]=j):j=e[20];let w;e[21]!==l||e[22]!==d||e[23]!==y||e[24]!==j||e[25]!==a||e[26]!==f||e[27]!==h?(w=n.jsxs("button",{type:"button",onClick:d,disabled:a,"aria-busy":l,className:f,children:[h,y,j]}),e[21]=l,e[22]=d,e[23]=y,e[24]=j,e[25]=a,e[26]=f,e[27]=h,e[28]=w):w=e[28];let v;return e[29]!==o||e[30]!==w?(v=n.jsxs(n.Fragment,{children:[w,o]}),e[29]=o,e[30]=w,e[31]=v):v=e[31],v}function Un(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},Qn)}),t[0]=e):e=t[0],e}function Qn(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(H,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Bn(t){const e=k.c(17),{tile:s,prompts:r,isEditMode:i,tileWidth:o}=t,{org:l}=J(),{open:d,startBlank:a,dialog:m,starting:c}=Ne(s.agentId),u=r.filter(qn),f=nt(s),h="relative flex h-full w-full flex-col p-3";let x;e[0]!==i||e[1]!==f||e[2]!==a||e[3]!==c?(x=!i&&n.jsx("button",{type:"button",onClick:()=>{a(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=a,e[3]=c,e[4]=x):x=e[4];const p="flex min-h-0 flex-1 gap-3 overflow-hidden";let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Kn,{}),e[5]=g):g=e[5];let y;e[6]!==l.id||e[7]!==l.slug||e[8]!==s?(y=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:g,children:n.jsx(Vn,{tile:s,orgId:l.id,orgSlug:l.slug})})}),e[6]=l.id,e[7]=l.slug,e[8]=s,e[9]=y):y=e[9];const j=u.length>0&&!i&&o>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(b=>n.jsx("button",{type:"button",onClick:()=>d(b),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let w;e[10]!==y||e[11]!==j?(w=n.jsxs("div",{className:p,children:[y,j]}),e[10]=y,e[11]=j,e[12]=w):w=e[12];let v;return e[13]!==m||e[14]!==x||e[15]!==w?(v=n.jsxs("div",{className:h,children:[x,w,m]}),e[13]=m,e[14]=x,e[15]=w,e[16]=v):v=e[16],v}function qn(t){return!!t.promptName}function Vn(t){const e=k.c(13),{tile:s,orgId:r,orgSlug:i}=t;let o;e[0]!==r||e[1]!==i||e[2]!==s.connectionId?(o={connectionId:s.connectionId,orgId:r,orgSlug:i},e[0]=r,e[1]=i,e[2]=s.connectionId,e[3]=o):o=e[3];const l=ce(o),d=s.minHeight??200,a=s.maxHeight??4e3;let m;return e[4]!==l||e[5]!==r||e[6]!==i||e[7]!==d||e[8]!==a||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(ds,{resourceURI:s.resourceUri,orgId:r,orgSlug:i,connectionId:s.connectionId,client:l,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:a,className:"h-full"}),e[4]=l,e[5]=r,e[6]=i,e[7]=d,e[8]=a,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function Kn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Wn(t){const e=k.c(14),{icon:s,name:r}=t;let i;e[0]!==s||e[1]!==r?(i=n.jsx(de,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=i):i=e[2];let o;e[3]!==r?(o=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=l):l=e[5];let d;e[6]!==o?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[o,l]}),e[6]=o,e[7]=d):d=e[7];let a;e[8]!==i||e[9]!==d?(a=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=a):a=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==a?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,m]}),e[12]=a,e[13]=c):c=e[13],c}function Gn(t){const e=k.c(10),{tile:s,prompts:r,isEditMode:i}=t,{open:o,startBlank:l,dialog:d,starting:a}=Ne(s.agentId),m=r.filter(Jn),c=nt(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==l?(f=()=>{l(c?{main:c}:void 0)},e[0]=c,e[1]=l,e[2]=f):f=e[2];const h=a||i;let x;e[3]!==f||e[4]!==h?(x=n.jsx("button",{type:"button",onClick:f,disabled:h,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=h,e[5]=x):x=e[5];const p=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(y=>n.jsx("button",{type:"button",onClick:()=>!i&&o(y),disabled:a,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:y.title})},y.promptName))});let g;return e[6]!==d||e[7]!==x||e[8]!==p?(g=n.jsxs("div",{className:u,children:[x,p,d]}),e[6]=d,e[7]=x,e[8]=p,e[9]=g):g=e[9],g}function Jn(t){return!!t.promptName}function it({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:r,tiles:i}=ve(e.slug),o=He()?.ids??[],l=new Set(o),d=De(),a=Ve(),m=le(),c=new Set(i.map(b=>b.agentId)),u=new Map;for(const b of r){const N=u.get(b.agentId);N?N.push(b):u.set(b.agentId,[b])}const f=r.filter(b=>!c.has(b.agentId)),h=[...i.map(b=>({kind:"tile",id:Ln(b),data:b})),...f.map(b=>({kind:"prompt",id:Rn(b),data:b}))],x=new Map(h.map(b=>[b.id,b])),p=En(h.map(b=>({id:b.id,defaultSize:b.kind==="tile"?Pn:zn,minSize:b.kind==="tile"?Mn:void 0,pinned:l.has(b.data.agentId)}))),g=b=>{d.apply(N=>N.filter(S=>S!==b)).catch(()=>U.error("Couldn't remove from home — please try again."))},y=async b=>{if(i.filter(S=>S.agentId===b.agentId).length<=1){g(b.agentId);return}try{const _=(await a.call("COLLECTION_VIRTUAL_MCP_GET",{id:b.agentId})).item;if(!_)throw new Error("Agent not found");const C=Z(_.metadata?.ui),I=b.tileId?C.filter(T=>T.tileId!==b.tileId):C.filter(T=>T.connectionId!==b.connectionId||T.resourceUri!==b.resourceUri);await a.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:b.agentId,data:{metadata:{..._.metadata??{},ui:{..._.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},j=b=>{const N=x.get(b);if(N){if(!l.has(N.data.agentId)){p.hideTile(b);return}N.kind==="tile"?y(N.data):g(N.data.agentId)}},w=b=>{const N=x.get(b.id);if(!N)return null;if(N.kind==="tile"){const S=u.get(N.data.agentId)??[];return n.jsx(vt,{fallback:n.jsx(Gn,{tile:N.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(Wn,{icon:N.data.agentIcon,name:N.data.agentName}),children:n.jsx(Bn,{tile:N.data,prompts:S,isEditMode:t,tileWidth:b.w})})})}return n.jsx(Fn,{entry:N.data,isEditMode:t})};return s||p.isLoading?n.jsx(Un,{}):p.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(Nn,{tiles:p.snapshot.visible,isEditMode:t,renderTile:w,onMove:p.moveTile,onResize:p.resizeTile,onRemove:j})})}function Xn(t){const e=k.c(2),{prompts:s,tiles:r}=ve(t),i=r.length>0||s.length>0;let o;return e[0]!==i?(o={hasVisibleTiles:i},e[0]=i,e[1]=o):o=e[1],o}const $e=420,Ae=305;function rt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:$e}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:$e}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ae}}),t[2]=r):r=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ae}})]}),t[3]=i):i=t[3],i}function Ee(){const t=k.c(33),{data:e}=jt.useSession(),{org:s}=J(),r=be(),i=$s(),{selectedVirtualMcp:o}=zt();let l;t[0]!==s.id?(l=St(s.id),t[0]=s.id,t[1]=l):l=t[1];const a=o??l;let m;t[2]!==s.slug?(m=Yt(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:Ct,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ce(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=Ts(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let h;t[10]!==s.id||t[11]!==s.slug?(h=Xt(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=h):h=t[12];let x;t[13]!==a.id||t[14]!==s.id||t[15]!==u?(x=Tt(s.id,a.id,u),t[13]=a.id,t[14]=s.id,t[15]=u,t[16]=x):x=t[16];let p;t[17]!==f||t[18]!==h||t[19]!==x?(p={queries:[f,h,x]},t[17]=f,t[18]=h,t[19]=x,t[20]=p):p=t[20],Ms(p);const g=ks(),y=kt(a.id),{hasDecoKey:j,isZeroBalance:w,isInitialFreeCredit:v,balanceDollars:b,hasOnlyDecoProvider:N}=Wt(),{hasVisibleTiles:S}=Xn(s.slug),_=Gt(y?.metadata);if(g.length===0&&!(_&&Jt(i))){let R;return t[21]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Rt,{})})}),t[21]=R):R=t[21],R}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const T=I,E=j&&v&&b!=null,P=j&&w&&N;let M;t[24]!==b||t[25]!==E||t[26]!==P?(M=E?n.jsx(re.CreditsEyebrow,{balanceDollars:b}):P?n.jsx(re.NoCreditsEyebrow,{}):null,t[24]=b,t[25]=E,t[26]=P,t[27]=M):M=t[27];const Q=M;let z;return t[28]!==Q||t[29]!==S||t[30]!==r||t[31]!==T?(z=n.jsx(yn,{children:r?n.jsx(Zn,{eyebrow:Q,userName:T}):n.jsx(Yn,{eyebrow:Q,userName:T,hasVisibleTiles:S})}),t[28]=Q,t[29]=S,t[30]=r,t[31]=T,t[32]=z):z=t[32],z}function Zn(t){const e=k.c(12),{eyebrow:s,userName:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(rt,{}),e[0]=i):i=e[0];let o;e[1]!==s?(o=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=o):o=e[2];let l;e[3]!==r?(l=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=l):l=e[4];let d;e[5]!==o||e[6]!==l?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[o,l]}),e[5]=o,e[6]=l,e[7]=d):d=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(re.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(it,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,a,m]}),e[10]=d,e[11]=c):c=e[11],c}function Yn(t){const e=k.c(32),{eyebrow:s,userName:r,hasVisibleTiles:i}=t,{isEditMode:o,enter:l,save:d,cancel:a,hasChanges:m}=st(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let h;e[1]!==a||e[2]!==l||e[3]!==m||e[4]!==o||e[5]!==d?(h=n.jsx(As.Right,{children:n.jsx(ei,{isEditMode:o,hasChanges:m,onEnter:l,onSave:d,onCancel:a,onAddTile:f})}),e[1]=a,e[2]=l,e[3]=m,e[4]=o,e[5]=d,e[6]=h):h=e[6];let x;e[7]!==c?(x=n.jsx(Rs,{open:c,onOpenChange:u}),e[7]=c,e[8]=x):x=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(rt,{}),e[9]=p):p=e[9];const g=i||o?"pt-32":"flex-1 justify-center";let y;e[10]!==g?(y=G("relative flex flex-col items-center px-10 pb-4",g),e[10]=g,e[11]=y):y=e[11];let j;e[12]!==s?(j=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=j):j=e[13];let w;e[14]!==r?(w=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let v;e[16]!==j||e[17]!==w?(v=n.jsxs("div",{className:"text-center mb-10",children:[j,w]}),e[16]=j,e[17]=w,e[18]=v):v=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"relative w-full",children:[n.jsx(ti,{}),n.jsx(re.Input,{showConnectionsBanner:!0})]}),e[19]=b):b=e[19];let N;e[20]!==v?(N=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,b]}),e[20]=v,e[21]=N):N=e[21];let S;e[22]!==o?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(it,{isEditMode:o})}),e[22]=o,e[23]=S):S=e[23];let _;e[24]!==N||e[25]!==S||e[26]!==y?(_=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[p,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:y,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=y,e[27]=_):_=e[27];let C;return e[28]!==_||e[29]!==h||e[30]!==x?(C=n.jsxs(n.Fragment,{children:[h,x,_]}),e[28]=_,e[29]=h,e[30]=x,e[31]=C):C=e[31],C}function ei(t){const e=k.c(17),{isEditMode:s,hasChanges:r,onEnter:i,onSave:o,onCancel:l,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Pe,{size:14}),e[3]=f):f=e[3];let h;e[4]!==l?(h=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:l,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=l,e[5]=h):h=e[5];const x=!r;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx($t,{size:14}),e[6]=p):p=e[6];let g;e[7]!==o||e[8]!==x?(g=n.jsxs(Y,{size:"sm",onClick:o,disabled:x,className:"gap-1.5 h-7 text-xs",children:[p,"Save"]}),e[7]=o,e[8]=x,e[9]=g):g=e[9];let y;return e[10]!==u||e[11]!==h||e[12]!==g?(y=n.jsxs(n.Fragment,{children:[u,h,g]}),e[10]=u,e[11]=h,e[12]=g,e[13]=y):y=e[13],y}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Mt,{size:14}),e[14]=a):a=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[a,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function ti(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function ro(){const t=k.c(2);if(be()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{ro as default};