decocms 4.37.0 → 4.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/client/assets/{AlertCircle-C3XBF3Lj.js → AlertCircle-C_PthZj6.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BAyBOox4.js → ArrowUpRight-BSkV0Y-z.js} +1 -1
  3. package/dist/client/assets/{Check-BBbJanyi.js → Check-Cw0Pux21.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-CUAoW5BF.js → CheckCircle-DXkzqqRn.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CdhVz413.js → ChevronDown-tyYdFFfN.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-DSkRxyMp.js → ChevronRight-Bp9Io_hH.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-VC09djpz.js → ChevronUp-BDxY0uOY.js} +1 -1
  8. package/dist/client/assets/{Circle-BaBs0XFQ.js → Circle-BQUenMg_.js} +1 -1
  9. package/dist/client/assets/{Copy01-BqGbD9kh.js → Copy01-UmEcysvC.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-Dx7q3hEM.js → DotsVertical-nFg2bvfQ.js} +1 -1
  11. package/dist/client/assets/{Eye-m_jc4WHC.js → Eye-DoFssO56.js} +1 -1
  12. package/dist/client/assets/{FilterLines-DJ3lRTxj.js → FilterLines-6oxbuqLc.js} +1 -1
  13. package/dist/client/assets/{Globe01-C7l3-Kj_.js → Globe01-4Io5Q5oH.js} +1 -1
  14. package/dist/client/assets/{Globe04-C3kyaQkX.js → Globe04-CBxhZ9DF.js} +1 -1
  15. package/dist/client/assets/{HardDrive-BfnTWF0w.js → HardDrive-B2Py5XJ7.js} +1 -1
  16. package/dist/client/assets/{Key01-DJufXC5l.js → Key01-DikplODM.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-C7UYEc8w.js → LayoutLeft-CV7E_mEk.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-DHPLvAlj.js → LinkExternal01-1GdBgEJT.js} +1 -1
  19. package/dist/client/assets/{List-DbYeo32c.js → List-WvV777Nw.js} +1 -1
  20. package/dist/client/assets/{Loading02-BfehCN_S.js → Loading02-BGVoIGFK.js} +1 -1
  21. package/dist/client/assets/{Monitor01-z8KVt_1L.js → Monitor01-BhP2GkDG.js} +1 -1
  22. package/dist/client/assets/{Palette-D0EiCOKi.js → Palette-CikHpF85.js} +1 -1
  23. package/dist/client/assets/{Play-DPT-Lr30.js → Play-B4Dza96H.js} +1 -1
  24. package/dist/client/assets/{Plus-DaZdxod6.js → Plus-D8900ruL.js} +1 -1
  25. package/dist/client/assets/{SearchLg-DxD_D_4n.js → SearchLg-CDJFrdhB.js} +1 -1
  26. package/dist/client/assets/{SearchMd-ByN3gshP.js → SearchMd-CQOcswg1.js} +1 -1
  27. package/dist/client/assets/{Settings02-iM-HC30X.js → Settings02-BEcVpM65.js} +1 -1
  28. package/dist/client/assets/{Shield01-B9NrENV2.js → Shield01-DVles1UP.js} +1 -1
  29. package/dist/client/assets/{Star01-D7maP7yw.js → Star01-DVz-gdnw.js} +1 -1
  30. package/dist/client/assets/{Stars01-DlXhHEac.js → Stars01-GRWLejM9.js} +1 -1
  31. package/dist/client/assets/{Stars02-CKZjtcO2.js → Stars02-D_szsQqn.js} +1 -1
  32. package/dist/client/assets/{Sun-D7S1ER7S.js → Sun-Bk2_vrQo.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-mHS8gX9f.js → SwitchHorizontal01-Bhmk7tVC.js} +1 -1
  34. package/dist/client/assets/{Tool01-NvZF1kAv.js → Tool01-Df55fGNY.js} +1 -1
  35. package/dist/client/assets/{Trash01-BXE2cBJq.js → Trash01-6WbDZXYo.js} +1 -1
  36. package/dist/client/assets/{Upload01-CypbVjGY.js → Upload01-D1fijbBc.js} +1 -1
  37. package/dist/client/assets/{User01-BB062KFn.js → User01-DonmcoFi.js} +1 -1
  38. package/dist/client/assets/{Users01-CffdXVAr.js → Users01-Ib6iUkOG.js} +1 -1
  39. package/dist/client/assets/{Users03-DSGWvEeU.js → Users03-D6LJk7D1.js} +1 -1
  40. package/dist/client/assets/{X-De82F_yV.js → X-D2_BxPBZ.js} +1 -1
  41. package/dist/client/assets/{XCircle-CrMyqBpn.js → XCircle-D6CNfdWM.js} +1 -1
  42. package/dist/client/assets/{XClose-Dg02sB1B.js → XClose-umwYAfKv.js} +1 -1
  43. package/dist/client/assets/{Zap-BtxkJShL.js → Zap-By-Y3fc8.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-BxP2mvwj.js → ZapSquare-BDx12cHv.js} +1 -1
  45. package/dist/client/assets/{ZoomOut-BORQEG0K.js → ZoomOut-CfuTFATb.js} +1 -1
  46. package/dist/client/assets/{access-gate-dqsmHXiw.js → access-gate-C0sy2zqS.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-xO_CAcV_.js → add-section-modal-Ctuv6kFN.js} +1 -1
  48. package/dist/client/assets/{agent-capabilities-B0Jsdt6p.js → agent-capabilities-BKC-lAH2.js} +1 -1
  49. package/dist/client/assets/{agent-icon-CQDdwbbu.js → agent-icon-9qUhvZ_l.js} +1 -1
  50. package/dist/client/assets/{agents-list-B9KJ5-Vw.js → agents-list-D94QHZAF.js} +1 -1
  51. package/dist/client/assets/{ai-providers-lgYH3fgi.js → ai-providers-DQ9T0tZ0.js} +1 -1
  52. package/dist/client/assets/{alert-47bgUaZb.js → alert-DITqZgvb.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-C9L2oZsl.js → alert-dialog-Cbe29PU-.js} +1 -1
  54. package/dist/client/assets/{app-editor-CO9hxiJL.js → app-editor-tY5xe4zn.js} +1 -1
  55. package/dist/client/assets/{auth-Dh53AhUb.js → auth-bWEKUdTf.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-D0mVmCTA.js → auth-catchall-B5D6d-3k.js} +1 -1
  57. package/dist/client/assets/{auth-entry-4fsXFx3P.js → auth-entry-DYbV_aW-.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-su8sCQDw.js → auth-split-layout-CsNTp71f.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-Dju715T5.js → authenticate-and-persist-oauth-B4V0nutT.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-BuZlqyz_.js → automation-list-row-DlvRlMED.js} +1 -1
  61. package/dist/client/assets/{automation-runs-Ddmvrziu.js → automation-runs-CwGnE6KL.js} +1 -1
  62. package/dist/client/assets/{automations-Bq2rlYLZ.js → automations-B4UsSZk7.js} +1 -1
  63. package/dist/client/assets/{autosend-U-xpRpSE.js → autosend-DhKVY0lc.js} +1 -1
  64. package/dist/client/assets/{avatar-CBGAelvW.js → avatar-BD72OpJK.js} +1 -1
  65. package/dist/client/assets/{badge-BPlPS6-U.js → badge-DZ4-Z7-Q.js} +1 -1
  66. package/dist/client/assets/{block-document-xFTCKSCF.js → block-document-BqxAhKJs.js} +2 -2
  67. package/dist/client/assets/{brand-context-0GQL71Th.js → brand-context-KRqE2eki.js} +1 -1
  68. package/dist/client/assets/{breadcrumb-Dtuz1MwX.js → breadcrumb-Dxgyd2_b.js} +1 -1
  69. package/dist/client/assets/{buckets-B0SQVvMa.js → buckets-B2tSGALr.js} +1 -1
  70. package/dist/client/assets/{bulk-category-panel-B8lTxEat.js → bulk-category-panel-A78JGopv.js} +1 -1
  71. package/dist/client/assets/{calendar-CrC0GPqv.js → calendar-CSR-wYJE.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-BNkXTJQ4.js → capability-load-error-W6lLqJna.js} +1 -1
  73. package/dist/client/assets/{card-1rWslgPf.js → card-AHKmAyCM.js} +1 -1
  74. package/dist/client/assets/category-editor-ZAG7ALbo.js +1 -0
  75. package/dist/client/assets/chat-context-BQ0BEwTQ.js +28 -0
  76. package/dist/client/assets/{checkbox-CIo6Fidy.js → checkbox-Dy_uphk8.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-DWfLlt4Z.js → cli-auth-success-0eOwSiTr.js} +1 -1
  78. package/dist/client/assets/{collection-detail-D-PuNBNa.js → collection-detail-DIRpwsjf.js} +1 -1
  79. package/dist/client/assets/{collection-display-button-DacysYX0.js → collection-display-button-D2z7WwZf.js} +1 -1
  80. package/dist/client/assets/{collection-search-BQbTxwoW.js → collection-search-DkPfMNHi.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-Bve5fpBU.js → collection-table-wrapper-BhkgGpsE.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-CoU3ihMK.js → collection-tabs-jT8eUHhG.js} +1 -1
  83. package/dist/client/assets/{command-1aG03_je.js → command-WWFXnqCm.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-B_JppzGN.js → commerce-onboarding-Dxwrc32F.js} +1 -1
  85. package/dist/client/assets/{connect-desktop-dialog-9CJopn2Q.js → connect-desktop-dialog-WyaJMC9Z.js} +1 -1
  86. package/dist/client/assets/{connection-card-BX64E0ZX.js → connection-card-GPBwW2P-.js} +1 -1
  87. package/dist/client/assets/{connection-detail-C4wtieIN.js → connection-detail-BZmqRExy.js} +1 -1
  88. package/dist/client/assets/{connection-form-helpers-CFnSkiaw.js → connection-form-helpers-C9Utnc5Z.js} +1 -1
  89. package/dist/client/assets/{connections-DYwCZqw1.js → connections-zDUNgfz5.js} +1 -1
  90. package/dist/client/assets/{decopilot-sse-pool-moj0w8Vo.js → decopilot-sse-pool-St_q2wjk.js} +1 -1
  91. package/dist/client/assets/{dialog-C3IuPH3f.js → dialog-BfrsaX8o.js} +1 -1
  92. package/dist/client/assets/{domain-settings-iC6xNktr.js → domain-settings-Du2OcMqR.js} +1 -1
  93. package/dist/client/assets/{drawer-DNygCL0g.js → drawer-DsgyEqbz.js} +1 -1
  94. package/dist/client/assets/{dropdown-menu-KKF-lxCP.js → dropdown-menu-CWbvB5EW.js} +1 -1
  95. package/dist/client/assets/{empty-state-BKnsu1Gz.js → empty-state-D4qf_Ogz.js} +1 -1
  96. package/dist/client/assets/{extract-connection-data-baLEbDV8.js → extract-connection-data-9sOh6tRB.js} +1 -1
  97. package/dist/client/assets/{file-explorer-B28iuflM.js → file-explorer-DY9Ii5wu.js} +1 -1
  98. package/dist/client/assets/{file-type-icon-D3hb0Drj.js → file-type-icon-CANvRqic.js} +1 -1
  99. package/dist/client/assets/{files-DH0E_awG.js → files-DE1NKViA.js} +1 -1
  100. package/dist/client/assets/{form-B3R-A37u.js → form-CePVVa6f.js} +1 -1
  101. package/dist/client/assets/{general-CprE_KO_.js → general-CHpARtXA.js} +1 -1
  102. package/dist/client/assets/{github-repo-picker-DUcUZ8Lg.js → github-repo-picker-KqfKyvL6.js} +1 -1
  103. package/dist/client/assets/{hooks-DqC-czl4.js → hooks-Ceqm53Lo.js} +1 -1
  104. package/dist/client/assets/{index-i5Akvaks.js → index-7ICNP1jy.js} +1 -1
  105. package/dist/client/assets/{index-CZ6_AyFs.js → index-9sLf1EMJ.js} +1 -1
  106. package/dist/client/assets/{index-ADar06lH.js → index-BPFX-wYw.js} +27 -27
  107. package/dist/client/assets/index-BQNRTve8.js +1 -0
  108. package/dist/client/assets/{index-CE5H3VpT.js → index-Bjk4ISMv.js} +3 -3
  109. package/dist/client/assets/{index-DBjfCYVU.js → index-C6jPDHV-.js} +1 -1
  110. package/dist/client/assets/{index-HXaQVvR_.js → index-CLFokapL.js} +1 -1
  111. package/dist/client/assets/{index-DqD1ib5M.js → index-CiXCvRGn.js} +1 -1
  112. package/dist/client/assets/{index-BVvioSjf.js → index-CjBIHW6t.js} +1 -1
  113. package/dist/client/assets/{index-BvCZtoIo.js → index-Dnc5NPOZ.js} +1 -1
  114. package/dist/client/assets/{index-2AWMloEK.js → index-DwjyT7Zo.js} +1 -1
  115. package/dist/client/assets/{index-BwFf1RZV.js → index-E4kBSHu2.js} +1 -1
  116. package/dist/client/assets/{index-DBc0WuE4.js → index-Gjjc3OAP.js} +1 -1
  117. package/dist/client/assets/index-WuJzpm3C.js +1 -0
  118. package/dist/client/assets/{index-redirect-DyxEdUUV.js → index-redirect-C88-RQNe.js} +1 -1
  119. package/dist/client/assets/{input-kOQaqTZ-.js → input-D4fkRfxT.js} +1 -1
  120. package/dist/client/assets/{integration-icon-BDMIArBS.js → integration-icon-DEGzAck0.js} +1 -1
  121. package/dist/client/assets/{invite-member-dialog-Ccpti3hZ.js → invite-member-dialog-BJQ9g04H.js} +1 -1
  122. package/dist/client/assets/{label-xBJ0yPUA.js → label-CbO_uYES.js} +1 -1
  123. package/dist/client/assets/{login-B91dGbPX.js → login-BBgyWLz8.js} +1 -1
  124. package/dist/client/assets/{mcp-oauth-BvfQRZ3m.js → mcp-oauth-C_bFU3Gc.js} +1 -1
  125. package/dist/client/assets/{members-CbYnYStp.js → members-Dy_oe4Uo.js} +1 -1
  126. package/dist/client/assets/{monaco-editor-BFTtBdRV.js → monaco-editor-BhBBMupc.js} +1 -1
  127. package/dist/client/assets/{monitoring-stats-row-C6O1EZbT.js → monitoring-stats-row-B4rVWk9I.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-Br9ETgLh.js → oauth-callback-DIjlkOpl.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-ai-provider-CsLWWfd4.js → oauth-callback-ai-provider-D1ufWwOs.js} +1 -1
  130. package/dist/client/assets/{onboarding-CICAWNdF.js → onboarding-DhznWZoR.js} +1 -1
  131. package/dist/client/assets/{org-install-De7fgbM7.js → org-install-DK_F0TSm.js} +1 -1
  132. package/dist/client/assets/{org-layout-CRJY3sFD.js → org-layout-DVx8y1so.js} +1 -1
  133. package/dist/client/assets/{organization-choice-BW8OCXSY.js → organization-choice-Cpfd_wDc.js} +1 -1
  134. package/dist/client/assets/{page-seo-form-DYaVDnHX.js → page-seo-form-CMYzopS-.js} +1 -1
  135. package/dist/client/assets/page-seo-sheet-uWZ8BMlL.js +1 -0
  136. package/dist/client/assets/{popover-CLvqhSp6.js → popover-B4BtLjPZ.js} +1 -1
  137. package/dist/client/assets/{post-editor-J8xsTyoR.js → post-editor-CDVir2pV.js} +1 -1
  138. package/dist/client/assets/{primitives-DofUlhoU.js → primitives-B9WcCiGT.js} +1 -1
  139. package/dist/client/assets/{profile-DNJeTzOW.js → profile-0K_9o87Q.js} +1 -1
  140. package/dist/client/assets/project-app-view-AKCf2pxf.js +1 -0
  141. package/dist/client/assets/record-editor-B4pUmSC7.js +1 -0
  142. package/dist/client/assets/registry-Bo8FI0tO.js +2 -0
  143. package/dist/client/assets/{registry-layout-BWORV1jh.js → registry-layout-DBASd3QS.js} +1 -1
  144. package/dist/client/assets/{require-capability-CWyRktcv.js → require-capability-BLyKPVtk.js} +1 -1
  145. package/dist/client/assets/{required-auth-layout-C7z1SSP_.js → required-auth-layout-BOxyFvzi.js} +1 -1
  146. package/dist/client/assets/{reset-password-8VrpqEw1.js → reset-password-46XxrG9J.js} +1 -1
  147. package/dist/client/assets/{roles-DkujgzrZ.js → roles-CRutApip.js} +1 -1
  148. package/dist/client/assets/{search-input-DmhKRv1z.js → search-input-Bh2soUz8.js} +1 -1
  149. package/dist/client/assets/{secrets-C2XUJSf4.js → secrets-9wLuhkbO.js} +1 -1
  150. package/dist/client/assets/{sections-editor-B9OImJFz.js → sections-editor-DC3pSRsZ.js} +2 -2
  151. package/dist/client/assets/{select-model-CNBU35Uk.js → select-model-4EP19xDe.js} +1 -1
  152. package/dist/client/assets/{select-p16t1oqR.js → select-ztDLr-BX.js} +1 -1
  153. package/dist/client/assets/{seo-editor-RVbznvc6.js → seo-editor-DEjqC7k4.js} +1 -1
  154. package/dist/client/assets/settings-layout-Exyn-x1v.js +1 -0
  155. package/dist/client/assets/{settings-section-iYQ69o_s.js → settings-section-0Mfaa9js.js} +1 -1
  156. package/dist/client/assets/{shell-controls-CA1LD88M.js → shell-controls-Bwf6yuaG.js} +1 -1
  157. package/dist/client/assets/{shell-layout-Ur6mRNK2.js → shell-layout-CsiSpURE.js} +1 -1
  158. package/dist/client/assets/{sidebar-DoDKf_4K.js → sidebar-BfjrAgmW.js} +1 -1
  159. package/dist/client/assets/{skeleton-H_BeyWZC.js → skeleton-0X0FQagz.js} +1 -1
  160. package/dist/client/assets/{sso-ChETt6h4.js → sso-BDZ9HrPf.js} +1 -1
  161. package/dist/client/assets/{store-DGgxbYxi.js → store-1HCUn-_N.js} +1 -1
  162. package/dist/client/assets/store-registry-Bw1hDZJQ.js +2 -0
  163. package/dist/client/assets/{studio-tools-7Wg9yY_n.js → studio-tools-Dp2ea9aY.js} +1 -1
  164. package/dist/client/assets/{switch-DHEIkHtS.js → switch-CN_nXlQv.js} +1 -1
  165. package/dist/client/assets/{table-f2GQgPNW.js → table-BXRCuiKO.js} +1 -1
  166. package/dist/client/assets/{tabs-djg35jJe.js → tabs-RhNisUrs.js} +1 -1
  167. package/dist/client/assets/{textarea-BcDVHw10.js → textarea-DwRUaUdb.js} +1 -1
  168. package/dist/client/assets/{toggle-group-CyItOhMq.js → toggle-group-ClLg742B.js} +1 -1
  169. package/dist/client/assets/{toolbar-Bx2JvL88.js → toolbar-YMaa8UNc.js} +1 -1
  170. package/dist/client/assets/{toolbar-icon-button-Du8AVUGg.js → toolbar-icon-button--qtBPkiK.js} +1 -1
  171. package/dist/client/assets/{tools-list-aqaPnMDt.js → tools-list-DBjEXb-O.js} +1 -1
  172. package/dist/client/assets/{tooltip-Cg3rQVMP.js → tooltip-DuUNXwuH.js} +1 -1
  173. package/dist/client/assets/{types-B-PIV7tw.js → types-B0nrm435.js} +1 -1
  174. package/dist/client/assets/{use-ai-providers-BLYI7is3.js → use-ai-providers-CROILssk.js} +1 -1
  175. package/dist/client/assets/{use-automations-C2_4_jPZ.js → use-automations-BLZS3nCt.js} +1 -1
  176. package/dist/client/assets/{use-capability-B58SdY6m.js → use-capability-C4rDcWK1.js} +1 -1
  177. package/dist/client/assets/{use-clock-tick-KJrFAFXc.js → use-clock-tick-Cg3dqyaj.js} +1 -1
  178. package/dist/client/assets/{use-collections-FdPpYeY0.js → use-collections-DBNnpK3C.js} +1 -1
  179. package/dist/client/assets/{use-connection-Bnuwr5M1.js → use-connection-DpAYk0pY.js} +1 -1
  180. package/dist/client/assets/{use-copy-LQlzIxLa.js → use-copy-CjgIuSjk.js} +1 -1
  181. package/dist/client/assets/{use-create-virtual-mcp-B3rhipHX.js → use-create-virtual-mcp-BNI3peJt.js} +1 -1
  182. package/dist/client/assets/{use-debounced-autosave-CtV7p_Pr.js → use-debounced-autosave-4U2Wankb.js} +1 -1
  183. package/dist/client/assets/{use-debounced-value-wokrtNfu.js → use-debounced-value-DSh1Y-X9.js} +1 -1
  184. package/dist/client/assets/{use-decopilot-events-CFzSYSZ0.js → use-decopilot-events-DX5hcV5D.js} +1 -1
  185. package/dist/client/assets/{use-delete-connection-Ck-8BuQD.js → use-delete-connection-skcQCnGe.js} +1 -1
  186. package/dist/client/assets/{use-file-configs-NGX_LaaZ.js → use-file-configs-BTXKniia.js} +1 -1
  187. package/dist/client/assets/{use-infinite-scroll-DQs52IQI.js → use-infinite-scroll-DKHyKqtw.js} +1 -1
  188. package/dist/client/assets/{use-join-requests-D_YCRqVN.js → use-join-requests-ndvip1Om.js} +1 -1
  189. package/dist/client/assets/{use-mcp-client-ZBC-eCDx.js → use-mcp-client-wsLqAdJf.js} +1 -1
  190. package/dist/client/assets/{use-mcp-prompts-CccYNdu3.js → use-mcp-prompts-bSr7PkxJ.js} +1 -1
  191. package/dist/client/assets/{use-mcp-tools-FxYZ1Cxx.js → use-mcp-tools-Dsxl1ers.js} +1 -1
  192. package/dist/client/assets/{use-members-V-W3kQEI.js → use-members-ZMMUHevE.js} +1 -1
  193. package/dist/client/assets/{use-mobile-BGgRMBqg.js → use-mobile-Dtj1ar2K.js} +1 -1
  194. package/dist/client/assets/{use-navigate-to-agent-Dn2BNzaE.js → use-navigate-to-agent-D_vEzydG.js} +1 -1
  195. package/dist/client/assets/{use-org-auth-client-BvkB8WEw.js → use-org-auth-client-Be-9Eftp.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-B_WqXsc5.js → use-org-sso-piNvTxIb.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-DgnZyn8W.js → use-organization-roles-KxgBLbf1.js} +1 -1
  198. package/dist/client/assets/use-organization-settings-B9F-hGcN.js +1 -0
  199. package/dist/client/assets/{use-registry-connections-DMa9GcRc.js → use-registry-connections-1qWaLib_.js} +1 -1
  200. package/dist/client/assets/{use-secrets-DEtr_hQU.js → use-secrets-C1l33zOr.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-CnHm0wXx.js → use-status-sounds-mCinm18z.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-CWq1V6tJ.js → use-view-mode-oLkIRu_O.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-DOdyKPNe.js → use-virtual-mcp-h9Ui0Bre.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-LsNZKlJR.js +1 -0
  205. package/dist/client/assets/useSuspenseInfiniteQuery-BHzaAyrY.js +1 -0
  206. package/dist/client/assets/{variant-calendar-CgL7sZ3f.js → variant-calendar-t93Hb4Tm.js} +1 -1
  207. package/dist/client/assets/{view-mode-toggle-DjWw19bb.js → view-mode-toggle-D6OE9IgI.js} +1 -1
  208. package/dist/client/index.html +1 -1
  209. package/dist/server/cli.js +475 -475
  210. package/dist/server/migrate.js +119 -119
  211. package/dist/server/server.js +315 -315
  212. package/package.json +1 -1
  213. package/dist/client/assets/category-editor-BEYHYIOn.js +0 -1
  214. package/dist/client/assets/chat-context-E29cn9cH.js +0 -28
  215. package/dist/client/assets/index-KeXOZRMC.js +0 -1
  216. package/dist/client/assets/index-rzCgJdfY.js +0 -1
  217. package/dist/client/assets/page-seo-sheet-Bn8OGTea.js +0 -1
  218. package/dist/client/assets/project-app-view-CV-Yq4-x.js +0 -1
  219. package/dist/client/assets/record-editor-CJ95zNme.js +0 -1
  220. package/dist/client/assets/registry-BVGN4erV.js +0 -2
  221. package/dist/client/assets/settings-layout-CX_9MTmF.js +0 -1
  222. package/dist/client/assets/store-registry-2DaMvGmB.js +0 -2
  223. package/dist/client/assets/use-organization-settings-B0Nwjkeh.js +0 -1
  224. package/dist/client/assets/useInfiniteQuery-D3w5TQxr.js +0 -1
  225. package/dist/client/assets/useSuspenseInfiniteQuery-bZ1w_AdM.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "4.37.0",
3
+ "version": "4.39.0",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{c as G,r as S,l as Q,j as t,B as I,i as V,t as U}from"./index-CE5H3VpT.js";import{i as X}from"./XCircle-CrMyqBpn.js";import{aC as Y,H as T}from"./agent-icon-CQDdwbbu.js";import{n as Z}from"./LinkExternal01-DHPLvAlj.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-C9L2oZsl.js";import{I as L}from"./input-kOQaqTZ-.js";import{L as H}from"./label-xBJ0yPUA.js";import{k as at,l as mt,J as nt,S as lt,m as R,o as pt,L as ct}from"./index-ADar06lH.js";import{c as dt,B as ut,a as gt}from"./block-document-xFTCKSCF.js";import{u as xt,s as v,E as ft}from"./primitives-DofUlhoU.js";import{t as ht}from"./ChevronDown-CdhVz413.js";import{J as jt,K as yt,I as vt}from"./automation-runs-Ddmvrziu.js";import"./AlertCircle-C3XBF3Lj.js";import"./Tool01-NvZF1kAv.js";import"./SwitchHorizontal01-mHS8gX9f.js";import"./Settings02-iM-HC30X.js";import"./ArrowUpRight-BAyBOox4.js";import"./ZapSquare-BxP2mvwj.js";import"./Users03-DSGWvEeU.js";import"./Loading02-BfehCN_S.js";import"./CheckCircle-CUAoW5BF.js";import"./Check-BBbJanyi.js";import"./ChevronRight-DSkRxyMp.js";import"./ChevronUp-VC09djpz.js";import"./Circle-BaBs0XFQ.js";import"./Stars02-CKZjtcO2.js";import"./Copy01-BqGbD9kh.js";import"./ZoomOut-BORQEG0K.js";import"./DotsVertical-Dx7q3hEM.js";import"./Globe01-C7l3-Kj_.js";import"./Eye-m_jc4WHC.js";import"./FilterLines-DJ3lRTxj.js";import"./Star01-D7maP7yw.js";import"./Globe04-C3kyaQkX.js";import"./HardDrive-BfnTWF0w.js";import"./Key01-DJufXC5l.js";import"./LayoutLeft-C7UYEc8w.js";import"./List-DbYeo32c.js";import"./Monitor01-z8KVt_1L.js";import"./Sun-D7S1ER7S.js";import"./Palette-D0EiCOKi.js";import"./Play-DPT-Lr30.js";import"./Plus-DaZdxod6.js";import"./SearchLg-DxD_D_4n.js";import"./SearchMd-ByN3gshP.js";import"./Shield01-B9NrENV2.js";import"./Stars01-DlXhHEac.js";import"./Trash01-BXE2cBJq.js";import"./Upload01-CypbVjGY.js";import"./User01-BB062KFn.js";import"./Users01-CffdXVAr.js";import"./XClose-Dg02sB1B.js";import"./X-De82F_yV.js";import"./Zap-BtxkJShL.js";import"./chat-context-E29cn9cH.js";import"./autosend-U-xpRpSE.js";import"./hooks-DqC-czl4.js";import"./use-mcp-client-ZBC-eCDx.js";import"./constants-B72Xmt_K.js";import"./auth-Dh53AhUb.js";import"./decopilot-sse-pool-moj0w8Vo.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-DOdyKPNe.js";import"./use-collections-FdPpYeY0.js";import"./use-ai-providers-BLYI7is3.js";import"./studio-tools-7Wg9yY_n.js";import"./use-decopilot-events-CFzSYSZ0.js";import"./tab-id-DAJ8K7VA.js";import"./use-organization-settings-B0Nwjkeh.js";import"./tooltip-Cg3rQVMP.js";import"./dialog-C3IuPH3f.js";import"./drawer-DNygCL0g.js";import"./collection-search-BQbTxwoW.js";import"./use-mobile-BGgRMBqg.js";import"./use-mcp-prompts-CccYNdu3.js";import"./shell-layout-Ur6mRNK2.js";import"./avatar-CBGAelvW.js";import"./required-auth-layout-C7z1SSP_.js";import"./use-org-sso-B_WqXsc5.js";import"./form-B3R-A37u.js";import"./select-p16t1oqR.js";import"./tabs-djg35jJe.js";import"./toggle-group-CyItOhMq.js";import"./agent-capabilities-B0Jsdt6p.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BX64E0ZX.js";import"./use-registry-connections-DMa9GcRc.js";import"./use-connection-Bnuwr5M1.js";import"./useInfiniteQuery-D3w5TQxr.js";import"./use-infinite-scroll-DQs52IQI.js";import"./extract-connection-data-baLEbDV8.js";import"./card-1rWslgPf.js";import"./integration-icon-BDMIArBS.js";import"./collection-tabs-CoU3ihMK.js";import"./badge-BPlPS6-U.js";import"./textarea-BcDVHw10.js";import"./connection-form-helpers-CFnSkiaw.js";import"./authenticate-and-persist-oauth-Dju715T5.js";import"./mcp-oauth-BvfQRZ3m.js";import"./useSuspenseInfiniteQuery-bZ1w_AdM.js";import"./connect-desktop-dialog-9CJopn2Q.js";import"./select-model-CNBU35Uk.js";import"./checkbox-CIo6Fidy.js";import"./skeleton-H_BeyWZC.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-iYQ69o_s.js";import"./command-1aG03_je.js";import"./index-DBc0WuE4.js";import"./popover-CLvqhSp6.js";import"./dropdown-menu-KKF-lxCP.js";import"./index-HXaQVvR_.js";import"./file-type-icon-D3hb0Drj.js";import"./toolbar-Bx2JvL88.js";import"./use-debounced-value-wokrtNfu.js";import"./index-BwFf1RZV.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CnHm0wXx.js";import"./empty-state-BKnsu1Gz.js";import"./use-mcp-tools-FxYZ1Cxx.js";import"./types-B-PIV7tw.js";import"./use-capability-B58SdY6m.js";import"./tools-list-aqaPnMDt.js";import"./switch-DHEIkHtS.js";import"./use-debounced-autosave-CtV7p_Pr.js";import"./index-DqD1ib5M.js";import"./sidebar-DoDKf_4K.js";import"./search-input-DmhKRv1z.js";import"./github-repo-picker-DUcUZ8Lg.js";import"./use-navigate-to-agent-Dn2BNzaE.js";import"./reusable-new-chat-qqWu133U.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-DEtr_hQU.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-members-V-W3kQEI.js";import"./use-org-auth-client-BvkB8WEw.js";import"./index-CZ6_AyFs.js";import"./get-initials-D-f_fDFw.js";import"./format-time-Cy7tTmZp.js";import"./calendar-CrC0GPqv.js";import"./toolbar-icon-button-Du8AVUGg.js";import"./use-automations-C2_4_jPZ.js";import"./monaco-editor-BFTtBdRV.js";import"./automation-list-row-BuZlqyz_.js";import"./use-file-configs-NGX_LaaZ.js";import"./table-f2GQgPNW.js";import"./use-clock-tick-KJrFAFXc.js";import"./use-copy-LQlzIxLa.js";function bt(k){const e=G.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(jt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(yt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function pr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:n,data:R(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,j]=S.useState(a),[m,C]=S.useState(null),[N,$]=S.useState(!1),z=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],y=z.length,J=o=>s("slug",o),M=async(o,w)=>{const q=v(r.name);$(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:q,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:R(P,"posts",F)}),g+=1)}const E={...r,slug:w};await i.mutateAsync({blockKey:n,data:R(n,"categories",E)}),c(E),U.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){j(o),C(null),U.error(g instanceof Error?g.message:"Rename failed")}finally{$(!1)}},W=()=>{const o=B.trim();if(o===a){B!==o&&j(o);return}if(!o){j(a);return}if(y===0){J(o);return}C({oldSlug:a,newSlug:o,count:y})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:B,onChange:o=>j(o.target.value),onBlur:W,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[y," ",y===1?"post":"posts"," in this category"]})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),y>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(j(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&M(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{pr as CategoryEditor};
@@ -1,28 +0,0 @@
1
- import{c as ue,l as Ge,by as Xe,j as Q,cp as Ye,a0 as Le,p as Ne,$ as se,K as ge,t as ne,Y as le,V as de,b as qe,u as Fe,e as Ze,r as m,M as Je,a as et,a1 as tt,af as nt}from"./index-CE5H3VpT.js";import{A as je,c as st,a as ot,w as at}from"./autosend-U-xpRpSE.js";import{S as rt,u as it,d as ct,b as lt}from"./hooks-DqC-czl4.js";import{u as dt}from"./use-mcp-client-ZBC-eCDx.js";import{a as ut,S as pt}from"./constants-B72Xmt_K.js";import{u as ft}from"./use-virtual-mcp-DOdyKPNe.js";import{u as ht,a as me}from"./use-ai-providers-BLYI7is3.js";import{u as mt}from"./use-decopilot-events-CFzSYSZ0.js";import{q as gt,n as yt}from"./tab-id-DAJ8K7VA.js";import{f as St}from"./use-organization-settings-B0Nwjkeh.js";const xt={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"],codex:["codex:gpt-5.6-luna"]},vt={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"],codex:["codex:gpt-5.6-terra"]},It={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"],"claude-code":["claude-code:opus-1m","claude-code:opus","claude-code:sonnet"],codex:["codex:gpt-5.6-sol"]},Ct={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},kt={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},bt={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function Ue(t){return t.toLowerCase().replace(/[^a-z0-9]/g,"")}function Mt(t){return Ue(t).includes("deepresearch")}const Tt=["sonar","searchpreview","online"];function Qe(t){const e=Ue(t);return e.includes("deepresearch")?!1:Tt.some(n=>e.includes(n))}function Ke(t){return t.asyncResearch!==!0&&Qe(t.modelId)}function Ve(t){return t.asyncResearch===!0||Mt(t.modelId)||Qe(t.modelId)}function ie(t,e,n,s){for(const o of n){const a=t.find(r=>r.modelId===o);if(a)return{keyId:e,modelId:a.modelId,title:a.title}}for(const o of n){const a=t.find(r=>r.modelId.includes(o));if(a)return{keyId:e,modelId:a.modelId,title:a.title}}if(s){const o=t.find(s);if(o)return{keyId:e,modelId:o.modelId,title:o.title}}return null}function wt(t,e){const n={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const s of t){const o=e[s.id]??[],a=s.providerId;n.chat.fast||(n.chat.fast=ie(o,s.id,xt[a]??[])),n.chat.smart||(n.chat.smart=ie(o,s.id,vt[a]??[])),n.chat.thinking||(n.chat.thinking=ie(o,s.id,It[a]??[])),n.image||(n.image=ie(o,s.id,Ct[a]??[],r=>r.capabilities?.includes("image")===!0)),n.webSearch||(n.webSearch=ie(o,s.id,kt[a]??[],Ke)),n.deepResearch||(n.deepResearch=ie(o,s.id,bt[a]??[],Ve))}return n}const Et=Xe("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function mn(t){const e=ue.c(10),{variant:n,size:s}=t;let o;e[0]!==s||e[1]!==n?(o=Ge(Et({variant:n,size:s})),e[0]=s,e[1]=n,e[2]=o):o=e[2];let a,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=Q.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=Q.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=a,e[4]=r):(a=e[3],r=e[4]);let l;e[5]!==o?(l=Q.jsxs("svg",{"aria-hidden":"true",className:o,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a,r]}),e[5]=o,e[6]=l):l=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=Q.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=g):g=e[7];let S;return e[8]!==l?(S=Q.jsxs("div",{role:"status",children:[l,g]}),e[8]=l,e[9]=S):S=e[9],S}function At(t,e=[]){return t==="stop"?e.filter(o=>o.type==="text"&&o.text).map(o=>o.text).join(`
2
- `).replace(/https?:\/\/[^\s)>\]]+/g,"").includes("?")?"requires_action":"completed":t==="tool-calls"?e.some(s=>s.type==="tool-user_ask"&&s.state==="input-available"||s.state==="approval-requested")?"requires_action":"completed":"failed"}const Me={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"}};function _t(t,e){if(!t)return null;const n=e?Ye(e):null;if(t==="decopilot"&&n===null)return"decopilot";for(const[s,o]of Object.entries(Me))if(o.harness===t&&o.sandbox===n)return s;return null}function gn(t){return t.claudeCode?"claude-code-desktop":t.codex?"codex-desktop":null}function $t(t){return t.thread?.harness_id!=null?{}:{harnessId:t.globals.harnessId,sandboxProviderKind:t.globals.sandboxProviderKind,branch:t.globals.branch??null}}function Rt(t){const e=ue.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=n):n=e[0];const s=Le(n);let o;if(e[1]!==s?.params.appSlug||e[2]!==s?.params.collectionName||e[3]!==s?.params.itemId||e[4]!==t){o=[],t&&o.push(`### Selected Agent
3
- - ID: ${t}`);let a;e[6]!==s?.params.appSlug||e[7]!==s?.params.collectionName||e[8]!==s?.params.itemId?(a=[],s?.params.appSlug&&a.push(`- Connection ID: ${s?.params.appSlug}`),s?.params.collectionName&&a.push(`- Collection: ${s?.params.collectionName}`),s?.params.itemId&&a.push(`- Item ID: ${s?.params.itemId}`),e[6]=s?.params.appSlug,e[7]=s?.params.collectionName,e[8]=s?.params.itemId,e[9]=a):a=e[9],a.length>0&&o.push(`### Current Resource
4
- The user is viewing the following resource:
5
- ${a.join(`
6
- `)}
7
-
8
- Help the user understand and work with this resource.`),e[1]=s?.params.appSlug,e[2]=s?.params.collectionName,e[3]=s?.params.itemId,e[4]=t,e[5]=o}else o=e[5];return o.join(`
9
-
10
- `)}function Pt(){const t=ue.c(5),e=Ne(),{org:n}=se();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=s):s=t[0];const o=Le(s);let a;return t[1]!==o?.params||t[2]!==n||t[3]!==e?(a=r=>{const g=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!g||!g[1])return;const S=g[1],I=o?.params.appSlug;if(!I)return;e.invalidateQueries({queryKey:ge.collection(n.slug,I,S)});const T=S.toLowerCase().replace(/_/g," ");ne.success(`${T} updated`)},t[1]=o?.params,t[2]=n,t[3]=e,t[4]=a):a=t[4],a}function Dt(){const t=ue.c(4),{org:e,project:n}=se(),s=`${e.id}/${n.id}`;let o;t[0]!==s?(o=de.taskLastViewed(s),t[0]=s,t[1]=o):o=t[1];const[,a]=le(o,Ot);let r;return t[2]!==a?(r={markTaskRead:g=>{a(S=>({...S,[g]:new Date().toISOString()}))}},t[2]=a,t[3]=r):r=t[3],r}function Ot(t){return t??{}}function We(){const t=qe(),{org:e}=se(),n=Fe({strict:!1}),s=Ze({strict:!1}),o=n.virtualmcpid??ut(e.id).id,a=(g,S)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:g},search:I=>{const T={},N=S?.virtualMcpId??I.virtualmcpid;N&&(T.virtualmcpid=N);const p=I.main;return p&&typeof p=="string"&&!gt(p)&&(T.main=p),I.chat&&(T.chat=I.chat),S?.autosend&&(T.autosend=je),T}})},r=m.useRef(crypto.randomUUID()),l=s.taskId??r.current;return{virtualMcpId:o,taskId:l,navigateToTask:a}}function Lt(t,e){const{mimeType:n,data:s}=t;if(n.startsWith("text/"))try{const o=new TextDecoder().decode(Uint8Array.from(atob(s),a=>a.charCodeAt(0)));return[{type:"text",text:`${e}
11
- ${o}`}]}catch(o){console.error("Failed to decode text file:",o)}return[{type:"file",url:`data:${n};base64,${s}`,filename:e,mediaType:n}]}function Re(t,e){const n=[];for(const s of t)"text"in s&&s.text?n.push({type:"text",text:`[${e}]
12
- ${s.text}`}):"blob"in s&&s.blob&&s.mimeType&&n.push({type:"file",url:`data:${s.mimeType};base64,${s.blob}`,filename:String(s.uri),mediaType:String(s.mimeType)});return n}function Nt(t,e){const n=(t.files??[]).filter(r=>r.content?.trim()),s=t.omittedPaths??[];if(n.length===0&&s.length===0)return[];const o=n.map(r=>`<skill-file path="${r.relPath}">
13
- ${r.content.trim()}
14
- </skill-file>`).join(`
15
-
16
- `),a=s.length>0?`
17
-
18
- Other files in \`${t.sandboxPath}/\`: ${s.join(", ")}`:"";return[{type:"text",text:`[${e}]
19
- ${o}${a}`}]}function qt(t,e){const n=[];for(const s of t){if(s.role!=="user"||!s.content)continue;const o=Array.isArray(s.content)?s.content:[s.content];for(const a of o)switch(a.type){case"text":{const r=a.text?.trim();if(!r)continue;n.push({type:"text",text:`[${e}]
20
- ${r}`});break}case"image":case"audio":{if(!a.data||!a.mimeType)continue;n.push({type:"file",url:`data:${a.mimeType};base64,${a.data}`,mediaType:a.mimeType});break}case"resource":{const r=a.resource;if(!r||!r.mimeType)continue;r&&("text"in r&&r.text?n.push({type:"text",text:`[${e}]
21
- ${r.text}`}):"blob"in r&&r.blob&&r.mimeType&&n.push({type:"file",url:`data:${r.mimeType};base64,${r.blob}`,filename:String(r.uri),mediaType:String(r.mimeType)}));break}}}return n}function Be(t){if(!t)return[];const e=[];let n="";const s=o=>{if(o){if(o.type==="text"&&"text"in o&&typeof o.text=="string")n+=o.text;else if(o.type==="mention"&&o.attrs){const a=o.attrs.char??"/",r=`${a}${o.attrs.name}`;if(n+=r,a==="@"){const l=o.attrs.metadata;l&&!Array.isArray(l)&&"agentId"in l?e.push({type:"text",text:`[DELEGATE TO AGENT: ${l.title??o.attrs.name} (agent_id: ${l.agentId})]
22
- Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(l)&&e.push(...Re(l,r))}else if(o.attrs.kind==="skill"){const l=o.attrs.metadata;l&&!Array.isArray(l)&&Array.isArray(l.files)&&e.push(...Nt(l,r))}else{const l=o.attrs.metadata||o.attrs.prompts||[];Array.isArray(l)&&l.length>0&&"role"in l[0]?e.push(...qt(l,r)):Array.isArray(l)&&e.push(...Re(l,r))}}else if(o.type==="file"&&o.attrs){const a=o.attrs,r=`[file:://${encodeURIComponent(a.name)}]`;n+=r,e.push(...Lt(a,r))}if("content"in o&&Array.isArray(o.content))for(const a of o.content)s(a)}};return s(t),n.trim()&&e.unshift({type:"text",text:n.trim()}),e}function yn(t){const e=Be(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function Sn(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Ft(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function xn(t){return t.filter(e=>e.status==="queued").sort((e,n)=>e.enqueuedAt-n.enqueuedAt)}function jt(t,e){return t.some(n=>n.messageId===e.messageId)?t:[...t,e]}function Ut(t,e){return t.filter(n=>n.messageId!==e)}const Pe=new Map,we=new Set;function Qt(t){we.add(t)}function Kt(t){return we.has(t)}function Vt(t){we.delete(t)}function ye(t){let e=Pe.get(t);return e||(e=new rt([]),Pe.set(t,e)),e}function He(t,e){ye(t).update(n=>jt(n,e))}function Te(t,e){ye(t).update(n=>Ut(n,e))}function Wt(t,e){ye(t).set(e)}const Ie=new Map;function Bt(t,e){Ie.set(`${t}:${e.id}`,e)}function Ht(t,e){const n=`${t}:${e}`,s=Ie.get(n);return Ie.delete(n),s}function De(t,e){Ie.delete(`${t}:${e}`)}async function X(t,e){try{const n=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!n.ok)return;const s=await n.json();Wt(e,s.items??[])}catch{}}function vn(t){const e=ue.c(2);let n;e[0]!==t?(n=ye(t),e[0]=t,e[1]=n):n=e[1];const s=n;return m.useSyncExternalStore(s.subscribe,s.get,s.get)}function zt(){const{org:t}=se();return{enqueue:He,refresh:e=>X(t.slug,e),cancel:async(e,n)=>{const s=`thread-run:${e}:${n}`;Te(e,n);try{const o=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(s)}`,{method:"POST",credentials:"include"});if(!o.ok&&o.status!==404)throw new Error(`Cancel failed: ${o.status}`);return!0}catch(o){return ne.error(o instanceof Error?o.message:"Failed to cancel"),!1}finally{await X(t.slug,e)}}}}const Oe=new Set,ee=new Set;function ce(t){return m.useSyncExternalStore(t.subscribe,t.get,t.get)}function Gt(t){return t.kind==="loading"?"ready":t.kind}function te(t,e,n,s){if(!t)return null;const o=e.find(r=>r.id===t.keyId);if(!o)return null;const a=n.find(r=>r.modelId===t.modelId);return a?{...a,keyId:t.keyId}:{modelId:t.modelId,title:s??t.modelId,keyId:t.keyId,providerId:o.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function Xt(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function Yt(t,e,n,s){if(!n||s.length===0)return null;const o=e.find(g=>g.id===n);if(!o)return null;const a=wt([o],{[n]:s}),r=t==="fast"?a.chat.fast:t==="thinking"?a.chat.thinking:a.chat.smart;if(!r)return null;const l=s.find(g=>g.modelId===r.modelId);return l?{...l,keyId:n}:null}const Zt=1e4,Jt=10,Ee=m.createContext(null),Ae=m.createContext(null),_e=m.createContext(null),ze=m.createContext(null);function en({children:t}){const{locator:e}=se(),{virtualMcpId:n}=We(),[s,o]=le(de.chatSelectedImageModel(e),null),[a,r]=le(de.chatSelectedWebSearchModel(e),null),[l,g]=le(de.chatSelectedDeepResearchModel(e),null),[S,I]=m.useState(null),[T,N]=m.useState("default"),p=St(),[$,K]=le(de.chatSimpleModeTier(e),null),D=Xt($),C=ht(),k=p.tiers[D],R=S&&C.some(i=>i.id===S)?S:k?.keyId??C[0]?.id??null,{models:x,isLoading:V}=me(R??void 0),{models:H}=me(k?.keyId),{models:Y}=me(p.tiers.image?.keyId),{models:M}=me(p.tiers.web_search?.keyId),{models:W}=me(p.tiers.deep_research?.keyId),z=te(k,C,H,k?.title)??Yt(D,C,R,x),q=V,B=x.filter(i=>i.capabilities?.includes("image")),F=te(s,C,B),u=te(p.tiers.image,C,Y,p.tiers.image?.title)??F??B[0]??null,E=x.filter(Ke),O=te(a,C,E),Z=E.find(i=>i.modelId==="perplexity/sonar")??E[0]??null,j=te(p.tiers.web_search,C,M,p.tiers.web_search?.title)??O??Z,L=x.filter(Ve),b=te(l,C,L),v=L.find(i=>i.modelId==="perplexity/deep-research")??L.find(i=>i.asyncResearch===!0)??L[0]??null,G=te(p.tiers.deep_research,C,W,p.tiers.deep_research?.title)??b??v,Se=ft(n)??{id:n,title:"",description:null,icon:null},[Ce,fe]=m.useState({}),xe=(i,h)=>{const U=[];for(const y of h.content??[])y.type==="text"&&y.text?.trim()&&U.push(y.text.trim());const _=U.join(`
23
- `);if(!_){he(i);return}new TextEncoder().encode(_).length>Zt||fe(y=>Object.keys(y).length>=Jt&&!(i in y)?y:{...y,[i]:_})},he=i=>{fe(h=>{const{[i]:U,..._}=h;return _})},[oe,ke]=le(de.chatLastAgentOption(e),i=>i&&i in Me?i:null),J=sn(),be=J?.isThreadLocked&&J.lockedHarness!=null?_t(J.lockedHarness,J.lockedSandbox):null,$e=oe,ae=J?.isThreadLocked?be:$e,ve=ae?Me[ae]:null,c=ve?.harness??null,d=ve?.sandbox??null,[w,A]=m.useState(void 0),f=m.useRef(w);f.current=w;const P={selectedModel:z,setModel:()=>{},credentialId:R,setCredentialId:I,allModelsConnections:C,isModelsLoading:q,selectedVirtualMcp:Se,imageModel:u,setImageModel:i=>{o(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},webSearchModel:j,setWebSearchModel:i=>{r(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},deepResearchModel:G,setDeepResearchModel:i=>{g(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},chatMode:T,setChatMode:N,appContexts:Ce,setAppContext:xe,clearAppContext:he,tiptapDoc:w,setTiptapDoc:A,tiptapDocRef:f,resetInteraction:()=>{},simpleModeTier:D,setSimpleModeTier:i=>K(i),pendingAgentOption:ae,setPendingAgentOption:ke,pendingHarnessId:c,pendingSandboxProviderKind:d};return Q.jsx(_e.Provider,{value:P,children:t})}function In(t){const e=ue.c(41),{virtualMcpId:n,task:s,children:o}=t,{locator:a}=se(),{data:r}=et.useSession(),l=r?.user??null,{taskId:g,virtualMcpId:S,navigateToTask:I}=We(),[T]=tt(),{markTaskRead:N}=Dt(),p=lt(),$=g,K=S,D=Rt(K);let C;e[0]!==N||e[1]!==I?(C=(b,v)=>{N(b),I(b,{virtualMcpId:v?.virtualMcpId,autosend:v?.autosend})},e[0]=N,e[1]=I,e[2]=C):C=e[2];const k=C,R=$&&s?.id===$?s:null,x=R?.harness_id??null,V=R?.sandbox_provider_kind??null,H=R?.branch??null,Y=x!=null,M=H;let W;e[3]!==M||e[4]!==k||e[5]!==p||e[6]!==n?(W=()=>{const b=crypto.randomUUID();return p.create({id:b,virtual_mcp_id:n,...M?{branch:M}:{}}).then(()=>k(b)).catch(()=>{k(b)}),b},e[3]=M,e[4]=k,e[5]=p,e[6]=n,e[7]=W):W=e[7];const z=W;let q;e[8]!==M||e[9]!==a||e[10]!==k||e[11]!==p||e[12]!==n?(q=b=>{const v=crypto.randomUUID(),G=b.virtualMcpId??n,pe=G===n?M:null;at(sessionStorage,a,v,b.message),p.create({id:v,virtual_mcp_id:G,...pe?{branch:pe}:{}}).then(()=>k(v,{virtualMcpId:b.virtualMcpId,autosend:!0})).catch(()=>{k(v,{virtualMcpId:b.virtualMcpId,autosend:!0})})},e[8]=M,e[9]=a,e[10]=k,e[11]=p,e[12]=n,e[13]=q):q=e[13];const B=q;let F;e[14]!==$||e[15]!==p?(F=b=>{$&&p.setBranch($,b)},e[14]=$,e[15]=p,e[16]=F):F=e[16];let u;e[17]!==R||e[18]!==z||e[19]!==B||e[20]!==M||e[21]!==$||e[22]!==K||e[23]!==Y||e[24]!==H||e[25]!==x||e[26]!==V||e[27]!==k||e[28]!==F?(u={virtualMcpId:K,taskId:$,openTask:k,createTask:z,createTaskWithMessage:B,activeTask:R,isThreadLocked:Y,lockedHarness:x,lockedSandbox:V,lockedBranch:H,currentBranch:M,setCurrentTaskBranch:F},e[17]=R,e[18]=z,e[19]=B,e[20]=M,e[21]=$,e[22]=K,e[23]=Y,e[24]=H,e[25]=x,e[26]=V,e[27]=k,e[28]=F,e[29]=u):u=e[29];const E=u;let O;e[30]!==D||e[31]!==T||e[32]!==I||e[33]!==l?(O={user:l,contextPrompt:D,preferences:T,rawNavigateToTask:I},e[30]=D,e[31]=T,e[32]=I,e[33]=l,e[34]=O):O=e[34];const Z=O;let j;e[35]!==o||e[36]!==Z?(j=Q.jsx(en,{children:Q.jsx(ze.Provider,{value:Z,children:o})}),e[35]=o,e[36]=Z,e[37]=j):j=e[37];let L;return e[38]!==j||e[39]!==E?(L=Q.jsx(Ae.Provider,{value:E,children:j}),e[38]=j,e[39]=E,e[40]=L):L=e[40],L}function Cn({taskId:t,children:e}){const{virtualMcpId:n,activeTask:s,currentBranch:o}=tn();t&&!Oe.has(t)&&(Oe.add(t),Je("chat_opened",{thread_id:t}));const{imageModel:a,webSearchModel:r,deepResearchModel:l,chatMode:g,setChatMode:S,appContexts:I,setTiptapDoc:T,simpleModeTier:N,pendingSandboxProviderKind:p,pendingHarnessId:$}=nn(),K=m.useContext(ze);if(!K)throw new Error("ActiveTaskProvider must be used within ChatContextProvider");const{user:D,contextPrompt:C,preferences:k,rawNavigateToTask:R}=K,{org:x,locator:V}=se(),H=zt(),[Y,M]=m.useState(null),W=Pt(),z=Ne(),q=it(),B=qe(),F=dt({connectionId:pt,orgId:x.id,orgSlug:x.slug}),u=ct(x.slug,t,{client:F});m.use(u.ready);const E=ce(u.messages),O=ce(u.status),Z=ce(u.finishReason),j=ce(u.runStatusStage),L=ce(u.hasMoreOlder),b=ce(u.isFetchingOlder),v=m.useRef({onToolCall:W,queryClient:z,rawNavigateToTask:R,taskId:t,manager:q,navigate:B,orgId:x.id,orgSlug:x.slug});v.current={onToolCall:W,queryClient:z,rawNavigateToTask:R,taskId:t,manager:q,navigate:B,orgId:x.id,orgSlug:x.slug},mt({orgSlug:x.slug,taskId:t,onTaskStatus:c=>{const d=v.current,w=c.data.message_id;if(c.data.status==="in_progress"&&w){Te(d.taskId,w);const A=Ht(d.taskId,w);A&&u.applyLocalMessage(A),X(d.orgSlug,d.taskId)}Kt(d.taskId)&&(async()=>(await X(d.orgSlug,d.taskId),await u.reconcileFromServer()&&ye(d.taskId).get().length===0&&Vt(d.taskId)))()}}),m.useEffect(()=>{const c={onData:f=>{if(f.type==="data-thread-title"){const P=f.data;if(!P?.title)return;const i=v.current;if(!i.taskId)return;i.manager.patchThread({id:i.taskId,title:P.title,updated_at:new Date().toISOString()});return}if(f.type==="data-deck-updated"){const P=f.data;if(!P?.path)return;const i=P.path,h=v.current;h.queryClient.invalidateQueries({queryKey:ge.orgFsStat(h.orgId,"home",i)}),h.queryClient.invalidateQueries({queryKey:ge.orgFsRecent(h.orgId)}),h.navigate({to:".",search:U=>({...U,main:yt(i)}),replace:!0});return}},onFinish:(f,P,i)=>{const h=v.current;h.taskId&&X(h.orgSlug,h.taskId),h.taskId&&h.manager.patchThread({id:h.taskId,status:At(i,f.parts),updated_at:new Date().toISOString()});const U=f.parts?.some(y=>{const re=y;return(re.type==="tool-share_with_user"||re.type==="tool-bash"||re.type==="tool-write")&&re.state==="output-available"});if(h.taskId&&U){const y=ge.threadOutputs(h.taskId);for(const re of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{h.queryClient.invalidateQueries({queryKey:y})},re)}h.queryClient.invalidateQueries({queryKey:ge.homeNextActions(h.orgSlug)});const _=f.metadata?.thread_id;_&&_!==h.taskId&&h.rawNavigateToTask(_)},onError:f=>{M(f),console.error("[chat] Error",f)},onToolCall:f=>v.current.onToolCall(f)};u.observer=c,X(v.current.orgSlug,v.current.taskId);const d=f=>f==="submitted"||f==="streaming";let w=d(u.status.get().kind);const A=u.status.subscribe(()=>{const f=d(u.status.get().kind);if(f===w)return;w=f;const P=v.current;X(P.orgSlug,P.taskId)});return()=>{u.observer===c&&(u.observer=null),A()}},[u]);const G=O.kind==="submitted"||O.kind==="streaming",pe=E.length===0,Se=E.at(-1),Ce=!G&&Se?.role==="assistant"&&Se.parts.some(c=>"state"in c&&c.state==="approval-requested"),fe=s,xe=(fe?.status==="in_progress"||fe?.status==="expired")&&O.kind==="ready"&&E.length>0;async function he(c){const d=t,w=n,A=Object.entries(I),f=A.length>0?A.map(([_,y])=>`### App Context: ${_}
24
- ${y}`).join(`
25
-
26
- `):"",P=[C,f].filter(Boolean).join(`
27
-
28
- `);let i=g;i==="gen-image"&&!a&&(i="default"),i==="web-search"&&!r&&(i="default"),i==="deep-research"&&!l&&(i="default"),(i==="web-search"||i==="deep-research")&&S("default");const h=$t({thread:s?{harness_id:s.harness_id??null,sandbox_provider_kind:s.sandbox_provider_kind??null,branch:s.branch??null}:null,globals:{harnessId:$??void 0,sandboxProviderKind:p??void 0,branch:o}});s?.harness_id||q.patchThread({id:d,harness_id:h.harnessId??"decopilot",sandbox_provider_kind:h.sandboxProviderKind??null,updated_at:new Date().toISOString()});const U={tier:N,mode:i,toolApprovalLevel:k.toolApprovalLevel??nt(),system:P||void 0,agent:{id:w},thread_id:d,...h};try{if(G||xe){let _=!0;try{Bt(d,c),await u.enqueue(c,U),He(d,{workflowId:`thread-run:${d}:${c.id}`,messageId:c.id,text:Ft(c.parts),hasAttachments:c.parts.some(y=>y.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),Qt(d)}catch(y){_=!1,De(d,c.id),Te(d,c.id),M(y instanceof Error?y:new Error(String(y))),ne.error(y instanceof Error?y.message:"Failed to queue message")}return X(x.slug,d),_}return await u.submit({kind:"message",message:c},U),!0}finally{ee.delete(d)}}async function oe(c){const d=c.parts??Be(c.tiptapDoc);if(d.length===0||ee.has(t))return;ee.add(t),M(null),T(void 0);const w={tiptapDoc:c.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:D?.image??void 0,name:D?.name??"you"}},A={id:crypto.randomUUID(),role:"user",parts:d,metadata:w};await he(A)}async function ke(c,d){if(ee.has(t))return ne.info("Still sending your previous message — try again in a moment"),!1;if(ee.add(t),!await H.cancel(t,c))return ee.delete(t),ne.error("Couldn't remove the original message"),!1;De(t,c),u.removeLocalMessage(c);const A={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:d}],metadata:{created_at:new Date().toISOString(),user:{avatar:D?.image??void 0,name:D?.name??"you"}}};try{return await he(A)}catch(f){return ne.error(f instanceof Error?f.message:"Failed to send edited message"),!1}}const J=async()=>{u.stop();try{const c=await fetch(`/api/${x.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(c.status===404)return;if(!c.ok){const d=await c.json().catch(()=>({}));throw new Error(d.message??`Cancel failed: ${c.status}`)}}catch(c){const d=c instanceof Error?c.message:"Failed to cancel";ne.error(d),console.error("[chat] cancelRun",c)}},be=c=>c&&typeof c=="object"&&"type"in c?oe({tiptapDoc:c}):oe(c),ae=Fe({strict:!1}).autosend===je;m.useEffect(()=>{if(!ae||E.length>0)return;const c=st(sessionStorage,V,t);c&&oe(c.message).then(()=>{ot(sessionStorage,V,t)})},[ae,E.length,V,t,oe]);const ve={messages:E,status:Gt(O),sendMessage:be,editQueuedMessage:ke,stop:()=>{J()},submit:(c,d)=>u.submit(c,d),removeLocalMessage:c=>u.removeLocalMessage(c),isSendInFlight:()=>ee.has(t),error:Y,clearError:()=>M(null),finishReason:Z,runStatusStage:j,clearFinishReason:()=>u.finishReason.set(null),isStreaming:G,isChatEmpty:pe,isWaitingForApprovals:Ce??!1,isRunInProgress:xe,hasMoreOlder:L,isFetchingOlder:b,fetchOlderMessages:u.fetchOlderMessages.bind(u)};return Q.jsx(Ee.Provider,{value:ve,children:e})}function kn(){const t=m.useContext(Ee);if(!t)throw new Error("useChatStream must be used within ActiveTaskProvider");return t}function bn(){return m.useContext(Ee)}function tn(){const t=m.useContext(Ae);if(!t)throw new Error("useChatTask must be used within ChatContextProvider");return t}function nn(){const t=m.useContext(_e);if(!t)throw new Error("useChatPrefs must be used within ChatContextProvider");return t}function Mn(){return m.useContext(_e)}function sn(){return m.useContext(Ae)}export{Cn as A,en as C,mn as S,kn as a,sn as b,tn as c,vn as d,zt as e,De as f,bn as g,In as h,Sn as i,Be as j,We as k,Mn as l,Ke as m,Ve as n,wt as o,gn as p,xn as s,yn as t,nn as u};
@@ -1 +0,0 @@
1
- import{c as $,j as s,Y as He,r as E,l as F,M as oe,Z as bs,_ as js,a as he,$ as se,b as xe,a0 as vs,a1 as ys,t as re,a2 as Ss,a3 as Ns,K as _s,k as Cs,a4 as ws,i as Lt,e as lt,u as rt,P as Rt,G as ks,H as As,I as Is,J as zs,d as $s,B as Je,a5 as Ts,T as Ms,U as Os,a6 as Ps,X as Ds,a7 as Fs}from"./index-CE5H3VpT.js";import{u as pe,S as ot,a as at,b as ae,c as J,d as K,e as Bt,f as Ht,g as Es,h as Ls,i as Ze,j as Rs,k as Bs,l as Hs}from"./sidebar-DoDKf_4K.js";import{u as ct}from"./use-mobile-BGgRMBqg.js";import{S as te}from"./skeleton-H_BeyWZC.js";import{i as Gt}from"./LayoutLeft-C7UYEc8w.js";import{T as ve}from"./toolbar-icon-button-Du8AVUGg.js";import{P as Ge,a as ze,b as Ue}from"./popover-CLvqhSp6.js";import{D as Ut,a as Wt,b as qt}from"./drawer-DNygCL0g.js";import{A as Le}from"./avatar-CBGAelvW.js";import{a as ce,b as de,c as et,T as me}from"./tooltip-Cg3rQVMP.js";import{a as gt}from"./Copy01-BqGbD9kh.js";import{n as Gs,i as Us}from"./Globe01-C7l3-Kj_.js";import{i as Ws}from"./ZoomOut-BORQEG0K.js";import{i as qs,a as Ks}from"./ZapSquare-BxP2mvwj.js";import{i as tt}from"./Monitor01-z8KVt_1L.js";import{n as Xs,a as Vs}from"./Sun-D7S1ER7S.js";import{a as dt}from"./Settings02-iM-HC30X.js";import{i as Ys}from"./Shield01-B9NrENV2.js";import{a as Qs}from"./Users03-DSGWvEeU.js";import{a as bt,b as jt,c as Js,d as Zs,A as ye,e as vt,i as en,s as tn,f as sn}from"./agent-icon-CQDdwbbu.js";import"./index-BVvioSjf.js";import{I as nn}from"./invite-member-dialog-Ccpti3hZ.js";import{u as ln,A as rn,g as on,a as an,b as Kt}from"./agent-capabilities-B0Jsdt6p.js";import{u as cn,v as dn,C as yt}from"./connect-desktop-dialog-9CJopn2Q.js";import{i as mn}from"./FilterLines-DJ3lRTxj.js";import{T as un,a as fn}from"./toggle-group-CyItOhMq.js";import{u as hn}from"./use-mcp-client-ZBC-eCDx.js";import{S as xn,a as Re,i as pn,b as gn}from"./constants-B72Xmt_K.js";import{u as mt,a as Xt}from"./use-virtual-mcp-DOdyKPNe.js";import{u as bn,a as ut,b as Vt,T as jn}from"./hooks-DqC-czl4.js";import{u as ft,r as vn}from"./shell-layout-Ur6mRNK2.js";import{c as yn,a as Sn,b as Nn,d as _n,e as Cn}from"./dialog-C3IuPH3f.js";import{C as wn,a as kn,b as An,c as In,d as zn}from"./command-1aG03_je.js";import{u as Yt}from"./studio-tools-7Wg9yY_n.js";import{i as Qt}from"./Zap-BtxkJShL.js";import{S as Jt,M as $n}from"./shell-controls-CA1LD88M.js";import{n as Tn}from"./Stars02-CKZjtcO2.js";import{g as Mn,u as On,S as Pn}from"./use-clock-tick-KJrFAFXc.js";import{f as Dn}from"./format-time-Cy7tTmZp.js";import{t as ht}from"./ChevronDown-CdhVz413.js";import{i as Fn}from"./ChevronRight-DSkRxyMp.js";import{S as Zt,u as En,g as Ln,a as Rn,b as Bn}from"./use-navigate-to-agent-Dn2BNzaE.js";import{S as Hn,C as Gn}from"./chat-context-E29cn9cH.js";import{B as St,a as Un,b as Wn}from"./breadcrumb-Dtuz1MwX.js";import{i as es}from"./Check-BBbJanyi.js";import{s as $e}from"./Plus-DaZdxod6.js";import{i as ts}from"./SearchMd-ByN3gshP.js";import{s as qn}from"./XClose-Dg02sB1B.js";import{A as Kn,a as Xn,b as Vn,c as Yn,d as Qn,e as Jn,f as Zn}from"./alert-dialog-C9L2oZsl.js";import{F as ei,a as ti,b as si,c as ni,d as ii,f as li,e as ri}from"./form-B3R-A37u.js";import{I as oi}from"./input-kOQaqTZ-.js";import{G as ai,a as ci}from"./github-repo-picker-DUcUZ8Lg.js";import{f as di}from"./reusable-new-chat-qqWu133U.js";import{T as Q}from"./toolbar-Bx2JvL88.js";import"./X-De82F_yV.js";import"./User01-BB062KFn.js";import"./AlertCircle-C3XBF3Lj.js";import"./Tool01-NvZF1kAv.js";import"./SwitchHorizontal01-mHS8gX9f.js";import"./XCircle-CrMyqBpn.js";import"./ArrowUpRight-BAyBOox4.js";import"./Loading02-BfehCN_S.js";import"./CheckCircle-CUAoW5BF.js";import"./ChevronUp-VC09djpz.js";import"./Circle-BaBs0XFQ.js";import"./DotsVertical-Dx7q3hEM.js";import"./Eye-m_jc4WHC.js";import"./Star01-D7maP7yw.js";import"./Globe04-C3kyaQkX.js";import"./HardDrive-BfnTWF0w.js";import"./Key01-DJufXC5l.js";import"./LinkExternal01-DHPLvAlj.js";import"./List-DbYeo32c.js";import"./Palette-D0EiCOKi.js";import"./Play-DPT-Lr30.js";import"./SearchLg-DxD_D_4n.js";import"./Stars01-DlXhHEac.js";import"./Trash01-BXE2cBJq.js";import"./Upload01-CypbVjGY.js";import"./Users01-CffdXVAr.js";import"./select-p16t1oqR.js";import"./textarea-BcDVHw10.js";import"./use-org-auth-client-BvkB8WEw.js";import"./use-organization-roles-DgnZyn8W.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BX64E0ZX.js";import"./use-registry-connections-DMa9GcRc.js";import"./use-connection-Bnuwr5M1.js";import"./use-collections-FdPpYeY0.js";import"./use-organization-settings-B0Nwjkeh.js";import"./useInfiniteQuery-D3w5TQxr.js";import"./use-infinite-scroll-DQs52IQI.js";import"./extract-connection-data-baLEbDV8.js";import"./card-1rWslgPf.js";import"./integration-icon-BDMIArBS.js";import"./collection-search-BQbTxwoW.js";import"./collection-tabs-CoU3ihMK.js";import"./badge-BPlPS6-U.js";import"./connection-form-helpers-CFnSkiaw.js";import"./authenticate-and-persist-oauth-Dju715T5.js";import"./mcp-oauth-BvfQRZ3m.js";import"./auth-Dh53AhUb.js";import"./useSuspenseInfiniteQuery-bZ1w_AdM.js";import"./use-ai-providers-BLYI7is3.js";import"./decopilot-sse-pool-moj0w8Vo.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-C7z1SSP_.js";import"./autosend-U-xpRpSE.js";import"./tab-id-DAJ8K7VA.js";import"./use-org-sso-B_WqXsc5.js";import"./index-DBc0WuE4.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-CFzSYSZ0.js";import"./label-xBJ0yPUA.js";import"./checkbox-CIo6Fidy.js";import"./use-debounced-value-wokrtNfu.js";import"./use-mcp-tools-FxYZ1Cxx.js";import"./github-installations-DzN1UQ4x.js";function mi(t){const e=$.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:i,isMobile:r}=pe();if(r||i==="collapsed")return null;let a,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={left:"var(--sidebar-width)"},o=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]=a,e[1]=o):(a=e[0],o=e[1]);let d;return e[2]!==l||e[3]!==n?(d=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:a,children:o}),e[2]=l,e[3]=n,e[4]=d):d=e[4],d}const xt=240,ui=400,fi="sidebar.width";function Te(t){return Math.max(xt,Math.min(ui,t))}function hi(){const t=$.c(11),[e,n]=He(fi,xi),l=E.useRef(null);let i;t[0]!==n||t[1]!==e?(i=m=>{m.preventDefault();const u=m.clientX,f=Te(e),x=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),g=x?Array.from(x.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const p of g)p.style.transition="none";const j=p=>{const b=Te(f+(p.clientX-u));x?.style.setProperty("--sidebar-width",`${b}px`)},h=p=>{const b=Te(f+(p.clientX-u));n(b);for(const y of g)y.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",h),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",h)},t[0]=n,t[1]=e,t[2]=i):i=t[2];const r=i;let a;t[3]!==n?(a=()=>{n(xt)},t[3]=n,t[4]=a):a=t[4];const o=a;let d;t[5]!==e?(d=Te(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==r||t[8]!==o||t[9]!==d?(c={width:d,wrapperRef:l,onStartResize:r,resetWidth:o},t[7]=r,t[8]=o,t[9]=d,t[10]=c):c=t[10],c}function xi(t){return typeof t=="number"?Te(t):xt}function ss(){return[]}function ns(t){const e=$.c(3),{children:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=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]=l):l=e[0];let i;return e[1]!==n?(i=s.jsxs(ot,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(at,{children:s.jsx(ae,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function is(t){const e=$.c(18),{item:n}=t,{isMobile:l,setOpenMobile:i}=pe();let r;e[0]!==l||e[1]!==n||e[2]!==i?(r=()=>{oe("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&i(!1)},e[0]=l,e[1]=n,e[2]=i,e[3]=r):r=e[3];const a=r,o=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=F(d),e[4]=d,e[5]=c):c=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=a,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(K,{className:c,children:u},o),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function pi(t){const e=$.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Bt,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,i=n.group.defaultExpanded;let r;e[2]!==n.group.items?(r=n.group.items.map(bi),e[2]=n.group.items,e[3]=r):r=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==r?(a=s.jsx(ns,{label:l,defaultExpanded:i,children:r}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=r,e[7]=a):a=e[7],a}case"items":{let l;e[8]!==n.items?(l=n.items.map(gi),e[8]=n.items,e[9]=l):l=e[9];let i;return e[10]!==l?(i=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ae,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=i):i=e[11],i}case"custom":return n.content}}function gi(t){return s.jsx(is,{item:t},t.key)}function bi(t){return s.jsx(is,{item:t},t.key)}function ji(t){const e=$.c(14),{sections:n,footer:l,additionalContent:i,variant:r,contentClassName:a}=t,o=r===void 0?"sidebar":r;let d;e[0]!==a?(d=F("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[0]=a,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(vi),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==i?(m=i&&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:i}),e[4]=i,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Ht,{className:d,children:[c,m]}),e[6]=d,e[7]=c,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==l||e[11]!==u||e[12]!==o?(f=s.jsxs(Es,{variant:o,children:[u,l]}),e[10]=l,e[11]=u,e[12]=o,e[13]=f):f=e[13],f}function vi(t,e){return s.jsx(pi,{section:t},e)}function ls(t){const e=$.c(2);let n;return e[0]!==t?(n=s.jsx(ji,{...t}),e[0]=t,e[1]=n):n=e[1],n}ls.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(te,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function yi(t){const e=$.c(16),{onToggle:n,className:l}=t,r=bs().logo??js,a=typeof r=="string"?r:r.light,o=typeof r=="string"?r:r.dark;let d;e[0]!==l?(d=F("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",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==a?(c=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=a,e[3]=c):c=e[3];let m;e[4]!==o?(m=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=o,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==m?(u=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,m]})}),e[6]=c,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Gt,{size:16}),e[9]=f):f=e[9];let x;e[10]!==n?(x=s.jsx(ve,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=x):x=e[11];let g;return e[12]!==d||e[13]!==u||e[14]!==x?(g=s.jsxs(Ls,{className:d,children:[u,x]}),e[12]=d,e[13]=u,e[14]=x,e[15]=g):g=e[15],g}function Nt(t){const e=$.c(18),{item:n,onClose:l}=t,i=n.isActive&&"z-10";let r;e[0]!==i?(r=F(i),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==n||e[3]!==l?(a=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=a):a=e[4];let o;e[5]!==n.icon?(o=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=o):o=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==a||e[12]!==o||e[13]!==d?(c=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[o,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=o,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==r||e[16]!==c?(m=s.jsx(K,{className:r,children:c}),e[15]=r,e[16]=c,e[17]=m):m=e[17],m}function Si(t){const e=$.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Bt,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,r=n.group.defaultExpanded;let a;if(e[2]!==l||e[3]!==n.group.items){let d;e[5]!==l?(d=c=>s.jsx(Nt,{item:c,onClose:l},c.key),e[5]=l,e[6]=d):d=e[6],a=n.group.items.map(d),e[2]=l,e[3]=n.group.items,e[4]=a}else a=e[4];let o;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(o=s.jsx(ns,{label:i,defaultExpanded:r,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=o):o=e[10],o}case"items":{let i;if(e[11]!==l||e[12]!==n.items){let a;e[14]!==l?(a=o=>s.jsx(Nt,{item:o,onClose:l},o.key),e[14]=l,e[15]=a):a=e[15],i=n.items.map(a),e[11]=l,e[12]=n.items,e[13]=i}else i=e[13];let r;return e[16]!==i?(r=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ae,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=r):r=e[17],r}case"custom":return n.content}}function Ni(t){const e=$.c(17),{sections:n,onClose:l,footer:i,additionalContent:r}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=a):a=e[0];let o;e[1]!==l?(o=s.jsx(E.Suspense,{fallback:a,children:s.jsx(yi,{onToggle:l})}),e[1]=l,e[2]=o):o=e[2];let d;if(e[3]!==l||e[4]!==n){let f;e[6]!==l?(f=(x,g)=>s.jsx(Si,{section:x,onClose:l},g),e[6]=l,e[7]=f):f=e[7],d=n.map(f),e[3]=l,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==r?(c=r&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:r}),e[8]=r,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Ht,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12];let u;return e[13]!==i||e[14]!==o||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[o,m,i]}),e[13]=i,e[14]=o,e[15]=m,e[16]=u):u=e[16],u}function De(t){const e=$.c(22),{item:n,onClose:l}=t;if(n.href){const d=n.external?"_blank":void 0,c=n.external?"noopener noreferrer":void 0;let m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==l||e[6]!==d||e[7]!==c||e[8]!==m||e[9]!==u?(f=s.jsxs("a",{href:n.href,target:d,rel:c,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:l,children:[m,u]}),e[4]=n.href,e[5]=l,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let i;e[11]!==n||e[12]!==l?(i=()=>{n.onClick?.(),l()},e[11]=n,e[12]=l,e[13]=i):i=e[13];let r;e[14]!==n.icon?(r=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=r):r=e[15];let a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let o;return e[18]!==i||e[19]!==r||e[20]!==a?(o=s.jsxs("button",{type:"button",onClick:i,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:[r,a]}),e[18]=i,e[19]=r,e[20]=a,e[21]=o):o=e[21],o}function _t(t){const e=$.c(126),{user:n,userImage:l,menuItems:i,signOutItem:r,themeOptions:a,preferences:o,setPreferences:d,close:c,isMobile:m}=t;if(m){const U=n?.name??"U";let q;e[0]!==U||e[1]!==l?(q=s.jsx(Le,{url:l,fallback:U,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=U,e[1]=l,e[2]=q):q=e[2];const B=n?.name??"User";let Z;e[3]!==B?(Z=s.jsx("p",{className:"text-sm font-medium truncate",children:B}),e[3]=B,e[4]=Z):Z=e[4];const ge=n?.email;let ee;e[5]!==ge?(ee=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ge}),e[5]=ge,e[6]=ee):ee=e[6];let ue;e[7]!==Z||e[8]!==ee?(ue=s.jsxs("div",{className:"flex-1 min-w-0",children:[Z,ee]}),e[7]=Z,e[8]=ee,e[9]=ue):ue=e[9];let be;e[10]!==n?(be=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(ki)},e[10]=n,e[11]=be):be=e[11];let ne;e[12]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(gt,{size:14}),e[12]=ne):ne=e[12];let fe;e[13]!==be?(fe=s.jsx(ce,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:be,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ne})}),e[13]=be,e[14]=fe):fe=e[14];let je;e[15]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(de,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=je):je=e[15];let T;e[16]!==fe?(T=s.jsx(et,{delayDuration:300,children:s.jsxs(me,{children:[fe,je]})}),e[16]=fe,e[17]=T):T=e[17];let H;e[18]!==T||e[19]!==q||e[20]!==ue?(H=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[q,ue,T]}),e[18]=T,e[19]=q,e[20]=ue,e[21]=H):H=e[21];let X;if(e[22]!==c||e[23]!==i){let le;e[25]!==c?(le=Pe=>s.jsx(De,{item:Pe,onClose:c},Pe.key),e[25]=c,e[26]=le):le=e[26],X=i.map(le),e[22]=c,e[23]=i,e[24]=X}else X=e[24];let W;e[27]!==c||e[28]!==r?(W=s.jsx(De,{item:r,onClose:c}),e[27]=c,e[28]=r,e[29]=W):W=e[29];let ie;e[30]!==X||e[31]!==W?(ie=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[X,W]})}),e[30]=X,e[31]=W,e[32]=ie):ie=e[32];let Se;if(e[33]!==o.theme||e[34]!==d||e[35]!==a){let le;e[37]!==o.theme||e[38]!==d?(le=Pe=>{const{value:Xe,icon:xs,label:ps}=Pe;return s.jsx("button",{type:"button","aria-label":ps,onClick:()=>d(gs=>({...gs,theme:Xe})),className:F("size-8 rounded-md flex items-center justify-center transition-colors",o.theme===Xe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:xs},Xe)},e[37]=o.theme,e[38]=d,e[39]=le):le=e[39],Se=a.map(le),e[33]=o.theme,e[34]=d,e[35]=a,e[36]=Se}else Se=e[36];let Ne;e[40]!==Se?(Ne=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=Ne):Ne=e[41];const qe=o.enableSounds?"Disable sounds":"Enable sounds";let _e;e[42]!==d?(_e=()=>d(wi),e[42]=d,e[43]=_e):_e=e[43];const Ke=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ce;e[44]!==Ke?(Ce=F("size-8 rounded-md flex items-center justify-center transition-colors",Ke),e[44]=Ke,e[45]=Ce):Ce=e[45];let we;e[46]!==o.enableSounds?(we=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[46]=o.enableSounds,e[47]=we):we=e[47];let ke;e[48]!==qe||e[49]!==_e||e[50]!==Ce||e[51]!==we?(ke=s.jsx("button",{type:"button","aria-label":qe,onClick:_e,className:Ce,children:we}),e[48]=qe,e[49]=_e,e[50]=Ce,e[51]=we,e[52]=ke):ke=e[52];let Me;e[53]===Symbol.for("react.memo_cache_sentinel")?(Me=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.37.0"]}),e[53]=Me):Me=e[53];let Ae;e[54]!==ke?(Ae=s.jsxs("div",{className:"flex items-center gap-2",children:[ke,Me]}),e[54]=ke,e[55]=Ae):Ae=e[55];let Ie;e[56]!==Ne||e[57]!==Ae?(Ie=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ne,Ae]}),e[56]=Ne,e[57]=Ae,e[58]=Ie):Ie=e[58];let Oe;return e[59]!==H||e[60]!==ie||e[61]!==Ie?(Oe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[H,ie,Ie]}),e[59]=H,e[60]=ie,e[61]=Ie,e[62]=Oe):Oe=e[62],Oe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==l?(f=s.jsx(Le,{url:l,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=l,e[65]=f):f=e[65];const x=n?.name??"User";let g;e[66]!==x?(g=s.jsx("p",{className:"text-sm font-medium truncate",children:x}),e[66]=x,e[67]=g):g=e[67];const j=n?.email;let h;e[68]!==j?(h=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:j}),e[68]=j,e[69]=h):h=e[69];let p;e[70]!==g||e[71]!==h?(p=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,h]}),e[70]=g,e[71]=h,e[72]=p):p=e[72];let b;e[73]!==n?(b=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ci)},e[73]=n,e[74]=b):b=e[74];let y;e[75]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(gt,{size:14}),e[75]=y):y=e[75];let v;e[76]!==b?(v=s.jsx(ce,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:y})}),e[76]=b,e[77]=v):v=e[77];let w;e[78]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(de,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=w):w=e[78];let C;e[79]!==v?(C=s.jsx(et,{delayDuration:300,children:s.jsxs(me,{children:[v,w]})}),e[79]=v,e[80]=C):C=e[80];let N;e[81]!==C||e[82]!==f||e[83]!==p?(N=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,p,C]}),e[81]=C,e[82]=f,e[83]=p,e[84]=N):N=e[84];let S;if(e[85]!==c||e[86]!==i){let U;e[88]!==c?(U=q=>s.jsx(De,{item:q,onClose:c},q.key),e[88]=c,e[89]=U):U=e[89],S=i.map(U),e[85]=c,e[86]=i,e[87]=S}else S=e[87];let A;e[90]!==c||e[91]!==r?(A=s.jsx(De,{item:r,onClose:c}),e[90]=c,e[91]=r,e[92]=A):A=e[92];let k;e[93]!==S||e[94]!==A?(k=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[S,A]}),e[93]=S,e[94]=A,e[95]=k):k=e[95];let z;if(e[96]!==o.theme||e[97]!==d||e[98]!==a){let U;e[100]!==o.theme||e[101]!==d?(U=q=>{const{value:B,icon:Z,label:ge}=q;return s.jsx("button",{type:"button","aria-label":ge,onClick:()=>d(ee=>({...ee,theme:B})),className:F("size-7 rounded-md flex items-center justify-center transition-colors",o.theme===B?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},B)},e[100]=o.theme,e[101]=d,e[102]=U):U=e[102],z=a.map(U),e[96]=o.theme,e[97]=d,e[98]=a,e[99]=z}else z=e[99];let _;e[103]!==z?(_=s.jsx("div",{className:"flex items-center gap-0.5",children:z}),e[103]=z,e[104]=_):_=e[104];const I=o.enableSounds?"Disable sounds":"Enable sounds";let M;e[105]!==d?(M=()=>d(_i),e[105]=d,e[106]=M):M=e[106];const L=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let P;e[107]!==L?(P=F("size-7 rounded-md flex items-center justify-center transition-colors",L),e[107]=L,e[108]=P):P=e[108];let D;e[109]!==o.enableSounds?(D=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[109]=o.enableSounds,e[110]=D):D=e[110];let O;e[111]!==I||e[112]!==M||e[113]!==P||e[114]!==D?(O=s.jsx("button",{type:"button","aria-label":I,onClick:M,className:P,children:D}),e[111]=I,e[112]=M,e[113]=P,e[114]=D,e[115]=O):O=e[115];let R;e[116]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.37.0"]}),e[116]=R):R=e[116];let G;e[117]!==O?(G=s.jsxs("div",{className:"flex items-center gap-2",children:[O,R]}),e[117]=O,e[118]=G):G=e[118];let V;e[119]!==_||e[120]!==G?(V=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[_,G]}),e[119]=_,e[120]=G,e[121]=V):V=e[121];let Y;return e[122]!==N||e[123]!==k||e[124]!==V?(Y=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[N,k,V]})}),e[122]=N,e[123]=k,e[124]=V,e[125]=Y):Y=e[125],Y}function _i(t){return{...t,enableSounds:!t.enableSounds}}function Ci(){re.success("User ID copied")}function wi(t){return{...t,enableSounds:!t.enableSounds}}function ki(){re.success("User ID copied")}function st(){const t=$.c(34),{data:e}=he.useSession(),{org:n}=se(),l=xe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const a=vs(i)?.params.org,[o,d]=ys(),c=ct(),[m,u]=E.useState(!1),f=e?.user,x=f?.image;let g;t[1]===Symbol.for("react.memo_cache_sentinel")?(g=()=>u(!1),t[1]=g):g=t[1];const j=g;let h;t[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(dt,{size:16}),t[2]=h):h=t[2];let p;t[3]!==l||t[4]!==a?(p={key:"preferences",label:"Preferences",icon:h,onClick:()=>{l({to:"/$org/settings/profile",params:{org:a??""}})}},t[3]=l,t[4]=a,t[5]=p):p=t[5];let b;t[6]!==n||t[7]!==l?(b=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Gs,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=b):b=t[8];let y;t[9]===Symbol.for("react.memo_cache_sentinel")?(y={key:"terms",label:"Terms of Use",icon:s.jsx(Ws,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=y):y=t[9];let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v={key:"privacy",label:"Privacy Policy",icon:s.jsx(Ys,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=v):v=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w={key:"github",label:"decocms/studio",icon:s.jsx(Ss,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=w):w=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C={key:"community",label:"Community",icon:s.jsx(Qs,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=C):C=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N={key:"homepage",label:"Homepage",icon:s.jsx(Us,{size:16}),href:"https://decocms.com",external:!0},t[13]=N):N=t[13];let S;t[14]!==p||t[15]!==b?(S=[p,...b,y,v,w,C,N],t[14]=p,t[15]=b,t[16]=S):S=t[16];const A=S;let k;t[17]===Symbol.for("react.memo_cache_sentinel")?(k={key:"logout",label:"Sign out",icon:s.jsx(qs,{size:16}),onClick:Ii},t[17]=k):k=t[17];const z=k;let _;t[18]===Symbol.for("react.memo_cache_sentinel")?(_={value:"light",icon:s.jsx(Xs,{size:14}),label:"Light theme"},t[18]=_):_=t[18];let I;t[19]===Symbol.for("react.memo_cache_sentinel")?(I={value:"dark",icon:s.jsx(Vs,{size:14}),label:"Dark theme"},t[19]=I):I=t[19];let M;t[20]===Symbol.for("react.memo_cache_sentinel")?(M=[_,I,{value:"system",icon:s.jsx(tt,{size:14}),label:"System theme"}],t[20]=M):M=t[20];const L=M;let P;t[21]!==c||t[22]!==A||t[23]!==o||t[24]!==d||t[25]!==f||t[26]!==x?(P={user:f,userImage:x,menuItems:A,signOutItem:z,themeOptions:L,preferences:o,setPreferences:d,close:j,isMobile:c},t[21]=c,t[22]=A,t[23]=o,t[24]=d,t[25]=f,t[26]=x,t[27]=P):P=t[27];const D=P;let O;return t[28]!==c||t[29]!==m||t[30]!==D||t[31]!==f?.name||t[32]!==x?(O=s.jsx(s.Fragment,{children:c?s.jsxs(Ut,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!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(Le,{url:x,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Wt,{className:"h-[80dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Account"}),s.jsx(_t,{...D})]})]}):s.jsxs(Ge,{open:m,onOpenChange:u,children:[s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Le,{url:x,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Ue,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Ai,children:s.jsx(_t,{...D})})]})}),t[28]=c,t[29]=m,t[30]=D,t[31]=f?.name,t[32]=x,t[33]=O):O=t[33],O}function Ai(t){return t.preventDefault()}function Ii(){oe("signed_out",{source:"account_popover"}),Ns(),he.signOut()}function nt(t){const e=$.c(43),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,i=cn(),[r,a]=E.useState(!1);let o,d;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online){const y=dn(i.capabilities);o=i.online?"Desktop linked":"Connect desktop",d=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:y.length>0?`Available: ${y.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=o,e[5]=d}else o=e[4],d=e[5];const c=d;if(l==="full"){let y,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>a(!0),v=s.jsx(tt,{}),e[6]=y,e[7]=v):(y=e[6],v=e[7]);let w;e[8]!==o?(w=s.jsx("span",{children:o}),e[8]=o,e[9]=w):w=e[9];let C;e[10]!==i.online?(C=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=i.online,e[11]=C):C=e[11];let N;e[12]!==o||e[13]!==w||e[14]!==C?(N=s.jsx(ce,{asChild:!0,children:s.jsxs(J,{tooltip:o,onClick:y,children:[v,w,C]})}),e[12]=o,e[13]=w,e[14]=C,e[15]=N):N=e[15];let S;e[16]!==c?(S=s.jsx(de,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let A;e[18]!==N||e[19]!==S?(A=s.jsxs(me,{children:[N,S]}),e[18]=N,e[19]=S,e[20]=A):A=e[20];let k;e[21]!==r?(k=s.jsx(yt,{open:r,onOpenChange:a}),e[21]=r,e[22]=k):k=e[22];let z;return e[23]!==k||e[24]!==A?(z=s.jsxs(s.Fragment,{children:[A,k]}),e[23]=k,e[24]=A,e[25]=z):z=e[25],z}let m;e[26]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),e[26]=m):m=e[26];const u=i.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(tt,{size:16}),e[27]=f):f=e[27];let x;e[28]!==i.online?(x=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=i.online,e[29]=x):x=e[29];let g;e[30]!==u||e[31]!==x?(g=s.jsx(ce,{asChild:!0,children:s.jsxs(ve,{onClick:m,"aria-label":u,children:[f,x]})}),e[30]=u,e[31]=x,e[32]=g):g=e[32];let j;e[33]!==c?(j=s.jsx(de,{side:"bottom",children:c}),e[33]=c,e[34]=j):j=e[34];let h;e[35]!==g||e[36]!==j?(h=s.jsxs(me,{children:[g,j]}),e[35]=g,e[36]=j,e[37]=h):h=e[37];let p;e[38]!==r?(p=s.jsx(yt,{open:r,onOpenChange:a}),e[38]=r,e[39]=p):p=e[39];let b;return e[40]!==p||e[41]!==h?(b=s.jsxs(s.Fragment,{children:[h,p]}),e[40]=p,e[41]=h,e[42]=b):b=e[42],b}class zi extends E.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 $i(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Ti(){const t=$.c(17),e=xe(),{org:n}=se(),{hasDecoKey:l,balanceDollars:i}=ln();if(!l)return null;let r;t[0]!==i?(r=i!=null?`Credits: $${i.toFixed(2)}`:"Credits",t[0]=i,t[1]=r):r=t[1];let a;t[2]!==i?(a=F(i!=null&&$i(i)),t[2]=i,t[3]=a):a=t[3];let o;t[4]!==e||t[5]!==n.slug?(o=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=o):o=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Js,{}),t[7]=d):d=t[7];let c;t[8]!==i?(c=i!=null?`$${i.toFixed(2)}`:"Credits",t[8]=i,t[9]=c):c=t[9];let m;t[10]!==c?(m=s.jsx("span",{children:c}),t[10]=c,t[11]=m):m=t[11];let u;return t[12]!==r||t[13]!==a||t[14]!==o||t[15]!==m?(u=s.jsx(ae,{children:s.jsx(K,{children:s.jsxs(J,{tooltip:r,className:a,onClick:o,children:[d,m]})})}),t[12]=r,t[13]=a,t[14]=o,t[15]=m,t[16]=u):u=t[16],u}function Ct(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(zi,{children:s.jsx(E.Suspense,{fallback:null,children:s.jsx(Ti,{})})}),t[0]=e):e=t[0],e}function wt(){const t=$.c(7),e=xe(),{org:n}=se();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i,r;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(dt,{}),r=s.jsx("span",{children:"Settings"}),t[3]=i,t[4]=r):(i=t[3],r=t[4]);let a;return t[5]!==l?(a=s.jsxs(J,{tooltip:"Settings",onClick:l,children:[i,r]}),t[5]=l,t[6]=a):a=t[6],a}function kt(){const t=$.c(4),[e,n]=E.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(K,{children:s.jsx(nn,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(Zs,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(ae,{className:"gap-0.5",children:[l,s.jsx(K,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(Ks,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsxs(s.Fragment,{children:[i,s.jsx(rn,{open:e,onOpenChange:n,mode:"browse"})]}),t[2]=e,t[3]=r):r=t[3],r}function Mi(){const t=$.c(10),{state:e}=pe();if(e==="collapsed"){let d,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(kt,{}),c=s.jsx(Ct,{}),t[0]=d,t[1]=c):(d=t[0],c=t[1]);let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(K,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(nt,{})})}),t[2]=m):m=t[2];let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{children:s.jsx(wt,{})}),t[3]=u):u=t[3];let f;return t[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs(Ze,{className:"px-2 pb-3 gap-1",children:[d,c,s.jsxs(ae,{children:[m,u,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[4]=f):f=t[4],f}let l,i;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(kt,{}),i=s.jsx(Ct,{}),t[5]=l,t[6]=i):(l=t[5],i=t[6]);let r;t[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:s.jsx(nt,{variant:"full"})}),t[7]=r):r=t[7];let a;t[8]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(K,{children:s.jsx(wt,{})}),t[8]=a):a=t[8];let o;return t[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(Ze,{className:"px-2 pb-3 gap-0.5",children:[l,i,s.jsxs(ae,{className:"gap-0.5",children:[r,a,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[9]=o):o=t[9],o}function Oi(){const t=$.c(8),e=xe(),{org:n}=se(),{setOpenMobile:l}=pe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ae,{children:s.jsx(K,{children:s.jsx(st,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e||t[2]!==n.slug||t[3]!==l?(r=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=r):r=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(dt,{className:"size-4"}),t[5]=a):a=t[5];let o;return t[6]!==r?(o=s.jsx(Ze,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(ve,{"aria-label":"Settings",onClick:r,children:a})]})}),t[6]=r,t[7]=o):o=t[7],o}function At(t){const e=$.c(15),{className:n,wrapperClassName:l,children:i}=t,[r,a]=E.useState(!1);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=p=>{p&&a(p.scrollHeight>p.clientHeight+1)},e[0]=o):o=e[0];const d=o;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=p=>{const b=p.currentTarget;a(b.scrollHeight-b.scrollTop>b.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==l?(u=F("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:i}),e[4]=i,e[5]=n,e[6]=f):f=e[6];const x=r?"opacity-100":"opacity-0";let g;e[7]!==x?(g=F("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",x),e[7]=x,e[8]=g):g=e[8];let j;e[9]!==g?(j=s.jsx("div",{"aria-hidden":!0,className:g}),e[9]=g,e[10]=j):j=e[10];let h;return e[11]!==u||e[12]!==f||e[13]!==j?(h=s.jsxs("div",{className:u,children:[f,j]}),e[11]=u,e[12]=f,e[13]=j,e[14]=h):h=e[14],h}function Pi(t){const e=$.c(8),{virtualMcpId:n,size:l,showAutomationBadge:i}=t,r=l===void 0?"sm":l;let a;e[0]!==r||e[1]!==n?(a=n?s.jsx(Di,{virtualMcpId:n,size:r}):s.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=a):a=e[2];let o;e[3]!==i?(o=i&&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(Qt,{size:10,className:"text-white"})}),e[3]=i,e[4]=o):o=e[4];let d;return e[5]!==a||e[6]!==o?(d=s.jsxs("div",{className:"relative shrink-0",children:[a,o]}),e[5]=a,e[6]=o,e[7]=d):d=e[7],d}function Di(t){const e=$.c(6),{virtualMcpId:n,size:l}=t,i=mt(n);if(!i){let o;return e[0]!==l?(o=s.jsx(ye,{icon:null,name:"?",size:l}),e[0]=l,e[1]=o):o=e[1],o}const r=i.icon??null;let a;return e[2]!==i.title||e[3]!==l||e[4]!==r?(a=s.jsx(ye,{icon:r,name:i.title,size:l}),e[2]=i.title,e[3]=l,e[4]=r,e[5]=a):a=e[5],a}function It(t){const e=$.c(36),{open:n,onOpenChange:l}=t,[i,r]=E.useState(""),{org:a}=se(),{setTaskId:o}=ft(),d=Yt();let c,m,u;e[0]!==a.id||e[1]!==i?(u=i.trim(),m=Cs,c=_s.globalSearch(a.id,u),e[0]=a.id,e[1]=i,e[2]=c,e[3]=m,e[4]=u):(c=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let x;e[5]!==d||e[6]!==u?(x=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=x):x=e[7];let g;e[8]!==c||e[9]!==f||e[10]!==x?(g={queryKey:c,enabled:f,queryFn:x,staleTime:1e4},e[8]=c,e[9]=f,e[10]=x,e[11]=g):g=e[11];const{data:j,isFetching:h}=m(g);let p;e[12]!==j?.items?(p=j?.items??[],e[12]=j?.items,e[13]=p):p=e[13];const b=p;let y;e[14]!==l?(y=I=>{I||r(""),l(I)},e[14]=l,e[15]=y):y=e[15];const v=y;let w;e[16]!==v||e[17]!==o?(w=I=>{v(!1),o(I.id,I.virtual_mcp_id??void 0)},e[16]=v,e[17]=o,e[18]=w):w=e[18];const C=w;let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(yn,{className:"sr-only",children:[s.jsx(Sn,{children:"Search"}),s.jsx(Nn,{children:"Search across your organization's resources."})]}),e[19]=N):N=e[19];let S;e[20]!==i?(S=s.jsx(An,{value:i,onValueChange:r,placeholder:"Search..."}),e[20]=i,e[21]=S):S=e[21];let A;e[22]!==C||e[23]!==h||e[24]!==b||e[25]!==u?(A=u?h&&b.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):b.length===0?s.jsx(wn,{children:"No results."}):b.map(I=>I.type==="thread"?s.jsxs(kn,{value:`thread:${I.id}:${I.title}`,onSelect:()=>C(I),className:"gap-2.5",children:[s.jsx(Pi,{virtualMcpId:I.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:I.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(I.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${I.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=C,e[23]=h,e[24]=b,e[25]=u,e[26]=A):A=e[26];let k;e[27]!==A?(k=s.jsx(In,{children:A}),e[27]=A,e[28]=k):k=e[28];let z;e[29]!==S||e[30]!==k?(z=s.jsxs(_n,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[N,s.jsxs(zn,{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:[S,k]})]}),e[29]=S,e[30]=k,e[31]=z):z=e[31];let _;return e[32]!==v||e[33]!==n||e[34]!==z?(_=s.jsx(Cn,{open:n,onOpenChange:v,children:z}),e[32]=v,e[33]=n,e[34]=z,e[35]=_):_=e[35],_}function Fi(t){return t==="ephemeral"||t.startsWith("thread:")}function rs(t){const e=$.c(40),{task:n,isActive:l,onClick:i,onArchive:r,showAutomationBadge:a,showAgentIcon:o,hideStatusIdle:d,indented:c}=t,m=Mn(n.status),u=m.icon,f=n.metadata?.kind==="tool_call_run",x=mt(f?void 0:n.virtual_mcp_id);let g;e[0]!==x?(g=on(x),e[0]=x,e[1]=g):g=e[1];const j=g;On(6e4);const h=a||!!n.trigger_id,p=n.id,b="button",y=0;let v;e[2]!==i?(v=G=>{G.target===G.currentTarget&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),i())},e[2]=i,e[3]=v):v=e[3];const w=c?"-ml-4 pl-6":"pl-2",C=l?"bg-accent text-accent-foreground":"hover:bg-accent/60";let N;e[4]!==w||e[5]!==C?(N=F("group/row flex items-center gap-2 py-1.5 pr-2 rounded-md cursor-pointer transition-colors",w,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",C),e[4]=w,e[5]=C,e[6]=N):N=e[6];let S;e[7]!==f||e[8]!==o||e[9]!==x?.icon||e[10]!==x?.title?(S=o&&!f&&s.jsx(ye,{icon:x?.icon??null,name:x?.title??"?",size:"2xs"}),e[7]=f,e[8]=o,e[9]=x?.icon,e[10]=x?.title,e[11]=S):S=e[11];let A;e[12]!==h?(A=h&&s.jsx(Qt,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=h,e[13]=A):A=e[13];const k=n.title||"Untitled task";let z;e[14]!==k?(z=s.jsx("div",{className:"text-sm text-foreground truncate",children:k}),e[14]=k,e[15]=z):z=e[15];let _;e[16]!==A||e[17]!==z?(_=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[A,z]}),e[16]=A,e[17]=z,e[18]=_):_=e[18];let I;e[19]!==j||e[20]!==l||e[21]!==n.branch||e[22]!==n.updated_at?(I=n.updated_at&&s.jsxs("div",{className:F("flex items-center gap-1 text-[11px] min-w-0",l?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Fi(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):j?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[j.owner,"/",j.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Dn(new Date(n.updated_at))})]}),e[19]=j,e[20]=l,e[21]=n.branch,e[22]=n.updated_at,e[23]=I):I=e[23];let M;e[24]!==_||e[25]!==I?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[_,I]}),e[24]=_,e[25]=I,e[26]=M):M=e[26];const L="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",P=!d&&s.jsx("span",{className:F("[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":m.label,children:s.jsx(u,{size:14,className:F(m.iconClassName,n.status==="in_progress"&&"animate-spin")})});let D;e[27]!==r?(D=r&&s.jsxs(me,{children:[s.jsx(ce,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:G=>{G.stopPropagation(),r()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(ws,{size:14})})}),s.jsx(de,{side:"right",children:"Archive"})]}),e[27]=r,e[28]=D):D=e[28];let O;e[29]!==P||e[30]!==D?(O=s.jsxs("div",{className:L,children:[P,D]}),e[29]=P,e[30]=D,e[31]=O):O=e[31];let R;return e[32]!==i||e[33]!==M||e[34]!==O||e[35]!==v||e[36]!==N||e[37]!==S||e[38]!==n.id?(R=s.jsxs("div",{"data-task-id":p,role:b,tabIndex:y,onClick:i,onKeyDown:v,className:N,children:[S,M,O]}),e[32]=i,e[33]=M,e[34]=O,e[35]=v,e[36]=N,e[37]=S,e[38]=n.id,e[39]=R):R=e[39],R}const zt=["requires_action","in_progress","failed","expired","completed"];function Ei(t){const e=new Map(zt.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return zt.map(n=>({status:n,threads:e.get(n)}))}const Li="sidebar.group.expanded.";function Ri(t,e){const n=$.c(3),[l,i]=He(`${Li}${t}`,e);let r;return n[0]!==l||n[1]!==i?(r=[l,i],n[0]=l,n[1]=i,n[2]=r):r=n[2],r}function os(t){const e=$.c(12),{onClick:n,isFetching:l,indented:i}=t,r=i?"-ml-4 pl-6 pr-2":"px-2";let a;e[0]!==r?(a=F("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",r,"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]=r,e[1]=a):a=e[1];let o;e[2]!==l?(o=l&&s.jsx(Lt,{size:14,className:"animate-spin"}),e[2]=l,e[3]=o):o=e[3];const d=l?"Loading…":"Show more";let c;e[4]!==d?(c=s.jsx("span",{children:d}),e[4]=d,e[5]=c):c=e[5];let m;return e[6]!==l||e[7]!==n||e[8]!==a||e[9]!==o||e[10]!==c?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:a,children:[o,c]}),e[6]=l,e[7]=n,e[8]=a,e[9]=o,e[10]=c,e[11]=m):m=e[11],m}function Bi(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function Hi(t){return t.member==="mine"&&!t.currentUserId}const as=4;let Ee=0;const it=[];function Gi(){for(;Ee<as&&it.length>0;){const t=it.shift();t&&t()}}function cs(t){return new Promise((e,n)=>{const l=()=>{Ee++,t().then(e,n).finally(()=>{Ee--,Gi()})};Ee<as?l():it.push(l)})}const We=10;function $t(t,e,n,l,i){const r={hidden:!1};l.member==="mine"&&l.currentUserId&&(r.created_by=l.currentUserId),l.type==="automation"&&(r.has_trigger=!0),l.type==="manual"&&(r.has_trigger=!1);const a={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return a.status=e,a}function Ui(t,e,n,l){let i=0;for(const r of t)ds(r,e,n,l)&&i++;return i}function Ve(t,e,n,l){return Ui(t,e,n,l)}function Wi(t,e){return!!(t>=We||t===0&&e)}function Tt(t,e){return t<e}function qi(t,e){return e===!1?!1:e===!0?!0:t}function ds(t,e,n,l){return!(t.hidden||(t.status??"completed")!==n||l.member==="mine"&&l.currentUserId&&t.created_by!==l.currentUserId||l.type==="automation"&&!t.trigger_id||l.type==="manual"&&t.trigger_id)}const Be=new Map,Fe=new Map;function Ki(t,e){return e?t>=We?!0:null:!1}function Mt(t){return Be.get(t)}function Xi(t,e){Be.set(t,e)}function Vi(t,e,n){const l=Be.get(t);if(l!==void 0){n(l);return}let i=Fe.get(t);i||(i=cs(e).then(r=>(Be.set(t,r),Fe.delete(t),r)).catch(()=>(Fe.delete(t),Promise.reject(new Error("group probe failed")))),Fe.set(t,i)),i.then(n,()=>n(!1))}function Ot(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===We,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Yi(t,e,n,l,i){let r=0;for(const a of t)e.has(a.id)||ds(a,n,l,i)&&r++;return r}function Qi(t,e,n,l){const i=$.c(8),{org:r}=se(),a=Bi(r.id,t,e,n);let o;i[0]!==n?(o=Hi(n),i[0]=n,i[1]=o):o=i[1];const d=o,[c,m]=E.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==a&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const u=bn(),{threads:f,hasMore:x}=ut(),g=Ve(f,t,e,n),j=Wi(g,x),h=Ki(g,x),p=Yt();if(c.identity===a&&c.serverHasMore===null){const N=h??Mt(a);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:N})}!d&&c.identity===a&&c.serverHasMore===null&&h===null&&Mt(a)===void 0&&c.probeSubscribedIdentity!==a&&(m(N=>N.identity===a?{...N,isProbing:!0,probeSubscribedIdentity:a}:N),Vi(a,async()=>{const N=$t(t,e,0,n,1),S=await p.call("COLLECTION_THREADS_LIST",N),{totalCount:A}=Ot(S),k=Ve(u.threads.get(),t,e,n);return A===void 0?!1:Tt(k,A)},N=>{m(S=>S.identity!==a?S:{...S,isProbing:!1,serverHasMore:N})}));const y=async function(){if(c.isFetching||c.isProbing||d)return;const S=a;m(A=>A.identity===S?{...A,isFetching:!0}:A);try{const A=Ve(f,t,e,n),k=$t(t,e,A,n,We),z=await cs(()=>p.call("COLLECTION_THREADS_LIST",k)),{items:_,hasMore:I,totalCount:M}=Ot(z),L=new Set(f.map(Ji)),P=Yi(_,L,t,e,n),D=A;u.mergeThreads(_),m(O=>{if(O.identity!==S)return O;let R;return M!==void 0?R=Tt(D+P,M):R=_.length===0||P===0?!1:I,Xi(S,R),{...O,isFetching:!1,serverHasMore:R}})}catch(A){const k=A,z=k instanceof Error?k.message:String(k);re.error(`Could not load more tasks: ${z}`),m(_=>_.identity===S?{..._,isFetching:!1}:_)}},v=c.isFetching||c.isProbing,w=!d&&!v&&qi(j,c.serverHasMore);let C;return i[2]!==v||i[3]!==y||i[4]!==w||i[5]!==c.isProbing||i[6]!==c.serverHasMore?(C={hasMore:w,isFetching:v,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},i[2]=v,i[3]=y,i[4]=w,i[5]=c.isProbing,i[6]=c.serverHasMore,i[7]=C):C=i[7],C}function Ji(t){return t.id}function Zi(t){const e=$.c(20),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:f,serverHasMore:x}=Qi("status",n,d),[g,j]=E.useState(!1);!g&&l.length===0&&x===!0&&!c&&!m&&(j(!0),queueMicrotask(()=>{u()}));let h;if(e[0]!==i||e[1]!==o||e[2]!==d||e[3]!==a||e[4]!==r||e[5]!==l){let y;e[7]!==i||e[8]!==o||e[9]!==d||e[10]!==a||e[11]!==r?(y=v=>s.jsx(rs,{task:v,isActive:i===v.id,onClick:()=>r(v),onArchive:o&&v.created_by===d.currentUserId?()=>a(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[7]=i,e[8]=o,e[9]=d,e[10]=a,e[11]=r,e[12]=y):y=e[12],h=l.map(y),e[0]=i,e[1]=o,e[2]=d,e[3]=a,e[4]=r,e[5]=l,e[6]=h}else h=e[6];let p;e[13]!==f||e[14]!==c||e[15]!==u?(p=(f||c)&&s.jsx(os,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=p):p=e[16];let b;return e[17]!==h||e[18]!==p?(b=s.jsxs(s.Fragment,{children:[h,p]}),e[17]=h,e[18]=p,e[19]=b):b=e[19],b}function el(t){const e=$.c(36),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,c=Pn[n],m=c.icon,[u,f]=Ri(`status-${n}`,!1);let x;e[0]!==u||e[1]!==f?(x=function(){f(!u)},e[0]=u,e[1]=f,e[2]=x):x=e[2];const g=x;let j;e[3]!==g?(j=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),g())},e[3]=g,e[4]=j):j=e[4];let h;e[5]!==m||e[6]!==c.iconClassName?(h=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(m,{size:12,className:c.iconClassName})}),e[5]=m,e[6]=c.iconClassName,e[7]=h):h=e[7];let p;e[8]!==u?(p=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(ht,{size:14}):s.jsx(Fn,{size:14})}),e[8]=u,e[9]=p):p=e[9];let b;e[10]!==h||e[11]!==p?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[h,p]}),e[10]=h,e[11]=p,e[12]=b):b=e[12];let y;e[13]!==c.label?(y=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=y):y=e[14];let v;e[15]!==l.length?(v=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:l.length})}),e[15]=l.length,e[16]=v):v=e[16];let w;e[17]!==u||e[18]!==g||e[19]!==j||e[20]!==b||e[21]!==y||e[22]!==v?(w=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,onKeyDown:j,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,y,v]}),e[17]=u,e[18]=g,e[19]=j,e[20]=b,e[21]=y,e[22]=v,e[23]=w):w=e[23];let C;e[24]!==i||e[25]!==o||e[26]!==u||e[27]!==d||e[28]!==a||e[29]!==r||e[30]!==n||e[31]!==l?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(Zi,{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d})}),e[24]=i,e[25]=o,e[26]=u,e[27]=d,e[28]=a,e[29]=r,e[30]=n,e[31]=l,e[32]=C):C=e[32];let N;return e[33]!==w||e[34]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[w,C]}),e[33]=w,e[34]=C,e[35]=N):N=e[35],N}function Pt(t){const e=$.c(38),{threads:n,groupBy:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,filters:o,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Tn,{className:"size-6 opacity-60"}),e[0]=h):h=e[0];const p=u?"No threads match your filters":"No threads yet";let b;return e[1]!==p?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[h,s.jsx("p",{className:"text-sm",children:p})]}),e[1]=p,e[2]=b):b=e[2],b}const f=n.length>1||d;if(l==="status"){let h;if(e[3]!==i||e[4]!==f||e[5]!==o||e[6]!==a||e[7]!==r||e[8]!==n){let b;e[10]!==i||e[11]!==f||e[12]!==o||e[13]!==a||e[14]!==r?(b=y=>s.jsx(el,{status:y.status,threads:y.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:f,filters:o},y.status),e[10]=i,e[11]=f,e[12]=o,e[13]=a,e[14]=r,e[15]=b):b=e[15],h=Ei(n).map(b),e[3]=i,e[4]=f,e[5]=o,e[6]=a,e[7]=r,e[8]=n,e[9]=h}else h=e[9];let p;return e[16]!==h?(p=s.jsx(s.Fragment,{children:h}),e[16]=h,e[17]=p):p=e[17],p}let x;if(e[18]!==i||e[19]!==f||e[20]!==o||e[21]!==a||e[22]!==r||e[23]!==n){let h;e[25]!==i||e[26]!==f||e[27]!==o||e[28]!==a||e[29]!==r?(h=p=>s.jsx(rs,{task:p,isActive:i===p.id,onClick:()=>r(p),onArchive:f&&p.created_by===o.currentUserId?()=>a(p):void 0,showAutomationBadge:!!p.trigger_id,showAgentIcon:!0},p.id),e[25]=i,e[26]=f,e[27]=o,e[28]=a,e[29]=r,e[30]=h):h=e[30],x=n.map(h),e[18]=i,e[19]=f,e[20]=o,e[21]=a,e[22]=r,e[23]=n,e[24]=x}else x=e[24];let g;e[31]!==d||e[32]!==c||e[33]!==m?(g=(d||c)&&s.jsx(os,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=g):g=e[34];let j;return e[35]!==x||e[36]!==g?(j=s.jsxs(s.Fragment,{children:[x,g]}),e[35]=x,e[36]=g,e[37]=j):j=e[37],j}function Dt(t){const e=$.c(17),{label:n,onClick:l,active:i,children:r}=t,[a,o]=E.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>o(!0),c=()=>o(!1),m=()=>o(!0),u=()=>o(!1),e[0]=d,e[1]=c,e[2]=m,e[3]=u):(d=e[0],c=e[1],m=e[2],u=e[3]);const f=i&&"bg-sidebar-accent text-foreground";let x;e[4]!==f?(x=F(f),e[4]=f,e[5]=x):x=e[5];let g;e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==x?(g=s.jsx(ce,{asChild:!0,children:s.jsx(ve,{"aria-label":n,onClick:l,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:x,children:r})}),e[6]=r,e[7]=n,e[8]=l,e[9]=x,e[10]=g):g=e[10];let j;e[11]!==n?(j=s.jsx(de,{side:"bottom",children:n}),e[11]=n,e[12]=j):j=e[12];let h;return e[13]!==a||e[14]!==g||e[15]!==j?(h=s.jsxs(me,{open:a,children:[g,j]}),e[13]=a,e[14]=g,e[15]=j,e[16]=h):h=e[16],h}function Ye(t){const e=$.c(13),{label:n,value:l,onChange:i,options:r}=t;let a;e[0]!==n?(a=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==i?(o=u=>u&&i(u),e[2]=i,e[3]=o):o=e[3];let d;e[4]!==r?(d=r.map(tl),e[4]=r,e[5]=d):d=e[5];let c;e[6]!==o||e[7]!==d||e[8]!==l?(c=s.jsx(fn,{type:"single",size:"sm",value:l,onValueChange:o,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=o,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m;return e[10]!==a||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a,c]}),e[10]=a,e[11]=c,e[12]=m):m=e[12],m}function tl(t){return s.jsxs(un,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function ms({onNavigate:t}={}){const{data:e}=he.useSession(),n=e?.user?.id,{org:l}=se(),i=hn({connectionId:xn,orgId:l.id,orgSlug:l.slug}),r=Re(l.id).id,a=Xt(),{threads:o,hasMore:d,isFetchingMore:c,fetchNextPage:m}=ut(),u=o.filter(T=>!T.hidden),{hide:f}=Vt(),x=xe(),{setTaskId:g,createNewTask:j}=ft(),h=lt({strict:!1}),p=rt({strict:!1}),b=h.taskId??null,y=p.virtualmcpid??o.find(T=>T.id===b)?.virtual_mcp_id??null,v=()=>{t?.()},w=[...u].sort((T,H)=>(H.updated_at??"").localeCompare(T.updated_at??"")),[C,N]=E.useState("all"),[S,A]=E.useState("flat"),[k,z]=He("sidebar-threads-scope-all",!1),[_,I]=E.useState(!1),[M,L]=E.useState(!1),P={type:C,member:"mine",currentUserId:n??null},D=T=>n?T.filter(H=>H.created_by===n):[],O=T=>C==="automation"?T.filter(H=>!!H.trigger_id):C==="manual"?T.filter(H=>!H.trigger_id):T,R=D(w),G=O(R),V=O(w),Y=k?V:G,U=T=>{if(n&&T.created_by&&T.created_by!==n)return;const H=T.id===b;if(f(T.id),!H)return;const X=R.find(W=>W.id!==T.id&&W.virtual_mcp_id===T.virtual_mcp_id);v(),X?g(X.id,X.virtual_mcp_id):x({to:"/$org",params:{org:l.slug}})},q=T=>{v(),g(T.id,T.virtual_mcp_id)},B=async T=>{try{const H=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((H.structuredContent??H).items?.length??0)===0}catch{return!1}},Z=async()=>{const T=y??r;oe("sidebar_new_thread_clicked",{virtual_mcp_id:T});const H=R.find(X=>X.virtual_mcp_id===T&&X.title==="New chat");if(H&&await B(H.id)){v(),g(H.id,T);return}v(),j(T)},{state:ge,isMobile:ee,toggleSidebar:ue}=pe();if(ge==="collapsed"&&!ee){const T=Re(l.id),H=new Map((a??[]).map(W=>[W.id,W])),X=W=>(W?H.get(W):void 0)??(W===r?T:void 0);return s.jsxs(ae,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(K,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:ue,children:s.jsx(Gt,{size:16})})}),s.jsx(K,{children:s.jsx(J,{tooltip:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})}),Y.map(W=>{const ie=X(W.virtual_mcp_id);return s.jsx(K,{children:s.jsx(J,{tooltip:W.title||"New chat",isActive:W.id===b,onClick:()=>q(W),children:s.jsx(ye,{icon:ie?.icon??null,name:ie?.title??"Agent",size:"2xs"})})},W.id)})]})}const ne=S!=="flat"||C!=="all"||k===!0,fe=s.jsxs(Ge,{children:[s.jsxs(me,{children:[s.jsx(ce,{asChild:!0,children:s.jsx(ze,{asChild:!0,children:s.jsxs(ve,{"aria-label":"Filter threads",active:ne,children:[s.jsx(mn,{size:16}),ne&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(de,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Ue,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Ye,{label:"View",value:S,onChange:T=>{oe("tasks_panel_group_by_changed",{to_value:T}),A(T)},options:[{value:"flat",label:"List",icon:s.jsx(tn,{size:13})},{value:"status",label:"Status",icon:s.jsx(sn,{size:13})}]}),s.jsx(Ye,{label:"Type",value:C,onChange:T=>{oe("tasks_panel_filter_changed",{to_value:T}),N(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(Ye,{label:"Scope",value:k?"team":"mine",onChange:T=>z(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),je=T=>s.jsx(et,{delayDuration:300,children:s.jsxs("div",{className:F("shrink-0 px-1 flex items-center justify-between",T?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(Jt,{}),fe]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Dt,{label:"Search threads",onClick:()=>{oe("tasks_panel_search_opened"),L(!0),I(!0)},children:s.jsx(en,{size:16})}),s.jsx(Dt,{label:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})]})]})});return ee?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!0),s.jsx(At,{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(Pt,{threads:Y,groupBy:S,activeTaskId:b,onSelectTask:q,onArchiveTask:U,filters:P,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})}),M&&s.jsx(It,{open:_,onOpenChange:I})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(At,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Pt,{threads:Y,groupBy:S,activeTaskId:b,onSelectTask:q,onArchiveTask:U,filters:P,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})})}),M&&s.jsx(It,{open:_,onOpenChange:I})]})}const sl=5,nl=[{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 us(){const t=$.c(3),{state:e}=pe();if(e==="collapsed"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:sl}).map(rl)}),t[0]=i):i=t[0],i}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(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"})]}),s.jsx(te,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=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:nl.map(il)})]}),t[2]=l):l=t[2],l}function il(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(te,{className:"size-5 rounded-full shrink-0"}),s.jsx(te,{className:F("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(ll)})]},e)}function ll(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(te,{className:"h-3 flex-1 rounded-sm"})},e)}function rl(t,e){return s.jsx(te,{className:"size-10 rounded-lg mx-auto"},e)}function ol(){const t=$.c(4),e=ss();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Mi,{}),t[0]=n):n=t[0];let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Rt,{children:s.jsx(E.Suspense,{fallback:s.jsx(us,{}),children:s.jsx(ms,{})})}),t[1]=l):l=t[1];let i;return t[2]!==e?(i=s.jsx(Zt,{children:s.jsx(ls,{sections:e,footer:n,additionalContent:l})}),t[2]=e,t[3]=i):i=t[3],i}function al(t){const e=$.c(8),{onClose:n}=t,l=ss();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Oi,{}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(us,{}),e[1]=r):r=e[1];let a;e[2]!==n?(a=s.jsx(Rt,{children:s.jsx(E.Suspense,{fallback:r,children:s.jsx(ms,{onNavigate:n})})}),e[2]=n,e[3]=a):a=e[3];let o;return e[4]!==n||e[5]!==l||e[6]!==a?(o=s.jsx(Zt,{children:s.jsx(Ni,{sections:l,onClose:n,footer:i,additionalContent:a})}),e[4]=n,e[5]=l,e[6]=a,e[7]=o):o=e[7],o}function fs(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const cl=ks({name:As().min(2,"Organization name is required")});function dl(t){const e=$.c(41),{open:n,onOpenChange:l}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:Is(cl),defaultValues:{name:""}},e[0]=i):i=e[0];const r=zs(i);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:ul,onSuccess:ml},e[1]=a):a=e[1];const o=$s(a),d=o.error instanceof Error?o.error.message:o.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Vn,{children:[s.jsx(Yn,{children:"Create a new organization"}),s.jsx(Qn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==o||e[4]!==r){let N;e[6]!==o?(N=S=>o.mutateAsync(S),e[6]=o,e[7]=N):N=e[7],m=r.handleSubmit(N),e[3]=o,e[4]=r,e[5]=m}else m=e[5];let u;e[8]!==r.formState.isSubmitting?(u=N=>{const{field:S}=N;return s.jsxs(si,{children:[s.jsx(ni,{children:"Organization Name"}),s.jsx(ii,{children:s.jsx(oi,{...S,placeholder:"Acme Inc.",disabled:r.formState.isSubmitting})}),s.jsx(li,{children:"The name of your company or organization"}),S.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:"","/",fs(S.value)]})]}),s.jsx(ri,{})]})},e[8]=r.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==r.control||e[11]!==u?(f=s.jsx(ei,{control:r.control,name:"name",render:u}),e[10]=r.control,e[11]=u,e[12]=f):f=e[12];let x;e[13]!==d?(x=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=x):x=e[14];let g;e[15]!==o||e[16]!==r?(g=()=>{o.reset(),r.reset()},e[15]=o,e[16]=r,e[17]=g):g=e[17];let j;e[18]!==r.formState.isSubmitting||e[19]!==g?(j=s.jsx(Kn,{disabled:r.formState.isSubmitting,onClick:g,children:"Cancel"}),e[18]=r.formState.isSubmitting,e[19]=g,e[20]=j):j=e[20];const h=!r.formState.isValid||r.formState.isSubmitting;let p;e[21]!==r.formState.isSubmitting?(p=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Hn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=r.formState.isSubmitting,e[22]=p):p=e[22];let b;e[23]!==h||e[24]!==p?(b=s.jsx(Je,{type:"submit",variant:"default",disabled:h,children:p}),e[23]=h,e[24]=p,e[25]=b):b=e[25];let y;e[26]!==b||e[27]!==j?(y=s.jsxs(Jn,{children:[j,b]}),e[26]=b,e[27]=j,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==m||e[31]!==f||e[32]!==x?(v=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,x,y]}),e[29]=y,e[30]=m,e[31]=f,e[32]=x,e[33]=v):v=e[33];let w;e[34]!==r||e[35]!==v?(w=s.jsxs(Xn,{children:[c,s.jsx(ti,{...r,children:v})]}),e[34]=r,e[35]=v,e[36]=w):w=e[36];let C;return e[37]!==l||e[38]!==n||e[39]!==w?(C=s.jsx(Zn,{open:n,onOpenChange:l,children:w}),e[37]=l,e[38]=n,e[39]=w,e[40]=C):C=e[40],C}function ml(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function ul(t){const e=fs(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await he.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function hs(){const t=E.useContext(Ts),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>n?.()}}function fl(t){let e=0;for(let l=0;l<t.length;l++)e=t.charCodeAt(l)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function pt(t){const e=$.c(13),{org:n,size:l}=t,i=l===void 0?"sm":l,r=i==="xs"?"size-5":"size-6",a=i==="xs"?"text-[9px]":"text-xs";let o;e[0]!==r?(o=F(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=o):o=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:fl(n.name),e[2]=n.logo,e[3]=n.name,e[4]=d):d=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==a?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:F("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=c):c=e[8];let m;return e[9]!==o||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:o,style:d,children:c}),e[9]=o,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function hl({invitation:t,onChanged:e}){const[n,l]=E.useState(!1),i=t.organizationName??"Unknown organization",r=async()=>{l(!0);try{const d=await he.organization.acceptInvitation({invitationId:t.id});if(d.error){re.error(d.error.message),l(!1);return}}catch{re.error("Failed to accept invitation"),l(!1);return}re.success(`Joined ${i}`),Os();let o;try{o=(await he.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=o?`/${o}`:"/"},a=async()=>{l(!0);try{const o=await he.organization.rejectInvitation({invitationId:t.id});if(o.error){re.error(o.error.message),l(!1);return}re.success("Invitation declined"),l(!1),e()}catch{re.error("Failed to decline invitation"),l(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx(pt,{org:{name:i},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:i}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(Je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:n,children:"Accept"}),s.jsx(Je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:n,"aria-label":`Decline invitation to ${i}`,children:s.jsx(qn,{size:14})})]})]})}function xl(t){const e=$.c(29),{orgParam:n,onSelectOrg:l,onCreateOrg:i}=t,{data:r}=Ms(),{invitations:a,refetch:o}=hs();let d;e[0]!==n?(d=(_,I)=>_.slug===n?-1:I.slug===n?1:_.name.localeCompare(I.name),e[0]=n,e[1]=d):d=e[1];const c=[...r??[]].sort(d),[m,u]=E.useState(""),f=m.toLowerCase(),x=f?c.filter(_=>_.name.toLowerCase().includes(f)||_.slug.toLowerCase().includes(f)):c;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ts,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=g):g=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=_=>u(_.target.value),e[3]=j):j=e[3];let h;e[4]!==m?(h=_=>_.key==="Escape"&&m&&u(""),e[4]=m,e[5]=h):h=e[5];let p;e[6]!==m||e[7]!==h?(p=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:m,onChange:j,onKeyDown:h,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=m,e[7]=h,e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx($e,{size:16}),e[9]=b):b=e[9];let y;e[10]!==i?(y=s.jsx("button",{type:"button",onClick:i,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]=i,e[11]=y):y=e[11];let v;e[12]!==p||e[13]!==y?(v=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[g,p,y]}),e[12]=p,e[13]=y,e[14]=v):v=e[14];const w="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let C;e[15]!==a||e[16]!==m||e[17]!==o?(C=!m&&a.map(_=>s.jsx(hl,{invitation:_,onChanged:o},_.id)),e[15]=a,e[16]=m,e[17]=o,e[18]=C):C=e[18];const N=x.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:m?`No organizations match "${m}"`:"No organizations available"});let S;e[19]!==l||e[20]!==n?(S=_=>s.jsxs("button",{type:"button",onClick:()=>l(_.slug),className:F("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",_.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(pt,{org:_,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:_.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.slug})]}),_.slug===n&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},_.id),e[19]=l,e[20]=n,e[21]=S):S=e[21];const A=x.map(S);let k;e[22]!==C||e[23]!==N||e[24]!==A?(k=s.jsxs("div",{className:w,children:[C,N,A]}),e[22]=C,e[23]=N,e[24]=A,e[25]=k):k=e[25];let z;return e[26]!==k||e[27]!==v?(z=s.jsxs(s.Fragment,{children:[v,k]}),e[26]=k,e[27]=v,e[28]=z):z=e[28],z}function pl(t){const e=$.c(22),{trigger:n,orgParam:l,align:i,side:r}=t,a=i===void 0?"start":i,o=r===void 0?"bottom":r,d=xe(),[c,m]=E.useState(!1),[u,f]=E.useState(!1);let x;e[0]!==n?(x=s.jsx(ze,{asChild:!0,children:n}),e[0]=n,e[1]=x):x=e[1];const g=String(c);let j;e[2]!==d?(j=C=>{m(!1),d({to:"/$org",params:{org:C}})},e[2]=d,e[3]=j):j=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{m(!1),f(!0)},e[4]=h):h=e[4];let p;e[5]!==l||e[6]!==g||e[7]!==j?(p=s.jsx(xl,{orgParam:l,onSelectOrg:j,onCreateOrg:h},g),e[5]=l,e[6]=g,e[7]=j,e[8]=p):p=e[8];let b;e[9]!==a||e[10]!==o||e[11]!==p?(b=s.jsx(Ue,{side:o,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:bl,onCloseAutoFocus:gl,children:p}),e[9]=a,e[10]=o,e[11]=p,e[12]=b):b=e[12];let y;e[13]!==c||e[14]!==x||e[15]!==b?(y=s.jsxs(Ge,{open:c,onOpenChange:m,children:[x,b]}),e[13]=c,e[14]=x,e[15]=b,e[16]=y):y=e[16];let v;e[17]!==u?(v=s.jsx(dl,{open:u,onOpenChange:f}),e[17]=u,e[18]=v):v=e[18];let w;return e[19]!==v||e[20]!==y?(w=s.jsxs(s.Fragment,{children:[y,v]}),e[19]=v,e[20]=y,e[21]=w):w=e[21],w}function gl(t){return t.preventDefault()}function bl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function jl(t){const e=$.c(21),{value:n,onChange:l,placeholder:i,onKeyDown:r,className:a,isSearching:o,disabled:d}=t,c=i===void 0?"Search...":i;let m;e[0]!==a?(m=F("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=F("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let x;e[4]!==o?(x=o?s.jsx(Lt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(ts,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=o,e[5]=x):x=e[5];let g;e[6]!==l?(g=b=>l(b.target.value),e[6]=l,e[7]=g):g=e[7];let j;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==g||e[12]!==n?(j=s.jsx("input",{type:"text",value:n,onChange:g,onKeyDown:r,placeholder:c,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=r,e[10]=c,e[11]=g,e[12]=n,e[13]=j):j=e[13];let h;e[14]!==f||e[15]!==x||e[16]!==j?(h=s.jsxs("label",{className:f,children:[x,j]}),e[14]=f,e[15]=x,e[16]=j,e[17]=h):h=e[17];let p;return e[18]!==m||e[19]!==h?(p=s.jsx("div",{className:m,children:h}),e[18]=m,e[19]=h,e[20]=p):p=e[20],p}const vl="Select an existing agent";function yl(t){const e=$.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(ce,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(de,{side:"right",sideOffset:8,children:vl}),e[2]=i):i=e[2];let r;return e[3]!==l?(r=s.jsxs(me,{defaultOpen:!0,delayDuration:0,children:[l,i]}),e[3]=l,e[4]=r):r=e[4],r}function Sl(t){const e=xe(),{create:n}=Vt(),{locator:l}=se(),i=lt({strict:!1}),r=rt({strict:!1});return async a=>{const o=crypto.randomUUID(),d=a===r.virtualmcpid?vn(t,l,i.taskId??""):null;try{await n({id:o,virtual_mcp_id:a,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:o},search:{virtualmcpid:a}})}}function Qe(t){const e=$.c(20),{agent:n,selected:l,onClick:i}=t,r=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=F("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let o;e[2]!==n.icon||e[3]!==n.title?(o=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=o):o=e[4];let d;e[5]!==n.title?(d=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let m;e[9]!==d||e[10]!==c?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let u;e[12]!==l?(u=l&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==i||e[15]!==a||e[16]!==o||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:i,className:a,children:[o,m,u]}),e[14]=i,e[15]=a,e[16]=o,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Ft(t){const e=$.c(5),{children:n,action:l}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i?(r=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,l]}),e[2]=l,e[3]=i,e[4]=r):r=e[4],r}function Nl(t){const e=$.c(27),{onClose:n,onSelectAgent:l,selectedAgentId:i,onImportFromGithub:r}=t,[a,o]=E.useState(""),d=Xt(),c=d??[],{org:m}=se(),{data:u}=he.useSession(),f=u?.user?.id??"anon",x=Ln(d),g=Rn(),j=Sl(m.slug),h=an(d),p=a.toLowerCase(),b=c.filter(kl).filter(B=>!h.has(B.id)).filter(wl).filter(B=>!a||B.title.toLowerCase().includes(p)),y=b.filter(Cl),v=b.filter(_l),w=Re(m.id),C=!a||w.title.toLowerCase().includes(p),N=!!(l&&C);let S;e[0]!==n||e[1]!==l?(S=()=>{l?.(null),n(),o("")},e[0]=n,e[1]=l,e[2]=S):S=e[2];const A=S,k=B=>{if(l){l(B.id),n(),o("");return}Bn({orgId:m.id,userId:f},B.id,x),g(),n(),o(""),j(B.id)},z="flex flex-col max-h-[min(640px,80dvh)]";let _;e[3]!==a?(_=s.jsx(jl,{value:a,onChange:o,placeholder:"Search agents..."}),e[3]=a,e[4]=_):_=e[4];const I="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",M=l&&C&&w&&s.jsx(Qe,{agent:w,selected:!i||i===w.id,onClick:A}),L=v.length>0&&s.jsx(Ft,{children:"Agents"}),P=v.map(B=>s.jsx(Qe,{agent:B,selected:l?i===B.id:void 0,onClick:()=>k(B)},B.id)),D=(y.length>0||!a)&&s.jsx(Ft,{action:s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[s.jsx(ci,{className:"size-3.5"}),"Import"]}),children:"Code Agents"}),O=y.map(B=>s.jsx(Qe,{agent:B,selected:l?i===B.id:void 0,onClick:()=>k(B)},B.id));let R;e[5]!==N||e[6]!==a||e[7]!==b.length?(R=b.length===0&&!N&&a&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:"No agents found"}),e[5]=N,e[6]=a,e[7]=b.length,e[8]=R):R=e[8];let G;e[9]!==R||e[10]!==M||e[11]!==L||e[12]!==P||e[13]!==D||e[14]!==O?(G=s.jsxs("div",{className:I,children:[M,L,P,D,O,R]}),e[9]=R,e[10]=M,e[11]=L,e[12]=P,e[13]=D,e[14]=O,e[15]=G):G=e[15];let V;e[16]!==m.slug?(V={org:m.slug},e[16]=m.slug,e[17]=V):V=e[17];let Y;e[18]!==n?(Y=()=>n(),e[18]=n,e[19]=Y):Y=e[19];let U;e[20]!==V||e[21]!==Y?(U=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ps,{to:"/$org/settings/agents",params:V,onClick:Y,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[20]=V,e[21]=Y,e[22]=U):U=e[22];let q;return e[23]!==G||e[24]!==U||e[25]!==_?(q=s.jsxs("div",{className:z,children:[_,G,U]}),e[23]=G,e[24]=U,e[25]=_,e[26]=q):q=e[26],q}function _l(t){return!Kt(t.metadata)}function Cl(t){return Kt(t.metadata)}function wl(t){return!gn(t.id)}function kl(t){return!pn(t.id)}function Al(t){const e=$.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:i,onSelectAgent:r,selectedAgentId:a,side:o,align:d}=n,c=l===void 0?!1:l,m=o===void 0?"right":o,u=d===void 0?"start":d,[f,x]=E.useState(!1),[g,j]=E.useState(!1),h=ct(),{setOpenMobile:p}=pe(),b=En(),y=b?"border border-border":void 0;let v;e[2]!==b?(v=L=>b?s.jsx(yl,{children:L}):L,e[2]=b,e[3]=v):v=e[3];const w=v;let C;e[4]!==h||e[5]!==p?(C=()=>{x(!1),h&&p(!1)},e[4]=h,e[5]=p,e[6]=C):C=e[6];const N=C;let S;e[7]!==N?(S=()=>{N(),j(!0)},e[7]=N,e[8]=S):S=e[8];const A=S;let k;e[9]!==N||e[10]!==A||e[11]!==r||e[12]!==f||e[13]!==a?(k=f&&s.jsx(E.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(te,{className:"h-4 w-24"})}),children:s.jsx(Nl,{onClose:N,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:A})}),e[9]=N,e[10]=A,e[11]=r,e[12]=f,e[13]=a,e[14]=k):k=e[14];const z=k;let _;e[15]!==u||e[16]!==c||e[17]!==y||e[18]!==b||e[19]!==h||e[20]!==f||e[21]!==z||e[22]!==m||e[23]!==i||e[24]!==w?(_=h?s.jsxs(s.Fragment,{children:[i?s.jsx("button",{type:"button",onClick:()=>x(!0),className:"contents",children:i}):c?w(s.jsx(ve,{"aria-label":"Browse agents",className:F(y),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),x(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(K,{children:w(s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:F(y),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),x(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Ut,{open:f,onOpenChange:x,direction:"bottom",children:s.jsxs(Wt,{className:"max-h-[85dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Browse agents"}),z]})})]}):s.jsxs(Ge,{open:f,onOpenChange:L=>{L&&!f&&oe("agent_browser_opened",{surface:"desktop_popover"}),x(L)},children:[i?s.jsx(ze,{asChild:!0,children:i}):c?w(s.jsx(ze,{asChild:!0,children:s.jsx(ve,{"aria-label":"Browse agents",className:F(y),children:s.jsx($e,{className:"size-4"})})})):s.jsx(K,{children:w(s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:F(y),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ue,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:z})]}),e[15]=u,e[16]=c,e[17]=y,e[18]=b,e[19]=h,e[20]=f,e[21]=z,e[22]=m,e[23]=i,e[24]=w,e[25]=_):_=e[25];let I;e[26]!==g?(I=s.jsx(ai,{open:g,onOpenChange:j,mode:"agent"}),e[26]=g,e[27]=I):I=e[27];let M;return e[28]!==I||e[29]!==_?(M=s.jsxs(s.Fragment,{children:[_,I]}),e[28]=I,e[29]=_,e[30]=M):M=e[30],M}const Il="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function zl(t){const e=$.c(19),{agentId:n,fallback:l,onOpenHome:i,onPick:r}=t,a=mt(n)??l??null,o=a?.title??"Super Agent",d=`Open ${o} home`,c=a?.icon??null;let m;e[0]!==c||e[1]!==o?(m=s.jsx(ye,{icon:c,name:o,size:"xs"}),e[0]=c,e[1]=o,e[2]=m):m=e[2];let u;e[3]!==i||e[4]!==d||e[5]!==m?(u=s.jsx("button",{type:"button",onClick:i,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:m}),e[3]=i,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==o?(f=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:o}),e[7]=o,e[8]=f):f=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=x):x=e[9];let g;e[10]!==f?(g=s.jsxs("button",{type:"button",className:Il,children:[f,x]}),e[10]=f,e[11]=g):g=e[11];let j;e[12]!==n||e[13]!==r||e[14]!==g?(j=s.jsx(Al,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:g}),e[12]=n,e[13]=r,e[14]=g,e[15]=j):j=e[15];let h;return e[16]!==u||e[17]!==j?(h=s.jsxs("div",{className:"flex items-center gap-1",children:[u,j]}),e[16]=u,e[17]=j,e[18]=h):h=e[18],h}function Et(){const t=$.c(43),{org:e}=se(),{state:n,isMobile:l}=pe(),i=xe();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const a=lt(r);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[1]=o):o=t[1];const d=rt(o),{threads:c}=ut(),{setTaskId:m,createNewTask:u}=ft(),f=hs().invitations.length>0,x=n==="collapsed"||l;let g;t[2]!==e.id?(g=Re(e.id),t[2]=e.id,t[3]=g):g=t[3];const j=g,h=j.id,p=a.taskId?d.virtualmcpid??h:h;let b;t[4]!==u||t[5]!==h||t[6]!==i||t[7]!==e.slug||t[8]!==m||t[9]!==c?(b=O=>{if(!O||O===h){i({to:"/$org",params:{org:e.slug}});return}const R=di(c,O);R?m(R.id,O):u(O)},t[4]=u,t[5]=h,t[6]=i,t[7]=e.slug,t[8]=m,t[9]=c,t[10]=b):b=t[10];const y=b,v=f?`${e.name} — switch organization (pending invitation)`:`${e.name} — switch organization`;let w;t[11]!==e?(w=s.jsx(pt,{org:e,size:"sm"}),t[11]=e,t[12]=w):w=t[12];let C;t[13]!==f||t[14]!==x?(C=f&&s.jsx("span",{className:F("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",x?"-top-1":"top-1/2 -translate-y-1/2")}),t[13]=f,t[14]=x,t[15]=C):C=t[15];let N;t[16]!==w||t[17]!==C?(N=s.jsxs("span",{className:"relative inline-flex",children:[w,C]}),t[16]=w,t[17]=C,t[18]=N):N=t[18];let S;t[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[19]=S):S=t[19];let A;t[20]!==v||t[21]!==N?(A=s.jsx(ce,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":v,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-md pl-3 pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[N,S]})}),t[20]=v,t[21]=N,t[22]=A):A=t[22];let k;t[23]!==e.slug||t[24]!==A?(k=s.jsx(pl,{orgParam:e.slug,trigger:A}),t[23]=e.slug,t[24]=A,t[25]=k):k=t[25];let z;t[26]!==e.name?(z=s.jsx(de,{side:"bottom",children:e.name}),t[26]=e.name,t[27]=z):z=t[27];let _;t[28]!==k||t[29]!==z?(_=s.jsx(St,{children:s.jsxs(me,{children:[k,z]})}),t[28]=k,t[29]=z,t[30]=_):_=t[30];let I;t[31]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),t[31]=I):I=t[31];const M=p===h?j:void 0;let L;t[32]!==p||t[33]!==y?(L=()=>y(p),t[32]=p,t[33]=y,t[34]=L):L=t[34];let P;t[35]!==p||t[36]!==y||t[37]!==M||t[38]!==L?(P=s.jsx(St,{children:s.jsx(E.Suspense,{fallback:I,children:s.jsx(zl,{agentId:p,fallback:M,onOpenHome:L,onPick:y})})}),t[35]=p,t[36]=y,t[37]=M,t[38]=L,t[39]=P):P=t[39];let D;return t[40]!==_||t[41]!==P?(D=s.jsx(Un,{className:"wco-no-drag",children:s.jsxs(Wn,{className:"flex-nowrap gap-1.5 sm:gap-1.5",children:[_,P]})}),t[40]=_,t[41]=P,t[42]=D):D=t[42],D}const $l="sidebar.open";function Tl(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{}),t[0]=e):e=t[0],e}function qo(){const t=$.c(24),e=ct(),[n,l]=He($l,!1),{width:i,wrapperRef:r,onStartResize:a,resetWidth:o}=hi();let d;t[0]!==e?(d=e?s.jsxs(Q.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] items-center gap-2",children:[s.jsx(Jt,{}),s.jsx(Et,{}),s.jsx(nt,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(Q.TogglesSlot,{}),s.jsx(Q.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(Q.CenterSlot,{}),s.jsx(Q.RightSlot,{})]}):s.jsxs(Q.Header,{children:[s.jsxs(Q.LeftColumn,{children:[s.jsx(Et,{}),s.jsx(Q.TogglesSlot,{})]}),s.jsx(Q.CenterSlot,{}),s.jsxs(Q.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(Q.TabsSlot,{})}),s.jsx(Q.RightSlot,{})]})]}),t[0]=e,t[1]=d):d=t[1];const c=`${i}px`;let m;t[2]!==c?(m={"--sidebar-width":c,"--sidebar-width-icon":"3.5rem"},t[2]=c,t[3]=m):m=t[3];const u=m;let f;t[4]!==e||t[5]!==a||t[6]!==o?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(ol,{}),s.jsx(mi,{onPointerDown:a,onDoubleClick:o})]}),t[4]=e,t[5]=a,t[6]=o,t[7]=f):f=t[7];let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x={background:"transparent",containerType:"inline-size"},t[8]=x):x=t[8];let g;t[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Rs,{className:"flex flex-col",style:x,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(E.Suspense,{fallback:s.jsx(Tl,{}),children:s.jsx(Ds,{})})})})}),t[9]=g):g=t[9];let j;t[10]!==u||t[11]!==f||t[12]!==r?(j=s.jsxs(Bs,{ref:r,className:"flex-1 bg-sidebar relative min-h-0",style:u,children:[f,g]}),t[10]=u,t[11]=f,t[12]=r,t[13]=j):j=t[13];let h;t[14]!==e?(h=e&&s.jsx($n,{renderSidebar:Ml}),t[14]=e,t[15]=h):h=t[15];let p;t[16]!==d||t[17]!==j||t[18]!==h?(p=s.jsx(Gn,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[d,j,h]})}),t[16]=d,t[17]=j,t[18]=h,t[19]=p):p=t[19];let b;return t[20]!==l||t[21]!==n||t[22]!==p?(b=s.jsx(jn,{children:s.jsx(Q.Provider,{children:s.jsx(Hs,{open:n,onOpenChange:l,children:p})})}),t[20]=l,t[21]=n,t[22]=p,t[23]=b):b=t[23],b}function Ml(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(al,{onClose:e})})})}export{qo as default};
@@ -1 +0,0 @@
1
- import{c as u,$ as d,r as f,j as l,a7 as g,N as x}from"./index-CE5H3VpT.js";import{a as h}from"./constants-B72Xmt_K.js";import{a as j}from"./hooks-DqC-czl4.js";import{f as I}from"./reusable-new-chat-qqWu133U.js";import"./use-mcp-client-ZBC-eCDx.js";import"./auth-Dh53AhUb.js";import"./decopilot-sse-pool-moj0w8Vo.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function y(){const t=u.c(9),{org:s}=d(),r=h(s.id).id,{threads:m,status:c}=j(),[p]=f.useState(R);if(c.kind==="loading"){let a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(g,{}),t[0]=a):a=t[0],a}const n=I(m,r)?.id??p;let e;t[1]!==s.slug||t[2]!==n?(e={org:s.slug,taskId:n},t[1]=s.slug,t[2]=n,t[3]=e):e=t[3];let o;t[4]!==r?(o={virtualmcpid:r},t[4]=r,t[5]=o):o=t[5];let i;return t[6]!==e||t[7]!==o?(i=l.jsx(x,{to:"/$org/$taskId",params:e,search:o,replace:!0}),t[6]=e,t[7]=o,t[8]=i):i=t[8],i}function R(){return crypto.randomUUID()}export{y as default};
@@ -1 +0,0 @@
1
- import{c as it,r as b,j as e,i as rt}from"./index-CE5H3VpT.js";import{m as mt,o as pt,p as st,q as at}from"./sidebar-DoDKf_4K.js";import{B as nt}from"./automation-runs-Ddmvrziu.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-DYaVDnHX.js";import{v as xt}from"./index-ADar06lH.js";import"./LayoutLeft-C7UYEc8w.js";import"./use-mobile-BGgRMBqg.js";import"./X-De82F_yV.js";import"./tooltip-Cg3rQVMP.js";import"./select-p16t1oqR.js";import"./Check-BBbJanyi.js";import"./ChevronDown-CdhVz413.js";import"./ChevronUp-VC09djpz.js";import"./useInfiniteQuery-D3w5TQxr.js";import"./use-infinite-scroll-DQs52IQI.js";import"./use-connection-Bnuwr5M1.js";import"./use-collections-FdPpYeY0.js";import"./use-mcp-client-ZBC-eCDx.js";import"./constants-B72Xmt_K.js";import"./auth-Dh53AhUb.js";import"./use-virtual-mcp-DOdyKPNe.js";import"./card-1rWslgPf.js";import"./table-f2GQgPNW.js";import"./empty-state-BKnsu1Gz.js";import"./use-members-V-W3kQEI.js";import"./use-org-auth-client-BvkB8WEw.js";import"./use-clock-tick-KJrFAFXc.js";import"./AlertCircle-C3XBF3Lj.js";import"./CheckCircle-CUAoW5BF.js";import"./Circle-BaBs0XFQ.js";import"./agent-icon-CQDdwbbu.js";import"./Tool01-NvZF1kAv.js";import"./SwitchHorizontal01-mHS8gX9f.js";import"./Settings02-iM-HC30X.js";import"./XCircle-CrMyqBpn.js";import"./ArrowUpRight-BAyBOox4.js";import"./ZapSquare-BxP2mvwj.js";import"./Users03-DSGWvEeU.js";import"./Loading02-BfehCN_S.js";import"./ChevronRight-DSkRxyMp.js";import"./Stars02-CKZjtcO2.js";import"./Copy01-BqGbD9kh.js";import"./ZoomOut-BORQEG0K.js";import"./DotsVertical-Dx7q3hEM.js";import"./Globe01-C7l3-Kj_.js";import"./Eye-m_jc4WHC.js";import"./FilterLines-DJ3lRTxj.js";import"./Star01-D7maP7yw.js";import"./Globe04-C3kyaQkX.js";import"./HardDrive-BfnTWF0w.js";import"./Key01-DJufXC5l.js";import"./LinkExternal01-DHPLvAlj.js";import"./List-DbYeo32c.js";import"./Monitor01-z8KVt_1L.js";import"./Sun-D7S1ER7S.js";import"./Palette-D0EiCOKi.js";import"./Play-DPT-Lr30.js";import"./Plus-DaZdxod6.js";import"./SearchLg-DxD_D_4n.js";import"./SearchMd-ByN3gshP.js";import"./Shield01-B9NrENV2.js";import"./Stars01-DlXhHEac.js";import"./Trash01-BXE2cBJq.js";import"./Upload01-CypbVjGY.js";import"./User01-BB062KFn.js";import"./Users01-CffdXVAr.js";import"./XClose-Dg02sB1B.js";import"./Zap-BtxkJShL.js";import"./use-automations-C2_4_jPZ.js";import"./studio-tools-7Wg9yY_n.js";import"./useSuspenseInfiniteQuery-bZ1w_AdM.js";import"./badge-BPlPS6-U.js";import"./checkbox-CIo6Fidy.js";import"./command-1aG03_je.js";import"./index-DBc0WuE4.js";import"./dialog-C3IuPH3f.js";import"./popover-CLvqhSp6.js";import"./avatar-CBGAelvW.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-LQlzIxLa.js";import"./file-type-icon-D3hb0Drj.js";import"./tab-id-DAJ8K7VA.js";import"./monaco-editor-BFTtBdRV.js";import"./index-BwFf1RZV.js";import"./chat-context-E29cn9cH.js";import"./autosend-U-xpRpSE.js";import"./hooks-DqC-czl4.js";import"./decopilot-sse-pool-moj0w8Vo.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-BLYI7is3.js";import"./use-decopilot-events-CFzSYSZ0.js";import"./use-organization-settings-B0Nwjkeh.js";import"./types-B-PIV7tw.js";import"./shell-layout-Ur6mRNK2.js";import"./alert-dialog-C9L2oZsl.js";import"./required-auth-layout-C7z1SSP_.js";import"./use-org-sso-B_WqXsc5.js";import"./integration-icon-BDMIArBS.js";import"./use-navigate-to-agent-Dn2BNzaE.js";import"./reusable-new-chat-qqWu133U.js";import"./use-mcp-prompts-CccYNdu3.js";import"./form-B3R-A37u.js";import"./label-xBJ0yPUA.js";import"./input-kOQaqTZ-.js";import"./switch-DHEIkHtS.js";import"./drawer-DNygCL0g.js";import"./collection-search-BQbTxwoW.js";import"./tabs-djg35jJe.js";import"./toggle-group-CyItOhMq.js";import"./agent-capabilities-B0Jsdt6p.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BX64E0ZX.js";import"./use-registry-connections-DMa9GcRc.js";import"./extract-connection-data-baLEbDV8.js";import"./collection-tabs-CoU3ihMK.js";import"./textarea-BcDVHw10.js";import"./connection-form-helpers-CFnSkiaw.js";import"./authenticate-and-persist-oauth-Dju715T5.js";import"./mcp-oauth-BvfQRZ3m.js";import"./connect-desktop-dialog-9CJopn2Q.js";import"./select-model-CNBU35Uk.js";import"./skeleton-H_BeyWZC.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-iYQ69o_s.js";import"./dropdown-menu-KKF-lxCP.js";import"./index-HXaQVvR_.js";import"./toolbar-Bx2JvL88.js";import"./use-debounced-value-wokrtNfu.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CnHm0wXx.js";import"./use-mcp-tools-FxYZ1Cxx.js";import"./use-capability-B58SdY6m.js";import"./tools-list-aqaPnMDt.js";import"./use-debounced-autosave-CtV7p_Pr.js";import"./index-DqD1ib5M.js";import"./search-input-DmhKRv1z.js";import"./github-repo-picker-DUcUZ8Lg.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-DEtr_hQU.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-CZ6_AyFs.js";import"./get-initials-D-f_fDFw.js";import"./calendar-CrC0GPqv.js";import"./toolbar-icon-button-Du8AVUGg.js";import"./automation-list-row-BuZlqyz_.js";import"./use-file-configs-NGX_LaaZ.js";function ni(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]=b.useState(k),[tt,i]=b.useState(null),[J,g]=b.useState(void 0),[x,y]=b.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 B=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 M=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 V=F,q=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,z=m.kind==="site"&&o&&n,A=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 H=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const $=O;let l;t[13]!==q?(l=e.jsx(mt,{className:"text-sm font-semibold",children:q}),t[13]=q,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]!==$||t[22]!==H||t[23]!==B||t[24]!==v||t[25]!==h||t[26]!==A||t[27]!==x||t[28]!==M||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==z||t[37]!==_?(S=!o||!T&&!z?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:A}):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:B,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:H,onBumpFormKey:$}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:M})})})}),t[20]=p,t[21]=$,t[22]=H,t[23]=B,t[24]=v,t[25]=h,t[26]=A,t[27]=x,t[28]=M,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=z,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 E;return t[42]!==V||t[43]!==N||t[44]!==f?(E=e.jsx(at,{open:N,onOpenChange:V,children:f}),t[42]=V,t[43]=N,t[44]=f,t[45]=E):E=t[45],E}function yt(u){return u+1}function wt(u){return u+1}export{ni as SeoSheet};
@@ -1 +0,0 @@
1
- import{c as w,$ as H,j as A}from"./index-CE5H3VpT.js";import{a as L,g as E,s as b}from"./automation-runs-Ddmvrziu.js";import{u as O}from"./use-mcp-client-ZBC-eCDx.js";import{p as k}from"./constants-B72Xmt_K.js";import{b as q,c as B}from"./use-mcp-tools-FxYZ1Cxx.js";import{u as Y}from"./index-ADar06lH.js";import{c as G}from"./monaco-editor-BFTtBdRV.js";import{g as K,M as V,a as $}from"./types-B-PIV7tw.js";import{a as z,u as F}from"./chat-context-E29cn9cH.js";import{u as J}from"./shell-layout-Ur6mRNK2.js";import"./select-p16t1oqR.js";import"./tooltip-Cg3rQVMP.js";import"./Check-BBbJanyi.js";import"./ChevronDown-CdhVz413.js";import"./ChevronUp-VC09djpz.js";import"./useInfiniteQuery-D3w5TQxr.js";import"./use-infinite-scroll-DQs52IQI.js";import"./use-connection-Bnuwr5M1.js";import"./use-collections-FdPpYeY0.js";import"./use-virtual-mcp-DOdyKPNe.js";import"./card-1rWslgPf.js";import"./sidebar-DoDKf_4K.js";import"./LayoutLeft-C7UYEc8w.js";import"./use-mobile-BGgRMBqg.js";import"./X-De82F_yV.js";import"./table-f2GQgPNW.js";import"./empty-state-BKnsu1Gz.js";import"./use-members-V-W3kQEI.js";import"./use-org-auth-client-BvkB8WEw.js";import"./use-clock-tick-KJrFAFXc.js";import"./AlertCircle-C3XBF3Lj.js";import"./CheckCircle-CUAoW5BF.js";import"./Circle-BaBs0XFQ.js";import"./agent-icon-CQDdwbbu.js";import"./Tool01-NvZF1kAv.js";import"./SwitchHorizontal01-mHS8gX9f.js";import"./Settings02-iM-HC30X.js";import"./XCircle-CrMyqBpn.js";import"./ArrowUpRight-BAyBOox4.js";import"./ZapSquare-BxP2mvwj.js";import"./Users03-DSGWvEeU.js";import"./Loading02-BfehCN_S.js";import"./ChevronRight-DSkRxyMp.js";import"./Stars02-CKZjtcO2.js";import"./Copy01-BqGbD9kh.js";import"./ZoomOut-BORQEG0K.js";import"./DotsVertical-Dx7q3hEM.js";import"./Globe01-C7l3-Kj_.js";import"./Eye-m_jc4WHC.js";import"./FilterLines-DJ3lRTxj.js";import"./Star01-D7maP7yw.js";import"./Globe04-C3kyaQkX.js";import"./HardDrive-BfnTWF0w.js";import"./Key01-DJufXC5l.js";import"./LinkExternal01-DHPLvAlj.js";import"./List-DbYeo32c.js";import"./Monitor01-z8KVt_1L.js";import"./Sun-D7S1ER7S.js";import"./Palette-D0EiCOKi.js";import"./Play-DPT-Lr30.js";import"./Plus-DaZdxod6.js";import"./SearchLg-DxD_D_4n.js";import"./SearchMd-ByN3gshP.js";import"./Shield01-B9NrENV2.js";import"./Stars01-DlXhHEac.js";import"./Trash01-BXE2cBJq.js";import"./Upload01-CypbVjGY.js";import"./User01-BB062KFn.js";import"./Users01-CffdXVAr.js";import"./XClose-Dg02sB1B.js";import"./Zap-BtxkJShL.js";import"./use-automations-C2_4_jPZ.js";import"./studio-tools-7Wg9yY_n.js";import"./useSuspenseInfiniteQuery-bZ1w_AdM.js";import"./badge-BPlPS6-U.js";import"./checkbox-CIo6Fidy.js";import"./command-1aG03_je.js";import"./index-DBc0WuE4.js";import"./dialog-C3IuPH3f.js";import"./popover-CLvqhSp6.js";import"./avatar-CBGAelvW.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-LQlzIxLa.js";import"./file-type-icon-D3hb0Drj.js";import"./tab-id-DAJ8K7VA.js";import"./hooks-DqC-czl4.js";import"./decopilot-sse-pool-moj0w8Vo.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./integration-icon-BDMIArBS.js";import"./use-navigate-to-agent-Dn2BNzaE.js";import"./reusable-new-chat-qqWu133U.js";import"./use-mcp-prompts-CccYNdu3.js";import"./form-B3R-A37u.js";import"./label-xBJ0yPUA.js";import"./input-kOQaqTZ-.js";import"./auth-Dh53AhUb.js";import"./drawer-DNygCL0g.js";import"./collection-search-BQbTxwoW.js";import"./autosend-U-xpRpSE.js";import"./tabs-djg35jJe.js";import"./toggle-group-CyItOhMq.js";import"./agent-capabilities-B0Jsdt6p.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BX64E0ZX.js";import"./use-registry-connections-DMa9GcRc.js";import"./use-organization-settings-B0Nwjkeh.js";import"./extract-connection-data-baLEbDV8.js";import"./collection-tabs-CoU3ihMK.js";import"./textarea-BcDVHw10.js";import"./connection-form-helpers-CFnSkiaw.js";import"./authenticate-and-persist-oauth-Dju715T5.js";import"./mcp-oauth-BvfQRZ3m.js";import"./use-ai-providers-BLYI7is3.js";import"./connect-desktop-dialog-9CJopn2Q.js";import"./select-model-CNBU35Uk.js";import"./skeleton-H_BeyWZC.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-iYQ69o_s.js";import"./dropdown-menu-KKF-lxCP.js";import"./index-HXaQVvR_.js";import"./alert-dialog-C9L2oZsl.js";import"./toolbar-Bx2JvL88.js";import"./use-debounced-value-wokrtNfu.js";import"./index-BwFf1RZV.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CnHm0wXx.js";import"./use-decopilot-events-CFzSYSZ0.js";import"./use-capability-B58SdY6m.js";import"./tools-list-aqaPnMDt.js";import"./switch-DHEIkHtS.js";import"./use-debounced-autosave-CtV7p_Pr.js";import"./index-DqD1ib5M.js";import"./search-input-DmhKRv1z.js";import"./github-repo-picker-DUcUZ8Lg.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-DEtr_hQU.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-CZ6_AyFs.js";import"./get-initials-D-f_fDFw.js";import"./calendar-CrC0GPqv.js";import"./toolbar-icon-button-Du8AVUGg.js";import"./automation-list-row-BuZlqyz_.js";import"./use-file-configs-NGX_LaaZ.js";import"./required-auth-layout-C7z1SSP_.js";import"./use-org-sso-B_WqXsc5.js";const Q={};function W(S){const t=w.c(37),{client:e,resourceURI:h,tool:o,connectionId:p,orgId:l,args:M}=S,{sendMessage:I}=z(),{setAppContext:d,clearAppContext:n}=F(),{setChatOpen:f,openTab:g}=J(),r=`${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]!==e||t[3]!==o.name||t[4]!==s?(c={client:e,toolName:o.name,toolArguments:s},t[2]=e,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=b(o.name,C),t[6]=o._meta,t[7]=o.name,t[8]=x}else x=t[8];const U=x;let u;t[9]!==o.inputSchema?(u=o.inputSchema??{type:"object"},t[9]=o.inputSchema,t[10]=u):u=t[10];let N;t[11]!==U||t[12]!==u||t[13]!==o?(N={...o,name:U,inputSchema:u},t[11]=U,t[12]=u,t[13]=o,t[14]=N):N=t[14];const j=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 y=_;let P;t[18]!==j?(P={tool:j},t[18]=j,t[19]=P):P=t[19];let T;t[20]!==d||t[21]!==r?(T=C=>d(r,C),t[20]=d,t[21]=r,t[22]=T):T=t[22];let R;t[23]!==n||t[24]!==r?(R=()=>n(r),t[23]=n,t[24]=r,t[25]=R):R=t[25];let v;return t[26]!==e||t[27]!==y||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:$.fullscreen.minHeight,maxHeight:$.fullscreen.maxHeight,client:e,onMessage:y,onUpdateModelContext:T,onTeardown:R,onRequestDisplayMode:m,className:"h-full"}),t[26]=e,t[27]=y,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 Lr(S){const t=w.c(24),{connectionId:e,toolName:h,args:o}=S,{org:p}=H(),l=Y();let M;t[0]!==e||t[1]!==l?(M=k(e)&&l.vmEntry?.sandboxProviderKind==="user-desktop"&&l.previewUrl?`${l.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=e,t[1]=l,t[2]=M):M=t[2];const I=M;let d;t[3]!==e||t[4]!==I||t[5]!==p.id||t[6]!==p.slug?(d={connectionId:e,orgId:p.id,orgSlug:p.slug,mcpUrl:I},t[3]=e,t[4]=I,t[5]=p.id,t[6]=p.slug,t[7]=d):d=t[7];const n=O(d);let f;t[8]!==n?(f={client:n},t[8]=n,t[9]=f):f=t[9];const{data:g}=q(f);let r,a,m;t[10]!==h||t[11]!==g.tools?(r=L(decodeURIComponent(h)),m=g.tools.find(i=>i.name===r)??g.tools.find(i=>{const x=E(i._meta);if(!x)return!1;if(b(i.name,x)===r)return!0;const u=b(r,x);return u!==r&&i.name===u}),a=m?._meta?K(m._meta):void 0,t[10]=h,t[11]=g.tools,t[12]=r,t[13]=a,t[14]=m):(r=t[12],a=t[13],m=t[14]);const s=a;if(!m||!s){let i;return t[15]!==r?(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 "',r,'" not found or has no UI']})}),t[15]=r,t[16]=i):i=t[16],i}let c;return t[17]!==o||t[18]!==n||t[19]!==e||t[20]!==p.id||t[21]!==s||t[22]!==m?(c=A.jsx(W,{client:n,resourceURI:s,tool:m,connectionId:e,orgId:p.id,args:o}),t[17]=o,t[18]=n,t[19]=e,t[20]=p.id,t[21]=s,t[22]=m,t[23]=c):c=t[23],c}export{Lr as AppViewContent};
@@ -1 +0,0 @@
1
- import{c as F,j as r}from"./index-CE5H3VpT.js";import{I as T}from"./input-kOQaqTZ-.js";import{L as C}from"./label-xBJ0yPUA.js";import{T as L}from"./textarea-BcDVHw10.js";import{k as A,l as R,S as D,m as J,I as K}from"./index-ADar06lH.js";import{u as M,s as P}from"./primitives-DofUlhoU.js";import"./SwitchHorizontal01-mHS8gX9f.js";import"./chat-context-E29cn9cH.js";import"./autosend-U-xpRpSE.js";import"./hooks-DqC-czl4.js";import"./use-mcp-client-ZBC-eCDx.js";import"./constants-B72Xmt_K.js";import"./auth-Dh53AhUb.js";import"./decopilot-sse-pool-moj0w8Vo.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-DOdyKPNe.js";import"./use-collections-FdPpYeY0.js";import"./use-ai-providers-BLYI7is3.js";import"./studio-tools-7Wg9yY_n.js";import"./use-decopilot-events-CFzSYSZ0.js";import"./tab-id-DAJ8K7VA.js";import"./use-organization-settings-B0Nwjkeh.js";import"./automation-runs-Ddmvrziu.js";import"./select-p16t1oqR.js";import"./tooltip-Cg3rQVMP.js";import"./Check-BBbJanyi.js";import"./ChevronDown-CdhVz413.js";import"./ChevronUp-VC09djpz.js";import"./useInfiniteQuery-D3w5TQxr.js";import"./use-infinite-scroll-DQs52IQI.js";import"./use-connection-Bnuwr5M1.js";import"./card-1rWslgPf.js";import"./sidebar-DoDKf_4K.js";import"./LayoutLeft-C7UYEc8w.js";import"./use-mobile-BGgRMBqg.js";import"./X-De82F_yV.js";import"./table-f2GQgPNW.js";import"./empty-state-BKnsu1Gz.js";import"./use-members-V-W3kQEI.js";import"./use-org-auth-client-BvkB8WEw.js";import"./use-clock-tick-KJrFAFXc.js";import"./AlertCircle-C3XBF3Lj.js";import"./CheckCircle-CUAoW5BF.js";import"./Circle-BaBs0XFQ.js";import"./agent-icon-CQDdwbbu.js";import"./Tool01-NvZF1kAv.js";import"./Settings02-iM-HC30X.js";import"./XCircle-CrMyqBpn.js";import"./ArrowUpRight-BAyBOox4.js";import"./ZapSquare-BxP2mvwj.js";import"./Users03-DSGWvEeU.js";import"./Loading02-BfehCN_S.js";import"./ChevronRight-DSkRxyMp.js";import"./Stars02-CKZjtcO2.js";import"./Copy01-BqGbD9kh.js";import"./ZoomOut-BORQEG0K.js";import"./DotsVertical-Dx7q3hEM.js";import"./Globe01-C7l3-Kj_.js";import"./Eye-m_jc4WHC.js";import"./FilterLines-DJ3lRTxj.js";import"./Star01-D7maP7yw.js";import"./Globe04-C3kyaQkX.js";import"./HardDrive-BfnTWF0w.js";import"./Key01-DJufXC5l.js";import"./LinkExternal01-DHPLvAlj.js";import"./List-DbYeo32c.js";import"./Monitor01-z8KVt_1L.js";import"./Sun-D7S1ER7S.js";import"./Palette-D0EiCOKi.js";import"./Play-DPT-Lr30.js";import"./Plus-DaZdxod6.js";import"./SearchLg-DxD_D_4n.js";import"./SearchMd-ByN3gshP.js";import"./Shield01-B9NrENV2.js";import"./Stars01-DlXhHEac.js";import"./Trash01-BXE2cBJq.js";import"./Upload01-CypbVjGY.js";import"./User01-BB062KFn.js";import"./Users01-CffdXVAr.js";import"./XClose-Dg02sB1B.js";import"./Zap-BtxkJShL.js";import"./use-automations-C2_4_jPZ.js";import"./useSuspenseInfiniteQuery-bZ1w_AdM.js";import"./badge-BPlPS6-U.js";import"./checkbox-CIo6Fidy.js";import"./command-1aG03_je.js";import"./index-DBc0WuE4.js";import"./dialog-C3IuPH3f.js";import"./popover-CLvqhSp6.js";import"./avatar-CBGAelvW.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-LQlzIxLa.js";import"./file-type-icon-D3hb0Drj.js";import"./monaco-editor-BFTtBdRV.js";import"./index-BwFf1RZV.js";import"./types-B-PIV7tw.js";import"./shell-layout-Ur6mRNK2.js";import"./alert-dialog-C9L2oZsl.js";import"./required-auth-layout-C7z1SSP_.js";import"./use-org-sso-B_WqXsc5.js";import"./integration-icon-BDMIArBS.js";import"./use-navigate-to-agent-Dn2BNzaE.js";import"./reusable-new-chat-qqWu133U.js";import"./use-mcp-prompts-CccYNdu3.js";import"./form-B3R-A37u.js";import"./drawer-DNygCL0g.js";import"./collection-search-BQbTxwoW.js";import"./tabs-djg35jJe.js";import"./toggle-group-CyItOhMq.js";import"./agent-capabilities-B0Jsdt6p.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BX64E0ZX.js";import"./use-registry-connections-DMa9GcRc.js";import"./extract-connection-data-baLEbDV8.js";import"./collection-tabs-CoU3ihMK.js";import"./connection-form-helpers-CFnSkiaw.js";import"./authenticate-and-persist-oauth-Dju715T5.js";import"./mcp-oauth-BvfQRZ3m.js";import"./connect-desktop-dialog-9CJopn2Q.js";import"./select-model-CNBU35Uk.js";import"./skeleton-H_BeyWZC.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-iYQ69o_s.js";import"./dropdown-menu-KKF-lxCP.js";import"./index-HXaQVvR_.js";import"./toolbar-Bx2JvL88.js";import"./use-debounced-value-wokrtNfu.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CnHm0wXx.js";import"./use-mcp-tools-FxYZ1Cxx.js";import"./use-capability-B58SdY6m.js";import"./tools-list-aqaPnMDt.js";import"./switch-DHEIkHtS.js";import"./use-debounced-autosave-CtV7p_Pr.js";import"./index-DqD1ib5M.js";import"./search-input-DmhKRv1z.js";import"./github-repo-picker-DUcUZ8Lg.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-DEtr_hQU.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-CZ6_AyFs.js";import"./get-initials-D-f_fDFw.js";import"./calendar-CrC0GPqv.js";import"./toolbar-icon-button-Du8AVUGg.js";import"./automation-list-row-BuZlqyz_.js";import"./use-file-configs-NGX_LaaZ.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 Br(S){const t=F.c(34),{orgSlug:v,virtualMcpId:j,branch:w,kind:p,blockKey:g,block:f}=S;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 B=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(B,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{Br as RecordEditor};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BWORV1jh.js","assets/index-CE5H3VpT.js","assets/index-DhHJ9QL9.css","assets/XCircle-CrMyqBpn.js","assets/CheckCircle-CUAoW5BF.js","assets/Settings02-iM-HC30X.js","assets/use-mcp-client-ZBC-eCDx.js","assets/constants-B72Xmt_K.js","assets/auth-Dh53AhUb.js","assets/useInfiniteQuery-D3w5TQxr.js","assets/use-infinite-scroll-DQs52IQI.js","assets/studio-tools-7Wg9yY_n.js","assets/badge-BPlPS6-U.js","assets/input-kOQaqTZ-.js","assets/dropdown-menu-KKF-lxCP.js","assets/Check-BBbJanyi.js","assets/ChevronRight-DSkRxyMp.js","assets/Circle-BaBs0XFQ.js","assets/table-f2GQgPNW.js","assets/toggle-group-CyItOhMq.js","assets/use-view-mode-CWq1V6tJ.js","assets/use-mobile-BGgRMBqg.js","assets/DotsVertical-Dx7q3hEM.js","assets/FilterLines-DJ3lRTxj.js","assets/Globe01-C7l3-Kj_.js","assets/SearchMd-ByN3gshP.js","assets/dialog-C3IuPH3f.js","assets/X-De82F_yV.js","assets/AlertCircle-C3XBF3Lj.js","assets/Upload01-CypbVjGY.js","assets/alert-dialog-C9L2oZsl.js","assets/card-1rWslgPf.js","assets/Trash01-BXE2cBJq.js","assets/label-xBJ0yPUA.js","assets/select-p16t1oqR.js","assets/tooltip-Cg3rQVMP.js","assets/ChevronDown-CdhVz413.js","assets/ChevronUp-VC09djpz.js","assets/switch-DHEIkHtS.js","assets/textarea-BcDVHw10.js","assets/checkbox-CIo6Fidy.js","assets/Eye-m_jc4WHC.js","assets/LinkExternal01-DHPLvAlj.js","assets/use-copy-LQlzIxLa.js","assets/Copy01-BqGbD9kh.js","assets/Key01-DJufXC5l.js","assets/Plus-DaZdxod6.js","assets/mcp-oauth-BvfQRZ3m.js","assets/Play-DPT-Lr30.js"])))=>i.map(i=>d[i]);
2
- import{c as s,j as e,r as i,i as a,aF as o}from"./index-CE5H3VpT.js";import{R as m}from"./require-capability-CWyRktcv.js";import"./use-capability-B58SdY6m.js";import"./access-gate-dqsmHXiw.js";import"./capability-load-error-BNkXTJQ4.js";const n=i.lazy(()=>o(()=>import("./registry-layout-BWORV1jh.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,45,46,47,48])));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};
@@ -1 +0,0 @@
1
- import{aW as H,r as A,aX as J,aY as Q,c as S,e as L,j as s,$ as Y,l as k,aC as F,a6 as B,M as I,a3 as E,a as G,i as K,X as U}from"./index-CE5H3VpT.js";import{j as V,k as Z,l as ee,S as q,a as w,b as M,d as P,c as R,f as se,g as te}from"./sidebar-DoDKf_4K.js";import{a as re}from"./index-DqD1ib5M.js";import{n as le,c as ie,a as oe,d as ne,b as ae,i as T}from"./ZapSquare-BxP2mvwj.js";import{t as ce,a as O}from"./Users03-DSGWvEeU.js";import{i as me}from"./HardDrive-BfnTWF0w.js";import{i as fe}from"./Key01-DJufXC5l.js";import{i as de}from"./Shield01-B9NrENV2.js";import{s as ue}from"./User01-BB062KFn.js";import{i as xe}from"./Zap-BtxkJShL.js";import{a as be}from"./use-capability-B58SdY6m.js";import{u as he}from"./use-join-requests-D_YCRqVN.js";import{u as W}from"./use-mobile-BGgRMBqg.js";import{u as pe}from"./use-status-sounds-CnHm0wXx.js";import{T as y}from"./toolbar-Bx2JvL88.js";import{S as ge,M as je}from"./shell-controls-CA1LD88M.js";import"./LayoutLeft-C7UYEc8w.js";import"./X-De82F_yV.js";import"./tooltip-Cg3rQVMP.js";import"./studio-tools-7Wg9yY_n.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-CFzSYSZ0.js";import"./decopilot-sse-pool-moj0w8Vo.js";import"./backoff-CrEUbyZT.js";import"./toolbar-icon-button-Du8AVUGg.js";function X(e){const t=H({warn:e?.router===void 0}),n=e?.router||t,r=A.useRef(void 0);return J(n.stores.__store,l=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=Q(r.current,e.select(l));return r.current=i,i}return e.select(l)}return l})}function D(){const e=S.c(21),{capabilities:t,isPrivileged:n,loading:r,error:l}=be(),i=he().length;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ce,{size:14}),e[0]=a):a=e[0];let o,c;if(e[1]!==t||e[2]!==l||e[3]!==n||e[4]!==i||e[5]!==r){c=Symbol.for("react.early_return_sentinel");e:{let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(le,{size:14}),e[8]=f):f=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ie,{size:14}),e[9]=d):d=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(fe,{size:14}),e[10]=m):m=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(me,{size:14}),e[11]=u):u=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(oe,{size:14}),e[12]=x):x=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(O,{size:14}),e[13]=p):p=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(xe,{size:14}),e[14]=h):h=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ne,{size:14}),e[15]=g):g=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ae,{size:14}),e[16]=b):b=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(O,{size:14}),e[17]=_):_=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(de,{size:14}),e[18]=j):j=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(F,{size:14}),e[19]=v):v=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ue,{size:14}),e[20]=N):N=e[20];const C=[{label:"Organization",items:[{key:"general",label:"General",icon:a,to:"/$org/settings/general",requires:"org:manage"},{key:"brand-context",label:"Brand Context",icon:f,to:"/$org/settings/brand-context",requires:"org:manage"},{key:"ai-providers",label:"AI Providers",icon:d,to:"/$org/settings/ai-providers",requires:"ai-providers:manage"},{key:"secrets",label:"Secrets",icon:m,to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"buckets",label:"Buckets",icon:u,to:"/$org/settings/buckets",requires:"file-configs:manage"}]},{label:"Build",items:[{key:"connections",label:"Connections",icon:x,to:"/$org/settings/connections"},{key:"agents",label:"Agents",icon:p,to:"/$org/settings/agents"},{key:"automations",label:"Automations",icon:h,to:"/$org/settings/automations",requires:"automations:manage"},{key:"store",label:"Store",icon:g,to:"/$org/settings/store",requires:"registry:manage"}]},{label:"Manage",items:[{key:"monitor",label:"Monitor",icon:b,to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:"Members",icon:_,to:"/$org/settings/members",requires:"members:manage",badge:i},{key:"roles",label:"Roles",icon:j,to:"/$org/settings/roles",privilegedOnly:!0},{key:"sso",label:"Security",icon:v,to:"/$org/settings/sso",requires:"org:manage"}]},{label:"Account",items:[{key:"profile",label:"Profile & Preferences",icon:N,to:"/$org/settings/profile"}]}];if(r||l){c=C;break e}o=C.map(z=>({...z,items:z.items.filter($=>$.privilegedOnly?n:$.requires?n||t[$.requires]:!0)})).filter(_e)}e[1]=t,e[2]=l,e[3]=n,e[4]=i,e[5]=r,e[6]=o,e[7]=c}else o=e[6],c=e[7];return c!==Symbol.for("react.early_return_sentinel")?c:o}function _e(e){return e.items.length>0}function ye(){const e=S.c(19),t=D();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org"},e[0]=n):n=e[0];const{org:r}=L(n);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={select:ve},e[1]=l):l=e[1];const i=X(l);let a;e[2]!==r||e[3]!==i?(a=p=>{const h=p.replace("$org",r);return i.startsWith(h)},e[2]=r,e[3]=i,e[4]=a):a=e[4];const o=a;let c;if(e[5]!==t||e[6]!==o||e[7]!==r){let p;e[9]!==o||e[10]!==r?(p=(h,g)=>s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[h.label&&s.jsx("p",{className:k("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",g>0&&"mt-3"),children:h.label}),s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:h.items.map(b=>s.jsx(P,{children:s.jsx(R,{asChild:!0,isActive:o(b.to),children:s.jsxs(B,{to:b.to,params:{org:r},onClick:()=>I("settings_nav_clicked",{section_key:b.key,section_label:b.label,group_label:h.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsxs("span",{className:"relative shrink-0",children:[b.icon,b.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:b.label})]})})},b.key))})})]},`${h.label}-${g}`),e[9]=o,e[10]=r,e[11]=p):p=e[11],c=t.map(p),e[5]=t,e[6]=o,e[7]=r,e[8]=c}else c=e[8];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[12]=f):f=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[f,s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:s.jsx(P,{children:s.jsxs(R,{onClick:Se,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(T,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[13]=d):d=e[13];let m;e[14]!==c?(m=s.jsxs(se,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0 overflow-y-auto",children:[c,d]}),e[14]=c,e[15]=m):m=e[15];let u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.37.0"]})}),e[16]=u):u=e[16];let x;return e[17]!==m?(x=s.jsxs(te,{variant:"sidebar",children:[m,u]}),e[17]=m,e[18]=x):x=e[18],x}function Se(){I("signed_out",{source:"settings_sidebar"}),E(),G.signOut()}function ve(e){return e.location.pathname}function Ne(e){const t=S.c(21),{onClose:n}=e,r=D();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org"},t[0]=l):l=t[0];const{org:i}=L(l);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={select:$e},t[1]=a):a=t[1];const o=X(a);let c;t[2]!==i||t[3]!==o?(c=g=>{const b=g.replace("$org",i);return o.startsWith(b)},t[2]=i,t[3]=o,t[4]=c):c=t[4];const f=c;let d;if(t[5]!==r||t[6]!==f||t[7]!==n||t[8]!==i){let g;t[10]!==f||t[11]!==n||t[12]!==i?(g=(b,_)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[b.label&&s.jsx("p",{className:k("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",_>0&&"mt-3"),children:b.label}),b.items.map(j=>s.jsxs(B,{to:j.to,params:{org:i},onClick:n,className:k("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",f(j.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsxs("span",{className:"relative shrink-0",children:[j.icon,j.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:j.label})]},j.key))]},`${b.label}-${_}`),t[10]=f,t[11]=n,t[12]=i,t[13]=g):g=t[13],d=r.map(g),t[5]=r,t[6]=f,t[7]=n,t[8]=i,t[9]=d}else d=t[9];let m;t[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[14]=m):m=t[14];let u;t[15]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[m,s.jsxs("button",{type:"button",onClick:ke,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("span",{className:"shrink-0",children:s.jsx(T,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[15]=u):u=t[15];let x;t[16]!==d?(x=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[d,u]}),t[16]=d,t[17]=x):x=t[17];let p;t[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.37.0"]})}),t[18]=p):p=t[18];let h;return t[19]!==x?(h=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[x,p]}),t[19]=x,t[20]=h):h=t[20],h}function ke(){E(),G.signOut()}function $e(e){return e.location.pathname}function Ce(){const e=S.c(4),t=W(),{org:n}=Y();pe(n.slug);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(K,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(A.Suspense,{fallback:r,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(re,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(U,{})})})})}),e[1]=l):l=e[1];const i=l;if(t){let o;return e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col flex-1 bg-background min-h-0 overflow-hidden",children:i}),e[2]=o):o=e[2],o}let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:k("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),children:i})}),e[3]=a):a=e[3],a}function es(){const e=S.c(21),t=W();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(y.LogoLink,{}),e[0]=n):n=e[0];let r;e[1]!==t?(r=t&&s.jsx(ge,{}),e[1]=t,e[2]=r):r=e[2];let l;e[3]!==r?(l=s.jsxs(y.LeftColumn,{children:[n,r]}),e[3]=r,e[4]=l):l=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(y.CenterSlot,{}),e[5]=i):i=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(y.RightColumn,{children:s.jsx("span",{})}),e[6]=a):a=e[6];let o;e[7]!==l?(o=s.jsxs(y.Header,{children:[l,i,a]}),e[7]=l,e[8]=o):o=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c={"--sidebar-width-icon":"3.5rem"},e[9]=c):c=e[9];let f;e[10]!==t?(f=!t&&s.jsx(ye,{}),e[10]=t,e[11]=f):f=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(V,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(Ce,{})}),e[12]=d):d=e[12];let m;e[13]!==f?(m=s.jsxs(Z,{className:"flex-1 bg-sidebar min-h-0",style:c,children:[f,d]}),e[13]=f,e[14]=m):m=e[14];let u;e[15]!==t?(u=t&&s.jsx(je,{renderSidebar:ze}),e[15]=t,e[16]=u):u=e[16];let x;return e[17]!==u||e[18]!==o||e[19]!==m?(x=s.jsx(y.Provider,{children:s.jsx(ee,{defaultOpen:!0,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[o,m,u]})})}),e[17]=u,e[18]=o,e[19]=m,e[20]=x):x=e[20],x}function ze(e){const{onClose:t}=e;return s.jsx(Ne,{onClose:t})}export{ye as SettingsSidebar,Ne as SettingsSidebarMobile,es as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BWORV1jh.js","assets/index-CE5H3VpT.js","assets/index-DhHJ9QL9.css","assets/XCircle-CrMyqBpn.js","assets/CheckCircle-CUAoW5BF.js","assets/Settings02-iM-HC30X.js","assets/use-mcp-client-ZBC-eCDx.js","assets/constants-B72Xmt_K.js","assets/auth-Dh53AhUb.js","assets/useInfiniteQuery-D3w5TQxr.js","assets/use-infinite-scroll-DQs52IQI.js","assets/studio-tools-7Wg9yY_n.js","assets/badge-BPlPS6-U.js","assets/input-kOQaqTZ-.js","assets/dropdown-menu-KKF-lxCP.js","assets/Check-BBbJanyi.js","assets/ChevronRight-DSkRxyMp.js","assets/Circle-BaBs0XFQ.js","assets/table-f2GQgPNW.js","assets/toggle-group-CyItOhMq.js","assets/use-view-mode-CWq1V6tJ.js","assets/use-mobile-BGgRMBqg.js","assets/DotsVertical-Dx7q3hEM.js","assets/FilterLines-DJ3lRTxj.js","assets/Globe01-C7l3-Kj_.js","assets/SearchMd-ByN3gshP.js","assets/dialog-C3IuPH3f.js","assets/X-De82F_yV.js","assets/AlertCircle-C3XBF3Lj.js","assets/Upload01-CypbVjGY.js","assets/alert-dialog-C9L2oZsl.js","assets/card-1rWslgPf.js","assets/Trash01-BXE2cBJq.js","assets/label-xBJ0yPUA.js","assets/select-p16t1oqR.js","assets/tooltip-Cg3rQVMP.js","assets/ChevronDown-CdhVz413.js","assets/ChevronUp-VC09djpz.js","assets/switch-DHEIkHtS.js","assets/textarea-BcDVHw10.js","assets/checkbox-CIo6Fidy.js","assets/Eye-m_jc4WHC.js","assets/LinkExternal01-DHPLvAlj.js","assets/use-copy-LQlzIxLa.js","assets/Copy01-BqGbD9kh.js","assets/Key01-DJufXC5l.js","assets/Plus-DaZdxod6.js","assets/mcp-oauth-BvfQRZ3m.js","assets/Play-DPT-Lr30.js"])))=>i.map(i=>d[i]);
2
- import{c as m,b as n,e as c,j as t,i as p,r as l,aF as f}from"./index-CE5H3VpT.js";import{R as u}from"./require-capability-CWyRktcv.js";import"./use-capability-B58SdY6m.js";import"./access-gate-dqsmHXiw.js";import"./capability-load-error-BNkXTJQ4.js";const g=l.lazy(()=>f(()=>import("./registry-layout-BWORV1jh.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,45,46,47,48])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(p,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
@@ -1 +0,0 @@
1
- import{c as l,$ as _,k as b,K as f,p as E,d as z,r as D}from"./index-CE5H3VpT.js";import{W as R}from"./constants-B72Xmt_K.js";import{c as $,u as G}from"./studio-tools-7Wg9yY_n.js";const I={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,task_board_enabled:!1},k={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function N(t,e){return{queryKey:f.organizationSettings(e),queryFn:async()=>{try{return await $(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...I,organizationId:e}}},staleTime:6e4}}function g(t){const e=l.c(6),{org:s}=_();let n;e[0]!==s.id||e[1]!==s.slug?(n=N(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const a=t;let i;return e[3]!==n||e[4]!==a?(i={...n,select:a},e[3]=n,e[4]=a,e[5]=i):i=e[5],b(i)}function W(t,e){const s=l.c(3);let n;s[0]!==t||s[1]!==e?(n=N(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:a}=b(n);return a??null}function y(){const t=l.c(9),{org:e}=_(),s=G(),n=E();let a;t[0]!==e||t[1]!==s?(a=async u=>{const o=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...u});if(!o)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return o},t[0]=e,t[1]=s,t[2]=a):a=t[2];let i;t[3]!==e||t[4]!==n?(i=u=>{n.setQueryData(f.organizationSettings(e.id),o=>({...o??I,...u}))},t[3]=e,t[4]=n,t[5]=i):i=t[5];let r;return t[6]!==a||t[7]!==i?(r={mutationFn:a,onSuccess:i},t[6]=a,t[7]=i,t[8]=r):r=t[8],z(r)}function M(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:k}function Z(){const{data:t}=g(Q);return t??k}function Q(t){return M(t.simple_mode)}function F(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(i,r)=>e.mutate({simple_mode:i},r),n=(i,r)=>e.mutateAsync({simple_mode:i},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function j(){const{data:t}=g(C);return t??!1}function C(t){return t.task_board_enabled??!1}function L(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(i,r)=>e.mutate({task_board_enabled:i},r),n=(i,r)=>e.mutateAsync({task_board_enabled:i},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function P(){const{data:t}=g(U);return t??null}function U(t){return t.registry_config}function v(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(i,r)=>e.mutate({registry_config:i},r),n=(i,r)=>e.mutateAsync({registry_config:i},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function J(){const{data:t}=g(x);return t??null}function x(t){return t.default_home_agents}function q(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(i,r)=>e.mutate({default_home_agents:i},r),n=(i,r)=>e.mutateAsync({default_home_agents:i},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function V(){const t=l.c(14),{org:e}=_(),s=q(),n=E();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=Promise.resolve(),t[0]=a):a=t[0];const i=D.useRef(a);let r;t[1]!==e.id?(r=f.organizationSettings(e.id),t[1]=e.id,t[2]=r):r=t[2];const u=r;let o;t[3]!==u||t[4]!==n?(o=()=>n.getQueryData(u)?.default_home_agents?.ids??[],t[3]=u,t[4]=n,t[5]=o):o=t[5];const p=o;let m;t[6]!==u||t[7]!==e.slug||t[8]!==n||t[9]!==s?(m=O=>{const T=i.current.then(async()=>{const A=n.getQueryData(u),S=O(A?.default_home_agents?.ids??[]);if(S!==null){n.setQueryData(u,c=>c&&{...c,default_home_agents:{ids:S}});try{await s.mutateAsync({ids:S}),await n.refetchQueries({queryKey:f.homeNextActions(e.slug),type:"active"})}catch(c){const w=c;throw n.setQueryData(u,A),w}}});return i.current=T.catch(K),T},t[6]=u,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=m):m=t[10];const h=m;let d;return t[11]!==h||t[12]!==p?(d={currentIds:p,apply:h},t[11]=h,t[12]=p,t[13]=d):d=t[13],d}function K(){}function X(){const t=l.c(5),{org:e}=_(),s=P();let n;t[0]!==e.id?(n=R.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const a=n;let i;return t[2]!==a||t[3]!==s?(i=r=>{if(!s)return r===a;const u=s.registries[r];return u?u.enabled:r===a},t[2]=a,t[3]=s,t[4]=i):i=t[4],i}export{V as a,j as b,X as c,W as d,L as e,Z as f,F as g,P as h,v as i,J as u};
@@ -1 +0,0 @@
1
- import{I as u}from"./use-infinite-scroll-DQs52IQI.js";import{cy as i}from"./index-CE5H3VpT.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{I as s}from"./use-infinite-scroll-DQs52IQI.js";import{cy as u,F as n}from"./index-CE5H3VpT.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};