decocms 4.10.0 → 4.11.1

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 (224) hide show
  1. package/dist/client/assets/{AlertCircle-B9i_x3yX.js → AlertCircle-Br7CfLvX.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-cF0mnN41.js → ArrowUpRight-Bm0I42Vg.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-zzRIg2zR.js → CheckCircle-Bh9aQ2VF.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-D4rBo5Cd.js → ChevronDown-BSXA0X2j.js} +1 -1
  5. package/dist/client/assets/{ChevronRight-CDn6HuCQ.js → ChevronRight-DCtjkcdS.js} +1 -1
  6. package/dist/client/assets/{ChevronUp-CFXuZkVg.js → ChevronUp-B5CTYZ29.js} +1 -1
  7. package/dist/client/assets/{DotsVertical-CyO7wZv3.js → DotsVertical-Cp_gOESp.js} +1 -1
  8. package/dist/client/assets/{Eye-DJjniuqY.js → Eye-Cl5xVjnx.js} +1 -1
  9. package/dist/client/assets/{FilterLines-C7d-9ZQk.js → FilterLines-DuHaMCAv.js} +1 -1
  10. package/dist/client/assets/{Globe01-Do2q7EuB.js → Globe01-BrFbdg9i.js} +1 -1
  11. package/dist/client/assets/{Globe04-Mvw3976B.js → Globe04-BY_mEKwR.js} +1 -1
  12. package/dist/client/assets/{HardDrive-Ci17wnKW.js → HardDrive-Dcgyml69.js} +1 -1
  13. package/dist/client/assets/{Key01-BiZk1T91.js → Key01-yWXuIvXr.js} +1 -1
  14. package/dist/client/assets/{LayoutLeft-BMp-06Ch.js → LayoutLeft-DaFUFPON.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-BIEuCHKR.js → LinkExternal01-BtG3Yjaj.js} +1 -1
  16. package/dist/client/assets/{Monitor01-DNKFU3PW.js → Monitor01-DiWXBdCO.js} +1 -1
  17. package/dist/client/assets/{Palette-CB1NQWQN.js → Palette-BHa56PsA.js} +1 -1
  18. package/dist/client/assets/{Play-An8HsyAi.js → Play-CC0UzcfF.js} +1 -1
  19. package/dist/client/assets/{Plus-D3xgmWdX.js → Plus-YsNvhs75.js} +1 -1
  20. package/dist/client/assets/{SearchLg-BYw4LhiQ.js → SearchLg-DN8WW4RT.js} +1 -1
  21. package/dist/client/assets/{SearchMd-BYsRf8JG.js → SearchMd-Eh9vdTJf.js} +1 -1
  22. package/dist/client/assets/{Settings02-CPxYREBE.js → Settings02-BAgaJKfH.js} +1 -1
  23. package/dist/client/assets/{Shield01-Dr2T7xLf.js → Shield01-C3eg9E2L.js} +1 -1
  24. package/dist/client/assets/{Star01-z6-lfdui.js → Star01-Btl_P8Ex.js} +1 -1
  25. package/dist/client/assets/{Stars01-ZkDAuQwr.js → Stars01-tAHopfEa.js} +1 -1
  26. package/dist/client/assets/{Stars02-D8az_5Af.js → Stars02-BKlbikd6.js} +1 -1
  27. package/dist/client/assets/{Sun-CCi4P6Lh.js → Sun-CylE9qNE.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-DHUuncY2.js → SwitchHorizontal01-CC3QrqqH.js} +1 -1
  29. package/dist/client/assets/{Tool01-B4amg9yB.js → Tool01-DouR6tu6.js} +1 -1
  30. package/dist/client/assets/{Trash01-BcusIWqe.js → Trash01-BOBuBITr.js} +1 -1
  31. package/dist/client/assets/{Upload01-Dj1G7JBU.js → Upload01-CfKVWS6s.js} +1 -1
  32. package/dist/client/assets/{User01-NcvWezb3.js → User01-C8CPwAlr.js} +1 -1
  33. package/dist/client/assets/{Users01-CbnVd6yD.js → Users01-Cfx8Vr84.js} +1 -1
  34. package/dist/client/assets/{Users03-CCVhW9kg.js → Users03-HwPSmLR7.js} +1 -1
  35. package/dist/client/assets/{X-Dq3oJiz6.js → X-DnFBncs5.js} +1 -1
  36. package/dist/client/assets/{XCircle-7nuhx8NX.js → XCircle-BDS4O4y1.js} +1 -1
  37. package/dist/client/assets/{XClose-Bqzfjmh3.js → XClose-B30J5raq.js} +1 -1
  38. package/dist/client/assets/{Zap-BNW86-w0.js → Zap-DA2zNVJu.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-CL8vn24R.js → ZapSquare-B3exHvaw.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-CLFft6BA.js → ZoomOut-BXVyDbe6.js} +1 -1
  41. package/dist/client/assets/{access-gate-C4hUJNh_.js → access-gate-DRMde4Lj.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-jXfcfN41.js → add-section-modal-CW4e6K5h.js} +1 -1
  43. package/dist/client/assets/{agent-icon-BM8MQ5be.js → agent-icon-D0xfW9tm.js} +1 -1
  44. package/dist/client/assets/{agents-list-C3-KQvRC.js → agents-list-BzbCjASH.js} +1 -1
  45. package/dist/client/assets/{ai-providers-D4SEreuO.js → ai-providers-BKRS6C22.js} +1 -1
  46. package/dist/client/assets/{alert-RaqgzwNf.js → alert-Bu0KmciZ.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-BvMgbTr9.js → alert-dialog-DRqaDJgF.js} +1 -1
  48. package/dist/client/assets/{app-editor-DwNMCbKV.js → app-editor-BkE5A3Hh.js} +1 -1
  49. package/dist/client/assets/{auth-BU0GeO8h.js → auth-DbUndmuO.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-ESAwWRyk.js → auth-catchall-Cp_Icy65.js} +1 -1
  51. package/dist/client/assets/{auth-entry-f4oO2pyf.js → auth-entry-BzT37PWX.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-CzFU6N2L.js → auth-split-layout-D3fzkokE.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-Bwuou5N5.js → authenticate-and-persist-oauth-CEpoZ411.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-CIaxBCOJ.js → automation-list-row-CD6XcRtq.js} +1 -1
  55. package/dist/client/assets/{automation-runs-JsZo9EC7.js → automation-runs-B6IGPMWC.js} +1 -1
  56. package/dist/client/assets/{automations-DaITHsPe.js → automations-Cl-WKDZo.js} +1 -1
  57. package/dist/client/assets/{avatar-BP2FzYvw.js → avatar-BRMcK1Fa.js} +1 -1
  58. package/dist/client/assets/{badge-KNqQ-xkh.js → badge-IyD2awn9.js} +1 -1
  59. package/dist/client/assets/{block-document-Bu9KWNtO.js → block-document-l4MC4p0E.js} +1 -1
  60. package/dist/client/assets/{brand-context-BQJyP211.js → brand-context-CZ9ZkRzo.js} +1 -1
  61. package/dist/client/assets/{buckets-Bfj6xDEl.js → buckets-CVmdlYJQ.js} +1 -1
  62. package/dist/client/assets/{bulk-category-panel-Dj0HeJEJ.js → bulk-category-panel-Dwcozw91.js} +1 -1
  63. package/dist/client/assets/{capability-load-error-CGz8Hngs.js → capability-load-error-Cz-U4kpy.js} +1 -1
  64. package/dist/client/assets/{card-DuBMqYZm.js → card-DkGLJz1i.js} +1 -1
  65. package/dist/client/assets/{category-editor-B9Ck95Rl.js → category-editor-Dr7Q-28c.js} +1 -1
  66. package/dist/client/assets/{chat-context-PzKbUAil.js → chat-context-DLQm6s3r.js} +1 -1
  67. package/dist/client/assets/{checkbox-fYp407Fh.js → checkbox-CAZp4gqB.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-eA-t3OgD.js → cli-auth-success-vpR_zUUG.js} +1 -1
  69. package/dist/client/assets/collection-detail-C6v0FX6i.js +1 -0
  70. package/dist/client/assets/{collection-display-button-B7JPr-DT.js → collection-display-button-BhpOmYvj.js} +1 -1
  71. package/dist/client/assets/{collection-search-FrO71oF0.js → collection-search-Sx1B8ICI.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-CjIQ8mgh.js → collection-tabs-txdKcvvO.js} +1 -1
  73. package/dist/client/assets/{command-Bnhz7-1L.js → command-CQa0SvAl.js} +1 -1
  74. package/dist/client/assets/{commerce-onboarding-G6HdfTep.js → commerce-onboarding-CyM0-TyT.js} +1 -1
  75. package/dist/client/assets/{connect-desktop-dialog-8s9YrP8w.js → connect-desktop-dialog-BnhE2jwv.js} +1 -1
  76. package/dist/client/assets/{connection-card-5hK-b_ZU.js → connection-card-C7X_tih3.js} +1 -1
  77. package/dist/client/assets/{connection-detail-DX7Dr0rR.js → connection-detail-ptDmzKUs.js} +1 -1
  78. package/dist/client/assets/{connection-form-helpers-BaOBFUzF.js → connection-form-helpers-BD99vME8.js} +1 -1
  79. package/dist/client/assets/{connections-CZ0xzDDq.js → connections-BtrvbbXR.js} +1 -1
  80. package/dist/client/assets/{context-menu-CSrtqxxM.js → context-menu-Dt8bitpN.js} +1 -1
  81. package/dist/client/assets/{decopilot-MP52Tp89.js → decopilot-BLAyXwA-.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-DOCSJwAs.js → decopilot-sse-pool-BaRsrENm.js} +1 -1
  83. package/dist/client/assets/{dialog-C45rhbs4.js → dialog-07W2yxeT.js} +1 -1
  84. package/dist/client/assets/{domain-settings-CddLevU5.js → domain-settings-q7ve00ko.js} +1 -1
  85. package/dist/client/assets/{drawer-DfEPwI8N.js → drawer-Duybhr8F.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-ChAsKxcd.js → dropdown-menu-DWTgoPvl.js} +1 -1
  87. package/dist/client/assets/{empty-state-DW1Hxncl.js → empty-state-D7Bf9tu1.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-DhnwqdMi.js → extract-connection-data-DPv6JZEM.js} +1 -1
  89. package/dist/client/assets/{file-explorer-DsoUhoA0.js → file-explorer-BAloNSOV.js} +1 -1
  90. package/dist/client/assets/{file-type-icon-weqtDXd8.js → file-type-icon-BeYdcxvq.js} +1 -1
  91. package/dist/client/assets/{files-BTCpYytU.js → files-BkGN6lfv.js} +1 -1
  92. package/dist/client/assets/{form-CXezR26M.js → form-BfaJIT2-.js} +1 -1
  93. package/dist/client/assets/{general-BVTedgk9.js → general-Cf4_1MKO.js} +1 -1
  94. package/dist/client/assets/{github-repo-picker-CJ3K7Ssu.js → github-repo-picker-D7ggOM83.js} +1 -1
  95. package/dist/client/assets/{hooks-BxVsJBlY.js → hooks-Bkc6oCsQ.js} +1 -1
  96. package/dist/client/assets/{import-from-deco-dialog-BthWZyqT.js → import-from-deco-dialog-BOI7-GDq.js} +1 -1
  97. package/dist/client/assets/{index-DwFgoCov.js → index-BICoYGrI.js} +1 -1
  98. package/dist/client/assets/index-BWalXsiW.js +1 -0
  99. package/dist/client/assets/{index-IRZqLymo.js → index-BZAqyIds.js} +1 -1
  100. package/dist/client/assets/{index-DYjFitmS.js → index-BgwSyeXJ.js} +5 -5
  101. package/dist/client/assets/{index-Bb1TAV4I.js → index-BiYGT9-e.js} +1 -1
  102. package/dist/client/assets/index-Bmw1XOLw.js +1 -0
  103. package/dist/client/assets/{index-DlzujfAy.js → index-Bq-LLmH1.js} +1 -1
  104. package/dist/client/assets/index-C1FJSmcm.css +1 -0
  105. package/dist/client/assets/{index-BZUEFC59.js → index-CI1Jht9R.js} +1 -1
  106. package/dist/client/assets/{index-DW2ObUy5.js → index-CZuArN5L.js} +1 -1
  107. package/dist/client/assets/{index-BK387j8D.js → index-CyyOVIRa.js} +4 -4
  108. package/dist/client/assets/{index-CQr8eIPX.js → index-D04l1q2i.js} +1 -1
  109. package/dist/client/assets/{index-tteI6gsC.js → index-DWXEY8d6.js} +1 -1
  110. package/dist/client/assets/{index-DZ5bzPKv.js → index-Dq4pGeXP.js} +2 -2
  111. package/dist/client/assets/{index-Df3PBi-r.js → index-h6bqPl48.js} +1 -1
  112. package/dist/client/assets/{index-redirect-B3JUIDwz.js → index-redirect-Ba4q2tqb.js} +1 -1
  113. package/dist/client/assets/{input-DvLfRoZW.js → input-BmwjNaE_.js} +1 -1
  114. package/dist/client/assets/{integration-icon-BWhOzvug.js → integration-icon-DTYLyB0j.js} +1 -1
  115. package/dist/client/assets/{label-DoALhGxW.js → label-C0NFwQ-B.js} +1 -1
  116. package/dist/client/assets/{login-YSQySP0u.js → login-CGNGEz2y.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-DvrxuFpt.js → mcp-oauth-DC24xUWs.js} +1 -1
  118. package/dist/client/assets/{members-BuVfsbNX.js → members-D3XzBXV8.js} +1 -1
  119. package/dist/client/assets/{monaco-editor-CA9h_ekf.js → monaco-editor-DYjkflmx.js} +1 -1
  120. package/dist/client/assets/{monitoring-stats-row-eVx0x0p6.js → monitoring-stats-row-J-G1MYWT.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-DSez9DtD.js → oauth-callback-DUpiMcs5.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-ai-provider-DjnwtIpJ.js → oauth-callback-ai-provider-CO3P1OZI.js} +1 -1
  123. package/dist/client/assets/{onboarding-CiG0gYdW.js → onboarding-DclrsG6Y.js} +1 -1
  124. package/dist/client/assets/{org-install-B7OrIv8E.js → org-install-DeUKIKD8.js} +1 -1
  125. package/dist/client/assets/{org-layout-BZ7Kkhx3.js → org-layout-Cg8fHLJ3.js} +1 -1
  126. package/dist/client/assets/{organization-choice-C_odcuEm.js → organization-choice-19Z9fWPb.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-DTO2x-C2.js → page-seo-form-Br3cQd7b.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-LvVyeCMa.js +1 -0
  129. package/dist/client/assets/{popover-DQyFV8gm.js → popover-ClZL1CWm.js} +1 -1
  130. package/dist/client/assets/{post-editor-8VwYe_fg.js → post-editor-BMMef4hZ.js} +1 -1
  131. package/dist/client/assets/{primitives-B6uu6gyb.js → primitives-DxrHnq66.js} +1 -1
  132. package/dist/client/assets/{profile-ufPV6YNA.js → profile-3JRFUV7F.js} +1 -1
  133. package/dist/client/assets/project-app-view-C4eEjnaY.js +1 -0
  134. package/dist/client/assets/record-editor-ChXkzoHs.js +1 -0
  135. package/dist/client/assets/registry-BP23lwdm.js +2 -0
  136. package/dist/client/assets/{registry-layout-BTgVNCIw.js → registry-layout-BccXQGxQ.js} +1 -1
  137. package/dist/client/assets/{require-capability-CJGLcYrf.js → require-capability-DpW2tvWJ.js} +1 -1
  138. package/dist/client/assets/{required-auth-layout-w72qbqCL.js → required-auth-layout-BDN_tOh_.js} +1 -1
  139. package/dist/client/assets/{reset-password-DgTyqBxV.js → reset-password-Duvtf1jV.js} +1 -1
  140. package/dist/client/assets/{roles-fAEk-7yD.js → roles-A5_ymSQV.js} +1 -1
  141. package/dist/client/assets/{scroll-area-NHg75EXM.js → scroll-area-CHLEJhKV.js} +1 -1
  142. package/dist/client/assets/{search-input-Co7OLTCa.js → search-input-muDNy6Ln.js} +1 -1
  143. package/dist/client/assets/{secrets-DjFyccFn.js → secrets-NBDgnL_7.js} +1 -1
  144. package/dist/client/assets/{sections-editor-8vNJbKih.js → sections-editor-BOCIkcbA.js} +1 -1
  145. package/dist/client/assets/{select-neJjS-sd.js → select-BrXsgaQw.js} +1 -1
  146. package/dist/client/assets/{select-model-C5-1Nf3S.js → select-model-I66VA05Y.js} +1 -1
  147. package/dist/client/assets/{seo-editor-CQNmoHPg.js → seo-editor-DgrFPKLm.js} +1 -1
  148. package/dist/client/assets/{settings-layout-Bq29dQXX.js → settings-layout-BHHlMr6X.js} +1 -1
  149. package/dist/client/assets/{settings-section-CDE63k2k.js → settings-section-DJLIT0a7.js} +1 -1
  150. package/dist/client/assets/{sheet-5r4gvmz4.js → sheet-X5a6kIzZ.js} +1 -1
  151. package/dist/client/assets/{shell-controls-D-HV2pZq.js → shell-controls-jA-KpHgH.js} +1 -1
  152. package/dist/client/assets/shell-layout-D7I7yjNX.js +1 -0
  153. package/dist/client/assets/{shell-route-loading-DsOqPmRX.js → shell-route-loading-DLaAxBcg.js} +1 -1
  154. package/dist/client/assets/{sidebar-X-9G9EvR.js → sidebar-Cotph9GB.js} +1 -1
  155. package/dist/client/assets/{skeleton-BZmNkJzm.js → skeleton-B7EgfrzJ.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-CF7laJH4.js → sortable.esm-Bq0cxJFG.js} +1 -1
  157. package/dist/client/assets/{sso-BK7eY86R.js → sso-DIe8zGS9.js} +1 -1
  158. package/dist/client/assets/{store-CNNPxbb2.js → store-CcJfrtts.js} +1 -1
  159. package/dist/client/assets/store-registry-BVbGNn8k.js +2 -0
  160. package/dist/client/assets/{studio-tools-D0ivYLyr.js → studio-tools-CmzCyBSU.js} +1 -1
  161. package/dist/client/assets/{switch-pC1-GX3d.js → switch-q9ZAafWN.js} +1 -1
  162. package/dist/client/assets/{table-CE8mNTWi.js → table-DA_NVnEC.js} +1 -1
  163. package/dist/client/assets/{tabs-mXxKVCyL.js → tabs-trrgBSsE.js} +1 -1
  164. package/dist/client/assets/{task-status-URAtGr6i.js → task-status-DYJYBWK3.js} +1 -1
  165. package/dist/client/assets/{textarea-EExQ_9H4.js → textarea-CF_i2Emn.js} +1 -1
  166. package/dist/client/assets/{toggle-group-B1Y3vdU4.js → toggle-group--JnydyBd.js} +1 -1
  167. package/dist/client/assets/{toolbar-DCRlrcKI.js → toolbar-CFklUh7K.js} +1 -1
  168. package/dist/client/assets/{toolbar-icon-button-BVVbHoc7.js → toolbar-icon-button-CREWlh5Z.js} +1 -1
  169. package/dist/client/assets/{tools-list-Dg1n34t2.js → tools-list-BWRoiOhb.js} +1 -1
  170. package/dist/client/assets/{tooltip-AP6mu2Do.js → tooltip-BD_hqNMT.js} +1 -1
  171. package/dist/client/assets/{types-CbEn8FkC.js → types-DPAYBgv7.js} +1 -1
  172. package/dist/client/assets/{use-ai-providers-f1eJK-kn.js → use-ai-providers-AChSiauM.js} +1 -1
  173. package/dist/client/assets/{use-automations-Dzb7eJ_x.js → use-automations-CQFMa_xu.js} +1 -1
  174. package/dist/client/assets/{use-capability-Dd2n6N0i.js → use-capability-BDE4nswa.js} +1 -1
  175. package/dist/client/assets/{use-clock-tick-CVbq_r0l.js → use-clock-tick-epCV0GEa.js} +1 -1
  176. package/dist/client/assets/{use-collections-6pmiM0Qb.js → use-collections-FInS6wZz.js} +1 -1
  177. package/dist/client/assets/{use-connection-COqYPxZz.js → use-connection-BxRtoFu6.js} +1 -1
  178. package/dist/client/assets/{use-copy-Bwnp2CVs.js → use-copy-BxgG1adZ.js} +1 -1
  179. package/dist/client/assets/{use-create-virtual-mcp-CNpngIKw.js → use-create-virtual-mcp-CiJqon6J.js} +1 -1
  180. package/dist/client/assets/{use-debounced-autosave-BAzJX42Z.js → use-debounced-autosave-BesIuXJ2.js} +1 -1
  181. package/dist/client/assets/{use-debounced-value-cb2W_ITw.js → use-debounced-value-B3ccLn0n.js} +1 -1
  182. package/dist/client/assets/{use-decopilot-events-BW75euWo.js → use-decopilot-events-DoA4Dj8r.js} +1 -1
  183. package/dist/client/assets/{use-delete-connection-CtZBvQEi.js → use-delete-connection-CpYK1Pvo.js} +1 -1
  184. package/dist/client/assets/{use-file-configs-Bud6_vwO.js → use-file-configs-BMzJEODP.js} +1 -1
  185. package/dist/client/assets/{use-infinite-scroll-CT70Yzl7.js → use-infinite-scroll-CaP-AfaJ.js} +1 -1
  186. package/dist/client/assets/{use-join-requests-Cqn8c-p-.js → use-join-requests-TsGNMd2k.js} +1 -1
  187. package/dist/client/assets/{use-mcp-client-B7wTW6Za.js → use-mcp-client-D-3djHEd.js} +1 -1
  188. package/dist/client/assets/{use-mcp-prompts-BYKvWRs7.js → use-mcp-prompts-C7PCZmCf.js} +1 -1
  189. package/dist/client/assets/{use-mcp-tools-R4ecAJwu.js → use-mcp-tools-4b8tmekN.js} +1 -1
  190. package/dist/client/assets/{use-members-uN-CIzro.js → use-members-BkG6R_Ms.js} +1 -1
  191. package/dist/client/assets/{use-mobile-DUjtY1Or.js → use-mobile-4O24ZFvZ.js} +1 -1
  192. package/dist/client/assets/{use-navigate-to-agent-CCsB3ZB_.js → use-navigate-to-agent-dQ_9J_2Z.js} +1 -1
  193. package/dist/client/assets/{use-org-auth-client-BvnffwO5.js → use-org-auth-client-RcUHQqk5.js} +1 -1
  194. package/dist/client/assets/{use-org-fs-C4gEIpOa.js → use-org-fs-uLrDtVeE.js} +1 -1
  195. package/dist/client/assets/{use-org-sso-UVp5OsHW.js → use-org-sso-BTHPNY6i.js} +1 -1
  196. package/dist/client/assets/{use-organization-roles-B5xSJ3K5.js → use-organization-roles-CuhlCWMC.js} +1 -1
  197. package/dist/client/assets/{use-organization-settings-C9fqfs_P.js → use-organization-settings-4R0yhMfM.js} +1 -1
  198. package/dist/client/assets/{use-registry-connections-xn3NRt1I.js → use-registry-connections-hLJGRrY-.js} +1 -1
  199. package/dist/client/assets/{use-secrets-B1Y6lxEc.js → use-secrets-BsrVmEdZ.js} +1 -1
  200. package/dist/client/assets/{use-status-sounds-zZf0duMU.js → use-status-sounds-Bn5JSQLC.js} +1 -1
  201. package/dist/client/assets/{use-view-mode-rzzoxJSf.js → use-view-mode-Cof9K_JB.js} +1 -1
  202. package/dist/client/assets/{use-virtual-mcp-CKtNavH6.js → use-virtual-mcp-BOgjhoey.js} +1 -1
  203. package/dist/client/assets/useInfiniteQuery-DQxcwnxb.js +1 -0
  204. package/dist/client/assets/useSuspenseInfiniteQuery--Vx6AgQ4.js +1 -0
  205. package/dist/client/assets/{useSuspenseQueries-erPqJTOK.js → useSuspenseQueries-CWZVI1nR.js} +1 -1
  206. package/dist/client/assets/variant-calendar-DMinPkMh.js +1 -0
  207. package/dist/client/assets/{view-mode-toggle-BsTJiBtn.js → view-mode-toggle-C2E71WnX.js} +1 -1
  208. package/dist/client/index.html +2 -2
  209. package/dist/server/cli.js +287 -287
  210. package/dist/server/server.js +244 -244
  211. package/package.json +1 -1
  212. package/dist/client/assets/collection-detail-BXB7pr1D.js +0 -1
  213. package/dist/client/assets/index-BcXb7VeZ.css +0 -1
  214. package/dist/client/assets/index-CgNNkRrj.js +0 -1
  215. package/dist/client/assets/index-hCkkO38W.js +0 -1
  216. package/dist/client/assets/page-seo-sheet-DDy6pvD9.js +0 -1
  217. package/dist/client/assets/project-app-view-Cn00jw84.js +0 -1
  218. package/dist/client/assets/record-editor-otBpum8f.js +0 -1
  219. package/dist/client/assets/registry-De9FQA6w.js +0 -2
  220. package/dist/client/assets/shell-layout-B6f6Mezi.js +0 -1
  221. package/dist/client/assets/store-registry-ByfWDZq4.js +0 -2
  222. package/dist/client/assets/useInfiniteQuery-Cy3rKkmY.js +0 -1
  223. package/dist/client/assets/useSuspenseInfiniteQuery-AFWRY55D.js +0 -1
  224. package/dist/client/assets/variant-calendar-B-Aqso_O.js +0 -1
@@ -1 +0,0 @@
1
- import{c as N,j as s,C as ut,r as A,l as W,i as ms,v as J,D as de,a as ve,F as fs,K as At,k as $t,b as Le,e as xs,u as fn,G as xn,H as pn,o as hn,s as gn,n as bn,p as jn,d as vn,B as Xe,I as Sn,J as yn,t as Te,M as Nn,P as _n,x as Cn,m as wn,y as kn,R as In,T as Tn,U as On,V as Oe,W as ps,X as An,Y as hs,Z as $n,_ as Pn,$ as zn,a0 as Dn,a1 as Mn,a2 as Rn,a3 as En,E as gs,O as Fn}from"./index-BK387j8D.js";import{u as Be,S as ae,a as Se,b as mt,c as ft,d as Ae,e as bs,f as js,g as Hn,h as Gn,i as Ct,j as Ln,k as Bn,l as Un}from"./sidebar-X-9G9EvR.js";import{u as Pt}from"./use-mobile-DUjtY1Or.js";import{T as ce}from"./toolbar-icon-button-BVVbHoc7.js";import{a as Fe,b as He,T as Ge,c as qt}from"./tooltip-AP6mu2Do.js";import{S as je}from"./skeleton-BZmNkJzm.js";import{P as xt,a as Qe,b as pt}from"./popover-DQyFV8gm.js";import{D as vs,a as Ss,b as ys}from"./drawer-DfEPwI8N.js";import{i as Ns}from"./SearchMd-BYsRf8JG.js";import{s as qn}from"./Star01-z6-lfdui.js";import{s as Ee}from"./Plus-D3xgmWdX.js";import{i as Wn,u as Kn,S as Vn,a as Yn}from"./use-mcp-client-B7wTW6Za.js";import{u as _s,a as zt,b as Xn}from"./use-virtual-mcp-CKtNavH6.js";import{u as Qn}from"./use-create-virtual-mcp-CNpngIKw.js";import{I as Jn,u as Zn,W as er}from"./import-from-deco-dialog-BthWZyqT.js";import{A as Je,a as Wt,b as Kt,c as Cs,d as tr,i as sr,s as nr,e as rr,f as or}from"./agent-icon-BM8MQ5be.js";import{G as ir,a as lr}from"./github-repo-picker-CJ3K7Ssu.js";import{u as ws,a as ar,b as ks,T as cr}from"./hooks-BxVsJBlY.js";import{r as dr,u as ur,R as mr,a as fr,b as Is}from"./shell-layout-B6f6Mezi.js";import{u as xr,g as Ts,a as pr,b as hr,s as gr,c as br,r as jr,d as vr,e as Sr,f as yr,p as Nr,h as _r,i as Cr,j as wr,k as kr,l as Ir,m as Tr,n as Or,T as St,S as yt,o as Ar,q as $r,t as Os}from"./use-navigate-to-agent-CCsB3ZB_.js";import{g as Pr,u as As,A as $s,a as zr,b as Vt,K as Dr,P as Mr,s as Rr,S as Er,v as Fr,D as Hr,c as Gr,d as Lr,C as Br,e as Ur}from"./sortable.esm-CF7laJH4.js";import{i as qr}from"./LayoutLeft-BMp-06Ch.js";import{A as wt}from"./avatar-BP2FzYvw.js";import{i as Dt}from"./ChevronUp-CFXuZkVg.js";import{a as Yt}from"./Eye-DJjniuqY.js";import{n as Wr,i as Kr}from"./Globe01-Do2q7EuB.js";import{i as Vr}from"./ZoomOut-CLFft6BA.js";import{i as Yr,a as Ps}from"./ZapSquare-CL8vn24R.js";import{i as zs}from"./Monitor01-DNKFU3PW.js";import{n as Xr,a as Qr}from"./Sun-CCi4P6Lh.js";import{a as tt,b as Jr,i as Zr}from"./Settings02-CPxYREBE.js";import{i as eo}from"./Shield01-Dr2T7xLf.js";import{a as to}from"./Users03-CCVhW9kg.js";import{s as Mt}from"./XClose-Bqzfjmh3.js";import{A as so,a as no,b as ro,c as oo,d as io,e as lo,f as ao}from"./alert-dialog-BvMgbTr9.js";import{F as co,a as uo,b as mo,c as fo,d as xo,f as po,e as ho}from"./form-CXezR26M.js";import{I as go}from"./input-DvLfRoZW.js";import{S as bo,C as jo}from"./chat-context-PzKbUAil.js";import"./index-Df3PBi-r.js";import{n as Rt}from"./Stars02-D8az_5Af.js";import{u as vo,v as So,C as yo}from"./connect-desktop-dialog-8s9YrP8w.js";import{u as No,a as _o}from"./use-join-requests-Cqn8c-p-.js";import{i as Et}from"./ChevronRight-CDn6HuCQ.js";import{i as Co}from"./FilterLines-C7d-9ZQk.js";import{S as wo,a as ko,b as Io,c as To,d as Oo}from"./select-neJjS-sd.js";import{u as Ao,S as Xt,M as $o}from"./shell-controls-D-HV2pZq.js";import{c as Po,a as zo,b as Do,d as Mo,e as Ro}from"./dialog-C45rhbs4.js";import{C as Eo,a as Fo,b as Ho,c as Go,d as Lo}from"./command-Bnhz7-1L.js";import{u as Ds}from"./studio-tools-D0ivYLyr.js";import{i as Bo}from"./Zap-BNW86-w0.js";import{u as Uo}from"./use-org-auth-client-BvnffwO5.js";import{C as nt,a as Qt,b as Ms,c as Rs,d as Es}from"./context-menu-CSrtqxxM.js";import{T as Ft,S as qo}from"./shell-route-loading-DsOqPmRX.js";import{t as Fs}from"./ChevronDown-D4rBo5Cd.js";import{S as Wo}from"./task-status-URAtGr6i.js";import{T as Ko,a as Vo,b as Jt,c as Zt}from"./tabs-mXxKVCyL.js";import{T as ie}from"./toolbar-DCRlrcKI.js";import"./sheet-5r4gvmz4.js";import"./X-Dq3oJiz6.js";import"./auth-BU0GeO8h.js";import"./use-collections-6pmiM0Qb.js";import"./use-connection-COqYPxZz.js";import"./github-installations-DzN1UQ4x.js";import"./collection-search-FrO71oF0.js";import"./AlertCircle-B9i_x3yX.js";import"./Tool01-B4amg9yB.js";import"./SwitchHorizontal01-DHUuncY2.js";import"./XCircle-7nuhx8NX.js";import"./ArrowUpRight-cF0mnN41.js";import"./CheckCircle-zzRIg2zR.js";import"./DotsVertical-CyO7wZv3.js";import"./Globe04-Mvw3976B.js";import"./HardDrive-Ci17wnKW.js";import"./Key01-BiZk1T91.js";import"./LinkExternal01-BIEuCHKR.js";import"./Palette-CB1NQWQN.js";import"./Play-An8HsyAi.js";import"./SearchLg-BYw4LhiQ.js";import"./Stars01-ZkDAuQwr.js";import"./Trash01-BcusIWqe.js";import"./Upload01-Dj1G7JBU.js";import"./User01-NcvWezb3.js";import"./Users01-CbnVd6yD.js";import"./checkbox-fYp407Fh.js";import"./use-debounced-value-cb2W_ITw.js";import"./authenticate-and-persist-oauth-Bwuou5N5.js";import"./mcp-oauth-DvrxuFpt.js";import"./use-mcp-tools-R4ecAJwu.js";import"./extract-connection-data-DhnwqdMi.js";import"./decopilot-sse-pool-DOCSJwAs.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-w72qbqCL.js";import"./tab-id-AX1D_RMI.js";import"./use-organization-settings-C9fqfs_P.js";import"./use-org-sso-UVp5OsHW.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-5hK-b_ZU.js";import"./use-registry-connections-xn3NRt1I.js";import"./useInfiniteQuery-Cy3rKkmY.js";import"./use-infinite-scroll-CT70Yzl7.js";import"./card-DuBMqYZm.js";import"./integration-icon-BWhOzvug.js";import"./collection-tabs-CjIQ8mgh.js";import"./badge-KNqQ-xkh.js";import"./textarea-EExQ_9H4.js";import"./connection-form-helpers-BaOBFUzF.js";import"./useSuspenseInfiniteQuery-AFWRY55D.js";import"./use-ai-providers-f1eJK-kn.js";import"./label-DoALhGxW.js";import"./use-decopilot-events-BW75euWo.js";import"./use-capability-Dd2n6N0i.js";import"./index-BZUEFC59.js";import"./use-clock-tick-CVbq_r0l.js";import"./differenceInSeconds-NQ4PDo0z.js";function Yo(t){const e=N.c(5),{onPointerDown:n,onDoubleClick:r}=t,{state:o,isMobile:i}=Be();if(i||o==="collapsed")return null;let l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=l,e[1]=a):(l=e[0],a=e[1]);let c;return e[2]!==r||e[3]!==n?(c=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:r,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:l,children:a}),e[2]=r,e[3]=n,e[4]=c):c=e[4],c}const Ht=240,Xo=400,Qo="sidebar.width";function et(t){return Math.max(Ht,Math.min(Xo,t))}function Jo(){const t=N.c(11),[e,n]=ut(Qo,Zo),r=A.useRef(null);let o;t[0]!==n||t[1]!==e?(o=u=>{u.preventDefault();const m=u.clientX,f=et(e),h=r.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),x=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of x)b.style.transition="none";const p=b=>{const j=et(f+(b.clientX-m));h?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=et(f+(b.clientX-m));n(j);for(const S of x)S.style.transition="";window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",g),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",p),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=o):o=t[2];const i=o;let l;t[3]!==n?(l=()=>{n(Ht)},t[3]=n,t[4]=l):l=t[4];const a=l;let c;t[5]!==e?(c=et(e),t[5]=e,t[6]=c):c=t[6];let d;return t[7]!==i||t[8]!==a||t[9]!==c?(d={width:c,wrapperRef:r,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=c,t[10]=d):d=t[10],d}function Zo(t){return typeof t=="number"?et(t):Ht}function ei(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:l,isSearching:a,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==l?(u=W("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=W("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(ms,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(Ns,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=h):h=e[5];let x;e[6]!==r?(x=j=>r(j.target.value),e[6]=r,e[7]=x):x=e[7];let p;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==x||e[12]!==n?(p=s.jsx("input",{type:"text",value:n,onChange:x,onKeyDown:i,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=d,e[11]=x,e[12]=n,e[13]=p):p=e[13];let g;e[14]!==f||e[15]!==h||e[16]!==p?(g=s.jsxs("label",{className:f,children:[h,p]}),e[14]=f,e[15]=h,e[16]=p,e[17]=g):g=e[17];let b;return e[18]!==u||e[19]!==g?(b=s.jsx("div",{className:u,children:g}),e[18]=u,e[19]=g,e[20]=b):b=e[20],b}const ti="Select an existing agent";function si(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(Fe,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(He,{side:"right",sideOffset:8,children:ti}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(Ge,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function ni(){const t=N.c(5),{enableDecoImport:e}=fs(),{data:n}=ve.useSession();let r;t[0]!==n?.user?.email?(r=At.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const o=!!e&&!!n?.user?.email;let i;t[2]!==r||t[3]!==o?(i={queryKey:r,queryFn:ri,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:l}=$t(i);return l?.isDecoUser??!1}async function ri(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function oi(t){const e=Le(),{create:n}=ws(),{locator:r}=de(),o=xs({strict:!1}),i=fn({strict:!1});return async l=>{const a=crypto.randomUUID(),c=l===i.virtualmcpid?dr(t,r,o.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function ii(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Je,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let i;e[3]!==n.title?(i=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==o||e[7]!==i?(l=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=l):l=e[8],l}function li(t){const e=N.c(56),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,l]=A.useState(""),a=_s(),c=a??[],{org:d}=de(),{data:u}=ve.useSession(),m=u?.user?.id??"anon",f=Ts(a),h=pr();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={navigateOnCreate:!0},e[0]=x):x=e[0];const{createVirtualMCP:p,isCreating:g}=Qn(x),{createFromTemplate:b,isCreating:j}=Zn(),S=ni(),y=oi(d.slug),C=Pr(a),w=i.toLowerCase(),_=c.filter(ai).filter(ee=>!C.has(ee.id)).filter(ee=>!i||ee.title.toLowerCase().includes(w)),I=ee=>{hr({orgId:d.id,userId:m},ee.id,f),h(),n(),l(""),y(ee.id)},O="flex flex-col max-h-[min(640px,80dvh)]";let T;e[1]!==i?(T=s.jsx(ei,{value:i,onChange:l,placeholder:"Search agents..."}),e[1]=i,e[2]=T):T=e[2];const z="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let $;e[3]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[3]=$):$=e[3];const k="grid grid-cols-3 gap-1";let R;e[4]!==p||e[5]!==n?(R=async()=>{J("agent_create_new_clicked",{source:"browse_popover"}),await p(),n()},e[4]=p,e[5]=n,e[6]=R):R=e[6];let L,H;e[7]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ee,{size:16,className:"text-muted-foreground"})}),H=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=L,e[8]=H):(L=e[7],H=e[8]);let M;e[9]!==g||e[10]!==R?(M=s.jsxs("button",{type:"button",disabled:g,onClick:R,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[L,H]}),e[9]=g,e[10]=R,e[11]=M):M=e[11];let E;e[12]!==b||e[13]!==n?(E=async()=>{J("agent_create_clicked",{source:"browse_popover",method:"website"}),await b(er),n()},e[12]=b,e[13]=n,e[14]=E):E=e[14];let D,q;e[15]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(qn,{className:"size-5 text-muted-foreground"})}),q=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=D,e[16]=q):(D=e[15],q=e[16]);let B;e[17]!==j||e[18]!==E?(B=s.jsxs("button",{type:"button",disabled:j,onClick:E,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[D,q]}),e[17]=j,e[18]=E,e[19]=B):B=e[19];let K;e[20]!==n||e[21]!==o?(K=()=>{J("agent_import_clicked",{source:"github"}),o(),n()},e[20]=n,e[21]=o,e[22]=K):K=e[22];let G,Y;e[23]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(lr,{className:"size-5 text-muted-foreground"})}),Y=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[23]=G,e[24]=Y):(G=e[23],Y=e[24]);let U;e[25]!==K?(U=s.jsxs("button",{type:"button",onClick:K,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[G,Y]}),e[25]=K,e[26]=U):U=e[26];let X;e[27]!==S||e[28]!==n||e[29]!==r?(X=S&&s.jsxs("button",{type:"button",onClick:()=>{J("agent_import_clicked",{source:"deco"}),r(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"",className:"size-5 object-contain"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import deco.cx"})]}),e[27]=S,e[28]=n,e[29]=r,e[30]=X):X=e[30];const se=_.map(ee=>s.jsx(ii,{agent:ee,onClick:()=>I(ee)},ee.id));let Q;e[31]!==M||e[32]!==B||e[33]!==U||e[34]!==X||e[35]!==se?(Q=s.jsxs("div",{className:k,children:[M,B,U,X,se]}),e[31]=M,e[32]=B,e[33]=U,e[34]=X,e[35]=se,e[36]=Q):Q=e[36];let te;e[37]!==g||e[38]!==i||e[39]!==_.length?(te=_.length===0&&!g&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[37]=g,e[38]=i,e[39]=_.length,e[40]=te):te=e[40];let V;e[41]!==Q||e[42]!==te||e[43]!==$?(V=s.jsxs("div",{className:z,children:[$,Q,te]}),e[41]=Q,e[42]=te,e[43]=$,e[44]=V):V=e[44];let Z;e[45]!==d.slug?(Z={org:d.slug},e[45]=d.slug,e[46]=Z):Z=e[46];let re;e[47]!==n?(re=()=>n(),e[47]=n,e[48]=re):re=e[48];let ne;e[49]!==Z||e[50]!==re?(ne=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(xn,{to:"/$org/settings/agents",params:Z,onClick:re,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[49]=Z,e[50]=re,e[51]=ne):ne=e[51];let oe;return e[52]!==V||e[53]!==ne||e[54]!==T?(oe=s.jsxs("div",{className:O,children:[T,V,ne]}),e[52]=V,e[53]=ne,e[54]=T,e[55]=oe):oe=e[55],oe}function ai(t){return!Wn(t.id)}function Hs(t){const e=N.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,l]=A.useState(!1),[a,c]=A.useState(!1),[d,u]=A.useState(!1),m=Pt(),{setOpenMobile:f}=Be(),h=xr(),x=h?"border border-border":void 0;let p;e[2]!==h?(p=O=>h?s.jsx(si,{children:O}):O,e[2]=h,e[3]=p):p=e[3];const g=p;let b;e[4]!==m||e[5]!==f?(b=()=>{l(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=b):b=e[6];const j=b;let S;e[7]!==j||e[8]!==i?(S=i&&s.jsx(A.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(je,{className:"h-4 w-24"})}),children:s.jsx(li,{onClose:j,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),j()}})}),e[7]=j,e[8]=i,e[9]=S):S=e[9];const y=S;let C;e[10]!==o||e[11]!==x||e[12]!==h||e[13]!==m||e[14]!==i||e[15]!==y||e[16]!==g?(C=m?s.jsxs(s.Fragment,{children:[o?g(s.jsx(ce,{"aria-label":"Browse agents",className:W(x),onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:s.jsx(Ee,{className:"size-4"})})):s.jsx(ae,{children:g(s.jsxs(Se,{tooltip:h?void 0:"Browse agents",className:W(x),onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:[s.jsx(Ee,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(vs,{open:i,onOpenChange:l,direction:"bottom",children:s.jsxs(Ss,{className:"max-h-[85dvh] p-0",children:[s.jsx(ys,{className:"sr-only",children:"Browse agents"}),y]})})]}):s.jsxs(xt,{open:i,onOpenChange:O=>{O&&!i&&J("agent_browser_opened",{surface:"desktop_popover"}),l(O)},children:[o?g(s.jsx(Qe,{asChild:!0,children:s.jsx(ce,{"aria-label":"Browse agents",className:W(x),children:s.jsx(Ee,{className:"size-4"})})})):s.jsx(ae,{children:g(s.jsx(Qe,{asChild:!0,children:s.jsxs(Se,{tooltip:h?void 0:"Browse agents",className:W(x),children:[s.jsx(Ee,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(pt,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:y})]}),e[10]=o,e[11]=x,e[12]=h,e[13]=m,e[14]=i,e[15]=y,e[16]=g,e[17]=C):C=e[17];let w;e[18]!==a?(w=s.jsx(Jn,{open:a,onOpenChange:c}),e[18]=a,e[19]=w):w=e[19];let _;e[20]!==d?(_=s.jsx(ir,{open:d,onOpenChange:u}),e[20]=d,e[21]=_):_=e[21];let I;return e[22]!==C||e[23]!==w||e[24]!==_?(I=s.jsxs(s.Fragment,{children:[C,w,_]}),e[22]=C,e[23]=w,e[24]=_,e[25]=I):I=e[25],I}function Gs(){const t=N.c(3);de();const{state:e,isMobile:n}=Be(),r=!n&&e==="collapsed";let o;if(t[0]!==r){if(o=[],r){let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i={type:"custom",key:"new-task",content:s.jsx(mt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ft,{children:s.jsx(Ae,{className:"gap-1.5",children:s.jsx(Hs,{})})})})},t[2]=i):i=t[2],o.push(i)}t[0]=r,t[1]=o}else o=t[1];return o}function Ls(t){const e=N.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(mt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(ft,{children:s.jsx(Ae,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function Bs(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Be();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{J("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const l=i,a=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=W(c),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==n.label?(u=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=u):u=e[7];let m;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(Se,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=u,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==m?(f=s.jsx(ae,{className:d,children:m},a),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function ci(t){const e=N.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(bs,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(ui),e[2]=n.group.items,e[3]=i):i=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(l=s.jsx(Ls,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let r;e[8]!==n.items?(r=n.items.map(di),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(mt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ft,{children:s.jsx(Ae,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function di(t){return s.jsx(Bs,{item:t},t.key)}function ui(t){return s.jsx(Bs,{item:t},t.key)}function mi(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:l}=t,a=i===void 0?"sidebar":i;let c;e[0]!==l?(c=W("flex flex-col flex-1 px-2 py-2 gap-0.5",l),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(fi),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==c||e[7]!==d||e[8]!==u?(m=s.jsxs(js,{className:c,children:[d,u]}),e[6]=c,e[7]=d,e[8]=u,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==a?(f=s.jsxs(Hn,{variant:a,children:[m,r]}),e[10]=r,e[11]=m,e[12]=a,e[13]=f):f=e[13],f}function fi(t,e){return s.jsx(ci,{section:t},e)}function Us(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(mi,{...t}),e[0]=t,e[1]=n):n=e[1],n}Us.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(je,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function xi(t){const e=N.c(16),{onToggle:n,className:r}=t,i=fs().logo??pn,l=typeof i=="string"?i:i.light,a=typeof i=="string"?i:i.dark;let c;e[0]!==r?(c=W("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==l?(d=s.jsx("img",{src:l,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=l,e[3]=d):d=e[3];let u;e[4]!==a?(u=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=u):u=e[5];let m;e[6]!==d||e[7]!==u?(m=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[d,u]})}),e[6]=d,e[7]=u,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(qr,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(ce,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let x;return e[12]!==c||e[13]!==m||e[14]!==h?(x=s.jsxs(Gn,{className:c,children:[m,h]}),e[12]=c,e[13]=m,e[14]=h,e[15]=x):x=e[15],x}function es(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=W(o),e[0]=o,e[1]=i):i=e[1];let l;e[2]!==n||e[3]!==r?(l=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let d;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==c?(d=s.jsxs(Se,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=c,e[14]=d):d=e[14];let u;return e[15]!==i||e[16]!==d?(u=s.jsx(ae,{className:i,children:d}),e[15]=i,e[16]=d,e[17]=u):u=e[17],u}function pi(t){const e=N.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(bs,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let l;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(es,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],l=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(Ls,{label:o,defaultExpanded:i,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let l;e[14]!==r?(l=a=>s.jsx(es,{item:a,onClose:r},a.key),e[14]=r,e[15]=l):l=e[15],o=n.items.map(l),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(mt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ft,{children:s.jsx(Ae,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function hi(t){const e=N.c(17),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=l):l=e[0];let a;e[1]!==r?(a=s.jsx(A.Suspense,{fallback:l,children:s.jsx(xi,{onToggle:r})}),e[1]=r,e[2]=a):a=e[2];let c;if(e[3]!==r||e[4]!==n){let f;e[6]!==r?(f=(h,x)=>s.jsx(pi,{section:h,onClose:r},x),e[6]=r,e[7]=f):f=e[7],c=n.map(f),e[3]=r,e[4]=n,e[5]=c}else c=e[5];let d;e[8]!==i?(d=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[8]=i,e[9]=d):d=e[9];let u;e[10]!==c||e[11]!==d?(u=s.jsxs(js,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[c,d]}),e[10]=c,e[11]=d,e[12]=u):u=e[12];let m;return e[13]!==o||e[14]!==a||e[15]!==u?(m=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,u,o]}),e[13]=o,e[14]=a,e[15]=u,e[16]=m):m=e[16],m}function qs(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const gi=hn({name:gn().min(2,"Organization name is required")});function bi(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:bn(gi),defaultValues:{name:""}},e[0]=o):o=e[0];const i=jn(o);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:vi,onSuccess:ji},e[1]=l):l=e[1];const a=vn(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(ro,{children:[s.jsx(oo,{children:"Create a new organization"}),s.jsx(io,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==a||e[4]!==i){let _;e[6]!==a?(_=I=>a.mutateAsync(I),e[6]=a,e[7]=_):_=e[7],u=i.handleSubmit(_),e[3]=a,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:I}=_;return s.jsxs(mo,{children:[s.jsx(fo,{children:"Organization Name"}),s.jsx(xo,{children:s.jsx(go,{...I,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(po,{children:"The name of your company or organization"}),I.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",qs(I.value)]})]}),s.jsx(ho,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(co,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let h;e[13]!==c?(h=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==i?(x=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=x):x=e[17];let p;e[18]!==i.formState.isSubmitting||e[19]!==x?(p=s.jsx(so,{disabled:i.formState.isSubmitting,onClick:x,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=x,e[20]=p):p=e[20];const g=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(bo,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(Xe,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let S;e[26]!==j||e[27]!==p?(S=s.jsxs(lo,{children:[p,j]}),e[26]=j,e[27]=p,e[28]=S):S=e[28];let y;e[29]!==S||e[30]!==u||e[31]!==f||e[32]!==h?(y=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,h,S]}),e[29]=S,e[30]=u,e[31]=f,e[32]=h,e[33]=y):y=e[33];let C;e[34]!==i||e[35]!==y?(C=s.jsxs(no,{children:[d,s.jsx(uo,{...i,children:y})]}),e[34]=i,e[35]=y,e[36]=C):C=e[36];let w;return e[37]!==r||e[38]!==n||e[39]!==C?(w=s.jsx(ao,{open:n,onOpenChange:r,children:C}),e[37]=r,e[38]=n,e[39]=C,e[40]=w):w=e[40],w}function ji(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function vi(t){const e=qs(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await ve.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const r=n?.data?.slug??e;if(!r)throw new Error("Failed to create organization");return{orgSlug:r}}function kt(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function Si(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",l=o==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=W(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:kt(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let d;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:W("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=d):d=e[8];let u;return e[9]!==a||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:a,style:c,children:d}),e[9]=a,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function rt(t){const e=N.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,d=n.external?"noopener noreferrer":void 0;let u;e[0]!==n.icon?(u=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=u):u=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==u||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:d,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:r,children:[u,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=u,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let l;e[16]!==n.label?(l=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=l):l=e[17];let a;return e[18]!==o||e[19]!==i||e[20]!==l?(a=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,l]}),e[18]=o,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function ts(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=Cn();let l;e[0]!==n?(l=(k,R)=>k.slug===n?-1:R.slug===n?1:k.name.localeCompare(R.name),e[0]=n,e[1]=l):l=e[1];const a=[...i??[]].sort(l),[c,d]=A.useState(!1),[u,m]=A.useState(""),f=u.toLowerCase(),h=f?a.filter(k=>k.name.toLowerCase().includes(f)||k.slug.toLowerCase().includes(f)):a;let x;e[2]!==c?(x=function(){c&&m(""),d(yi)},e[2]=c,e[3]=x):x=e[3];const p=x;let g;e[4]!==u||e[5]!==c||e[6]!==p?(g=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:k=>m(k.target.value),onKeyDown:k=>k.key==="Escape"&&p(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=u,e[5]=c,e[6]=p,e[7]=g):g=e[7];let b;e[8]!==c?(b=c?s.jsx(Mt,{size:16}):s.jsx(Ns,{size:16}),e[8]=c,e[9]=b):b=e[9];let j;e[10]!==b||e[11]!==p?(j=s.jsx("button",{type:"button",onClick:p,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=b,e[11]=p,e[12]=j):j=e[12];let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ee,{size:16}),e[13]=S):S=e[13];let y;e[14]!==o?(y=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:S}),e[14]=o,e[15]=y):y=e[15];let C;e[16]!==j||e[17]!==y?(C=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,y]}),e[16]=j,e[17]=y,e[18]=C):C=e[18];let w;e[19]!==g||e[20]!==C?(w=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[g,C]}),e[19]=g,e[20]=C,e[21]=w):w=e[21];const _="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",I=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?`No organizations match "${u}"`:"No organizations available"});let O;e[22]!==r||e[23]!==n?(O=k=>s.jsxs("button",{type:"button",onClick:()=>r(k.slug),className:W("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Si,{org:k,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===n&&s.jsx(Dt,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[22]=r,e[23]=n,e[24]=O):O=e[24];const T=h.map(O);let z;e[25]!==I||e[26]!==T?(z=s.jsxs("div",{className:_,children:[I,T]}),e[25]=I,e[26]=T,e[27]=z):z=e[27];let $;return e[28]!==z||e[29]!==w?($=s.jsxs(s.Fragment,{children:[w,z]}),e[28]=z,e[29]=w,e[30]=$):$=e[30],$}function yi(t){return!t}function ss(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:h,open:x}=t;if(h){const V=n?.name??"U";let Z;e[0]!==V||e[1]!==r?(Z=s.jsx(wt,{url:r,fallback:V,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=V,e[1]=r,e[2]=Z):Z=e[2];const re=n?.name??"User";let ne;e[3]!==re?(ne=s.jsx("p",{className:"text-sm font-medium truncate",children:re}),e[3]=re,e[4]=ne):ne=e[4];const oe=n?.email;let ee;e[5]!==oe?(ee=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:oe}),e[5]=oe,e[6]=ee):ee=e[6];let $e;e[7]!==ne||e[8]!==ee?($e=s.jsxs("div",{className:"flex-1 min-w-0",children:[ne,ee]}),e[7]=ne,e[8]=ee,e[9]=$e):$e=e[9];let le;e[10]!==n?(le=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(wi)},e[10]=n,e[11]=le):le=e[11];let ye;e[12]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(Yt,{size:14}),e[12]=ye):ye=e[12];let fe;e[13]!==le?(fe=s.jsx(Fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:le,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ye})}),e[13]=le,e[14]=fe):fe=e[14];let qe;e[15]===Symbol.for("react.memo_cache_sentinel")?(qe=s.jsx(He,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=qe):qe=e[15];let Pe;e[16]!==fe?(Pe=s.jsx(qt,{delayDuration:300,children:s.jsxs(Ge,{children:[fe,qe]})}),e[16]=fe,e[17]=Pe):Pe=e[17];let xe;e[18]!==Pe||e[19]!==Z||e[20]!==$e?(xe=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[Z,$e,Pe]}),e[18]=Pe,e[19]=Z,e[20]=$e,e[21]=xe):xe=e[21];const pe=String(x);let he;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==pe?(he=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(ts,{orgParam:d,onSelectOrg:u,onCreateOrg:m},pe)}),e[22]=m,e[23]=u,e[24]=d,e[25]=pe,e[26]=he):he=e[26];let me;if(e[27]!==f||e[28]!==o){let ue;e[30]!==f?(ue=Ve=>s.jsx(rt,{item:Ve,onClose:f},Ve.key),e[30]=f,e[31]=ue):ue=e[31],me=o.map(ue),e[27]=f,e[28]=o,e[29]=me}else me=e[29];let ge;e[32]!==f||e[33]!==i?(ge=s.jsx(rt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=ge):ge=e[34];let ze;e[35]!==me||e[36]!==ge?(ze=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[me,ge]}),e[35]=me,e[36]=ge,e[37]=ze):ze=e[37];let De;e[38]!==he||e[39]!==ze?(De=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[he,ze]}),e[38]=he,e[39]=ze,e[40]=De):De=e[40];let Ne;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let ue;e[45]!==a.theme||e[46]!==c?(ue=Ve=>{const{value:Ye,icon:Ut,label:vt}=Ve;return s.jsx("button",{type:"button","aria-label":vt,onClick:()=>c(st=>({...st,theme:Ye})),className:W("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Ye?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ut},Ye)},e[45]=a.theme,e[46]=c,e[47]=ue):ue=e[47],Ne=l.map(ue),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=Ne}else Ne=e[44];let be;e[48]!==Ne?(be=s.jsx("div",{className:"flex items-center gap-0.5",children:Ne}),e[48]=Ne,e[49]=be):be=e[49];const Ue=a.enableSounds?"Disable sounds":"Enable sounds";let _e;e[50]!==c?(_e=()=>c(Ci),e[50]=c,e[51]=_e):_e=e[51];const Ze=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Me;e[52]!==Ze?(Me=W("size-8 rounded-md flex items-center justify-center transition-colors",Ze),e[52]=Ze,e[53]=Me):Me=e[53];let Ce;e[54]!==a.enableSounds?(Ce=a.enableSounds?s.jsx(Wt,{size:14}):s.jsx(Kt,{size:14}),e[54]=a.enableSounds,e[55]=Ce):Ce=e[55];let we;e[56]!==Ue||e[57]!==_e||e[58]!==Me||e[59]!==Ce?(we=s.jsx("button",{type:"button","aria-label":Ue,onClick:_e,className:Me,children:Ce}),e[56]=Ue,e[57]=_e,e[58]=Me,e[59]=Ce,e[60]=we):we=e[60];let We;e[61]===Symbol.for("react.memo_cache_sentinel")?(We=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.10.0"]}),e[61]=We):We=e[61];let ke;e[62]!==we?(ke=s.jsxs("div",{className:"flex items-center gap-2",children:[we,We]}),e[62]=we,e[63]=ke):ke=e[63];let Ie;e[64]!==be||e[65]!==ke?(Ie=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[be,ke]}),e[64]=be,e[65]=ke,e[66]=Ie):Ie=e[66];let Ke;return e[67]!==xe||e[68]!==De||e[69]!==Ie?(Ke=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[xe,De,Ie]}),e[67]=xe,e[68]=De,e[69]=Ie,e[70]=Ke):Ke=e[70],Ke}const p=n?.name??"U";let g;e[71]!==p||e[72]!==r?(g=s.jsx(wt,{url:r,fallback:p,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=p,e[72]=r,e[73]=g):g=e[73];const b=n?.name??"User";let j;e[74]!==b?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:b}),e[74]=b,e[75]=j):j=e[75];const S=n?.email;let y;e[76]!==S?(y=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S}),e[76]=S,e[77]=y):y=e[77];let C;e[78]!==j||e[79]!==y?(C=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,y]}),e[78]=j,e[79]=y,e[80]=C):C=e[80];let w;e[81]!==n?(w=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(_i)},e[81]=n,e[82]=w):w=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Yt,{size:14}),e[83]=_):_=e[83];let I;e[84]!==w?(I=s.jsx(Fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:w,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=w,e[85]=I):I=e[85];let O;e[86]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(He,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=O):O=e[86];let T;e[87]!==I?(T=s.jsx(qt,{delayDuration:300,children:s.jsxs(Ge,{children:[I,O]})}),e[87]=I,e[88]=T):T=e[88];let z;e[89]!==T||e[90]!==g||e[91]!==C?(z=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[g,C,T]}),e[89]=T,e[90]=g,e[91]=C,e[92]=z):z=e[92];let $;if(e[93]!==f||e[94]!==o){let V;e[96]!==f?(V=Z=>s.jsx(rt,{item:Z,onClose:f},Z.key),e[96]=f,e[97]=V):V=e[97],$=o.map(V),e[93]=f,e[94]=o,e[95]=$}else $=e[95];let k;e[98]!==f||e[99]!==i?(k=s.jsx(rt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=k):k=e[100];let R;e[101]!==$||e[102]!==k?(R=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[$,k]}),e[101]=$,e[102]=k,e[103]=R):R=e[103];let L;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let V;e[108]!==a.theme||e[109]!==c?(V=Z=>{const{value:re,icon:ne,label:oe}=Z;return s.jsx("button",{type:"button","aria-label":oe,onClick:()=>c(ee=>({...ee,theme:re})),className:W("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===re?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ne},re)},e[108]=a.theme,e[109]=c,e[110]=V):V=e[110],L=l.map(V),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=L}else L=e[107];let H;e[111]!==L?(H=s.jsx("div",{className:"flex items-center gap-0.5",children:L}),e[111]=L,e[112]=H):H=e[112];const M=a.enableSounds?"Disable sounds":"Enable sounds";let E;e[113]!==c?(E=()=>c(Ni),e[113]=c,e[114]=E):E=e[114];const D=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let q;e[115]!==D?(q=W("size-7 rounded-md flex items-center justify-center transition-colors",D),e[115]=D,e[116]=q):q=e[116];let B;e[117]!==a.enableSounds?(B=a.enableSounds?s.jsx(Wt,{size:14}):s.jsx(Kt,{size:14}),e[117]=a.enableSounds,e[118]=B):B=e[118];let K;e[119]!==M||e[120]!==E||e[121]!==q||e[122]!==B?(K=s.jsx("button",{type:"button","aria-label":M,onClick:E,className:q,children:B}),e[119]=M,e[120]=E,e[121]=q,e[122]=B,e[123]=K):K=e[123];let G;e[124]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.10.0"]}),e[124]=G):G=e[124];let Y;e[125]!==K?(Y=s.jsxs("div",{className:"flex items-center gap-2",children:[K,G]}),e[125]=K,e[126]=Y):Y=e[126];let U;e[127]!==H||e[128]!==Y?(U=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[H,Y]}),e[127]=H,e[128]=Y,e[129]=U):U=e[129];let X;e[130]!==z||e[131]!==R||e[132]!==U?(X=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[z,R,U]}),e[130]=z,e[131]=R,e[132]=U,e[133]=X):X=e[133];const se=String(x);let Q;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==se?(Q=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(ts,{orgParam:d,onSelectOrg:u,onCreateOrg:m},se)}),e[134]=m,e[135]=u,e[136]=d,e[137]=se,e[138]=Q):Q=e[138];let te;return e[139]!==X||e[140]!==Q?(te=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[X,Q]}),e[139]=X,e[140]=Q,e[141]=te):te=e[141],te}function Ni(t){return{...t,enableSounds:!t.enableSounds}}function _i(){Te.success("User ID copied")}function Ci(t){return{...t,enableSounds:!t.enableSounds}}function wi(){Te.success("User ID copied")}function It(){const t=N.c(44),{data:e}=ve.useSession(),{org:n}=de(),r=Le();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const l=Sn(o)?.params.org,[a,c]=yn(),d=Pt(),[u,m]=A.useState(!1),[f,h]=A.useState(!1),x=e?.user,p=x?.image;let g;t[1]!==r?(g=X=>{m(!1),r({to:"/$org",params:{org:X}})},t[1]=r,t[2]=g):g=t[2];const b=g;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),t[3]=j):j=t[3];const S=j;let y;t[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(tt,{size:16}),t[4]=y):y=t[4];let C;t[5]!==r||t[6]!==l?(C={key:"preferences",label:"Preferences",icon:y,onClick:()=>{r({to:"/$org/settings/profile",params:{org:l??""}})}},t[5]=r,t[6]=l,t[7]=C):C=t[7];let w;t[8]!==n||t[9]!==r?(w=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Wr,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=w):w=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"terms",label:"Terms of Use",icon:s.jsx(Vr,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=_):_=t[11];let I;t[12]===Symbol.for("react.memo_cache_sentinel")?(I={key:"privacy",label:"Privacy Policy",icon:s.jsx(eo,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=I):I=t[12];let O;t[13]===Symbol.for("react.memo_cache_sentinel")?(O={key:"github",label:"decocms/studio",icon:s.jsx(Nn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=O):O=t[13];let T;t[14]===Symbol.for("react.memo_cache_sentinel")?(T={key:"community",label:"Community",icon:s.jsx(to,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=T):T=t[14];let z;t[15]===Symbol.for("react.memo_cache_sentinel")?(z={key:"homepage",label:"Homepage",icon:s.jsx(Kr,{size:16}),href:"https://decocms.com",external:!0},t[15]=z):z=t[15];let $;t[16]!==C||t[17]!==w?($=[C,...w,_,I,O,T,z],t[16]=C,t[17]=w,t[18]=$):$=t[18];const k=$;let R;t[19]===Symbol.for("react.memo_cache_sentinel")?(R={key:"logout",label:"Sign out",icon:s.jsx(Yr,{size:16}),onClick:Ii},t[19]=R):R=t[19];const L=R;let H;t[20]===Symbol.for("react.memo_cache_sentinel")?(H={value:"light",icon:s.jsx(Xr,{size:14}),label:"Light theme"},t[20]=H):H=t[20];let M;t[21]===Symbol.for("react.memo_cache_sentinel")?(M={value:"dark",icon:s.jsx(Qr,{size:14}),label:"Dark theme"},t[21]=M):M=t[21];let E;t[22]===Symbol.for("react.memo_cache_sentinel")?(E=[H,M,{value:"system",icon:s.jsx(zs,{size:14}),label:"System theme"}],t[22]=E):E=t[22];const D=E;let q;t[23]===Symbol.for("react.memo_cache_sentinel")?(q=()=>{m(!1),h(!0)},t[23]=q):q=t[23];let B;t[24]!==b||t[25]!==d||t[26]!==k||t[27]!==u||t[28]!==l||t[29]!==a||t[30]!==c||t[31]!==x||t[32]!==p?(B={user:x,userImage:p,menuItems:k,signOutItem:L,themeOptions:D,preferences:a,setPreferences:c,orgParam:l,onSelectOrg:b,onCreateOrg:q,close:S,isMobile:d,open:u},t[24]=b,t[25]=d,t[26]=k,t[27]=u,t[28]=l,t[29]=a,t[30]=c,t[31]=x,t[32]=p,t[33]=B):B=t[33];const K=B;let G;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==K?(G=d?s.jsxs(vs,{open:u,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:kt(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]}),s.jsxs(Ss,{className:"h-[80dvh] p-0",children:[s.jsx(ys,{className:"sr-only",children:"Account"}),s.jsx(ss,{...K})]})]}):s.jsxs(xt,{open:u,onOpenChange:m,children:[s.jsx(Qe,{asChild:!0,children:s.jsxs(Se,{tooltip:n?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:kt(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]})}),s.jsx(pt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:ki,children:s.jsx(ss,{...K})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=K,t[38]=G):G=t[38];let Y;t[39]!==f?(Y=s.jsx(bi,{open:f,onOpenChange:h}),t[39]=f,t[40]=Y):Y=t[40];let U;return t[41]!==G||t[42]!==Y?(U=s.jsxs(s.Fragment,{children:[G,Y]}),t[41]=G,t[42]=Y,t[43]=U):U=t[43],U}function ki(t){return t.preventDefault()}function Ii(){J("signed_out",{source:"account_popover"}),_n(),ve.signOut()}function Tt(){const t=N.c(22),e=vo(),[n,r]=A.useState(!1);let o;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const p=So(e.capabilities);o=e.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:e.hostname??e.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:p.length>0?`Available: ${p.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),t[0]=e.capabilities,t[1]=e.hostname,t[2]=e.machineId,t[3]=e.online,t[4]=o}else o=t[4];const i=o;let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=()=>r(!0),t[5]=l):l=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(zs,{size:16}),t[6]=c):c=t[6];let d;t[7]!==e.online?(d=e.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),t[7]=e.online,t[8]=d):d=t[8];let u;t[9]!==a||t[10]!==d?(u=s.jsx(Fe,{asChild:!0,children:s.jsxs(ce,{onClick:l,"aria-label":a,children:[c,d]})}),t[9]=a,t[10]=d,t[11]=u):u=t[11];let m;t[12]!==i?(m=s.jsx(He,{side:"bottom",children:i}),t[12]=i,t[13]=m):m=t[13];let f;t[14]!==u||t[15]!==m?(f=s.jsxs(Ge,{children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16];let h;t[17]!==n?(h=s.jsx(yo,{open:n,onOpenChange:r}),t[17]=n,t[18]=h):h=t[18];let x;return t[19]!==f||t[20]!==h?(x=s.jsxs(s.Fragment,{children:[f,h]}),t[19]=f,t[20]=h,t[21]=x):x=t[21],x}function Ti({invitation:t}){const[e,n]=A.useState(!1),[r,o]=A.useState(!1),i=wn(),l=async()=>{n(!0);try{const d=await ve.organization.acceptInvitation({invitationId:t.id});if(d.error){Te.error(d.error.message),n(!1);return}}catch{Te.error("Failed to accept invitation"),n(!1);return}Te.success("Invitation accepted!"),kn();let c;try{c=(await ve.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{o(!0);try{const c=await ve.organization.rejectInvitation({invitationId:t.id});c.error?(Te.error(c.error.message),o(!1)):(Te.success("Invitation declined"),i.invalidateQueries())}catch{Te.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(Xe,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Dt,{size:14})}),s.jsx(Xe,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(Mt,{size:14})})]})]})}function Oi(t){const e=N.c(29),{request:n}=t,{approve:r,deny:o}=No(),i=r.isPending||o.isPending,l=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let c;e[0]!==l?(c=l.charAt(0).toUpperCase(),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==a||e[3]!==c?(d=s.jsx(wt,{url:a,fallback:c,shape:"circle",size:"sm"}),e[2]=a,e[3]=c,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=u):u=e[5];let m;e[6]!==l?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[u,s.jsx("p",{className:"text-sm font-medium truncate",children:l})]}),e[6]=l,e[7]=m):m=e[7];let f;e[8]!==r||e[9]!==n.id?(f=()=>r.mutate(n.id),e[8]=r,e[9]=n.id,e[10]=f):f=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Dt,{size:14}),e[11]=h):h=e[11];let x;e[12]!==i||e[13]!==f?(x=s.jsx(Xe,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:f,disabled:i,"aria-label":"Approve join request",children:h}),e[12]=i,e[13]=f,e[14]=x):x=e[14];let p;e[15]!==o||e[16]!==n.id?(p=()=>o.mutate(n.id),e[15]=o,e[16]=n.id,e[17]=p):p=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Mt,{size:14}),e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==p?(b=s.jsx(Xe,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:p,disabled:i,"aria-label":"Deny join request",children:g}),e[19]=i,e[20]=p,e[21]=b):b=e[21];let j;e[22]!==b||e[23]!==x?(j=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[x,b]}),e[22]=b,e[23]=x,e[24]=j):j=e[24];let S;return e[25]!==j||e[26]!==d||e[27]!==m?(S=s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[d,m,j]}),e[25]=j,e[26]=d,e[27]=m,e[28]=S):S=e[28],S}function Ai(t){const e=N.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==n.eyebrow?(l=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=l):l=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==l||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Et,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==i||e[12]!==c?(u=s.jsxs("button",{type:"button",onClick:o,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,c,d]}),e[10]=o,e[11]=i,e[12]=c,e[13]=u):u=e[13],u}function $i(){const t=A.useContext(In),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function Ws(){const t=N.c(11),{isSeen:e,markSeen:n,unseenCount:r}=ur(),o=$i(),i=_o();let l;if(t[0]!==e||t[1]!==o||t[2]!==i){const d=[...i].sort(Ri).map(Mi),u=[...o].sort(Di).map(zi);let m;t[4]!==e?(m=h=>({type:"release",release:h,isSeen:e(h.id)}),t[4]=e,t[5]=m):m=t[5];const f=[...mr].sort(Pi).map(m);l=[...d,...u,...f],t[0]=e,t[1]=o,t[2]=i,t[3]=l}else l=t[3];const a=r+o.length+i.length;let c;return t[6]!==n||t[7]!==o||t[8]!==l||t[9]!==a?(c={items:l,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=o,t[8]=l,t[9]=a,t[10]=c):c=t[10],c}function Pi(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function zi(t){return{type:"invitation",invitation:t}}function Di(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function Mi(t){return{type:"join-request",request:t}}function Ri(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class Ks extends A.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Vs(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Ei(){const t=N.c(17),e=Le(),{org:n}=de(),{hasDecoKey:r,balanceDollars:o}=As();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let l;t[2]!==o?(l=W(o!=null&&Vs(o)),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Cs,{}),t[7]=c):c=t[7];let d;t[8]!==o?(d=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=d):d=t[9];let u;t[10]!==d?(u=s.jsx("span",{children:d}),t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==i||t[13]!==l||t[14]!==a||t[15]!==u?(m=s.jsx(Ae,{children:s.jsx(ae,{children:s.jsxs(Se,{tooltip:i,className:l,onClick:a,children:[c,u]})})}),t[12]=i,t[13]=l,t[14]=a,t[15]=u,t[16]=m):m=t[16],m}function Fi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ks,{children:s.jsx(A.Suspense,{fallback:null,children:s.jsx(Ei,{})})}),t[0]=e):e=t[0],e}function Hi(){const t=N.c(17),e=Le(),{org:n}=de(),{hasDecoKey:r,balanceDollars:o}=As();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];const l=i;let a;t[2]!==e||t[3]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=a):a=t[4];let c;t[5]!==o?(c=W(o!=null&&Vs(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Cs,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==a||t[9]!==c||t[10]!==l?(u=s.jsx(Fe,{asChild:!0,children:s.jsx(ce,{"aria-label":l,onClick:a,className:c,children:d})}),t[8]=a,t[9]=c,t[10]=l,t[11]=u):u=t[11];let m;t[12]!==l?(m=s.jsx(He,{side:"top",children:l}),t[12]=l,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(Ge,{delayDuration:300,children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16],f}function Gi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ks,{children:s.jsx(A.Suspense,{fallback:null,children:s.jsx(Hi,{})})}),t[0]=e):e=t[0],e}function Ys(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=Ws(),[i,l]=A.useState(null);let a;if(e[0]!==r||e[1]!==i){let p;e[3]!==i?(p=g=>g.type==="release"&&g.release.id===i,e[3]=i,e[4]=p):p=e[4],a=r.find(p),e[0]=r,e[1]=i,e[2]=a}else a=e[2];const c=a,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=p=>{l(p),o(p)},e[5]=o,e[6]=u):u=e[6];const m=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=p=>{p||l(null)},e[7]=f):f=e[7];let h;e[8]!==m||e[9]!==r||e[10]!==d?(h=s.jsx(pt,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:d?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx(Xe,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>l(null),children:s.jsx(Jr,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:d.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(fr,{release:d})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Rt,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations, join requests, and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(p=>p.type==="join-request"?s.jsx(Oi,{request:p.request},`req-${p.request.id}`):p.type==="invitation"?s.jsx(Ti,{invitation:p.invitation},`inv-${p.invitation.id}`):s.jsx(Ai,{release:p.release,isSeen:p.isSeen,onSelect:()=>m(p.release.id)},`rel-${p.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=d,e[11]=h):h=e[11];let x;return e[12]!==n||e[13]!==h?(x=s.jsxs(xt,{onOpenChange:f,children:[n,h]}),e[12]=n,e[13]=h,e[14]=x):x=e[14],x}function Xs(){const{redDotCount:t}=Ws();return t>0}function Li(){const t=N.c(6),e=Xs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Rt,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx(Ys,{children:s.jsx(Qe,{asChild:!0,children:s.jsxs(Se,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function Bi(){const t=N.c(8),e=Xs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Rt,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(Qe,{asChild:!0,children:s.jsx(Fe,{asChild:!0,children:s.jsxs(ce,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(He,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let l;return t[6]!==o?(l=s.jsx(Ys,{children:s.jsxs(Ge,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=l):l=t[7],l}function Ui(){const t=N.c(3),[e,n]=A.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Se,{tooltip:"Connections",onClick:()=>{J("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(Ps,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx($s,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function qi(){const t=N.c(3),[e,n]=A.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ge,{delayDuration:300,children:[s.jsx(Fe,{asChild:!0,children:s.jsx(ce,{"aria-label":"Connections",onClick:()=>{J("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(Ps,{className:"size-4"})})}),s.jsx(He,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx($s,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function Wi(){const t=N.c(7),e=Le(),{org:n}=de();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(tt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let l;return t[5]!==r?(l=s.jsxs(Se,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=l):l=t[6],l}function Ki(){const t=N.c(9),e=Le(),{org:n}=de();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(tt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(Fe,{asChild:!0,children:s.jsx(ce,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(He,{side:"top",children:"Settings"}),t[6]=l):l=t[6];let a;return t[7]!==i?(a=s.jsxs(Ge,{delayDuration:300,children:[i,l]}),t[7]=i,t[8]=a):a=t[8],a}function Vi(){const t=N.c(7),{state:e}=Be();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Fi,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ae,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Tt,{})})}),t[1]=i):i=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ae,{children:s.jsx(Ui,{})}),t[2]=l):l=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ae,{children:s.jsx(Li,{})}),t[3]=a):a=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ae,{children:s.jsx(Wi,{})}),t[4]=c):c=t[4];let d;return t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(Ct,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs(Ae,{children:[i,l,a,c,s.jsx(ae,{children:s.jsx(It,{})})]})]}),t[5]=d):d=t[5],d}let r;return t[6]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ct,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Ae,{children:s.jsx(ae,{children:s.jsx(It,{})})})}),s.jsx(Ki,{}),s.jsx(Bi,{}),s.jsx(Tt,{}),s.jsx(qi,{}),s.jsx(Gi,{})]})}),t[6]=r):r=t[6],r}function Yi(){const t=N.c(8),e=Le(),{org:n}=de(),{setOpenMobile:r}=Be();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Ae,{children:s.jsx(ae,{children:s.jsx(It,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(tt,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==i?(a=s.jsx(Ct,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(ce,{"aria-label":"Settings",onClick:i,children:l})]})}),t[6]=i,t[7]=a):a=t[7],a}function ot(t){const e=N.c(15),{className:n,wrapperClassName:r,children:o}=t,[i,l]=A.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&l(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const c=a;let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=b=>{const j=b.currentTarget;l(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=d):d=e[1];const u=d;let m;e[2]!==r?(m=W("relative",r),e[2]=r,e[3]=m):m=e[3];let f;e[4]!==o||e[5]!==n?(f=s.jsx("div",{ref:c,onScroll:u,className:n,children:o}),e[4]=o,e[5]=n,e[6]=f):f=e[6];const h=i?"opacity-100":"opacity-0";let x;e[7]!==h?(x=W("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=x):x=e[8];let p;e[9]!==x?(p=s.jsx("div",{"aria-hidden":!0,className:x}),e[9]=x,e[10]=p):p=e[10];let g;return e[11]!==m||e[12]!==f||e[13]!==p?(g=s.jsxs("div",{className:m,children:[f,p]}),e[11]=m,e[12]=f,e[13]=p,e[14]=g):g=e[14],g}function Xi(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let l;e[0]!==i||e[1]!==n?(l=n?s.jsx(Qi,{virtualMcpId:n,size:i}):s.jsx(Je,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==o?(a=o&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(Bo,{size:10,className:"text-white"})}),e[3]=o,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function Qi(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=zt(n);if(!o){let a;return e[0]!==r?(a=s.jsx(Je,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const i=o.icon??null;let l;return e[2]!==o.title||e[3]!==r||e[4]!==i?(l=s.jsx(Je,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=l):l=e[5],l}function ns(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=A.useState(""),{org:l}=de(),{setTaskId:a}=Is(),c=Ds();let d,u,m;e[0]!==l.id||e[1]!==o?(m=o.trim(),u=$t,d=At.globalSearch(l.id,m),e[0]=l.id,e[1]=o,e[2]=d,e[3]=u,e[4]=m):(d=e[2],u=e[3],m=e[4]);const f=n&&m.length>0;let h;e[5]!==c||e[6]!==m?(h=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=h):h=e[7];let x;e[8]!==d||e[9]!==f||e[10]!==h?(x={queryKey:d,enabled:f,queryFn:h,staleTime:1e4},e[8]=d,e[9]=f,e[10]=h,e[11]=x):x=e[11];const{data:p,isFetching:g}=u(x);let b;e[12]!==p?.items?(b=p?.items??[],e[12]=p?.items,e[13]=b):b=e[13];const j=b;let S;e[14]!==r?(S=k=>{k||i(""),r(k)},e[14]=r,e[15]=S):S=e[15];const y=S;let C;e[16]!==y||e[17]!==a?(C=k=>{y(!1),a(k.id,k.virtual_mcp_id??void 0)},e[16]=y,e[17]=a,e[18]=C):C=e[18];const w=C;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(Po,{className:"sr-only",children:[s.jsx(zo,{children:"Search"}),s.jsx(Do,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let I;e[20]!==o?(I=s.jsx(Ho,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=I):I=e[21];let O;e[22]!==w||e[23]!==g||e[24]!==j||e[25]!==m?(O=m?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Eo,{children:"No results."}):j.map(k=>k.type==="thread"?s.jsxs(Fo,{value:`thread:${k.id}:${k.title}`,onSelect:()=>w(k),className:"gap-2.5",children:[s.jsx(Xi,{virtualMcpId:k.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:k.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(k.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${k.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=w,e[23]=g,e[24]=j,e[25]=m,e[26]=O):O=e[26];let T;e[27]!==O?(T=s.jsx(Go,{children:O}),e[27]=O,e[28]=T):T=e[28];let z;e[29]!==I||e[30]!==T?(z=s.jsxs(Mo,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(Lo,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[I,T]})]}),e[29]=I,e[30]=T,e[31]=z):z=e[31];let $;return e[32]!==y||e[33]!==n||e[34]!==z?($=s.jsx(Ro,{open:n,onOpenChange:y,children:z}),e[32]=y,e[33]=n,e[34]=z,e[35]=$):$=e[35],$}function Ji(t){return t==="owner"||t==="admin"}function Zi(){const t=N.c(11),{locator:e}=de(),n=Uo(),{data:r}=ve.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=At.members(e),t[0]=e,t[1]=i):i=t[1];let l;t[2]!==n?(l=()=>n.organization.listMembers(),t[2]=n,t[3]=l):l=t[3];const a=!!o;let c;t[4]!==i||t[5]!==l||t[6]!==a?(c={queryKey:i,queryFn:l,enabled:a,staleTime:6e4},t[4]=i,t[5]=l,t[6]=a,t[7]=c):c=t[7];const{data:d}=$t(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(h=>h.userId===o)?.role;u=Ji(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var Nt,ht="HoverCard",[Qs]=An(ht,[ps]),gt=ps(),[el,bt]=Qs(ht),Js=t=>{const{__scopeHoverCard:e,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:l=700,closeDelay:a=300}=t,c=gt(e),d=A.useRef(0),u=A.useRef(0),m=A.useRef(!1),f=A.useRef(!1),[h,x]=Rn({prop:r,defaultProp:o??!1,onChange:i,caller:ht}),p=A.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>x(!0),l)},[l,x]),g=A.useCallback(()=>{clearTimeout(d.current),!m.current&&!f.current&&(u.current=window.setTimeout(()=>x(!1),a))},[a,x]),b=A.useCallback(()=>x(!1),[x]);return A.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),s.jsx(el,{scope:e,open:h,onOpenChange:x,onOpen:p,onClose:g,onDismiss:b,hasSelectionRef:m,isPointerDownOnContentRef:f,children:s.jsx(En,{...c,children:n})})};Js.displayName=ht;var Zs="HoverCardTrigger",en=A.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=bt(Zs,n),i=gt(n);return s.jsx(Tn,{asChild:!0,...i,children:s.jsx(On.a,{"data-state":o.open?"open":"closed",...r,ref:e,onPointerEnter:Oe(t.onPointerEnter,ct(o.onOpen)),onPointerLeave:Oe(t.onPointerLeave,ct(o.onClose)),onFocus:Oe(t.onFocus,o.onOpen),onBlur:Oe(t.onBlur,o.onClose),onTouchStart:Oe(t.onTouchStart,l=>l.preventDefault())})})});en.displayName=Zs;var Gt="HoverCardPortal",[tl,sl]=Qs(Gt,{forceMount:void 0}),tn=t=>{const{__scopeHoverCard:e,forceMount:n,children:r,container:o}=t,i=bt(Gt,e);return s.jsx(tl,{scope:e,forceMount:n,children:s.jsx(hs,{present:n||i.open,children:s.jsx(Mn,{asChild:!0,container:o,children:r})})})};tn.displayName=Gt;var at="HoverCardContent",sn=A.forwardRef((t,e)=>{const n=sl(at,t.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=t,i=bt(at,t.__scopeHoverCard);return s.jsx(hs,{present:r||i.open,children:s.jsx(nl,{"data-state":i.open?"open":"closed",...o,onPointerEnter:Oe(t.onPointerEnter,ct(i.onOpen)),onPointerLeave:Oe(t.onPointerLeave,ct(i.onClose)),ref:e})})});sn.displayName=at;var nl=A.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,...a}=t,c=bt(at,n),d=gt(n),u=A.useRef(null),m=$n(e,u),[f,h]=A.useState(!1);return A.useEffect(()=>{if(f){const x=document.body;return Nt=x.style.userSelect||x.style.webkitUserSelect,x.style.userSelect="none",x.style.webkitUserSelect="none",()=>{x.style.userSelect=Nt,x.style.webkitUserSelect=Nt}}},[f]),A.useEffect(()=>{if(u.current){const x=()=>{h(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",x),()=>{document.removeEventListener("pointerup",x),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),A.useEffect(()=>{u.current&&il(u.current).forEach(p=>p.setAttribute("tabindex","-1"))}),s.jsx(Pn,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Oe(i,x=>{x.preventDefault()}),onDismiss:c.onDismiss,children:s.jsx(zn,{...d,...a,onPointerDown:Oe(a.onPointerDown,x=>{x.currentTarget.contains(x.target)&&h(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:m,style:{...a.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),rl="HoverCardArrow",ol=A.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=gt(n);return s.jsx(Dn,{...o,...r,ref:e})});ol.displayName=rl;function ct(t){return e=>e.pointerType==="touch"?void 0:t()}function il(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var ll=Js,al=en,cl=tn,dl=sn;function ul(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(ll,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=r):r=e[3],r}function ml(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(al,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function fl(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,align:o,sideOffset:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"center":o,a=i===void 0?4:i;let c;e[5]!==n?(c=W("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==r||e[9]!==a||e[10]!==c?(d=s.jsx(cl,{"data-slot":"hover-card-portal",children:s.jsx(dl,{"data-slot":"hover-card-content",align:l,sideOffset:a,className:c,...r})}),e[7]=l,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function nn(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:l,onToggleOrgPin:a,onHideGroup:c}=t;let d;e[0]!==i||e[1]!==n?(d=()=>i(n),e[0]=i,e[1]=n,e[2]=d):d=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ee,{size:14,className:"mr-2"}),e[3]=u):u=e[3];let m;e[4]!==d?(m=s.jsxs(nt,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==l||e[7]!==n?(f=()=>l(n),e[6]=l,e[7]=n,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(tt,{size:14,className:"mr-2"}),e[9]=h):h=e[9];let x;e[10]!==f?(x=s.jsxs(nt,{onSelect:f,children:[h,"Settings"]}),e[10]=f,e[11]=x):x=e[11];let p;e[12]!==o||e[13]!==r||e[14]!==a||e[15]!==n?(p=o&&s.jsxs(s.Fragment,{children:[s.jsx(Qt,{}),s.jsxs(nt,{onSelect:()=>a(n,!r),children:[s.jsx(tr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=a,e[15]=n,e[16]=p):p=e[16];let g;e[17]!==r||e[18]!==c||e[19]!==n?(g=!r&&s.jsxs(s.Fragment,{children:[s.jsx(Qt,{}),s.jsxs(nt,{onSelect:()=>c(n),children:[s.jsx(Zr,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=g):g=e[20];let b;return e[21]!==m||e[22]!==x||e[23]!==p||e[24]!==g?(b=s.jsxs(s.Fragment,{children:[m,x,p,g]}),e[21]=m,e[22]=x,e[23]=p,e[24]=g,e[25]=b):b=e[25],b}function Lt(t){const e=N.c(12),{onClick:n,isFetching:r,indented:o}=t,i=o?"-ml-4 pl-6 pr-2":"px-2";let l;e[0]!==i?(l=W("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",i,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=i,e[1]=l):l=e[1];let a;e[2]!==r?(a=r&&s.jsx(ms,{size:14,className:"animate-spin"}),e[2]=r,e[3]=a):a=e[3];const c=r?"Loading…":"Show more";let d;e[4]!==c?(d=s.jsx("span",{children:c}),e[4]=c,e[5]=d):d=e[5];let u;return e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==a||e[10]!==d?(u=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:l,children:[a,d]}),e[6]=r,e[7]=n,e[8]=l,e[9]=a,e[10]=d,e[11]=u):u=e[11],u}function xl(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function pl(t){return t.member==="mine"&&!t.currentUserId}const rn=4;let lt=0;const Ot=[];function hl(){for(;lt<rn&&Ot.length>0;){const t=Ot.shift();t&&t()}}function on(t){return new Promise((e,n)=>{const r=()=>{lt++,t().then(e,n).finally(()=>{lt--,hl()})};lt<rn?r():Ot.push(r)})}const jt=10;function rs(t,e,n,r,o){const i={hidden:!1};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const l={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(l.status=e),l}function gl(t,e,n,r){let o=0;for(const i of t)Bt(i,e,n,r)&&o++;return o}function _t(t,e,n,r){return gl(t,e,n,r)}function bl(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&Bt(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function jl(t,e){return!!(t>=jt||t===0&&e)}function os(t,e){return t<e}function vl(t,e){return e===!1?!1:e===!0?!0:t}function Bt(t,e,n,r){return!(t.hidden||e==="agent"&&t.virtual_mcp_id!==n||e==="status"&&(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const dt=new Map,it=new Map;function Sl(t,e){return e?t>=jt?!0:null:!1}function is(t){return dt.get(t)}function yl(t,e){dt.set(t,e)}function Nl(t,e,n){const r=dt.get(t);if(r!==void 0){n(r);return}let o=it.get(t);o||(o=on(e).then(i=>(dt.set(t,i),it.delete(t),i)).catch(()=>(it.delete(t),Promise.reject(new Error("group probe failed")))),it.set(t,o)),o.then(n,()=>n(!1))}function ls(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===jt,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function _l(t,e,n,r,o){let i=0;for(const l of t)e.has(l.id)||Bt(l,n,r,o)&&i++;return i}function ln(t,e,n,r){const o=N.c(8),{org:i}=de(),l=xl(i.id,t,e,n);let a;o[0]!==n?(a=pl(n),o[0]=n,o[1]=a):a=o[1];const c=a,[d,u]=A.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==l&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const m=ar(),{threads:f,hasMore:h}=ks(),x=r??_t(f,t,e,n),p=jl(x,h),g=Sl(x,h),b=Ds();if(d.identity===l&&d.serverHasMore===null){const _=g??is(l);_!==void 0&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:_})}!c&&d.identity===l&&d.serverHasMore===null&&g===null&&is(l)===void 0&&d.probeSubscribedIdentity!==l&&(u(_=>_.identity===l?{..._,isProbing:!0,probeSubscribedIdentity:l}:_),Nl(l,async()=>{const _=rs(t,e,0,n,1),I=await b.call("COLLECTION_THREADS_LIST",_),{totalCount:O}=ls(I),T=_t(m.threads.get(),t,e,n);return O===void 0?!1:os(T,O)},_=>{u(I=>I.identity!==l?I:{...I,isProbing:!1,serverHasMore:_})}));const S=async function(){if(d.isFetching||d.isProbing||c)return;const I=l;u(O=>O.identity===I?{...O,isFetching:!0}:O);try{const O=_t(f,t,e,n),T=rs(t,e,O,n,jt),z=await on(()=>b.call("COLLECTION_THREADS_LIST",T)),{items:$,hasMore:k,totalCount:R}=ls(z),L=new Set(f.map(Cl)),H=_l($,L,t,e,n),M=O;m.mergeThreads($),u(E=>{if(E.identity!==I)return E;let D;return R!==void 0?D=os(M+H,R):D=$.length===0||H===0?!1:k,yl(I,D),{...E,isFetching:!1,serverHasMore:D}})}catch(O){const T=O,z=T instanceof Error?T.message:String(T);Te.error(`Could not load more tasks: ${z}`),u($=>$.identity===I?{...$,isFetching:!1}:$)}},y=d.isFetching||d.isProbing,C=!c&&!y&&vl(p,d.serverHasMore);let w;return o[2]!==y||o[3]!==S||o[4]!==C||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(w={hasMore:C,isFetching:y,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:S},o[2]=y,o[3]=S,o[4]=C,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=w):w=o[7],w}function Cl(t){return t.id}function an(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:l,onArchiveTask:a,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:h,sortable:x,groupVisibleCount:p}=t,g=m===void 0?!1:m,b=f===void 0?!1:f,j=zt(n),S=r[0];let y;e[0]!==S||e[1]!==c||e[2]!==l||e[3]!==n?(y=()=>{S?l(S):c(n)},e[0]=S,e[1]=c,e[2]=l,e[3]=n,e[4]=y):y=e[4];const C=y,w=x?.isDragging?!1:void 0;let _;e[5]!==x?.isDragging||e[6]!==n?(_=V=>{x?.isDragging||V&&J("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=x?.isDragging,e[6]=n,e[7]=_):_=e[7];const I=!!(S&&o&&S.id===o),O=x?"Drag to reorder":void 0;let T;e[8]!==x?(T=x?{...x.attributes,...x.listeners}:{},e[8]=x,e[9]=T):T=e[9];const z=x&&"cursor-pointer active:cursor-grabbing touch-none",$=x?.isDragging&&"cursor-grabbing";let k;e[10]!==$||e[11]!==z?(k=W("group-data-[state=collapsed]/sidebar:!size-10 group-data-[state=collapsed]/sidebar:!max-w-none group-data-[state=collapsed]/sidebar:!overflow-visible group-data-[state=collapsed]/sidebar:[&_svg]:opacity-100",z,$),e[10]=$,e[11]=z,e[12]=k):k=e[12];const R=j?.icon??null,L=j?.title??"?";let H;e[13]!==R||e[14]!==L?(H=s.jsx(Je,{icon:R,name:L,size:"sm+",className:"rounded-lg"}),e[13]=R,e[14]=L,e[15]=H):H=e[15];let M;e[16]!==C||e[17]!==k||e[18]!==H||e[19]!==I||e[20]!==O||e[21]!==T?(M=s.jsx(ae,{children:s.jsx(Ms,{asChild:!0,children:s.jsx(ml,{asChild:!0,children:s.jsx(Se,{onClick:C,isActive:I,title:O,...T,className:k,children:H})})})}),e[16]=C,e[17]=k,e[18]=H,e[19]=I,e[20]=O,e[21]=T,e[22]=M):M=e[22];const E=h??wl;let D;e[23]!==b||e[24]!==g||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==E||e[29]!==n?(D=s.jsx(Rs,{className:"w-56",children:s.jsx(nn,{virtualMcpId:n,isOrgPinned:g,canManageOrgPin:b,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:E,onHideGroup:u})}),e[23]=b,e[24]=g,e[25]=u,e[26]=c,e[27]=d,e[28]=E,e[29]=n,e[30]=D):D=e[30];let q;e[31]!==M||e[32]!==D?(q=s.jsxs(Es,{children:[M,D]}),e[31]=M,e[32]=D,e[33]=q):q=e[33];const B=j?.title??"Agent";let K;e[34]!==B?(K=s.jsx("span",{className:"truncate",children:B}),e[34]=B,e[35]=K):K=e[35];let G;e[36]!==c||e[37]!==n?(G=()=>c(n),e[36]=c,e[37]=n,e[38]=G):G=e[38];let Y;e[39]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx(Ee,{size:14}),e[39]=Y):Y=e[39];let U;e[40]!==G?(U=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:G,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:Y}),e[40]=G,e[41]=U):U=e[41];let X;e[42]!==K||e[43]!==U?(X=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[K,U]}),e[42]=K,e[43]=U,e[44]=X):X=e[44];let se;e[45]!==o||e[46]!==i||e[47]!==p||e[48]!==a||e[49]!==l||e[50]!==r||e[51]!==n?(se=s.jsx(kl,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:p,onSelectTask:l,onArchiveTask:a}),e[45]=o,e[46]=i,e[47]=p,e[48]=a,e[49]=l,e[50]=r,e[51]=n,e[52]=se):se=e[52];let Q;e[53]!==X||e[54]!==se?(Q=s.jsxs(fl,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[X,se]}),e[53]=X,e[54]=se,e[55]=Q):Q=e[55];let te;return e[56]!==q||e[57]!==Q||e[58]!==w||e[59]!==_?(te=s.jsxs(ul,{open:w,openDelay:120,closeDelay:150,onOpenChange:_,children:[q,Q]}),e[56]=q,e[57]=Q,e[58]=w,e[59]=_,e[60]=te):te=e[60],te}function wl(){}function kl(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:l,onSelectTask:a,onArchiveTask:c}=t,d=ln("agent",n,i,l);let u;return e[0]!==o||e[1]!==c||e[2]!==a||e[3]!==d||e[4]!==r?(u=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:r.length===0&&!d.hasMore&&!d.isFetching?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(Ft,{task:m,isActive:o===m.id,onClick:()=>a(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(Lt,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=a,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function Il(t,e,n,r,o,i,l){const a=N.c(18),c=l===void 0?"expanded":l;let d;a[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},a[0]=d):d=a[0];let u;a[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:Rr},a[1]=u):u=a[1];const m=zr(Vt(Mr,d),Vt(Dr,u));let f;a[2]!==r||a[3]!==o||a[4]!==e||a[5]!==t?(f=gr(t,e,r,o),a[2]=r,a[3]=o,a[4]=e,a[5]=t,a[6]=f):f=a[6];const h=f;let x;a[7]!==i||a[8]!==n||a[9]!==o||a[10]!==e||a[11]!==h||a[12]!==c?(x=b=>{const{active:j,over:S}=b;if(!S||j.id===S.id)return;const y=String(j.id),C=String(S.id);if(!br(y,C,o))return;const w=jr(h,y,C),_=vr(e,n,o,w);e==="org"?Sr(n.orgId,_):yr(n,_),J("sidebar_group_reordered",{virtual_mcp_id:y,over_virtual_mcp_id:C,surface:c,section:e}),i()},a[7]=i,a[8]=n,a[9]=o,a[10]=e,a[11]=h,a[12]=c,a[13]=x):x=a[13];const p=x;let g;return a[14]!==p||a[15]!==m||a[16]!==h?(g={sensors:m,sortableIds:h,handleDragEnd:p},a[14]=p,a[15]=m,a[16]=h,a[17]=g):g=a[17],g}function Tl(t){const e=N.c(2),{collapsed:n}=t;if(n===void 0?!1:n){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-auto my-1 h-px w-6 shrink-0 bg-border"}),e[0]=i):i=e[0],i}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"my-1.5 h-px w-full shrink-0 bg-border"}),e[1]=o):o=e[1],o}function Ol(t){const e=N.c(12),{id:n,children:r}=t;let o;e[0]!==n?(o={id:n},e[0]=n,e[1]=o):o=e[1];const{attributes:i,listeners:l,setNodeRef:a,transform:c,transition:d,isDragging:u}=Lr(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==d){const h={transform:Br.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:a,style:h,isDragging:u,attributes:i,listeners:l}),e[2]=i,e[3]=r,e[4]=u,e[5]=l,e[6]=a,e[7]=c,e[8]=d,e[9]=m}else m=e[9];let f;return e[10]!==m?(f=s.jsx(s.Fragment,{children:m}),e[10]=m,e[11]=f):f=e[11],f}function as(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:l,onReorder:a,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:h,handleDragEnd:x}=Il(r,n,o,i,l,a,c);if(r.length===0)return null;const p=h;let g;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==h){let S;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==h?(S=y=>{const C=d(y);return h.includes(y.virtualMcpId)?s.jsx(Ol,{id:y.virtualMcpId,children:w=>{const{setNodeRef:_,style:I,isDragging:O,attributes:T,listeners:z}=w;return s.jsx("div",{ref:_,style:I,className:W(O&&"opacity-50"),children:u(C,{attributes:T,listeners:z,isDragging:O})})}},y.virtualMcpId):s.jsx("div",{children:m(C)},y.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=h,e[10]=S):S=e[10],g=r.map(S),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=h,e[5]=g}else g=e[5];let b;e[11]!==p||e[12]!==g?(b=s.jsx(Er,{items:p,strategy:Fr,children:g}),e[11]=p,e[12]=g,e[13]=b):b=e[13];let j;return e[14]!==x||e[15]!==f||e[16]!==b?(j=s.jsx(Hr,{sensors:f,collisionDetection:Gr,onDragEnd:x,children:b}),e[14]=x,e[15]=f,e[16]=b,e[17]=j):j=e[17],j}function cn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==a){const{decopilot:h,orgPinned:x,user:p,toolCallRuns:g}=Nr(n,o,i),b=x.length>0&&p.length>0;let j;e[11]!==o||e[12]!==l||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==a?(j={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=l,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=a,e[19]=j):j=e[19];const S=j;let y;e[20]!==c||e[21]!==b?(y=b&&s.jsx(Tl,{collapsed:c}),e[20]=c,e[21]=b,e[22]=y):y=e[22],f=s.jsxs(s.Fragment,{children:[h&&m(d(h)),s.jsx(as,{section:"org",groups:x,...S}),y,s.jsx(as,{section:"user",groups:p,...S}),g&&m(d(g))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=l,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=a,e[10]=f}else f=e[10];return f}function Al(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(cn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:a,renderFixed:Pl,renderSortable:$l}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function $l(t,e){return s.jsx(an,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function Pl(t){return s.jsx(an,{...t},t.virtualMcpId)}function dn(t){const e=N.c(41),{virtualMcpId:n,isActive:r,threadCount:o,onOpen:i,onNewTask:l,onShowSettings:a,onHideGroup:c,isOrgPinned:d,canManageOrgPin:u,onToggleOrgPin:m,sortable:f}=t,h=d===void 0?!1:d,x=u===void 0?!1:u,p=zt(n),g=f?.isDragging??!1,b=p?.title??"Agent";let j;e[0]!==f?(j=f?{...f.attributes,...f.listeners}:{},e[0]=f,e[1]=j):j=e[1];let S;e[2]!==i||e[3]!==n?(S=()=>i(n),e[2]=i,e[3]=n,e[4]=S):S=e[4];let y;e[5]!==i||e[6]!==f?.listeners||e[7]!==n?(y=D=>{f?.listeners?.onKeyDown?.(D),!D.defaultPrevented&&D.target===D.currentTarget&&D.key==="Enter"&&(D.preventDefault(),i(n))},e[5]=i,e[6]=f?.listeners,e[7]=n,e[8]=y):y=e[8];const C=f&&"touch-none active:cursor-grabbing",w=r?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/60",_=g&&"shadow-md bg-accent/40 cursor-grabbing";let I;e[9]!==C||e[10]!==w||e[11]!==_?(I=W("group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium transition-colors","cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",C,w,_),e[9]=C,e[10]=w,e[11]=_,e[12]=I):I=e[12];const O=p?.icon??null;let T;e[13]!==O||e[14]!==b?(T=s.jsx(Je,{icon:O,name:b,size:"2xs"}),e[13]=O,e[14]=b,e[15]=T):T=e[15];let z;e[16]!==b?(z=s.jsx("span",{className:"flex-1 truncate",children:b}),e[16]=b,e[17]=z):z=e[17];let $;e[18]!==o?($=typeof o=="number"&&o>0&&s.jsx("span",{className:"shrink-0 size-7 flex items-center justify-center text-xs text-muted-foreground tabular-nums",children:o}),e[18]=o,e[19]=$):$=e[19];let k;e[20]!==T||e[21]!==z||e[22]!==$||e[23]!==j||e[24]!==S||e[25]!==y||e[26]!==I?(k=s.jsxs("div",{...j,role:"button",tabIndex:0,onClick:S,onKeyDown:y,className:I,children:[T,z,$]}),e[20]=T,e[21]=z,e[22]=$,e[23]=j,e[24]=S,e[25]=y,e[26]=I,e[27]=k):k=e[27];const R=k;let L;e[28]!==R?(L=s.jsx(Ms,{asChild:!0,children:R}),e[28]=R,e[29]=L):L=e[29];const H=m??zl;let M;e[30]!==x||e[31]!==h||e[32]!==c||e[33]!==l||e[34]!==a||e[35]!==H||e[36]!==n?(M=s.jsx(Rs,{className:"w-56",children:s.jsx(nn,{virtualMcpId:n,isOrgPinned:h,canManageOrgPin:x,onNewTaskInGroup:l,onShowSettings:a,onToggleOrgPin:H,onHideGroup:c})}),e[30]=x,e[31]=h,e[32]=c,e[33]=l,e[34]=a,e[35]=H,e[36]=n,e[37]=M):M=e[37];let E;return e[38]!==L||e[39]!==M?(E=s.jsxs(Es,{children:[L,M]}),e[38]=L,e[39]=M,e[40]=E):E=e[40],E}function zl(){}function cs(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(cn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"expanded",renderGroup:a,renderFixed:Ml,renderSortable:Dl}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function Dl(t,e){return s.jsx(dn,{...t,sortable:e},t.virtualMcpId)}function Ml(t){return s.jsx(dn,{...t},t.virtualMcpId)}const Rl="sidebar.group.expanded.";function El(t,e){const n=N.c(3),[r,o]=ut(`${Rl}${t}`,e);let i;return n[0]!==r||n[1]!==o?(i=[r,o],n[0]=r,n[1]=o,n[2]=i):i=n[2],i}function Fl(t){const e=N.c(18),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=ln("status",n,a),[h,x]=A.useState(!1);!h&&r.length===0&&f===!0&&!c&&!d&&(x(!0),queueMicrotask(()=>{u()}));let p;if(e[0]!==o||e[1]!==a||e[2]!==l||e[3]!==i||e[4]!==r){let j;e[6]!==o||e[7]!==a||e[8]!==l||e[9]!==i?(j=S=>s.jsx(Ft,{task:S,isActive:o===S.id,onClick:()=>i(S),onArchive:S.created_by===a.currentUserId?()=>l(S):void 0,showAutomationBadge:!!S.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},S.id),e[6]=o,e[7]=a,e[8]=l,e[9]=i,e[10]=j):j=e[10],p=r.map(j),e[0]=o,e[1]=a,e[2]=l,e[3]=i,e[4]=r,e[5]=p}else p=e[5];let g;e[11]!==m||e[12]!==c||e[13]!==u?(g=(m||c)&&s.jsx(Lt,{onClick:()=>{u()},isFetching:c,indented:!0}),e[11]=m,e[12]=c,e[13]=u,e[14]=g):g=e[14];let b;return e[15]!==p||e[16]!==g?(b=s.jsxs(s.Fragment,{children:[p,g]}),e[15]=p,e[16]=g,e[17]=b):b=e[17],b}function Hl(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,c=Wo[n],d=c.icon,[u,m]=El(`status-${n}`,!1);let f;e[0]!==u||e[1]!==m?(f=function(){m(!u)},e[0]=u,e[1]=m,e[2]=f):f=e[2];const h=f;let x;e[3]!==h?(x=_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),h())},e[3]=h,e[4]=x):x=e[4];let p;e[5]!==d||e[6]!==c.iconClassName?(p=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=p):p=e[7];let g;e[8]!==u?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(Fs,{size:14}):s.jsx(Et,{size:14})}),e[8]=u,e[9]=g):g=e[9];let b;e[10]!==p||e[11]!==g?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[p,g]}),e[10]=p,e[11]=g,e[12]=b):b=e[12];let j;e[13]!==c.label?(j=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=j):j=e[14];let S;e[15]!==r.length?(S=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[15]=r.length,e[16]=S):S=e[16];let y;e[17]!==u||e[18]!==h||e[19]!==x||e[20]!==b||e[21]!==j||e[22]!==S?(y=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:h,onKeyDown:x,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[b,j,S]}),e[17]=u,e[18]=h,e[19]=x,e[20]=b,e[21]=j,e[22]=S,e[23]=y):y=e[23];let C;e[24]!==o||e[25]!==u||e[26]!==a||e[27]!==l||e[28]!==i||e[29]!==n||e[30]!==r?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(Fl,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a})}),e[24]=o,e[25]=u,e[26]=a,e[27]=l,e[28]=i,e[29]=n,e[30]=r,e[31]=C):C=e[31];let w;return e[32]!==y||e[33]!==C?(w=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[y,C]}),e[32]=y,e[33]=C,e[34]=w):w=e[34],w}function ds(t){const e=N.c(31),{threads:n,groupBy:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a,hasMore:c,isFetchingMore:d,onLoadMore:u}=t;if(r==="status"){let x;if(e[0]!==o||e[1]!==a||e[2]!==l||e[3]!==i||e[4]!==n){let g;e[6]!==o||e[7]!==a||e[8]!==l||e[9]!==i?(g=b=>s.jsx(Hl,{status:b.status,threads:b.threads,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a},b.status),e[6]=o,e[7]=a,e[8]=l,e[9]=i,e[10]=g):g=e[10],x=_r(n).map(g),e[0]=o,e[1]=a,e[2]=l,e[3]=i,e[4]=n,e[5]=x}else x=e[5];let p;return e[11]!==x?(p=s.jsx(s.Fragment,{children:x}),e[11]=x,e[12]=p):p=e[12],p}let m;if(e[13]!==o||e[14]!==a||e[15]!==l||e[16]!==i||e[17]!==n){let x;e[19]!==o||e[20]!==a||e[21]!==l||e[22]!==i?(x=p=>s.jsx(Ft,{task:p,isActive:o===p.id,onClick:()=>i(p),onArchive:p.created_by===a.currentUserId?()=>l(p):void 0,showAutomationBadge:!!p.trigger_id,showAgentIcon:!0},p.id),e[19]=o,e[20]=a,e[21]=l,e[22]=i,e[23]=x):x=e[23],m=n.map(x),e[13]=o,e[14]=a,e[15]=l,e[16]=i,e[17]=n,e[18]=m}else m=e[18];let f;e[24]!==c||e[25]!==d||e[26]!==u?(f=(c||d)&&s.jsx(Lt,{onClick:u,isFetching:d}),e[24]=c,e[25]=d,e[26]=u,e[27]=f):f=e[27];let h;return e[28]!==m||e[29]!==f?(h=s.jsxs(s.Fragment,{children:[m,f]}),e[28]=m,e[29]=f,e[30]=h):h=e[30],h}function Gl(t){const e=N.c(19),{label:n,open:r,onToggle:o,count:i,action:l,actionSlot:a,controlsId:c}=t;let d;e[0]!==r?(d=r?s.jsx(Fs,{size:12,className:"shrink-0"}):s.jsx(Et,{size:12,className:"shrink-0"}),e[0]=r,e[1]=d):d=e[1];let u;e[2]!==n?(u=s.jsx("span",{className:"truncate",children:n}),e[2]=n,e[3]=u):u=e[3];let m;e[4]!==i?(m=typeof i=="number"&&i>0&&s.jsx("span",{className:"tabular-nums text-muted-foreground/60",children:i}),e[4]=i,e[5]=m):m=e[5];let f;e[6]!==c||e[7]!==o||e[8]!==r||e[9]!==d||e[10]!==u||e[11]!==m?(f=s.jsxs("button",{type:"button","aria-expanded":r,"aria-controls":c,onClick:o,className:"flex flex-1 min-w-0 items-center gap-1 text-sm font-medium text-muted-foreground/80 hover:text-foreground transition-colors focus-visible:outline-none",children:[d,u,m]}),e[6]=c,e[7]=o,e[8]=r,e[9]=d,e[10]=u,e[11]=m,e[12]=f):f=e[12];let h;e[13]!==l?(h=l&&s.jsxs("button",{type:"button",onClick:l.onClick,className:"shrink-0 flex items-center gap-0.5 text-sm font-medium text-muted-foreground/60 hover:text-foreground opacity-0 group-hover/section:opacity-100 focus-visible:opacity-100 transition-opacity focus-visible:outline-none",children:[l.label,l.icon]}),e[13]=l,e[14]=h):h=e[14];let x;return e[15]!==a||e[16]!==f||e[17]!==h?(x=s.jsxs("div",{className:"group/section flex items-center gap-1 px-2 pt-1 pb-0.5",children:[f,h,a]}),e[15]=a,e[16]=f,e[17]=h,e[18]=x):x=e[18],x}function Ll(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function Bl(t,e,n,r,o){const i=N.c(5),l=Ll(t,e,r,o),[a,c]=A.useState("");a!==l&&(Cr(t,e,n,r),c(l));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=wr(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const us={all:"All tasks",manual:"Chats",automation:"Automation"};function un({onNavigate:t}={}){const{data:e}=ve.useSession(),n=e?.user?.id,r=n??"anon",{org:o}=de(),i=Kn({connectionId:Vn,orgId:o.id,orgSlug:o.slug}),l=Yn(o.id).id,a=_s(),{liveToDev:c,devToLive:d}=Ur(a),u=Ts(a),m=Zi(),f=Xn(),[h,x]=A.useState({}),p=new Set(u),g={},b=[];for(const[v,P]of Object.entries(h))p.has(v)!==P?g[v]=P:b.push(v);b.length>0&&x(v=>{const P={...v};for(const F of b)delete P[F];return P});const j=(()=>{const v=new Set(u);for(const[P,F]of Object.entries(g))F?v.add(P):v.delete(P);return[...v]})(),S=new Set(j),{threads:y,hasMore:C,isFetchingMore:w,fetchNextPage:_}=ks(),I=y.filter(v=>!v.hidden),{hide:O}=ws(),T=Le(),z=kr(),{setTaskId:$,createNewTask:k}=Is(),R=xs({strict:!1}),L=Ao({select:v=>v.location.pathname}),H=L===`/${o.slug}`||L===`/${o.slug}/`,M=R.taskId??null,E=y.find(v=>v.id===M)?.virtual_mcp_id??null,D=()=>{t?.()},q=[...I].sort((v,P)=>(P.updated_at??"").localeCompare(v.updated_at??"")),[B,K]=A.useState("all"),[G,Y]=A.useState("flat"),[U,X]=A.useState(!0),[se,Q]=ut("sidebar-threads-scope-all",!1),[te,V]=A.useState(!1),[Z,re]=A.useState(!1),[ne,oe]=A.useState(0),ee=Ir(),$e=ne+ee,le={orgId:o.id,userId:r},ye={type:B,member:"mine",currentUserId:n??null},fe=bl(q,"agent",ye),qe=Bl(le,Tr(Or(q,l),d),l,j,$e),Pe=new Set(a.map(v=>v.id).filter(v=>!!v)),xe=qe.filter(v=>v.virtualMcpId===l||v.virtualMcpId===St||Pe.has(v.virtualMcpId)),pe=xe.filter(v=>v.virtualMcpId!==St),he=v=>n?v.filter(P=>P.created_by===n):[],me=v=>B==="automation"?v.filter(P=>!!P.trigger_id):B==="manual"?v.filter(P=>!P.trigger_id):v,ge=he(q),ze=me(ge),De=me(q),Ne=se?De:ze,be=v=>{if(n&&v.created_by&&v.created_by!==n)return;const P=v.id===M;if(O(v.id),!P)return;const F=ge.find(Re=>Re.id!==v.id&&Re.virtual_mcp_id===v.virtual_mcp_id);D(),F?$(F.id,F.virtual_mcp_id):T({to:"/$org",params:{org:o.slug}})},Ue=v=>{D(),$(v.id,v.virtual_mcp_id)},_e=v=>{J("sidebar_group_new_clicked",{virtual_mcp_id:v}),D(),k(v)},Ze=async()=>{const v=E??l;J("sidebar_new_thread_clicked",{virtual_mcp_id:v});const P=ge.find(F=>F.virtual_mcp_id===v&&F.title==="New chat");if(P){let F=!1;try{const Re=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:P.id,limit:1,offset:0}});F=((Re.structuredContent??Re).items?.length??0)===0}catch{}if(F){D(),$(P.id,v);return}}D(),k(v)},Me=v=>{if(v===l){D(),T({to:"/$org",params:{org:o.slug}});return}J("sidebar_agent_opened",{virtual_mcp_id:v}),D(),z(v)},Ce=v=>{J("sidebar_group_settings_clicked",{virtual_mcp_id:v}),D(),z(v,{search:{main:"instructions"}})},we=v=>{if(S.has(v))return;J("sidebar_group_hide_clicked",{virtual_mcp_id:v});const P=xe.find(F=>F.virtualMcpId===v);if(P)for(const F of P.threads)O(F.id);Ar(le,v,j),oe(F=>F+1)},We=async(v,P)=>{if(m&&g[v]===void 0){J("sidebar_group_org_pin_toggled",{virtual_mcp_id:v,pinned:P}),x(F=>({...F,[v]:P}));try{await f.update.mutateAsync({id:v,data:{pinned:P}})}catch{$r(le,v,!P),x(F=>{const Re={...F};return delete Re[v],Re})}}},ke=v=>{const P=v===l||v===St;return{isOrgPinned:P||S.has(v),canManageOrgPin:P?!1:m,onToggleOrgPin:P?void 0:We}},Ie=v=>({virtualMcpId:v.virtualMcpId,isActive:v.virtualMcpId===l?H:E===v.virtualMcpId,threadCount:fe.get(v.virtualMcpId)??0,onOpen:Me,onNewTask:_e,onShowSettings:Ce,onHideGroup:we,...ke(v.virtualMcpId)}),Ke=v=>{const P=me(he(v.threads)),F=c.get(v.virtualMcpId)??null;return{virtualMcpId:v.virtualMcpId,threads:P,devPartnerId:F,devGroupVisibleCount:F?fe.get(F)??0:0,activeTaskId:M,filters:ye,groupVisibleCount:fe.get(v.virtualMcpId)??0,onSelectTask:Ue,onArchiveTask:be,onNewTaskInGroup:_e,onShowSettings:Ce,onHideGroup:we,...ke(v.virtualMcpId)}},ue=B!=="all",{state:Ve,isMobile:Ye}=Be();if(Ve==="collapsed"&&!Ye){const v=xe.filter(P=>{const F=me(he(P.threads));return!(ue&&F.length===0)});return s.jsxs(s.Fragment,{children:[s.jsx(yt,{value:pe.length===0}),s.jsx(Ae,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(Al,{groups:v,orderScope:le,decopilotId:l,orgPinnedIds:j,onReorder:()=>oe(P=>P+1),renderGroup:P=>Ke(P)})})]})}const vt=s.jsx("button",{type:"button",onClick:()=>Q(v=>!v),className:"text-xs text-muted-foreground hover:text-foreground transition-colors px-1.5 py-0.5 rounded hover:bg-muted",children:se?"All":"Mine"}),st=v=>s.jsxs("div",{className:W("shrink-0 px-1 flex items-center justify-between",v?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(ce,{"aria-label":"Search threads",onClick:()=>{J("tasks_panel_search_opened"),re(!0),V(!0)},children:s.jsx(sr,{size:16})}),s.jsx(ce,{"aria-label":G==="flat"?"Group by status":"Show as flat list",title:G==="flat"?"Flat list":"Grouped by status",onClick:()=>{const P=G==="flat"?"status":"flat";J("tasks_panel_group_by_changed",{to_value:P}),Y(P)},children:G==="flat"?s.jsx(nr,{size:16}):s.jsx(rr,{size:16})}),!v&&s.jsxs(xt,{children:[s.jsx(Qe,{asChild:!0,children:s.jsxs(ce,{"aria-label":"Filter tasks",children:[s.jsx(Co,{size:16}),ue&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 ring-1 ring-sidebar pointer-events-none"})]})}),s.jsx(pt,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsx("div",{className:"flex flex-col gap-2",children:s.jsx(Ul,{label:"Type",children:s.jsxs(wo,{value:B,onValueChange:P=>{const F=P;F!==B&&J("tasks_panel_filter_changed",{to_value:F}),K(F)},children:[s.jsx(ko,{size:"sm",className:"w-full",children:s.jsx(Io,{})}),s.jsx(To,{children:Object.keys(us).map(P=>s.jsx(Oo,{value:P,children:us[P]},P))})]})})})})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[vt,s.jsx(ce,{"aria-label":"New thread",title:"New thread",onClick:()=>{Ze()},children:s.jsx(or,{size:16})})]})]});return Ye?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[s.jsx(yt,{value:pe.length===0}),st(!0),s.jsxs(Ko,{defaultValue:"threads",variant:"pill",className:"flex flex-col flex-1 min-h-0 gap-0",children:[s.jsxs(Vo,{variant:"pill",className:"shrink-0 mx-1 mb-2 w-[calc(100%-0.5rem)]",children:[s.jsx(Jt,{variant:"pill",value:"threads",children:"Threads"}),s.jsx(Jt,{variant:"pill",value:"agents",children:"Agents"})]}),s.jsx(Zt,{value:"threads",className:"flex-1 min-h-0 mt-1 flex flex-col",children:s.jsx(ot,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(ds,{threads:Ne,groupBy:G,activeTaskId:M,onSelectTask:Ue,onArchiveTask:be,filters:ye,hasMore:C,isFetchingMore:w,onLoadMore:()=>{_()}})})}),s.jsx(Zt,{value:"agents",className:"flex-1 min-h-0 mt-1 flex flex-col",children:s.jsx(ot,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(cs,{groups:pe,orderScope:le,decopilotId:l,orgPinnedIds:j,onReorder:()=>oe(v=>v+1),renderGroup:Ie})})})]}),Z&&s.jsx(ns,{open:te,onOpenChange:V})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[s.jsx(yt,{value:pe.length===0}),st(!1),s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:[s.jsx(ot,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(ds,{threads:Ne,groupBy:G,activeTaskId:M,onSelectTask:Ue,onArchiveTask:be,filters:ye,hasMore:C,isFetchingMore:w,onLoadMore:()=>{_()}})}),s.jsx("div",{className:"shrink-0 mx-2 my-2 border-b"}),s.jsxs("div",{className:"shrink-0",children:[s.jsx(Gl,{label:"Agents",open:U,onToggle:()=>X(v=>!v),count:pe.length,controlsId:"sidebar-section-agents",actionSlot:s.jsx(Hs,{compact:!0})}),s.jsx("div",{id:"sidebar-section-agents","aria-hidden":!U,className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:U?"1fr":"0fr"},children:s.jsx("div",{className:"overflow-hidden",children:s.jsx(ot,{className:"flex flex-col gap-0.5 max-h-[35vh] overflow-y-auto overscroll-contain",children:s.jsx(cs,{groups:pe,orderScope:le,decopilotId:l,orgPinnedIds:j,onReorder:()=>oe(v=>v+1),renderGroup:Ie})})})})]})]}),Z&&s.jsx(ns,{open:te,onOpenChange:V})]})}function Ul(t){const e=N.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}const ql=5,Wl=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function mn(){const t=N.c(3),{state:e}=Be();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:ql}).map(Yl)}),t[0]=o):o=t[0],o}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(je,{className:"size-6 rounded-md"}),s.jsx(je,{className:"size-6 rounded-md"}),s.jsx(je,{className:"size-6 rounded-md"})]}),s.jsx(je,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:Wl.map(Kl)})]}),t[2]=r):r=t[2],r}function Kl(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(je,{className:"size-5 rounded-full shrink-0"}),s.jsx(je,{className:W("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(Vl)})]},e)}function Vl(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(je,{className:"h-3 flex-1 rounded-sm"})},e)}function Yl(t,e){return s.jsx(je,{className:"size-10 rounded-lg mx-auto"},e)}function Xl(){const t=N.c(4),e=Gs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Vi,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(gs,{children:s.jsx(A.Suspense,{fallback:s.jsx(mn,{}),children:s.jsx(un,{})})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(Os,{children:s.jsx(Us,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Ql(t){const e=N.c(8),{onClose:n}=t,r=Gs();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Yi,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(mn,{}),e[1]=i):i=e[1];let l;e[2]!==n?(l=s.jsx(gs,{children:s.jsx(A.Suspense,{fallback:i,children:s.jsx(un,{onNavigate:n})})}),e[2]=n,e[3]=l):l=e[3];let a;return e[4]!==n||e[5]!==r||e[6]!==l?(a=s.jsx(Os,{children:s.jsx(hi,{sections:r,onClose:n,footer:o,additionalContent:l})}),e[4]=n,e[5]=r,e[6]=l,e[7]=a):a=e[7],a}const Jl="sidebar.open";function Zl(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(qo,{}),t[0]=e):e=t[0],e}function cd(){const t=N.c(24),e=Pt(),[n,r]=ut(Jl,!1),{width:o,wrapperRef:i,onStartResize:l,resetWidth:a}=Jo();let c;t[0]!==e?(c=e?s.jsxs(ie.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto_auto] items-center gap-2",children:[s.jsx(ie.LogoLink,{}),s.jsx(Xt,{}),s.jsx(Tt,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(ie.TogglesSlot,{}),s.jsx(ie.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(ie.CenterSlot,{}),s.jsx(ie.RightSlot,{})]}):s.jsxs(ie.Header,{children:[s.jsxs(ie.LeftColumn,{children:[s.jsx(ie.LogoLink,{}),s.jsx(Xt,{}),s.jsx(ie.TogglesSlot,{})]}),s.jsx(ie.CenterSlot,{}),s.jsxs(ie.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:s.jsx(ie.TabsSlot,{})}),s.jsx(ie.RightSlot,{})]})]}),t[0]=e,t[1]=c):c=t[1];const d=`${o}px`;let u;t[2]!==d?(u={"--sidebar-width":d,"--sidebar-width-icon":"3.5rem"},t[2]=d,t[3]=u):u=t[3];const m=u;let f;t[4]!==e||t[5]!==l||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Xl,{}),s.jsx(Yo,{onPointerDown:l,onDoubleClick:a})]}),t[4]=e,t[5]=l,t[6]=a,t[7]=f):f=t[7];let h;t[8]===Symbol.for("react.memo_cache_sentinel")?(h={background:"transparent",containerType:"inline-size"},t[8]=h):h=t[8];let x;t[9]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ln,{className:"flex flex-col",style:h,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(A.Suspense,{fallback:s.jsx(Zl,{}),children:s.jsx(Fn,{})})})})}),t[9]=x):x=t[9];let p;t[10]!==m||t[11]!==f||t[12]!==i?(p=s.jsxs(Bn,{ref:i,className:"flex-1 bg-sidebar relative min-h-0",style:m,children:[f,x]}),t[10]=m,t[11]=f,t[12]=i,t[13]=p):p=t[13];let g;t[14]!==e?(g=e&&s.jsx($o,{renderSidebar:ea}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==c||t[17]!==p||t[18]!==g?(b=s.jsx(jo,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,p,g]})}),t[16]=c,t[17]=p,t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==r||t[21]!==n||t[22]!==b?(j=s.jsx(cr,{children:s.jsx(ie.Provider,{children:s.jsx(Un,{open:n,onOpenChange:r,children:b})})}),t[20]=r,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function ea(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(Ql,{onClose:e})})})}export{cd as default};
@@ -1 +0,0 @@
1
- import{c as k,j as n,r as $,D as J,m as xe,l as Q,i as le,an as Z,t as U,K as te,k as se,B as Y,d as st,a6 as nt,E as it,a as ot}from"./index-BK387j8D.js";import{u as ge}from"./use-mobile-DUjtY1Or.js";import{u as rt}from"./useSuspenseQueries-erPqJTOK.js";import{i as lt,u as ae,m as at,a as ct,S as dt}from"./use-mcp-client-B7wTW6Za.js";import{u as mt,b as ut,v as ft,a as pt}from"./use-virtual-mcp-CKtNavH6.js";import{i as ht}from"./ChevronUp-CFXuZkVg.js";import{i as xt,A as ce,t as gt,ae as yt,F as bt,j as jt}from"./agent-icon-BM8MQ5be.js";import{s as ye}from"./Plus-D3xgmWdX.js";import{i as $e}from"./X-Dq3oJiz6.js";import{C as oe}from"./index-IRZqLymo.js";import{b as vt}from"./chat-context-PzKbUAil.js";import{N as Nt}from"./decopilot-MP52Tp89.js";import{g as wt,a as Ae,b as re,K as Pe,P as Ee,D as Me,c as St,S as _t,v as Ct,d as It,C as Tt,s as kt,l as $t,k as At,o as Pt,u as Et,j as Mt,h as zt}from"./sortable.esm-CF7laJH4.js";import{u as ze,a as Oe,o as Ot}from"./use-organization-settings-C9fqfs_P.js";import{c as be,b as Lt,h as Dt}from"./shell-layout-B6f6Mezi.js";import{I as Le}from"./input-DvLfRoZW.js";import{S as Ht,t as je,P as Rt,j as Ft,s as Ut,g as Bt}from"./scroll-area-NHg75EXM.js";import{S as Vt,a as Kt,b as Wt,c as qt,d as Gt}from"./sheet-5r4gvmz4.js";import{S as H}from"./skeleton-BZmNkJzm.js";import{t as De}from"./ChevronDown-D4rBo5Cd.js";import{b as He}from"./ZoomOut-CLFft6BA.js";import{g as Re,M as Qt}from"./types-CbEn8FkC.js";import{I as Fe}from"./integration-icon-BWhOzvug.js";import{a as Jt,b as Xt,c as Zt,d as we,S as Yt}from"./select-neJjS-sd.js";import{T as es}from"./textarea-EExQ_9H4.js";import{u as Ue}from"./studio-tools-D0ivYLyr.js";import{a as ts}from"./use-mcp-tools-R4ecAJwu.js";import{i as ss}from"./XCircle-7nuhx8NX.js";import{f as ns}from"./tab-id-AX1D_RMI.js";import{g as is}from"./use-mcp-prompts-BYKvWRs7.js";import{u as os,w as rs}from"./hooks-BxVsJBlY.js";import{a as ls,g as as,c as cs,b as ds,D as ms}from"./dropdown-menu-ChAsKxcd.js";import{s as us}from"./Trash01-BcusIWqe.js";import{a as fs,u as ps}from"./use-ai-providers-f1eJK-kn.js";import{u as hs}from"./connect-desktop-dialog-8s9YrP8w.js";import{T as xs}from"./toolbar-DCRlrcKI.js";import"./auth-BU0GeO8h.js";import"./use-collections-6pmiM0Qb.js";import"./AlertCircle-B9i_x3yX.js";import"./Tool01-B4amg9yB.js";import"./SwitchHorizontal01-DHUuncY2.js";import"./Settings02-CPxYREBE.js";import"./ArrowUpRight-cF0mnN41.js";import"./ZapSquare-CL8vn24R.js";import"./Users03-CCVhW9kg.js";import"./CheckCircle-zzRIg2zR.js";import"./ChevronRight-CDn6HuCQ.js";import"./DotsVertical-CyO7wZv3.js";import"./Stars02-D8az_5Af.js";import"./Eye-DJjniuqY.js";import"./Globe01-Do2q7EuB.js";import"./FilterLines-C7d-9ZQk.js";import"./Star01-z6-lfdui.js";import"./Globe04-Mvw3976B.js";import"./HardDrive-Ci17wnKW.js";import"./Key01-BiZk1T91.js";import"./LayoutLeft-BMp-06Ch.js";import"./LinkExternal01-BIEuCHKR.js";import"./Monitor01-DNKFU3PW.js";import"./Sun-CCi4P6Lh.js";import"./Palette-CB1NQWQN.js";import"./Play-An8HsyAi.js";import"./SearchLg-BYw4LhiQ.js";import"./SearchMd-BYsRf8JG.js";import"./Shield01-Dr2T7xLf.js";import"./Stars01-ZkDAuQwr.js";import"./Upload01-Dj1G7JBU.js";import"./User01-NcvWezb3.js";import"./Users01-CbnVd6yD.js";import"./XClose-Bqzfjmh3.js";import"./Zap-BNW86-w0.js";import"./tooltip-AP6mu2Do.js";import"./dialog-C45rhbs4.js";import"./drawer-DfEPwI8N.js";import"./collection-search-FrO71oF0.js";import"./form-CXezR26M.js";import"./label-DoALhGxW.js";import"./tabs-mXxKVCyL.js";import"./toggle-group-B1Y3vdU4.js";import"./popover-DQyFV8gm.js";import"./command-Bnhz7-1L.js";import"./index-BZUEFC59.js";import"./useInfiniteQuery-Cy3rKkmY.js";import"./use-infinite-scroll-CT70Yzl7.js";import"./use-org-fs-C4gEIpOa.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-BW75euWo.js";import"./decopilot-sse-pool-DOCSJwAs.js";import"./backoff-CrEUbyZT.js";import"./checkbox-fYp407Fh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-BP2FzYvw.js";import"./settings-section-CDE63k2k.js";import"./card-DuBMqYZm.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-5hK-b_ZU.js";import"./use-registry-connections-xn3NRt1I.js";import"./use-connection-COqYPxZz.js";import"./extract-connection-data-DhnwqdMi.js";import"./collection-tabs-CjIQ8mgh.js";import"./badge-KNqQ-xkh.js";import"./connection-form-helpers-BaOBFUzF.js";import"./authenticate-and-persist-oauth-Bwuou5N5.js";import"./mcp-oauth-DvrxuFpt.js";import"./useSuspenseInfiniteQuery-AFWRY55D.js";import"./alert-dialog-BvMgbTr9.js";import"./required-auth-layout-w72qbqCL.js";import"./use-org-sso-UVp5OsHW.js";import"./use-clock-tick-CVbq_r0l.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Bwnp2CVs.js";import"./file-type-icon-weqtDXd8.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-CCsB3ZB_.js";import"./delay-CnY5UFtP.js";function Be(t){const e=k.c(11),{properties:s,required:o,values:i,onChange:r}=t;let a;e[0]!==o?(a=o??[],e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=new Set(a),e[2]=a,e[3]=d):d=e[3];const l=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,p]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,l.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:p.type})]}),p.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:p.description}),n.jsx(gs,{type:p.type,fieldKey:f,value:i[f],onChange:h=>r(f,h)})]},f)})}),e[6]=r,e[7]=l,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function gs(t){const e=k.c(19),{type:s,fieldKey:o,value:i,onChange:r}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==r?(u=h=>r(h.target.value),e[0]=r,e[1]=u):u=e[1];const f=`Enter ${o} as JSON…`;let p;return e[2]!==c||e[3]!==u||e[4]!==f?(p=n.jsx(es,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=p):p=e[5],p}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==r?(u=x=>r(x==="true"),e[6]=r,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Jt,{className:"h-7 text-xs",children:n.jsx(Xt,{placeholder:"Select…"})}),e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs(Zt,{children:[n.jsx(we,{value:"true",children:"true"}),n.jsx(we,{value:"false",children:"false"})]}),e[9]=p):p=e[9];let h;return e[10]!==c||e[11]!==u?(h=n.jsxs(Yt,{value:c,onValueChange:u,children:[f,p]}),e[10]=c,e[11]=u,e[12]=h):h=e[12],h}const a=i??"";let d;e[13]!==r?(d=c=>r(c.target.value),e[13]=r,e[14]=d):d=e[14];const l=`Enter ${o}…`;let m;return e[15]!==a||e[16]!==d||e[17]!==l?(m=n.jsx(Le,{className:"h-7 text-xs",value:a,onChange:d,placeholder:l}),e[15]=a,e[16]=d,e[17]=l,e[18]=m):m=e[18],m}const ne=8;function ys(t){const e=k.c(16),{open:s,onOpenChange:o}=t,[i,r]=$.useState("");let a,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Vt,{children:"Manage home"}),d=n.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=a,e[1]=d):(a=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(xt,{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]=l):l=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=x=>r(x.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(Wt,{className:"px-5 py-4 border-b border-border",children:[a,d,n.jsxs("div",{className:"relative mt-3",children:[l,n.jsx(Le,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Gs,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(Ht,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx($.Suspense,{fallback:u,children:n.jsx(js,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==f?(p=n.jsxs(qt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=p):p=e[11];let h;return e[12]!==o||e[13]!==s||e[14]!==p?(h=n.jsx(Gt,{open:s,onOpenChange:o,children:p}),e[12]=o,e[13]=s,e[14]=p,e[15]=h):h=e[15],h}function bs(t){const e=k.c(32),{org:s}=J(),o=ze();let i;e[0]!==o?.ids?(i=o?.ids??[],e[0]=o?.ids,e[1]=i):i=e[1];const r=i,a=Oe(),d=ut(),l=xe();let m;e[2]!==s||e[3]!==l?(m=()=>l.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=m):m=e[4];const c=m;let u;e[5]!==r?(u=_=>r.includes(_),e[5]=r,e[6]=u):u=e[6];const f=u;let p;e[7]!==r||e[8]!==t?(p=t?r.filter(_=>t.has(_)).length:r.length,e[7]=r,e[8]=t,e[9]=p):p=e[9];const x=p>=ne;let y;e[10]!==x||e[11]!==f||e[12]!==a?(y=_=>f(_)||x?Promise.resolve():a.apply(I=>I.includes(_)?null:[...I,_]),e[10]=x,e[11]=f,e[12]=a,e[13]=y):y=e[13];const b=y;let v;e[14]!==a?(v=_=>a.apply(I=>I.filter(T=>T!==_)),e[14]=a,e[15]=v):v=e[15];const N=v;let j;e[16]!==a?(j=_=>a.apply(()=>_),e[16]=a,e[17]=j):j=e[17];const g=j;let w;e[18]!==d||e[19]!==x||e[20]!==f||e[21]!==c||e[22]!==a?(w=async(_,I)=>{await d.update.mutateAsync({id:_.id,data:{metadata:I}}),!f(_.id)&&!x&&await a.apply(T=>T.includes(_.id)?null:[...T,_.id]),await c()},e[18]=d,e[19]=x,e[20]=f,e[21]=c,e[22]=a,e[23]=w):w=e[23];const S=w;let C;return e[24]!==b||e[25]!==x||e[26]!==r||e[27]!==f||e[28]!==N||e[29]!==g||e[30]!==S?(C={homeIds:r,isOnHome:f,atLimit:x,addAgent:b,removeAgent:N,reorder:g,saveAgentMetadata:S},e[24]=b,e[25]=x,e[26]=r,e[27]=f,e[28]=N,e[29]=g,e[30]=S,e[31]=C):C=e[31],C}function js(t){const e=k.c(21),{search:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={pageSize:1e3},e[0]=o):o=e[0];const i=mt(o);let r;e[1]!==i?(r=new Set(i.map(_s)),e[1]=i,e[2]=r):r=e[2];const a=bs(r);let d,l,m;if(e[3]!==i||e[4]!==a||e[5]!==s){const x=new Map(i.map(Ss));d=s.trim().toLowerCase();const y=N=>!d||N.title?.toLowerCase().includes(d);l=a.homeIds.map(N=>x.get(N)).filter(ws).filter(y);const b=wt(i);let v;e[9]!==a?(v=N=>!a.isOnHome(N.id),e[9]=a,e[10]=v):v=e[10],m=i.filter(Ns).filter(N=>!b.has(N.id)).filter(v).filter(y).sort(vs),e[3]=i,e[4]=a,e[5]=s,e[6]=d,e[7]=l,e[8]=m}else d=e[6],l=e[7],m=e[8];const c=m;let u;e[11]!==a||e[12]!==l?(u=n.jsx(Cs,{home:a,agents:l}),e[11]=a,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==c||e[15]!==a||e[16]!==f?(p=n.jsx(ks,{home:a,agents:c,hasSearch:f}),e[14]=c,e[15]=a,e[16]=f,e[17]=p):p=e[17];let h;return e[18]!==u||e[19]!==p?(h=n.jsxs(n.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=h):h=e[20],h}function vs(t,e){return(t.title??"").localeCompare(e.title??"")}function Ns(t){return t.id&&!lt(t.id)}function ws(t){return!!t}function Ss(t){return[t.id,t]}function _s(t){return t.id}function Ve(t){const e=k.c(7),{title:s,hint:o}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==o?(r=o&&n.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==r?(a=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,r]}),e[4]=i,e[5]=r,e[6]=a):a=e[6],a}function Cs(t){const e=k.c(14),{home:s,agents:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={coordinateGetter:kt},e[1]=r):r=e[1];const a=Ae(re(Ee,i),re(Pe,r));let d;e[2]!==s?(d=p=>{const{active:h,over:x}=p;if(!x||h.id===x.id)return;const y=s.homeIds,b=y.indexOf(h.id),v=y.indexOf(x.id);b===-1||v===-1||s.reorder($t([...y],b,v)).catch(Ts)},e[2]=s,e[3]=d):d=e[3];const l=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(Ve,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==a?(u=o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Me,{sensors:a,collisionDetection:St,onDragEnd:l,children:n.jsx(_t,{items:o.map(Is),strategy:Ct,children:n.jsx("div",{className:"flex flex-col gap-1",children:o.map(p=>n.jsx(As,{agent:p,home:s},p.id))})})}),e[6]=o,e[7]=l,e[8]=s,e[9]=a,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Is(t){return t.id}function Ts(){return U.error("Couldn't reorder home — please try again.")}function ks(t){const e=k.c(6),{home:s,agents:o,hasSearch:i}=t,[r,a]=$.useState(20);let d;if(e[0]!==o||e[1]!==i||e[2]!==s||e[3]!==r){const l=o.slice(0,r);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ve,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:l.map(c=>n.jsx(Ms,{agent:c,home:s},c.id))}),o.length>r&&n.jsxs("button",{type:"button",onClick:()=>a($s),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 (",o.length-r,")"]})]})]}),e[0]=o,e[1]=i,e[2]=s,e[3]=r,e[4]=d}else d=e[4];return d}function $s(t){return t+20}function Ke(t){const e=Z(t.metadata?.ui).filter(r=>!!r.resourceUri).length,s=t.metadata?.ui?.homePrompts,o=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),o!==null&&o>0&&i.push(`${o} prompt${o===1?"":"s"}`),o===0&&i.push("prompts off"),i.join(" · ")}function As(t){const e=k.c(57),{agent:s,home:o}=t,[i,r]=$.useState(!1);let a;e[0]!==s.id?(a={id:s.id},e[0]=s.id,e[1]=a):a=e[1];const{attributes:d,listeners:l,setNodeRef:m,transform:c,transition:u,isDragging:f}=It(a),p=Ke(s)||"Quick access";let h;e[2]!==c?(h=Tt.Transform.toString(c),e[2]=c,e[3]=h):h=e[3];const x=f?.5:void 0,y=f?100:void 0;let b;e[4]!==h||e[5]!==x||e[6]!==y||e[7]!==u?(b={transform:h,transition:u,opacity:x,zIndex:y},e[4]=h,e[5]=x,e[6]=y,e[7]=u,e[8]=b):b=e[8];const v=b,N=f&&"shadow-lg";let j;e[9]!==N?(j=Q("rounded-lg border border-border bg-card",N),e[9]=N,e[10]=j):j=e[10];const g=`Drag to reorder ${s.title??s.id}`;let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(He,{size:14}),e[11]=w):w=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==g?(S=n.jsx("button",{type:"button",...d,...l,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":g,children:w}),e[12]=d,e[13]=l,e[14]=g,e[15]=S):S=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=()=>r(Es),e[16]=C):C=e[16];const _=s.title??s.id;let I;e[17]!==s.icon||e[18]!==_?(I=n.jsx(ce,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=I):I=e[19];const T=s.title??s.id;let P;e[20]!==T?(P=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=P):P=e[21];let M;e[22]!==p?(M=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=M):M=e[23];let z;e[24]!==P||e[25]!==M?(z=n.jsxs("div",{className:"min-w-0 flex-1",children:[P,M]}),e[24]=P,e[25]=M,e[26]=z):z=e[26];const B=i&&"rotate-180";let O;e[27]!==B?(O=Q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=O):O=e[28];let L;e[29]!==O?(L=n.jsx(De,{size:16,className:O}),e[29]=O,e[30]=L):L=e[30];let K;e[31]!==i||e[32]!==I||e[33]!==z||e[34]!==L?(K=n.jsxs("button",{type:"button",onClick:C,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,z,L]}),e[31]=i,e[32]=I,e[33]=z,e[34]=L,e[35]=K):K=e[35];let A;e[36]!==s.id||e[37]!==o?(A=()=>o.removeAgent(s.id).catch(Ps),e[36]=s.id,e[37]=o,e[38]=A):A=e[38];const V=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx($e,{size:14}),e[39]=D):D=e[39];let E;e[40]!==A||e[41]!==V?(E=n.jsx("button",{type:"button",onClick:A,"aria-label":V,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:D}),e[40]=A,e[41]=V,e[42]=E):E=e[42];let R;e[43]!==S||e[44]!==K||e[45]!==E?(R=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,K,E]}),e[43]=S,e[44]=K,e[45]=E,e[46]=R):R=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==o?(F=i&&n.jsx(We,{agent:s,home:o}),e[47]=s,e[48]=i,e[49]=o,e[50]=F):F=e[50];let q;return e[51]!==m||e[52]!==v||e[53]!==R||e[54]!==F||e[55]!==j?(q=n.jsxs("div",{ref:m,style:v,className:j,children:[R,F]}),e[51]=m,e[52]=v,e[53]=R,e[54]=F,e[55]=j,e[56]=q):q=e[56],q}function Ps(){return U.error("Couldn't remove from home — please try again.")}function Es(t){return!t}function Ms({agent:t,home:e}){const[s,o]=$.useState(!1),[i,r]=$.useState(!1),a=Ke(t),d=async()=>{if(!e.atLimit){r(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{r(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>o(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(ce,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),a&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:a})]}),n.jsx(De,{size:16,className:Q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(le,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(We,{agent:t,home:e})]})}function We(t){const e=k.c(17),{agent:s,home:o}=t,i=s.metadata?.ui;let r;e[0]!==i?(r=Z(i),e[0]=i,e[1]=r):r=e[1];const a=r;let d;e[2]!==s.connections?(d=(s.connections??[]).map(zs).sort(),e[2]=s.connections,e[3]=d):d=e[3];const l=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==l||e[6]!==o||e[7]!==a?(c=n.jsx(Ls,{agent:s,home:o,connectionIds:l,pinnedTiles:a}),e[4]=s,e[5]=l,e[6]=o,e[7]=a,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Os,{}),e[9]=u):u=e[9];const f=m??null;let p;e[10]!==s||e[11]!==o||e[12]!==f?(p=n.jsx($.Suspense,{fallback:u,children:n.jsx(Us,{agent:s,home:o,curated:f})}),e[10]=s,e[11]=o,e[12]=f,e[13]=p):p=e[13];let h;return e[14]!==c||e[15]!==p?(h=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,p]}),e[14]=c,e[15]=p,e[16]=h):h=e[16],h}function zs(t){return t.connection_id}function Os(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(H,{className:"h-8 w-full"}),n.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Ls({agent:t,home:e,connectionIds:s,pinnedTiles:o}){const i=Ue(),{data:r,isLoading:a}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),p=(f?.tools??[]).flatMap(h=>{const x=Re(h._meta);return x?[{name:h.name,description:h.description,resourceUri:x,inputSchema:h.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:p}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(a)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!r||r.length===0)return null;const d=new Map;for(const c of r)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const l=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=o.some(c=>!!l(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),o.map(c=>{const u=l(c);return u?n.jsx(Rs,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),r.map(c=>c.uiTools.map(u=>n.jsx(Fs,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function qe(t,e){const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;if((r==="object"||r==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[o]=JSON.parse(i)}catch{return null}}else if((r==="number"||r==="integer")&&typeof i=="string"){if(!i.trim())continue;s[o]=Number(i)}else i!==""&&i!=null&&(s[o]=i)}return s}function Ds(t,e){if(!t||!e)return{};const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;(r==="object"||r==="array")&&i!=null&&typeof i!="string"?s[o]=JSON.stringify(i,null,2):s[o]=i}return s}function Hs(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,o])=>{const i=typeof o=="object"?JSON.stringify(o):String(o);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function Rs({agent:t,home:e,connection:s,tool:o,tile:i}){const[r,a]=$.useState(!1),[d,l]=$.useState(!1),m=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[c,u]=$.useState(()=>Ds(i.toolInput,o.inputSchema?.properties)),f=async()=>{a(!0);try{const x=Z(t.metadata?.ui),y=i.tileId?x.filter(v=>v.tileId!==i.tileId):x.filter(v=>v!==i),b={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,b),l(!1)}catch(x){console.error("[home-tiles] failed to remove tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},p=async()=>{a(!0);try{let x;if(m&&o.inputSchema?.properties){const N=qe(c,o.inputSchema.properties);if(!N){U.error("Invalid JSON in one of the fields — please fix it."),a(!1);return}Object.keys(N).length>0&&(x=N)}const b=Z(t.metadata?.ui).map(N=>(i.tileId?N.tileId===i.tileId:N===i)?{...N,toolInput:x}:N),v={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:b}};await e.saveAgentMetadata(t,v),l(!1)}catch(x){console.error("[home-tiles] failed to save tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},h=Hs(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(o.name)}),h&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:h})]}),m&&n.jsx("button",{type:"button",onClick:()=>l(x=>!x),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(gt,{size:14})}),n.jsx(ve,{isPinned:!0,submitting:r,onClick:f,label:"Remove from home"})]}),d&&m&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:c,onChange:(x,y)=>u(b=>({...b,[x]:y}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>l(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:r,onClick:p,children:r?n.jsx(le,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function Fs({agent:t,home:e,connection:s,tool:o}){const[i,r]=$.useState(!1),[a,d]=$.useState(!1),l=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(l&&!a){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{r(!0);try{let p;if(l&&o.inputSchema?.properties){const b=qe(m,o.inputSchema.properties);if(!b){U.error("Invalid JSON in one of the fields — please fix it."),r(!1);return}Object.keys(b).length>0&&(p=b)}const x=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:o.resourceUri,toolName:o.name,...p?{toolInput:p}:{}}],y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:x}};await e.saveAgentMetadata(t,y),d(!1),c({})}catch(p){console.error("[home-tiles] failed to add tile",p),U.error("Couldn't update home — please try again.")}finally{r(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(o.name)}),n.jsx(ve,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),a&&l&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:m,onChange:(p,h)=>c(x=>({...x,[p]:h}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(le,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function ve(t){const e=k.c(11),{isPinned:s,submitting:o,onClick:i,label:r}=t,a=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==a?(d=Q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",a),e[0]=a,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==o?(l=o?n.jsx(le,{size:12,className:"animate-spin"}):s?n.jsx(yt,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let m;return e[5]!==r||e[6]!==i||e[7]!==o||e[8]!==d||e[9]!==l?(m=n.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":r,title:r,className:d,children:l}),e[5]=r,e[6]=i,e[7]=o,e[8]=d,e[9]=l,e[10]=m):m=e[10],m}function Us(t){const e=k.c(32),{agent:s,home:o,curated:i}=t,{org:r}=J();let a;e[0]!==s.id||e[1]!==r.id||e[2]!==r.slug?(a={connectionId:s.id,orgId:r.id,orgSlug:r.slug},e[0]=s.id,e[1]=r.id,e[2]=r.slug,e[3]=a):a=e[3];const d=ae(a);let l;e[4]!==s.id||e[5]!==r.id?(l=te.agentPrompts(r.id,s.id),e[4]=s.id,e[5]=r.id,e[6]=l):l=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:g}=await d.listPrompts();return g.map(Ws)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==l||e[10]!==m?(c={queryKey:l,queryFn:m,staleTime:3e4,retry:!1},e[9]=l,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:p}=se(c),h=be(r.slug);let x,y;if(e[12]!==s.id||e[13]!==u||e[14]!==h.prompts){let g;e[17]!==s.id?(g=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=g):g=e[18],x=h.prompts.filter(g).map(Ks);let w;e[19]!==u?(w=u??[],e[19]=u,e[20]=w):w=e[20],y=[...w];for(const S of x)y.some(C=>C.name===S.name)||y.push(S);e[12]=s.id,e[13]=u,e[14]=h.prompts,e[15]=x,e[16]=y}else x=e[15],y=e[16];if(f&&x.length===0){let g;return e[21]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=g):g=e[21],g}if(p&&x.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(y.length===0)return null;let b;e[22]!==i||e[23]!==y?(b=i??y.map(Vs),e[22]=i,e[23]=y,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const N=v;let j;return e[27]!==s||e[28]!==o||e[29]!==y||e[30]!==N?(j=n.jsx("div",{className:"flex flex-col gap-0.5",children:y.map(g=>n.jsx(qs,{agent:s,home:o,prompt:g,allPromptNames:y.map(Bs),isPinned:N.has(g.name)},g.name))}),e[27]=s,e[28]=o,e[29]=y,e[30]=N,e[31]=j):j=e[31],j}function Bs(t){return t.name}function Vs(t){return t.name}function Ks(t){return{name:t.promptName,title:t.title,description:t.description}}function Ws(t){return{name:t.name,title:t.title,description:t.description}}function qs({agent:t,home:e,prompt:s,allPromptNames:o,isPinned:i}){const[r,a]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}a(!0);try{const l=t.metadata?.ui?.homePrompts;let m;Array.isArray(l)?m=i?l.filter(u=>u!==s.name):[...l,s.name]:m=i?o.filter(u=>u!==s.name):o;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),U.error("Couldn't update home — please try again.")}finally{a(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(ve,{isPinned:i,submitting:r,onClick:d,label:i?"Remove from home":"Add to home"})]})}function Gs(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Qs)}),t[0]=e):e=t[0],e}function Qs(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ge=`home-board.layout.v${ee}`;function Qe(t){return`home-board.layout.v${ee}.${t}`}const Je={version:ee,tiles:{},hidden:[]};function fe(t){return!t||t.version!==ee?Je:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Js(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Xs(t){try{const e=localStorage.getItem(Qe(t));return e?fe(JSON.parse(e)):void 0}catch{return}}function Se(t,e){try{localStorage.setItem(Qe(t),JSON.stringify(e))}catch{}}async function _e(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 Zs(t){const e=k.c(24),s=xe();let o;e[0]!==t?(o=te.boardLayout(t),e[0]=t,e[1]=o):o=e[1];const i=o;let r;e[2]!==t?(r=Xs(t),e[2]=t,e[3]=r):r=e[3];const a=r;let d;e[4]!==a||e[5]!==t?(d=async()=>{const b=await fetch(`/api/${t}/kv/${Ge}`);if(b.status===404)return a&&Js(a)?(await _e(t,a),a):Je;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),N=fe(v.value);return Se(t,N),N},e[4]=a,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==i||e[9]!==d?(l={queryKey:i,queryFn:d,initialData:a,staleTime:0,refetchOnWindowFocus:!1},e[7]=a,e[8]=i,e[9]=d,e[10]=l):l=e[10];const{data:m,isLoading:c}=se(l);let u;e[11]!==t?(u={mutationFn:b=>_e(t,b)},e[11]=t,e[12]=u):u=e[12];const f=st(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(p=b=>{Se(t,b),s.setQueryData(i,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=p):p=e[17];const h=p;let x;e[18]!==m?(x=fe(m),e[18]=m,e[19]=x):x=e[19];let y;return e[20]!==c||e[21]!==h||e[22]!==x?(y={layout:x,isLoading:c,save:h},e[20]=c,e[21]=h,e[22]=x,e[23]=y):y=e[23],y}const Xe=$.createContext(null);function Ys(t){const e=k.c(24),{children:s}=t,{org:o}=J(),i=Zs(o.slug),[r,a]=$.useState(!1),[d,l]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{l(i.layout),a(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l(null),a(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==i?(p=()=>{d&&i.save(d),l(null),a(!1)},e[3]=d,e[4]=i,e[5]=p):p=e[5];const h=p,x=r&&d!==null,y=x?d:i.layout;let b;e[6]!==d||e[7]!==x||e[8]!==i.layout?(b=x?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=x,e[8]=i.layout,e[9]=b):b=e[9];const v=b;let N;e[10]!==r||e[11]!==i?(N=S=>{r?l(S):i.save(S)},e[10]=r,e[11]=i,e[12]=N):N=e[12];const j=N;let g;e[13]!==j||e[14]!==c||e[15]!==v||e[16]!==r||e[17]!==y||e[18]!==h||e[19]!==i.isLoading?(g={isEditMode:r,enter:c,cancel:f,save:h,hasChanges:v,layout:y,isLayoutLoading:i.isLoading,commitLayout:j},e[13]=j,e[14]=c,e[15]=v,e[16]=r,e[17]=y,e[18]=h,e[19]=i.isLoading,e[20]=g):g=e[20];let w;return e[21]!==s||e[22]!==g?(w=n.jsx(Xe.Provider,{value:g,children:s}),e[21]=s,e[22]=g,e[23]=w):w=e[23],w}function Ze(){const t=$.useContext(Xe);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function en({agentId:t}){const{org:e,locator:s}=J(),o=ae({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=os(),{setTaskId:r}=Lt(),[a,d]=$.useState(null),[l,m]=$.useState(!1),c=$.useRef(!1),u=async(y,b)=>{if(!o){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const v=await is(o,y.name,b),N={type:"doc",content:[{type:"paragraph",content:[Ft({id:y.name,name:Ut(y.name,Bt(y._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},j=crypto.randomUUID();rs(sessionStorage,s,j,{tiptapDoc:N}),await i({id:j,virtual_mcp_id:t}),r(j,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async y=>{if(!c.current){if(y.arguments&&y.arguments.length>0){d(y);return}await u(y)}},p=async y=>{if(!a)return;const b=a;d(null),await u(b,y)};return{start:f,startBlank:async y=>{if(!c.current){c.current=!0,m(!0);try{const b=crypto.randomUUID();await i({id:b,virtual_mcp_id:t}),r(b,t,y?.main?{main:y.main}:void 0)}catch(b){console.error("[start-thread-from-prompt] startBlank failed",b),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(Rt,{prompt:a,setPrompt:y=>d(y),onSubmit:p}),dialogPrompt:a,starting:l}}const W=4,G=100,Ce=12,tn=5,sn={w:2,h:2};class pe extends $.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(nt,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function nn(t){const e=k.c(72),{tiles:s,isEditMode:o,renderTile:i,onMove:r,onResize:a,onRemove:d}=t,l=ge(),m=$.useRef(null),[c,u]=$.useState(null),[f,p]=$.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activationConstraint:{distance:4}},e[0]=h):h=e[0];const x=Ae(re(Ee,h),re(Pe)),y=s.reduce(on,0),b=o?Math.max(y+2,4):Math.max(y,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/W,cellHeight:G}:null},e[1]=v):v=e[1];const N=v;let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=A=>{u(String(A.active.id)),p(N())},e[2]=j):j=e[2];const g=j;let w;e[3]!==f||e[4]!==r||e[5]!==s?(w=A=>{const V=String(A.active.id),D=f??N();if(u(null),p(null),!D||D.cellWidth<=0)return;const E=s.find(q=>q.id===V);if(!E)return;const R=Math.round(A.delta.x/D.cellWidth),F=Math.round(A.delta.y/D.cellHeight);R===0&&F===0||r(V,{x:E.x+R,y:E.y+F})},e[3]=f,e[4]=r,e[5]=s,e[6]=w):w=e[6];const S=w;if(l){let A;if(e[7]!==i||e[8]!==s){let D;e[10]!==i?(D=E=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:G},children:n.jsx(pe,{children:i(E)})},E.id),e[10]=i,e[11]=D):D=e[11],A=s.map(D),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let V;return e[12]!==A?(V=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=V):V=e[13],V}let C,_,I,T,P,M,z,B,O;if(e[14]!==c||e[15]!==f||e[16]!==o||e[17]!==S||e[18]!==d||e[19]!==a||e[20]!==i||e[21]!==x||e[22]!==s||e[23]!==b){const A=c?s.find(X=>X.id===c):null;_=Me,B=x,O=g,I=S;const V=b*G,D=o?G*4:G;let E;e[33]!==V||e[34]!==D?(E={height:V,minHeight:D},e[33]=V,e[34]=D,e[35]=E):E=e[35];let R;e[36]!==o||e[37]!==s||e[38]!==b?(R=o&&n.jsx(rn,{rows:b,tiles:s}),e[36]=o,e[37]=s,e[38]=b,e[39]=R):R=e[39];let F;if(e[40]!==c||e[41]!==o||e[42]!==d||e[43]!==a||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==o||e[49]!==d||e[50]!==a||e[51]!==i?(X=ie=>n.jsx(an,{tile:ie,isEditMode:o,isDragging:c===ie.id,onResize:a,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=o,e[49]=d,e[50]=a,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=o,e[42]=d,e[43]=a,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==E||e[54]!==R||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:E,children:[R,F]}),e[53]=E,e[54]=R,e[55]=F,e[56]=T):T=e[56],C=At,P=null;const q=A&&f?A.w*f.cellWidth-Ce:void 0,de=A&&f?A.h*f.cellHeight-Ce:void 0;e[57]!==q||e[58]!==de?(M={width:q,height:de},e[57]=q,e[58]=de,e[59]=M):M=e[59],z=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(pe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=o,e[17]=S,e[18]=d,e[19]=a,e[20]=i,e[21]=x,e[22]=s,e[23]=b,e[24]=C,e[25]=_,e[26]=I,e[27]=T,e[28]=P,e[29]=M,e[30]=z,e[31]=B,e[32]=O}else C=e[24],_=e[25],I=e[26],T=e[27],P=e[28],M=e[29],z=e[30],B=e[31],O=e[32];let L;e[60]!==C||e[61]!==P||e[62]!==M||e[63]!==z?(L=n.jsx(C,{dropAnimation:P,style:M,children:z}),e[60]=C,e[61]=P,e[62]=M,e[63]=z,e[64]=L):L=e[64];let K;return e[65]!==_||e[66]!==I||e[67]!==T||e[68]!==L||e[69]!==B||e[70]!==O?(K=n.jsxs(_,{sensors:B,onDragStart:O,onDragEnd:I,children:[T,L]}),e[65]=_,e[66]=I,e[67]=T,e[68]=L,e[69]=B,e[70]=O,e[71]=K):K=e[71],K}function on(t,e){return Math.max(t,e.y+e.h)}function rn(t){const e=k.c(7),{rows:s,tiles:o}=t;let i;e[0]!==o?(i=(l,m)=>o.some(c=>l>=c.x&&l<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=o,e[1]=i):i=e[1];const r=i;let a;if(e[2]!==r||e[3]!==s){a=[];for(let l=0;l<s;l++)for(let m=0;m<W;m++)r(m,l)||a.push({x:m,y:l});e[2]=r,e[3]=s,e[4]=a}else a=e[4];let d;return e[5]!==a?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:a.map(ln)}),e[5]=a,e[6]=d):d=e[6],d}function ln(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/W*100}%`,top:t.y*G,width:`${1/W*100}%`,height:G},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function an(t){const e=k.c(31),{tile:s,isEditMode:o,isDragging:i,onResize:r,onRemove:a,children:d}=t,l=!o;let m;e[0]!==l||e[1]!==s.id?(m={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:p}=Pt(m),h=`${s.x/W*100}%`,x=`${s.w/W*100}%`,y=s.y*G,b=s.h*G,v=p||i,N=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",j=v&&"opacity-30";let g;e[3]!==N||e[4]!==j?(g=Q("absolute p-1 will-change-[left,top,width,height,opacity]",N,j),e[3]=N,e[4]=j,e[5]=g):g=e[5];let w;e[6]!==b||e[7]!==h||e[8]!==y||e[9]!==x?(w={left:h,top:y,width:x,height:b},e[6]=b,e[7]=h,e[8]=y,e[9]=x,e[10]=w):w=e[10];const S=o&&"outline outline-1 outline-transparent hover:outline-primary/40";let C;e[11]!==S?(C=Q("group 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]!==o||e[15]!==f||e[16]!==a||e[17]!==r||e[18]!==s?(_=o&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(He,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(cn,{tile:s,onResize:r,onRemove:a})})]}),e[13]=u,e[14]=o,e[15]=f,e[16]=a,e[17]=r,e[18]=s,e[19]=_):_=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(pe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==C||e[24]!==_?(T=n.jsxs("div",{className:C,children:[_,I]}),e[22]=I,e[23]=C,e[24]=_,e[25]=T):T=e[25];let P;return e[26]!==c||e[27]!==T||e[28]!==g||e[29]!==w?(P=n.jsx("div",{ref:c,className:g,style:w,children:T}),e[26]=c,e[27]=T,e[28]=g,e[29]=w,e[30]=P):P=e[30],P}function cn(t){const e=k.c(20),{tile:s,onResize:o,onRemove:i}=t,[r,a]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ls,{asChild:!0,children:n.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:n.jsx(bt,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==o||e[2]!==s.id?(l=y=>{o(s.id,y),a(!1)},e[1]=o,e[2]=s.id,e[3]=l):l=e[3];let m;e[4]!==l||e[5]!==s?(m=n.jsx(dn,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(as,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(us,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=n.jsxs(cs,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let h;e[14]!==m||e[15]!==p?(h=n.jsxs(ds,{align:"end",className:"w-auto",children:[m,c,p]}),e[14]=m,e[15]=p,e[16]=h):h=e[16];let x;return e[17]!==r||e[18]!==h?(x=n.jsxs(ms,{open:r,onOpenChange:a,children:[d,h]}),e[17]=r,e[18]=h,e[19]=x):x=e[19],x}function dn(t){const e=k.c(19),{tile:s,onPick:o}=t,i=s.minW??1,r=s.minH??1,[a,d]=$.useState(null);let l;e[0]!==a||e[1]!==s.h||e[2]!==s.w?(l=a??{w:s.w,h:s.h},e[0]=a,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const m=l;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${W}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let h;e[10]!==m.h||e[11]!==m.w||e[12]!==r||e[13]!==i||e[14]!==o?(h=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:tn},(y,b)=>Array.from({length:W},(v,N)=>{const j=N+1,g=b+1,w=j<i||g<r,S=j<=m.w&&g<=m.h;return n.jsx("button",{type:"button",disabled:w,"aria-label":`${j} by ${g}`,onPointerEnter:()=>d({w:j,h:g}),onClick:()=>o({w:j,h:g}),className:Q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",w?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${j}x${g}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=r,e[13]=i,e[14]=o,e[15]=h):h=e[15];let x;return e[16]!==u||e[17]!==h?(x=n.jsxs("div",{className:"px-2 py-1.5",children:[u,h]}),e[16]=u,e[17]=h,e[18]=x):x=e[18],x}function mn(t,e,s){return t.some(o=>e>=o.x&&e<o.x+o.w&&s>=o.y&&s<o.y+o.h)}function he(t,e,s){for(let o=0;o<100;o++)for(let i=0;i<=W-e;i++){let r=!0;for(let a=0;a<s&&r;a++)for(let d=0;d<e&&r;d++)mn(t,i+d,o+a)&&(r=!1);if(r)return{x:i,y:o}}return{x:0,y:0}}function me(t,e,s={w:1,h:1}){const o=Math.max(s.w,Math.min(W,t)),i=Math.max(s.h,Math.min(6,e));return{w:o,h:i}}function ue(t,e,s){const o=Math.max(0,Math.min(W-s,t)),i=Math.max(0,e);return{x:o,y:i}}function un(t,e,s){const o=t.find(l=>l.id===e);if(!o)return t;const i=t.filter(l=>l.id!==e),r=i.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(r&&r.w===o.w&&r.h===o.h)return t.map(l=>l.id===e?{...l,x:r.x,y:r.y}:l.id===r.id?{...l,x:o.x,y:o.y}:l);const d=[{...o,x:s.x,y:s.y}];for(const l of i){const m=he(d,l.w,l.h);d.push({...l,x:m.x,y:m.y})}return d}function fn(t){const e=k.c(35),{layout:s,isLayoutLoading:o,commitLayout:i}=Ze();let r;e[0]!==s.hidden?(r=new Set(s.hidden),e[0]=s.hidden,e[1]=r):r=e[1];const a=r;let d,l;if(e[2]!==t||e[3]!==a||e[4]!==s.tiles){l=[];let v;e[7]!==a?(v=j=>j.pinned||!a.has(j.id),e[7]=a,e[8]=v):v=e[8];const N=t.filter(v);d=new Map;for(const j of t)j.minSize&&d.set(j.id,j.minSize);for(const j of N){const g=s.tiles[j.id];if(!g)continue;const w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),{x:_,y:I}=ue(g.x,g.y,S);l.push({id:j.id,x:_,y:I,w:S,h:C,minW:w?.w,minH:w?.h})}for(const j of N){if(l.some(I=>I.id===j.id))continue;const g=j.defaultSize??sn,w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),_=he(l,S,C);l.push({id:j.id,x:_.x,y:_.y,w:S,h:C,minW:w?.w,minH:w?.h})}e[2]=t,e[3]=a,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let m;e[9]!==t?(m=new Set(t.map(pn)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(v,N)=>{const j={};for(const g of v)j[g.id]={x:g.x,y:g.y,w:g.w,h:g.h};i({version:ee,tiles:j,hidden:N.filter(g=>c.has(g))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let p;e[14]!==l?(p={visible:l},e[14]=l,e[15]=p):p=e[15];let h;e[16]!==f||e[17]!==s||e[18]!==l?(h=(v,N)=>{const j=l.find(S=>S.id===v);if(!j)return;const g=ue(N.x,N.y,j.w);if(g.x===j.x&&g.y===j.y)return;const w=un(l,v,g);f(w,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=h):h=e[19];let x;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(x=(v,N)=>{const j=l.find(T=>T.id===v);if(!j)return;const g=d.get(v),{w,h:S}=me(N.w,N.h,g);if(w===j.w&&S===j.h)return;const C={...j,w,h:S,x:ue(j.x,j.y,w).x},_=l.filter(T=>T.id!==v),I=[C];for(const T of _){const P=he(I,T.w,T.h);I.push({...T,x:P.x,y:P.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=x):x=e[24];let y;e[25]!==f||e[26]!==s||e[27]!==l?(y=v=>{const N=l.filter(j=>j.id!==v);f(N,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=l,e[28]=y):y=e[28];let b;return e[29]!==o||e[30]!==p||e[31]!==h||e[32]!==x||e[33]!==y?(b={snapshot:p,isLoading:o,moveTile:h,resizeTile:x,hideTile:y},e[29]=o,e[30]=p,e[31]=h,e[32]=x,e[33]=y,e[34]=b):b=e[34],b}function pn(t){return t.id}const hn={w:2,h:4},xn={w:1,h:2},gn={w:1,h:1};function yn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function bn(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function jn(t){return t.promptName?t.agentName:t.description}function vn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function Ye(t){const e=k.c(14),{org:s}=J();let o;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(o=at({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=o):o=e[3];const{data:i}=se(o),r=!!i&&!t.toolName;let a;e[4]!==i||e[5]!==r?(a={client:i,enabled:r},e[4]=i,e[5]=r,e[6]=a):a=e[6];const{data:d}=ts(a);let l;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(l=t.toolName??d?.tools.find(u=>Re(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=l):l=e[10];const m=l;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?ns(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:o,startBlank:i,dialog:r,starting:a}=en(s);let d;e[2]!==o||e[3]!==i?(d=c=>{if(!c.promptName){i();return}o(vn(c))},e[2]=o,e[3]=i,e[4]=d):d=e[4];const l=d;let m;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==a?(m={open:l,startBlank:i,dialog:r,starting:a},e[5]=r,e[6]=l,e[7]=i,e[8]=a,e[9]=m):m=e[9],m}function Nn(t){const e=k.c(32),{entry:s,isEditMode:o}=t,{open:i,dialog:r,starting:a}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const l=a||o,m=!o&&"cursor-pointer transition-colors hover:bg-accent/40",c=o&&"cursor-default pl-12",u=a&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=Q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=n.jsx(ce,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let h;e[10]!==s.title?(h=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=h):h=e[11];let x;e[12]!==s?(x=jn(s),e[12]=s,e[13]=x):x=e[13];let y;e[14]!==x?(y=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:x}),e[14]=x,e[15]=y):y=e[15];let b;e[16]!==y||e[17]!==h?(b=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,y]}),e[16]=y,e[17]=h,e[18]=b):b=e[18];let v;e[19]!==o?(v=!o&&n.jsx(ss,{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]=o,e[20]=v):v=e[20];let N;e[21]!==a||e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==l||e[26]!==f||e[27]!==p?(N=n.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":a,className:f,children:[p,b,v]}),e[21]=a,e[22]=d,e[23]=b,e[24]=v,e[25]=l,e[26]=f,e[27]=p,e[28]=N):N=e[28];let j;return e[29]!==r||e[30]!==N?(j=n.jsxs(n.Fragment,{children:[N,r]}),e[29]=r,e[30]=N,e[31]=j):j=e[31],j}function wn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},Sn)}),t[0]=e):e=t[0],e}function Sn(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(H,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function _n(t){const e=k.c(17),{tile:s,prompts:o,isEditMode:i,tileWidth:r}=t,{org:a}=J(),{open:d,startBlank:l,dialog:m,starting:c}=Ne(s.agentId),u=o.filter(Cn),f=Ye(s),p="relative flex h-full w-full flex-col p-3";let h;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==c?(h=!i&&n.jsx("button",{type:"button",onClick:()=>{l(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=l,e[3]=c,e[4]=h):h=e[4];const x="flex min-h-0 flex-1 gap-3 overflow-hidden";let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Tn,{}),e[5]=y):y=e[5];let b;e[6]!==a.id||e[7]!==a.slug||e[8]!==s?(b=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:y,children:n.jsx(In,{tile:s,orgId:a.id,orgSlug:a.slug})})}),e[6]=a.id,e[7]=a.slug,e[8]=s,e[9]=b):b=e[9];const v=u.length>0&&!i&&r>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(g=>n.jsx("button",{type:"button",onClick:()=>d(g),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:g.title})},g.promptName))});let N;e[10]!==b||e[11]!==v?(N=n.jsxs("div",{className:x,children:[b,v]}),e[10]=b,e[11]=v,e[12]=N):N=e[12];let j;return e[13]!==m||e[14]!==h||e[15]!==N?(j=n.jsxs("div",{className:p,children:[h,N,m]}),e[13]=m,e[14]=h,e[15]=N,e[16]=j):j=e[16],j}function Cn(t){return!!t.promptName}function In(t){const e=k.c(13),{tile:s,orgId:o,orgSlug:i}=t;let r;e[0]!==o||e[1]!==i||e[2]!==s.connectionId?(r={connectionId:s.connectionId,orgId:o,orgSlug:i},e[0]=o,e[1]=i,e[2]=s.connectionId,e[3]=r):r=e[3];const a=ae(r),d=s.minHeight??200,l=s.maxHeight??4e3;let m;return e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(Qt,{resourceURI:s.resourceUri,orgId:o,orgSlug:i,connectionId:s.connectionId,client:a,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=a,e[5]=o,e[6]=i,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function Tn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function kn(t){const e=k.c(14),{icon:s,name:o}=t;let i;e[0]!==s||e[1]!==o?(i=n.jsx(ce,{icon:s,name:o,size:"sm+"}),e[0]=s,e[1]=o,e[2]=i):i=e[2];let r;e[3]!==o?(r=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=a):a=e[5];let d;e[6]!==r?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[r,a]}),e[6]=r,e[7]=d):d=e[7];let l;e[8]!==i||e[9]!==d?(l=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=l):l=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==l?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,m]}),e[12]=l,e[13]=c):c=e[13],c}function $n(t){const e=k.c(10),{tile:s,prompts:o,isEditMode:i}=t,{open:r,startBlank:a,dialog:d,starting:l}=Ne(s.agentId),m=o.filter(An),c=Ye(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==a?(f=()=>{a(c?{main:c}:void 0)},e[0]=c,e[1]=a,e[2]=f):f=e[2];const p=l||i;let h;e[3]!==f||e[4]!==p?(h=n.jsx("button",{type:"button",onClick:f,disabled:p,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=p,e[5]=h):h=e[5];const x=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(b=>n.jsx("button",{type:"button",onClick:()=>!i&&r(b),disabled:l,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let y;return e[6]!==d||e[7]!==h||e[8]!==x?(y=n.jsxs("div",{className:u,children:[h,x,d]}),e[6]=d,e[7]=h,e[8]=x,e[9]=y):y=e[9],y}function An(t){return!!t.promptName}function et({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:o,tiles:i}=be(e.slug),r=ze()?.ids??[],a=new Set(r),d=Oe(),l=Ue(),m=xe(),c=new Set(i.map(g=>g.agentId)),u=new Map;for(const g of o){const w=u.get(g.agentId);w?w.push(g):u.set(g.agentId,[g])}const f=o.filter(g=>!c.has(g.agentId)),p=[...i.map(g=>({kind:"tile",id:bn(g),data:g})),...f.map(g=>({kind:"prompt",id:yn(g),data:g}))],h=new Map(p.map(g=>[g.id,g])),x=fn(p.map(g=>({id:g.id,defaultSize:g.kind==="tile"?hn:gn,minSize:g.kind==="tile"?xn:void 0,pinned:a.has(g.data.agentId)}))),y=g=>{d.apply(w=>w.filter(S=>S!==g)).catch(()=>U.error("Couldn't remove from home — please try again."))},b=async g=>{if(i.filter(S=>S.agentId===g.agentId).length<=1){y(g.agentId);return}try{const C=(await l.call("COLLECTION_VIRTUAL_MCP_GET",{id:g.agentId})).item;if(!C)throw new Error("Agent not found");const _=Z(C.metadata?.ui),I=g.tileId?_.filter(T=>T.tileId!==g.tileId):_.filter(T=>T.connectionId!==g.connectionId||T.resourceUri!==g.resourceUri);await l.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:g.agentId,data:{metadata:{...C.metadata??{},ui:{...C.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},v=g=>{const w=h.get(g);if(w){if(!a.has(w.data.agentId)){x.hideTile(g);return}w.kind==="tile"?b(w.data):y(w.data.agentId)}},N=g=>{const w=h.get(g.id);if(!w)return null;if(w.kind==="tile"){const S=u.get(w.data.agentId)??[];return n.jsx(it,{fallback:n.jsx($n,{tile:w.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(kn,{icon:w.data.agentIcon,name:w.data.agentName}),children:n.jsx(_n,{tile:w.data,prompts:S,isEditMode:t,tileWidth:g.w})})})}return n.jsx(Nn,{entry:w.data,isEditMode:t})};return s||x.isLoading?n.jsx(wn,{}):x.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(nn,{tiles:x.snapshot.visible,isEditMode:t,renderTile:N,onMove:x.moveTile,onResize:x.resizeTile,onRemove:v})})}function Pn(t){const e=k.c(2),{prompts:s,tiles:o}=be(t),i=o.length>0||s.length>0;let r;return e[0]!==i?(r={hasVisibleTiles:i},e[0]=i,e[1]=r):r=e[1],r}const Ie=420,Te=305;function tt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ie}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ie}}),t[1]=s):s=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Te}}),t[2]=o):o=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,o,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Te}})]}),t[3]=i):i=t[3],i}function ke(){const t=k.c(33),{data:e}=ot.useSession(),{org:s}=J(),o=ge(),i=hs(),{selectedVirtualMcp:r}=vt();let a;t[0]!==s.id?(a=ct(s.id),t[0]=s.id,t[1]=a):a=t[1];const l=r??a;let m;t[2]!==s.slug?(m=Dt(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:dt,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ae(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=fs(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==s.slug?(p=Ot(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=p):p=t[12];let h;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(h=ft(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=h):h=t[16];let x;t[17]!==f||t[18]!==p||t[19]!==h?(x={queries:[f,p,h]},t[17]=f,t[18]=p,t[19]=h,t[20]=x):x=t[20],rt(x);const y=ps(),b=pt(l.id),{hasDecoKey:v,isZeroBalance:N,isInitialFreeCredit:j,balanceDollars:g,hasOnlyDecoProvider:w}=Et(),{hasVisibleTiles:S}=Pn(s.slug),C=Mt(b?.metadata);if(y.length===0&&!(C&&zt(i))){let L;return t[21]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Nt,{})})}),t[21]=L):L=t[21],L}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const T=I,P=v&&j&&g!=null,M=v&&N&&w;let z;t[24]!==g||t[25]!==P||t[26]!==M?(z=P?n.jsx(oe.CreditsEyebrow,{balanceDollars:g}):M?n.jsx(oe.NoCreditsEyebrow,{}):null,t[24]=g,t[25]=P,t[26]=M,t[27]=z):z=t[27];const B=z;let O;return t[28]!==B||t[29]!==S||t[30]!==o||t[31]!==T?(O=n.jsx(Ys,{children:o?n.jsx(En,{eyebrow:B,userName:T}):n.jsx(Mn,{eyebrow:B,userName:T,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=o,t[31]=T,t[32]=O):O=t[32],O}function En(t){const e=k.c(12),{eyebrow:s,userName:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(tt,{}),e[0]=i):i=e[0];let r;e[1]!==s?(r=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=r):r=e[2];let a;e[3]!==o?(a=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",o,"?"]}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==r||e[6]!==a?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[r,a]}),e[5]=r,e[6]=a,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(oe.Input,{showConnectionsBanner:!0})}),e[8]=l):l=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(et,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,l,m]}),e[10]=d,e[11]=c):c=e[11],c}function Mn(t){const e=k.c(32),{eyebrow:s,userName:o,hasVisibleTiles:i}=t,{isEditMode:r,enter:a,save:d,cancel:l,hasChanges:m}=Ze(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let p;e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==r||e[5]!==d?(p=n.jsx(xs.Right,{children:n.jsx(zn,{isEditMode:r,hasChanges:m,onEnter:a,onSave:d,onCancel:l,onAddTile:f})}),e[1]=l,e[2]=a,e[3]=m,e[4]=r,e[5]=d,e[6]=p):p=e[6];let h;e[7]!==c?(h=n.jsx(ys,{open:c,onOpenChange:u}),e[7]=c,e[8]=h):h=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(tt,{}),e[9]=x):x=e[9];const y=i||r?"pt-32":"flex-1 justify-center";let b;e[10]!==y?(b=Q("relative flex flex-col items-center px-10 pb-4",y),e[10]=y,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let N;e[14]!==o?(N=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",o,"?"]}),e[14]=o,e[15]=N):N=e[15];let j;e[16]!==v||e[17]!==N?(j=n.jsxs("div",{className:"text-center mb-10",children:[v,N]}),e[16]=v,e[17]=N,e[18]=j):j=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"relative w-full",children:[n.jsx(On,{}),n.jsx(oe.Input,{showConnectionsBanner:!0})]}),e[19]=g):g=e[19];let w;e[20]!==j?(w=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[j,g]}),e[20]=j,e[21]=w):w=e[21];let S;e[22]!==r?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(et,{isEditMode:r})}),e[22]=r,e[23]=S):S=e[23];let C;e[24]!==w||e[25]!==S||e[26]!==b?(C=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[x,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:b,children:[w,S]})})]}),e[24]=w,e[25]=S,e[26]=b,e[27]=C):C=e[27];let _;return e[28]!==C||e[29]!==p||e[30]!==h?(_=n.jsxs(n.Fragment,{children:[p,h,C]}),e[28]=C,e[29]=p,e[30]=h,e[31]=_):_=e[31],_}function zn(t){const e=k.c(17),{isEditMode:s,hasChanges:o,onEnter:i,onSave:r,onCancel:a,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx($e,{size:14}),e[3]=f):f=e[3];let p;e[4]!==a?(p=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:a,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=a,e[5]=p):p=e[5];const h=!o;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(ht,{size:14}),e[6]=x):x=e[6];let y;e[7]!==r||e[8]!==h?(y=n.jsxs(Y,{size:"sm",onClick:r,disabled:h,className:"gap-1.5 h-7 text-xs",children:[x,"Save"]}),e[7]=r,e[8]=h,e[9]=y):y=e[9];let b;return e[10]!==u||e[11]!==p||e[12]!==y?(b=n.jsxs(n.Fragment,{children:[u,p,y]}),e[10]=u,e[11]=p,e[12]=y,e[13]=b):b=e[13],b}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(jt,{size:14}),e[14]=l):l=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[l,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function On(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function Ko(){const t=k.c(2);if(ge()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(ke,{})}),t[0]=o):o=t[0],o}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(ke,{})})})}),t[1]=s):s=t[1],s}export{Ko as default};
@@ -1 +0,0 @@
1
- import{c as it,r as E,j as e,i as rt}from"./index-BK387j8D.js";import{S as mt,b as pt,c as st,d as at}from"./sheet-5r4gvmz4.js";import{S as nt}from"./scroll-area-NHg75EXM.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-DTO2x-C2.js";import{p as xt}from"./index-DYjFitmS.js";import"./X-Dq3oJiz6.js";import"./agent-icon-BM8MQ5be.js";import"./AlertCircle-B9i_x3yX.js";import"./Tool01-B4amg9yB.js";import"./SwitchHorizontal01-DHUuncY2.js";import"./Settings02-CPxYREBE.js";import"./XCircle-7nuhx8NX.js";import"./ArrowUpRight-cF0mnN41.js";import"./ZapSquare-CL8vn24R.js";import"./Users03-CCVhW9kg.js";import"./CheckCircle-zzRIg2zR.js";import"./ChevronUp-CFXuZkVg.js";import"./ChevronDown-D4rBo5Cd.js";import"./ChevronRight-CDn6HuCQ.js";import"./DotsVertical-CyO7wZv3.js";import"./Stars02-D8az_5Af.js";import"./Eye-DJjniuqY.js";import"./ZoomOut-CLFft6BA.js";import"./Globe01-Do2q7EuB.js";import"./FilterLines-C7d-9ZQk.js";import"./Star01-z6-lfdui.js";import"./Globe04-Mvw3976B.js";import"./HardDrive-Ci17wnKW.js";import"./Key01-BiZk1T91.js";import"./LayoutLeft-BMp-06Ch.js";import"./LinkExternal01-BIEuCHKR.js";import"./Monitor01-DNKFU3PW.js";import"./Sun-CCi4P6Lh.js";import"./Palette-CB1NQWQN.js";import"./Play-An8HsyAi.js";import"./Plus-D3xgmWdX.js";import"./SearchLg-BYw4LhiQ.js";import"./SearchMd-BYsRf8JG.js";import"./Shield01-Dr2T7xLf.js";import"./Stars01-ZkDAuQwr.js";import"./Trash01-BcusIWqe.js";import"./Upload01-Dj1G7JBU.js";import"./User01-NcvWezb3.js";import"./Users01-CbnVd6yD.js";import"./XClose-Bqzfjmh3.js";import"./Zap-BNW86-w0.js";import"./use-clock-tick-CVbq_r0l.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Bwnp2CVs.js";import"./tooltip-AP6mu2Do.js";import"./file-type-icon-weqtDXd8.js";import"./dialog-C45rhbs4.js";import"./use-mobile-DUjtY1Or.js";import"./tab-id-AX1D_RMI.js";import"./content-blocks-o63cs2vh.js";import"./types-CbEn8FkC.js";import"./use-mcp-client-B7wTW6Za.js";import"./auth-BU0GeO8h.js";import"./chat-context-PzKbUAil.js";import"./hooks-BxVsJBlY.js";import"./decopilot-sse-pool-DOCSJwAs.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CKtNavH6.js";import"./use-collections-6pmiM0Qb.js";import"./use-ai-providers-f1eJK-kn.js";import"./studio-tools-D0ivYLyr.js";import"./use-decopilot-events-BW75euWo.js";import"./use-organization-settings-C9fqfs_P.js";import"./shell-layout-B6f6Mezi.js";import"./avatar-BP2FzYvw.js";import"./alert-dialog-BvMgbTr9.js";import"./required-auth-layout-w72qbqCL.js";import"./use-org-sso-UVp5OsHW.js";import"./integration-icon-BWhOzvug.js";import"./use-navigate-to-agent-CCsB3ZB_.js";import"./use-connection-COqYPxZz.js";import"./use-mcp-prompts-BYKvWRs7.js";import"./form-CXezR26M.js";import"./label-DoALhGxW.js";import"./input-DvLfRoZW.js";import"./select-neJjS-sd.js";import"./switch-pC1-GX3d.js";import"./index-IRZqLymo.js";import"./drawer-DfEPwI8N.js";import"./collection-search-FrO71oF0.js";import"./tabs-mXxKVCyL.js";import"./toggle-group-B1Y3vdU4.js";import"./sortable.esm-CF7laJH4.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-5hK-b_ZU.js";import"./use-registry-connections-xn3NRt1I.js";import"./useInfiniteQuery-Cy3rKkmY.js";import"./use-infinite-scroll-CT70Yzl7.js";import"./extract-connection-data-DhnwqdMi.js";import"./card-DuBMqYZm.js";import"./collection-tabs-CjIQ8mgh.js";import"./badge-KNqQ-xkh.js";import"./textarea-EExQ_9H4.js";import"./connection-form-helpers-BaOBFUzF.js";import"./authenticate-and-persist-oauth-Bwuou5N5.js";import"./mcp-oauth-DvrxuFpt.js";import"./useSuspenseInfiniteQuery-AFWRY55D.js";import"./connect-desktop-dialog-8s9YrP8w.js";import"./decopilot-MP52Tp89.js";import"./checkbox-fYp407Fh.js";import"./skeleton-BZmNkJzm.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CDE63k2k.js";import"./popover-DQyFV8gm.js";import"./command-Bnhz7-1L.js";import"./index-BZUEFC59.js";import"./use-org-fs-C4gEIpOa.js";import"./dropdown-menu-ChAsKxcd.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-DsOqPmRX.js";import"./task-status-URAtGr6i.js";import"./use-status-sounds-zZf0duMU.js";import"./empty-state-DW1Hxncl.js";import"./toolbar-DCRlrcKI.js";import"./index-DlzujfAy.js";import"./use-debounced-value-cb2W_ITw.js";import"./index-DW2ObUy5.js";import"./toolbar-icon-button-BVVbHoc7.js";import"./use-mcp-tools-R4ecAJwu.js";import"./use-capability-Dd2n6N0i.js";import"./tools-list-Dg1n34t2.js";import"./use-debounced-autosave-BAzJX42Z.js";import"./index-Bb1TAV4I.js";import"./sidebar-X-9G9EvR.js";import"./search-input-Co7OLTCa.js";import"./github-repo-picker-CJ3K7Ssu.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-B1Y6lxEc.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./automation-runs-JsZo9EC7.js";import"./table-CE8mNTWi.js";import"./use-members-uN-CIzro.js";import"./use-org-auth-client-BvnffwO5.js";import"./use-automations-Dzb7eJ_x.js";import"./use-file-configs-Bud6_vwO.js";import"./monaco-editor-CA9h_ekf.js";import"./select-model-C5-1Nf3S.js";import"./automation-list-row-CIaxBCOJ.js";function mi(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{mi as SeoSheet};
@@ -1 +0,0 @@
1
- import{c as $,D as H,j as A}from"./index-BK387j8D.js";import{l as L,g as E,s as y}from"./scroll-area-NHg75EXM.js";import{p as O,u as k}from"./use-mcp-client-B7wTW6Za.js";import{b as q,c as B}from"./use-mcp-tools-R4ecAJwu.js";import{u as Y}from"./index-DYjFitmS.js";import{c as G}from"./content-blocks-o63cs2vh.js";import{g as K,M as V,a as w}from"./types-CbEn8FkC.js";import{u as z,b as F}from"./chat-context-PzKbUAil.js";import{b as J}from"./shell-layout-B6f6Mezi.js";import"./agent-icon-BM8MQ5be.js";import"./AlertCircle-B9i_x3yX.js";import"./Tool01-B4amg9yB.js";import"./SwitchHorizontal01-DHUuncY2.js";import"./Settings02-CPxYREBE.js";import"./XCircle-7nuhx8NX.js";import"./ArrowUpRight-cF0mnN41.js";import"./ZapSquare-CL8vn24R.js";import"./Users03-CCVhW9kg.js";import"./CheckCircle-zzRIg2zR.js";import"./ChevronUp-CFXuZkVg.js";import"./ChevronDown-D4rBo5Cd.js";import"./ChevronRight-CDn6HuCQ.js";import"./DotsVertical-CyO7wZv3.js";import"./Stars02-D8az_5Af.js";import"./Eye-DJjniuqY.js";import"./ZoomOut-CLFft6BA.js";import"./Globe01-Do2q7EuB.js";import"./FilterLines-C7d-9ZQk.js";import"./Star01-z6-lfdui.js";import"./Globe04-Mvw3976B.js";import"./HardDrive-Ci17wnKW.js";import"./Key01-BiZk1T91.js";import"./LayoutLeft-BMp-06Ch.js";import"./LinkExternal01-BIEuCHKR.js";import"./Monitor01-DNKFU3PW.js";import"./Sun-CCi4P6Lh.js";import"./Palette-CB1NQWQN.js";import"./Play-An8HsyAi.js";import"./Plus-D3xgmWdX.js";import"./SearchLg-BYw4LhiQ.js";import"./SearchMd-BYsRf8JG.js";import"./Shield01-Dr2T7xLf.js";import"./Stars01-ZkDAuQwr.js";import"./Trash01-BcusIWqe.js";import"./Upload01-Dj1G7JBU.js";import"./User01-NcvWezb3.js";import"./Users01-CbnVd6yD.js";import"./XClose-Bqzfjmh3.js";import"./X-Dq3oJiz6.js";import"./Zap-BNW86-w0.js";import"./use-clock-tick-CVbq_r0l.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Bwnp2CVs.js";import"./tooltip-AP6mu2Do.js";import"./file-type-icon-weqtDXd8.js";import"./dialog-C45rhbs4.js";import"./use-mobile-DUjtY1Or.js";import"./tab-id-AX1D_RMI.js";import"./hooks-BxVsJBlY.js";import"./decopilot-sse-pool-DOCSJwAs.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-D0ivYLyr.js";import"./sheet-5r4gvmz4.js";import"./integration-icon-BWhOzvug.js";import"./use-virtual-mcp-CKtNavH6.js";import"./use-collections-6pmiM0Qb.js";import"./use-navigate-to-agent-CCsB3ZB_.js";import"./use-connection-COqYPxZz.js";import"./use-mcp-prompts-BYKvWRs7.js";import"./form-CXezR26M.js";import"./label-DoALhGxW.js";import"./input-DvLfRoZW.js";import"./select-neJjS-sd.js";import"./auth-BU0GeO8h.js";import"./index-IRZqLymo.js";import"./drawer-DfEPwI8N.js";import"./collection-search-FrO71oF0.js";import"./tabs-mXxKVCyL.js";import"./toggle-group-B1Y3vdU4.js";import"./sortable.esm-CF7laJH4.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-5hK-b_ZU.js";import"./use-registry-connections-xn3NRt1I.js";import"./use-organization-settings-C9fqfs_P.js";import"./useInfiniteQuery-Cy3rKkmY.js";import"./use-infinite-scroll-CT70Yzl7.js";import"./extract-connection-data-DhnwqdMi.js";import"./card-DuBMqYZm.js";import"./collection-tabs-CjIQ8mgh.js";import"./badge-KNqQ-xkh.js";import"./textarea-EExQ_9H4.js";import"./connection-form-helpers-BaOBFUzF.js";import"./authenticate-and-persist-oauth-Bwuou5N5.js";import"./mcp-oauth-DvrxuFpt.js";import"./useSuspenseInfiniteQuery-AFWRY55D.js";import"./use-ai-providers-f1eJK-kn.js";import"./connect-desktop-dialog-8s9YrP8w.js";import"./decopilot-MP52Tp89.js";import"./checkbox-fYp407Fh.js";import"./skeleton-BZmNkJzm.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-BP2FzYvw.js";import"./settings-section-CDE63k2k.js";import"./popover-DQyFV8gm.js";import"./command-Bnhz7-1L.js";import"./index-BZUEFC59.js";import"./use-org-fs-C4gEIpOa.js";import"./dropdown-menu-ChAsKxcd.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-DsOqPmRX.js";import"./task-status-URAtGr6i.js";import"./use-status-sounds-zZf0duMU.js";import"./use-decopilot-events-BW75euWo.js";import"./empty-state-DW1Hxncl.js";import"./toolbar-DCRlrcKI.js";import"./index-DlzujfAy.js";import"./alert-dialog-BvMgbTr9.js";import"./use-debounced-value-cb2W_ITw.js";import"./index-DW2ObUy5.js";import"./toolbar-icon-button-BVVbHoc7.js";import"./use-capability-Dd2n6N0i.js";import"./tools-list-Dg1n34t2.js";import"./switch-pC1-GX3d.js";import"./use-debounced-autosave-BAzJX42Z.js";import"./index-Bb1TAV4I.js";import"./sidebar-X-9G9EvR.js";import"./search-input-Co7OLTCa.js";import"./github-repo-picker-CJ3K7Ssu.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-B1Y6lxEc.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./automation-runs-JsZo9EC7.js";import"./table-CE8mNTWi.js";import"./use-members-uN-CIzro.js";import"./use-org-auth-client-BvnffwO5.js";import"./use-automations-Dzb7eJ_x.js";import"./use-file-configs-Bud6_vwO.js";import"./monaco-editor-CA9h_ekf.js";import"./select-model-C5-1Nf3S.js";import"./automation-list-row-CIaxBCOJ.js";import"./required-auth-layout-w72qbqCL.js";import"./use-org-sso-UVp5OsHW.js";const Q={};function W(S){const t=$.c(37),{client:r,resourceURI:h,tool:o,connectionId:p,orgId:l,args:M}=S,{sendMessage:I}=z(),{setAppContext:u,clearAppContext:n}=F(),{setChatOpen:f,openTab:g}=J(),e=`${p}:${o.name}`;let a;t[0]!==g?(a=C=>C==="inline"?(g("0"),"inline"):"fullscreen",t[0]=g,t[1]=a):a=t[1];const m=a,s=M??Q;let c;t[2]!==r||t[3]!==o.name||t[4]!==s?(c={client:r,toolName:o.name,toolArguments:s},t[2]=r,t[3]=o.name,t[4]=s,t[5]=c):c=t[5];const{data:i}=B(c);let x;if(t[6]!==o._meta||t[7]!==o.name){const C=E(o._meta);x=y(o.name,C),t[6]=o._meta,t[7]=o.name,t[8]=x}else x=t[8];const U=x;let d;t[9]!==o.inputSchema?(d=o.inputSchema??{type:"object"},t[9]=o.inputSchema,t[10]=d):d=t[10];let N;t[11]!==U||t[12]!==d||t[13]!==o?(N={...o,name:U,inputSchema:d},t[11]=U,t[12]=d,t[13]=o,t[14]=N):N=t[14];const b=N;let _;t[15]!==I||t[16]!==f?(_=C=>{const D=G(C.content);D.content.length>0&&(f(!0),I({tiptapDoc:D}))},t[15]=I,t[16]=f,t[17]=_):_=t[17];const j=_;let P;t[18]!==b?(P={tool:b},t[18]=b,t[19]=P):P=t[19];let T;t[20]!==u||t[21]!==e?(T=C=>u(e,C),t[20]=u,t[21]=e,t[22]=T):T=t[22];let R;t[23]!==n||t[24]!==e?(R=()=>n(e),t[23]=n,t[24]=e,t[25]=R):R=t[25];let v;return t[26]!==r||t[27]!==j||t[28]!==m||t[29]!==l||t[30]!==h||t[31]!==P||t[32]!==T||t[33]!==R||t[34]!==s||t[35]!==i?(v=A.jsx(V,{resourceURI:h,orgId:l,toolInfo:P,toolInput:s,toolResult:i,displayMode:"fullscreen",minHeight:w.fullscreen.minHeight,maxHeight:w.fullscreen.maxHeight,client:r,onMessage:j,onUpdateModelContext:T,onTeardown:R,onRequestDisplayMode:m,className:"h-full"}),t[26]=r,t[27]=j,t[28]=m,t[29]=l,t[30]=h,t[31]=P,t[32]=T,t[33]=R,t[34]=s,t[35]=i,t[36]=v):v=t[36],v}function we(S){const t=$.c(24),{connectionId:r,toolName:h,args:o}=S,{org:p}=H(),l=Y();let M;t[0]!==r||t[1]!==l?(M=O(r)&&l.vmEntry?.sandboxProviderKind==="user-desktop"&&l.previewUrl?`${l.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=r,t[1]=l,t[2]=M):M=t[2];const I=M;let u;t[3]!==r||t[4]!==I||t[5]!==p.id||t[6]!==p.slug?(u={connectionId:r,orgId:p.id,orgSlug:p.slug,mcpUrl:I},t[3]=r,t[4]=I,t[5]=p.id,t[6]=p.slug,t[7]=u):u=t[7];const n=k(u);let f;t[8]!==n?(f={client:n},t[8]=n,t[9]=f):f=t[9];const{data:g}=q(f);let e,a,m;t[10]!==h||t[11]!==g.tools?(e=L(decodeURIComponent(h)),m=g.tools.find(i=>i.name===e)??g.tools.find(i=>{const x=E(i._meta);if(!x)return!1;if(y(i.name,x)===e)return!0;const d=y(e,x);return d!==e&&i.name===d}),a=m?._meta?K(m._meta):void 0,t[10]=h,t[11]=g.tools,t[12]=e,t[13]=a,t[14]=m):(e=t[12],a=t[13],m=t[14]);const s=a;if(!m||!s){let i;return t[15]!==e?(i=A.jsx("div",{className:"flex items-center justify-center h-full w-full",children:A.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',e,'" not found or has no UI']})}),t[15]=e,t[16]=i):i=t[16],i}let c;return t[17]!==o||t[18]!==n||t[19]!==r||t[20]!==p.id||t[21]!==s||t[22]!==m?(c=A.jsx(W,{client:n,resourceURI:s,tool:m,connectionId:r,orgId:p.id,args:o}),t[17]=o,t[18]=n,t[19]=r,t[20]=p.id,t[21]=s,t[22]=m,t[23]=c):c=t[23],c}export{we as AppViewContent};
@@ -1 +0,0 @@
1
- import{c as S,j as r}from"./index-BK387j8D.js";import{I as T}from"./input-DvLfRoZW.js";import{L as C}from"./label-DoALhGxW.js";import{T as L}from"./textarea-EExQ_9H4.js";import{au as A,av as R,at as D,aw as J,ax as K}from"./index-DYjFitmS.js";import{u as M,s as P}from"./primitives-B6uu6gyb.js";import"./index-IRZqLymo.js";import"./SwitchHorizontal01-DHUuncY2.js";import"./chat-context-PzKbUAil.js";import"./hooks-BxVsJBlY.js";import"./use-mcp-client-B7wTW6Za.js";import"./auth-BU0GeO8h.js";import"./decopilot-sse-pool-DOCSJwAs.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CKtNavH6.js";import"./use-collections-6pmiM0Qb.js";import"./use-ai-providers-f1eJK-kn.js";import"./studio-tools-D0ivYLyr.js";import"./use-decopilot-events-BW75euWo.js";import"./tab-id-AX1D_RMI.js";import"./use-organization-settings-C9fqfs_P.js";import"./scroll-area-NHg75EXM.js";import"./agent-icon-BM8MQ5be.js";import"./AlertCircle-B9i_x3yX.js";import"./Tool01-B4amg9yB.js";import"./Settings02-CPxYREBE.js";import"./XCircle-7nuhx8NX.js";import"./ArrowUpRight-cF0mnN41.js";import"./ZapSquare-CL8vn24R.js";import"./Users03-CCVhW9kg.js";import"./CheckCircle-zzRIg2zR.js";import"./ChevronUp-CFXuZkVg.js";import"./ChevronDown-D4rBo5Cd.js";import"./ChevronRight-CDn6HuCQ.js";import"./DotsVertical-CyO7wZv3.js";import"./Stars02-D8az_5Af.js";import"./Eye-DJjniuqY.js";import"./ZoomOut-CLFft6BA.js";import"./Globe01-Do2q7EuB.js";import"./FilterLines-C7d-9ZQk.js";import"./Star01-z6-lfdui.js";import"./Globe04-Mvw3976B.js";import"./HardDrive-Ci17wnKW.js";import"./Key01-BiZk1T91.js";import"./LayoutLeft-BMp-06Ch.js";import"./LinkExternal01-BIEuCHKR.js";import"./Monitor01-DNKFU3PW.js";import"./Sun-CCi4P6Lh.js";import"./Palette-CB1NQWQN.js";import"./Play-An8HsyAi.js";import"./Plus-D3xgmWdX.js";import"./SearchLg-BYw4LhiQ.js";import"./SearchMd-BYsRf8JG.js";import"./Shield01-Dr2T7xLf.js";import"./Stars01-ZkDAuQwr.js";import"./Trash01-BcusIWqe.js";import"./Upload01-Dj1G7JBU.js";import"./User01-NcvWezb3.js";import"./Users01-CbnVd6yD.js";import"./XClose-Bqzfjmh3.js";import"./X-Dq3oJiz6.js";import"./Zap-BNW86-w0.js";import"./use-clock-tick-CVbq_r0l.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Bwnp2CVs.js";import"./tooltip-AP6mu2Do.js";import"./file-type-icon-weqtDXd8.js";import"./dialog-C45rhbs4.js";import"./use-mobile-DUjtY1Or.js";import"./content-blocks-o63cs2vh.js";import"./types-CbEn8FkC.js";import"./shell-layout-B6f6Mezi.js";import"./avatar-BP2FzYvw.js";import"./alert-dialog-BvMgbTr9.js";import"./required-auth-layout-w72qbqCL.js";import"./use-org-sso-UVp5OsHW.js";import"./sheet-5r4gvmz4.js";import"./integration-icon-BWhOzvug.js";import"./use-navigate-to-agent-CCsB3ZB_.js";import"./use-connection-COqYPxZz.js";import"./use-mcp-prompts-BYKvWRs7.js";import"./form-CXezR26M.js";import"./select-neJjS-sd.js";import"./drawer-DfEPwI8N.js";import"./collection-search-FrO71oF0.js";import"./tabs-mXxKVCyL.js";import"./toggle-group-B1Y3vdU4.js";import"./sortable.esm-CF7laJH4.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-5hK-b_ZU.js";import"./use-registry-connections-xn3NRt1I.js";import"./useInfiniteQuery-Cy3rKkmY.js";import"./use-infinite-scroll-CT70Yzl7.js";import"./extract-connection-data-DhnwqdMi.js";import"./card-DuBMqYZm.js";import"./collection-tabs-CjIQ8mgh.js";import"./badge-KNqQ-xkh.js";import"./connection-form-helpers-BaOBFUzF.js";import"./authenticate-and-persist-oauth-Bwuou5N5.js";import"./mcp-oauth-DvrxuFpt.js";import"./useSuspenseInfiniteQuery-AFWRY55D.js";import"./connect-desktop-dialog-8s9YrP8w.js";import"./decopilot-MP52Tp89.js";import"./checkbox-fYp407Fh.js";import"./skeleton-BZmNkJzm.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CDE63k2k.js";import"./popover-DQyFV8gm.js";import"./command-Bnhz7-1L.js";import"./index-BZUEFC59.js";import"./use-org-fs-C4gEIpOa.js";import"./dropdown-menu-ChAsKxcd.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-DsOqPmRX.js";import"./task-status-URAtGr6i.js";import"./use-status-sounds-zZf0duMU.js";import"./empty-state-DW1Hxncl.js";import"./toolbar-DCRlrcKI.js";import"./index-DlzujfAy.js";import"./use-debounced-value-cb2W_ITw.js";import"./index-DW2ObUy5.js";import"./toolbar-icon-button-BVVbHoc7.js";import"./use-mcp-tools-R4ecAJwu.js";import"./use-capability-Dd2n6N0i.js";import"./tools-list-Dg1n34t2.js";import"./switch-pC1-GX3d.js";import"./use-debounced-autosave-BAzJX42Z.js";import"./index-Bb1TAV4I.js";import"./sidebar-X-9G9EvR.js";import"./search-input-Co7OLTCa.js";import"./github-repo-picker-CJ3K7Ssu.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-B1Y6lxEc.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./automation-runs-JsZo9EC7.js";import"./table-CE8mNTWi.js";import"./use-members-uN-CIzro.js";import"./use-org-auth-client-BvnffwO5.js";import"./use-automations-Dzb7eJ_x.js";import"./use-file-configs-Bud6_vwO.js";import"./monaco-editor-CA9h_ekf.js";import"./select-model-C5-1Nf3S.js";import"./automation-list-row-CIaxBCOJ.js";const $={authors:[{key:"name",label:"Name",widget:"text"},{key:"email",label:"Email",widget:"text",placeholder:"author@example.com"},{key:"jobTitle",label:"Job title",widget:"text"},{key:"company",label:"Company",widget:"text"},{key:"avatar",label:"Avatar",widget:"image"}]},q={authors:"Author"};function Nr(B){const t=S.c(34),{orgSlug:v,virtualMcpId:j,branch:w,kind:p,blockKey:g,block:f}=B;let y;t[0]!==w||t[1]!==v||t[2]!==j?(y={orgSlug:v,virtualMcpId:j,branch:w},t[0]=w,t[1]=v,t[2]=j,t[3]=y):y=t[3];const m=A(y);let d;t[4]!==f||t[5]!==p?(d=R(f,p),t[4]=f,t[5]=p,t[6]=d):d=t[6];const F=d;let h;t[7]!==g||t[8]!==p||t[9]!==m?(h=e=>{m.mutate({blockKey:g,data:J(g,p,e)})},t[7]=g,t[8]=p,t[9]=m,t[10]=h):h=t[10];const[i,E]=M(F,h);let k;t[11]!==i||t[12]!==E?(k=(e,o)=>E({...i,[e]:o}),t[11]=i,t[12]=E,t[13]=k):k=t[13];const a=k,N=q[p];let s;t[14]!==N?(s=r.jsx("span",{className:"text-sm font-medium",children:N}),t[14]=N,t[15]=s):s=t[15];let l;t[16]!==m.isError||t[17]!==m.isPending?(l=r.jsx(D,{isPending:m.isPending,isError:m.isError}),t[16]=m.isError,t[17]=m.isPending,t[18]=l):l=t[18];let n;t[19]!==s||t[20]!==l?(n=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[s,l]}),t[19]=s,t[20]=l,t[21]=n):n=t[21];const I=$[p];let c;if(t[22]!==i||t[23]!==a||t[24]!==I){let e;t[26]!==i||t[27]!==a?(e=o=>r.jsx("div",{className:"space-y-2",children:o.widget==="image"?r.jsx(K,{schema:{type:"string",format:"image-uri",title:o.label},value:i[o.key],onChange:u=>a(o.key,u),path:o.key,label:o.label}):r.jsxs(r.Fragment,{children:[r.jsx(C,{htmlFor:o.key,children:o.label}),o.widget==="textarea"?r.jsx(L,{id:o.key,value:P(i[o.key]),onChange:u=>a(o.key,u.target.value),rows:3}):r.jsx(T,{id:o.key,value:P(i[o.key]),placeholder:o.placeholder,onChange:u=>a(o.key,u.target.value),className:"h-10"})]})},o.key),t[26]=i,t[27]=a,t[28]=e):e=t[28],c=I.map(e),t[22]=i,t[23]=a,t[24]=I,t[25]=c}else c=t[25];let x;t[29]!==c?(x=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:c})}),t[29]=c,t[30]=x):x=t[30];let b;return t[31]!==x||t[32]!==n?(b=r.jsxs("div",{className:"flex h-full flex-col",children:[n,x]}),t[31]=x,t[32]=n,t[33]=b):b=t[33],b}export{Nr as RecordEditor};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BTgVNCIw.js","assets/index-BK387j8D.js","assets/index-BcXb7VeZ.css","assets/XCircle-7nuhx8NX.js","assets/CheckCircle-zzRIg2zR.js","assets/Settings02-CPxYREBE.js","assets/use-mcp-client-B7wTW6Za.js","assets/auth-BU0GeO8h.js","assets/useInfiniteQuery-Cy3rKkmY.js","assets/use-infinite-scroll-CT70Yzl7.js","assets/studio-tools-D0ivYLyr.js","assets/badge-KNqQ-xkh.js","assets/input-DvLfRoZW.js","assets/dropdown-menu-ChAsKxcd.js","assets/ChevronUp-CFXuZkVg.js","assets/ChevronRight-CDn6HuCQ.js","assets/DotsVertical-CyO7wZv3.js","assets/table-CE8mNTWi.js","assets/toggle-group-B1Y3vdU4.js","assets/use-view-mode-rzzoxJSf.js","assets/use-mobile-DUjtY1Or.js","assets/FilterLines-C7d-9ZQk.js","assets/Globe01-Do2q7EuB.js","assets/SearchMd-BYsRf8JG.js","assets/dialog-C45rhbs4.js","assets/X-Dq3oJiz6.js","assets/AlertCircle-B9i_x3yX.js","assets/Upload01-Dj1G7JBU.js","assets/alert-dialog-BvMgbTr9.js","assets/card-DuBMqYZm.js","assets/Trash01-BcusIWqe.js","assets/label-DoALhGxW.js","assets/select-neJjS-sd.js","assets/tooltip-AP6mu2Do.js","assets/ChevronDown-D4rBo5Cd.js","assets/switch-pC1-GX3d.js","assets/textarea-EExQ_9H4.js","assets/checkbox-fYp407Fh.js","assets/Eye-DJjniuqY.js","assets/LinkExternal01-BIEuCHKR.js","assets/use-copy-Bwnp2CVs.js","assets/Key01-BiZk1T91.js","assets/Plus-D3xgmWdX.js","assets/mcp-oauth-DvrxuFpt.js","assets/Play-An8HsyAi.js"])))=>i.map(i=>d[i]);
2
- import{c as s,j as e,r as i,i as a,ak as o}from"./index-BK387j8D.js";import{R as m}from"./require-capability-CJGLcYrf.js";import"./use-capability-Dd2n6N0i.js";import"./access-gate-C4hUJNh_.js";import"./capability-load-error-CGz8Hngs.js";const n=i.lazy(()=>o(()=>import("./registry-layout-BTgVNCIw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44])));function f(){const r=s.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(m,{capability:"registry:manage",area:"the registry",children:e.jsx(i.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(n,{})})}),r[0]=t):t=r[0],t}export{f as default};