decocms 3.18.14 → 3.18.15

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 (230) hide show
  1. package/dist/client/assets/{AlertCircle-bw8APVTP.js → AlertCircle-2Km0CX2z.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-Dbduy1m4.js → ArrowUpRight-BLByMWEr.js} +1 -1
  3. package/dist/client/assets/{Check-Bf81oHIx.js → Check-B05JiFMG.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-C2YKXIzz.js → CheckCircle-D2PakmMP.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BvRbGG6-.js → ChevronDown-B-1h0qij.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-CiPwn0ab.js → ChevronLeft-DZmvAgUs.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-BvmZ62FM.js → ChevronRight-UH18q_3i.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-BIjgRrwO.js → ChevronUp-CNAXIcyx.js} +1 -1
  9. package/dist/client/assets/{Container-CtL-mp48.js → Container-CnVkM2IK.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-B73bYg9n.js → DotsVertical-CBkWO2us.js} +1 -1
  11. package/dist/client/assets/{Eye-CZAVODeF.js → Eye-BF--IKG8.js} +1 -1
  12. package/dist/client/assets/{FilterLines-CP_9llH7.js → FilterLines-NzTnzrsm.js} +1 -1
  13. package/dist/client/assets/{Globe01-i2XbOy99.js → Globe01-C6CmSgYh.js} +1 -1
  14. package/dist/client/assets/{HardDrive-CfrLg2xf.js → HardDrive-C8gbUBwi.js} +1 -1
  15. package/dist/client/assets/{Key01-BYQMCT4A.js → Key01-DdkT4-r1.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-Zaw_5BZm.js → LayoutLeft-Cq-3SzOV.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-Bj00t0ru.js → LinkExternal01-BuKoKvOJ.js} +1 -1
  18. package/dist/client/assets/{Monitor01-B1o877E7.js → Monitor01-DtzCrxlL.js} +1 -1
  19. package/dist/client/assets/{Palette-D3jRmDwk.js → Palette-qBV8jtn1.js} +1 -1
  20. package/dist/client/assets/{Play-BZYwkUau.js → Play-BwyGr6Ll.js} +1 -1
  21. package/dist/client/assets/{Plus-CMEcOONB.js → Plus-2y8e9M50.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-DMnRH0ZT.js → RefreshCcw01-7LgZ2KuS.js} +1 -1
  23. package/dist/client/assets/{SearchMd-DOIvnVlG.js → SearchMd-BNL3h-Lw.js} +1 -1
  24. package/dist/client/assets/{Settings02-DdkUIvok.js → Settings02-D3dhPmVM.js} +1 -1
  25. package/dist/client/assets/{Shield01-CSZCc7MG.js → Shield01-02qnRjhT.js} +1 -1
  26. package/dist/client/assets/{Star01-D_E6-i0i.js → Star01-BIOcBShW.js} +1 -1
  27. package/dist/client/assets/{Stars01-DzexK6QI.js → Stars01-Ra7VZDk8.js} +1 -1
  28. package/dist/client/assets/{Stars02-BwO5G7ui.js → Stars02-BxWZ5xUE.js} +1 -1
  29. package/dist/client/assets/{Sun-BZiXbHNs.js → Sun-cNIbkxvb.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-5FcSEvbO.js → SwitchHorizontal01-D8n2_4Ky.js} +1 -1
  31. package/dist/client/assets/{Tool01-OQo-uXCC.js → Tool01-CHQi6ime.js} +1 -1
  32. package/dist/client/assets/{Trash01-C616xT4q.js → Trash01-De5yP0M0.js} +1 -1
  33. package/dist/client/assets/{Upload01-Oh0sLtTm.js → Upload01-C4oU-PRW.js} +1 -1
  34. package/dist/client/assets/{User01-D2gFSNxI.js → User01-BQtKeucE.js} +1 -1
  35. package/dist/client/assets/{Users01-5inxqowf.js → Users01-B5Mk__ya.js} +1 -1
  36. package/dist/client/assets/{Users03-yWp-llAL.js → Users03-CyIgvftP.js} +1 -1
  37. package/dist/client/assets/{X-B1c3_NKe.js → X-3fwJpxV0.js} +1 -1
  38. package/dist/client/assets/{XCircle-Cy7JAcBV.js → XCircle-86RGTWAp.js} +1 -1
  39. package/dist/client/assets/{XClose-Bt6MNhcr.js → XClose-BlyN_Sc4.js} +1 -1
  40. package/dist/client/assets/{Zap-o4dnVQUJ.js → Zap-Ca8RLP4U.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-C2cv_s4k.js → ZapSquare-CzOxfiLh.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-DPmFOUrW.js → ZoomOut-sWkdOBib.js} +1 -1
  43. package/dist/client/assets/{access-gate-C6VWMT89.js → access-gate-DhxGxw4d.js} +1 -1
  44. package/dist/client/assets/{accordion-xYY9Vs3i.js → accordion-B7nmBs3G.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-DDNbG-LT.js → add-section-modal-BvUFLbIa.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-g1017n-e.js → agent-capabilities-DBe6gbqa.js} +1 -1
  47. package/dist/client/assets/{agent-icon-DM5cF00W.js → agent-icon-DvIbcdW2.js} +1 -1
  48. package/dist/client/assets/{agent-icons-C8WXPWgd.js → agent-icons-DyjPUCsW.js} +1 -1
  49. package/dist/client/assets/{agents-list-7KvSth3W.js → agents-list-DaNStHnT.js} +1 -1
  50. package/dist/client/assets/{ai-providers-CShrfZ48.js → ai-providers-Bib_oH4I.js} +1 -1
  51. package/dist/client/assets/{alert-ClStgHjS.js → alert-DEBP9hUS.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-BkN9zKKs.js → alert-dialog-CZIXkgul.js} +1 -1
  53. package/dist/client/assets/app-editor-DsVP0toS.js +1 -0
  54. package/dist/client/assets/{auth-catchall-Bo64tC2X.js → auth-catchall-DdQvjuma.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-BUZnTB74.js → auth-split-layout-n-ujQmbR.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-Cw_2pXsa.js → automation-list-row-DriahbPJ.js} +1 -1
  57. package/dist/client/assets/{automation-runs-CEdKyT7s.js → automation-runs-Ctj_mEp6.js} +1 -1
  58. package/dist/client/assets/{automations-_fUbD5-a.js → automations-BUfuHGwZ.js} +1 -1
  59. package/dist/client/assets/{avatar-sm34rGJY.js → avatar-5lbWWNzy.js} +1 -1
  60. package/dist/client/assets/{badge-DpbVwDlO.js → badge-C8lUCNjK.js} +1 -1
  61. package/dist/client/assets/{brand-context-CYMUZ_Py.js → brand-context-DvNIUdF6.js} +1 -1
  62. package/dist/client/assets/{buckets-xQnvHRYr.js → buckets-BJfOjTUl.js} +1 -1
  63. package/dist/client/assets/{calendar-j_Bkwk5e.js → calendar-DBINhNQa.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-D0CbsEH-.js → capability-load-error-BBTZEgSS.js} +1 -1
  65. package/dist/client/assets/{card-DznbXvu1.js → card-BojXSjgh.js} +1 -1
  66. package/dist/client/assets/{chat-context-DkA0z7QG.js → chat-context-CAiaOJBn.js} +1 -1
  67. package/dist/client/assets/{checkbox-DJbe24ej.js → checkbox-BRdsmoVp.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BTsn5sKe.js → cli-auth-success-DvdLHTjh.js} +1 -1
  69. package/dist/client/assets/{collection-detail-3gGoT9BT.js → collection-detail-CSRnSI9A.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-IEmM7S5W.js → collection-display-button-CqdzzRsa.js} +1 -1
  71. package/dist/client/assets/{collection-search-CFhPioUl.js → collection-search-7eYR8rmz.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-DtNDRZOW.js → collection-table-wrapper-IozlTqh-.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-BOrvD3ee.js → collection-tabs-wah4r8cS.js} +1 -1
  74. package/dist/client/assets/{collections-BWns8Fl4.js → collections-6h-er8nI.js} +1 -1
  75. package/dist/client/assets/{command-CGrKj_q2.js → command-BW6ahm7f.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-Cx6ZiLsH.js → connect-desktop-dialog-B5JH2LsR.js} +1 -1
  77. package/dist/client/assets/{connection-card-C5Ck0pdF.js → connection-card-CLgdMTGQ.js} +1 -1
  78. package/dist/client/assets/{connection-detail-CL7d8hb5.js → connection-detail-BnDl_hu3.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-CoUR8Gdd.js → connection-form-helpers-BOF_wZkg.js} +1 -1
  80. package/dist/client/assets/{connections-n2cWHSFA.js → connections-CZjXDeMK.js} +1 -1
  81. package/dist/client/assets/{constants-CpnKa-xF.js → constants-z4dXNe1A.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-DovlgNgn.js → decopilot-sse-pool-D_E34tmA.js} +1 -1
  83. package/dist/client/assets/{dialog-BgR7sKjj.js → dialog-D4L8eWam.js} +1 -1
  84. package/dist/client/assets/{domain-settings-BoNB4OyD.js → domain-settings-B_ZzeQnr.js} +1 -1
  85. package/dist/client/assets/{drawer-yi2RSYSs.js → drawer-_tDof6Q1.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-CmFjLD69.js → dropdown-menu-Dl0H7aq8.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-CAghhmrX.js → dynamic-plugin-layout-zDEHkdNd.js} +1 -1
  88. package/dist/client/assets/{empty-state-BLShIxQO.js → empty-state-DQ2A49Za.js} +1 -1
  89. package/dist/client/assets/{empty-state-DZiP84xj.js → empty-state-n6SIHgFi.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-Cu0TihZD.js → extract-connection-data-DubVfj_8.js} +1 -1
  91. package/dist/client/assets/{features-CQ7eQ45h.js → features-Bt5trMQR.js} +1 -1
  92. package/dist/client/assets/{file-explorer-BXGYEc6t.js → file-explorer-Cta1sV0c.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-C-p7ShzI.js → file-type-icon-CYcdJQBd.js} +1 -1
  94. package/dist/client/assets/{files-CA5Kud-R.js → files-DxLfFYV8.js} +1 -1
  95. package/dist/client/assets/{form-CQCVrb2A.js → form-DWpWJxH3.js} +1 -1
  96. package/dist/client/assets/{general-n7zJ-Tmv.js → general-BOEBqJTT.js} +1 -1
  97. package/dist/client/assets/{generate-id-D2atcitn.js → generate-id-CUPl0OgE.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-CW5Lm0LI.js → github-repo-picker-CIX9qNpb.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-3G28EYnu.js → header-tab-button-DWdrQrci.js} +1 -1
  100. package/dist/client/assets/{hover-card-Cbez29Eh.js → hover-card-BpUlDOcu.js} +1 -1
  101. package/dist/client/assets/{image-field-D0VeC8fd.js → image-field-B9LJ-oo3.js} +1 -1
  102. package/dist/client/assets/{index-dnazHw5V.js → index-5dm8s9_d.js} +1 -1
  103. package/dist/client/assets/{index-BT_raHV2.js → index-8LKP27D8.js} +1 -1
  104. package/dist/client/assets/{index-DTIMrSki.js → index-B-PHV3oz.js} +3 -3
  105. package/dist/client/assets/{index-Dif3zHHN.js → index-B6gGXliX.js} +1 -1
  106. package/dist/client/assets/{index-ChUipotL.js → index-BAFQUCvL.js} +1 -1
  107. package/dist/client/assets/{index-TpB5789m.js → index-BHNzJyJJ.js} +4 -4
  108. package/dist/client/assets/{index-D9EvcvjG.js → index-C6_q3Fvb.js} +1 -1
  109. package/dist/client/assets/{index-D9S2FyNx.js → index-Ce4_XeXN.js} +1 -1
  110. package/dist/client/assets/{index-svSMHN0w.js → index-DCXIRuG9.js} +1 -1
  111. package/dist/client/assets/{index-DGlN_9W_.js → index-DKhTnIGj.js} +1 -1
  112. package/dist/client/assets/{index-_lE9LP-s.js → index-DPSjO83e.js} +1 -1
  113. package/dist/client/assets/{index-C3kEUtyw.js → index-Dd2xeqBU.js} +1 -1
  114. package/dist/client/assets/{index-X1FaP_lK.js → index-PCvAjjUF.js} +1 -1
  115. package/dist/client/assets/{index-DpRtSKGx.js → index-r6D2rnm-.js} +1 -1
  116. package/dist/client/assets/{index-redirect-BdTNQBy1.js → index-redirect-DvO-nY0l.js} +1 -1
  117. package/dist/client/assets/{index-BvOXlcfp.js → index-xIEUKOci.js} +1 -1
  118. package/dist/client/assets/{infiniteQueryObserver-qU5LO8rc.js → infiniteQueryObserver-D8VqrbcP.js} +1 -1
  119. package/dist/client/assets/{input-COyKwj-n.js → input-DMqfVdLl.js} +1 -1
  120. package/dist/client/assets/{integration-icon-D6-qSe9e.js → integration-icon-D82j_1fN.js} +1 -1
  121. package/dist/client/assets/{label-BqzXVIx8.js → label-CEKSGqhJ.js} +1 -1
  122. package/dist/client/assets/{layout-Dgoj1q-v.js → layout-CZFlWOtF.js} +1 -1
  123. package/dist/client/assets/{login-CJ-M9FDx.js → login-CTWgO0AK.js} +1 -1
  124. package/dist/client/assets/{members-CY1JRcOT.js → members-kt9gLt-h.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-Bc8JgloZ.js → monaco-editor-C46m31Dh.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-HPV40e1F.js → monitoring-stats-row-CebqP6k-.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-DEbnvZpM.js → oauth-callback-BZrRM5kU.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-BxzGllvJ.js → oauth-callback-ai-provider-BBuEC5Wz.js} +1 -1
  129. package/dist/client/assets/{onboarding-DB5AWt_c.js → onboarding-rzwzYzm_.js} +1 -1
  130. package/dist/client/assets/{org-install-D-h5ZLYW.js → org-install-Gip9a1hb.js} +1 -1
  131. package/dist/client/assets/{org-layout-gkZ1ckS_.js → org-layout-dh0ltVLd.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-CUdY7qHI.js → org-plugin-layout-DF3qU2QR.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-DHVvMQEp.js → page-seo-form-CYUPfUAt.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-Dd5zcjqg.js +1 -0
  135. package/dist/client/assets/{pair-_1qYDL9O.js → pair-crvFYVBr.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-CY_Wyooh.js → plugin-empty-state-x9gnUm1V.js} +1 -1
  137. package/dist/client/assets/{plugin-header-x-FR2fIR.js → plugin-header-Df3pEPu9.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-CPzWmWjs.js → plugin-layout-D3EhJ7op.js} +1 -1
  139. package/dist/client/assets/{popover-BuZ8Y8iu.js → popover-Dl1ZkjR5.js} +1 -1
  140. package/dist/client/assets/{post-editor-txhYuHfn.js → post-editor-zf_w60KH.js} +1 -1
  141. package/dist/client/assets/{primitives-BjI65GQ9.js → primitives-CKiHtqRB.js} +1 -1
  142. package/dist/client/assets/{profile-CUO4qF-t.js → profile-CIaXotrp.js} +1 -1
  143. package/dist/client/assets/project-app-view-IEYOUU7q.js +1 -0
  144. package/dist/client/assets/record-editor-BYoxxfKk.js +1 -0
  145. package/dist/client/assets/registry-B0clmo5b.js +2 -0
  146. package/dist/client/assets/{registry-layout-DkT4OpIe.js → registry-layout-DGFplxm8.js} +1 -1
  147. package/dist/client/assets/{require-capability-VFrqa_TF.js → require-capability-DcqVaeiX.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-C-P6JOpD.js → required-auth-layout-XAFLruT3.js} +1 -1
  149. package/dist/client/assets/{reset-password-Coe_gvDQ.js → reset-password-BZZgl7lT.js} +1 -1
  150. package/dist/client/assets/{resizable-CdwyF2Th.js → resizable-CwNlFXM0.js} +1 -1
  151. package/dist/client/assets/{roles-CLHJjzsb.js → roles-qmPrLYMg.js} +1 -1
  152. package/dist/client/assets/{save-status-CSnhnIzR.js → save-status-BoMz5J28.js} +1 -1
  153. package/dist/client/assets/{schema-form-SHU04h0X.js → schema-form-B_vVRhXa.js} +1 -1
  154. package/dist/client/assets/{scroll-area-DNFFm-Da.js → scroll-area-Cm6OwqFg.js} +1 -1
  155. package/dist/client/assets/{search-input-kS6oNZ8N.js → search-input-BmRW3Wrv.js} +1 -1
  156. package/dist/client/assets/{secrets-cm7K67gb.js → secrets-BHdH4vfv.js} +1 -1
  157. package/dist/client/assets/{sections-editor-CIRhTc6O.js → sections-editor-MEEsh-TE.js} +1 -1
  158. package/dist/client/assets/{select-model-CBJr1n3A.js → select-model-D6htI6Ma.js} +1 -1
  159. package/dist/client/assets/{select-BwWN8yYM.js → select-xdBxNMUb.js} +1 -1
  160. package/dist/client/assets/{seo-editor-C6kUTQbL.js → seo-editor-BHelQny3.js} +1 -1
  161. package/dist/client/assets/{settings-layout-CLR44Cfr.js → settings-layout-DSZYNuri.js} +1 -1
  162. package/dist/client/assets/{settings-section-D8pPcHrJ.js → settings-section-C5SA5_8A.js} +1 -1
  163. package/dist/client/assets/{sheet-DgB1c-VM.js → sheet-D_M_IVaY.js} +1 -1
  164. package/dist/client/assets/{shell-controls-GYTzk8VK.js → shell-controls-DVl-40mx.js} +1 -1
  165. package/dist/client/assets/{shell-layout-DhcPxoJD.js → shell-layout-xKUGAKiS.js} +1 -1
  166. package/dist/client/assets/{shell-route-loading-CjSh1k0Y.js → shell-route-loading-BSSaTyIa.js} +1 -1
  167. package/dist/client/assets/{sidebar-DlrNB2Xp.js → sidebar-CWkpLi-3.js} +1 -1
  168. package/dist/client/assets/{skeleton-vS5RdX08.js → skeleton-9nqYTB4H.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-DsVAkcb-.js → sortable.esm-BcFz9Psy.js} +1 -1
  170. package/dist/client/assets/{spinner-ClPrRNae.js → spinner-B2vBmLe8.js} +1 -1
  171. package/dist/client/assets/{sso-BfQZTXOa.js → sso-jXmArOcD.js} +1 -1
  172. package/dist/client/assets/{store-Dh4OeDzo.js → store-Zu--mnH4.js} +1 -1
  173. package/dist/client/assets/store-registry-CoE86eRH.js +2 -0
  174. package/dist/client/assets/{switch-TwwoKMLD.js → switch-UTjje473.js} +1 -1
  175. package/dist/client/assets/{tab-id-BvDwqq5G.js → tab-id-D6B9k9rp.js} +1 -1
  176. package/dist/client/assets/{table-CqpgXtvV.js → table-DCodMVmA.js} +1 -1
  177. package/dist/client/assets/{tabs-7ZwKh-ET.js → tabs-B8C4rHnI.js} +1 -1
  178. package/dist/client/assets/{task-status-DJ8zGGL1.js → task-status-CY705BLe.js} +1 -1
  179. package/dist/client/assets/{textarea-BVSBUQBw.js → textarea-DHIira09.js} +1 -1
  180. package/dist/client/assets/{toggle-group-DitpC9UH.js → toggle-group-C4X1dcf6.js} +1 -1
  181. package/dist/client/assets/{toolbar-C4mR5FDC.js → toolbar-Dfgzdkic.js} +1 -1
  182. package/dist/client/assets/{tools-list-CzPzcLtp.js → tools-list-BEiQpjim.js} +1 -1
  183. package/dist/client/assets/{tooltip-B73tUZ1m.js → tooltip-5zCZryvU.js} +1 -1
  184. package/dist/client/assets/{types-DcJ-04H3.js → types-ChK1eRLX.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers-2aN6ivvn.js → use-ai-providers-DOlhyKeN.js} +1 -1
  186. package/dist/client/assets/{use-automations-5zzS4QL6.js → use-automations-CYo7bTL2.js} +1 -1
  187. package/dist/client/assets/{use-capability-qzt5yc4K.js → use-capability-Dh4mghw5.js} +1 -1
  188. package/dist/client/assets/{use-collections-DwKsUMti.js → use-collections-B47GVLOL.js} +1 -1
  189. package/dist/client/assets/{use-connection-Cwv1LoHp.js → use-connection-xtan9MLA.js} +1 -1
  190. package/dist/client/assets/{use-copy-CKQfjDVo.js → use-copy-C4ZAj4f4.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-lUbyVuL2.js → use-create-virtual-mcp-Ct03M34V.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-DZjvQqdP.js → use-debounced-autosave-CCI4Blgp.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-kPPh9tkW.js → use-delete-connection-0rOlwE36.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-D8DD3_j6.js → use-file-configs-CTGSVeMB.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-C6qx_zOj.js → use-infinite-scroll-DOmZgM0o.js} +1 -1
  196. package/dist/client/assets/{use-list-state-BwjzrQt0.js → use-list-state-DYrqWRC5.js} +1 -1
  197. package/dist/client/assets/{use-mcp-prompts-CLjWTejk.js → use-mcp-prompts-NDfKteCA.js} +1 -1
  198. package/dist/client/assets/{use-mcp-tools-DZOvxGCI.js → use-mcp-tools-OpAnzK8L.js} +1 -1
  199. package/dist/client/assets/{use-members-CItAFL92.js → use-members-B4vP4n73.js} +1 -1
  200. package/dist/client/assets/{use-navigate-to-agent-BDPVPFmk.js → use-navigate-to-agent-Bj_pSs39.js} +1 -1
  201. package/dist/client/assets/{use-org-auth-client-CB-HyejF.js → use-org-auth-client-0xYqT1He.js} +1 -1
  202. package/dist/client/assets/{use-org-sso-CvUHQ8hJ.js → use-org-sso-C0VlDkck.js} +1 -1
  203. package/dist/client/assets/{use-organization-roles-BSPq9MzU.js → use-organization-roles-B_y3meLa.js} +1 -1
  204. package/dist/client/assets/{use-organization-settings-B437Sgc-.js → use-organization-settings-CDjtm6S0.js} +1 -1
  205. package/dist/client/assets/{use-registry-connections-C2Tx39xp.js → use-registry-connections-BGN7oY_B.js} +1 -1
  206. package/dist/client/assets/{use-secrets-CaxOFigl.js → use-secrets-KLXtsaQq.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-DBw9c6R5.js → use-status-sounds-BQZXHMUe.js} +1 -1
  208. package/dist/client/assets/{use-view-mode-Cbbs6eev.js → use-view-mode-ByOIjp8l.js} +1 -1
  209. package/dist/client/assets/{use-virtual-mcp-DsknuxfQ.js → use-virtual-mcp-DPpsp0b-.js} +1 -1
  210. package/dist/client/assets/useInfiniteQuery-5f-XmzuR.js +1 -0
  211. package/dist/client/assets/{useRouterState-BuKQPQqt.js → useRouterState-C1tnhy3B.js} +1 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-CI2XOApz.js +1 -0
  213. package/dist/client/assets/{user-Cr6KrMQF.js → user-BN8x6_Oz.js} +1 -1
  214. package/dist/client/assets/{view-mode-toggle-Bw6oVmE9.js → view-mode-toggle-CXjX5DI_.js} +1 -1
  215. package/dist/client/assets/{workflow-BS6qyoTg.js → workflow-CYHY-omo.js} +1 -1
  216. package/dist/client/assets/workflow-detail-5cTcIfwi.js +1 -0
  217. package/dist/client/index.html +1 -1
  218. package/dist/server/cli.js +161 -161
  219. package/dist/server/migrate.js +1 -1
  220. package/dist/server/server.js +157 -157
  221. package/package.json +1 -1
  222. package/dist/client/assets/app-editor-CvCtk6DP.js +0 -1
  223. package/dist/client/assets/page-seo-sheet-86Ob0SKm.js +0 -1
  224. package/dist/client/assets/project-app-view-CXcT_osU.js +0 -1
  225. package/dist/client/assets/record-editor-DQxbE3JE.js +0 -1
  226. package/dist/client/assets/registry-3vxU2iaj.js +0 -2
  227. package/dist/client/assets/store-registry-G-33lnXc.js +0 -2
  228. package/dist/client/assets/useInfiniteQuery-CRK338_N.js +0 -1
  229. package/dist/client/assets/useSuspenseInfiniteQuery-CDSuZvB0.js +0 -1
  230. package/dist/client/assets/workflow-detail-DR4AjhaL.js +0 -1
@@ -1 +1 @@
1
- import{r as n,bi as q,cw as R,cx as Ee,cy as ke,cz as Se,bE as xe,cA as j}from"./index-DTIMrSki.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,...O}=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"),z=m.getAttribute("id");return((g=e.get(z))!=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:[],z=le(S,y);r.current.filtered.items.set(g,z),z>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,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,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),B(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:O,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),B(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"})}),Oe=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)}})}),ze=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},B(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),Be=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},B(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:ze,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:Be,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 B({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,bi as q,cw as R,cx as Ee,cy as ke,cz as Se,bE as xe,cA as j}from"./index-B-PHV3oz.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,...O}=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"),z=m.getAttribute("id");return((g=e.get(z))!=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:[],z=le(S,y);r.current.filtered.items.set(g,z),z>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,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,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),B(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:O,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),B(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"})}),Oe=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)}})}),ze=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},B(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),Be=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},B(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:ze,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:Be,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 B({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,3 +1,3 @@
1
- import{e as S,r as E,j as t,n as J,B as T,K as M,c as Y,f as Ce,d as Se,E as re,q as $e,G as Ge,C as Xe,o as I}from"./index-DTIMrSki.js";import{i as Qe}from"./ChevronRight-BvmZ62FM.js";import{s as De}from"./Eye-CZAVODeF.js";import{n as ae,i as We}from"./Globe01-i2XbOy99.js";import{a as Ye,c as Ze}from"./ZoomOut-DPmFOUrW.js";import{s as Je}from"./Plus-CMEcOONB.js";import{t as et}from"./Stars01-DzexK6QI.js";import{i as ze}from"./Upload01-Oh0sLtTm.js";import{b as K,T as V,a as q,u as Fe}from"./tooltip-B73tUZ1m.js";import{A as tt,a as lt,b as st,c as nt,d as it,e as rt,f as ot,g as at}from"./alert-dialog-BkN9zKKs.js";import{c as Z,D as ce,a as de,f as ct,b as dt,e as ft,d as mt}from"./dialog-BgR7sKjj.js";import{I as ut}from"./input-COyKwj-n.js";import{S as H}from"./skeleton-vS5RdX08.js";import{F as A,d as _e,M as ht}from"./file-type-icon-C-p7ShzI.js";import{a as xt}from"./toolbar-C4mR5FDC.js";import{u as Oe,b as Pe,H as Te,e as Ue,f as Ae,a as fe,F as Ee,d as me,h as Me,c as pt,i as ye,j as jt,k as Le,l as gt}from"./header-tab-button-3G28EYnu.js";import{i as ue}from"./DotsVertical-B73bYg9n.js";import{s as he}from"./Trash01-C616xT4q.js";import{i as Re}from"./Zap-o4dnVQUJ.js";import{a as xe,c as X,b as pe,D as je}from"./dropdown-menu-CmFjLD69.js";import{R as ve,a as bt,b as yt}from"./resizable-CdwyF2Th.js";import{n as Be}from"./LinkExternal01-Bj00t0ru.js";import{s as Ie}from"./XClose-Bt6MNhcr.js";import{i as vt}from"./X-B1c3_NKe.js";import"./Check-Bf81oHIx.js";import"./ChevronLeft-CiPwn0ab.js";import"./LayoutLeft-Zaw_5BZm.js";import"./index-D9S2FyNx.js";const wt=new Set(["output","upload","public","home"]),Nt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function kt(l){return wt.has(l)||!Nt.test(l)?"home":l}function Ct(l){const e=S.c(33);let s,i,o;e[0]!==l?({glyph:s,readOnly:o,...i}=l,e[0]=l,e[1]=s,e[2]=i,e[3]=o):(s=e[1],i=e[2],o=e[3]);const c=E.useId(),r=`${c}-back`,a=`${c}-front`,n=`url(#${r})`;let d;e[4]!==n?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:n}),e[4]=n,e[5]=d):d=e[5];const m=`url(#${a})`;let f;e[6]!==m?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:m}),e[6]=m,e[7]=f):f=e[7];let u,g,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),g=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),b=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=u,e[9]=g,e[10]=b):(u=e[8],g=e[9],b=e[10]);let p;e[11]!==s?(p=s&&t.jsx(s,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=s,e[12]=p):p=e[12];let x;e[13]!==o?(x=o&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(De,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=o,e[14]=x):x=e[14];let h,N;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),N=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=h,e[16]=N):(h=e[15],N=e[16]);let v;e[17]!==r?(v=t.jsxs("linearGradient",{id:r,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[h,N]}),e[17]=r,e[18]=v):v=e[18];let w,j;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("stop",{stopColor:"#72B6FA"}),j=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=w,e[20]=j):(w=e[19],j=e[20]);let C;e[21]!==a?(C=t.jsxs("radialGradient",{id:a,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[w,j]}),e[21]=a,e[22]=C):C=e[22];let k;e[23]!==v||e[24]!==C?(k=t.jsxs("defs",{children:[v,C]}),e[23]=v,e[24]=C,e[25]=k):k=e[25];let $;return e[26]!==i||e[27]!==k||e[28]!==d||e[29]!==f||e[30]!==p||e[31]!==x?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,u,g,b,p,x,k]}),e[26]=i,e[27]=k,e[28]=d,e[29]=f,e[30]=p,e[31]=x,e[32]=$):$=e[32],$}function St(l){const e={};for(const s of l.split(`
1
+ import{e as S,r as E,j as t,n as J,B as T,K as M,c as Y,f as Ce,d as Se,E as re,q as $e,G as Ge,C as Xe,o as I}from"./index-B-PHV3oz.js";import{i as Qe}from"./ChevronRight-UH18q_3i.js";import{s as De}from"./Eye-BF--IKG8.js";import{n as ae,i as We}from"./Globe01-C6CmSgYh.js";import{a as Ye,c as Ze}from"./ZoomOut-sWkdOBib.js";import{s as Je}from"./Plus-2y8e9M50.js";import{t as et}from"./Stars01-Ra7VZDk8.js";import{i as ze}from"./Upload01-C4oU-PRW.js";import{b as K,T as V,a as q,u as Fe}from"./tooltip-5zCZryvU.js";import{A as tt,a as lt,b as st,c as nt,d as it,e as rt,f as ot,g as at}from"./alert-dialog-CZIXkgul.js";import{c as Z,D as ce,a as de,f as ct,b as dt,e as ft,d as mt}from"./dialog-D4L8eWam.js";import{I as ut}from"./input-DMqfVdLl.js";import{S as H}from"./skeleton-9nqYTB4H.js";import{F as A,d as _e,M as ht}from"./file-type-icon-CYcdJQBd.js";import{a as xt}from"./toolbar-Dfgzdkic.js";import{u as Oe,b as Pe,H as Te,e as Ue,f as Ae,a as fe,F as Ee,d as me,h as Me,c as pt,i as ye,j as jt,k as Le,l as gt}from"./header-tab-button-DWdrQrci.js";import{i as ue}from"./DotsVertical-CBkWO2us.js";import{s as he}from"./Trash01-De5yP0M0.js";import{i as Re}from"./Zap-Ca8RLP4U.js";import{a as xe,c as X,b as pe,D as je}from"./dropdown-menu-Dl0H7aq8.js";import{R as ve,a as bt,b as yt}from"./resizable-CwNlFXM0.js";import{n as Be}from"./LinkExternal01-BuKoKvOJ.js";import{s as Ie}from"./XClose-BlyN_Sc4.js";import{i as vt}from"./X-3fwJpxV0.js";import"./Check-B05JiFMG.js";import"./ChevronLeft-DZmvAgUs.js";import"./LayoutLeft-Cq-3SzOV.js";import"./index-Ce4_XeXN.js";const wt=new Set(["output","upload","public","home"]),Nt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function kt(l){return wt.has(l)||!Nt.test(l)?"home":l}function Ct(l){const e=S.c(33);let s,i,o;e[0]!==l?({glyph:s,readOnly:o,...i}=l,e[0]=l,e[1]=s,e[2]=i,e[3]=o):(s=e[1],i=e[2],o=e[3]);const c=E.useId(),r=`${c}-back`,a=`${c}-front`,n=`url(#${r})`;let d;e[4]!==n?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:n}),e[4]=n,e[5]=d):d=e[5];const m=`url(#${a})`;let f;e[6]!==m?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:m}),e[6]=m,e[7]=f):f=e[7];let u,g,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),g=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),b=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=u,e[9]=g,e[10]=b):(u=e[8],g=e[9],b=e[10]);let p;e[11]!==s?(p=s&&t.jsx(s,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=s,e[12]=p):p=e[12];let x;e[13]!==o?(x=o&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(De,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=o,e[14]=x):x=e[14];let h,N;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),N=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=h,e[16]=N):(h=e[15],N=e[16]);let v;e[17]!==r?(v=t.jsxs("linearGradient",{id:r,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[h,N]}),e[17]=r,e[18]=v):v=e[18];let w,j;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("stop",{stopColor:"#72B6FA"}),j=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=w,e[20]=j):(w=e[19],j=e[20]);let C;e[21]!==a?(C=t.jsxs("radialGradient",{id:a,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[w,j]}),e[21]=a,e[22]=C):C=e[22];let k;e[23]!==v||e[24]!==C?(k=t.jsxs("defs",{children:[v,C]}),e[23]=v,e[24]=C,e[25]=k):k=e[25];let $;return e[26]!==i||e[27]!==k||e[28]!==d||e[29]!==f||e[30]!==p||e[31]!==x?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,u,g,b,p,x,k]}),e[26]=i,e[27]=k,e[28]=d,e[29]=f,e[30]=p,e[31]=x,e[32]=$):$=e[32],$}function St(l){const e={};for(const s of l.split(`
2
2
  `)){const i=s.match(/^([A-Za-z][\w-]*):\s*(.*)$/);i?.[1]&&i[2]!==void 0&&(e[i[1].toLowerCase()]=i[2].trim())}return e}function we(l){for(const e of l.split(/\n\s*\n/)){const s=e.trim();if(!(!s||s.startsWith("#")))return s.replace(/\n/g," ")}return null}function He(l){const e=l.match(/^---\n([\s\S]*?)\n---\n?/);if(!e||e[1]===void 0)return{name:null,description:we(l),body:l};const s=St(e[1]),i=l.slice(e[0].length);return{name:s.name||null,description:s.description||we(i),body:i}}const $t=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),Dt=new Set(["csv","tsv"]),zt=new Set(["mp4","webm","mov","m4v"]),Ft=new Set(["txt","md","markdown","json","log","yaml","yml","xml","html","htm"]),_t=256*1024;function ee(l){const e=new Date(l);if(Number.isNaN(e.getTime()))return"";const s=Date.now()-e.getTime(),i=Math.floor(s/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const c=Math.floor(o/24);return c<30?`${c}d ago`:e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Ot(l){return l.split(".").pop()?.toLowerCase()??""}function Ke(l){const e=S.c(15),{downloadUrl:s,filename:i,onDelete:o}=l,c=`Actions for ${i}`;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ue,{size:14}),e[0]=r):r=e[0];let a;e[1]!==c?(a=t.jsx(xe,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Tt,"aria-label":c,children:r})}),e[1]=c,e[2]=a):a=e[2];let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ae,{size:14}),e[3]=n):n=e[3];let d;e[4]!==s||e[5]!==i?(d=t.jsx(X,{asChild:!0,children:t.jsxs("a",{href:s,download:i,children:[n,"Download"]})}),e[4]=s,e[5]=i,e[6]=d):d=e[6];let m;e[7]!==o?(m=o&&t.jsxs(X,{variant:"destructive",onClick:o,children:[t.jsx(he,{size:14}),"Delete"]}),e[7]=o,e[8]=m):m=e[8];let f;e[9]!==d||e[10]!==m?(f=t.jsxs(pe,{align:"end",onClick:Pt,children:[d,m]}),e[9]=d,e[10]=m,e[11]=f):f=e[11];let u;return e[12]!==a||e[13]!==f?(u=t.jsxs(je,{children:[a,f]}),e[12]=a,e[13]=f,e[14]=u):u=e[14],u}function Pt(l){return l.stopPropagation()}function Tt(l){return l.stopPropagation()}function te(l){const e=S.c(9),{onOpen:s,children:i,className:o}=l;let c;e[0]!==s?(c=n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),s())},e[0]=s,e[1]=c):c=e[1];let r;e[2]!==o?(r=Y("group/card flex cursor-pointer flex-col gap-3 rounded-2xl border border-border bg-background p-4 text-left transition-colors hover:border-border hover:bg-muted/40",o),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==s||e[6]!==c||e[7]!==r?(a=t.jsx("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:c,className:r,children:i}),e[4]=i,e[5]=s,e[6]=c,e[7]=r,e[8]=a):a=e[8],a}function le(l){const e=S.c(16),{icon:s,name:i,meta:o,subtitle:c,actions:r}=l;let a;e[0]!==i?(a=t.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] text-foreground",title:i,children:i}),e[0]=i,e[1]=a):a=e[1];let n;e[2]!==o?(n=o&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=n):n=e[3];let d;e[4]!==a||e[5]!==n?(d=t.jsxs("div",{className:"flex items-start gap-3",children:[a,n]}),e[4]=a,e[5]=n,e[6]=d):d=e[6];let m;e[7]!==c?(m=c&&t.jsx("span",{className:"text-xs text-muted-foreground",children:c}),e[7]=c,e[8]=m):m=e[8];let f;e[9]!==d||e[10]!==m?(f=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col justify-center",children:[d,m]}),e[9]=d,e[10]=m,e[11]=f):f=e[11];let u;return e[12]!==r||e[13]!==s||e[14]!==f?(u=t.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s,f,r]}),e[12]=r,e[13]=s,e[14]=f,e[15]=u):u=e[15],u}function se(l){const e=S.c(15),{name:s,meta:i,subtitle:o,glyph:c,readOnly:r,onOpen:a,onDelete:n}=l;let d;e[0]!==c||e[1]!==r?(d=t.jsx(Ct,{glyph:c,readOnly:r,className:"size-8 shrink-0"}),e[0]=c,e[1]=r,e[2]=d):d=e[2];let m;e[3]!==s||e[4]!==n?(m=n?t.jsxs(je,{children:[t.jsx(xe,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:At,"aria-label":`Actions for ${s}`,children:t.jsx(ue,{size:14})})}),t.jsx(pe,{align:"end",onClick:Ut,children:t.jsxs(X,{variant:"destructive",onClick:n,children:[t.jsx(he,{size:14}),"Delete"]})})]}):void 0,e[3]=s,e[4]=n,e[5]=m):m=e[5];let f;e[6]!==i||e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==m?(f=t.jsx(le,{icon:d,name:s,meta:i,subtitle:o,actions:m}),e[6]=i,e[7]=s,e[8]=o,e[9]=d,e[10]=m,e[11]=f):f=e[11];let u;return e[12]!==a||e[13]!==f?(u=t.jsx(te,{onOpen:a,children:f}),e[12]=a,e[13]=f,e[14]=u):u=e[14],u}function Ut(l){return l.stopPropagation()}function At(l){return l.stopPropagation()}function Ve(l){const e=S.c(19),{filename:s,updatedAt:i,downloadUrl:o,onOpen:c,onDelete:r}=l;let a;e[0]!==s?(a=t.jsx(A,{filename:s,className:"h-8 w-6.5 shrink-0"}),e[0]=s,e[1]=a):a=e[1];let n;e[2]!==i?(n=ee(i),e[2]=i,e[3]=n):n=e[3];let d;e[4]!==s?(d=_e(s),e[4]=s,e[5]=d):d=e[5];let m;e[6]!==o||e[7]!==s||e[8]!==r?(m=t.jsx(Ke,{downloadUrl:o,filename:s,onDelete:r}),e[6]=o,e[7]=s,e[8]=r,e[9]=m):m=e[9];let f;e[10]!==s||e[11]!==a||e[12]!==n||e[13]!==d||e[14]!==m?(f=t.jsx(le,{icon:a,name:s,meta:n,subtitle:d,actions:m}),e[10]=s,e[11]=a,e[12]=n,e[13]=d,e[14]=m,e[15]=f):f=e[15];let u;return e[16]!==c||e[17]!==f?(u=t.jsx(te,{onOpen:c,children:f}),e[16]=c,e[17]=f,e[18]=u):u=e[18],u}function Et(l){const e=S.c(36),{dirName:s,updatedAt:i,skillMdUrl:o,onOpen:c,onBrowse:r,onDelete:a}=l;let n;e[0]!==o?(n=M.fileText(o),e[0]=o,e[1]=n):n=e[1];let d;e[2]!==o?(d=async()=>{const F=await fetch(o,{credentials:"include"});if(!F.ok)throw new Error(`fetch failed: ${F.status}`);return F.text()},e[2]=o,e[3]=d):d=e[3];let m;e[4]!==n||e[5]!==d?(m={queryKey:n,queryFn:d,staleTime:6e4,retry:!1},e[4]=n,e[5]=d,e[6]=m):m=e[6];const{data:f}=J(m);let u;e[7]!==f?(u=f?He(f):null,e[7]=f,e[8]=u):u=e[8];const g=u;let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:t.jsx(Re,{size:16})}),e[9]=b):b=e[9];const p=g?.name??s;let x;e[10]!==i?(x=ee(i),e[10]=i,e[11]=x):x=e[11];const h=`Actions for ${s}`;let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(ue,{size:14}),e[12]=N):N=e[12];let v;e[13]!==h?(v=t.jsx(xe,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Lt,"aria-label":h,children:N})}),e[13]=h,e[14]=v):v=e[14];let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Ye,{size:14}),e[15]=w):w=e[15];let j;e[16]!==r?(j=t.jsxs(X,{onClick:r,children:[w,"Browse files"]}),e[16]=r,e[17]=j):j=e[17];let C;e[18]!==a?(C=a&&t.jsxs(X,{variant:"destructive",onClick:a,children:[t.jsx(he,{size:14}),"Delete"]}),e[18]=a,e[19]=C):C=e[19];let k;e[20]!==j||e[21]!==C?(k=t.jsxs(pe,{align:"end",onClick:Mt,children:[j,C]}),e[20]=j,e[21]=C,e[22]=k):k=e[22];let $;e[23]!==v||e[24]!==k?($=t.jsxs(je,{children:[v,k]}),e[23]=v,e[24]=k,e[25]=$):$=e[25];let z;e[26]!==$||e[27]!==p||e[28]!==x?(z=t.jsx(le,{icon:b,name:p,meta:x,subtitle:"Skill",actions:$}),e[26]=$,e[27]=p,e[28]=x,e[29]=z):z=e[29];const P=g?.description??"";let D;e[30]!==P?(D=t.jsx("p",{className:"line-clamp-2 min-h-8 text-xs leading-4 text-muted-foreground",children:P}),e[30]=P,e[31]=D):D=e[31];let y;return e[32]!==c||e[33]!==z||e[34]!==D?(y=t.jsxs(te,{onOpen:c,children:[z,D]}),e[32]=c,e[33]=z,e[34]=D,e[35]=y):y=e[35],y}function Mt(l){return l.stopPropagation()}function Lt(l){return l.stopPropagation()}function oe(l){const e=S.c(4),{children:s}=l,[i,o]=E.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n=>{if(!n)return;const d=new IntersectionObserver(m=>{const[f]=m;f?.isIntersecting&&(o(!0),d.disconnect())},{rootMargin:"200px"});d.observe(n)},e[0]=c):c=e[0];const[r]=E.useState(c);if(i){let n;return e[1]!==s?(n=t.jsx(t.Fragment,{children:s}),e[1]=s,e[2]=n):n=e[2],n}let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{ref:r,className:"h-full w-full"}),e[3]=a):a=e[3],a}function Rt(l){const e=S.c(11),{url:s}=l;let i;e[0]!==s?(i=M.fileText(s),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==s?(o=async()=>{const d=await fetch(s,{credentials:"include"});if(!d.ok)throw new Error(`fetch failed: ${d.status}`);return d.text()},e[2]=s,e[3]=o):o=e[3];let c;e[4]!==i||e[5]!==o?(c={queryKey:i,queryFn:o,staleTime:6e4,retry:!1},e[4]=i,e[5]=o,e[6]=c):c=e[6];const{data:r}=J(c);if(!r)return null;let a;e[7]!==r?(a=r.slice(0,2e3),e[7]=r,e[8]=a):a=e[8];let n;return e[9]!==a?(n=t.jsx("pre",{className:"pointer-events-none h-full w-full overflow-hidden bg-background p-3 font-mono text-[9px] leading-[1.5] text-muted-foreground select-none",children:a}),e[9]=a,e[10]=n):n=e[10],n}function Bt(l){const e=S.c(23),{url:s,ext:i}=l;let o;e[0]!==s?(o=M.csvThumb(s),e[0]=s,e[1]=o):o=e[1];let c;e[2]!==s?(c=async()=>{const x=await fetch(s,{credentials:"include",headers:{Range:"bytes=0-8191"}});if(!x.ok)throw new Error(`fetch failed: ${x.status}`);return x.text()},e[2]=s,e[3]=c):c=e[3];let r;e[4]!==o||e[5]!==c?(r={queryKey:o,queryFn:c,staleTime:6e4,retry:!1},e[4]=o,e[5]=c,e[6]=r):r=e[6];const{data:a}=J(r);if(!a)return null;const n=i==="tsv"?" ":",";let d,m,f,u;if(e[7]!==a||e[8]!==n){u=Symbol.for("react.early_return_sentinel");e:{let x;e[13]!==n?(x=N=>N.split(n).slice(0,6).map(Kt),e[13]=n,e[14]=x):x=e[14];const h=a.split(`
3
3
  `).filter(Boolean).slice(0,7).map(x);if(h.length===0){u=null;break e}f="pointer-events-none h-full w-full overflow-hidden bg-background p-2 select-none",m="w-full border-collapse",d=h.map(It)}e[7]=a,e[8]=n,e[9]=d,e[10]=m,e[11]=f,e[12]=u}else d=e[9],m=e[10],f=e[11],u=e[12];if(u!==Symbol.for("react.early_return_sentinel"))return u;let g;e[15]!==d?(g=t.jsx("tbody",{children:d}),e[15]=d,e[16]=g):g=e[16];let b;e[17]!==m||e[18]!==g?(b=t.jsx("table",{className:m,children:g}),e[17]=m,e[18]=g,e[19]=b):b=e[19];let p;return e[20]!==f||e[21]!==b?(p=t.jsx("div",{className:f,children:b}),e[20]=f,e[21]=b,e[22]=p):p=e[22],p}function It(l,e){return t.jsx("tr",{className:Y(e===0&&"bg-muted/50 font-medium"),children:l.map(Ht)},e)}function Ht(l,e){return t.jsx("td",{className:"max-w-[56px] overflow-hidden border border-border/30 px-1 py-px text-[7px] leading-[1.4] text-muted-foreground",style:{maxWidth:56},children:t.jsx("span",{className:"block truncate",children:l})},e)}function Kt(l){return l.trim().replace(/^"|"$/g,"")}function Vt(l){const e=S.c(14),{filename:s,size:i,downloadUrl:o}=l;let c;if(e[0]!==o||e[1]!==s||e[2]!==i){const r=Ot(s);let a;if($t.has(r)){let n;e[4]!==o?(n=t.jsx("img",{src:o,alt:"",loading:"lazy",className:"h-full w-full object-cover"}),e[4]=o,e[5]=n):n=e[5],a=n}else if(zt.has(r)){const n=`${o}#t=0.1`;let d;e[6]!==n?(d=t.jsx(oe,{children:t.jsx("video",{src:n,preload:"metadata",muted:!0,playsInline:!0,className:"pointer-events-none h-full w-full object-cover"})}),e[6]=n,e[7]=d):d=e[7],a=d}else if(r==="pdf"){let n;e[8]!==s?(n=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(A,{filename:s,className:"h-14 w-11 opacity-60"})}),e[8]=s,e[9]=n):n=e[9],a=n}else if(Dt.has(r))a=t.jsx(oe,{children:t.jsx(Bt,{url:o,ext:r})});else if(Ft.has(r)&&i<=_t){let n;e[10]!==o?(n=t.jsx(oe,{children:t.jsx(Rt,{url:o})}),e[10]=o,e[11]=n):n=e[11],a=n}else{let n;e[12]!==s?(n=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(A,{filename:s,className:"h-14 w-11 opacity-60"})}),e[12]=s,e[13]=n):n=e[13],a=n}c=t.jsx("div",{className:"aspect-[400/265] w-full overflow-hidden rounded-lg border border-border/60 bg-muted/30",children:a}),e[0]=o,e[1]=s,e[2]=i,e[3]=c}else c=e[3];return c}function qt(l){const e=S.c(24),s=l.onOpen;let i;e[0]!==l.filename?(i=t.jsx(A,{filename:l.filename,className:"h-8 w-6.5 shrink-0"}),e[0]=l.filename,e[1]=i):i=e[1];const o=l.filename;let c;e[2]!==l.updatedAt?(c=ee(l.updatedAt),e[2]=l.updatedAt,e[3]=c):c=e[3];let r;e[4]!==l.filename?(r=_e(l.filename),e[4]=l.filename,e[5]=r):r=e[5];let a;e[6]!==l.downloadUrl||e[7]!==l.filename||e[8]!==l.onDelete?(a=t.jsx(Ke,{downloadUrl:l.downloadUrl,filename:l.filename,onDelete:l.onDelete}),e[6]=l.downloadUrl,e[7]=l.filename,e[8]=l.onDelete,e[9]=a):a=e[9];let n;e[10]!==l.filename||e[11]!==i||e[12]!==c||e[13]!==r||e[14]!==a?(n=t.jsx(le,{icon:i,name:o,meta:c,subtitle:r,actions:a}),e[10]=l.filename,e[11]=i,e[12]=c,e[13]=r,e[14]=a,e[15]=n):n=e[15];let d;e[16]!==l.downloadUrl||e[17]!==l.filename||e[18]!==l.size?(d=t.jsx(Vt,{filename:l.filename,size:l.size,downloadUrl:l.downloadUrl}),e[16]=l.downloadUrl,e[17]=l.filename,e[18]=l.size,e[19]=d):d=e[19];let m;return e[20]!==l.onOpen||e[21]!==n||e[22]!==d?(m=t.jsxs(te,{onOpen:s,children:[n,d]}),e[20]=l.onOpen,e[21]=n,e[22]=d,e[23]=m):m=e[23],m}function ne(l){const e=l?l.split("/").filter(Boolean):[],s=e[0]==="public",i=s?e[1]??null:null,o=s?i?`public-${i}`:null:e[0]??null,c=(s?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:o,dirPath:c,isPublic:s,publicSet:i,readOnly:s}}function W(l,e){return l.isPublic&&l.publicSet?`public/${l.publicSet}/${e}`:l.volume?`${l.volume}/${e}`:e}function O(l){const e=l.lastIndexOf("/");return e===-1?l:l.slice(e+1)}const Gt=l=>/\.html?$/i.test(l);function Xt(l){const e=S.c(26),{previewPath:s,onClose:i}=l;let o;e[0]!==s?(o=ne(s),e[0]=s,e[1]=o):o=e[1];const c=o,{volume:r,dirPath:a}=c,{data:n,isPending:d}=Oe(r,a),m=Pe(r??"");let f,u,g,b,p,x;if(e[2]!==m||e[3]!==n||e[4]!==a||e[5]!==d||e[6]!==i||e[7]!==s||e[8]!==r){const v=O(a),w=n&&n.kind==="file"?{key:s,filename:v,size:n.size,downloadUrl:m(n.path)}:null;u=ce,p=!0,e[15]!==i?(x=j=>{j||i()},e[15]=i,e[16]=x):x=e[16],f=de,g="flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",b=w&&n&&Gt(v)?t.jsxs(t.Fragment,{children:[t.jsx(Z,{className:"sr-only",children:v}),t.jsx(Te,{readUrl:w.downloadUrl,marker:Ue(n),title:v,savePath:r==="home"?a:void 0,trailing:t.jsx("div",{className:"w-8 shrink-0"})},s)]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-1 border-b border-border/60 py-1 pr-12 pl-2",children:[t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2",children:[t.jsx(A,{filename:v,className:"h-4.5 w-3.5 shrink-0"}),t.jsx(Z,{className:"truncate text-xs font-medium text-foreground",children:v}),w&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Ae(w.size)})]}),w&&t.jsxs(t.Fragment,{children:[t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",asChild:!0,children:t.jsx("a",{href:w.downloadUrl,download:w.filename,children:t.jsx(ae,{size:14})})})}),t.jsx(q,{side:"bottom",children:"Download"})]}),t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:()=>window.open(w.downloadUrl,"_blank","noopener"),children:t.jsx(Be,{size:14})})}),t.jsx(q,{side:"bottom",children:"Open in new tab"})]})]})]}),t.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:w?t.jsx(fe,{file:w}):d?t.jsx(Ee,{}):t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[t.jsx(A,{filename:v,className:"h-7.5 w-6"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."})]})})]}),e[2]=m,e[3]=n,e[4]=a,e[5]=d,e[6]=i,e[7]=s,e[8]=r,e[9]=f,e[10]=u,e[11]=g,e[12]=b,e[13]=p,e[14]=x}else f=e[9],u=e[10],g=e[11],b=e[12],p=e[13],x=e[14];let h;e[17]!==f||e[18]!==g||e[19]!==b?(h=t.jsx(f,{className:g,children:b}),e[17]=f,e[18]=g,e[19]=b,e[20]=h):h=e[20];let N;return e[21]!==u||e[22]!==p||e[23]!==x||e[24]!==h?(N=t.jsx(u,{open:p,onOpenChange:x,children:h}),e[21]=u,e[22]=p,e[23]=x,e[24]=h,e[25]=N):N=e[25],N}const Qt=l=>/\.html?$/i.test(l);function Wt(l){const e=S.c(6),{onClose:s}=l;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ie,{size:14}),e[0]=i):i=e[0];let o;e[1]!==s?(o=t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:s,children:i})}),e[1]=s,e[2]=o):o=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(q,{side:"bottom",children:"Close"}),e[3]=c):c=e[3];let r;return e[4]!==o?(r=t.jsxs(K,{children:[o,c]}),e[4]=o,e[5]=r):r=e[5],r}function Yt(l){const e=S.c(49),{previewPath:s,onClose:i}=l;let o;e[0]!==s?(o=ne(s),e[0]=s,e[1]=o):o=e[1];const c=o,{volume:r,dirPath:a}=c,{data:n,isPending:d}=Oe(r,a),m=Pe(r??"");let f,u,g,b,p,x,h,N,v;if(e[2]!==m||e[3]!==n||e[4]!==a||e[5]!==i||e[6]!==s||e[7]!==r){v=Symbol.for("react.early_return_sentinel");e:{if(u=O(a),f=n&&n.kind==="file"?{key:s,filename:u,size:n.size,downloadUrl:m(n.path)}:null,f&&n&&Qt(u)){const F=f.downloadUrl;let U;e[17]!==n?(U=Ue(n),e[17]=n,e[18]=U):U=e[18];let B;e[19]!==i?(B=t.jsx(Wt,{onClose:i}),e[19]=i,e[20]=B):B=e[20],v=t.jsx(Te,{readUrl:F,marker:U,title:u,savePath:r==="home"?a:void 0,trailing:B},s);break e}N="flex h-full w-full flex-col bg-background",h="flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",g="flex min-w-0 flex-1 items-center gap-2 px-2",b=t.jsx(A,{filename:u,className:"h-4.5 w-3.5 shrink-0"}),e[21]!==u?(p=t.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:u}),e[21]=u,e[22]=p):p=e[22],x=f&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Ae(f.size)})}e[2]=m,e[3]=n,e[4]=a,e[5]=i,e[6]=s,e[7]=r,e[8]=f,e[9]=u,e[10]=g,e[11]=b,e[12]=p,e[13]=x,e[14]=h,e[15]=N,e[16]=v}else f=e[8],u=e[9],g=e[10],b=e[11],p=e[12],x=e[13],h=e[14],N=e[15],v=e[16];if(v!==Symbol.for("react.early_return_sentinel"))return v;let w;e[23]!==g||e[24]!==b||e[25]!==p||e[26]!==x?(w=t.jsxs("div",{className:g,children:[b,p,x]}),e[23]=g,e[24]=b,e[25]=p,e[26]=x,e[27]=w):w=e[27];let j;e[28]!==f?(j=f&&t.jsxs(t.Fragment,{children:[t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",asChild:!0,children:t.jsx("a",{href:f.downloadUrl,download:f.filename,children:t.jsx(ae,{size:14})})})}),t.jsx(q,{side:"bottom",children:"Download"})]}),t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:()=>window.open(f.downloadUrl,"_blank","noopener"),children:t.jsx(Be,{size:14})})}),t.jsx(q,{side:"bottom",children:"Open in new tab"})]})]}),e[28]=f,e[29]=j):j=e[29];let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ie,{size:14}),e[30]=C):C=e[30];let k;e[31]!==i?(k=t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:i,children:C})}),e[31]=i,e[32]=k):k=e[32];let $;e[33]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(q,{side:"bottom",children:"Close"}),e[33]=$):$=e[33];let z;e[34]!==k?(z=t.jsxs(K,{children:[k,$]}),e[34]=k,e[35]=z):z=e[35];let P;e[36]!==j||e[37]!==z||e[38]!==h||e[39]!==w?(P=t.jsxs("div",{className:h,children:[w,j,z]}),e[36]=j,e[37]=z,e[38]=h,e[39]=w,e[40]=P):P=e[40];let D;e[41]!==f||e[42]!==u||e[43]!==d?(D=t.jsx("div",{className:"relative min-h-0 flex-1",children:f?t.jsx(fe,{file:f}):d?t.jsx(Ee,{}):t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[t.jsx(A,{filename:u,className:"h-7.5 w-6"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."})]})}),e[41]=f,e[42]=u,e[43]=d,e[44]=D):D=e[44];let y;return e[45]!==P||e[46]!==D||e[47]!==N?(y=t.jsxs("div",{className:N,children:[P,D]}),e[45]=P,e[46]=D,e[47]=N,e[48]=y):y=e[48],y}function Zt(l){const e=S.c(21),{skillPath:s,onClose:i}=l,o=ne(s),{volume:c,dirPath:r}=o,a=me(),n=a(c??"",`${r}/SKILL.md`),d=M.fileText(n);let m;e[0]!==n?(m=async()=>{const _=await fetch(n,{credentials:"include"});if(!_.ok)throw new Error(`fetch failed: ${_.status}`);return _.text()},e[0]=n,e[1]=m):m=e[1];let f;e[2]!==d||e[3]!==m?(f={queryKey:d,queryFn:m,staleTime:6e4,retry:!1},e[2]=d,e[3]=m,e[4]=f):f=e[4];const u=J(f),g=Me(c??"",r);let b;e[5]!==r?(b=O(r),e[5]=r,e[6]=b):b=e[6];const p=b;let x;e[7]!==u.data?(x=u.data?He(u.data):null,e[7]=u.data,e[8]=x):x=e[8];const h=x,N=el;let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(_,G)=>N(_.path)?-1:N(G.path)?1:O(_.path).localeCompare(O(G.path)),e[9]=v):v=e[9];const w=(g.data??[]).filter(Jt).sort(v),[j,C]=E.useState(null),k=j===null?null:w.find(_=>_.path===j)??null;let $;e[10]!==i?($=_=>{_||i()},e[10]=i,e[11]=$):$=e[11];let z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(Re,{size:18})}),e[12]=z):z=e[12];const P=h?.name??p;let D;e[13]!==P?(D=t.jsx(Z,{className:"flex-1 truncate text-base font-medium text-foreground",children:P}),e[13]=P,e[14]=D):D=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ct,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(vt,{size:16})})}),e[15]=y):y=e[15];let F;e[16]!==D?(F=t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[z,D,y]}),e[16]=D,e[17]=F):F=e[17];let U;e[18]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[18]=U):U=e[18];const B="relative flex min-w-0 flex-1 flex-col overflow-y-auto",ie=k?t.jsx(fe,{file:{key:k.path,filename:O(k.path),size:k.size,downloadUrl:a(c??"",k.path)}}):u.isPending?t.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[t.jsx(H,{className:"h-4 w-1/3"}),t.jsx(H,{className:"h-3 w-full"}),t.jsx(H,{className:"h-3 w-5/6"}),t.jsx(H,{className:"h-3 w-2/3"})]}):u.isError||!h?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),t.jsx("p",{className:"text-base text-muted-foreground",children:h.description??"Claude Code skill"})]}),t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:t.jsx(ht,{id:`skill-preview-${s}`,text:h.body})})]});let Q;return e[19]!==ie?(Q=t.jsx("div",{className:B,children:ie}),e[19]=ie,e[20]=Q):Q=e[20],t.jsx(ce,{open:!0,onOpenChange:$,children:t.jsxs(de,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:[F,t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[U,g.isPending?t.jsx(H,{className:"mx-2 h-4 w-24"}):w.map(_=>{const G=N(_.path)?k===null:j===_.path;return t.jsxs("button",{type:"button",onClick:()=>C(N(_.path)?null:_.path),className:Y("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",G?"bg-background shadow-sm":"hover:bg-muted/60"),children:[t.jsx(A,{filename:O(_.path),className:"h-6 w-5 shrink-0"}),t.jsx("span",{className:Y("truncate text-sm",G?"text-foreground":"text-muted-foreground"),children:O(_.path)})]},_.path)})]}),Q]})]})})}function Jt(l){return l.kind==="file"}function el(l){return O(l)==="SKILL.md"}const qe=[{id:"home",description:"Your organization's home folder",glyph:Ze},{id:"uploads",description:"Files your team uploads",glyph:ze},{id:"outputs",description:"Agent run outputs",glyph:et}],Ne=3;function R(l){const e=S.c(2),{children:s}=l;let i;return e[0]!==s?(i=t.jsx("p",{className:"text-[13px] text-foreground",children:s}),e[0]=s,e[1]=i):i=e[1],i}function L(l){const e=S.c(2),{children:s}=l;let i;return e[0]!==s?(i=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:s}),e[0]=s,e[1]=i):i=e[1],i}function ge(l){const e=S.c(2),{rows:s}=l,i=s===void 0?1:s;let o;return e[0]!==i?(o=t.jsx(L,{children:Array.from({length:i*3},tl)}),e[0]=i,e[1]=o):o=e[1],o}function tl(l,e){return t.jsx(H,{className:"h-16 rounded-2xl"},e)}function be(l){const e=S.c(2),{children:s}=l;let i;return e[0]!==s?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1],i}function ll(l){const e=S.c(6),{volume:s,displayName:i,description:o,glyph:c,onOpen:r}=l,a=gt(s),n=i??s,d=a.data?`${a.data.files} files`:void 0;let m;return e[0]!==o||e[1]!==c||e[2]!==r||e[3]!==n||e[4]!==d?(m=t.jsx(se,{name:n,meta:d,subtitle:o,glyph:c,onOpen:r}),e[0]=o,e[1]=c,e[2]=r,e[3]=n,e[4]=d,e[5]=m):m=e[5],m}function sl(l){const e=S.c(8),{segments:s,onNavigate:i}=l;let o;e[0]!==i?(o=t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(""),children:"Library"}),e[0]=i,e[1]=o):o=e[1];let c;e[2]!==i||e[3]!==s?(c=s.map((a,n)=>{const d=s.slice(0,n+1).join("/"),m=n===s.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[t.jsx(Qe,{size:12,className:"shrink-0 text-muted-foreground"}),m?t.jsx("span",{className:"truncate font-medium text-foreground",children:a}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(d),children:a})]},d)}),e[2]=i,e[3]=s,e[4]=c):c=e[4];let r;return e[5]!==o||e[6]!==c?(r=t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[o,c]}),e[5]=o,e[6]=c,e[7]=r):r=e[7],r}function nl(l){const e=S.c(19),{onOpenDir:s,onOpenFile:i,onDelete:o}=l,{org:c}=$e(),r=jt(),a=Le(),n=me();let d;if(e[0]!==n||e[1]!==o||e[2]!==s||e[3]!==i||e[4]!==c||e[5]!==a.data?.length||e[6]!==r.data||e[7]!==r.isPending){const m=r.data??[],f=m.slice(0,Ne),u=m.slice(Ne);let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(R,{children:"Folders"}),e[9]=g):g=e[9];let b;e[10]!==s||e[11]!==c?(b=qe.map(h=>t.jsx(ll,{volume:h.id,displayName:h.id==="home"?kt(c.slug):void 0,description:h.description,glyph:h.glyph,onOpen:()=>s(h.id)},h.id)),e[10]=s,e[11]=c,e[12]=b):b=e[12];let p;e[13]!==s||e[14]!==a.data?.length?(p=(a.data?.length??0)>0&&t.jsx(se,{name:"public",meta:`${a.data?.length} sets`,subtitle:"Curated skill sets — read-only",glyph:We,readOnly:!0,onOpen:()=>s("public")}),e[13]=s,e[14]=a.data?.length,e[15]=p):p=e[15];let x;e[16]!==b||e[17]!==p?(x=t.jsxs("div",{className:"flex flex-col gap-3",children:[g,t.jsxs(L,{children:[b,p]})]}),e[16]=b,e[17]=p,e[18]=x):x=e[18],d=t.jsxs(t.Fragment,{children:[r.isPending?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Recently added"}),t.jsx(ge,{})]}):f.length>0?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Recently added"}),t.jsx(L,{children:f.map(h=>t.jsx(qt,{filename:O(h.path),updatedAt:h.updatedAt,size:h.size,downloadUrl:n(h.volume,h.path),onOpen:()=>i(`${h.volume}/${h.path}`),onDelete:()=>o({volume:h.volume,path:h.path,kind:"file"})},`${h.volume}/${h.path}`))})]}):t.jsx(be,{children:"No files yet — upload one, or ask an agent to produce something."}),x,u.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"All files"}),t.jsx(L,{children:u.map(h=>t.jsx(Ve,{filename:O(h.path),updatedAt:h.updatedAt,downloadUrl:n(h.volume,h.path),onOpen:()=>i(`${h.volume}/${h.path}`),onDelete:()=>o({volume:h.volume,path:h.path,kind:"file"})},`${h.volume}/${h.path}`))})]})]}),e[0]=n,e[1]=o,e[2]=s,e[3]=i,e[4]=c,e[5]=a.data?.length,e[6]=r.data,e[7]=r.isPending,e[8]=d}else d=e[8];return d}function il(l){const e=S.c(11),{onOpenDir:s}=l,i=Le();if(i.isPending){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ge,{}),e[0]=n):n=e[0],n}let o;e[1]!==i.data?(o=i.data??[],e[1]=i.data,e[2]=o):o=e[2];const c=o;if(c.length===0){let n;return e[3]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(be,{children:"No public skill sets are configured."}),e[3]=n):n=e[3],n}let r;if(e[4]!==s||e[5]!==c){let n;e[7]!==s?(n=d=>t.jsx(se,{name:d,subtitle:"Read-only",readOnly:!0,onOpen:()=>s(`public/${d}`)},d),e[7]=s,e[8]=n):n=e[8],r=c.map(n),e[4]=s,e[5]=c,e[6]=r}else r=e[6];let a;return e[9]!==r?(a=t.jsx(L,{children:r}),e[9]=r,e[10]=a):a=e[10],a}function rl(l){const e=S.c(25),{location:s,onOpenDir:i,onOpenFile:o,onOpenSkill:c,onDelete:r}=l,a=s.volume??"",n=Me(a,s.dirPath),d=me();if(n.isPending){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ge,{rows:2}),e[0]=p):p=e[0],p}if(n.isError){const p=n.error instanceof Error?n.error.message:"Failed to load";let x;return e[1]!==p?(x=t.jsx("p",{className:"text-sm text-destructive",children:p}),e[1]=p,e[2]=x):x=e[2],x}let m,f,u,g;if(e[3]!==d||e[4]!==n.data||e[5]!==s||e[6]!==r||e[7]!==i||e[8]!==o||e[9]!==c||e[10]!==a){g=Symbol.for("react.early_return_sentinel");e:{const p=n.data??[],x=p.filter(cl),h=p.filter(al),N=p.filter(ol);if(p.length===0){const j=s.readOnly?"Empty — this read-only set syncs from its GitHub source.":"Empty folder — upload a file or create a folder to get started.";let C;e[15]!==j?(C=t.jsx(be,{children:j}),e[15]=j,e[16]=C):C=e[16],g=C;break e}let v;e[17]!==s.readOnly||e[18]!==r||e[19]!==a?(v=j=>s.readOnly?void 0:()=>r({volume:a,path:j.path,kind:j.kind}),e[17]=s.readOnly,e[18]=r,e[19]=a,e[20]=v):v=e[20];const w=v;m=x.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Skills"}),t.jsx(L,{children:x.map(j=>t.jsx(Et,{dirName:O(j.path),updatedAt:j.updatedAt,skillMdUrl:d(a,`${j.path}/SKILL.md`),onOpen:()=>c(W(s,j.path)),onBrowse:()=>i(W(s,j.path)),onDelete:w(j)},j.path))})]}),f=h.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Folders"}),t.jsx(L,{children:h.map(j=>t.jsx(se,{name:O(j.path),meta:ee(j.updatedAt),readOnly:s.readOnly,onOpen:()=>i(W(s,j.path)),onDelete:w(j)},j.path))})]}),u=N.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Files"}),t.jsx(L,{children:N.map(j=>t.jsx(Ve,{filename:O(j.path),updatedAt:j.updatedAt,downloadUrl:d(a,j.path),onOpen:()=>o(W(s,j.path)),onDelete:w(j)},j.path))})]})}e[3]=d,e[4]=n.data,e[5]=s,e[6]=r,e[7]=i,e[8]=o,e[9]=c,e[10]=a,e[11]=m,e[12]=f,e[13]=u,e[14]=g}else m=e[11],f=e[12],u=e[13],g=e[14];if(g!==Symbol.for("react.early_return_sentinel"))return g;let b;return e[21]!==m||e[22]!==f||e[23]!==u?(b=t.jsxs(t.Fragment,{children:[m,f,u]}),e[21]=m,e[22]=f,e[23]=u,e[24]=b):b=e[24],b}function ol(l){return l.kind==="file"}function al(l){return l.kind==="dir"&&!l.hasSkill}function cl(l){return l.kind==="dir"&&l.hasSkill}function ke(){const{org:l}=$e(),e=Ge(),s=Ce(),i=Fe(),o=Se({strict:!1}),c=o.path??"",r=ne(c),a=r.segments.length===0,n=(y,F)=>s({to:".",search:U=>({...U,[y]:F||void 0})}),d=y=>n("path",y),m=y=>n("preview",y),f=y=>n("skill",y),[u,g]=E.useState(null),[b,p]=E.useState(!1),[x,h]=E.useState(""),N=E.useRef(null),v=r.readOnly?null:r.volume??"uploads",w=r.volume?r.dirPath:"",{upload:j,mkdir:C}=ye(v??"uploads"),{remove:k}=ye(u?.volume??"uploads");async function $(y){if(!(!v||!y||y.length===0))try{await j.mutateAsync({dir:w,files:[...y]}),I.success(y.length===1?`Uploaded ${y[0]?.name}`:`Uploaded ${y.length} files`)}catch(F){I.error(F instanceof Error?F.message:"Upload failed")}finally{N.current&&(N.current.value="")}}async function z(){const y=x.trim();if(!(!v||!y))try{await C.mutateAsync(w?`${w}/${y}`:y),I.success(`Folder "${y}" created`),p(!1),h("")}catch(F){I.error(F instanceof Error?F.message:"Failed to create folder")}}async function P(){if(!u)return;const y=u;try{await k.mutateAsync(y.path),I.success(`Deleted ${O(y.path)}`)}catch(F){I.error(F instanceof Error?F.message:"Delete failed")}finally{g(null)}}function D(){for(const y of qe)e.invalidateQueries({queryKey:M.orgFsVolume(l.id,y.id)});r.volume&&e.invalidateQueries({queryKey:M.orgFsVolume(l.id,r.volume)}),e.invalidateQueries({queryKey:M.orgFsRecent(l.id)}),e.invalidateQueries({queryKey:M.orgFsPublicSets(l.id)})}return t.jsxs("div",{className:"h-full overflow-y-auto",children:[t.jsxs("div",{className:"mx-auto flex w-full max-w-[900px] flex-col gap-10 px-6 py-10 lg:px-10",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[!a&&t.jsx(sl,{segments:r.segments,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"min-w-0 flex-1 truncate text-xl font-medium text-foreground",children:a?"Library":r.segments.at(-1)??"Library"}),t.jsx(T,{variant:"ghost",size:"icon",onClick:D,"aria-label":"Refresh",children:t.jsx(Xe,{size:14})}),!a&&v&&t.jsxs(T,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[t.jsx(Je,{size:14}),"New folder"]}),r.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(De,{size:12}),"Read-only"]}):t.jsxs(T,{size:"sm",disabled:j.isPending,onClick:()=>N.current?.click(),children:[t.jsx(ze,{size:14}),j.isPending?"Uploading…":"Upload file"]}),t.jsx("input",{ref:N,type:"file",multiple:!0,className:"hidden",onChange:y=>{$(y.target.files)}})]})]}),a?t.jsx(nl,{onOpenDir:d,onOpenFile:m,onDelete:g}):r.volume===null?t.jsx(il,{onOpenDir:d}):t.jsx(rl,{location:r,onOpenDir:d,onOpenFile:m,onOpenSkill:f,onDelete:g},r.volume)]}),o.preview?i&&t.jsx(Xt,{previewPath:o.preview,onClose:()=>n("preview",null)}):o.skill?t.jsx(Zt,{skillPath:o.skill,onClose:()=>n("skill",null)},o.skill):null,t.jsx(ce,{open:b,onOpenChange:p,children:t.jsxs(de,{children:[t.jsxs(dt,{children:[t.jsx(Z,{children:"New folder"}),t.jsxs(ft,{children:["Create a folder in ",c||"the library","."]})]}),t.jsx(ut,{autoFocus:!0,placeholder:"folder-name",value:x,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Enter"&&z()}}),t.jsxs(mt,{children:[t.jsx(T,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),t.jsx(T,{disabled:!x.trim()||C.isPending,onClick:()=>{z()},children:"Create"})]})]})}),t.jsx(tt,{open:u!==null,onOpenChange:y=>{y||g(null)},children:t.jsxs(lt,{children:[t.jsxs(st,{children:[t.jsxs(nt,{children:["Delete ",u?O(u.path):"","?"]}),t.jsx(it,{children:u?.kind==="dir"?"The folder and everything inside it will be deleted for the whole organization. Sandboxes see this change within seconds.":"The file will be deleted for the whole organization. Sandboxes see this change within seconds."})]}),t.jsxs(rt,{children:[t.jsx(ot,{children:"Cancel"}),t.jsx(at,{onClick:()=>{P()},children:"Delete"})]})]})})]})}function Ll(){const l=S.c(13),e=Fe(),s=Ce();let i;l[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},l[0]=i):i=l[0];const c=Se(i).preview;let r;l[1]!==c?(r=c?O(c):"",l[1]=c,l[2]=r):r=l[2];const a=r;let n;l[3]!==s?(n=()=>s({to:".",search:dl}),l[3]=s,l[4]=n):n=l[4];const d=n;if(e){let g;return l[5]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-background",children:t.jsx(re,{children:t.jsx(ke,{})})}),l[5]=g):g=l[5],g}let m;l[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ve,{order:1,minSize:30,defaultSize:55,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(re,{children:t.jsx(ke,{})})})})}),l[6]=m):m=l[6];let f;l[7]!==d||l[8]!==a||l[9]!==c?(f=c&&t.jsxs(t.Fragment,{children:[t.jsx(xt.Tabs,{children:t.jsx(pt,{title:a,icon:{kind:"component",Component:g=>t.jsx(A,{filename:a,...g})},active:!0,onClick:d})}),t.jsx(bt,{className:"bg-sidebar"}),t.jsx(ve,{order:2,minSize:25,defaultSize:45,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(re,{children:t.jsx(Yt,{previewPath:c,onClose:d})})})})})]}),l[7]=d,l[8]=a,l[9]=c,l[10]=f):f=l[10];let u;return l[11]!==f?(u=t.jsxs(yt,{direction:"horizontal",className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:[m,f]}),l[11]=f,l[12]=u):u=l[12],u}function dl(l){return{...l,preview:void 0}}export{Ll as default};
@@ -1 +1 @@
1
- import{ar as st,as as me,at as it,au as nt,av as Ae,G as pe,aw as rt,ax as ot,r as M,ay as lt,az as at,aA as ct,aB as dt,aC as je,aD as mt,aE as ut,aF as ft,e as $,j as i,q as V,c as K,l as Me,aG as xe,o as W,K as oe,n as le,a as ht,v as pt,E as xt,b as gt,B as we}from"./index-DTIMrSki.js";import{u as ge}from"./tooltip-B73tUZ1m.js";import{i as bt,u as ee,S as Le,g as yt}from"./constants-CpnKa-xF.js";import{a as vt,b as jt,v as wt,u as Nt}from"./use-virtual-mcp-DsknuxfQ.js";import{i as St}from"./Check-Bf81oHIx.js";import{Z as _t,A as Y,$ as Ct,u as Tt,c as Et}from"./agent-icon-DM5cF00W.js";import{s as be}from"./Plus-CMEcOONB.js";import{i as ze}from"./X-B1c3_NKe.js";import{u as It,b as kt,h as $t,C as ne}from"./agent-capabilities-g1017n-e.js";import{u as At,c as Mt}from"./chat-context-DkA0z7QG.js";import{N as Lt}from"./agent-icons-C8WXPWgd.js";import{u as Oe,a as re,K as Re,P as Pe,D as De,c as zt,S as Ot,v as Rt,b as Pt,C as Dt,s as Ht,d as Bt,e as Ut,f as Ft}from"./sortable.esm-DsVAkcb-.js";import{u as He,a as Be,o as Qt}from"./use-organization-settings-B437Sgc-.js";import{c as ye,u as Wt,h as qt}from"./shell-layout-DhcPxoJD.js";import{I as Kt}from"./input-COyKwj-n.js";import{S as Xt}from"./scroll-area-DNFFm-Da.js";import{S as Gt,c as Vt,d as Zt,a as Jt,b as Yt}from"./sheet-DgB1c-VM.js";import{S as D}from"./skeleton-vS5RdX08.js";import{t as Ue}from"./ChevronDown-BvRbGG6-.js";import{d as Fe}from"./ZoomOut-DPmFOUrW.js";import{g as es,M as ts}from"./types-DcJ-04H3.js";import{I as ss}from"./integration-icon-D6-qSe9e.js";import{u as is}from"./unwrap-tool-result-BYXdCQMg.js";import{t as Qe,P as ns,e as rs,s as os,g as ls}from"./pair-_1qYDL9O.js";import{a as as}from"./XCircle-Cy7JAcBV.js";import{g as cs}from"./use-mcp-prompts-CLjWTejk.js";import{u as ds,w as ms}from"./tab-id-BvDwqq5G.js";import{D as us,a as fs,b as hs,h as ps,c as Ne,d as xs}from"./dropdown-menu-CmFjLD69.js";import{s as gs}from"./Trash01-C616xT4q.js";import{a as bs,u as ys}from"./use-ai-providers-2aN6ivvn.js";import{a as vs}from"./toolbar-C4mR5FDC.js";import"./use-collections-DwKsUMti.js";import"./AlertCircle-bw8APVTP.js";import"./Tool01-OQo-uXCC.js";import"./SwitchHorizontal01-5FcSEvbO.js";import"./RefreshCcw01-DMnRH0ZT.js";import"./ArrowUpRight-Dbduy1m4.js";import"./ZapSquare-C2cv_s4k.js";import"./Users03-yWp-llAL.js";import"./CheckCircle-C2YKXIzz.js";import"./ChevronLeft-CiPwn0ab.js";import"./ChevronRight-BvmZ62FM.js";import"./ChevronUp-BIjgRrwO.js";import"./DotsVertical-B73bYg9n.js";import"./Container-CtL-mp48.js";import"./Eye-CZAVODeF.js";import"./Globe01-i2XbOy99.js";import"./FilterLines-CP_9llH7.js";import"./Star01-D_E6-i0i.js";import"./Palette-D3jRmDwk.js";import"./HardDrive-CfrLg2xf.js";import"./Stars02-BwO5G7ui.js";import"./Key01-BYQMCT4A.js";import"./LayoutLeft-Zaw_5BZm.js";import"./LinkExternal01-Bj00t0ru.js";import"./Monitor01-B1o877E7.js";import"./Sun-BZiXbHNs.js";import"./Play-BZYwkUau.js";import"./SearchMd-DOIvnVlG.js";import"./Settings02-DdkUIvok.js";import"./Shield01-CSZCc7MG.js";import"./Stars01-DzexK6QI.js";import"./Upload01-Oh0sLtTm.js";import"./User01-D2gFSNxI.js";import"./Users01-5inxqowf.js";import"./XClose-Bt6MNhcr.js";import"./Zap-o4dnVQUJ.js";import"./spinner-ClPrRNae.js";import"./dialog-BgR7sKjj.js";import"./drawer-yi2RSYSs.js";import"./collection-search-CFhPioUl.js";import"./form-CQCVrb2A.js";import"./label-BqzXVIx8.js";import"./select-BwWN8yYM.js";import"./tabs-7ZwKh-ET.js";import"./toggle-group-DitpC9UH.js";import"./connect-desktop-dialog-Cx6ZiLsH.js";import"./popover-BuZ8Y8iu.js";import"./command-CGrKj_q2.js";import"./index-_lE9LP-s.js";import"./useInfiniteQuery-CRK338_N.js";import"./infiniteQueryObserver-qU5LO8rc.js";import"./index-dnazHw5V.js";import"./question-004-sINsf4GQ.js";import"./checkbox-DJbe24ej.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-sm34rGJY.js";import"./settings-section-D8pPcHrJ.js";import"./card-DznbXvu1.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C5Ck0pdF.js";import"./use-registry-connections-C2Tx39xp.js";import"./use-connection-Cwv1LoHp.js";import"./extract-connection-data-Cu0TihZD.js";import"./generate-id-D2atcitn.js";import"./collections-BWns8Fl4.js";import"./collection-tabs-BOrvD3ee.js";import"./badge-DpbVwDlO.js";import"./textarea-BVSBUQBw.js";import"./connection-form-helpers-CoUR8Gdd.js";import"./use-infinite-scroll-C6qx_zOj.js";import"./useSuspenseInfiniteQuery-CDSuZvB0.js";import"./required-auth-layout-C-P6JOpD.js";import"./useRouterState-BuKQPQqt.js";import"./use-org-sso-CvUHQ8hJ.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CKQfjDVo.js";import"./file-type-icon-C-p7ShzI.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-BDPVPFmk.js";import"./decopilot-sse-pool-DovlgNgn.js";import"./create-sse-subscription-BS5983N4.js";function Se(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function js(t,e,s){const r=t.slice(0);return r[e]=s,r}var ws=class extends st{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#n=t,this.#i=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.#i=e,me.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),l=n.map(m=>m.getCurrentResult()),o=s.length!==n.length,c=n.some((m,u)=>m!==s[u]),a=o||c,d=a?!0:l.some((m,u)=>{const f=this.#e[u];return!f||!it(m,f)});!a&&!d||(a&&(this.#c=r,this.#t=n),this.#e=l,this.hasListeners()&&(a&&(Se(s,n).forEach(m=>{m.destroy()}),Se(n,s).forEach(m=>{m.subscribe(u=>{this.#f(m,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(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),n=s.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>this.#m(l??r,e,n),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const n=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,l=>{e.forEach(o=>{o.observer.trackProp(l)})})})}#m(t,e,s){if(e){const r=this.#a,n=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((l,o)=>l!==r[o]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=nt(this.#s,e(t))),this.#s}return t}#p(){return this.#i?.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 n=r.options.queryHash;if(!n)return;const l=e.get(n);l?l.push(r):e.set(n,[r])});const s=[];return t.forEach(r=>{const n=this.#n.defaultQueryOptions(r),o=e.get(n.queryHash)?.shift()??new Ae(this.#n,n);s.push({defaultedQueryOptions:n,observer:o})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=js(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.#i?.combine);(e||s!==r)&&me.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function Ns({queries:t,...e},s){const r=pe(s),n=rt(),l=ot(),o=M.useMemo(()=>t.map(p=>{const h=r.defaultQueryOptions(p);return h._optimisticResults=n?"isRestoring":"optimistic",h}),[t,r,n]);o.forEach(p=>{lt(p);const h=r.getQueryCache().get(p.queryHash);at(p,l,h)}),ct(l);const[c]=M.useState(()=>new ws(r,o,e)),[a,d,m]=c.getOptimisticResult(o,e.combine),u=!n&&e.subscribed!==!1;M.useSyncExternalStore(M.useCallback(p=>u?c.subscribe(me.batchCalls(p)):dt,[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),M.useEffect(()=>{c.setQueries(o,e)},[o,e,c]);const x=a.some((p,h)=>je(o[h],p))?a.flatMap((p,h)=>{const g=o[h];if(g&&je(g,p)){const y=new Ae(r,g);return mt(g,y,l)}return[]}):[];if(x.length>0)throw Promise.all(x);const b=a.find((p,h)=>{const g=o[h];return g&&ut({result:p,errorResetBoundary:l,throwOnError:g.throwOnError,query:r.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(b?.error)throw b.error;return d(m())}function Ss(t,e){return Ns({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:ft,enabled:!0,placeholderData:void 0}))},e)}const te=8;function _s(t){const e=$.c(16),{open:s,onOpenChange:r}=t,[n,l]=M.useState("");let o,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(Gt,{children:"Manage home"}),c=i.jsx(Vt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=o,e[1]=c):(o=e[0],c=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(_t,{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 d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=p=>l(p.target.value),e[3]=d):d=e[3];let m;e[4]!==n?(m=i.jsxs(Zt,{className:"px-5 py-4 border-b border-border",children:[o,c,i.jsxs("div",{className:"relative mt-3",children:[a,i.jsx(Kt,{value:n,onChange:d,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Ys,{}),e[6]=u):u=e[6];let f;e[7]!==n?(f=i.jsx(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(M.Suspense,{fallback:u,children:i.jsx(Ts,{search:n})})})}),e[7]=n,e[8]=f):f=e[8];let x;e[9]!==m||e[10]!==f?(x=i.jsxs(Jt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,f]}),e[9]=m,e[10]=f,e[11]=x):x=e[11];let b;return e[12]!==r||e[13]!==s||e[14]!==x?(b=i.jsx(Yt,{open:s,onOpenChange:r,children:x}),e[12]=r,e[13]=s,e[14]=x,e[15]=b):b=e[15],b}function Cs(t){const e=$.c(32),{org:s}=V(),r=He();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const l=n,o=Be(),c=jt(),a=pe();let d;e[2]!==s||e[3]!==a?(d=()=>a.refetchQueries({queryKey:oe.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=a,e[4]=d):d=e[4];const m=d;let u;e[5]!==l?(u=_=>l.includes(_),e[5]=l,e[6]=u):u=e[6];const f=u;let x;e[7]!==l||e[8]!==t?(x=t?l.filter(_=>t.has(_)).length:l.length,e[7]=l,e[8]=t,e[9]=x):x=e[9];const p=x>=te;let h;e[10]!==p||e[11]!==f||e[12]!==o?(h=_=>f(_)||p?Promise.resolve():o.apply(T=>T.includes(_)?null:[...T,_]),e[10]=p,e[11]=f,e[12]=o,e[13]=h):h=e[13];const g=h;let y;e[14]!==o?(y=_=>o.apply(T=>T.filter(I=>I!==_)),e[14]=o,e[15]=y):y=e[15];const j=y;let v;e[16]!==o?(v=_=>o.apply(()=>_),e[16]=o,e[17]=v):v=e[17];const w=v;let N;e[18]!==c||e[19]!==p||e[20]!==f||e[21]!==m||e[22]!==o?(N=async(_,T)=>{await c.update.mutateAsync({id:_.id,data:{metadata:T}}),!f(_.id)&&!p&&await o.apply(I=>I.includes(_.id)?null:[...I,_.id]),await m()},e[18]=c,e[19]=p,e[20]=f,e[21]=m,e[22]=o,e[23]=N):N=e[23];const S=N;let C;return e[24]!==g||e[25]!==p||e[26]!==l||e[27]!==f||e[28]!==j||e[29]!==w||e[30]!==S?(C={homeIds:l,isOnHome:f,atLimit:p,addAgent:g,removeAgent:j,reorder:w,saveAgentMetadata:S},e[24]=g,e[25]=p,e[26]=l,e[27]=f,e[28]=j,e[29]=w,e[30]=S,e[31]=C):C=e[31],C}function Ts(t){const e=$.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 n=vt(r);let l;e[1]!==n?(l=new Set(n.map(As)),e[1]=n,e[2]=l):l=e[2];const o=Cs(l);let c,a,d;if(e[3]!==n||e[4]!==o||e[5]!==s){const p=new Map(n.map($s));c=s.trim().toLowerCase();const h=y=>!c||y.title?.toLowerCase().includes(c);a=o.homeIds.map(y=>p.get(y)).filter(ks).filter(h);let g;e[9]!==o?(g=y=>!o.isOnHome(y.id),e[9]=o,e[10]=g):g=e[10],d=n.filter(Is).filter(g).filter(h).sort(Es),e[3]=n,e[4]=o,e[5]=s,e[6]=c,e[7]=a,e[8]=d}else c=e[6],a=e[7],d=e[8];const m=d;let u;e[11]!==o||e[12]!==a?(u=i.jsx(Ms,{home:o,agents:a}),e[11]=o,e[12]=a,e[13]=u):u=e[13];const f=!!c;let x;e[14]!==m||e[15]!==o||e[16]!==f?(x=i.jsx(Os,{home:o,agents:m,hasSearch:f}),e[14]=m,e[15]=o,e[16]=f,e[17]=x):x=e[17];let b;return e[18]!==u||e[19]!==x?(b=i.jsxs(i.Fragment,{children:[u,x]}),e[18]=u,e[19]=x,e[20]=b):b=e[20],b}function Es(t,e){return(t.title??"").localeCompare(e.title??"")}function Is(t){return t.id&&!bt(t.id)}function ks(t){return!!t}function $s(t){return[t.id,t]}function As(t){return t.id}function We(t){const e=$.c(7),{title:s,hint:r}=t;let n;e[0]!==s?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1];let l;e[2]!==r?(l=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let o;return e[4]!==n||e[5]!==l?(o=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,l]}),e[4]=n,e[5]=l,e[6]=o):o=e[6],o}function Ms(t){const e=$.c(14),{home:s,agents:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={coordinateGetter:Ht},e[1]=l):l=e[1];const o=Oe(re(Pe,n),re(Re,l));let c;e[2]!==s?(c=x=>{const{active:b,over:p}=x;if(!p||b.id===p.id)return;const h=s.homeIds,g=h.indexOf(b.id),y=h.indexOf(p.id);g===-1||y===-1||s.reorder(Bt([...h],g,y)).catch(zs)},e[2]=s,e[3]=c):c=e[3];const a=c,d=`${s.homeIds.length}/${te}`;let m;e[4]!==d?(m=i.jsx(We,{title:"On home",hint:d}),e[4]=d,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==s||e[9]!==o?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(De,{sensors:o,collisionDetection:zt,onDragEnd:a,children:i.jsx(Ot,{items:r.map(Ls),strategy:Rt,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(x=>i.jsx(Ps,{agent:x,home:s},x.id))})})}),e[6]=r,e[7]=a,e[8]=s,e[9]=o,e[10]=u):u=e[10];let f;return e[11]!==m||e[12]!==u?(f=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=f):f=e[13],f}function Ls(t){return t.id}function zs(){return W.error("Couldn't reorder home — please try again.")}function Os(t){const e=$.c(6),{home:s,agents:r,hasSearch:n}=t,[l,o]=M.useState(20);let c;if(e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==l){const a=r.slice(0,l);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(We,{title:"Add to home"}),e[5]=d):d=e[5],c=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:a.map(m=>i.jsx(Bs,{agent:m,home:s},m.id))}),r.length>l&&i.jsxs("button",{type:"button",onClick:()=>o(Rs),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-l,")"]})]})]}),e[0]=r,e[1]=n,e[2]=s,e[3]=l,e[4]=c}else c=e[4];return c}function Rs(t){return t+20}function qe(t){const e=xe(t.metadata?.ui).filter(l=>!!l.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Ps(t){const e=$.c(57),{agent:s,home:r}=t,[n,l]=M.useState(!1);let o;e[0]!==s.id?(o={id:s.id},e[0]=s.id,e[1]=o):o=e[1];const{attributes:c,listeners:a,setNodeRef:d,transform:m,transition:u,isDragging:f}=Pt(o),x=qe(s)||"Quick access";let b;e[2]!==m?(b=Dt.Transform.toString(m),e[2]=m,e[3]=b):b=e[3];const p=f?.5:void 0,h=f?100:void 0;let g;e[4]!==b||e[5]!==p||e[6]!==h||e[7]!==u?(g={transform:b,transition:u,opacity:p,zIndex:h},e[4]=b,e[5]=p,e[6]=h,e[7]=u,e[8]=g):g=e[8];const y=g,j=f&&"shadow-lg";let v;e[9]!==j?(v=K("rounded-lg border border-border bg-card",j),e[9]=j,e[10]=v):v=e[10];const w=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Fe,{size:14}),e[11]=N):N=e[11];let S;e[12]!==c||e[13]!==a||e[14]!==w?(S=i.jsx("button",{type:"button",...c,...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":w,children:N}),e[12]=c,e[13]=a,e[14]=w,e[15]=S):S=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=()=>l(Hs),e[16]=C):C=e[16];const _=s.title??s.id;let T;e[17]!==s.icon||e[18]!==_?(T=i.jsx(Y,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=T):T=e[19];const I=s.title??s.id;let E;e[20]!==I?(E=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:I}),e[20]=I,e[21]=E):E=e[21];let k;e[22]!==x?(k=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:x}),e[22]=x,e[23]=k):k=e[23];let L;e[24]!==E||e[25]!==k?(L=i.jsxs("div",{className:"min-w-0 flex-1",children:[E,k]}),e[24]=E,e[25]=k,e[26]=L):L=e[26];const U=n&&"rotate-180";let O;e[27]!==U?(O=K("shrink-0 text-muted-foreground transition-transform",U),e[27]=U,e[28]=O):O=e[28];let R;e[29]!==O?(R=i.jsx(Ue,{size:16,className:O}),e[29]=O,e[30]=R):R=e[30];let Q;e[31]!==n||e[32]!==T||e[33]!==L||e[34]!==R?(Q=i.jsxs("button",{type:"button",onClick:C,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[T,L,R]}),e[31]=n,e[32]=T,e[33]=L,e[34]=R,e[35]=Q):Q=e[35];let A;e[36]!==s.id||e[37]!==r?(A=()=>r.removeAgent(s.id).catch(Ds),e[36]=s.id,e[37]=r,e[38]=A):A=e[38];const F=`Remove ${s.title??s.id} from home`;let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(ze,{size:14}),e[39]=P):P=e[39];let z;e[40]!==A||e[41]!==F?(z=i.jsx("button",{type:"button",onClick:A,"aria-label":F,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:P}),e[40]=A,e[41]=F,e[42]=z):z=e[42];let H;e[43]!==S||e[44]!==Q||e[45]!==z?(H=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,Q,z]}),e[43]=S,e[44]=Q,e[45]=z,e[46]=H):H=e[46];let B;e[47]!==s||e[48]!==n||e[49]!==r?(B=n&&i.jsx(Ke,{agent:s,home:r}),e[47]=s,e[48]=n,e[49]=r,e[50]=B):B=e[50];let q;return e[51]!==d||e[52]!==y||e[53]!==H||e[54]!==B||e[55]!==v?(q=i.jsxs("div",{ref:d,style:y,className:v,children:[H,B]}),e[51]=d,e[52]=y,e[53]=H,e[54]=B,e[55]=v,e[56]=q):q=e[56],q}function Ds(){return W.error("Couldn't remove from home — please try again.")}function Hs(t){return!t}function Bs({agent:t,home:e}){const[s,r]=M.useState(!1),[n,l]=M.useState(!1),o=qe(t),c=async()=>{if(!e.atLimit){l(!0);try{await e.addAgent(t.id)}catch{W.error("Couldn't add to home — please try again.")}finally{l(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.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:[i.jsx(Y,{icon:t.icon,name:t.title??t.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),o&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:o})]}),i.jsx(Ue,{size:16,className:K("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:c,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${te}) — 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:n?i.jsx(Me,{size:12,className:"animate-spin"}):i.jsx(be,{size:14})})]}),s&&i.jsx(Ke,{agent:t,home:e})]})}function Ke(t){const e=$.c(26),{agent:s,home:r}=t;let n,l,o,c,a,d,m;if(e[0]!==s||e[1]!==r){const h=xe(s.metadata?.ui);let g;e[9]!==s.connections?(g=(s.connections??[]).map(Fs).sort(),e[9]=s.connections,e[10]=g):g=e[10];const y=g;l=s.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Ws,o=s,c=r,a=y,d=new Set(h.map(Us)),e[0]=s,e[1]=r,e[2]=n,e[3]=l,e[4]=o,e[5]=c,e[6]=a,e[7]=d,e[8]=m}else n=e[2],l=e[3],o=e[4],c=e[5],a=e[6],d=e[7],m=e[8];let u;e[11]!==n||e[12]!==o||e[13]!==c||e[14]!==a||e[15]!==d?(u=i.jsx(n,{agent:o,home:c,connectionIds:a,pinnedResourceUris:d}),e[11]=n,e[12]=o,e[13]=c,e[14]=a,e[15]=d,e[16]=u):u=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Qs,{}),e[17]=f):f=e[17];const x=l??null;let b;e[18]!==s||e[19]!==r||e[20]!==x?(b=i.jsx(M.Suspense,{fallback:f,children:i.jsx(Ks,{agent:s,home:r,curated:x})}),e[18]=s,e[19]=r,e[20]=x,e[21]=b):b=e[21];let p;return e[22]!==m||e[23]!==u||e[24]!==b?(p=i.jsxs("div",{className:m,children:[u,b]}),e[22]=m,e[23]=u,e[24]=b,e[25]=p):p=e[25],p}function Us(t){return t.resourceUri}function Fs(t){return t.connection_id}function Qs(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(D,{className:"h-8 w-full"}),i.jsx(D,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Ws({agent:t,home:e,connectionIds:s,pinnedResourceUris:r}){const{org:n}=V(),l=ee({connectionId:Le,orgId:n.id,orgSlug:n.slug}),{data:o,isLoading:c}=le({queryKey:oe.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async d=>{try{const m=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:d}}),{item:u}=is(m),f=(u?.tools??[]).flatMap(x=>{const b=es(x._meta);return b?[{name:x.name,description:x.description,resourceUri:b}]:[]});return{id:d,title:u?.title??d,icon:u?.icon??null,uiTools:f}}catch{return{id:d,title:d,icon:null,uiTools:[]}}}))).filter(d=>d.uiTools.length>0)});return s.length===0?null:c?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(D,{className:"h-7 w-full"}),i.jsx(D,{className:"h-7 w-2/3"})]}):!o||o.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:o.map(a=>a.uiTools.map(d=>i.jsx(qs,{agent:t,home:e,connection:a,tool:d,isPinned:r.has(d.resourceUri)},`${a.id}:${d.name}`)))})}function qs({agent:t,home:e,connection:s,tool:r,isPinned:n}){const[l,o]=M.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=xe(t.metadata?.ui),d=n?a.filter(u=>u.resourceUri!==r.resourceUri):[...a,{connectionId:s.id,resourceUri:r.resourceUri}],m={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:d}};await e.saveAgentMetadata(t,m)}catch(a){console.error("[home-tiles] failed to toggle tile",a),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(ss,{icon:s.icon,name:s.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Qe(r.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Xe(t){const e=$.c(11),{isPinned:s,submitting:r,onClick:n,label:l}=t,o=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let c;e[0]!==o?(c=K("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",o),e[0]=o,e[1]=c):c=e[1];let a;e[2]!==s||e[3]!==r?(a=r?i.jsx(Me,{size:12,className:"animate-spin"}):s?i.jsx(Ct,{size:14}):i.jsx(be,{size:14}),e[2]=s,e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==l||e[6]!==n||e[7]!==r||e[8]!==c||e[9]!==a?(d=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":l,title:l,className:c,children:a}),e[5]=l,e[6]=n,e[7]=r,e[8]=c,e[9]=a,e[10]=d):d=e[10],d}function Ks(t){const e=$.c(32),{agent:s,home:r,curated:n}=t,{org:l}=V();let o;e[0]!==s.id||e[1]!==l.id||e[2]!==l.slug?(o={connectionId:s.id,orgId:l.id,orgSlug:l.slug},e[0]=s.id,e[1]=l.id,e[2]=l.slug,e[3]=o):o=e[3];const c=ee(o);let a;e[4]!==s.id||e[5]!==l.id?(a=oe.agentPrompts(l.id,s.id),e[4]=s.id,e[5]=l.id,e[6]=a):a=e[6];let d;e[7]!==c?(d=async()=>{const{prompts:w}=await c.listPrompts();return w.map(Zs)},e[7]=c,e[8]=d):d=e[8];let m;e[9]!==a||e[10]!==d?(m={queryKey:a,queryFn:d,staleTime:3e4,retry:!1},e[9]=a,e[10]=d,e[11]=m):m=e[11];const{data:u,isLoading:f,error:x}=le(m),b=ye(l.slug);let p,h;if(e[12]!==s.id||e[13]!==u||e[14]!==b.prompts){let w;e[17]!==s.id?(w=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=w):w=e[18],p=b.prompts.filter(w).map(Vs);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],h=[...N];for(const S of p)h.some(C=>C.name===S.name)||h.push(S);e[12]=s.id,e[13]=u,e[14]=b.prompts,e[15]=p,e[16]=h}else p=e[15],h=e[16];if(f&&p.length===0){let w;return e[21]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(D,{className:"h-7 w-full"}),i.jsx(D,{className:"h-7 w-2/3"})]}),e[21]=w):w=e[21],w}if(x&&p.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,x),null;if(h.length===0)return null;let g;e[22]!==n||e[23]!==h?(g=n??h.map(Gs),e[22]=n,e[23]=h,e[24]=g):g=e[24];let y;e[25]!==g?(y=new Set(g),e[25]=g,e[26]=y):y=e[26];const j=y;let v;return e[27]!==s||e[28]!==r||e[29]!==h||e[30]!==j?(v=i.jsx("div",{className:"flex flex-col gap-0.5",children:h.map(w=>i.jsx(Js,{agent:s,home:r,prompt:w,allPromptNames:h.map(Xs),isPinned:j.has(w.name)},w.name))}),e[27]=s,e[28]=r,e[29]=h,e[30]=j,e[31]=v):v=e[31],v}function Xs(t){return t.name}function Gs(t){return t.name}function Vs(t){return{name:t.promptName,title:t.title,description:t.description}}function Zs(t){return{name:t.name,title:t.title,description:t.description}}function Js({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:n}){const[l,o]=M.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=t.metadata?.ui?.homePrompts;let d;Array.isArray(a)?d=n?a.filter(u=>u!==s.name):[...a,s.name]:d=n?r.filter(u=>u!==s.name):r;const m={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:d}};await e.saveAgentMetadata(t,m)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??Qe(s.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Ys(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},ei)}),t[0]=e):e=t[0],e}function ei(t,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(D,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(D,{className:"h-3 w-1/2"}),i.jsx(D,{className:"h-2.5 w-1/3"})]})]},e)}const J=1,Ge=`home-board.layout.v${J}`;function Ve(t){return`home-board.layout.v${J}.${t}`}const Ze={version:J,tiles:{},hidden:[]};function ue(t){return!t||t.version!==J?Ze:{version:J,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function ti(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function si(t){try{const e=localStorage.getItem(Ve(t));return e?ue(JSON.parse(e)):void 0}catch{return}}function _e(t,e){try{localStorage.setItem(Ve(t),JSON.stringify(e))}catch{}}async function Ce(t,e){if(!(await fetch(`/api/${t}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ii(t){const e=$.c(24),s=pe();let r;e[0]!==t?(r=oe.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const n=r;let l;e[2]!==t?(l=si(t),e[2]=t,e[3]=l):l=e[3];const o=l;let c;e[4]!==o||e[5]!==t?(c=async()=>{const g=await fetch(`/api/${t}/kv/${Ge}`);if(g.status===404)return o&&ti(o)?(await Ce(t,o),o):Ze;if(!g.ok)throw new Error("Failed to load board layout");const y=await g.json(),j=ue(y.value);return _e(t,j),j},e[4]=o,e[5]=t,e[6]=c):c=e[6];let a;e[7]!==o||e[8]!==n||e[9]!==c?(a={queryKey:n,queryFn:c,initialData:o,staleTime:0,refetchOnWindowFocus:!1},e[7]=o,e[8]=n,e[9]=c,e[10]=a):a=e[10];const{data:d,isLoading:m}=le(a);let u;e[11]!==t?(u={mutationFn:g=>Ce(t,g)},e[11]=t,e[12]=u):u=e[12];const f=ht(u);let x;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==n?(x=g=>{_e(t,g),s.setQueryData(n,g),f.mutate(g)},e[13]=f,e[14]=t,e[15]=s,e[16]=n,e[17]=x):x=e[17];const b=x;let p;e[18]!==d?(p=ue(d),e[18]=d,e[19]=p):p=e[19];let h;return e[20]!==m||e[21]!==b||e[22]!==p?(h={layout:p,isLoading:m,save:b},e[20]=m,e[21]=b,e[22]=p,e[23]=h):h=e[23],h}const Je=M.createContext(null);function ni(t){const e=$.c(24),{children:s}=t,{org:r}=V(),n=ii(r.slug),[l,o]=M.useState(!1),[c,a]=M.useState(null);let d;e[0]!==n.layout?(d=()=>{a(n.layout),o(!0)},e[0]=n.layout,e[1]=d):d=e[1];const m=d;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),o(!1)},e[2]=u):u=e[2];const f=u;let x;e[3]!==c||e[4]!==n?(x=()=>{c&&n.save(c),a(null),o(!1)},e[3]=c,e[4]=n,e[5]=x):x=e[5];const b=x,p=l&&c!==null,h=p?c:n.layout;let g;e[6]!==c||e[7]!==p||e[8]!==n.layout?(g=p?JSON.stringify(c)!==JSON.stringify(n.layout):!1,e[6]=c,e[7]=p,e[8]=n.layout,e[9]=g):g=e[9];const y=g;let j;e[10]!==l||e[11]!==n?(j=S=>{l?a(S):n.save(S)},e[10]=l,e[11]=n,e[12]=j):j=e[12];const v=j;let w;e[13]!==v||e[14]!==m||e[15]!==y||e[16]!==l||e[17]!==h||e[18]!==b||e[19]!==n.isLoading?(w={isEditMode:l,enter:m,cancel:f,save:b,hasChanges:y,layout:h,isLayoutLoading:n.isLoading,commitLayout:v},e[13]=v,e[14]=m,e[15]=y,e[16]=l,e[17]=h,e[18]=b,e[19]=n.isLoading,e[20]=w):w=e[20];let N;return e[21]!==s||e[22]!==w?(N=i.jsx(Je.Provider,{value:w,children:s}),e[21]=s,e[22]=w,e[23]=N):N=e[23],N}function Ye(){const t=M.useContext(Je);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function ri({agentId:t}){const{org:e,locator:s}=V(),r=ee({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:n}=ds(),{setTaskId:l}=Wt(),[o,c]=M.useState(null),[a,d]=M.useState(!1),m=M.useRef(!1),u=async(h,g)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,d(!0);try{const y=await cs(r,h.name,g),j={type:"doc",content:[{type:"paragraph",content:[rs({id:h.name,name:os(h.name,ls(h._meta)),metadata:y.messages,char:"/",kind:"prompt",args:g}),{type:"text",text:" "}]}]},v=crypto.randomUUID();ms(sessionStorage,s,v,{tiptapDoc:j}),await n({id:v,virtual_mcp_id:t}),l(v,t,{autosend:!0})}catch(y){console.error("[start-thread-from-prompt] failed",y),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},f=async h=>{if(!m.current){if(h.arguments&&h.arguments.length>0){c(h);return}await u(h)}},x=async h=>{if(!o)return;const g=o;c(null),await u(g,h)};return{start:f,startBlank:async()=>{if(!m.current){m.current=!0,d(!0);try{const h=crypto.randomUUID();await n({id:h,virtual_mcp_id:t}),l(h,t)}catch(h){console.error("[start-thread-from-prompt] startBlank failed",h),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},dialog:i.jsx(ns,{prompt:o,setPrompt:h=>c(h),onSubmit:x}),dialogPrompt:o,starting:a}}const G=4,X=100,Te=12,ie={S:{w:1,h:1},M:{w:1,h:2},T:{w:1,h:3},L:{w:2,h:1},XL:{w:2,h:2},LT:{w:2,h:3},XLT:{w:2,h:4},XXLT:{w:2,h:5},W:{w:4,h:1},WT:{w:4,h:3}},oi={S:"Small",M:"Tall",T:"Column",L:"Wide",XL:"Large",LT:"Showcase",XLT:"Display",XXLT:"Tower",W:"Full width",WT:"Hero"},Ee=["S","M","T","L","XL","LT","XLT","XXLT","W","WT"],li=ie.XL;class fe extends M.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?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(pt,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.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 ai(t){const e=$.c(72),{tiles:s,isEditMode:r,renderTile:n,onMove:l,onResize:o,onRemove:c}=t,a=ge(),d=M.useRef(null),[m,u]=M.useState(null),[f,x]=M.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={activationConstraint:{distance:4}},e[0]=b):b=e[0];const p=Oe(re(Pe,b),re(Re)),h=s.reduce(ci,0),g=r?Math.max(h+2,4):Math.max(h,1);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{const A=d.current?.getBoundingClientRect();return A?{cellWidth:A.width/G,cellHeight:X}:null},e[1]=y):y=e[1];const j=y;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=A=>{u(String(A.active.id)),x(j())},e[2]=v):v=e[2];const w=v;let N;e[3]!==f||e[4]!==l||e[5]!==s?(N=A=>{const F=String(A.active.id),P=f??j();if(u(null),x(null),!P||P.cellWidth<=0)return;const z=s.find(q=>q.id===F);if(!z)return;const H=Math.round(A.delta.x/P.cellWidth),B=Math.round(A.delta.y/P.cellHeight);H===0&&B===0||l(F,{x:z.x+H,y:z.y+B})},e[3]=f,e[4]=l,e[5]=s,e[6]=N):N=e[6];const S=N;if(a){let A;if(e[7]!==n||e[8]!==s){let P;e[10]!==n?(P=z=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:X},children:i.jsx(fe,{children:n(z)})},z.id),e[10]=n,e[11]=P):P=e[11],A=s.map(P),e[7]=n,e[8]=s,e[9]=A}else A=e[9];let F;return e[12]!==A?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=F):F=e[13],F}let C,_,T,I,E,k,L,U,O;if(e[14]!==m||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==c||e[19]!==o||e[20]!==n||e[21]!==p||e[22]!==s||e[23]!==g){const A=m?s.find(Z=>Z.id===m):null;_=De,U=p,O=w,T=S;const F=g*X,P=r?X*4:X;let z;e[33]!==F||e[34]!==P?(z={height:F,minHeight:P},e[33]=F,e[34]=P,e[35]=z):z=e[35];let H;e[36]!==r||e[37]!==s||e[38]!==g?(H=r&&i.jsx(di,{rows:g,tiles:s}),e[36]=r,e[37]=s,e[38]=g,e[39]=H):H=e[39];let B;if(e[40]!==m||e[41]!==r||e[42]!==c||e[43]!==o||e[44]!==n||e[45]!==s){let Z;e[47]!==m||e[48]!==r||e[49]!==c||e[50]!==o||e[51]!==n?(Z=se=>i.jsx(ui,{tile:se,isEditMode:r,isDragging:m===se.id,onResize:o,onRemove:c,children:n(se)},se.id),e[47]=m,e[48]=r,e[49]=c,e[50]=o,e[51]=n,e[52]=Z):Z=e[52],B=s.map(Z),e[40]=m,e[41]=r,e[42]=c,e[43]=o,e[44]=n,e[45]=s,e[46]=B}else B=e[46];e[53]!==z||e[54]!==H||e[55]!==B?(I=i.jsxs("div",{ref:d,className:"relative w-full",style:z,children:[H,B]}),e[53]=z,e[54]=H,e[55]=B,e[56]=I):I=e[56],C=Ut,E=null;const q=A&&f?A.w*f.cellWidth-Te:void 0,ae=A&&f?A.h*f.cellHeight-Te:void 0;e[57]!==q||e[58]!==ae?(k={width:q,height:ae},e[57]=q,e[58]=ae,e[59]=k):k=e[59],L=A&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(fe,{children:n(A)})}),e[14]=m,e[15]=f,e[16]=r,e[17]=S,e[18]=c,e[19]=o,e[20]=n,e[21]=p,e[22]=s,e[23]=g,e[24]=C,e[25]=_,e[26]=T,e[27]=I,e[28]=E,e[29]=k,e[30]=L,e[31]=U,e[32]=O}else C=e[24],_=e[25],T=e[26],I=e[27],E=e[28],k=e[29],L=e[30],U=e[31],O=e[32];let R;e[60]!==C||e[61]!==E||e[62]!==k||e[63]!==L?(R=i.jsx(C,{dropAnimation:E,style:k,children:L}),e[60]=C,e[61]=E,e[62]=k,e[63]=L,e[64]=R):R=e[64];let Q;return e[65]!==_||e[66]!==T||e[67]!==I||e[68]!==R||e[69]!==U||e[70]!==O?(Q=i.jsxs(_,{sensors:U,onDragStart:O,onDragEnd:T,children:[I,R]}),e[65]=_,e[66]=T,e[67]=I,e[68]=R,e[69]=U,e[70]=O,e[71]=Q):Q=e[71],Q}function ci(t,e){return Math.max(t,e.y+e.h)}function di(t){const e=$.c(7),{rows:s,tiles:r}=t;let n;e[0]!==r?(n=(a,d)=>r.some(m=>a>=m.x&&a<m.x+m.w&&d>=m.y&&d<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const l=n;let o;if(e[2]!==l||e[3]!==s){o=[];for(let a=0;a<s;a++)for(let d=0;d<G;d++)l(d,a)||o.push({x:d,y:a});e[2]=l,e[3]=s,e[4]=o}else o=e[4];let c;return e[5]!==o?(c=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(mi)}),e[5]=o,e[6]=c):c=e[6],c}function mi(t){return i.jsx("div",{className:"absolute p-1",style:{left:`${t.x/G*100}%`,top:t.y*X,width:`${1/G*100}%`,height:X},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function ui(t){const e=$.c(31),{tile:s,isEditMode:r,isDragging:n,onResize:l,onRemove:o,children:c}=t,a=!r;let d;e[0]!==a||e[1]!==s.id?(d={id:s.id,disabled:a},e[0]=a,e[1]=s.id,e[2]=d):d=e[2];const{setNodeRef:m,attributes:u,listeners:f,isDragging:x}=Ft(d),b=`${s.x/G*100}%`,p=`${s.w/G*100}%`,h=s.y*X,g=s.h*X,y=x||n,j=!y&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=y&&"opacity-30";let w;e[3]!==j||e[4]!==v?(w=K("absolute p-1 will-change-[left,top,width,height,opacity]",j,v),e[3]=j,e[4]=v,e[5]=w):w=e[5];let N;e[6]!==g||e[7]!==b||e[8]!==h||e[9]!==p?(N={left:b,top:h,width:p,height:g},e[6]=g,e[7]=b,e[8]=h,e[9]=p,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let C;e[11]!==S?(C=K("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=C):C=e[12];let _;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==o||e[17]!==l||e[18]!==s?(_=r&&i.jsxs(i.Fragment,{children:[i.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:i.jsx(Fe,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(fi,{tile:s,onResize:l,onRemove:o})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=o,e[17]=l,e[18]=s,e[19]=_):_=e[19];let T;e[20]!==c?(T=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(fe,{children:c})}),e[20]=c,e[21]=T):T=e[21];let I;e[22]!==T||e[23]!==C||e[24]!==_?(I=i.jsxs("div",{className:C,children:[_,T]}),e[22]=T,e[23]=C,e[24]=_,e[25]=I):I=e[25];let E;return e[26]!==m||e[27]!==I||e[28]!==w||e[29]!==N?(E=i.jsx("div",{ref:m,className:w,style:N,children:I}),e[26]=m,e[27]=I,e[28]=w,e[29]=N,e[30]=E):E=e[30],E}function fi(t){const e=$.c(43),{tile:s,onResize:r,onRemove:n}=t,l=s.minW??1,o=s.minH??1;let c,a,d,m,u,f,x;if(e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==s.h||e[4]!==s.id||e[5]!==s.w){let v;e[13]!==o||e[14]!==l?(v=_=>{const T=ie[_];return T.w>=l&&T.h>=o},e[13]=o,e[14]=l,e[15]=v):v=e[15];const w=Ee.filter(v);let N;e[16]!==s.h||e[17]!==s.w?(N=(()=>{for(const T of Ee){const I=ie[T];if(I.w===s.w&&I.h===s.h)return T}return null})(),e[16]=s.h,e[17]=s.w,e[18]=N):N=e[18];const S=N;a=us,e[19]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(fs,{asChild:!0,children:i.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:i.jsx(Tt,{size:16})})}),e[19]=x):x=e[19],c=hs,d="end",m="w-44",e[20]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ps,{children:"Size"}),e[20]=u):u=e[20];let C;e[21]!==S||e[22]!==r||e[23]!==s.id?(C=_=>{const T=ie[_];return i.jsxs(Ne,{onSelect:()=>r(s.id,T),className:"flex items-center justify-between",children:[i.jsx("span",{children:oi[_]}),i.jsx("span",{className:"text-xs text-muted-foreground",children:S===_?"✓":`${T.w}×${T.h}`})]},_)},e[21]=S,e[22]=r,e[23]=s.id,e[24]=C):C=e[24],f=w.map(C),e[0]=o,e[1]=l,e[2]=r,e[3]=s.h,e[4]=s.id,e[5]=s.w,e[6]=c,e[7]=a,e[8]=d,e[9]=m,e[10]=u,e[11]=f,e[12]=x}else c=e[6],a=e[7],d=e[8],m=e[9],u=e[10],f=e[11],x=e[12];let b;e[25]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx(xs,{}),e[25]=b):b=e[25];let p;e[26]!==n||e[27]!==s.id?(p=()=>n(s.id),e[26]=n,e[27]=s.id,e[28]=p):p=e[28];let h;e[29]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(gs,{size:14,className:"mr-2"}),e[29]=h):h=e[29];let g;e[30]!==p?(g=i.jsxs(Ne,{onSelect:p,className:"text-destructive focus:text-destructive",children:[h,"Remove tile"]}),e[30]=p,e[31]=g):g=e[31];let y;e[32]!==c||e[33]!==d||e[34]!==m||e[35]!==u||e[36]!==f||e[37]!==g?(y=i.jsxs(c,{align:d,className:m,children:[u,f,b,g]}),e[32]=c,e[33]=d,e[34]=m,e[35]=u,e[36]=f,e[37]=g,e[38]=y):y=e[38];let j;return e[39]!==a||e[40]!==y||e[41]!==x?(j=i.jsxs(a,{children:[x,y]}),e[39]=a,e[40]=y,e[41]=x,e[42]=j):j=e[42],j}function hi(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function he(t,e,s){for(let r=0;r<100;r++)for(let n=0;n<=G-e;n++){let l=!0;for(let o=0;o<s&&l;o++)for(let c=0;c<e&&l;c++)hi(t,n+c,r+o)&&(l=!1);if(l)return{x:n,y:r}}return{x:0,y:0}}function ce(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(G,t)),n=Math.max(s.h,Math.min(6,e));return{w:r,h:n}}function de(t,e,s){const r=Math.max(0,Math.min(G-s,t)),n=Math.max(0,e);return{x:r,y:n}}function pi(t,e,s){const r=t.find(a=>a.id===e);if(!r)return t;const n=t.filter(a=>a.id!==e),l=n.find(a=>s.x>=a.x&&s.x<a.x+a.w&&s.y>=a.y&&s.y<a.y+a.h);if(l&&l.w===r.w&&l.h===r.h)return t.map(a=>a.id===e?{...a,x:l.x,y:l.y}:a.id===l.id?{...a,x:r.x,y:r.y}:a);const c=[{...r,x:s.x,y:s.y}];for(const a of n){const d=he(c,a.w,a.h);c.push({...a,x:d.x,y:d.y})}return c}function xi(t){const e=$.c(35),{layout:s,isLayoutLoading:r,commitLayout:n}=Ye();let l;e[0]!==s.hidden?(l=new Set(s.hidden),e[0]=s.hidden,e[1]=l):l=e[1];const o=l;let c,a;if(e[2]!==t||e[3]!==o||e[4]!==s.tiles){a=[];let y;e[7]!==o?(y=v=>v.pinned||!o.has(v.id),e[7]=o,e[8]=y):y=e[8];const j=t.filter(y);c=new Map;for(const v of t)v.minSize&&c.set(v.id,v.minSize);for(const v of j){const w=s.tiles[v.id];if(!w)continue;const N=c.get(v.id),{w:S,h:C}=ce(w.w,w.h,N),{x:_,y:T}=de(w.x,w.y,S);a.push({id:v.id,x:_,y:T,w:S,h:C,minW:N?.w,minH:N?.h})}for(const v of j){if(a.some(T=>T.id===v.id))continue;const w=v.defaultSize??li,N=c.get(v.id),{w:S,h:C}=ce(w.w,w.h,N),_=he(a,S,C);a.push({id:v.id,x:_.x,y:_.y,w:S,h:C,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=o,e[4]=s.tiles,e[5]=c,e[6]=a}else c=e[5],a=e[6];let d;e[9]!==t?(d=new Set(t.map(gi)),e[9]=t,e[10]=d):d=e[10];const m=d;let u;e[11]!==m||e[12]!==n?(u=(y,j)=>{const v={};for(const w of y)v[w.id]={x:w.x,y:w.y,w:w.w,h:w.h};n({version:J,tiles:v,hidden:j.filter(w=>m.has(w))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const f=u;let x;e[14]!==a?(x={visible:a},e[14]=a,e[15]=x):x=e[15];let b;e[16]!==f||e[17]!==s||e[18]!==a?(b=(y,j)=>{const v=a.find(S=>S.id===y);if(!v)return;const w=de(j.x,j.y,v.w);if(w.x===v.x&&w.y===v.y)return;const N=pi(a,y,w);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=a,e[19]=b):b=e[19];let p;e[20]!==f||e[21]!==s||e[22]!==c||e[23]!==a?(p=(y,j)=>{const v=a.find(I=>I.id===y);if(!v)return;const w=c.get(y),{w:N,h:S}=ce(j.w,j.h,w);if(N===v.w&&S===v.h)return;const C={...v,w:N,h:S,x:de(v.x,v.y,N).x},_=a.filter(I=>I.id!==y),T=[C];for(const I of _){const E=he(T,I.w,I.h);T.push({...I,x:E.x,y:E.y})}f(T,s.hidden)},e[20]=f,e[21]=s,e[22]=c,e[23]=a,e[24]=p):p=e[24];let h;e[25]!==f||e[26]!==s||e[27]!==a?(h=y=>{const j=a.filter(v=>v.id!==y);f(j,Array.from(new Set([...s.hidden,y])))},e[25]=f,e[26]=s,e[27]=a,e[28]=h):h=e[28];let g;return e[29]!==r||e[30]!==x||e[31]!==b||e[32]!==p||e[33]!==h?(g={snapshot:x,isLoading:r,moveTile:b,resizeTile:p,hideTile:h},e[29]=r,e[30]=x,e[31]=b,e[32]=p,e[33]=h,e[34]=g):g=e[34],g}function gi(t){return t.id}const bi={w:2,h:4},yi={w:1,h:2},vi={w:1,h:1};function ji(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function wi(t){return`tile:${t.agentId}:${t.resourceUri}`}function Ni(t){return t.promptName?t.agentName:t.description}function Si(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function ve(t){const e=$.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:n,dialog:l,starting:o}=ri(s);let c;e[2]!==r||e[3]!==n?(c=m=>{if(!m.promptName){n();return}r(Si(m))},e[2]=r,e[3]=n,e[4]=c):c=e[4];const a=c;let d;return e[5]!==l||e[6]!==a||e[7]!==n||e[8]!==o?(d={open:a,startBlank:n,dialog:l,starting:o},e[5]=l,e[6]=a,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function _i(t){const e=$.c(32),{entry:s,isEditMode:r}=t,{open:n,dialog:l,starting:o}=ve(s.agentId);let c;e[0]!==s||e[1]!==n?(c=()=>n(s),e[0]=s,e[1]=n,e[2]=c):c=e[2];const a=o||r,d=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=o&&"opacity-60";let f;e[3]!==d||e[4]!==m||e[5]!==u?(f=K("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",d,m,u),e[3]=d,e[4]=m,e[5]=u,e[6]=f):f=e[6];let x;e[7]!==s.agentIcon||e[8]!==s.agentName?(x=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=x):x=e[9];let b;e[10]!==s.title?(b=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=b):b=e[11];let p;e[12]!==s?(p=Ni(s),e[12]=s,e[13]=p):p=e[13];let h;e[14]!==p?(h=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:p}),e[14]=p,e[15]=h):h=e[15];let g;e[16]!==h||e[17]!==b?(g=i.jsxs("div",{className:"min-w-0 flex-1",children:[b,h]}),e[16]=h,e[17]=b,e[18]=g):g=e[18];let y;e[19]!==r?(y=!r&&i.jsx(as,{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]=y):y=e[20];let j;e[21]!==o||e[22]!==c||e[23]!==g||e[24]!==y||e[25]!==a||e[26]!==f||e[27]!==x?(j=i.jsxs("button",{type:"button",onClick:c,disabled:a,"aria-busy":o,className:f,children:[x,g,y]}),e[21]=o,e[22]=c,e[23]=g,e[24]=y,e[25]=a,e[26]=f,e[27]=x,e[28]=j):j=e[28];let v;return e[29]!==l||e[30]!==j?(v=i.jsxs(i.Fragment,{children:[j,l]}),e[29]=l,e[30]=j,e[31]=v):v=e[31],v}function Ci(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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},Ti)}),t[0]=e):e=t[0],e}function Ti(t,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(D,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(D,{className:"h-3 w-2/3"}),i.jsx(D,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ei(t){const e=$.c(49),{tile:s,prompts:r,isEditMode:n,tileWidth:l}=t,{org:o}=V(),{open:c,startBlank:a,dialog:d,starting:m}=ve(s.agentId);let u,f,x,b,p;if(e[0]!==n||e[1]!==c||e[2]!==o.id||e[3]!==o.slug||e[4]!==r||e[5]!==a||e[6]!==m||e[7]!==s||e[8]!==l){const y=r.filter(Ii);b="flex h-full w-full flex-col gap-3 p-3";let j;e[14]!==a?(j=()=>{a()},e[14]=a,e[15]=j):j=e[15];const v=m||n,w=n&&"pl-10 pr-10";let N;e[16]!==w?(N=K("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",w),e[16]=w,e[17]=N):N=e[17];let S;e[18]!==s.agentIcon||e[19]!==s.agentName?(S=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[18]=s.agentIcon,e[19]=s.agentName,e[20]=S):S=e[20];let C;e[21]!==s.agentName?(C=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[21]=s.agentName,e[22]=C):C=e[22];const _=n?"Drag to rearrange":"Open chat";let T;e[23]!==_?(T=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:_}),e[23]=_,e[24]=T):T=e[24];let I;e[25]!==C||e[26]!==T?(I=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[C,T]}),e[25]=C,e[26]=T,e[27]=I):I=e[27],e[28]!==m||e[29]!==S||e[30]!==I||e[31]!==j||e[32]!==v||e[33]!==N?(p=i.jsxs("button",{type:"button",onClick:j,disabled:v,"aria-busy":m,className:N,children:[S,I]}),e[28]=m,e[29]=S,e[30]=I,e[31]=j,e[32]=v,e[33]=N,e[34]=p):p=e[34],u="flex min-h-0 flex-1 gap-3 overflow-hidden";let E;e[35]===Symbol.for("react.memo_cache_sentinel")?(E=i.jsx($i,{}),e[35]=E):E=e[35],e[36]!==o.id||e[37]!==o.slug||e[38]!==s?(f=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(M.Suspense,{fallback:E,children:i.jsx(ki,{tile:s,orgId:o.id,orgSlug:o.slug})})}),e[36]=o.id,e[37]=o.slug,e[38]=s,e[39]=f):f=e[39],x=y.length>0&&!n&&l>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:y.map(k=>i.jsx("button",{type:"button",onClick:()=>c(k),disabled:m,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:i.jsx("span",{className:"line-clamp-2",children:k.title})},k.promptName))}),e[0]=n,e[1]=c,e[2]=o.id,e[3]=o.slug,e[4]=r,e[5]=a,e[6]=m,e[7]=s,e[8]=l,e[9]=u,e[10]=f,e[11]=x,e[12]=b,e[13]=p}else u=e[9],f=e[10],x=e[11],b=e[12],p=e[13];let h;e[40]!==u||e[41]!==f||e[42]!==x?(h=i.jsxs("div",{className:u,children:[f,x]}),e[40]=u,e[41]=f,e[42]=x,e[43]=h):h=e[43];let g;return e[44]!==d||e[45]!==b||e[46]!==p||e[47]!==h?(g=i.jsxs("div",{className:b,children:[p,h,d]}),e[44]=d,e[45]=b,e[46]=p,e[47]=h,e[48]=g):g=e[48],g}function Ii(t){return!!t.promptName}function ki(t){const e=$.c(12),{tile:s,orgId:r,orgSlug:n}=t;let l;e[0]!==r||e[1]!==n||e[2]!==s.connectionId?(l={connectionId:s.connectionId,orgId:r,orgSlug:n},e[0]=r,e[1]=n,e[2]=s.connectionId,e[3]=l):l=e[3];const o=ee(l),c=s.minHeight??200,a=s.maxHeight??4e3;let d;return e[4]!==o||e[5]!==r||e[6]!==n||e[7]!==c||e[8]!==a||e[9]!==s.connectionId||e[10]!==s.resourceUri?(d=i.jsx(ts,{resourceURI:s.resourceUri,orgId:r,orgSlug:n,connectionId:s.connectionId,client:o,displayMode:"fullscreen",minHeight:c,maxHeight:a,className:"h-full"}),e[4]=o,e[5]=r,e[6]=n,e[7]=c,e[8]=a,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=d):d=e[11],d}function $i(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(D,{className:"h-3 w-2/3"}),i.jsx(D,{className:"h-3 w-1/2"}),i.jsx(D,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Ai(t){const e=$.c(14),{icon:s,name:r}=t;let n;e[0]!==s||e[1]!==r?(n=i.jsx(Y,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=n):n=e[2];let l;e[3]!==r?(l=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=l):l=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=o):o=e[5];let c;e[6]!==l?(c=i.jsxs("div",{className:"min-w-0 flex-1",children:[l,o]}),e[6]=l,e[7]=c):c=e[7];let a;e[8]!==n||e[9]!==c?(a=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,c]}),e[8]=n,e[9]=c,e[10]=a):a=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(D,{className:"h-3 w-3/4"}),i.jsx(D,{className:"h-3 w-1/2"}),i.jsx(D,{className:"h-3 w-2/3"})]}),e[11]=d):d=e[11];let m;return e[12]!==a?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,d]}),e[12]=a,e[13]=m):m=e[13],m}function Mi(t){const e=$.c(33),{tile:s,prompts:r,isEditMode:n}=t,{open:l,startBlank:o,dialog:c,starting:a}=ve(s.agentId);let d,m,u;if(e[0]!==n||e[1]!==l||e[2]!==r||e[3]!==o||e[4]!==a||e[5]!==s.agentIcon||e[6]!==s.agentName){const x=r.filter(Li);d="flex h-full w-full flex-col gap-3 p-4";let b;e[10]!==o?(b=()=>{o()},e[10]=o,e[11]=b):b=e[11];const p=a||n,h=n&&"pl-10 pr-10";let g;e[12]!==h?(g=K("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",h),e[12]=h,e[13]=g):g=e[13];let y;e[14]!==s.agentIcon||e[15]!==s.agentName?(y=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[14]=s.agentIcon,e[15]=s.agentName,e[16]=y):y=e[16];let j;e[17]!==s.agentName?(j=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[17]=s.agentName,e[18]=j):j=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=v):v=e[19];let w;e[20]!==j?(w=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[j,v]}),e[20]=j,e[21]=w):w=e[21],e[22]!==w||e[23]!==b||e[24]!==p||e[25]!==g||e[26]!==y?(m=i.jsxs("button",{type:"button",onClick:b,disabled:p,className:g,children:[y,w]}),e[22]=w,e[23]=b,e[24]=p,e[25]=g,e[26]=y,e[27]=m):m=e[27],u=x.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:x.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&l(N),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:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=l,e[2]=r,e[3]=o,e[4]=a,e[5]=s.agentIcon,e[6]=s.agentName,e[7]=d,e[8]=m,e[9]=u}else d=e[7],m=e[8],u=e[9];let f;return e[28]!==c||e[29]!==d||e[30]!==m||e[31]!==u?(f=i.jsxs("div",{className:d,children:[m,u,c]}),e[28]=c,e[29]=d,e[30]=m,e[31]=u,e[32]=f):f=e[32],f}function Li(t){return!!t.promptName}function et(t){const e=$.c(36),{isEditMode:s}=t,{org:r}=V(),{isLoading:n,prompts:l,tiles:o}=ye(r.slug),c=He()?.ids??[];let a;e[0]!==c?(a=new Set(c),e[0]=c,e[1]=a):a=e[1];const d=a,m=Be();let u;e[2]!==o?(u=new Set(o.map(Di)),e[2]=o,e[3]=u):u=e[3];const f=u;let x;if(e[4]!==l){x=new Map;for(const E of l){const k=x.get(E.agentId);k?k.push(E):x.set(E.agentId,[E])}e[4]=l,e[5]=x}else x=e[5];let b;if(e[6]!==l||e[7]!==f||e[8]!==o){let E;e[10]!==f?(E=L=>!f.has(L.agentId),e[10]=f,e[11]=E):E=e[11];const k=l.filter(E);b=[...o.map(Pi),...k.map(Ri)],e[6]=l,e[7]=f,e[8]=o,e[9]=b}else b=e[9];const p=b;let h;e[12]!==p?(h=new Map(p.map(Oi)),e[12]=p,e[13]=h):h=e[13];const g=h;let y;e[14]!==p||e[15]!==d?(y=p.map(E=>({id:E.id,defaultSize:E.kind==="tile"?bi:vi,minSize:E.kind==="tile"?yi:void 0,pinned:d.has(E.data.agentId)})),e[14]=p,e[15]=d,e[16]=y):y=e[16];const j=xi(y);let v;e[17]!==m?(v=E=>{m.apply(k=>k.filter(L=>L!==E)).catch(zi)},e[17]=m,e[18]=v):v=e[18];const w=v;let N;e[19]!==g||e[20]!==j||e[21]!==d||e[22]!==w?(N=E=>{const k=g.get(E);k&&d.has(k.data.agentId)?w(k.data.agentId):j.hideTile(E)},e[19]=g,e[20]=j,e[21]=d,e[22]=w,e[23]=N):N=e[23];const S=N;let C;e[24]!==g||e[25]!==s||e[26]!==x?(C=E=>{const k=g.get(E.id);if(!k)return null;if(k.kind==="tile"){const L=x.get(k.data.agentId)??[];return i.jsx(xt,{fallback:i.jsx(Mi,{tile:k.data,prompts:L,isEditMode:s}),children:i.jsx(M.Suspense,{fallback:i.jsx(Ai,{icon:k.data.agentIcon,name:k.data.agentName}),children:i.jsx(Ei,{tile:k.data,prompts:L,isEditMode:s,tileWidth:E.w})})})}return i.jsx(_i,{entry:k.data,isEditMode:s})},e[24]=g,e[25]=s,e[26]=x,e[27]=C):C=e[27];const _=C;if(n||j.isLoading){let E;return e[28]===Symbol.for("react.memo_cache_sentinel")?(E=i.jsx(Ci,{}),e[28]=E):E=e[28],E}if(j.snapshot.visible.length===0&&!s)return null;let I;return e[29]!==s||e[30]!==j.moveTile||e[31]!==j.resizeTile||e[32]!==j.snapshot.visible||e[33]!==S||e[34]!==_?(I=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ai,{tiles:j.snapshot.visible,isEditMode:s,renderTile:_,onMove:j.moveTile,onResize:j.resizeTile,onRemove:S})}),e[29]=s,e[30]=j.moveTile,e[31]=j.resizeTile,e[32]=j.snapshot.visible,e[33]=S,e[34]=_,e[35]=I):I=e[35],I}function zi(){return W.error("Couldn't remove from home — please try again.")}function Oi(t){return[t.id,t]}function Ri(t){return{kind:"prompt",id:ji(t),data:t}}function Pi(t){return{kind:"tile",id:wi(t),data:t}}function Di(t){return t.agentId}function Hi(t){const e=$.c(2),{prompts:s,tiles:r}=ye(t),n=r.length>0||s.length>0;let l;return e[0]!==n?(l={hasVisibleTiles:n},e[0]=n,e[1]=l):l=e[1],l}const Ie=420,ke=305;function tt(){const t=$.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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:Ie}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.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:Ie}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.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:ke}}),t[2]=r):r=t[2];let n;return t[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,i.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:ke}})]}),t[3]=n):n=t[3],n}function $e(){const t=$.c(33),{data:e}=gt.useSession(),{org:s}=V(),r=ge(),n=At(),{selectedVirtualMcp:l}=Mt();let o;t[0]!==s.id?(o=yt(s.id),t[0]=s.id,t[1]=o):o=t[1];const a=l??o;let d;t[2]!==s.slug?(d=qt(s.slug),t[2]=s.slug,t[3]=d):d=t[3],le(d);let m;t[4]!==s.id||t[5]!==s.slug?(m={connectionId:Le,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=m):m=t[6];const u=ee(m);let f;t[7]!==s.id||t[8]!==u?(f=bs(u,s.id),t[7]=s.id,t[8]=u,t[9]=f):f=t[9];let x;t[10]!==s.id||t[11]!==u?(x=Qt(u,s.id),t[10]=s.id,t[11]=u,t[12]=x):x=t[12];let b;t[13]!==a.id||t[14]!==s.id||t[15]!==u?(b=wt(s.id,a.id,u),t[13]=a.id,t[14]=s.id,t[15]=u,t[16]=b):b=t[16];let p;t[17]!==f||t[18]!==x||t[19]!==b?(p={queries:[f,x,b]},t[17]=f,t[18]=x,t[19]=b,t[20]=p):p=t[20],Ss(p);const h=ys(),g=Nt(a.id),{hasDecoKey:y,isZeroBalance:j,isInitialFreeCredit:v,balanceDollars:w,hasOnlyDecoProvider:N}=It(),{hasVisibleTiles:S}=Hi(s.slug),C=kt(g?.metadata);if(h.length===0&&!(C&&$t(n))){let R;return t[21]===Symbol.for("react.memo_cache_sentinel")?(R=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(Lt,{})})}),t[21]=R):R=t[21],R}let T;t[22]!==e?.user?.name?(T=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=T):T=t[23];const I=T,E=y&&v&&w!=null,k=y&&j&&N;let L;t[24]!==w||t[25]!==E||t[26]!==k?(L=E?i.jsx(ne.CreditsEyebrow,{balanceDollars:w}):k?i.jsx(ne.NoCreditsEyebrow,{}):null,t[24]=w,t[25]=E,t[26]=k,t[27]=L):L=t[27];const U=L;let O;return t[28]!==U||t[29]!==S||t[30]!==r||t[31]!==I?(O=i.jsx(ni,{children:r?i.jsx(Bi,{eyebrow:U,userName:I}):i.jsx(Ui,{eyebrow:U,userName:I,hasVisibleTiles:S})}),t[28]=U,t[29]=S,t[30]=r,t[31]=I,t[32]=O):O=t[32],O}function Bi(t){const e=$.c(12),{eyebrow:s,userName:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(tt,{}),e[0]=n):n=e[0];let l;e[1]!==s?(l=s&&i.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=l):l=e[2];let o;e[3]!==r?(o=i.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]=o):o=e[4];let c;e[5]!==l||e[6]!==o?(c=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[l,o]}),e[5]=l,e[6]=o,e[7]=c):c=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(ne.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(et,{isEditMode:!1})}),e[9]=d):d=e[9];let m;return e[10]!==c?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,c,a,d]}),e[10]=c,e[11]=m):m=e[11],m}function Ui(t){const e=$.c(32),{eyebrow:s,userName:r,hasVisibleTiles:n}=t,{isEditMode:l,enter:o,save:c,cancel:a,hasChanges:d}=Ye(),[m,u]=M.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let x;e[1]!==a||e[2]!==o||e[3]!==d||e[4]!==l||e[5]!==c?(x=i.jsx(vs.Right,{children:i.jsx(Fi,{isEditMode:l,hasChanges:d,onEnter:o,onSave:c,onCancel:a,onAddTile:f})}),e[1]=a,e[2]=o,e[3]=d,e[4]=l,e[5]=c,e[6]=x):x=e[6];let b;e[7]!==m?(b=i.jsx(_s,{open:m,onOpenChange:u}),e[7]=m,e[8]=b):b=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(tt,{}),e[9]=p):p=e[9];const h=n||l?"pt-32":"flex-1 justify-center";let g;e[10]!==h?(g=K("relative flex flex-col items-center px-10 pb-4",h),e[10]=h,e[11]=g):g=e[11];let y;e[12]!==s?(y=s&&i.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=y):y=e[13];let j;e[14]!==r?(j=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=j):j=e[15];let v;e[16]!==y||e[17]!==j?(v=i.jsxs("div",{className:"text-center mb-10",children:[y,j]}),e[16]=y,e[17]=j,e[18]=v):v=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Qi,{}),i.jsx(ne.Input,{showConnectionsBanner:!0})]}),e[19]=w):w=e[19];let N;e[20]!==v?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,w]}),e[20]=v,e[21]=N):N=e[21];let S;e[22]!==l?(S=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(et,{isEditMode:l})}),e[22]=l,e[23]=S):S=e[23];let C;e[24]!==N||e[25]!==S||e[26]!==g?(C=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[p,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:g,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=g,e[27]=C):C=e[27];let _;return e[28]!==C||e[29]!==x||e[30]!==b?(_=i.jsxs(i.Fragment,{children:[x,b,C]}),e[28]=C,e[29]=x,e[30]=b,e[31]=_):_=e[31],_}function Fi(t){const e=$.c(17),{isEditMode:s,hasChanges:r,onEnter:n,onSave:l,onCancel:o,onAddTile:c}=t;if(s){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(be,{size:14}),e[0]=m):m=e[0];let u;e[1]!==c?(u=i.jsxs("button",{type:"button",onClick:c,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:[m,"Add tile"]}),e[1]=c,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(ze,{size:14}),e[3]=f):f=e[3];let x;e[4]!==o?(x=i.jsxs(we,{size:"sm",variant:"ghost",onClick:o,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=o,e[5]=x):x=e[5];const b=!r;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(St,{size:14}),e[6]=p):p=e[6];let h;e[7]!==l||e[8]!==b?(h=i.jsxs(we,{size:"sm",onClick:l,disabled:b,className:"gap-1.5 h-7 text-xs",children:[p,"Save"]}),e[7]=l,e[8]=b,e[9]=h):h=e[9];let g;return e[10]!==u||e[11]!==x||e[12]!==h?(g=i.jsxs(i.Fragment,{children:[u,x,h]}),e[10]=u,e[11]=x,e[12]=h,e[13]=g):g=e[13],g}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Et,{size:14}),e[14]=a):a=e[14];let d;return e[15]!==n?(d=i.jsxs("button",{type:"button",onClick:n,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]=n,e[16]=d):d=e[16],d}function Qi(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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 Zr(){const t=$.c(2);if(ge()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx($e,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx($e,{})})})}),t[1]=s):s=t[1],s}export{Zr as default};
1
+ import{ar as st,as as me,at as it,au as nt,av as Ae,G as pe,aw as rt,ax as ot,r as M,ay as lt,az as at,aA as ct,aB as dt,aC as je,aD as mt,aE as ut,aF as ft,e as $,j as i,q as V,c as K,l as Me,aG as xe,o as W,K as oe,n as le,a as ht,v as pt,E as xt,b as gt,B as we}from"./index-B-PHV3oz.js";import{u as ge}from"./tooltip-5zCZryvU.js";import{i as bt,u as ee,S as Le,g as yt}from"./constants-z4dXNe1A.js";import{a as vt,b as jt,v as wt,u as Nt}from"./use-virtual-mcp-DPpsp0b-.js";import{i as St}from"./Check-B05JiFMG.js";import{Z as _t,A as Y,$ as Ct,u as Tt,c as Et}from"./agent-icon-DvIbcdW2.js";import{s as be}from"./Plus-2y8e9M50.js";import{i as ze}from"./X-3fwJpxV0.js";import{u as It,b as kt,h as $t,C as ne}from"./agent-capabilities-DBe6gbqa.js";import{u as At,c as Mt}from"./chat-context-CAiaOJBn.js";import{N as Lt}from"./agent-icons-DyjPUCsW.js";import{u as Oe,a as re,K as Re,P as Pe,D as De,c as zt,S as Ot,v as Rt,b as Pt,C as Dt,s as Ht,d as Bt,e as Ut,f as Ft}from"./sortable.esm-BcFz9Psy.js";import{u as He,a as Be,o as Qt}from"./use-organization-settings-CDjtm6S0.js";import{c as ye,u as Wt,h as qt}from"./shell-layout-xKUGAKiS.js";import{I as Kt}from"./input-DMqfVdLl.js";import{S as Xt}from"./scroll-area-Cm6OwqFg.js";import{S as Gt,c as Vt,d as Zt,a as Jt,b as Yt}from"./sheet-D_M_IVaY.js";import{S as D}from"./skeleton-9nqYTB4H.js";import{t as Ue}from"./ChevronDown-B-1h0qij.js";import{d as Fe}from"./ZoomOut-sWkdOBib.js";import{g as es,M as ts}from"./types-ChK1eRLX.js";import{I as ss}from"./integration-icon-D82j_1fN.js";import{u as is}from"./unwrap-tool-result-BYXdCQMg.js";import{t as Qe,P as ns,e as rs,s as os,g as ls}from"./pair-crvFYVBr.js";import{a as as}from"./XCircle-86RGTWAp.js";import{g as cs}from"./use-mcp-prompts-NDfKteCA.js";import{u as ds,w as ms}from"./tab-id-D6B9k9rp.js";import{D as us,a as fs,b as hs,h as ps,c as Ne,d as xs}from"./dropdown-menu-Dl0H7aq8.js";import{s as gs}from"./Trash01-De5yP0M0.js";import{a as bs,u as ys}from"./use-ai-providers-DOlhyKeN.js";import{a as vs}from"./toolbar-Dfgzdkic.js";import"./use-collections-B47GVLOL.js";import"./AlertCircle-2Km0CX2z.js";import"./Tool01-CHQi6ime.js";import"./SwitchHorizontal01-D8n2_4Ky.js";import"./RefreshCcw01-7LgZ2KuS.js";import"./ArrowUpRight-BLByMWEr.js";import"./ZapSquare-CzOxfiLh.js";import"./Users03-CyIgvftP.js";import"./CheckCircle-D2PakmMP.js";import"./ChevronLeft-DZmvAgUs.js";import"./ChevronRight-UH18q_3i.js";import"./ChevronUp-CNAXIcyx.js";import"./DotsVertical-CBkWO2us.js";import"./Container-CnVkM2IK.js";import"./Eye-BF--IKG8.js";import"./Globe01-C6CmSgYh.js";import"./FilterLines-NzTnzrsm.js";import"./Star01-BIOcBShW.js";import"./Palette-qBV8jtn1.js";import"./HardDrive-C8gbUBwi.js";import"./Stars02-BxWZ5xUE.js";import"./Key01-DdkT4-r1.js";import"./LayoutLeft-Cq-3SzOV.js";import"./LinkExternal01-BuKoKvOJ.js";import"./Monitor01-DtzCrxlL.js";import"./Sun-cNIbkxvb.js";import"./Play-BwyGr6Ll.js";import"./SearchMd-BNL3h-Lw.js";import"./Settings02-D3dhPmVM.js";import"./Shield01-02qnRjhT.js";import"./Stars01-Ra7VZDk8.js";import"./Upload01-C4oU-PRW.js";import"./User01-BQtKeucE.js";import"./Users01-B5Mk__ya.js";import"./XClose-BlyN_Sc4.js";import"./Zap-Ca8RLP4U.js";import"./spinner-B2vBmLe8.js";import"./dialog-D4L8eWam.js";import"./drawer-_tDof6Q1.js";import"./collection-search-7eYR8rmz.js";import"./form-DWpWJxH3.js";import"./label-CEKSGqhJ.js";import"./select-xdBxNMUb.js";import"./tabs-B8C4rHnI.js";import"./toggle-group-C4X1dcf6.js";import"./connect-desktop-dialog-B5JH2LsR.js";import"./popover-Dl1ZkjR5.js";import"./command-BW6ahm7f.js";import"./index-DPSjO83e.js";import"./useInfiniteQuery-5f-XmzuR.js";import"./infiniteQueryObserver-D8VqrbcP.js";import"./index-5dm8s9_d.js";import"./question-004-sINsf4GQ.js";import"./checkbox-BRdsmoVp.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-5lbWWNzy.js";import"./settings-section-C5SA5_8A.js";import"./card-BojXSjgh.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CLgdMTGQ.js";import"./use-registry-connections-BGN7oY_B.js";import"./use-connection-xtan9MLA.js";import"./extract-connection-data-DubVfj_8.js";import"./generate-id-CUPl0OgE.js";import"./collections-6h-er8nI.js";import"./collection-tabs-wah4r8cS.js";import"./badge-C8lUCNjK.js";import"./textarea-DHIira09.js";import"./connection-form-helpers-BOF_wZkg.js";import"./use-infinite-scroll-DOmZgM0o.js";import"./useSuspenseInfiniteQuery-CI2XOApz.js";import"./required-auth-layout-XAFLruT3.js";import"./useRouterState-C1tnhy3B.js";import"./use-org-sso-C0VlDkck.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C4ZAj4f4.js";import"./file-type-icon-CYcdJQBd.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-Bj_pSs39.js";import"./decopilot-sse-pool-D_E34tmA.js";import"./create-sse-subscription-BS5983N4.js";function Se(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function js(t,e,s){const r=t.slice(0);return r[e]=s,r}var ws=class extends st{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#n=t,this.#i=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.#i=e,me.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),l=n.map(m=>m.getCurrentResult()),o=s.length!==n.length,c=n.some((m,u)=>m!==s[u]),a=o||c,d=a?!0:l.some((m,u)=>{const f=this.#e[u];return!f||!it(m,f)});!a&&!d||(a&&(this.#c=r,this.#t=n),this.#e=l,this.hasListeners()&&(a&&(Se(s,n).forEach(m=>{m.destroy()}),Se(n,s).forEach(m=>{m.subscribe(u=>{this.#f(m,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(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),n=s.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>this.#m(l??r,e,n),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const n=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,l=>{e.forEach(o=>{o.observer.trackProp(l)})})})}#m(t,e,s){if(e){const r=this.#a,n=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((l,o)=>l!==r[o]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=nt(this.#s,e(t))),this.#s}return t}#p(){return this.#i?.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 n=r.options.queryHash;if(!n)return;const l=e.get(n);l?l.push(r):e.set(n,[r])});const s=[];return t.forEach(r=>{const n=this.#n.defaultQueryOptions(r),o=e.get(n.queryHash)?.shift()??new Ae(this.#n,n);s.push({defaultedQueryOptions:n,observer:o})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=js(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.#i?.combine);(e||s!==r)&&me.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function Ns({queries:t,...e},s){const r=pe(s),n=rt(),l=ot(),o=M.useMemo(()=>t.map(p=>{const h=r.defaultQueryOptions(p);return h._optimisticResults=n?"isRestoring":"optimistic",h}),[t,r,n]);o.forEach(p=>{lt(p);const h=r.getQueryCache().get(p.queryHash);at(p,l,h)}),ct(l);const[c]=M.useState(()=>new ws(r,o,e)),[a,d,m]=c.getOptimisticResult(o,e.combine),u=!n&&e.subscribed!==!1;M.useSyncExternalStore(M.useCallback(p=>u?c.subscribe(me.batchCalls(p)):dt,[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),M.useEffect(()=>{c.setQueries(o,e)},[o,e,c]);const x=a.some((p,h)=>je(o[h],p))?a.flatMap((p,h)=>{const g=o[h];if(g&&je(g,p)){const y=new Ae(r,g);return mt(g,y,l)}return[]}):[];if(x.length>0)throw Promise.all(x);const b=a.find((p,h)=>{const g=o[h];return g&&ut({result:p,errorResetBoundary:l,throwOnError:g.throwOnError,query:r.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(b?.error)throw b.error;return d(m())}function Ss(t,e){return Ns({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:ft,enabled:!0,placeholderData:void 0}))},e)}const te=8;function _s(t){const e=$.c(16),{open:s,onOpenChange:r}=t,[n,l]=M.useState("");let o,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(Gt,{children:"Manage home"}),c=i.jsx(Vt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=o,e[1]=c):(o=e[0],c=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(_t,{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 d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=p=>l(p.target.value),e[3]=d):d=e[3];let m;e[4]!==n?(m=i.jsxs(Zt,{className:"px-5 py-4 border-b border-border",children:[o,c,i.jsxs("div",{className:"relative mt-3",children:[a,i.jsx(Kt,{value:n,onChange:d,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Ys,{}),e[6]=u):u=e[6];let f;e[7]!==n?(f=i.jsx(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(M.Suspense,{fallback:u,children:i.jsx(Ts,{search:n})})})}),e[7]=n,e[8]=f):f=e[8];let x;e[9]!==m||e[10]!==f?(x=i.jsxs(Jt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,f]}),e[9]=m,e[10]=f,e[11]=x):x=e[11];let b;return e[12]!==r||e[13]!==s||e[14]!==x?(b=i.jsx(Yt,{open:s,onOpenChange:r,children:x}),e[12]=r,e[13]=s,e[14]=x,e[15]=b):b=e[15],b}function Cs(t){const e=$.c(32),{org:s}=V(),r=He();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const l=n,o=Be(),c=jt(),a=pe();let d;e[2]!==s||e[3]!==a?(d=()=>a.refetchQueries({queryKey:oe.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=a,e[4]=d):d=e[4];const m=d;let u;e[5]!==l?(u=_=>l.includes(_),e[5]=l,e[6]=u):u=e[6];const f=u;let x;e[7]!==l||e[8]!==t?(x=t?l.filter(_=>t.has(_)).length:l.length,e[7]=l,e[8]=t,e[9]=x):x=e[9];const p=x>=te;let h;e[10]!==p||e[11]!==f||e[12]!==o?(h=_=>f(_)||p?Promise.resolve():o.apply(T=>T.includes(_)?null:[...T,_]),e[10]=p,e[11]=f,e[12]=o,e[13]=h):h=e[13];const g=h;let y;e[14]!==o?(y=_=>o.apply(T=>T.filter(I=>I!==_)),e[14]=o,e[15]=y):y=e[15];const j=y;let v;e[16]!==o?(v=_=>o.apply(()=>_),e[16]=o,e[17]=v):v=e[17];const w=v;let N;e[18]!==c||e[19]!==p||e[20]!==f||e[21]!==m||e[22]!==o?(N=async(_,T)=>{await c.update.mutateAsync({id:_.id,data:{metadata:T}}),!f(_.id)&&!p&&await o.apply(I=>I.includes(_.id)?null:[...I,_.id]),await m()},e[18]=c,e[19]=p,e[20]=f,e[21]=m,e[22]=o,e[23]=N):N=e[23];const S=N;let C;return e[24]!==g||e[25]!==p||e[26]!==l||e[27]!==f||e[28]!==j||e[29]!==w||e[30]!==S?(C={homeIds:l,isOnHome:f,atLimit:p,addAgent:g,removeAgent:j,reorder:w,saveAgentMetadata:S},e[24]=g,e[25]=p,e[26]=l,e[27]=f,e[28]=j,e[29]=w,e[30]=S,e[31]=C):C=e[31],C}function Ts(t){const e=$.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 n=vt(r);let l;e[1]!==n?(l=new Set(n.map(As)),e[1]=n,e[2]=l):l=e[2];const o=Cs(l);let c,a,d;if(e[3]!==n||e[4]!==o||e[5]!==s){const p=new Map(n.map($s));c=s.trim().toLowerCase();const h=y=>!c||y.title?.toLowerCase().includes(c);a=o.homeIds.map(y=>p.get(y)).filter(ks).filter(h);let g;e[9]!==o?(g=y=>!o.isOnHome(y.id),e[9]=o,e[10]=g):g=e[10],d=n.filter(Is).filter(g).filter(h).sort(Es),e[3]=n,e[4]=o,e[5]=s,e[6]=c,e[7]=a,e[8]=d}else c=e[6],a=e[7],d=e[8];const m=d;let u;e[11]!==o||e[12]!==a?(u=i.jsx(Ms,{home:o,agents:a}),e[11]=o,e[12]=a,e[13]=u):u=e[13];const f=!!c;let x;e[14]!==m||e[15]!==o||e[16]!==f?(x=i.jsx(Os,{home:o,agents:m,hasSearch:f}),e[14]=m,e[15]=o,e[16]=f,e[17]=x):x=e[17];let b;return e[18]!==u||e[19]!==x?(b=i.jsxs(i.Fragment,{children:[u,x]}),e[18]=u,e[19]=x,e[20]=b):b=e[20],b}function Es(t,e){return(t.title??"").localeCompare(e.title??"")}function Is(t){return t.id&&!bt(t.id)}function ks(t){return!!t}function $s(t){return[t.id,t]}function As(t){return t.id}function We(t){const e=$.c(7),{title:s,hint:r}=t;let n;e[0]!==s?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1];let l;e[2]!==r?(l=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let o;return e[4]!==n||e[5]!==l?(o=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,l]}),e[4]=n,e[5]=l,e[6]=o):o=e[6],o}function Ms(t){const e=$.c(14),{home:s,agents:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={coordinateGetter:Ht},e[1]=l):l=e[1];const o=Oe(re(Pe,n),re(Re,l));let c;e[2]!==s?(c=x=>{const{active:b,over:p}=x;if(!p||b.id===p.id)return;const h=s.homeIds,g=h.indexOf(b.id),y=h.indexOf(p.id);g===-1||y===-1||s.reorder(Bt([...h],g,y)).catch(zs)},e[2]=s,e[3]=c):c=e[3];const a=c,d=`${s.homeIds.length}/${te}`;let m;e[4]!==d?(m=i.jsx(We,{title:"On home",hint:d}),e[4]=d,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==s||e[9]!==o?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(De,{sensors:o,collisionDetection:zt,onDragEnd:a,children:i.jsx(Ot,{items:r.map(Ls),strategy:Rt,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(x=>i.jsx(Ps,{agent:x,home:s},x.id))})})}),e[6]=r,e[7]=a,e[8]=s,e[9]=o,e[10]=u):u=e[10];let f;return e[11]!==m||e[12]!==u?(f=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=f):f=e[13],f}function Ls(t){return t.id}function zs(){return W.error("Couldn't reorder home — please try again.")}function Os(t){const e=$.c(6),{home:s,agents:r,hasSearch:n}=t,[l,o]=M.useState(20);let c;if(e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==l){const a=r.slice(0,l);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(We,{title:"Add to home"}),e[5]=d):d=e[5],c=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:a.map(m=>i.jsx(Bs,{agent:m,home:s},m.id))}),r.length>l&&i.jsxs("button",{type:"button",onClick:()=>o(Rs),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-l,")"]})]})]}),e[0]=r,e[1]=n,e[2]=s,e[3]=l,e[4]=c}else c=e[4];return c}function Rs(t){return t+20}function qe(t){const e=xe(t.metadata?.ui).filter(l=>!!l.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Ps(t){const e=$.c(57),{agent:s,home:r}=t,[n,l]=M.useState(!1);let o;e[0]!==s.id?(o={id:s.id},e[0]=s.id,e[1]=o):o=e[1];const{attributes:c,listeners:a,setNodeRef:d,transform:m,transition:u,isDragging:f}=Pt(o),x=qe(s)||"Quick access";let b;e[2]!==m?(b=Dt.Transform.toString(m),e[2]=m,e[3]=b):b=e[3];const p=f?.5:void 0,h=f?100:void 0;let g;e[4]!==b||e[5]!==p||e[6]!==h||e[7]!==u?(g={transform:b,transition:u,opacity:p,zIndex:h},e[4]=b,e[5]=p,e[6]=h,e[7]=u,e[8]=g):g=e[8];const y=g,j=f&&"shadow-lg";let v;e[9]!==j?(v=K("rounded-lg border border-border bg-card",j),e[9]=j,e[10]=v):v=e[10];const w=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Fe,{size:14}),e[11]=N):N=e[11];let S;e[12]!==c||e[13]!==a||e[14]!==w?(S=i.jsx("button",{type:"button",...c,...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":w,children:N}),e[12]=c,e[13]=a,e[14]=w,e[15]=S):S=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=()=>l(Hs),e[16]=C):C=e[16];const _=s.title??s.id;let T;e[17]!==s.icon||e[18]!==_?(T=i.jsx(Y,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=T):T=e[19];const I=s.title??s.id;let E;e[20]!==I?(E=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:I}),e[20]=I,e[21]=E):E=e[21];let k;e[22]!==x?(k=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:x}),e[22]=x,e[23]=k):k=e[23];let L;e[24]!==E||e[25]!==k?(L=i.jsxs("div",{className:"min-w-0 flex-1",children:[E,k]}),e[24]=E,e[25]=k,e[26]=L):L=e[26];const U=n&&"rotate-180";let O;e[27]!==U?(O=K("shrink-0 text-muted-foreground transition-transform",U),e[27]=U,e[28]=O):O=e[28];let R;e[29]!==O?(R=i.jsx(Ue,{size:16,className:O}),e[29]=O,e[30]=R):R=e[30];let Q;e[31]!==n||e[32]!==T||e[33]!==L||e[34]!==R?(Q=i.jsxs("button",{type:"button",onClick:C,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[T,L,R]}),e[31]=n,e[32]=T,e[33]=L,e[34]=R,e[35]=Q):Q=e[35];let A;e[36]!==s.id||e[37]!==r?(A=()=>r.removeAgent(s.id).catch(Ds),e[36]=s.id,e[37]=r,e[38]=A):A=e[38];const F=`Remove ${s.title??s.id} from home`;let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(ze,{size:14}),e[39]=P):P=e[39];let z;e[40]!==A||e[41]!==F?(z=i.jsx("button",{type:"button",onClick:A,"aria-label":F,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:P}),e[40]=A,e[41]=F,e[42]=z):z=e[42];let H;e[43]!==S||e[44]!==Q||e[45]!==z?(H=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,Q,z]}),e[43]=S,e[44]=Q,e[45]=z,e[46]=H):H=e[46];let B;e[47]!==s||e[48]!==n||e[49]!==r?(B=n&&i.jsx(Ke,{agent:s,home:r}),e[47]=s,e[48]=n,e[49]=r,e[50]=B):B=e[50];let q;return e[51]!==d||e[52]!==y||e[53]!==H||e[54]!==B||e[55]!==v?(q=i.jsxs("div",{ref:d,style:y,className:v,children:[H,B]}),e[51]=d,e[52]=y,e[53]=H,e[54]=B,e[55]=v,e[56]=q):q=e[56],q}function Ds(){return W.error("Couldn't remove from home — please try again.")}function Hs(t){return!t}function Bs({agent:t,home:e}){const[s,r]=M.useState(!1),[n,l]=M.useState(!1),o=qe(t),c=async()=>{if(!e.atLimit){l(!0);try{await e.addAgent(t.id)}catch{W.error("Couldn't add to home — please try again.")}finally{l(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.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:[i.jsx(Y,{icon:t.icon,name:t.title??t.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),o&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:o})]}),i.jsx(Ue,{size:16,className:K("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:c,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${te}) — 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:n?i.jsx(Me,{size:12,className:"animate-spin"}):i.jsx(be,{size:14})})]}),s&&i.jsx(Ke,{agent:t,home:e})]})}function Ke(t){const e=$.c(26),{agent:s,home:r}=t;let n,l,o,c,a,d,m;if(e[0]!==s||e[1]!==r){const h=xe(s.metadata?.ui);let g;e[9]!==s.connections?(g=(s.connections??[]).map(Fs).sort(),e[9]=s.connections,e[10]=g):g=e[10];const y=g;l=s.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Ws,o=s,c=r,a=y,d=new Set(h.map(Us)),e[0]=s,e[1]=r,e[2]=n,e[3]=l,e[4]=o,e[5]=c,e[6]=a,e[7]=d,e[8]=m}else n=e[2],l=e[3],o=e[4],c=e[5],a=e[6],d=e[7],m=e[8];let u;e[11]!==n||e[12]!==o||e[13]!==c||e[14]!==a||e[15]!==d?(u=i.jsx(n,{agent:o,home:c,connectionIds:a,pinnedResourceUris:d}),e[11]=n,e[12]=o,e[13]=c,e[14]=a,e[15]=d,e[16]=u):u=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Qs,{}),e[17]=f):f=e[17];const x=l??null;let b;e[18]!==s||e[19]!==r||e[20]!==x?(b=i.jsx(M.Suspense,{fallback:f,children:i.jsx(Ks,{agent:s,home:r,curated:x})}),e[18]=s,e[19]=r,e[20]=x,e[21]=b):b=e[21];let p;return e[22]!==m||e[23]!==u||e[24]!==b?(p=i.jsxs("div",{className:m,children:[u,b]}),e[22]=m,e[23]=u,e[24]=b,e[25]=p):p=e[25],p}function Us(t){return t.resourceUri}function Fs(t){return t.connection_id}function Qs(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(D,{className:"h-8 w-full"}),i.jsx(D,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Ws({agent:t,home:e,connectionIds:s,pinnedResourceUris:r}){const{org:n}=V(),l=ee({connectionId:Le,orgId:n.id,orgSlug:n.slug}),{data:o,isLoading:c}=le({queryKey:oe.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async d=>{try{const m=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:d}}),{item:u}=is(m),f=(u?.tools??[]).flatMap(x=>{const b=es(x._meta);return b?[{name:x.name,description:x.description,resourceUri:b}]:[]});return{id:d,title:u?.title??d,icon:u?.icon??null,uiTools:f}}catch{return{id:d,title:d,icon:null,uiTools:[]}}}))).filter(d=>d.uiTools.length>0)});return s.length===0?null:c?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(D,{className:"h-7 w-full"}),i.jsx(D,{className:"h-7 w-2/3"})]}):!o||o.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:o.map(a=>a.uiTools.map(d=>i.jsx(qs,{agent:t,home:e,connection:a,tool:d,isPinned:r.has(d.resourceUri)},`${a.id}:${d.name}`)))})}function qs({agent:t,home:e,connection:s,tool:r,isPinned:n}){const[l,o]=M.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=xe(t.metadata?.ui),d=n?a.filter(u=>u.resourceUri!==r.resourceUri):[...a,{connectionId:s.id,resourceUri:r.resourceUri}],m={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:d}};await e.saveAgentMetadata(t,m)}catch(a){console.error("[home-tiles] failed to toggle tile",a),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(ss,{icon:s.icon,name:s.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Qe(r.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Xe(t){const e=$.c(11),{isPinned:s,submitting:r,onClick:n,label:l}=t,o=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let c;e[0]!==o?(c=K("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",o),e[0]=o,e[1]=c):c=e[1];let a;e[2]!==s||e[3]!==r?(a=r?i.jsx(Me,{size:12,className:"animate-spin"}):s?i.jsx(Ct,{size:14}):i.jsx(be,{size:14}),e[2]=s,e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==l||e[6]!==n||e[7]!==r||e[8]!==c||e[9]!==a?(d=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":l,title:l,className:c,children:a}),e[5]=l,e[6]=n,e[7]=r,e[8]=c,e[9]=a,e[10]=d):d=e[10],d}function Ks(t){const e=$.c(32),{agent:s,home:r,curated:n}=t,{org:l}=V();let o;e[0]!==s.id||e[1]!==l.id||e[2]!==l.slug?(o={connectionId:s.id,orgId:l.id,orgSlug:l.slug},e[0]=s.id,e[1]=l.id,e[2]=l.slug,e[3]=o):o=e[3];const c=ee(o);let a;e[4]!==s.id||e[5]!==l.id?(a=oe.agentPrompts(l.id,s.id),e[4]=s.id,e[5]=l.id,e[6]=a):a=e[6];let d;e[7]!==c?(d=async()=>{const{prompts:w}=await c.listPrompts();return w.map(Zs)},e[7]=c,e[8]=d):d=e[8];let m;e[9]!==a||e[10]!==d?(m={queryKey:a,queryFn:d,staleTime:3e4,retry:!1},e[9]=a,e[10]=d,e[11]=m):m=e[11];const{data:u,isLoading:f,error:x}=le(m),b=ye(l.slug);let p,h;if(e[12]!==s.id||e[13]!==u||e[14]!==b.prompts){let w;e[17]!==s.id?(w=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=w):w=e[18],p=b.prompts.filter(w).map(Vs);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],h=[...N];for(const S of p)h.some(C=>C.name===S.name)||h.push(S);e[12]=s.id,e[13]=u,e[14]=b.prompts,e[15]=p,e[16]=h}else p=e[15],h=e[16];if(f&&p.length===0){let w;return e[21]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(D,{className:"h-7 w-full"}),i.jsx(D,{className:"h-7 w-2/3"})]}),e[21]=w):w=e[21],w}if(x&&p.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,x),null;if(h.length===0)return null;let g;e[22]!==n||e[23]!==h?(g=n??h.map(Gs),e[22]=n,e[23]=h,e[24]=g):g=e[24];let y;e[25]!==g?(y=new Set(g),e[25]=g,e[26]=y):y=e[26];const j=y;let v;return e[27]!==s||e[28]!==r||e[29]!==h||e[30]!==j?(v=i.jsx("div",{className:"flex flex-col gap-0.5",children:h.map(w=>i.jsx(Js,{agent:s,home:r,prompt:w,allPromptNames:h.map(Xs),isPinned:j.has(w.name)},w.name))}),e[27]=s,e[28]=r,e[29]=h,e[30]=j,e[31]=v):v=e[31],v}function Xs(t){return t.name}function Gs(t){return t.name}function Vs(t){return{name:t.promptName,title:t.title,description:t.description}}function Zs(t){return{name:t.name,title:t.title,description:t.description}}function Js({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:n}){const[l,o]=M.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=t.metadata?.ui?.homePrompts;let d;Array.isArray(a)?d=n?a.filter(u=>u!==s.name):[...a,s.name]:d=n?r.filter(u=>u!==s.name):r;const m={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:d}};await e.saveAgentMetadata(t,m)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??Qe(s.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Ys(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},ei)}),t[0]=e):e=t[0],e}function ei(t,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(D,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(D,{className:"h-3 w-1/2"}),i.jsx(D,{className:"h-2.5 w-1/3"})]})]},e)}const J=1,Ge=`home-board.layout.v${J}`;function Ve(t){return`home-board.layout.v${J}.${t}`}const Ze={version:J,tiles:{},hidden:[]};function ue(t){return!t||t.version!==J?Ze:{version:J,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function ti(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function si(t){try{const e=localStorage.getItem(Ve(t));return e?ue(JSON.parse(e)):void 0}catch{return}}function _e(t,e){try{localStorage.setItem(Ve(t),JSON.stringify(e))}catch{}}async function Ce(t,e){if(!(await fetch(`/api/${t}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ii(t){const e=$.c(24),s=pe();let r;e[0]!==t?(r=oe.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const n=r;let l;e[2]!==t?(l=si(t),e[2]=t,e[3]=l):l=e[3];const o=l;let c;e[4]!==o||e[5]!==t?(c=async()=>{const g=await fetch(`/api/${t}/kv/${Ge}`);if(g.status===404)return o&&ti(o)?(await Ce(t,o),o):Ze;if(!g.ok)throw new Error("Failed to load board layout");const y=await g.json(),j=ue(y.value);return _e(t,j),j},e[4]=o,e[5]=t,e[6]=c):c=e[6];let a;e[7]!==o||e[8]!==n||e[9]!==c?(a={queryKey:n,queryFn:c,initialData:o,staleTime:0,refetchOnWindowFocus:!1},e[7]=o,e[8]=n,e[9]=c,e[10]=a):a=e[10];const{data:d,isLoading:m}=le(a);let u;e[11]!==t?(u={mutationFn:g=>Ce(t,g)},e[11]=t,e[12]=u):u=e[12];const f=ht(u);let x;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==n?(x=g=>{_e(t,g),s.setQueryData(n,g),f.mutate(g)},e[13]=f,e[14]=t,e[15]=s,e[16]=n,e[17]=x):x=e[17];const b=x;let p;e[18]!==d?(p=ue(d),e[18]=d,e[19]=p):p=e[19];let h;return e[20]!==m||e[21]!==b||e[22]!==p?(h={layout:p,isLoading:m,save:b},e[20]=m,e[21]=b,e[22]=p,e[23]=h):h=e[23],h}const Je=M.createContext(null);function ni(t){const e=$.c(24),{children:s}=t,{org:r}=V(),n=ii(r.slug),[l,o]=M.useState(!1),[c,a]=M.useState(null);let d;e[0]!==n.layout?(d=()=>{a(n.layout),o(!0)},e[0]=n.layout,e[1]=d):d=e[1];const m=d;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),o(!1)},e[2]=u):u=e[2];const f=u;let x;e[3]!==c||e[4]!==n?(x=()=>{c&&n.save(c),a(null),o(!1)},e[3]=c,e[4]=n,e[5]=x):x=e[5];const b=x,p=l&&c!==null,h=p?c:n.layout;let g;e[6]!==c||e[7]!==p||e[8]!==n.layout?(g=p?JSON.stringify(c)!==JSON.stringify(n.layout):!1,e[6]=c,e[7]=p,e[8]=n.layout,e[9]=g):g=e[9];const y=g;let j;e[10]!==l||e[11]!==n?(j=S=>{l?a(S):n.save(S)},e[10]=l,e[11]=n,e[12]=j):j=e[12];const v=j;let w;e[13]!==v||e[14]!==m||e[15]!==y||e[16]!==l||e[17]!==h||e[18]!==b||e[19]!==n.isLoading?(w={isEditMode:l,enter:m,cancel:f,save:b,hasChanges:y,layout:h,isLayoutLoading:n.isLoading,commitLayout:v},e[13]=v,e[14]=m,e[15]=y,e[16]=l,e[17]=h,e[18]=b,e[19]=n.isLoading,e[20]=w):w=e[20];let N;return e[21]!==s||e[22]!==w?(N=i.jsx(Je.Provider,{value:w,children:s}),e[21]=s,e[22]=w,e[23]=N):N=e[23],N}function Ye(){const t=M.useContext(Je);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function ri({agentId:t}){const{org:e,locator:s}=V(),r=ee({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:n}=ds(),{setTaskId:l}=Wt(),[o,c]=M.useState(null),[a,d]=M.useState(!1),m=M.useRef(!1),u=async(h,g)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,d(!0);try{const y=await cs(r,h.name,g),j={type:"doc",content:[{type:"paragraph",content:[rs({id:h.name,name:os(h.name,ls(h._meta)),metadata:y.messages,char:"/",kind:"prompt",args:g}),{type:"text",text:" "}]}]},v=crypto.randomUUID();ms(sessionStorage,s,v,{tiptapDoc:j}),await n({id:v,virtual_mcp_id:t}),l(v,t,{autosend:!0})}catch(y){console.error("[start-thread-from-prompt] failed",y),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},f=async h=>{if(!m.current){if(h.arguments&&h.arguments.length>0){c(h);return}await u(h)}},x=async h=>{if(!o)return;const g=o;c(null),await u(g,h)};return{start:f,startBlank:async()=>{if(!m.current){m.current=!0,d(!0);try{const h=crypto.randomUUID();await n({id:h,virtual_mcp_id:t}),l(h,t)}catch(h){console.error("[start-thread-from-prompt] startBlank failed",h),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},dialog:i.jsx(ns,{prompt:o,setPrompt:h=>c(h),onSubmit:x}),dialogPrompt:o,starting:a}}const G=4,X=100,Te=12,ie={S:{w:1,h:1},M:{w:1,h:2},T:{w:1,h:3},L:{w:2,h:1},XL:{w:2,h:2},LT:{w:2,h:3},XLT:{w:2,h:4},XXLT:{w:2,h:5},W:{w:4,h:1},WT:{w:4,h:3}},oi={S:"Small",M:"Tall",T:"Column",L:"Wide",XL:"Large",LT:"Showcase",XLT:"Display",XXLT:"Tower",W:"Full width",WT:"Hero"},Ee=["S","M","T","L","XL","LT","XLT","XXLT","W","WT"],li=ie.XL;class fe extends M.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?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(pt,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.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 ai(t){const e=$.c(72),{tiles:s,isEditMode:r,renderTile:n,onMove:l,onResize:o,onRemove:c}=t,a=ge(),d=M.useRef(null),[m,u]=M.useState(null),[f,x]=M.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={activationConstraint:{distance:4}},e[0]=b):b=e[0];const p=Oe(re(Pe,b),re(Re)),h=s.reduce(ci,0),g=r?Math.max(h+2,4):Math.max(h,1);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{const A=d.current?.getBoundingClientRect();return A?{cellWidth:A.width/G,cellHeight:X}:null},e[1]=y):y=e[1];const j=y;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=A=>{u(String(A.active.id)),x(j())},e[2]=v):v=e[2];const w=v;let N;e[3]!==f||e[4]!==l||e[5]!==s?(N=A=>{const F=String(A.active.id),P=f??j();if(u(null),x(null),!P||P.cellWidth<=0)return;const z=s.find(q=>q.id===F);if(!z)return;const H=Math.round(A.delta.x/P.cellWidth),B=Math.round(A.delta.y/P.cellHeight);H===0&&B===0||l(F,{x:z.x+H,y:z.y+B})},e[3]=f,e[4]=l,e[5]=s,e[6]=N):N=e[6];const S=N;if(a){let A;if(e[7]!==n||e[8]!==s){let P;e[10]!==n?(P=z=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:X},children:i.jsx(fe,{children:n(z)})},z.id),e[10]=n,e[11]=P):P=e[11],A=s.map(P),e[7]=n,e[8]=s,e[9]=A}else A=e[9];let F;return e[12]!==A?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=F):F=e[13],F}let C,_,T,I,E,k,L,U,O;if(e[14]!==m||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==c||e[19]!==o||e[20]!==n||e[21]!==p||e[22]!==s||e[23]!==g){const A=m?s.find(Z=>Z.id===m):null;_=De,U=p,O=w,T=S;const F=g*X,P=r?X*4:X;let z;e[33]!==F||e[34]!==P?(z={height:F,minHeight:P},e[33]=F,e[34]=P,e[35]=z):z=e[35];let H;e[36]!==r||e[37]!==s||e[38]!==g?(H=r&&i.jsx(di,{rows:g,tiles:s}),e[36]=r,e[37]=s,e[38]=g,e[39]=H):H=e[39];let B;if(e[40]!==m||e[41]!==r||e[42]!==c||e[43]!==o||e[44]!==n||e[45]!==s){let Z;e[47]!==m||e[48]!==r||e[49]!==c||e[50]!==o||e[51]!==n?(Z=se=>i.jsx(ui,{tile:se,isEditMode:r,isDragging:m===se.id,onResize:o,onRemove:c,children:n(se)},se.id),e[47]=m,e[48]=r,e[49]=c,e[50]=o,e[51]=n,e[52]=Z):Z=e[52],B=s.map(Z),e[40]=m,e[41]=r,e[42]=c,e[43]=o,e[44]=n,e[45]=s,e[46]=B}else B=e[46];e[53]!==z||e[54]!==H||e[55]!==B?(I=i.jsxs("div",{ref:d,className:"relative w-full",style:z,children:[H,B]}),e[53]=z,e[54]=H,e[55]=B,e[56]=I):I=e[56],C=Ut,E=null;const q=A&&f?A.w*f.cellWidth-Te:void 0,ae=A&&f?A.h*f.cellHeight-Te:void 0;e[57]!==q||e[58]!==ae?(k={width:q,height:ae},e[57]=q,e[58]=ae,e[59]=k):k=e[59],L=A&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(fe,{children:n(A)})}),e[14]=m,e[15]=f,e[16]=r,e[17]=S,e[18]=c,e[19]=o,e[20]=n,e[21]=p,e[22]=s,e[23]=g,e[24]=C,e[25]=_,e[26]=T,e[27]=I,e[28]=E,e[29]=k,e[30]=L,e[31]=U,e[32]=O}else C=e[24],_=e[25],T=e[26],I=e[27],E=e[28],k=e[29],L=e[30],U=e[31],O=e[32];let R;e[60]!==C||e[61]!==E||e[62]!==k||e[63]!==L?(R=i.jsx(C,{dropAnimation:E,style:k,children:L}),e[60]=C,e[61]=E,e[62]=k,e[63]=L,e[64]=R):R=e[64];let Q;return e[65]!==_||e[66]!==T||e[67]!==I||e[68]!==R||e[69]!==U||e[70]!==O?(Q=i.jsxs(_,{sensors:U,onDragStart:O,onDragEnd:T,children:[I,R]}),e[65]=_,e[66]=T,e[67]=I,e[68]=R,e[69]=U,e[70]=O,e[71]=Q):Q=e[71],Q}function ci(t,e){return Math.max(t,e.y+e.h)}function di(t){const e=$.c(7),{rows:s,tiles:r}=t;let n;e[0]!==r?(n=(a,d)=>r.some(m=>a>=m.x&&a<m.x+m.w&&d>=m.y&&d<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const l=n;let o;if(e[2]!==l||e[3]!==s){o=[];for(let a=0;a<s;a++)for(let d=0;d<G;d++)l(d,a)||o.push({x:d,y:a});e[2]=l,e[3]=s,e[4]=o}else o=e[4];let c;return e[5]!==o?(c=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(mi)}),e[5]=o,e[6]=c):c=e[6],c}function mi(t){return i.jsx("div",{className:"absolute p-1",style:{left:`${t.x/G*100}%`,top:t.y*X,width:`${1/G*100}%`,height:X},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function ui(t){const e=$.c(31),{tile:s,isEditMode:r,isDragging:n,onResize:l,onRemove:o,children:c}=t,a=!r;let d;e[0]!==a||e[1]!==s.id?(d={id:s.id,disabled:a},e[0]=a,e[1]=s.id,e[2]=d):d=e[2];const{setNodeRef:m,attributes:u,listeners:f,isDragging:x}=Ft(d),b=`${s.x/G*100}%`,p=`${s.w/G*100}%`,h=s.y*X,g=s.h*X,y=x||n,j=!y&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=y&&"opacity-30";let w;e[3]!==j||e[4]!==v?(w=K("absolute p-1 will-change-[left,top,width,height,opacity]",j,v),e[3]=j,e[4]=v,e[5]=w):w=e[5];let N;e[6]!==g||e[7]!==b||e[8]!==h||e[9]!==p?(N={left:b,top:h,width:p,height:g},e[6]=g,e[7]=b,e[8]=h,e[9]=p,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let C;e[11]!==S?(C=K("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=C):C=e[12];let _;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==o||e[17]!==l||e[18]!==s?(_=r&&i.jsxs(i.Fragment,{children:[i.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:i.jsx(Fe,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(fi,{tile:s,onResize:l,onRemove:o})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=o,e[17]=l,e[18]=s,e[19]=_):_=e[19];let T;e[20]!==c?(T=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(fe,{children:c})}),e[20]=c,e[21]=T):T=e[21];let I;e[22]!==T||e[23]!==C||e[24]!==_?(I=i.jsxs("div",{className:C,children:[_,T]}),e[22]=T,e[23]=C,e[24]=_,e[25]=I):I=e[25];let E;return e[26]!==m||e[27]!==I||e[28]!==w||e[29]!==N?(E=i.jsx("div",{ref:m,className:w,style:N,children:I}),e[26]=m,e[27]=I,e[28]=w,e[29]=N,e[30]=E):E=e[30],E}function fi(t){const e=$.c(43),{tile:s,onResize:r,onRemove:n}=t,l=s.minW??1,o=s.minH??1;let c,a,d,m,u,f,x;if(e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==s.h||e[4]!==s.id||e[5]!==s.w){let v;e[13]!==o||e[14]!==l?(v=_=>{const T=ie[_];return T.w>=l&&T.h>=o},e[13]=o,e[14]=l,e[15]=v):v=e[15];const w=Ee.filter(v);let N;e[16]!==s.h||e[17]!==s.w?(N=(()=>{for(const T of Ee){const I=ie[T];if(I.w===s.w&&I.h===s.h)return T}return null})(),e[16]=s.h,e[17]=s.w,e[18]=N):N=e[18];const S=N;a=us,e[19]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(fs,{asChild:!0,children:i.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:i.jsx(Tt,{size:16})})}),e[19]=x):x=e[19],c=hs,d="end",m="w-44",e[20]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ps,{children:"Size"}),e[20]=u):u=e[20];let C;e[21]!==S||e[22]!==r||e[23]!==s.id?(C=_=>{const T=ie[_];return i.jsxs(Ne,{onSelect:()=>r(s.id,T),className:"flex items-center justify-between",children:[i.jsx("span",{children:oi[_]}),i.jsx("span",{className:"text-xs text-muted-foreground",children:S===_?"✓":`${T.w}×${T.h}`})]},_)},e[21]=S,e[22]=r,e[23]=s.id,e[24]=C):C=e[24],f=w.map(C),e[0]=o,e[1]=l,e[2]=r,e[3]=s.h,e[4]=s.id,e[5]=s.w,e[6]=c,e[7]=a,e[8]=d,e[9]=m,e[10]=u,e[11]=f,e[12]=x}else c=e[6],a=e[7],d=e[8],m=e[9],u=e[10],f=e[11],x=e[12];let b;e[25]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx(xs,{}),e[25]=b):b=e[25];let p;e[26]!==n||e[27]!==s.id?(p=()=>n(s.id),e[26]=n,e[27]=s.id,e[28]=p):p=e[28];let h;e[29]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(gs,{size:14,className:"mr-2"}),e[29]=h):h=e[29];let g;e[30]!==p?(g=i.jsxs(Ne,{onSelect:p,className:"text-destructive focus:text-destructive",children:[h,"Remove tile"]}),e[30]=p,e[31]=g):g=e[31];let y;e[32]!==c||e[33]!==d||e[34]!==m||e[35]!==u||e[36]!==f||e[37]!==g?(y=i.jsxs(c,{align:d,className:m,children:[u,f,b,g]}),e[32]=c,e[33]=d,e[34]=m,e[35]=u,e[36]=f,e[37]=g,e[38]=y):y=e[38];let j;return e[39]!==a||e[40]!==y||e[41]!==x?(j=i.jsxs(a,{children:[x,y]}),e[39]=a,e[40]=y,e[41]=x,e[42]=j):j=e[42],j}function hi(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function he(t,e,s){for(let r=0;r<100;r++)for(let n=0;n<=G-e;n++){let l=!0;for(let o=0;o<s&&l;o++)for(let c=0;c<e&&l;c++)hi(t,n+c,r+o)&&(l=!1);if(l)return{x:n,y:r}}return{x:0,y:0}}function ce(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(G,t)),n=Math.max(s.h,Math.min(6,e));return{w:r,h:n}}function de(t,e,s){const r=Math.max(0,Math.min(G-s,t)),n=Math.max(0,e);return{x:r,y:n}}function pi(t,e,s){const r=t.find(a=>a.id===e);if(!r)return t;const n=t.filter(a=>a.id!==e),l=n.find(a=>s.x>=a.x&&s.x<a.x+a.w&&s.y>=a.y&&s.y<a.y+a.h);if(l&&l.w===r.w&&l.h===r.h)return t.map(a=>a.id===e?{...a,x:l.x,y:l.y}:a.id===l.id?{...a,x:r.x,y:r.y}:a);const c=[{...r,x:s.x,y:s.y}];for(const a of n){const d=he(c,a.w,a.h);c.push({...a,x:d.x,y:d.y})}return c}function xi(t){const e=$.c(35),{layout:s,isLayoutLoading:r,commitLayout:n}=Ye();let l;e[0]!==s.hidden?(l=new Set(s.hidden),e[0]=s.hidden,e[1]=l):l=e[1];const o=l;let c,a;if(e[2]!==t||e[3]!==o||e[4]!==s.tiles){a=[];let y;e[7]!==o?(y=v=>v.pinned||!o.has(v.id),e[7]=o,e[8]=y):y=e[8];const j=t.filter(y);c=new Map;for(const v of t)v.minSize&&c.set(v.id,v.minSize);for(const v of j){const w=s.tiles[v.id];if(!w)continue;const N=c.get(v.id),{w:S,h:C}=ce(w.w,w.h,N),{x:_,y:T}=de(w.x,w.y,S);a.push({id:v.id,x:_,y:T,w:S,h:C,minW:N?.w,minH:N?.h})}for(const v of j){if(a.some(T=>T.id===v.id))continue;const w=v.defaultSize??li,N=c.get(v.id),{w:S,h:C}=ce(w.w,w.h,N),_=he(a,S,C);a.push({id:v.id,x:_.x,y:_.y,w:S,h:C,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=o,e[4]=s.tiles,e[5]=c,e[6]=a}else c=e[5],a=e[6];let d;e[9]!==t?(d=new Set(t.map(gi)),e[9]=t,e[10]=d):d=e[10];const m=d;let u;e[11]!==m||e[12]!==n?(u=(y,j)=>{const v={};for(const w of y)v[w.id]={x:w.x,y:w.y,w:w.w,h:w.h};n({version:J,tiles:v,hidden:j.filter(w=>m.has(w))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const f=u;let x;e[14]!==a?(x={visible:a},e[14]=a,e[15]=x):x=e[15];let b;e[16]!==f||e[17]!==s||e[18]!==a?(b=(y,j)=>{const v=a.find(S=>S.id===y);if(!v)return;const w=de(j.x,j.y,v.w);if(w.x===v.x&&w.y===v.y)return;const N=pi(a,y,w);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=a,e[19]=b):b=e[19];let p;e[20]!==f||e[21]!==s||e[22]!==c||e[23]!==a?(p=(y,j)=>{const v=a.find(I=>I.id===y);if(!v)return;const w=c.get(y),{w:N,h:S}=ce(j.w,j.h,w);if(N===v.w&&S===v.h)return;const C={...v,w:N,h:S,x:de(v.x,v.y,N).x},_=a.filter(I=>I.id!==y),T=[C];for(const I of _){const E=he(T,I.w,I.h);T.push({...I,x:E.x,y:E.y})}f(T,s.hidden)},e[20]=f,e[21]=s,e[22]=c,e[23]=a,e[24]=p):p=e[24];let h;e[25]!==f||e[26]!==s||e[27]!==a?(h=y=>{const j=a.filter(v=>v.id!==y);f(j,Array.from(new Set([...s.hidden,y])))},e[25]=f,e[26]=s,e[27]=a,e[28]=h):h=e[28];let g;return e[29]!==r||e[30]!==x||e[31]!==b||e[32]!==p||e[33]!==h?(g={snapshot:x,isLoading:r,moveTile:b,resizeTile:p,hideTile:h},e[29]=r,e[30]=x,e[31]=b,e[32]=p,e[33]=h,e[34]=g):g=e[34],g}function gi(t){return t.id}const bi={w:2,h:4},yi={w:1,h:2},vi={w:1,h:1};function ji(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function wi(t){return`tile:${t.agentId}:${t.resourceUri}`}function Ni(t){return t.promptName?t.agentName:t.description}function Si(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function ve(t){const e=$.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:n,dialog:l,starting:o}=ri(s);let c;e[2]!==r||e[3]!==n?(c=m=>{if(!m.promptName){n();return}r(Si(m))},e[2]=r,e[3]=n,e[4]=c):c=e[4];const a=c;let d;return e[5]!==l||e[6]!==a||e[7]!==n||e[8]!==o?(d={open:a,startBlank:n,dialog:l,starting:o},e[5]=l,e[6]=a,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function _i(t){const e=$.c(32),{entry:s,isEditMode:r}=t,{open:n,dialog:l,starting:o}=ve(s.agentId);let c;e[0]!==s||e[1]!==n?(c=()=>n(s),e[0]=s,e[1]=n,e[2]=c):c=e[2];const a=o||r,d=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=o&&"opacity-60";let f;e[3]!==d||e[4]!==m||e[5]!==u?(f=K("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",d,m,u),e[3]=d,e[4]=m,e[5]=u,e[6]=f):f=e[6];let x;e[7]!==s.agentIcon||e[8]!==s.agentName?(x=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=x):x=e[9];let b;e[10]!==s.title?(b=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=b):b=e[11];let p;e[12]!==s?(p=Ni(s),e[12]=s,e[13]=p):p=e[13];let h;e[14]!==p?(h=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:p}),e[14]=p,e[15]=h):h=e[15];let g;e[16]!==h||e[17]!==b?(g=i.jsxs("div",{className:"min-w-0 flex-1",children:[b,h]}),e[16]=h,e[17]=b,e[18]=g):g=e[18];let y;e[19]!==r?(y=!r&&i.jsx(as,{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]=y):y=e[20];let j;e[21]!==o||e[22]!==c||e[23]!==g||e[24]!==y||e[25]!==a||e[26]!==f||e[27]!==x?(j=i.jsxs("button",{type:"button",onClick:c,disabled:a,"aria-busy":o,className:f,children:[x,g,y]}),e[21]=o,e[22]=c,e[23]=g,e[24]=y,e[25]=a,e[26]=f,e[27]=x,e[28]=j):j=e[28];let v;return e[29]!==l||e[30]!==j?(v=i.jsxs(i.Fragment,{children:[j,l]}),e[29]=l,e[30]=j,e[31]=v):v=e[31],v}function Ci(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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},Ti)}),t[0]=e):e=t[0],e}function Ti(t,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(D,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(D,{className:"h-3 w-2/3"}),i.jsx(D,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ei(t){const e=$.c(49),{tile:s,prompts:r,isEditMode:n,tileWidth:l}=t,{org:o}=V(),{open:c,startBlank:a,dialog:d,starting:m}=ve(s.agentId);let u,f,x,b,p;if(e[0]!==n||e[1]!==c||e[2]!==o.id||e[3]!==o.slug||e[4]!==r||e[5]!==a||e[6]!==m||e[7]!==s||e[8]!==l){const y=r.filter(Ii);b="flex h-full w-full flex-col gap-3 p-3";let j;e[14]!==a?(j=()=>{a()},e[14]=a,e[15]=j):j=e[15];const v=m||n,w=n&&"pl-10 pr-10";let N;e[16]!==w?(N=K("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",w),e[16]=w,e[17]=N):N=e[17];let S;e[18]!==s.agentIcon||e[19]!==s.agentName?(S=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[18]=s.agentIcon,e[19]=s.agentName,e[20]=S):S=e[20];let C;e[21]!==s.agentName?(C=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[21]=s.agentName,e[22]=C):C=e[22];const _=n?"Drag to rearrange":"Open chat";let T;e[23]!==_?(T=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:_}),e[23]=_,e[24]=T):T=e[24];let I;e[25]!==C||e[26]!==T?(I=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[C,T]}),e[25]=C,e[26]=T,e[27]=I):I=e[27],e[28]!==m||e[29]!==S||e[30]!==I||e[31]!==j||e[32]!==v||e[33]!==N?(p=i.jsxs("button",{type:"button",onClick:j,disabled:v,"aria-busy":m,className:N,children:[S,I]}),e[28]=m,e[29]=S,e[30]=I,e[31]=j,e[32]=v,e[33]=N,e[34]=p):p=e[34],u="flex min-h-0 flex-1 gap-3 overflow-hidden";let E;e[35]===Symbol.for("react.memo_cache_sentinel")?(E=i.jsx($i,{}),e[35]=E):E=e[35],e[36]!==o.id||e[37]!==o.slug||e[38]!==s?(f=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(M.Suspense,{fallback:E,children:i.jsx(ki,{tile:s,orgId:o.id,orgSlug:o.slug})})}),e[36]=o.id,e[37]=o.slug,e[38]=s,e[39]=f):f=e[39],x=y.length>0&&!n&&l>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:y.map(k=>i.jsx("button",{type:"button",onClick:()=>c(k),disabled:m,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:i.jsx("span",{className:"line-clamp-2",children:k.title})},k.promptName))}),e[0]=n,e[1]=c,e[2]=o.id,e[3]=o.slug,e[4]=r,e[5]=a,e[6]=m,e[7]=s,e[8]=l,e[9]=u,e[10]=f,e[11]=x,e[12]=b,e[13]=p}else u=e[9],f=e[10],x=e[11],b=e[12],p=e[13];let h;e[40]!==u||e[41]!==f||e[42]!==x?(h=i.jsxs("div",{className:u,children:[f,x]}),e[40]=u,e[41]=f,e[42]=x,e[43]=h):h=e[43];let g;return e[44]!==d||e[45]!==b||e[46]!==p||e[47]!==h?(g=i.jsxs("div",{className:b,children:[p,h,d]}),e[44]=d,e[45]=b,e[46]=p,e[47]=h,e[48]=g):g=e[48],g}function Ii(t){return!!t.promptName}function ki(t){const e=$.c(12),{tile:s,orgId:r,orgSlug:n}=t;let l;e[0]!==r||e[1]!==n||e[2]!==s.connectionId?(l={connectionId:s.connectionId,orgId:r,orgSlug:n},e[0]=r,e[1]=n,e[2]=s.connectionId,e[3]=l):l=e[3];const o=ee(l),c=s.minHeight??200,a=s.maxHeight??4e3;let d;return e[4]!==o||e[5]!==r||e[6]!==n||e[7]!==c||e[8]!==a||e[9]!==s.connectionId||e[10]!==s.resourceUri?(d=i.jsx(ts,{resourceURI:s.resourceUri,orgId:r,orgSlug:n,connectionId:s.connectionId,client:o,displayMode:"fullscreen",minHeight:c,maxHeight:a,className:"h-full"}),e[4]=o,e[5]=r,e[6]=n,e[7]=c,e[8]=a,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=d):d=e[11],d}function $i(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(D,{className:"h-3 w-2/3"}),i.jsx(D,{className:"h-3 w-1/2"}),i.jsx(D,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Ai(t){const e=$.c(14),{icon:s,name:r}=t;let n;e[0]!==s||e[1]!==r?(n=i.jsx(Y,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=n):n=e[2];let l;e[3]!==r?(l=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=l):l=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=o):o=e[5];let c;e[6]!==l?(c=i.jsxs("div",{className:"min-w-0 flex-1",children:[l,o]}),e[6]=l,e[7]=c):c=e[7];let a;e[8]!==n||e[9]!==c?(a=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,c]}),e[8]=n,e[9]=c,e[10]=a):a=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(D,{className:"h-3 w-3/4"}),i.jsx(D,{className:"h-3 w-1/2"}),i.jsx(D,{className:"h-3 w-2/3"})]}),e[11]=d):d=e[11];let m;return e[12]!==a?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,d]}),e[12]=a,e[13]=m):m=e[13],m}function Mi(t){const e=$.c(33),{tile:s,prompts:r,isEditMode:n}=t,{open:l,startBlank:o,dialog:c,starting:a}=ve(s.agentId);let d,m,u;if(e[0]!==n||e[1]!==l||e[2]!==r||e[3]!==o||e[4]!==a||e[5]!==s.agentIcon||e[6]!==s.agentName){const x=r.filter(Li);d="flex h-full w-full flex-col gap-3 p-4";let b;e[10]!==o?(b=()=>{o()},e[10]=o,e[11]=b):b=e[11];const p=a||n,h=n&&"pl-10 pr-10";let g;e[12]!==h?(g=K("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",h),e[12]=h,e[13]=g):g=e[13];let y;e[14]!==s.agentIcon||e[15]!==s.agentName?(y=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[14]=s.agentIcon,e[15]=s.agentName,e[16]=y):y=e[16];let j;e[17]!==s.agentName?(j=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[17]=s.agentName,e[18]=j):j=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=v):v=e[19];let w;e[20]!==j?(w=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[j,v]}),e[20]=j,e[21]=w):w=e[21],e[22]!==w||e[23]!==b||e[24]!==p||e[25]!==g||e[26]!==y?(m=i.jsxs("button",{type:"button",onClick:b,disabled:p,className:g,children:[y,w]}),e[22]=w,e[23]=b,e[24]=p,e[25]=g,e[26]=y,e[27]=m):m=e[27],u=x.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:x.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&l(N),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:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=l,e[2]=r,e[3]=o,e[4]=a,e[5]=s.agentIcon,e[6]=s.agentName,e[7]=d,e[8]=m,e[9]=u}else d=e[7],m=e[8],u=e[9];let f;return e[28]!==c||e[29]!==d||e[30]!==m||e[31]!==u?(f=i.jsxs("div",{className:d,children:[m,u,c]}),e[28]=c,e[29]=d,e[30]=m,e[31]=u,e[32]=f):f=e[32],f}function Li(t){return!!t.promptName}function et(t){const e=$.c(36),{isEditMode:s}=t,{org:r}=V(),{isLoading:n,prompts:l,tiles:o}=ye(r.slug),c=He()?.ids??[];let a;e[0]!==c?(a=new Set(c),e[0]=c,e[1]=a):a=e[1];const d=a,m=Be();let u;e[2]!==o?(u=new Set(o.map(Di)),e[2]=o,e[3]=u):u=e[3];const f=u;let x;if(e[4]!==l){x=new Map;for(const E of l){const k=x.get(E.agentId);k?k.push(E):x.set(E.agentId,[E])}e[4]=l,e[5]=x}else x=e[5];let b;if(e[6]!==l||e[7]!==f||e[8]!==o){let E;e[10]!==f?(E=L=>!f.has(L.agentId),e[10]=f,e[11]=E):E=e[11];const k=l.filter(E);b=[...o.map(Pi),...k.map(Ri)],e[6]=l,e[7]=f,e[8]=o,e[9]=b}else b=e[9];const p=b;let h;e[12]!==p?(h=new Map(p.map(Oi)),e[12]=p,e[13]=h):h=e[13];const g=h;let y;e[14]!==p||e[15]!==d?(y=p.map(E=>({id:E.id,defaultSize:E.kind==="tile"?bi:vi,minSize:E.kind==="tile"?yi:void 0,pinned:d.has(E.data.agentId)})),e[14]=p,e[15]=d,e[16]=y):y=e[16];const j=xi(y);let v;e[17]!==m?(v=E=>{m.apply(k=>k.filter(L=>L!==E)).catch(zi)},e[17]=m,e[18]=v):v=e[18];const w=v;let N;e[19]!==g||e[20]!==j||e[21]!==d||e[22]!==w?(N=E=>{const k=g.get(E);k&&d.has(k.data.agentId)?w(k.data.agentId):j.hideTile(E)},e[19]=g,e[20]=j,e[21]=d,e[22]=w,e[23]=N):N=e[23];const S=N;let C;e[24]!==g||e[25]!==s||e[26]!==x?(C=E=>{const k=g.get(E.id);if(!k)return null;if(k.kind==="tile"){const L=x.get(k.data.agentId)??[];return i.jsx(xt,{fallback:i.jsx(Mi,{tile:k.data,prompts:L,isEditMode:s}),children:i.jsx(M.Suspense,{fallback:i.jsx(Ai,{icon:k.data.agentIcon,name:k.data.agentName}),children:i.jsx(Ei,{tile:k.data,prompts:L,isEditMode:s,tileWidth:E.w})})})}return i.jsx(_i,{entry:k.data,isEditMode:s})},e[24]=g,e[25]=s,e[26]=x,e[27]=C):C=e[27];const _=C;if(n||j.isLoading){let E;return e[28]===Symbol.for("react.memo_cache_sentinel")?(E=i.jsx(Ci,{}),e[28]=E):E=e[28],E}if(j.snapshot.visible.length===0&&!s)return null;let I;return e[29]!==s||e[30]!==j.moveTile||e[31]!==j.resizeTile||e[32]!==j.snapshot.visible||e[33]!==S||e[34]!==_?(I=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ai,{tiles:j.snapshot.visible,isEditMode:s,renderTile:_,onMove:j.moveTile,onResize:j.resizeTile,onRemove:S})}),e[29]=s,e[30]=j.moveTile,e[31]=j.resizeTile,e[32]=j.snapshot.visible,e[33]=S,e[34]=_,e[35]=I):I=e[35],I}function zi(){return W.error("Couldn't remove from home — please try again.")}function Oi(t){return[t.id,t]}function Ri(t){return{kind:"prompt",id:ji(t),data:t}}function Pi(t){return{kind:"tile",id:wi(t),data:t}}function Di(t){return t.agentId}function Hi(t){const e=$.c(2),{prompts:s,tiles:r}=ye(t),n=r.length>0||s.length>0;let l;return e[0]!==n?(l={hasVisibleTiles:n},e[0]=n,e[1]=l):l=e[1],l}const Ie=420,ke=305;function tt(){const t=$.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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:Ie}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.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:Ie}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.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:ke}}),t[2]=r):r=t[2];let n;return t[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,i.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:ke}})]}),t[3]=n):n=t[3],n}function $e(){const t=$.c(33),{data:e}=gt.useSession(),{org:s}=V(),r=ge(),n=At(),{selectedVirtualMcp:l}=Mt();let o;t[0]!==s.id?(o=yt(s.id),t[0]=s.id,t[1]=o):o=t[1];const a=l??o;let d;t[2]!==s.slug?(d=qt(s.slug),t[2]=s.slug,t[3]=d):d=t[3],le(d);let m;t[4]!==s.id||t[5]!==s.slug?(m={connectionId:Le,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=m):m=t[6];const u=ee(m);let f;t[7]!==s.id||t[8]!==u?(f=bs(u,s.id),t[7]=s.id,t[8]=u,t[9]=f):f=t[9];let x;t[10]!==s.id||t[11]!==u?(x=Qt(u,s.id),t[10]=s.id,t[11]=u,t[12]=x):x=t[12];let b;t[13]!==a.id||t[14]!==s.id||t[15]!==u?(b=wt(s.id,a.id,u),t[13]=a.id,t[14]=s.id,t[15]=u,t[16]=b):b=t[16];let p;t[17]!==f||t[18]!==x||t[19]!==b?(p={queries:[f,x,b]},t[17]=f,t[18]=x,t[19]=b,t[20]=p):p=t[20],Ss(p);const h=ys(),g=Nt(a.id),{hasDecoKey:y,isZeroBalance:j,isInitialFreeCredit:v,balanceDollars:w,hasOnlyDecoProvider:N}=It(),{hasVisibleTiles:S}=Hi(s.slug),C=kt(g?.metadata);if(h.length===0&&!(C&&$t(n))){let R;return t[21]===Symbol.for("react.memo_cache_sentinel")?(R=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(Lt,{})})}),t[21]=R):R=t[21],R}let T;t[22]!==e?.user?.name?(T=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=T):T=t[23];const I=T,E=y&&v&&w!=null,k=y&&j&&N;let L;t[24]!==w||t[25]!==E||t[26]!==k?(L=E?i.jsx(ne.CreditsEyebrow,{balanceDollars:w}):k?i.jsx(ne.NoCreditsEyebrow,{}):null,t[24]=w,t[25]=E,t[26]=k,t[27]=L):L=t[27];const U=L;let O;return t[28]!==U||t[29]!==S||t[30]!==r||t[31]!==I?(O=i.jsx(ni,{children:r?i.jsx(Bi,{eyebrow:U,userName:I}):i.jsx(Ui,{eyebrow:U,userName:I,hasVisibleTiles:S})}),t[28]=U,t[29]=S,t[30]=r,t[31]=I,t[32]=O):O=t[32],O}function Bi(t){const e=$.c(12),{eyebrow:s,userName:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(tt,{}),e[0]=n):n=e[0];let l;e[1]!==s?(l=s&&i.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=l):l=e[2];let o;e[3]!==r?(o=i.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]=o):o=e[4];let c;e[5]!==l||e[6]!==o?(c=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[l,o]}),e[5]=l,e[6]=o,e[7]=c):c=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(ne.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(et,{isEditMode:!1})}),e[9]=d):d=e[9];let m;return e[10]!==c?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,c,a,d]}),e[10]=c,e[11]=m):m=e[11],m}function Ui(t){const e=$.c(32),{eyebrow:s,userName:r,hasVisibleTiles:n}=t,{isEditMode:l,enter:o,save:c,cancel:a,hasChanges:d}=Ye(),[m,u]=M.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let x;e[1]!==a||e[2]!==o||e[3]!==d||e[4]!==l||e[5]!==c?(x=i.jsx(vs.Right,{children:i.jsx(Fi,{isEditMode:l,hasChanges:d,onEnter:o,onSave:c,onCancel:a,onAddTile:f})}),e[1]=a,e[2]=o,e[3]=d,e[4]=l,e[5]=c,e[6]=x):x=e[6];let b;e[7]!==m?(b=i.jsx(_s,{open:m,onOpenChange:u}),e[7]=m,e[8]=b):b=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(tt,{}),e[9]=p):p=e[9];const h=n||l?"pt-32":"flex-1 justify-center";let g;e[10]!==h?(g=K("relative flex flex-col items-center px-10 pb-4",h),e[10]=h,e[11]=g):g=e[11];let y;e[12]!==s?(y=s&&i.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=y):y=e[13];let j;e[14]!==r?(j=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=j):j=e[15];let v;e[16]!==y||e[17]!==j?(v=i.jsxs("div",{className:"text-center mb-10",children:[y,j]}),e[16]=y,e[17]=j,e[18]=v):v=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Qi,{}),i.jsx(ne.Input,{showConnectionsBanner:!0})]}),e[19]=w):w=e[19];let N;e[20]!==v?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,w]}),e[20]=v,e[21]=N):N=e[21];let S;e[22]!==l?(S=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(et,{isEditMode:l})}),e[22]=l,e[23]=S):S=e[23];let C;e[24]!==N||e[25]!==S||e[26]!==g?(C=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[p,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:g,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=g,e[27]=C):C=e[27];let _;return e[28]!==C||e[29]!==x||e[30]!==b?(_=i.jsxs(i.Fragment,{children:[x,b,C]}),e[28]=C,e[29]=x,e[30]=b,e[31]=_):_=e[31],_}function Fi(t){const e=$.c(17),{isEditMode:s,hasChanges:r,onEnter:n,onSave:l,onCancel:o,onAddTile:c}=t;if(s){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(be,{size:14}),e[0]=m):m=e[0];let u;e[1]!==c?(u=i.jsxs("button",{type:"button",onClick:c,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:[m,"Add tile"]}),e[1]=c,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(ze,{size:14}),e[3]=f):f=e[3];let x;e[4]!==o?(x=i.jsxs(we,{size:"sm",variant:"ghost",onClick:o,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=o,e[5]=x):x=e[5];const b=!r;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(St,{size:14}),e[6]=p):p=e[6];let h;e[7]!==l||e[8]!==b?(h=i.jsxs(we,{size:"sm",onClick:l,disabled:b,className:"gap-1.5 h-7 text-xs",children:[p,"Save"]}),e[7]=l,e[8]=b,e[9]=h):h=e[9];let g;return e[10]!==u||e[11]!==x||e[12]!==h?(g=i.jsxs(i.Fragment,{children:[u,x,h]}),e[10]=u,e[11]=x,e[12]=h,e[13]=g):g=e[13],g}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Et,{size:14}),e[14]=a):a=e[14];let d;return e[15]!==n?(d=i.jsxs("button",{type:"button",onClick:n,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]=n,e[16]=d):d=e[16],d}function Qi(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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 Zr(){const t=$.c(2);if(ge()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx($e,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx($e,{})})})}),t[1]=s):s=t[1],s}export{Zr as default};