decocms 4.373.2 → 4.373.3

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 (360) hide show
  1. package/dist/client/assets/{AlertCircle-D0XfIdP3.js → AlertCircle-NKpIdBKl.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BahcMnDC.js → AreaChart-Bm-WOd7b.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-COesgQ7q.js → ArrowLeft-BKx_QTJr.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CnMpegh6.js → ArrowRight-8mLQGGMI.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-17ZWJBkC.js → ArrowUp-BgjnqmUz.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-DqSaDs52.js → CartesianChart-CyfhriNO.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-GwUJIVVh.js → CheckCircle-DBlA9wkb.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-CodzCI7T.js → ChevronUp-BAQXOf5D.js} +1 -1
  9. package/dist/client/assets/{Copy01-CrFZhFXo.js → Copy01-wurPIobv.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-DDojC3kk.js → CreditCard01-DjPXzBq6.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-DMzYFBsd.js → DotsVertical-Bx5qjzcz.js} +1 -1
  12. package/dist/client/assets/{Download01-B93GUT2-.js → Download01-BWFtS53v.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-BUk8y7Bj.js → ErrorBarContext-DQtaxwUD.js} +1 -1
  14. package/dist/client/assets/{Eye-Bxxku7SE.js → Eye-BD0ZbSdl.js} +1 -1
  15. package/dist/client/assets/{Globe01-DjdW3vEO.js → Globe01-0DpEacUx.js} +1 -1
  16. package/dist/client/assets/{Globe04-1G-_QSZW.js → Globe04-D59f7pGB.js} +1 -1
  17. package/dist/client/assets/{Image01-DPvj49a-.js → Image01-BUYhMNkS.js} +1 -1
  18. package/dist/client/assets/{Key01-O_Ykzy8v.js → Key01-BvLdmCTc.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-Cr5_A1QG.js → LayoutLeft-CyJFqp-6.js} +1 -1
  20. package/dist/client/assets/{Line-aFR7lShe.js → Line-BeN-bY3Y.js} +1 -1
  21. package/dist/client/assets/{Link01-D8T6mRIR.js → Link01-qIayyFAq.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-CWPNoGQ_.js → LinkExternal01-hkxOMKQE.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CQaKbr3c.js → Monitor01-DyfIXCt5.js} +1 -1
  24. package/dist/client/assets/{Package-Cd3aVeK8.js → Package-EQg-wMAD.js} +1 -1
  25. package/dist/client/assets/{Palette-HRmzWYeK.js → Palette-DI15yG1R.js} +1 -1
  26. package/dist/client/assets/{Play-CaxaoMwA.js → Play-Cg9yqLoQ.js} +1 -1
  27. package/dist/client/assets/{Plus-BjOenFFb.js → Plus-BKjrQCsd.js} +1 -1
  28. package/dist/client/assets/{SearchLg-CT-Vntfj.js → SearchLg-RqwylEUM.js} +1 -1
  29. package/dist/client/assets/{SearchMd-C6gkQ2l2.js → SearchMd-I-u-Ppkp.js} +1 -1
  30. package/dist/client/assets/{Sector-B-fHBulW.js → Sector-C46Vk0wT.js} +1 -1
  31. package/dist/client/assets/{Settings02-DH86cX_B.js → Settings02-DJVGKnwW.js} +1 -1
  32. package/dist/client/assets/{Share07-Bw4Wicv2.js → Share07-adzWfg3s.js} +1 -1
  33. package/dist/client/assets/{Stars01-B1kYoDFp.js → Stars01-BEbgNJbY.js} +1 -1
  34. package/dist/client/assets/{Sun-kycCorOO.js → Sun-YVYc7YRc.js} +1 -1
  35. package/dist/client/assets/{Tool01-iak9ZtFE.js → Tool01-DDTjazFm.js} +1 -1
  36. package/dist/client/assets/{Tool02-CFu103hl.js → Tool02-BLokvBBs.js} +1 -1
  37. package/dist/client/assets/{Trash01-CpN6r-a0.js → Trash01-VGFb49EH.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-DlYmFZ7k.js → TrendUp01-BPu5TWOk.js} +1 -1
  39. package/dist/client/assets/{Upload01-DkDsqCWe.js → Upload01-Cv7tN2NN.js} +1 -1
  40. package/dist/client/assets/{User01-CmNzW4kH.js → User01-BI5R-4Xj.js} +1 -1
  41. package/dist/client/assets/{UserSquare-1_FC93GE.js → UserSquare-C_kKkH0n.js} +1 -1
  42. package/dist/client/assets/{Users01-CVhfgklM.js → Users01-DVg45Kv0.js} +1 -1
  43. package/dist/client/assets/{X-DTaqHNcB.js → X-CvjnZl5e.js} +1 -1
  44. package/dist/client/assets/{XCircle-BR8ZZHlj.js → XCircle-CB3Q-O1t.js} +1 -1
  45. package/dist/client/assets/{XClose-VLid_ZSM.js → XClose-l9OyLGUl.js} +1 -1
  46. package/dist/client/assets/{Zap-D3d1wpzw.js → Zap-UqD0_RZa.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-B3S7N50e.js → ZoomOut-Cq1zMqoM.js} +1 -1
  48. package/dist/client/assets/{access-gate-DAO7tJ5A.js → access-gate-eZrCTx42.js} +1 -1
  49. package/dist/client/assets/{add-connection-dialog-CaHZ3eeK.js → add-connection-dialog-CCnr4x54.js} +1 -1
  50. package/dist/client/assets/{agent-analytics-CzbWclRj.js → agent-analytics-BHAmS_Vv.js} +1 -1
  51. package/dist/client/assets/agent-app-0Lj8xuLI.js +1 -0
  52. package/dist/client/assets/{agent-assets-Dfpjbzyj.js → agent-assets-Dl566Cx2.js} +1 -1
  53. package/dist/client/assets/{agent-automation-C8r5_lAR.js → agent-automation-ZRwCzRyz.js} +1 -1
  54. package/dist/client/assets/{agent-automations-BSaV8k3Y.js → agent-automations-CcGv--oW.js} +1 -1
  55. package/dist/client/assets/{agent-connect-sources-AkHuiIU0.js → agent-connect-sources-DOCL0L4U.js} +1 -1
  56. package/dist/client/assets/agent-deck-EC_2q0-4.js +1 -0
  57. package/dist/client/assets/{agent-e2e-CjCqLXH1.js → agent-e2e-BheTu3sG.js} +1 -1
  58. package/dist/client/assets/{agent-experiments-4inK9Pvj.js → agent-experiments-DySEMnSa.js} +1 -1
  59. package/dist/client/assets/agent-file-CDMSSq77.js +1 -0
  60. package/dist/client/assets/{agent-git-BZmL1C91.js → agent-git-CGVI6Aq_.js} +1 -1
  61. package/dist/client/assets/{agent-hosting-CP9gImki.js → agent-hosting-CuK5vWln.js} +1 -1
  62. package/dist/client/assets/{agent-icon-D5Ih-I28.js → agent-icon-Du4foZ5w.js} +1 -1
  63. package/dist/client/assets/agent-library-file-CVu7KBHy.js +1 -0
  64. package/dist/client/assets/{agent-monitor-D7bE1AUL.js → agent-monitor-GtldlQaQ.js} +1 -1
  65. package/dist/client/assets/{agent-overview-C5zU0xJO.js → agent-overview-CV_KF9Yq.js} +1 -1
  66. package/dist/client/assets/agent-settings-S0BObv95.js +1 -0
  67. package/dist/client/assets/{agent-site-editor-BRzwUORk.js → agent-site-editor-DwI3mXwZ.js} +1 -1
  68. package/dist/client/assets/agent-site-editor-code-DHn9ldlr.js +2 -0
  69. package/dist/client/assets/{agent-site-editor-content-Da0JfE-w.js → agent-site-editor-content-B-s4vnUX.js} +2 -2
  70. package/dist/client/assets/{agent-site-editor-preview-DqMQfEJz.js → agent-site-editor-preview-BUdForMN.js} +3 -3
  71. package/dist/client/assets/agent-view-CMVA1gTC.js +1 -0
  72. package/dist/client/assets/{agent-view-guard-CmXIeKCe.js → agent-view-guard-O3WyIY56.js} +1 -1
  73. package/dist/client/assets/{agents-list-wHHXJTl8.js → agents-list-Bb_RX3Ji.js} +1 -1
  74. package/dist/client/assets/{ai-providers-COexxMGY.js → ai-providers-DDzOPCjm.js} +1 -1
  75. package/dist/client/assets/{alert-C_EPjsLF.js → alert-CXDlDd5b.js} +1 -1
  76. package/dist/client/assets/{alert-dialog-D6rlFoy0.js → alert-dialog-D2J-kRAV.js} +1 -1
  77. package/dist/client/assets/api-keys-CKnoL6XY.js +1 -0
  78. package/dist/client/assets/{api-keys-o45lgGkw.js → api-keys-DOy--osE.js} +1 -1
  79. package/dist/client/assets/app-editor-BHGu8CuE.js +1 -0
  80. package/dist/client/assets/{asset-utils-BG24FUsq.js → asset-utils-Bl8mgxfa.js} +1 -1
  81. package/dist/client/assets/{auth-B_QE3yd2.js → auth-DoQ4Nalq.js} +1 -1
  82. package/dist/client/assets/{auth-catchall-BM8U6OhG.js → auth-catchall-D5w-ZyXF.js} +1 -1
  83. package/dist/client/assets/{auth-entry-CdieewWf.js → auth-entry-DBl5DaPH.js} +1 -1
  84. package/dist/client/assets/{auth-split-layout-rKTEf0Lh.js → auth-split-layout-BgPxcBcB.js} +1 -1
  85. package/dist/client/assets/{authenticate-and-persist-oauth-Cm242zr2.js → authenticate-and-persist-oauth-CMWIzBXQ.js} +1 -1
  86. package/dist/client/assets/{automation-list-row-DDeJYMHS.js → automation-list-row-CdHBSjU2.js} +1 -1
  87. package/dist/client/assets/{automation-runs-BGXJk3-4.js → automation-runs-DkQGSYfz.js} +1 -1
  88. package/dist/client/assets/{automations-BhhOtnrs.js → automations-rIGMTqYL.js} +1 -1
  89. package/dist/client/assets/{autosend-DtYV6o0l.js → autosend-Bln98kNi.js} +1 -1
  90. package/dist/client/assets/{avatar-Dwn9Bjsb.js → avatar-1Yn634Bu.js} +1 -1
  91. package/dist/client/assets/{badge-BSirYRuD.js → badge-BMrNoDQF.js} +1 -1
  92. package/dist/client/assets/{block-document-DjxI0Nln.js → block-document-B0bO5MdC.js} +1 -1
  93. package/dist/client/assets/{blocks-preview-workspace-context-BwjlsTrq.js → blocks-preview-workspace-context-okcOywiO.js} +1 -1
  94. package/dist/client/assets/{breadcrumb-BpbnoaV3.js → breadcrumb-CzmrQK1U.js} +1 -1
  95. package/dist/client/assets/{buckets-DdptE4Pj.js → buckets-D85bhcTG.js} +1 -1
  96. package/dist/client/assets/{build-improve-prompt-doc-CIkgt5Ml.js → build-improve-prompt-doc-Jx4Nw8lc.js} +1 -1
  97. package/dist/client/assets/{bulk-category-panel-BUvAK76e.js → bulk-category-panel-Cpa3qfBq.js} +1 -1
  98. package/dist/client/assets/{calendar-Bhg3W8Dv.js → calendar-CDf47KON.js} +1 -1
  99. package/dist/client/assets/{capability-load-error-l-yxDu1W.js → capability-load-error-CG1OQua7.js} +1 -1
  100. package/dist/client/assets/category-editor-BzcQSv3B.js +1 -0
  101. package/dist/client/assets/{chart-B7hxFGKr.js → chart-Bcix-phJ.js} +1 -1
  102. package/dist/client/assets/{chat-context-CVZ1rNGo.js → chat-context-WkB72QDr.js} +1 -1
  103. package/dist/client/assets/{chat-draft-UIE-uNFd.js → chat-draft-anvjkrXf.js} +1 -1
  104. package/dist/client/assets/{checkbox-VSstjUSb.js → checkbox-Yo-_CoUr.js} +1 -1
  105. package/dist/client/assets/{choose-editor-DD3-fBUp.js → choose-editor-j32E7S6T.js} +1 -1
  106. package/dist/client/assets/{cli-auth-success-LIJhoLzG.js → cli-auth-success-Bz3RxiUp.js} +1 -1
  107. package/dist/client/assets/{client-icons-D8SzN11F.js → client-icons-BL2yc5kE.js} +1 -1
  108. package/dist/client/assets/{collapsible-BX137q_-.js → collapsible-Cz7g8j4s.js} +1 -1
  109. package/dist/client/assets/{collection-detail-Brbyx-hM.js → collection-detail-ChcpgbQd.js} +1 -1
  110. package/dist/client/assets/{collection-display-button-LAyYKy93.js → collection-display-button-Cqq95Rk5.js} +1 -1
  111. package/dist/client/assets/{collection-search-Dvf73igt.js → collection-search-DFM5AYUG.js} +1 -1
  112. package/dist/client/assets/{collection-table-wrapper-_ZnQA9Nx.js → collection-table-wrapper-DxZT2IDQ.js} +1 -1
  113. package/dist/client/assets/{collection-tabs-BW0egx-_.js → collection-tabs-CU5BwvHd.js} +1 -1
  114. package/dist/client/assets/{combobox-D6GclaQ-.js → combobox-5QbF4j2b.js} +1 -1
  115. package/dist/client/assets/{command-Dsz0XoYc.js → command-CY_32gBM.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-D7ntAaGF.js → companion-mcps-section-C5Ce-Ae8.js} +1 -1
  117. package/dist/client/assets/{connect-ChX83wmI.js → connect-VHpAEDVp.js} +1 -1
  118. package/dist/client/assets/{connect-layout-SP9zSVi3.js → connect-layout-DosY7Ren.js} +1 -1
  119. package/dist/client/assets/{connection-2MR1zroe.js → connection-BtAmcsWV.js} +1 -1
  120. package/dist/client/assets/{connection-card-B5yTdNvS.js → connection-card-DNLyrdBM.js} +1 -1
  121. package/dist/client/assets/{connection-detail-DKOxQWbq.js → connection-detail-ByWc2VaQ.js} +1 -1
  122. package/dist/client/assets/{connection-form-helpers-PrMbwr2L.js → connection-form-helpers-pqXyLS21.js} +1 -1
  123. package/dist/client/assets/{connections-lQVX-uGO.js → connections-BLrf_knq.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-Ccojws8S.js → create-organization-dialog-DqGp97lF.js} +1 -1
  125. package/dist/client/assets/{decofile-api-DygXY02K.js → decofile-api-C6MVAHgF.js} +1 -1
  126. package/dist/client/assets/{decopilot-rj_BJ_Z1.js → decopilot-C2LtkKnC.js} +1 -1
  127. package/dist/client/assets/{dialog-BKhaq-Xf.js → dialog-uPTcsM6n.js} +1 -1
  128. package/dist/client/assets/{discover-C_imFiZx.js → discover-D15TnXT7.js} +1 -1
  129. package/dist/client/assets/{domain-settings-CUKpZjNV.js → domain-settings-C4iSYJi_.js} +1 -1
  130. package/dist/client/assets/{download-app-dialog-wNu8nmu1.js → download-app-dialog-CSAHR0v5.js} +1 -1
  131. package/dist/client/assets/{drawer-CCmZWflK.js → drawer-CJhbJSjB.js} +1 -1
  132. package/dist/client/assets/{editor-DMij_Pa1.js → editor-DhWDdB15.js} +1 -1
  133. package/dist/client/assets/{empty-state-BDpfsfUL.js → empty-state-CvynDoal.js} +1 -1
  134. package/dist/client/assets/{empty-state-DiRnF-wA.js → empty-state-DATmbbqz.js} +1 -1
  135. package/dist/client/assets/{extract-connection-data-Bdk8iF2q.js → extract-connection-data-C-_k_HrX.js} +1 -1
  136. package/dist/client/assets/{feature-gate-KPNWzkBp.js → feature-gate-NGY-PlEE.js} +1 -1
  137. package/dist/client/assets/{feature-paywall-B3_no1lb.js → feature-paywall-C-R3YJVm.js} +1 -1
  138. package/dist/client/assets/{file-explorer-oIhs2jyB.js → file-explorer-CBVvygyV.js} +1 -1
  139. package/dist/client/assets/{file-preview-BFDgPeRr.js → file-preview-BQWchARE.js} +1 -1
  140. package/dist/client/assets/{file-share-button-7xy_ju8b.js → file-share-button-D6ndnz7e.js} +1 -1
  141. package/dist/client/assets/{file-type-icon-Co9lETmZ.js → file-type-icon-x1wD28_F.js} +1 -1
  142. package/dist/client/assets/{folder-icon-CPH1Bszw.js → folder-icon-BsGi9z8O.js} +1 -1
  143. package/dist/client/assets/{form-CxKBX2E3.js → form-CzXfgfFr.js} +1 -1
  144. package/dist/client/assets/{gateway-client-B8HHtBA6.js → gateway-client-_lcPratN.js} +1 -1
  145. package/dist/client/assets/{general-BXQ_6idC.js → general-CLxa6dw_.js} +1 -1
  146. package/dist/client/assets/{github-icon-DSeg1rga.js → github-icon-DD7YJLb0.js} +1 -1
  147. package/dist/client/assets/{home-FAOklPf6.js → home-Cc_gG_k0.js} +1 -1
  148. package/dist/client/assets/{hooks-CFjlhRX0.js → hooks-BDNT0Adb.js} +1 -1
  149. package/dist/client/assets/{hooks-BFlZlUD7.js → hooks-DdW3hvoh.js} +1 -1
  150. package/dist/client/assets/{icon-button-_3vMPXZp.js → icon-button-B9TVjSua.js} +1 -1
  151. package/dist/client/assets/{index-B3clFfYi.js → index--5W-89Xn.js} +1 -1
  152. package/dist/client/assets/{index-Coo4IGyG.js → index-Bb2NSQTG.js} +1 -1
  153. package/dist/client/assets/{index-BwwpOrcS.js → index-C5oMfVw1.js} +1 -1
  154. package/dist/client/assets/{index-CV2G6XgT.js → index-CQcZAkPo.js} +1 -1
  155. package/dist/client/assets/{index-DZmKVVGY.js → index-CdCeTCag.js} +1 -1
  156. package/dist/client/assets/{index-CC7J7MsT.js → index-DXBmCj7V.js} +2 -2
  157. package/dist/client/assets/{index-BrLZxE6-.js → index-DlTwltzZ.js} +1 -1
  158. package/dist/client/assets/{index-DoCuIH7r.js → index-DuEn4YkZ.js} +1 -1
  159. package/dist/client/assets/{index-Ci8CqfCi.js → index-Dud89Ecl.js} +1 -1
  160. package/dist/client/assets/{index-zFkCX32V.js → index-Oih4fNwt.js} +1 -1
  161. package/dist/client/assets/{index-D2HOssRq.js → index-U6uQHeCm.js} +1 -1
  162. package/dist/client/assets/{index-BcfYNZk_.js → index-VAuix8Ds.js} +1 -1
  163. package/dist/client/assets/{index-WfTG300W.js → index-VD5I0PAu.js} +1 -1
  164. package/dist/client/assets/{index-CxsDd08k.js → index-_1eIUhNB.js} +1 -1
  165. package/dist/client/assets/{index-redirect-BV59ZcWQ.js → index-redirect-BhYkN3DP.js} +1 -1
  166. package/dist/client/assets/{infiniteQueryObserver-CKT-6XMq.js → infiniteQueryObserver-DhQG5Ba-.js} +1 -1
  167. package/dist/client/assets/{infra-billing-RcXbwjta.js → infra-billing-CIY_y-NM.js} +1 -1
  168. package/dist/client/assets/{input-DSV_9cOM.js → input-CA3NO5_t.js} +1 -1
  169. package/dist/client/assets/{input-QKe7l082.js → input-Cl33QWb6.js} +1 -1
  170. package/dist/client/assets/{input-X38P96BY.js → input-DJ90IYpm.js} +1 -1
  171. package/dist/client/assets/{integration-icon-BARnXRTY.js → integration-icon-CAyUCGPQ.js} +1 -1
  172. package/dist/client/assets/{label-YKssz_GS.js → label-C_cX51We.js} +1 -1
  173. package/dist/client/assets/{last-preview-page-D5EFEwR4.js → last-preview-page-DolafzDL.js} +1 -1
  174. package/dist/client/assets/{layout-UcqeKFE9.js → layout-BDvTf5Y1.js} +1 -1
  175. package/dist/client/assets/{legacy-agents-deep-BYo-BuCs.js → legacy-agents-deep-CovYAG5o.js} +1 -1
  176. package/dist/client/assets/{legacy-main-redirect-NyVTUirL.js → legacy-main-redirect-DakI8WgO.js} +1 -1
  177. package/dist/client/assets/{library-FX2TKWir.js → library-CQOC6rOe.js} +1 -1
  178. package/dist/client/assets/{login-gigmbDXu.js → login-CzeMsg8T.js} +1 -1
  179. package/dist/client/assets/{markdown-tOSThun8.js → markdown-CqOP0_5N.js} +1 -1
  180. package/dist/client/assets/{mcp-app-renderer-c3JU3ROq.js → mcp-app-renderer-BrIoKm0G.js} +1 -1
  181. package/dist/client/assets/{mcp-oauth-Cr_ZflCp.js → mcp-oauth-ZZeDQKuh.js} +1 -1
  182. package/dist/client/assets/{members-Cd4baVfz.js → members-8jDg9Gt8.js} +1 -1
  183. package/dist/client/assets/{message-templates-Pr7m4Pgn.js → message-templates-D5TTMXdz.js} +1 -1
  184. package/dist/client/assets/{mini-report-page-0G8UQBMn.js → mini-report-page-VIPIzU0p.js} +1 -1
  185. package/dist/client/assets/{mock-board-Dw3AKqte.js → mock-board-DNOBo32D.js} +3 -3
  186. package/dist/client/assets/{monaco-editor-BhkNNN8A.js → monaco-editor-D3gyKeW5.js} +1 -1
  187. package/dist/client/assets/{monitoring-stats-row-D3wuHD5K.js → monitoring-stats-row-B2mHnjHP.js} +1 -1
  188. package/dist/client/assets/{multi-select-Bw9uE0vh.js → multi-select-DWjNtzij.js} +1 -1
  189. package/dist/client/assets/{mustache-BMe4E-3i.js → mustache-ChbLhy-e.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-Ckn9o5ws.js → oauth-callback-PixJQkgi.js} +1 -1
  191. package/dist/client/assets/{oauth-callback-ai-provider-B7dYzzRe.js → oauth-callback-ai-provider-Bo-B7c2F.js} +1 -1
  192. package/dist/client/assets/{onboarding-BtLLloCy.js → onboarding-Ci-02n6u.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-8yO8-q3h.js → optimistic-project-sidebar-views-DXHATWeY.js} +1 -1
  194. package/dist/client/assets/{org-file-open-context-k2zY7W2A.js → org-file-open-context-B3uxBbrN.js} +1 -1
  195. package/dist/client/assets/{organization-choice-oi5kPDHh.js → organization-choice-DTNV4OA3.js} +1 -1
  196. package/dist/client/assets/{orgs-C8VfgzyW.js → orgs-T1j1ZJVH.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-D-yemID7.js → page-seo-form-CEP8eX1I.js} +1 -1
  198. package/dist/client/assets/{pair-CbUh0olY.js → pair-BFIjmC4W.js} +1 -1
  199. package/dist/client/assets/{plan-ladder-DR8Snnfh.js → plan-ladder-BGfca4Fl.js} +1 -1
  200. package/dist/client/assets/{popover-tYq49O5I.js → popover-B1-bCr3Y.js} +1 -1
  201. package/dist/client/assets/{post-calendar-n3g3NXQN.js → post-calendar-BJNEmWBL.js} +1 -1
  202. package/dist/client/assets/{post-editor-BCki1XwL.js → post-editor-CXDWBybn.js} +1 -1
  203. package/dist/client/assets/{preview-content-BEe_g5h_.js → preview-content-BJxZz0wL.js} +1 -1
  204. package/dist/client/assets/{preview-dialog-B88KWjD7.js → preview-dialog-tXexYYvy.js} +1 -1
  205. package/dist/client/assets/{primitives-DvNXO9ko.js → primitives-CVINQDcd.js} +1 -1
  206. package/dist/client/assets/{profile-Dn8W-1_J.js → profile-BDVO0CZL.js} +1 -1
  207. package/dist/client/assets/{project-app-view-CHIgEuQJ.js → project-app-view-D5WewSj0.js} +1 -1
  208. package/dist/client/assets/{project-feed-BeVLcst-.js → project-feed-BJK1cP5l.js} +1 -1
  209. package/dist/client/assets/{project-icon-BuTPt9Ec.js → project-icon-I77gr-pK.js} +1 -1
  210. package/dist/client/assets/project-reports-C-M11Ewx.js +1 -0
  211. package/dist/client/assets/project-tasks-DTM5l8Na.js +1 -0
  212. package/dist/client/assets/{prompts-BrLG0HnD.js → prompts-CMF-VFXI.js} +1 -1
  213. package/dist/client/assets/record-editor-D668-cnv.js +1 -0
  214. package/dist/client/assets/{redirect-editor-DQh1NXo4.js → redirect-editor-DIpeG6wi.js} +1 -1
  215. package/dist/client/assets/registry-BL1mut8w.js +2 -0
  216. package/dist/client/assets/{registry-layout-tLc7-FpU.js → registry-layout-BmUtYGzz.js} +1 -1
  217. package/dist/client/assets/{reports-Bgxd82xF.js → reports-B5M0xDyn.js} +1 -1
  218. package/dist/client/assets/reports-DZF0Eu6T.js +1 -0
  219. package/dist/client/assets/{reports-onboarding-BORIliYh.js → reports-onboarding-pRaIN0gW.js} +1 -1
  220. package/dist/client/assets/{reports-tab-3yvhtU-e.js → reports-tab-b87PNkNv.js} +2 -2
  221. package/dist/client/assets/{repositories-DnQQ93Vy.js → repositories-J4P1iWK3.js} +1 -1
  222. package/dist/client/assets/{repository-import-picker-B1zE1wEx.js → repository-import-picker-CxfUH2IT.js} +1 -1
  223. package/dist/client/assets/{repository-picker-DMUsWfjy.js → repository-picker-C84r9pEi.js} +1 -1
  224. package/dist/client/assets/{require-capability-B9l2cjC7.js → require-capability-nXjtpUGm.js} +1 -1
  225. package/dist/client/assets/{required-auth-layout-qQ6V67AS.js → required-auth-layout-D6L2B3lC.js} +1 -1
  226. package/dist/client/assets/{reset-password-CzGwWM54.js → reset-password-CnmRONVL.js} +1 -1
  227. package/dist/client/assets/{resizable-c-JEmBrU.js → resizable-DGvuTNz4.js} +1 -1
  228. package/dist/client/assets/{review-settings-CBDmCs9f.js → review-settings-0gzJBFQk.js} +1 -1
  229. package/dist/client/assets/{rich-text-link-control-B4QybUls.js → rich-text-link-control-D1jkHV9n.js} +1 -1
  230. package/dist/client/assets/{roles-9Q5Zr1_l.js → roles-D0xiAKmZ.js} +1 -1
  231. package/dist/client/assets/{route-D9feMXoH.js → route-BXepAEc1.js} +1 -1
  232. package/dist/client/assets/{route-Cyp-PzpR.js → route-CRwg4ev7.js} +1 -1
  233. package/dist/client/assets/{route-DrZOVBG5.js → route-D4AIZCoB.js} +1 -1
  234. package/dist/client/assets/{route-page-header-BzWw0nja.js → route-page-header-DPnz1U8f.js} +1 -1
  235. package/dist/client/assets/{runnable-block-editor-nQ69L6jb.js → runnable-block-editor-DPGvOiWb.js} +1 -1
  236. package/dist/client/assets/{sandbox-lifecycle-context-DLKr6QBG.js → sandbox-lifecycle-context-BrifGyM7.js} +1 -1
  237. package/dist/client/assets/{schema-CStbpjQf.js → schema-CQ48zDTU.js} +1 -1
  238. package/dist/client/assets/{scroll-area-BLDUQh9N.js → scroll-area-SUblEurA.js} +1 -1
  239. package/dist/client/assets/{search-input-MlNEh696.js → search-input-DN1HxMQM.js} +1 -1
  240. package/dist/client/assets/{search-toggle-SUy-5Oe0.js → search-toggle-0BP5lkY1.js} +1 -1
  241. package/dist/client/assets/{secrets-CEw0kB_t.js → secrets-BaKuwycc.js} +1 -1
  242. package/dist/client/assets/{sections-editor-l8Cc724N.js → sections-editor-AVazcTA0.js} +1 -1
  243. package/dist/client/assets/{select-C_C7jdl-.js → select-DOrOm388.js} +1 -1
  244. package/dist/client/assets/{select-model-FW_XGeEU.js → select-model-BYr7h8L7.js} +1 -1
  245. package/dist/client/assets/{seo-editor-BhZJvD6-.js → seo-editor-Byp247PA.js} +1 -1
  246. package/dist/client/assets/{separator-D-DaNCb-.js → separator-CId9iV2J.js} +1 -1
  247. package/dist/client/assets/{settings-tab-DhuuexRq.js → settings-tab-BG8Rq5w6.js} +1 -1
  248. package/dist/client/assets/{sheet-B5ncClVO.js → sheet-DlPfrw9X.js} +1 -1
  249. package/dist/client/assets/{shell-layout-p-WJ7uxl.js → shell-layout-BDka9RLc.js} +1 -1
  250. package/dist/client/assets/{sidebar-BlfpAzXY.js → sidebar-6rO43IUN.js} +1 -1
  251. package/dist/client/assets/{skill-preview-CeIBKDR2.js → skill-preview-Co5VzFcl.js} +1 -1
  252. package/dist/client/assets/{skills-Cpf0zAbB.js → skills-BjII2RGG.js} +1 -1
  253. package/dist/client/assets/{sso-CYe8kGWS.js → sso-DisHvnNZ.js} +1 -1
  254. package/dist/client/assets/{store-DDl3lPqK.js → store-CFvcGu_A.js} +1 -1
  255. package/dist/client/assets/store-registry-ap1IeTES.js +2 -0
  256. package/dist/client/assets/{switch-C_FmZ5Us.js → switch-BV-MyRQN.js} +1 -1
  257. package/dist/client/assets/{synced-repos-DHbM7OOb.js → synced-repos-DQ8WQsrQ.js} +1 -1
  258. package/dist/client/assets/{table-mH2G1tkg.js → table-zCmjz1mf.js} +1 -1
  259. package/dist/client/assets/{tabs-jjUOgDeE.js → tabs-tFCunu6d.js} +1 -1
  260. package/dist/client/assets/{task-board-BtEMyO1f.js → task-board-D3lC_1Th.js} +1 -1
  261. package/dist/client/assets/{task-route-BaALoopn.js → task-route-Bcy3o1uq.js} +1 -1
  262. package/dist/client/assets/{task-status-CCMsckzm.js → task-status-DZ2zcnv8.js} +1 -1
  263. package/dist/client/assets/{taskboard-analytics-CzQSxt8I.js → taskboard-analytics-DN3ZXOV0.js} +1 -1
  264. package/dist/client/assets/tasks-C6FPIHKX.js +1 -0
  265. package/dist/client/assets/{tasks-K4e2STZ0.js → tasks-fYEHHw5V.js} +1 -1
  266. package/dist/client/assets/{textarea-B7wqTmSc.js → textarea-D-6K9r19.js} +1 -1
  267. package/dist/client/assets/{thread-button-B9U3gqvP.js → thread-button-DD23ms1j.js} +1 -1
  268. package/dist/client/assets/{thread-intent-DZx7N_NL.js → thread-intent-vrMbWjYP.js} +1 -1
  269. package/dist/client/assets/{thread-route-B3hhxYHj.js → thread-route-BSTJ2qPY.js} +1 -1
  270. package/dist/client/assets/{thread-route-DnE31jZ2.js → thread-route-QtII8A2p.js} +1 -1
  271. package/dist/client/assets/{thread-sheet-body-D_py0jIP.js → thread-sheet-body-KQlmfRxf.js} +1 -1
  272. package/dist/client/assets/{toggle-group-C-J6fFSZ.js → toggle-group-XcXQjaHX.js} +1 -1
  273. package/dist/client/assets/{toolbar-icon-button-DQAUOhdv.js → toolbar-icon-button-BIBFTsar.js} +1 -1
  274. package/dist/client/assets/{tooltip-DSCGYdw1.js → tooltip-rAdo_tRS.js} +1 -1
  275. package/dist/client/assets/{track-BWEjISsx.js → track-DmnUsSfo.js} +1 -1
  276. package/dist/client/assets/{types-BQYrCHfb.js → types-CzTQ99AX.js} +1 -1
  277. package/dist/client/assets/{usage-stats-CH100JwP.js → usage-stats-CYrj10jy.js} +1 -1
  278. package/dist/client/assets/{use-ai-providers-DPIPADTm.js → use-ai-providers-BwceVIHL.js} +1 -1
  279. package/dist/client/assets/{use-automations-Cm_whz3Q.js → use-automations-LlaDJlNA.js} +1 -1
  280. package/dist/client/assets/{use-autosave-C09DCahC.js → use-autosave-DVR2xqFT.js} +1 -1
  281. package/dist/client/assets/{use-connect-companion-D45RJA2C.js → use-connect-companion-C-xpH0dL.js} +1 -1
  282. package/dist/client/assets/{use-connection-DAR6kA6F.js → use-connection-BN3cT5kd.js} +1 -1
  283. package/dist/client/assets/{use-copy-CLZ5Gmjm.js → use-copy-Dcx9tDN2.js} +1 -1
  284. package/dist/client/assets/{use-create-virtual-mcp-DlDbTDWh.js → use-create-virtual-mcp-9-NMNx3_.js} +1 -1
  285. package/dist/client/assets/{use-date-fns-locale-4a1GuGUG.js → use-date-fns-locale-CDbheytD.js} +1 -1
  286. package/dist/client/assets/{use-debounced-autosave-s6ooboiq.js → use-debounced-autosave-DvQCb6wJ.js} +1 -1
  287. package/dist/client/assets/{use-debounced-value-C7PP6GCc.js → use-debounced-value-CfEN0fzg.js} +1 -1
  288. package/dist/client/assets/{use-deco-credits-C78gqYYg.js → use-deco-credits-6yJRZ2JQ.js} +1 -1
  289. package/dist/client/assets/{use-decopilot-events-DDN9tgML.js → use-decopilot-events-R9ZDtZrh.js} +1 -1
  290. package/dist/client/assets/{use-delete-connection-DT4K_5dd.js → use-delete-connection-BodmL1FQ.js} +1 -1
  291. package/dist/client/assets/{use-deployment-admin-mukdSbJI.js → use-deployment-admin-C884vS-k.js} +1 -1
  292. package/dist/client/assets/{use-entitlements-CsT7-WMV.js → use-entitlements-Dx7XqEcC.js} +1 -1
  293. package/dist/client/assets/{use-fast-preview-draft-url-BofBOVEy.js → use-fast-preview-draft-url-CAOVYx78.js} +1 -1
  294. package/dist/client/assets/{use-file-configs-DT6Slpub.js → use-file-configs-BJjPt2Ut.js} +1 -1
  295. package/dist/client/assets/{use-in-settings-BuwNY17C.js → use-in-settings-Bx-OzfKC.js} +1 -1
  296. package/dist/client/assets/{use-infinite-scroll-BEJH1fno.js → use-infinite-scroll-CWWIqkZ2.js} +1 -1
  297. package/dist/client/assets/{use-join-requests-CRlXrVsN.js → use-join-requests-gm28lnmh.js} +1 -1
  298. package/dist/client/assets/{use-main-panel-tabs-CHXW72tt.js → use-main-panel-tabs-Dcfn9hBK.js} +1 -1
  299. package/dist/client/assets/{use-mcp-auth-status-BUHt6LYh.js → use-mcp-auth-status-CwUBv4Hm.js} +1 -1
  300. package/dist/client/assets/{use-mcp-client-jmamuSRM.js → use-mcp-client-BtmoWWkf.js} +1 -1
  301. package/dist/client/assets/{use-mcp-prompts-Cb12ACl6.js → use-mcp-prompts-BkeLGKHx.js} +1 -1
  302. package/dist/client/assets/{use-mcp-tools-U5kwqIN7.js → use-mcp-tools-B84418Zt.js} +1 -1
  303. package/dist/client/assets/{use-members-CZk_logh.js → use-members-DOLKWeYn.js} +1 -1
  304. package/dist/client/assets/{use-mobile-X_9uHXB5.js → use-mobile-CRuuooNM.js} +1 -1
  305. package/dist/client/assets/{use-navigate-to-agent-XZHI0vTx.js → use-navigate-to-agent-DIpRW39A.js} +1 -1
  306. package/dist/client/assets/{use-open-billing-url-BygdFnSn.js → use-open-billing-url-C5SPvsb8.js} +1 -1
  307. package/dist/client/assets/{use-org-auth-client-6spdYft8.js → use-org-auth-client-TdQ8MWNM.js} +1 -1
  308. package/dist/client/assets/{use-org-fs-C4AEj3YR.js → use-org-fs-DnKhdb5t.js} +1 -1
  309. package/dist/client/assets/{use-org-repo-syncs-D5-YS2q1.js → use-org-repo-syncs-DJd41R4N.js} +1 -1
  310. package/dist/client/assets/{use-org-sso-CbtWg6df.js → use-org-sso-D6hDWGLC.js} +1 -1
  311. package/dist/client/assets/{use-organization-roles-B2NYy6qP.js → use-organization-roles-BXwewduE.js} +1 -1
  312. package/dist/client/assets/{use-organization-settings-DiOLzOn-.js → use-organization-settings-yjdHHrMs.js} +1 -1
  313. package/dist/client/assets/{use-panel-navigate-YnjVvVnu.js → use-panel-navigate-DEBeb2CL.js} +1 -1
  314. package/dist/client/assets/{use-project-native-view-presence-S2GuqygD.js → use-project-native-view-presence-CHdUtv7D.js} +1 -1
  315. package/dist/client/assets/{use-project-scope-azWGklpf.js → use-project-scope-DHl6lLqa.js} +1 -1
  316. package/dist/client/assets/{use-registry-connections-Dr6Tl0jy.js → use-registry-connections-B13lXSQz.js} +1 -1
  317. package/dist/client/assets/{use-releases-sRilJRv7.js → use-releases-CASa78Vi.js} +1 -1
  318. package/dist/client/assets/{use-reports-diagnostic-b56ze7yP.js → use-reports-diagnostic-jdgV6F3e.js} +1 -1
  319. package/dist/client/assets/{use-route-default-main-DAXdKSA3.js → use-route-default-main-DSxGO_aw.js} +1 -1
  320. package/dist/client/assets/{use-secrets-BD25jCAi.js → use-secrets-B-9J9EkQ.js} +1 -1
  321. package/dist/client/assets/{use-section-preview-base-CfKeOl7s.js → use-section-preview-base-Di3xgtD1.js} +1 -1
  322. package/dist/client/assets/{use-session-runtime-D8PgcjtK.js → use-session-runtime-Dc42TY0X.js} +1 -1
  323. package/dist/client/assets/{use-tags-DMzy8m-k.js → use-tags-CCJJRf2p.js} +1 -1
  324. package/dist/client/assets/{use-task-board-analytics-BXM0SDto.js → use-task-board-analytics-CK3_uAaU.js} +1 -1
  325. package/dist/client/assets/{use-task-metadata-IzJB5PVG.js → use-task-metadata-jNANkRmK.js} +1 -1
  326. package/dist/client/assets/{use-thread-outputs-BhhE_Gkc.js → use-thread-outputs-BoiojEnU.js} +1 -1
  327. package/dist/client/assets/{use-view-mode-CUHkIbeG.js → use-view-mode-D8IEchi6.js} +1 -1
  328. package/dist/client/assets/{use-virtual-mcp-Bt7oX0ej.js → use-virtual-mcp-2UFz9K4W.js} +1 -1
  329. package/dist/client/assets/useInfiniteQuery-Bvk6obSJ.js +1 -0
  330. package/dist/client/assets/{useQueries-D7ondynP.js → useQueries-thkmee8L.js} +1 -1
  331. package/dist/client/assets/useSuspenseInfiniteQuery-7JvmV8My.js +1 -0
  332. package/dist/client/assets/{users-CP4Dfulp.js → users-BGtd_KGY.js} +1 -1
  333. package/dist/client/assets/{utils-CcX7wgow.js → utils-1s66UjII.js} +1 -1
  334. package/dist/client/assets/{variant-calendar-BYxVe-PM.js → variant-calendar-Dg9C2UkW.js} +1 -1
  335. package/dist/client/assets/{variant-matcher-override-CgX58Kkx.js → variant-matcher-override-DquKUvoE.js} +1 -1
  336. package/dist/client/assets/{view-mode-toggle-CRnJAx40.js → view-mode-toggle-CJQ43vUA.js} +1 -1
  337. package/dist/client/assets/{virtual-mcp-BWl8nlWy.js → virtual-mcp-Be7V69gW.js} +1 -1
  338. package/dist/client/index.html +1 -1
  339. package/dist/server/cli.js +597 -597
  340. package/dist/server/server.js +392 -392
  341. package/package.json +1 -1
  342. package/dist/client/assets/agent-app-DqzssWfL.js +0 -1
  343. package/dist/client/assets/agent-deck-BQOqb5JA.js +0 -1
  344. package/dist/client/assets/agent-file-CN4CJx4b.js +0 -1
  345. package/dist/client/assets/agent-library-file-CMtJlgeS.js +0 -1
  346. package/dist/client/assets/agent-settings-G7qQl7Yj.js +0 -1
  347. package/dist/client/assets/agent-site-editor-code-BV4iQvoi.js +0 -2
  348. package/dist/client/assets/agent-view-BinIwia6.js +0 -1
  349. package/dist/client/assets/api-keys-CN-jy2XH.js +0 -1
  350. package/dist/client/assets/app-editor-BPKOcfIg.js +0 -1
  351. package/dist/client/assets/category-editor-Crlp5xLx.js +0 -1
  352. package/dist/client/assets/project-reports-EFWj1j4Z.js +0 -1
  353. package/dist/client/assets/project-tasks-DGYfz1Ev.js +0 -1
  354. package/dist/client/assets/record-editor-AST5wQoO.js +0 -1
  355. package/dist/client/assets/registry-FGkay0Wa.js +0 -2
  356. package/dist/client/assets/reports-CqtPOzss.js +0 -1
  357. package/dist/client/assets/store-registry-DUH5xq3l.js +0 -2
  358. package/dist/client/assets/tasks-CI20rxb_.js +0 -1
  359. package/dist/client/assets/useInfiniteQuery-zZoTJbYm.js +0 -1
  360. package/dist/client/assets/useSuspenseInfiniteQuery-BvOl5Id0.js +0 -1
@@ -1 +1 @@
1
- import{c as $,b as U,r as B,l as Y,j as s,h as je,a0 as le,au as Ne,at as Fe,E as Ct,a as Re,K as Pt,m as nt,q as ce,a6 as at,av as ls,aw as os,_ as At,t as It,an as cs,d as Be,Z as rt,n as pt,ax as Mt,ay as ds,f as Se,C as xt,e as us,u as Oe,k as ms,az as fs,aA as hs,O as Lt,aB as ps,N as xs,B as gs,P as Le}from"./index-CC7J7MsT.js";import{i as it}from"./AlertCircle-D0XfIdP3.js";import{i as bs}from"./LayoutLeft-Cr5_A1QG.js";import{u as vs}from"./sidebar-BlfpAzXY.js";import{T as De,p as js}from"./toolbar-icon-button-DQAUOhdv.js";import{C as ee,w as ys}from"./index-CV2G6XgT.js";import{u as ks,a as Ns}from"./use-organization-settings-DiOLzOn-.js";import{d as Ss,i as Ts}from"./decofile-api-DygXY02K.js";import{u as ze,a as $t,b as Ge,c as Dt,d as _s,e as ws,s as Cs}from"./chat-context-CVZ1rNGo.js";import{u as Et}from"./use-session-runtime-D8PgcjtK.js";import{u as Ps}from"./use-ai-providers-DPIPADTm.js";import{i as As}from"./CheckCircle-GwUJIVVh.js";import{o as gt,A as ye,p as Is,q as Ms,r as Ls,u as $s,v as Ds,w as Ft,x as Es,y as Fs,z as Rs,n as Bs}from"./agent-icon-D5Ih-I28.js";import{i as Os}from"./XCircle-BR8ZZHlj.js";import{s as bt}from"./XClose-VLid_ZSM.js";import{a as de,b as Rt}from"./use-virtual-mcp-Bt7oX0ej.js";import{I as Bt}from"./integration-icon-BARnXRTY.js";import{b as zs}from"./use-entitlements-CsT7-WMV.js";import{t as lt}from"./ChevronUp-CodzCI7T.js";import{O as Gs,u as Hs}from"./pair-CbUh0olY.js";import{u as Us,a as Vs}from"./use-thread-outputs-BhhE_Gkc.js";import{u as Ks}from"./use-deco-credits-C78gqYYg.js";import{a as ot,f as Ws,L as Ot,s as qs,b as Ys}from"./shell-layout-p-WJ7uxl.js";import{f as Qs,b as Zs}from"./use-project-scope-azWGklpf.js";import{g as et,u as Xs,n as Js,a as en}from"./use-releases-sRilJRv7.js";import{d as zt,c as tn}from"./thread-intent-DZx7N_NL.js";import{u as sn,a as ct,b as dt,c as ut}from"./hooks-BFlZlUD7.js";import{f as nn,a as Gt,b as an}from"./use-navigate-to-agent-XZHI0vTx.js";import{o as rn,s as ln,u as on,S as cn,a as dn}from"./sandbox-lifecycle-context-DLKr6QBG.js";import{E as Ht}from"./empty-state-DiRnF-wA.js";import{t as un,m as mn,u as fn}from"./thread-button-B9U3gqvP.js";import{g as Ut}from"./github-repo-BknN0SVI.js";import{u as Vt}from"./use-mobile-X_9uHXB5.js";import{C as vt,u as hn,P as pn}from"./index-Coo4IGyG.js";import{a as Kt,b as Wt,P as qt}from"./popover-tYq49O5I.js";import{T as Te,a as _e,c as we}from"./tooltip-DSCGYdw1.js";import{i as xn}from"./Tool02-CFu103hl.js";import{T as gn,a as bn}from"./toggle-group-C-J6fFSZ.js";import{u as Yt,a as He,r as vn,b as Qt,c as jn,d as yn}from"./thread-route-DnE31jZ2.js";import{d as kn,h as Nn,c as Sn,b as Tn,D as _n}from"./dialog-BKhaq-Xf.js";import{c as wn,C as Cn,a as Pn,b as An,e as In,d as Mn}from"./command-Dsz0XoYc.js";import{i as Zt}from"./Zap-D3d1wpzw.js";import{A as Ln,a as $n,b as Dn,c as En,g as Fn,d as Rn,e as Bn,f as On}from"./alert-dialog-D6rlFoy0.js";import{g as zn,S as Gn}from"./task-status-CCMsckzm.js";import{a as Hn}from"./format-time-BtXRrtv4.js";import{i as Un}from"./Globe01-DjdW3vEO.js";import{a as Vn}from"./Package-Cd3aVeK8.js";import{a as mt,u as Kn}from"./use-panel-navigate-YnjVvVnu.js";import{u as ft}from"./use-main-panel-tabs-CHXW72tt.js";import{i as Wn}from"./Share07-Bw4Wicv2.js";import{b as qn,c as Xt,S as Yn,d as Qn}from"./select-C_C7jdl-.js";import{L as ht,a as Zn}from"./legacy-main-redirect-NyVTUirL.js";import{L as Xn}from"./preview-dialog-B88KWjD7.js";import{O as Jn}from"./org-file-open-context-k2zY7W2A.js";import{B as jt}from"./blocks-preview-workspace-context-BwjlsTrq.js";import{u as Jt}from"./use-is-desktop-app-BNujXJc_.js";import{p as ea}from"./virtual-mcp-BWl8nlWy.js";import"./sheet-B5ncClVO.js";import"./X-DTaqHNcB.js";import"./ArrowUp-17ZWJBkC.js";import"./gateway-client-B8HHtBA6.js";import"./drawer-CCmZWflK.js";import"./collection-search-Dvf73igt.js";import"./SearchMd-C6gkQ2l2.js";import"./use-mcp-client-jmamuSRM.js";import"./auth-B_QE3yd2.js";import"./use-mcp-prompts-Cb12ACl6.js";import"./index-BcfYNZk_.js";import"./form-CxKBX2E3.js";import"./label-YKssz_GS.js";import"./input-DSV_9cOM.js";import"./utils-CVEq3hMx.js";import"./input-X38P96BY.js";import"./autosend-DtYV6o0l.js";import"./chat-draft-UIE-uNFd.js";import"./ArrowRight-CnMpegh6.js";import"./Image01-DPvj49a-.js";import"./Upload01-DkDsqCWe.js";import"./Copy01-CrFZhFXo.js";import"./ArrowLeft-COesgQ7q.js";import"./usage-stats-CH100JwP.js";import"./use-copy-CLZ5Gmjm.js";import"./markdown-tOSThun8.js";import"./Download01-B93GUT2-.js";import"./ZoomOut-B3S7N50e.js";import"./tabs-jjUOgDeE.js";import"./tool-namespace-DmnQIdtF.js";import"./use-open-billing-url-BygdFnSn.js";import"./decopilot-rj_BJ_Z1.js";import"./checkbox-VSstjUSb.js";import"./Tool01-iak9ZtFE.js";import"./Key01-O_Ykzy8v.js";import"./Settings02-DH86cX_B.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-CQaKbr3c.js";import"./avatar-Dwn9Bjsb.js";import"./User01-CmNzW4kH.js";import"./Eye-Bxxku7SE.js";import"./download-app-dialog-wNu8nmu1.js";import"./Stars01-B1kYoDFp.js";import"./index-DZmKVVGY.js";import"./input-QKe7l082.js";import"./hooks-CFjlhRX0.js";import"./use-org-fs-C4AEj3YR.js";import"./Link01-D8T6mRIR.js";import"./Plus-BjOenFFb.js";import"./question-004-sINsf4GQ.js";import"./use-members-CZk_logh.js";import"./use-org-auth-client-6spdYft8.js";import"./feature-paywall-B3_no1lb.js";import"./plan-ladder-DR8Snnfh.js";import"./add-connection-dialog-CaHZ3eeK.js";import"./extract-connection-data-Bdk8iF2q.js";import"./metadata-dUsYcpuu.js";import"./github-D4UJ99TO.js";import"./connection-2MR1zroe.js";import"./connection-card-B5yTdNvS.js";import"./use-registry-connections-Dr6Tl0jy.js";import"./use-connection-DAR6kA6F.js";import"./useInfiniteQuery-zZoTJbYm.js";import"./infiniteQueryObserver-CKT-6XMq.js";import"./retry-i8LvYSZg.js";import"./backoff-8mStPHYB.js";import"./connection-slug-CITJ0kGN.js";import"./slugify-CEUa2lfQ.js";import"./textarea-B7wqTmSc.js";import"./UserSquare-1_FC93GE.js";import"./connection-form-helpers-PrMbwr2L.js";import"./Trash01-CpN6r-a0.js";import"./authenticate-and-persist-oauth-Cm242zr2.js";import"./mcp-oauth-Cr_ZflCp.js";import"./collection-tabs-BW0egx-_.js";import"./badge-BSirYRuD.js";import"./use-infinite-scroll-BEJH1fno.js";import"./useSuspenseInfiniteQuery-BvOl5Id0.js";import"./schema-CStbpjQf.js";import"./task-board-BtEMyO1f.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DDN9tgML.js";import"./TrendUp01-DlYmFZ7k.js";import"./Globe04-1G-_QSZW.js";import"./CreditCard01-DDojC3kk.js";import"./DotsVertical-DMzYFBsd.js";import"./LinkExternal01-CWPNoGQ_.js";import"./Sun-kycCorOO.js";import"./Palette-HRmzWYeK.js";import"./Play-CaxaoMwA.js";import"./SearchLg-CT-Vntfj.js";import"./Users01-CVhfgklM.js";import"./collapsible-BX137q_-.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-c3JU3ROq.js";import"./types-BQYrCHfb.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./file-type-icon-Co9lETmZ.js";import"./project-icon-BuTPt9Ec.js";import"./required-auth-layout-qQ6V67AS.js";import"./use-org-sso-CbtWg6df.js";import"./serial-task-queue-CGOeQgpr.js";import"./sandbox-url-D3mC8qhT.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./use-route-default-main-DAXdKSA3.js";import"./use-in-settings-BuwNY17C.js";import"./resizable-c-JEmBrU.js";import"./route-page-header-BzWw0nja.js";import"./index-D2HOssRq.js";import"./index-BrLZxE6-.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-mcp-tools-U5kwqIN7.js";import"./use-task-metadata-IzJB5PVG.js";import"./use-project-native-view-presence-S2GuqygD.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-DT6Slpub.js";import"./site-slug-uya6Wp4-.js";import"./preview-content-BEe_g5h_.js";import"./file-preview-BFDgPeRr.js";import"./utils-CcX7wgow.js";import"./editor-DMij_Pa1.js";import"./file-share-button-7xy_ju8b.js";function ta({isThreadLocked:t,hasCloudProviderKeys:e}){return t?!1:!e}function sa(){const t=$.c(3),e=Ps(),a=ze()?.isThreadLocked??!1,i=e.length>0;let r;return t[0]!==a||t[1]!==i?(r=ta({isThreadLocked:a,hasCloudProviderKeys:i}),t[0]=a,t[1]=i,t[2]=r):r=t[2],r}function ve(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Qe(t){if(!t)return"—";const e=typeof t=="string"?new Date(t):t;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function na(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function aa(t){const e=$.c(4),{items:n}=t;let a;e[0]!==n?(a=n.map(ra),e[0]=n,e[1]=a):a=e[1];let i;return e[2]!==a?(i=s.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:a}),e[2]=a,e[3]=i):i=e[3],i}function ra(t){return s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[s.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.label}),s.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:t.value})]},t.label)}function ia(t){const e=$.c(33),{userTokens:n,assistantTokens:a,otherTokens:i}=t,r=U(),l=n+a+i,c=l>0?n/l*100:0,u=l>0?a/l*100:0,o=l>0?i/l*100:0;let d;e[0]!==c?(d=c>0&&s.jsx("div",{className:"h-full bg-chart-1",style:{width:`${c}%`}}),e[0]=c,e[1]=d):d=e[1];let f;e[2]!==u?(f=u>0&&s.jsx("div",{className:"h-full bg-chart-2",style:{width:`${u}%`}}),e[2]=u,e[3]=f):f=e[3];let m;e[4]!==o?(m=o>0&&s.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${o}%`}}),e[4]=o,e[5]=m):m=e[5];let h;e[6]!==d||e[7]!==f||e[8]!==m?(h=s.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[d,f,m]}),e[6]=d,e[7]=f,e[8]=m,e[9]=h):h=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=g):g=e[10];let j;e[11]!==r||e[12]!==c?(j=r("chat.contextPanel.userPercent",{pct:c.toFixed(1)}),e[11]=r,e[12]=c,e[13]=j):j=e[13];let b;e[14]!==j?(b=s.jsxs("div",{className:"flex items-center gap-1.5",children:[g,s.jsx("span",{className:"text-xs text-muted-foreground",children:j})]}),e[14]=j,e[15]=b):b=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[16]=x):x=e[16];let v;e[17]!==u||e[18]!==r?(v=r("chat.contextPanel.assistantPercent",{pct:u.toFixed(1)}),e[17]=u,e[18]=r,e[19]=v):v=e[19];let k;e[20]!==v?(k=s.jsxs("div",{className:"flex items-center gap-1.5",children:[x,s.jsx("span",{className:"text-xs text-muted-foreground",children:v})]}),e[20]=v,e[21]=k):k=e[21];let y;e[22]!==o||e[23]!==i||e[24]!==r?(y=i>0&&s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:r("chat.contextPanel.otherPercent",{pct:o.toFixed(1)})})]}),e[22]=o,e[23]=i,e[24]=r,e[25]=y):y=e[25];let p;e[26]!==k||e[27]!==y||e[28]!==b?(p=s.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[b,k,y]}),e[26]=k,e[27]=y,e[28]=b,e[29]=p):p=e[29];let T;return e[30]!==p||e[31]!==h?(T=s.jsxs("div",{className:"flex flex-col gap-2",children:[h,p]}),e[30]=p,e[31]=h,e[32]=T):T=e[32],T}function la(t){const e=$.c(14),{agentId:n,isError:a}=t,i=de(n),r=U();let l;e[0]!==i?.title||e[1]!==r?(l=i?.title??r("chat.subtask.subtaskNoun"),e[0]=i?.title,e[1]=r,e[2]=l):l=e[2];const c=l,u=i?.icon??null;let o;e[3]!==u||e[4]!==c?(o=s.jsx(Bt,{icon:u,name:c,size:"xs",className:"size-6 rounded-md shrink-0"}),e[3]=u,e[4]=c,e[5]=o):o=e[5];const d=a?"text-destructive":"text-foreground";let f;e[6]!==d?(f=Y("shrink-0 font-medium",d),e[6]=d,e[7]=f):f=e[7];let m;e[8]!==c||e[9]!==f?(m=s.jsx("span",{className:f,children:c}),e[8]=c,e[9]=f,e[10]=m):m=e[10];let h;return e[11]!==o||e[12]!==m?(h=s.jsxs(s.Fragment,{children:[o,m]}),e[11]=o,e[12]=m,e[13]=h):h=e[13],h}function oa(t){const e=$.c(12),{isError:n}=t,a=U();let i;e[0]!==a?(i=a("chat.contextPanel.subtask"),e[0]=a,e[1]=i):i=e[1];const r=i;let l;e[2]!==r?(l=s.jsx(Bt,{icon:null,name:r,size:"xs",className:"size-6 rounded-md shrink-0"}),e[2]=r,e[3]=l):l=e[3];const c=n?"text-destructive":"text-foreground";let u;e[4]!==c?(u=Y("shrink-0 font-medium",c),e[4]=c,e[5]=u):u=e[5];let o;e[6]!==r||e[7]!==u?(o=s.jsx("span",{className:u,children:r}),e[6]=r,e[7]=u,e[8]=o):o=e[8];let d;return e[9]!==l||e[10]!==o?(d=s.jsxs(s.Fragment,{children:[l,o]}),e[9]=l,e[10]=o,e[11]=d):d=e[11],d}function ca(t){const e=$.c(18),{part:n}=t,a=n.input?.agent_id,i=n.state==="input-streaming"||n.state==="input-available"||n.state==="output-available"&&n.preliminary===!0,r=n.state==="output-error",l=n.state==="approval-requested";let c;e[0]!==r?(c=s.jsx(oa,{isError:r}),e[0]=r,e[1]=c):c=e[1];let u;e[2]!==a||e[3]!==r?(u=s.jsx(la,{agentId:a,isError:r}),e[2]=a,e[3]=r,e[4]=u):u=e[4];let o;e[5]!==c||e[6]!==u?(o=s.jsx(B.Suspense,{fallback:c,children:u}),e[5]=c,e[6]=u,e[7]=o):o=e[7];let d;e[8]!==n.input?(d=n.input?.prompt&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/50",children:"·"}),s.jsx("span",{className:"truncate text-muted-foreground",children:n.input.prompt})]}),e[8]=n.input,e[9]=d):d=e[9];let f;e[10]!==l||e[11]!==r||e[12]!==i?(f=s.jsx("span",{className:"ml-auto shrink-0",children:i?s.jsx(je,{className:"size-3 text-muted-foreground"}):r?s.jsx(Os,{size:12,className:"text-destructive"}):l?s.jsx(it,{size:12,className:"text-warning"}):s.jsx(As,{size:12,className:"text-success"})}),e[10]=l,e[11]=r,e[12]=i,e[13]=f):f=e[13];let m;return e[14]!==o||e[15]!==d||e[16]!==f?(m=s.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[o,d,f]}),e[14]=o,e[15]=d,e[16]=f,e[17]=m):m=e[17],m}function da(t){const e=$.c(51),{onClose:n,back:a,className:i}=t,r=U(),[l,c]=B.useState(null),{messages:u}=$t(),{activeTask:o}=Ge(),{selectedModel:d,selectedVirtualMcp:f}=Dt(),m=_s(u),h=[...u].reverse().find(ya),g=h?.metadata?.usage,j=h?.metadata?.modelLimits?.contextWindow??d?.limits?.contextWindow??null,b=g?.contextTokens??0,x=j&&j>0?(b/j*100).toFixed(1):null,v=u;let k;e[0]!==v?(k=v.filter(ja).reduce(va,0),e[0]=v,e[1]=k):k=e[1];const y=k,p=u;let T;e[2]!==p?(T=p.filter(ba).reduce(ga,0),e[2]=p,e[3]=T):T=e[3];const N=T,S=Math.max(0,m.totalTokens-y-N),w=u[0],_=u.at(-1),C=w?.metadata?.created_at??o?.created_at,A=_?.metadata?.created_at??o?.updated_at,P=u.filter(xa),M=u.flatMap(ha),I=d?.modelId?na(d.modelId):"—",D=f?.title??"Super Agent",E=zs(),F=[{label:r("chat.contextPanel.sessionLabel"),value:o?.title??r("chat.contextPanel.newChat")},{label:r("chat.contextPanel.messagesLabel"),value:P.length},{label:r("chat.contextPanel.agentLabel"),value:D},...E?[{label:r("chat.contextPanel.modelLabel"),value:I}]:[],{label:r("chat.contextPanel.contextLimitLabel"),value:j?ve(j):"—"},{label:r("chat.contextPanel.sessionTokensLabel"),value:m.totalTokens>0?ve(m.totalTokens):"0"},{label:r("chat.contextPanel.usageLabel"),value:x!==null?`${x}%`:"—"},{label:r("chat.contextPanel.inputTokensLabel"),value:m.inputTokens>0?ve(m.inputTokens):"0"},{label:r("chat.contextPanel.outputTokensLabel"),value:m.outputTokens>0?ve(m.outputTokens):"0"},{label:r("chat.contextPanel.reasoningTokensLabel"),value:m.reasoningTokens>0?ve(m.reasoningTokens):"0"},...E?[{label:r("chat.contextPanel.costLabel"),value:m.cost>0?`$${m.cost<.001?m.cost.toFixed(6):m.cost.toFixed(4)}`:"$0.00"}]:[],{label:r("chat.contextPanel.sessionCreatedLabel"),value:Qe(C)},{label:r("chat.contextPanel.lastActivityLabel"),value:Qe(A)}];if(!o&&P.length===0){let H;e[4]!==i?(H=Y("flex flex-col h-full w-full border-l border-border bg-background",i),e[4]=i,e[5]=H):H=e[5];let q;e[6]!==r?(q=r("chat.contextPanel.title"),e[6]=r,e[7]=q):q=e[7];let ae;e[8]!==q?(ae=s.jsx("span",{className:"text-sm font-medium text-foreground",children:q}),e[8]=q,e[9]=ae):ae=e[9];let ie;e[10]!==a?(ie=a?s.jsx(gt,{size:14,className:"text-muted-foreground"}):s.jsx(bt,{size:14,className:"text-muted-foreground"}),e[10]=a,e[11]=ie):ie=e[11];let J;e[12]!==n||e[13]!==ie?(J=s.jsx("button",{type:"button",onClick:n,className:"flex size-6 items-center justify-center classic:rounded hover:bg-accent transition-colors compact:rounded-lg",children:ie}),e[12]=n,e[13]=ie,e[14]=J):J=e[14];let oe;e[15]!==ae||e[16]!==J?(oe=s.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[ae,J]}),e[15]=ae,e[16]=J,e[17]=oe):oe=e[17];let te;e[18]!==r?(te=r("chat.contextPanel.emptyState"),e[18]=r,e[19]=te):te=e[19];let se;e[20]!==te?(se=s.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:te})}),e[20]=te,e[21]=se):se=e[21];let re;return e[22]!==oe||e[23]!==se||e[24]!==H?(re=s.jsxs("div",{className:H,children:[oe,se]}),e[22]=oe,e[23]=se,e[24]=H,e[25]=re):re=e[25],re}let L;e[26]!==i?(L=Y("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",i),e[26]=i,e[27]=L):L=e[27];let G;e[28]!==r?(G=r("chat.contextPanel.title"),e[28]=r,e[29]=G):G=e[29];let O;e[30]!==G?(O=s.jsx("span",{className:"text-sm font-medium text-foreground",children:G}),e[30]=G,e[31]=O):O=e[31];let K;e[32]!==a?(K=a?s.jsx(gt,{size:14}):s.jsx(bt,{size:14}),e[32]=a,e[33]=K):K=e[33];let R;e[34]!==n||e[35]!==K?(R=s.jsx("button",{type:"button",onClick:n,className:"flex h-7 w-7 items-center justify-center classic:rounded-md compact:rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:K}),e[34]=n,e[35]=K,e[36]=R):R=e[36];let Q;e[37]!==O||e[38]!==R?(Q=s.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[O,R]}),e[37]=O,e[38]=R,e[39]=Q):Q=e[39];let V;e[40]!==r?(V=r("chat.contextPanel.contextBreakdownSection"),e[40]=r,e[41]=V):V=e[41];let W;e[42]!==V?(W=s.jsx("span",{className:"text-xs text-muted-foreground",children:V}),e[42]=V,e[43]=W):W=e[43];let Z;e[44]!==N||e[45]!==S||e[46]!==y?(Z=s.jsx(ia,{userTokens:y,assistantTokens:N,otherTokens:S}),e[44]=N,e[45]=S,e[46]=y,e[47]=Z):Z=e[47];let X;return e[48]!==W||e[49]!==Z?(X=s.jsxs("div",{className:"flex flex-col gap-3",children:[W,Z]}),e[48]=W,e[49]=Z,e[50]=X):X=e[50],s.jsxs("div",{className:L,children:[Q,s.jsxs("div",{className:"flex flex-col gap-8 p-6",children:[M.length>0&&s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:r("chat.contextPanel.subtasksSection")}),s.jsx("div",{className:"flex flex-col gap-1",children:M.map(fa)})]}),s.jsx(aa,{items:F}),X,P.length>0&&s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:r("chat.contextPanel.rawMessagesSection")}),s.jsx("div",{className:"flex flex-col gap-1",children:P.map(H=>{const q=H.metadata?.created_at,ae=l?.id===H.id;return s.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[s.jsxs("button",{type:"button",onClick:()=>c(ae?null:H),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent/50 w-full text-left cursor-pointer",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("span",{className:Y("shrink-0 font-medium",H.role==="user"?"text-chart-1":"text-chart-2"),children:H.role}),s.jsx("span",{className:"text-muted-foreground",children:"•"}),s.jsx("span",{className:"truncate text-muted-foreground font-mono",children:H.id})]}),q&&s.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:Qe(q)})]}),ae&&s.jsxs(s.Fragment,{children:[H.role==="assistant"&&(()=>{const ie=H.metadata?._request;if(!ie)return null;const J=ie.systemSections??[],oe=Math.max(1,...J.map(ma)),te=J.reduce(ua,0);return s.jsxs("div",{className:"border-t border-border/50 px-3 py-2.5 text-xs space-y-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-medium text-foreground",children:r("chat.contextPanel.requestLabel")}),s.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[ie.activeTools??0," / ",ie.tools??0," ",r("chat.contextPanel.toolsActive")]})]}),J.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"text-muted-foreground",children:[r("chat.contextPanel.systemPromptLabel")," ",s.jsxs("span",{className:"tabular-nums",children:["~",Math.round(te/4).toLocaleString()," ",r("chat.contextPanel.tokAbbrev")]})]}),J.map((se,re)=>{const ue=se.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${re}`,ge=se.chars/oe*100,me=Math.round(se.chars/4);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"font-mono text-foreground truncate",children:ue}),s.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["~",me.toLocaleString()," ",r("chat.contextPanel.tokAbbrev")]})]}),s.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full bg-chart-3",style:{width:`${ge}%`}})})]},re)})]})]})})(),s.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(H,null,2)})]})]},H.id)})})]})]})]})}function ua(t,e){return t+e.chars}function ma(t){return t.chars}function fa(t,e){return s.jsx(ca,{part:t},e)}function ha(t){return(t.parts??[]).filter(pa)}function pa(t){return t.type==="tool-subtask"}function xa(t){return t.role!=="system"}function ga(t,e){const n=e.metadata?.usage;return t+(n?.outputTokens??0)}function ba(t){return t.role==="assistant"}function va(t,e){const n=e.metadata?.usage;return t+(n?.inputTokens??0)}function ja(t){return t.role==="user"}function ya(t){return t.role==="assistant"&&t.metadata?.usage}function ka(t){const e=$.c(21),{onOpenContextPanel:n}=t,{org:a}=le(),{selectedVirtualMcp:i}=Dt();let r;e[0]!==a.id?(r=Ne(a.id),e[0]=a.id,e[1]=r):r=e[1];const c=i??r,o=de(c.id)??c,d=o.title??"Super Agent",f=o.icon??null,m=o.description??null;let h;e[2]!==f||e[3]!==d?(h=s.jsx(ye,{icon:f,name:d,size:"lg"}),e[2]=f,e[3]=d,e[4]=h):h=e[4];let g;e[5]!==d?(g=s.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:d}),e[5]=d,e[6]=g):g=e[6];let j;e[7]!==m?(j=m?s.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance",children:m}):null,e[7]=m,e[8]=j):j=e[8];let b;e[9]!==g||e[10]!==j?(b=s.jsxs("div",{className:"space-y-1.5",children:[g,j]}),e[9]=g,e[10]=j,e[11]=b):b=e[11];let x;e[12]!==h||e[13]!==b?(x=s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-4 px-6 text-center overflow-hidden",children:[h,b]}),e[12]=h,e[13]=b,e[14]=x):x=e[14];let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ee.IceBreakers,{className:"pb-3"}),e[15]=v):v=e[15];let k;e[16]!==n?(k=s.jsxs(ee.Footer,{children:[v,s.jsx(ee.Input,{onOpenContextPanel:n})]}),e[16]=n,e[17]=k):k=e[17];let y;return e[18]!==x||e[19]!==k?(y=s.jsxs(s.Fragment,{children:[x,k]}),e[18]=x,e[19]=k,e[20]=y):y=e[20],y}function yt(t){const e=$.c(17),{outputs:n,collapsed:a,onToggle:i,variant:r}=t,l=r==="card"?"rounded-xl border border-border bg-muted/95 shadow-sm backdrop-blur-sm":"border-b border-border bg-background";let c;e[0]!==l?(c=Y(l),e[0]=l,e[1]=c):c=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Files in this task"}),e[2]=u):u=e[2];const o=a&&"-rotate-90";let d;e[3]!==o?(d=Y("size-4 text-muted-foreground transition-transform",o),e[3]=o,e[4]=d):d=e[4];let f;e[5]!==d?(f=s.jsx(lt,{className:d}),e[5]=d,e[6]=f):f=e[6];let m;e[7]!==i||e[8]!==f?(m=s.jsxs("button",{type:"button",onClick:i,className:"flex w-full items-center justify-between px-3 py-2.5 text-left",children:[u,f]}),e[7]=i,e[8]=f,e[9]=m):m=e[9];let h;e[10]!==a||e[11]!==n?(h=!a&&s.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto px-2 pb-2",children:n.map(Na)}),e[10]=a,e[11]=n,e[12]=h):h=e[12];let g;return e[13]!==c||e[14]!==m||e[15]!==h?(g=s.jsxs("div",{className:c,children:[m,h]}),e[13]=c,e[14]=m,e[15]=h,e[16]=g):g=e[16],g}function Na(t){return s.jsx(Gs,{file:t},t.key)}function Sa(){const t=$.c(13),e=ze()?.taskId??null,n=Us();let a;t[0]!==n?(a={enabled:n},t[0]=n,t[1]=a):a=t[1];const{data:i}=Vs(e,a),[r,l]=B.useState(!1),[c,u]=B.useState(!0);if(!e||!i||i.length===0)return null;let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=()=>l(_a),t[2]=o):o=t[2];let d;t[3]!==r||t[4]!==i?(d=s.jsx("div",{className:"absolute top-2 right-2 z-10 hidden w-72 @[1280px]:block",children:s.jsx(yt,{variant:"card",outputs:i,collapsed:r,onToggle:o})}),t[3]=r,t[4]=i,t[5]=d):d=t[5];let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(Ta),t[6]=f):f=t[6];let m;t[7]!==c||t[8]!==i?(m=s.jsx("div",{className:"shrink-0 @[1280px]:hidden",children:s.jsx(yt,{variant:"bar",outputs:i,collapsed:c,onToggle:f})}),t[7]=c,t[8]=i,t[9]=m):m=t[9];let h;return t[10]!==d||t[11]!==m?(h=s.jsxs(s.Fragment,{children:[d,m]}),t[10]=d,t[11]=m,t[12]=h):h=t[12],h}function Ta(t){return!t}function _a(t){return!t}function wa(){const t=$.c(31),{org:e}=le(),n=ze(),{isChatEmpty:a}=$t(),[i,r]=B.useState("chat"),l=Ks(),c=sa(),{runtime:u}=Et(n?.virtualMcpId);if(c&&u!=="cms"){let _;return t[0]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(ee,{className:"animate-in fade-in-0 duration-200",children:s.jsx(ee.Main,{className:"flex flex-col items-center",children:s.jsx(ee.EmptyState,{children:s.jsx(ee.NoAiProviderEmptyState,{})})})}),t[0]=_):_=t[0],_}let d;t[1]!==l.hasDecoKey||t[2]!==l.hasOnlyDecoProvider||t[3]!==l.isLoading||t[4]!==l.isZeroBalance||t[5]!==a||t[6]!==e?(d=l.hasDecoKey&&l.isZeroBalance&&l.hasOnlyDecoProvider&&!l.isLoading&&a&&!ys(e.id),t[1]=l.hasDecoKey,t[2]=l.hasOnlyDecoProvider,t[3]=l.isLoading,t[4]=l.isZeroBalance,t[5]=a,t[6]=e,t[7]=d):d=t[7];const f=d;let m;t[8]!==f?(m=f&&s.jsx(ee.CreditsEmptyState,{}),t[8]=f,t[9]=m):m=t[9];const h=i!=="chat"?!0:void 0,g=i!=="chat",j=i!=="chat"?"opacity-0 pointer-events-none":"opacity-100";let b;t[10]!==j?(b=Y("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",j),t[10]=j,t[11]=b):b=t[11];let x;t[12]!==a||t[13]!==u?(x=a&&u!=="cms"?s.jsx(ka,{onOpenContextPanel:()=>r("context")}):s.jsxs(s.Fragment,{children:[s.jsxs(ee.Main,{className:"relative flex flex-col overflow-hidden @container",children:[s.jsx(Sa,{}),s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(ee.Messages,{})})]}),s.jsx(ee.Footer,{children:s.jsx(ee.Input,{onOpenContextPanel:()=>r("context")})})]}),t[12]=a,t[13]=u,t[14]=x):x=t[14];let v;t[15]!==h||t[16]!==g||t[17]!==b||t[18]!==x?(v=s.jsx("div",{inert:h,"aria-hidden":g,className:b,children:x}),t[15]=h,t[16]=g,t[17]=b,t[18]=x,t[19]=v):v=t[19];const k=i!=="context"?!0:void 0,y=i!=="context",p=i==="context"?"opacity-100":"opacity-0 pointer-events-none";let T;t[20]!==p?(T=Y("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",p),t[20]=p,t[21]=T):T=t[21];let N;t[22]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(da,{back:!0,onClose:()=>r("chat")}),t[22]=N):N=t[22];let S;t[23]!==T||t[24]!==k||t[25]!==y?(S=s.jsx("div",{inert:k,"aria-hidden":y,className:T,children:N}),t[23]=T,t[24]=k,t[25]=y,t[26]=S):S=t[26];let w;return t[27]!==m||t[28]!==S||t[29]!==v?(w=s.jsxs(ee,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[m,v,S]}),t[27]=m,t[28]=S,t[29]=v,t[30]=w):w=t[30],w}function Ca(){const t=$.c(7),e=U();let n;t[0]!==e?(n=e("agentShellLayout.agentShellLayout.chatLoadingError"),t[0]=e,t[1]=n):n=t[1];let a;t[2]!==n?(a=s.jsx("div",{role:"alert",className:"flex h-full flex-1 items-center justify-center text-sm text-muted-foreground",children:n}),t[2]=n,t[3]=a):a=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Fe,{children:s.jsx(wa,{})}),t[4]=i):i=t[4];let r;return t[5]!==a?(r=s.jsx(Ct,{fallback:a,children:i}),t[5]=a,t[6]=r):r=t[6],r}function Pa(t){const e=$.c(10),{org:n}=le(),a=sn(),{data:i}=Re.useSession(),r=i?.user?.id,l=t?.id??null,c=!!t&&!!r&&!!t.created_by&&t.created_by!==r;let u;e[0]!==n.id||e[1]!==l?(u=Pt.viewedThreadMetadataRefresh(n.id,l??""),e[0]=n.id,e[1]=l,e[2]=u):u=e[2];const o=!!a&&!!l&&c;let d;e[3]!==a||e[4]!==l?(d=async()=>(await a?.refreshThreadMetadata(l??""),!0),e[3]=a,e[4]=l,e[5]=d):d=e[5];let f;e[6]!==u||e[7]!==o||e[8]!==d?(f={queryKey:u,enabled:o,staleTime:Number.POSITIVE_INFINITY,queryFn:d},e[6]=u,e[7]=o,e[8]=d,e[9]=f):f=e[9],nt(f)}function Ze(t){const e=$.c(13),{label:n,value:a,onChange:i,options:r}=t;let l;e[0]!==n?(l=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=l):l=e[1];let c;e[2]!==i?(c=f=>f&&i(f),e[2]=i,e[3]=c):c=e[3];let u;e[4]!==r?(u=r.map(Aa),e[4]=r,e[5]=u):u=e[5];let o;e[6]!==c||e[7]!==u||e[8]!==a?(o=s.jsx(bn,{type:"single",size:"sm",value:a,onValueChange:c,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:u}),e[6]=c,e[7]=u,e[8]=a,e[9]=o):o=e[9];let d;return e[10]!==l||e[11]!==o?(d=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l,o]}),e[10]=l,e[11]=o,e[12]=d):d=e[12],d}function Aa(t){return s.jsxs(gn,{value:t.value,className:"h-6 gap-1.5 classic:rounded-md compact:rounded-lg 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 Ia(t){const e=$.c(91),{panel:n,className:a}=t,i=a===void 0?"md:size-[34px]":a,r=U();let l;e[0]!==r?(l=r("sidebar.taskGroupsList.filterChats"),e[0]=r,e[1]=l):l=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(xn,{size:16}),e[2]=c):c=e[2];let u;e[3]!==n.filtersActive?(u=n.filtersActive&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"}),e[3]=n.filtersActive,e[4]=u):u=e[4];let o;e[5]!==i||e[6]!==n.filtersActive||e[7]!==l||e[8]!==u?(o=s.jsx(Te,{asChild:!0,children:s.jsx(Kt,{asChild:!0,children:s.jsxs(De,{"aria-label":l,active:n.filtersActive,className:i,children:[c,u]})})}),e[5]=i,e[6]=n.filtersActive,e[7]=l,e[8]=u,e[9]=o):o=e[9];let d;e[10]!==r?(d=r("sidebar.taskGroupsList.filterChats"),e[10]=r,e[11]=d):d=e[11];let f;e[12]!==d?(f=s.jsx(_e,{side:"bottom",children:d}),e[12]=d,e[13]=f):f=e[13];let m;e[14]!==o||e[15]!==f?(m=s.jsxs(we,{children:[o,f]}),e[14]=o,e[15]=f,e[16]=m):m=e[16];let h;e[17]!==r?(h=r("sidebar.taskGroupsList.filterView"),e[17]=r,e[18]=h):h=e[18];const g=n.groupBy;let j;e[19]!==n?(j=q=>{ce("tasks_panel_group_by_changed",{to_value:q}),n.setGroupBy(q)},e[19]=n,e[20]=j):j=e[20];let b;e[21]!==r?(b=r("sidebar.taskGroupsList.viewList"),e[21]=r,e[22]=b):b=e[22];let x;e[23]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Is,{size:13}),e[23]=x):x=e[23];let v;e[24]!==b?(v={value:"flat",label:b,icon:x},e[24]=b,e[25]=v):v=e[25];let k;e[26]!==r?(k=r("sidebar.taskGroupsList.viewStatus"),e[26]=r,e[27]=k):k=e[27];let y;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ms,{size:13}),e[28]=y):y=e[28];let p;e[29]!==k?(p={value:"status",label:k,icon:y},e[29]=k,e[30]=p):p=e[30];let T;e[31]!==v||e[32]!==p?(T=[v,p],e[31]=v,e[32]=p,e[33]=T):T=e[33];let N;e[34]!==n.groupBy||e[35]!==j||e[36]!==T||e[37]!==h?(N=s.jsx(Ze,{label:h,value:g,onChange:j,options:T}),e[34]=n.groupBy,e[35]=j,e[36]=T,e[37]=h,e[38]=N):N=e[38];let S;e[39]!==r?(S=r("sidebar.taskGroupsList.filterType"),e[39]=r,e[40]=S):S=e[40];const w=n.typeFilter;let _;e[41]!==n?(_=q=>{ce("tasks_panel_filter_changed",{to_value:q}),n.setTypeFilter(q)},e[41]=n,e[42]=_):_=e[42];let C;e[43]!==r?(C=r("sidebar.taskGroupsList.typeAll"),e[43]=r,e[44]=C):C=e[44];let A;e[45]!==C?(A={value:"all",label:C},e[45]=C,e[46]=A):A=e[46];let P;e[47]!==r?(P=r("sidebar.taskGroupsList.typeChats"),e[47]=r,e[48]=P):P=e[48];let M;e[49]!==P?(M={value:"manual",label:P},e[49]=P,e[50]=M):M=e[50];let I;e[51]!==r?(I=r("sidebar.taskGroupsList.typeAuto"),e[51]=r,e[52]=I):I=e[52];let D;e[53]!==I?(D={value:"automation",label:I},e[53]=I,e[54]=D):D=e[54];let E;e[55]!==A||e[56]!==M||e[57]!==D?(E=[A,M,D],e[55]=A,e[56]=M,e[57]=D,e[58]=E):E=e[58];let F;e[59]!==n.typeFilter||e[60]!==S||e[61]!==_||e[62]!==E?(F=s.jsx(Ze,{label:S,value:w,onChange:_,options:E}),e[59]=n.typeFilter,e[60]=S,e[61]=_,e[62]=E,e[63]=F):F=e[63];let L;e[64]!==r?(L=r("sidebar.taskGroupsList.filterScope"),e[64]=r,e[65]=L):L=e[65];const G=n.showAll?"team":"mine";let O;e[66]!==n?(O=q=>n.setShowAll(q==="team"),e[66]=n,e[67]=O):O=e[67];let K;e[68]!==r?(K=r("sidebar.taskGroupsList.scopeMine"),e[68]=r,e[69]=K):K=e[69];let R;e[70]!==K?(R={value:"mine",label:K},e[70]=K,e[71]=R):R=e[71];let Q;e[72]!==r?(Q=r("sidebar.taskGroupsList.scopeTeam"),e[72]=r,e[73]=Q):Q=e[73];let V;e[74]!==Q?(V={value:"team",label:Q},e[74]=Q,e[75]=V):V=e[75];let W;e[76]!==R||e[77]!==V?(W=[R,V],e[76]=R,e[77]=V,e[78]=W):W=e[78];let Z;e[79]!==L||e[80]!==G||e[81]!==O||e[82]!==W?(Z=s.jsx(Ze,{label:L,value:G,onChange:O,options:W}),e[79]=L,e[80]=G,e[81]=O,e[82]=W,e[83]=Z):Z=e[83];let X;e[84]!==N||e[85]!==F||e[86]!==Z?(X=s.jsxs(Wt,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[N,F,Z]}),e[84]=N,e[85]=F,e[86]=Z,e[87]=X):X=e[87];let H;return e[88]!==X||e[89]!==m?(H=s.jsxs(qt,{children:[m,X]}),e[88]=X,e[89]=m,e[90]=H):H=e[90],H}function Ma(t,e){return t.filter(n=>n.id===e||!!n.trigger_id||un(n))}function La(){const t=$.c(2),e=Rt()??[];let n;return t[0]!==e?(n=a=>{if(!a)return;const i=e.find(r=>r.id===a);return i?zt(i.metadata):void 0},t[0]=e,t[1]=n):n=t[1],n}function $a(t){const e=$.c(9),{virtualMcpId:n,size:a,showAutomationBadge:i}=t,r=a===void 0?"sm":a,l=U();let c;e[0]!==r||e[1]!==n?(c=n?s.jsx(Da,{virtualMcpId:n,size:r}):s.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=c):c=e[2];let u;e[3]!==i||e[4]!==l?(u=i&&s.jsx("span",{"aria-label":l("tasksPanel.mcpAvatar.automationTriggered"),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(Zt,{size:10,className:"text-white"})}),e[3]=i,e[4]=l,e[5]=u):u=e[5];let o;return e[6]!==c||e[7]!==u?(o=s.jsxs("div",{className:"relative shrink-0",children:[c,u]}),e[6]=c,e[7]=u,e[8]=o):o=e[8],o}function Da(t){const e=$.c(6),{virtualMcpId:n,size:a}=t,i=de(n);if(!i){let c;return e[0]!==a?(c=s.jsx(ye,{icon:null,name:"?",size:a}),e[0]=a,e[1]=c):c=e[1],c}const r=i.icon??null;let l;return e[2]!==i.title||e[3]!==a||e[4]!==r?(l=s.jsx(ye,{icon:r,name:i.title,size:a}),e[2]=i.title,e[3]=a,e[4]=r,e[5]=l):l=e[5],l}const kt=["thread"];function Ea(t){const e=$.c(53),{open:n,onOpenChange:a}=t,[i,r]=B.useState(""),{org:l}=le(),{setTaskId:c}=ot(),u=at(),o=U();let d,f,m,h;e[0]!==l.id||e[1]!==i?(h=i.trim(),d=h?20:10,m=nt,f=Pt.globalSearch(l.id,h,d,kt),e[0]=l.id,e[1]=i,e[2]=d,e[3]=f,e[4]=m,e[5]=h):(d=e[2],f=e[3],m=e[4],h=e[5]);let g;e[6]!==d||e[7]!==u||e[8]!==h?(g=async()=>{const L=await u.call("GLOBAL_SEARCH",{query:h,limit:d,types:[...kt]});return{...L,items:L.items.filter(Fa)}},e[6]=d,e[7]=u,e[8]=h,e[9]=g):g=e[9];let j;e[10]!==n||e[11]!==f||e[12]!==g?(j={queryKey:f,enabled:n,queryFn:g,staleTime:1e4},e[10]=n,e[11]=f,e[12]=g,e[13]=j):j=e[13];const{data:b,isFetching:x}=m(j);let v;e[14]!==b?.items?(v=b?.items??[],e[14]=b?.items,e[15]=v):v=e[15];const k=v;let y;e[16]!==a?(y=L=>{L||r(""),a(L)},e[16]=a,e[17]=y):y=e[17];const p=y;let T;e[18]!==p||e[19]!==c?(T=L=>{p(!1),c(L.id,L.virtual_mcp_id??void 0)},e[18]=p,e[19]=c,e[20]=T):T=e[20];const N=T;let S;e[21]!==o?(S=o("tasksPanel.globalSearchDialog.title"),e[21]=o,e[22]=S):S=e[22];let w;e[23]!==S?(w=s.jsx(kn,{children:S}),e[23]=S,e[24]=w):w=e[24];let _;e[25]!==o?(_=o("tasksPanel.globalSearchDialog.description"),e[25]=o,e[26]=_):_=e[26];let C;e[27]!==_?(C=s.jsx(Nn,{children:_}),e[27]=_,e[28]=C):C=e[28];let A;e[29]!==C||e[30]!==w?(A=s.jsxs(Sn,{className:"sr-only",children:[w,C]}),e[29]=C,e[30]=w,e[31]=A):A=e[31];let P;e[32]!==o?(P=o("tasksPanel.globalSearchDialog.placeholder"),e[32]=o,e[33]=P):P=e[33];let M;e[34]!==i||e[35]!==P?(M=s.jsx(In,{value:i,onValueChange:r,placeholder:P}),e[34]=i,e[35]=P,e[36]=M):M=e[36];let I;e[37]!==N||e[38]!==x||e[39]!==k||e[40]!==o||e[41]!==h?(I=s.jsx(wn,{children:x&&k.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:o("tasksPanel.globalSearchDialog.searching")}):k.length===0?s.jsx(Cn,{children:o("tasksPanel.globalSearchDialog.noResults")}):s.jsx(Pn,{heading:h?void 0:o("tasksPanel.globalSearchDialog.recent"),children:k.map(L=>L.type==="thread"?s.jsxs(An,{value:`thread:${L.id}:${L.title}`,onSelect:()=>N(L),className:"gap-2.5",children:[s.jsx($a,{virtualMcpId:L.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:L.title||o("tasksPanel.globalSearchDialog.untitledChat")})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(L.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${L.id}`):null)})}),e[37]=N,e[38]=x,e[39]=k,e[40]=o,e[41]=h,e[42]=I):I=e[42];let D;e[43]!==M||e[44]!==I?(D=s.jsxs(Mn,{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:[M,I]}),e[43]=M,e[44]=I,e[45]=D):D=e[45];let E;e[46]!==A||e[47]!==D?(E=s.jsxs(Tn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[A,D]}),e[46]=A,e[47]=D,e[48]=E):E=e[48];let F;return e[49]!==p||e[50]!==n||e[51]!==E?(F=s.jsx(_n,{open:n,onOpenChange:p,children:E}),e[49]=p,e[50]=n,e[51]=E,e[52]=F):F=e[52],F}function Fa(t){return t.type==="thread"}function Ra(t){const e=$.c(43),{branch:n,onOutcome:a}=t,i=U();let r;e[0]!==a?(r=N=>{N||a("cancel")},e[0]=a,e[1]=r):r=e[1];let l;e[2]!==i?(l=i("sidebar.archiveWorktreeDialog.title"),e[2]=i,e[3]=l):l=e[3];let c;e[4]!==l?(c=s.jsx(Ln,{children:l}),e[4]=l,e[5]=c):c=e[5];let u;e[6]!==i?(u=i("sidebar.archiveWorktreeDialog.stopsAndDeletesBefore"),e[6]=i,e[7]=u):u=e[7];let o;e[8]!==n?(o=s.jsx("span",{className:"font-mono",children:n}),e[8]=n,e[9]=o):o=e[9];let d;e[10]!==i?(d=i("sidebar.archiveWorktreeDialog.stopsAndDeletesAfter"),e[10]=i,e[11]=d):d=e[11];let f;e[12]!==u||e[13]!==o||e[14]!==d?(f=s.jsxs($n,{children:[u," ",o," ",d]}),e[12]=u,e[13]=o,e[14]=d,e[15]=f):f=e[15];let m;e[16]!==c||e[17]!==f?(m=s.jsxs(Dn,{children:[c,f]}),e[16]=c,e[17]=f,e[18]=m):m=e[18];let h;e[19]!==a?(h=()=>a("cancel"),e[19]=a,e[20]=h):h=e[20];let g;e[21]!==i?(g=i("sidebar.archiveWorktreeDialog.cancel"),e[21]=i,e[22]=g):g=e[22];let j;e[23]!==g||e[24]!==h?(j=s.jsx(En,{onClick:h,children:g}),e[23]=g,e[24]=h,e[25]=j):j=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=Y(ls({variant:"destructive"})),e[26]=b):b=e[26];let x;e[27]!==a?(x=()=>a("confirm"),e[27]=a,e[28]=x):x=e[28];let v;e[29]!==i?(v=i("sidebar.archiveWorktreeDialog.confirm"),e[29]=i,e[30]=v):v=e[30];let k;e[31]!==x||e[32]!==v?(k=s.jsx(Fn,{className:b,onClick:x,children:v}),e[31]=x,e[32]=v,e[33]=k):k=e[33];let y;e[34]!==j||e[35]!==k?(y=s.jsxs(Rn,{children:[j,k]}),e[34]=j,e[35]=k,e[36]=y):y=e[36];let p;e[37]!==y||e[38]!==m?(p=s.jsxs(Bn,{children:[m,y]}),e[37]=y,e[38]=m,e[39]=p):p=e[39];let T;return e[40]!==r||e[41]!==p?(T=s.jsx(On,{open:!0,onOpenChange:r,children:p}),e[40]=r,e[41]=p,e[42]=T):T=e[42],T}function Ba(t,e,n){if(!n)return;const a=t.findIndex(i=>i.id===e);if(a!==-1){for(let i=a+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=a-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Oa(t){return t==="ephemeral"||t.startsWith("thread:")}function es(t){const e=$.c(45),{task:n,isActive:a,onClick:i,onArchive:r,showAutomationBadge:l,showAgentIcon:c,hideStatusIdle:u,indented:o}=t,d=U(),f=zn(n.status),m=f.icon,h=n.metadata?.kind==="tool_call_run",g=de(h?void 0:n.virtual_mcp_id);let j;e[0]!==g?(j=Ut(g),e[0]=g,e[1]=j):j=e[1];const b=j;Hs(6e4);const x=l||!!n.trigger_id,v=n.id,k="button",y=0;let p;e[2]!==i?(p=O=>{O.target===O.currentTarget&&(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),i())},e[2]=i,e[3]=p):p=e[3];const T=o?"-ml-4 pl-6":"pl-[9px]",N=a?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==T||e[5]!==N?(S=Y("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",T,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=T,e[5]=N,e[6]=S):S=e[6];let w;e[7]!==h||e[8]!==c||e[9]!==g?.icon||e[10]!==g?.title?(w=c&&!h&&s.jsx(ye,{icon:g?.icon??null,name:g?.title??"?",size:"2xs"}),e[7]=h,e[8]=c,e[9]=g?.icon,e[10]=g?.title,e[11]=w):w=e[11];let _;e[12]!==x||e[13]!==d?(_=x&&s.jsx(Zt,{size:12,"aria-label":d("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-blue-500"}),e[12]=x,e[13]=d,e[14]=_):_=e[14];let C;e[15]!==d||e[16]!==n.title?(C=n.title||d("tasksPanel.taskRow.untitledTask"),e[15]=d,e[16]=n.title,e[17]=C):C=e[17];let A;e[18]!==C?(A=s.jsx("div",{className:"text-sm text-foreground truncate",children:C}),e[18]=C,e[19]=A):A=e[19];let P;e[20]!==_||e[21]!==A?(P=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[_,A]}),e[20]=_,e[21]=A,e[22]=P):P=e[22];let M;e[23]!==b||e[24]!==a||e[25]!==n.branch||e[26]!==n.updated_at?(M=n.updated_at&&s.jsxs("div",{className:Y("flex items-center gap-1 text-[11px] min-w-0",a?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Oa(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):b?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[b.owner,"/",b.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Hn(new Date(n.updated_at))})]}),e[23]=b,e[24]=a,e[25]=n.branch,e[26]=n.updated_at,e[27]=M):M=e[27];let I;e[28]!==P||e[29]!==M?(I=s.jsxs("div",{className:"flex-1 min-w-0",children:[P,M]}),e[28]=P,e[29]=M,e[30]=I):I=e[30];const D="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",E=!u&&s.jsx("span",{className:Y("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":d("tasksPanel.taskRow.statusLabel",{status:d(f.labelKey)}),children:n.status==="in_progress"?s.jsx(je,{className:Y("size-3.5",f.iconClassName)}):s.jsx(m,{size:14,className:f.iconClassName})});let F;e[31]!==r||e[32]!==d?(F=r&&s.jsxs(we,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":d("tasksPanel.taskRow.archiveTask"),onClick:O=>{O.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-8 items-center justify-center classic:rounded-md compact:rounded-lg 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(os,{size:14})})}),s.jsx(_e,{side:"right",children:d("tasksPanel.taskRow.archive")})]}),e[31]=r,e[32]=d,e[33]=F):F=e[33];let L;e[34]!==E||e[35]!==F?(L=s.jsxs("div",{className:D,children:[E,F]}),e[34]=E,e[35]=F,e[36]=L):L=e[36];let G;return e[37]!==i||e[38]!==I||e[39]!==L||e[40]!==p||e[41]!==S||e[42]!==w||e[43]!==n.id?(G=s.jsxs("div",{"data-task-id":v,role:k,tabIndex:y,onClick:i,onKeyDown:p,className:S,children:[w,I,L]}),e[37]=i,e[38]=I,e[39]=L,e[40]=p,e[41]=S,e[42]=w,e[43]=n.id,e[44]=G):G=e[44],G}const Nt=["requires_action","in_progress","failed","expired","completed"];function za(t){const e=new Map(Nt.map(n=>[n,[]]));for(const n of t){const a=n.status??"completed";(e.get(a)??e.get("completed")).push(n)}return Nt.map(n=>({status:n,threads:e.get(n)}))}const Ga="sidebar.group.expanded.";function Ha(t,e){const n=$.c(3),[a,i]=At(`${Ga}${t}`,e);let r;return n[0]!==a||n[1]!==i?(r=[a,i],n[0]=a,n[1]=i,n[2]=r):r=n[2],r}function ts(t){const e=$.c(18),{onClick:n,isFetching:a,indented:i}=t,r=U();let l;e[0]!==r?(l=r("sidebar.showMoreButton.ariaLabel"),e[0]=r,e[1]=l):l=e[1];const c=i?"-ml-4 pl-6 pr-2":"px-2";let u;e[2]!==c?(u=Y("flex items-center gap-2 py-1.5 classic:rounded-md compact:rounded-lg text-sm text-muted-foreground",c,"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[2]=c,e[3]=u):u=e[3];let o;e[4]!==a?(o=a&&s.jsx(je,{className:"size-3.5"}),e[4]=a,e[5]=o):o=e[5];let d;e[6]!==a||e[7]!==r?(d=r(a?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=a,e[7]=r,e[8]=d):d=e[8];let f;e[9]!==d?(f=s.jsx("span",{children:d}),e[9]=d,e[10]=f):f=e[10];let m;return e[11]!==a||e[12]!==n||e[13]!==l||e[14]!==u||e[15]!==o||e[16]!==f?(m=s.jsxs("button",{type:"button","aria-label":l,onClick:n,disabled:a,className:u,children:[o,f]}),e[11]=a,e[12]=n,e[13]=l,e[14]=u,e[15]=o,e[16]=f,e[17]=m):m=e[17],m}function Ua(t,e,n,a){return[t,e,n,a.type,a.member,a.currentUserId??""].join("|")}function Va(t){return t.member==="mine"&&!t.currentUserId}const ss=4;let $e=0;const tt=[];function Ka(){for(;$e<ss&&tt.length>0;){const t=tt.shift();t&&t()}}function ns(t){return new Promise((e,n)=>{const a=()=>{$e++,t().then(e,n).finally(()=>{$e--,Ka()})};$e<ss?a():tt.push(a)})}const Ue=10;function St(t,e,n,a,i){const r={hidden:!1};a.member==="mine"&&a.currentUserId&&(r.created_by=a.currentUserId),a.type==="automation"&&(r.has_trigger=!0),a.type==="manual"&&(r.has_trigger=!1);const l={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return l.status=e,l}function Wa(t,e,n,a){let i=0;for(const r of t)as(r,e,n,a)&&i++;return i}function Xe(t,e,n,a){return Wa(t,e,n,a)}function qa(t,e){return!!(t>=Ue||t===0&&e)}function Tt(t,e){return t<e}function Ya(t,e){return e===!1?!1:e===!0?!0:t}function as(t,e,n,a){return!(t.hidden||(t.status??"completed")!==n||a.member==="mine"&&a.currentUserId&&t.created_by!==a.currentUserId||a.type==="automation"&&!t.trigger_id||a.type==="manual"&&t.trigger_id)}const Ee=new Map,Me=new Map;function Qa(t,e){return e?t>=Ue?!0:null:!1}function _t(t){return Ee.get(t)}function Za(t,e){Ee.set(t,e)}function Xa(t,e,n){const a=Ee.get(t);if(a!==void 0){n(a);return}let i=Me.get(t);i||(i=ns(e).then(r=>(Ee.set(t,r),Me.delete(t),r)).catch(()=>(Me.delete(t),Promise.reject(new Error("group probe failed")))),Me.set(t,i)),i.then(n,()=>n(!1))}function wt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ue,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Ja(t,e,n,a,i){let r=0;for(const l of t)e.has(l.id)||as(l,n,a,i)&&r++;return r}function er(t,e,n,a){const i=$.c(8),{org:r}=le(),l=Ua(r.id,t,e,n);let c;i[0]!==n?(c=Va(n),i[0]=n,i[1]=c):c=i[1];const u=c,[o,d]=B.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});o.identity!==l&&d({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const f=ct(),{threads:m,hasMore:h}=dt(),g=Xe(m,t,e,n),j=qa(g,h),b=Qa(g,h),x=at();if(o.identity===l&&o.serverHasMore===null){const N=b??_t(l);N!==void 0&&d({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:o.probeSubscribedIdentity,serverHasMore:N})}!u&&o.identity===l&&o.serverHasMore===null&&b===null&&_t(l)===void 0&&o.probeSubscribedIdentity!==l&&(d(N=>N.identity===l?{...N,isProbing:!0,probeSubscribedIdentity:l}:N),Xa(l,async()=>{const N=St(t,e,0,n,1),S=await x.call("COLLECTION_THREADS_LIST",N),{totalCount:w}=wt(S),_=Xe(f.threads.get(),t,e,n);return w===void 0?!1:Tt(_,w)},N=>{d(S=>S.identity!==l?S:{...S,isProbing:!1,serverHasMore:N})}));const k=async function(){if(o.isFetching||o.isProbing||u)return;const S=l;d(w=>w.identity===S?{...w,isFetching:!0}:w);try{const w=Xe(m,t,e,n),_=St(t,e,w,n,Ue),C=await ns(()=>x.call("COLLECTION_THREADS_LIST",_)),{items:A,hasMore:P,totalCount:M}=wt(C),I=new Set(m.map(tr)),D=Ja(A,I,t,e,n),E=w;f.mergeThreads(A),d(F=>{if(F.identity!==S)return F;let L;return M!==void 0?L=Tt(E+D,M):L=A.length===0||D===0?!1:P,Za(S,L),{...F,isFetching:!1,serverHasMore:L}})}catch(w){const _=w,C=_ instanceof Error?_.message:String(_);It.error(`Could not load more tasks: ${C}`),d(A=>A.identity===S?{...A,isFetching:!1}:A)}},y=o.isFetching||o.isProbing,p=!u&&!y&&Ya(j,o.serverHasMore);let T;return i[2]!==y||i[3]!==k||i[4]!==p||i[5]!==o.isProbing||i[6]!==o.serverHasMore?(T={hasMore:p,isFetching:y,isProbing:o.isProbing,serverHasMore:o.serverHasMore,loadMore:k},i[2]=y,i[3]=k,i[4]=p,i[5]=o.isProbing,i[6]=o.serverHasMore,i[7]=T):T=i[7],T}function tr(t){return t.id}function sr(t){const e=$.c(20),{status:n,threads:a,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:c,filters:u}=t,{isFetching:o,isProbing:d,loadMore:f,hasMore:m,serverHasMore:h}=er("status",n,u),[g,j]=B.useState(!1);!g&&a.length===0&&h===!0&&!o&&!d&&(j(!0),queueMicrotask(()=>{f()}));let b;if(e[0]!==i||e[1]!==c||e[2]!==u||e[3]!==l||e[4]!==r||e[5]!==a){let k;e[7]!==i||e[8]!==c||e[9]!==u||e[10]!==l||e[11]!==r?(k=y=>s.jsx(es,{task:y,isActive:i===y.id,onClick:()=>r(y),onArchive:c&&y.created_by===u.currentUserId?()=>l(y):void 0,showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[7]=i,e[8]=c,e[9]=u,e[10]=l,e[11]=r,e[12]=k):k=e[12],b=a.map(k),e[0]=i,e[1]=c,e[2]=u,e[3]=l,e[4]=r,e[5]=a,e[6]=b}else b=e[6];let x;e[13]!==m||e[14]!==o||e[15]!==f?(x=(m||o)&&s.jsx(ts,{onClick:()=>{f()},isFetching:o,indented:!0}),e[13]=m,e[14]=o,e[15]=f,e[16]=x):x=e[16];let v;return e[17]!==b||e[18]!==x?(v=s.jsxs(s.Fragment,{children:[b,x]}),e[17]=b,e[18]=x,e[19]=v):v=e[19],v}function nr(t){const e=$.c(39),{status:n,threads:a,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:c,filters:u}=t,o=U(),d=Gn[n],f=d.icon,[m,h]=Ha(`status-${n}`,!1);let g;e[0]!==m||e[1]!==h?(g=function(){h(!m)},e[0]=m,e[1]=h,e[2]=g):g=e[2];const j=g;let b;e[3]!==j?(b=_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),j())},e[3]=j,e[4]=b):b=e[4];let x;e[5]!==f||e[6]!==d.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(f,{size:12,className:d.iconClassName})}),e[5]=f,e[6]=d.iconClassName,e[7]=x):x=e[7];let v;e[8]!==m?(v=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:m?s.jsx(lt,{size:14}):s.jsx(cs,{size:14})}),e[8]=m,e[9]=v):v=e[9];let k;e[10]!==x||e[11]!==v?(k=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,v]}),e[10]=x,e[11]=v,e[12]=k):k=e[12];let y;e[13]!==d.labelKey||e[14]!==o?(y=o(d.labelKey),e[13]=d.labelKey,e[14]=o,e[15]=y):y=e[15];let p;e[16]!==y?(p=s.jsx("span",{className:"flex-1 truncate",children:y}),e[16]=y,e[17]=p):p=e[17];let T;e[18]!==a.length?(T=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:a.length})}),e[18]=a.length,e[19]=T):T=e[19];let N;e[20]!==m||e[21]!==j||e[22]!==b||e[23]!==k||e[24]!==p||e[25]!==T?(N=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,onClick:j,onKeyDown:b,className:"group/group flex items-center gap-2 px-2 py-1.5 classic:rounded-md compact:rounded-lg 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:[k,p,T]}),e[20]=m,e[21]=j,e[22]=b,e[23]=k,e[24]=p,e[25]=T,e[26]=N):N=e[26];let S;e[27]!==i||e[28]!==c||e[29]!==m||e[30]!==u||e[31]!==l||e[32]!==r||e[33]!==n||e[34]!==a?(S=m&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(sr,{status:n,threads:a,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:c,filters:u})}),e[27]=i,e[28]=c,e[29]=m,e[30]=u,e[31]=l,e[32]=r,e[33]=n,e[34]=a,e[35]=S):S=e[35];let w;return e[36]!==S||e[37]!==N?(w=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[N,S]}),e[36]=S,e[37]=N,e[38]=w):w=e[38],w}function ar(t){const e=$.c(38),{threads:n,groupBy:a,activeTaskId:i,onSelectTask:r,onArchiveTask:l,filters:c,hasMore:u,isFetchingMore:o,onLoadMore:d,filtersActive:f}=t;if(n.length===0&&!u&&!o){let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ls,{className:"size-6 opacity-60"}),e[0]=b):b=e[0];const x=f?"No chats match your filters":"No chats yet";let v;return e[1]!==x?(v=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[b,s.jsx("p",{className:"text-sm",children:x})]}),e[1]=x,e[2]=v):v=e[2],v}const m=n.length>1||u;if(a==="status"){let b;if(e[3]!==i||e[4]!==m||e[5]!==c||e[6]!==l||e[7]!==r||e[8]!==n){let v;e[10]!==i||e[11]!==m||e[12]!==c||e[13]!==l||e[14]!==r?(v=k=>s.jsx(nr,{status:k.status,threads:k.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:m,filters:c},k.status),e[10]=i,e[11]=m,e[12]=c,e[13]=l,e[14]=r,e[15]=v):v=e[15],b=za(n).map(v),e[3]=i,e[4]=m,e[5]=c,e[6]=l,e[7]=r,e[8]=n,e[9]=b}else b=e[9];let x;return e[16]!==b?(x=s.jsx(s.Fragment,{children:b}),e[16]=b,e[17]=x):x=e[17],x}let h;if(e[18]!==i||e[19]!==m||e[20]!==c||e[21]!==l||e[22]!==r||e[23]!==n){let b;e[25]!==i||e[26]!==m||e[27]!==c||e[28]!==l||e[29]!==r?(b=x=>s.jsx(es,{task:x,isActive:i===x.id,onClick:()=>r(x),onArchive:m&&x.created_by===c.currentUserId?()=>l(x):void 0,showAutomationBadge:!!x.trigger_id,showAgentIcon:!0},x.id),e[25]=i,e[26]=m,e[27]=c,e[28]=l,e[29]=r,e[30]=b):b=e[30],h=n.map(b),e[18]=i,e[19]=m,e[20]=c,e[21]=l,e[22]=r,e[23]=n,e[24]=h}else h=e[24];let g;e[31]!==u||e[32]!==o||e[33]!==d?(g=(u||o)&&s.jsx(ts,{onClick:d,isFetching:o}),e[31]=u,e[32]=o,e[33]=d,e[34]=g):g=e[34];let j;return e[35]!==h||e[36]!==g?(j=s.jsxs(s.Fragment,{children:[h,g]}),e[35]=h,e[36]=g,e[37]=j):j=e[37],j}function rr(t,e){return null}function ir(t,e){return t.some(n=>n.id!==e.taskId&&!n.hidden&&n.branch===e.branch&&n.virtual_mcp_id===e.virtualMcpId)}const lr=["archive","reclaim-worktree"],or=[];function cr(t){return t==="confirm"?lr:or}function dr(t){const e=$.c(11),{panel:n}=t;let a;return e[0]!==n.activeTaskId||e[1]!==n.archiveTask||e[2]!==n.filters||e[3]!==n.filtersActive||e[4]!==n.groupBy||e[5]!==n.hasMore||e[6]!==n.isFetchingMore||e[7]!==n.loadMore||e[8]!==n.selectTask||e[9]!==n.threads?(a=s.jsx(ar,{threads:n.threads,groupBy:n.groupBy,activeTaskId:n.activeTaskId,onSelectTask:n.selectTask,onArchiveTask:n.archiveTask,filters:n.filters,hasMore:n.hasMore,isFetchingMore:n.isFetchingMore,onLoadMore:n.loadMore,filtersActive:n.filtersActive}),e[0]=n.activeTaskId,e[1]=n.archiveTask,e[2]=n.filters,e[3]=n.filtersActive,e[4]=n.groupBy,e[5]=n.hasMore,e[6]=n.isFetchingMore,e[7]=n.loadMore,e[8]=n.selectTask,e[9]=n.threads,e[10]=a):a=e[10],a}function ur(t){const e=$.c(83);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:a}=n,i=U(),{data:r}=Re.useSession(),l=r?.user?.id,{org:c}=le();let u;e[2]!==c.id?(u=Ne(c.id),e[2]=c.id,e[3]=u):u=e[3];const o=u.id,d=La(),{threads:f,hasMore:m,isFetchingMore:h,fetchNextPage:g}=dt(),j=f.filter(pr),{hide:b,setScope:x}=ut(),v=Be(),k=at(),{setTaskId:y,createNewTask:p}=ot(),T=Yt(),N=He();let S;e[4]!==N||e[5]!==f||e[6]!==T?(S=vn({routeAgentId:T,threadVirtualMcpId:f.find(z=>z.id===N)?.virtual_mcp_id}),e[4]=N,e[5]=f,e[6]=T,e[7]=S):S=e[7];const w=S;let _;e[8]!==a?(_=()=>{a?.()},e[8]=a,e[9]=_):_=e[9];const C=_,A=[...j].sort(hr),[P,M]=B.useState("all"),[I,D]=B.useState("flat"),[E,F]=At("sidebar-threads-scope-all",!1),[L,G]=B.useState(!1),[O,K]=B.useState(!1);let R;e[10]!==G?(R=()=>{ce("tasks_panel_search_opened"),K(!0),G(!0)},e[10]=G,e[11]=R):R=e[11];const Q=R,[V,W]=B.useState(null),Z=l??null;let X;e[12]!==Z||e[13]!==P?(X={type:P,member:"mine",currentUserId:Z},e[12]=Z,e[13]=P,e[14]=X):X=e[14];const H=X,q={};E||(q.created_by="me"),x(q);let ae;e[15]!==l?(ae=z=>l?z.filter(ne=>ne.created_by===l):[],e[15]=l,e[16]=ae):ae=e[16];const ie=ae;let J;e[17]!==P?(J=z=>P==="automation"?z.filter(fr):P==="manual"?z.filter(mr):z,e[17]=P,e[18]=J):J=e[18];const oe=J,te=Ma(oe(E?A:ie(A)),N);let se;e[19]!==N||e[20]!==C||e[21]!==l||e[22]!==b||e[23]!==v||e[24]!==c.slug||e[25]!==y||e[26]!==te?(se=z=>{const ne=z.id===N,xe=b(z.id);if(Ws(z.id),!ne)return xe;const be=Ba(te,z.id,l);return C(),be?y(be.id,be.virtual_mcp_id):v({to:"/$org",params:{org:c.slug}}),xe},e[19]=N,e[20]=C,e[21]=l,e[22]=b,e[23]=v,e[24]=c.slug,e[25]=y,e[26]=te,e[27]=se):se=e[27];const re=se;let ue;e[28]!==k||e[29]!==i?(ue=async z=>{try{await k.call("SANDBOX_DELETE",{virtualMcpId:z.virtualMcpId,branch:z.branch,removeWorktree:!0})}catch{It.error(i("sidebar.archiveWorktreeDialog.reclaimFailed",{branch:z.branch}))}},e[28]=k,e[29]=i,e[30]=ue):ue=e[30];const ge=ue;let me;e[31]!==f||e[32]!==re||e[33]!==l||e[34]!==W?(me=z=>{if(l&&z.created_by&&z.created_by!==l)return;const ne=rr();if(!ne||ir(f,ne)){re(z);return}W({task:z,target:ne})},e[31]=f,e[32]=re,e[33]=l,e[34]=W,e[35]=me):me=e[35];const Ve=me;let Ce;e[36]!==re||e[37]!==V||e[38]!==ge||e[39]!==W?(Ce=z=>{const ne=V;ne&&(W(null),(async()=>{for(const xe of cr(z))if(xe==="archive")try{await re(ne.task)}catch{return}else await ge(ne.target)})())},e[36]=re,e[37]=V,e[38]=ge,e[39]=W,e[40]=Ce):Ce=e[40];const Ke=Ce;let Pe;e[41]!==C||e[42]!==y?(Pe=z=>{C(),y(z.id,z.virtual_mcp_id)},e[41]=C,e[42]=y,e[43]=Pe):Pe=e[43];const We=Pe;let Ae;e[44]!==w||e[45]!==N||e[46]!==f||e[47]!==C||e[48]!==p||e[49]!==l||e[50]!==o||e[51]!==d||e[52]!==y?(Ae=()=>{const z=w??o;ce("sidebar_new_thread_clicked",{virtual_mcp_id:z}),C();const ne=nn(f,z,l,d(z));if(ne){y(ne.id,ne.virtual_mcp_id);return}const xe=f.find(be=>be.id===N)?.branch??null;p(z,xe)},e[44]=w,e[45]=N,e[46]=f,e[47]=C,e[48]=p,e[49]=l,e[50]=o,e[51]=d,e[52]=y,e[53]=Ae):Ae=e[53];const qe=Ae;let fe;e[54]!==g?(fe=()=>{g()},e[54]=g,e[55]=fe):fe=e[55];const Ye=I!=="flat"||P!=="all"||E;let he;e[56]!==Ke||e[57]!==V?(he=V?s.jsx(Ra,{branch:V.target.branch,onOutcome:Ke}):null,e[56]=Ke,e[57]=V,e[58]=he):he=e[58];let pe;e[59]!==O||e[60]!==L||e[61]!==G?(pe=O?s.jsx(Ea,{open:L,onOpenChange:G}):null,e[59]=O,e[60]=L,e[61]=G,e[62]=pe):pe=e[62];let Ie;return e[63]!==N||e[64]!==Ve||e[65]!==H||e[66]!==I||e[67]!==m||e[68]!==h||e[69]!==qe||e[70]!==Q||e[71]!==We||e[72]!==D||e[73]!==F||e[74]!==M||e[75]!==E||e[76]!==fe||e[77]!==Ye||e[78]!==he||e[79]!==pe||e[80]!==P||e[81]!==te?(Ie={threads:te,activeTaskId:N,filters:H,hasMore:m,isFetchingMore:h,loadMore:fe,groupBy:I,setGroupBy:D,typeFilter:P,setTypeFilter:M,showAll:E,setShowAll:F,filtersActive:Ye,selectTask:We,archiveTask:Ve,newThread:qe,openSearch:Q,reclaimDialog:he,searchDialog:pe},e[63]=N,e[64]=Ve,e[65]=H,e[66]=I,e[67]=m,e[68]=h,e[69]=qe,e[70]=Q,e[71]=We,e[72]=D,e[73]=F,e[74]=M,e[75]=E,e[76]=fe,e[77]=Ye,e[78]=he,e[79]=pe,e[80]=P,e[81]=te,e[82]=Ie):Ie=e[82],Ie}function mr(t){return!t.trigger_id}function fr(t){return!!t.trigger_id}function hr(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function pr(t){return!t.hidden}function xr(){const t=$.c(60),e=U(),[n,a]=B.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={onNavigate:()=>a(!1)},t[0]=i):i=t[0];const r=ur(i),l=ze()?.activeTask;let c;t[1]!==l?.title||t[2]!==r.activeTaskId||t[3]!==r.threads||t[4]!==e?(c=l?.title||r.threads.find(F=>F.id===r.activeTaskId)?.title||e("tasksPanel.taskRow.untitledTask"),t[1]=l?.title,t[2]=r.activeTaskId,t[3]=r.threads,t[4]=e,t[5]=c):c=t[5];const u=c;let o;t[6]!==r?(o=()=>{a(!1),r.openSearch()},t[6]=r,t[7]=o):o=t[7];const d=o;let f;t[8]!==e?(f=e("chat.threadsMenu.chats"),t[8]=e,t[9]=f):f=t[9];const m=n&&"bg-sidebar-accent";let h;t[10]!==m?(h=Y("flex h-[34px] min-w-0 shrink items-center gap-1.5 rounded-lg px-2 text-sm text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",m),t[10]=m,t[11]=h):h=t[11];let g;t[12]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx($s,{size:16,className:"shrink-0"}),t[12]=g):g=t[12];let j;t[13]!==u?(j=s.jsx("span",{className:"truncate max-w-[10rem] font-medium",children:u}),t[13]=u,t[14]=j):j=t[14];let b;t[15]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(lt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[15]=b):b=t[15];let x;t[16]!==f||t[17]!==h||t[18]!==j?(x=s.jsx(Te,{asChild:!0,children:s.jsx(Kt,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":f,className:h,children:[g,j,b]})})}),t[16]=f,t[17]=h,t[18]=j,t[19]=x):x=t[19];let v;t[20]!==e?(v=e("chat.threadsMenu.chats"),t[20]=e,t[21]=v):v=t[21];let k;t[22]!==v?(k=s.jsx(_e,{side:"bottom",children:v}),t[22]=v,t[23]=k):k=t[23];let y;t[24]!==k||t[25]!==x?(y=s.jsxs(we,{children:[x,k]}),t[24]=k,t[25]=x,t[26]=y):y=t[26];let p;t[27]!==r?(p=s.jsx(Ia,{panel:r,className:"size-8 classic:rounded-lg"}),t[27]=r,t[28]=p):p=t[28];let T;t[29]!==e?(T=e("sidebar.taskGroupsList.searchChats"),t[29]=e,t[30]=T):T=t[30];let N;t[31]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Ds,{size:16}),t[31]=N):N=t[31];let S;t[32]!==d||t[33]!==T?(S=s.jsx(De,{"aria-label":T,onClick:d,className:"size-8 classic:rounded-lg",children:N}),t[32]=d,t[33]=T,t[34]=S):S=t[34];let w;t[35]!==e?(w=e("sidebar.taskGroupsList.newChat"),t[35]=e,t[36]=w):w=t[36];let _;t[37]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ft,{size:16}),t[37]=_):_=t[37];let C;t[38]!==r.newThread||t[39]!==w?(C=s.jsx(De,{"aria-label":w,onClick:r.newThread,className:"size-8 classic:rounded-lg",children:_}),t[38]=r.newThread,t[39]=w,t[40]=C):C=t[40];let A;t[41]!==S||t[42]!==C?(A=s.jsxs("div",{className:"flex items-center gap-0.5",children:[S,C]}),t[41]=S,t[42]=C,t[43]=A):A=t[43];let P;t[44]!==p||t[45]!==A?(P=s.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[p,A]}),t[44]=p,t[45]=A,t[46]=P):P=t[46];let M;t[47]!==r?(M=s.jsx("div",{className:"flex max-h-[60vh] min-h-0 flex-col gap-0.5 overflow-y-auto overscroll-contain",children:s.jsx(dr,{panel:r})}),t[47]=r,t[48]=M):M=t[48];let I;t[49]!==P||t[50]!==M?(I=s.jsxs(Wt,{align:"start",side:"bottom",onOpenAutoFocus:gr,className:"flex w-80 flex-col gap-2 p-2",children:[P,M]}),t[49]=P,t[50]=M,t[51]=I):I=t[51];let D;t[52]!==n||t[53]!==y||t[54]!==I?(D=s.jsxs(qt,{open:n,onOpenChange:a,children:[y,I]}),t[52]=n,t[53]=y,t[54]=I,t[55]=D):D=t[55];let E;return t[56]!==r.reclaimDialog||t[57]!==r.searchDialog||t[58]!==D?(E=s.jsxs(s.Fragment,{children:[D,r.searchDialog,r.reclaimDialog]}),t[56]=r.reclaimDialog,t[57]=r.searchDialog,t[58]=D,t[59]=E):E=t[59],E}function gr(t){return t.preventDefault()}function br(){const t=$.c(20),e=U(),{threads:n}=dt(),{createNewTask:a}=ot(),i=Qt(),r=He();let l;t[0]!==r||t[1]!==n?(l=n.find(b=>b.id===r)?.branch??null,t[0]=r,t[1]=n,t[2]=l):l=t[2];const c=l;let u;t[3]!==i||t[4]!==a||t[5]!==c?(u=()=>{a(i,c)},t[3]=i,t[4]=a,t[5]=c,t[6]=u):u=t[6];const o=u;let d;t[7]!==e?(d=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=d):d=t[8];let f;t[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ft,{size:16}),t[9]=f):f=t[9];let m;t[10]!==o||t[11]!==d?(m=s.jsx(Te,{asChild:!0,children:s.jsx("button",{type:"button",onClick:o,"aria-label":d,className:"flex shrink-0 items-center classic:rounded-md compact:rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:f})}),t[10]=o,t[11]=d,t[12]=m):m=t[12];let h;t[13]!==e?(h=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=h):h=t[14];let g;t[15]!==h?(g=s.jsx(_e,{side:"bottom",children:h}),t[15]=h,t[16]=g):g=t[16];let j;return t[17]!==m||t[18]!==g?(j=s.jsxs(we,{children:[m,g]}),t[17]=m,t[18]=g,t[19]=j):j=t[19],j}function vr(t){const e=$.c(14),{virtualMcp:n}=t,a=U(),i=Rt(),{navigateToTask:r}=ws(),{create:l}=ut();let c,u;if(e[0]!==i||e[1]!==l||e[2]!==r||e[3]!==a||e[4]!==n){u=Symbol.for("react.early_return_sentinel");e:{const o=Qs(n,i);if(!o){u=null;break e}const d=o.mode==="dev";let f;e[7]!==l||e[8]!==r?(f=async x=>{const v=crypto.randomUUID();try{await l({id:v,virtual_mcp_id:x})}catch{}r(v,{virtualMcpId:x})},e[7]=l,e[8]=r,e[9]=f):f=e[9];const m=f,h=(x,v,k)=>s.jsxs("button",{type:"button","aria-pressed":v,"aria-label":x,title:x,onClick:()=>{v||m(o.targetId)},className:Y("inline-flex items-center gap-1.5 px-2.5 py-1 classic:rounded-md compact:rounded-lg transition-colors",v?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[s.jsx(k,{className:"size-3.5 shrink-0"}),s.jsx("span",{className:"@max-3xl/panel-header:hidden",children:x})]});let g;e[10]!==a?(g=a("devAgent.devAgentControl.develop"),e[10]=a,e[11]=g):g=e[11];const j=h(g,d,Es);let b;e[12]!==a?(b=a("devAgent.devAgentControl.live"),e[12]=a,e[13]=b):b=e[13],c=s.jsxs("div",{className:"inline-flex items-center rounded-lg border border-border bg-muted p-0.5 text-xs font-medium",children:[j,h(b,!d,Un)]})}e[0]=i,e[1]=l,e[2]=r,e[3]=a,e[4]=n,e[5]=c,e[6]=u}else c=e[5],u=e[6];return u!==Symbol.for("react.early_return_sentinel")?u:c}function ke(t){const e=$.c(10),{icon:n,className:a}=t,i=a===void 0?"size-4":a;if(n.kind==="component"){const{Component:l}=n;let c;return e[0]!==l||e[1]!==i?(c=s.jsx(l,{className:i}),e[0]=l,e[1]=i,e[2]=c):c=e[2],c}if(n.kind==="url"){const l=n.src;let c;e[3]!==i?(c=Y(i,"rounded-sm object-cover"),e[3]=i,e[4]=c):c=e[4];let u;return e[5]!==n.src||e[6]!==c?(u=s.jsx("img",{src:l,alt:"",className:c}),e[5]=n.src,e[6]=c,e[7]=u):u=e[7],u}let r;return e[8]!==i?(r=s.jsx(Vn,{className:i}),e[8]=i,e[9]=r):r=e[9],r}const jr={sooner:"@max-3xl/panel-header:hidden",later:"@max-xl/panel-header:hidden"};function yr(t){const e=$.c(29),{title:n,icon:a,active:i,onClick:r,disabled:l,locked:c,className:u,testId:o,tooltip:d,labelCollapse:f,showIcon:m}=t,h=l===void 0?!1:l,g=c===void 0?!1:c,j=f===void 0?"later":f,b=m===void 0?!0:m,x=g||void 0;let v;e[0]!==i||e[1]!==u||e[2]!==g?(v=Y("shrink-0 flex items-center gap-1.5 h-7 rounded-md px-2",js(i),"disabled:opacity-40 disabled:pointer-events-none",g&&"pointer-events-none",u),e[0]=i,e[1]=u,e[2]=g,e[3]=v):v=e[3];let k;e[4]!==a||e[5]!==b?(k=b&&s.jsx("span",{className:"flex size-5 items-center justify-center shrink-0",children:s.jsx(ke,{icon:a})}),e[4]=a,e[5]=b,e[6]=k):k=e[6];const y=b&&jr[j];let p;e[7]!==y?(p=Y(y,"whitespace-nowrap text-sm font-medium leading-none"),e[7]=y,e[8]=p):p=e[8];let T;e[9]!==p||e[10]!==n?(T=s.jsx("span",{className:p,children:n}),e[9]=p,e[10]=n,e[11]=T):T=e[11];let N;e[12]!==i||e[13]!==h||e[14]!==r||e[15]!==T||e[16]!==x||e[17]!==v||e[18]!==k||e[19]!==o||e[20]!==n?(N=s.jsxs("button",{type:"button",onClick:r,disabled:h,"data-testid":o,"aria-pressed":i,"aria-disabled":x,"aria-label":n,className:v,children:[k,T]}),e[12]=i,e[13]=h,e[14]=r,e[15]=T,e[16]=x,e[17]=v,e[18]=k,e[19]=o,e[20]=n,e[21]=N):N=e[21];const S=N;let w;e[22]!==S?(w=s.jsx(Te,{asChild:!0,children:S}),e[22]=S,e[23]=w):w=e[23];const _=d??n;let C;e[24]!==_?(C=s.jsx(_e,{side:"bottom",children:_}),e[24]=_,e[25]=C):C=e[25];let A;return e[26]!==w||e[27]!==C?(A=s.jsxs(we,{children:[w,C]}),e[26]=w,e[27]=C,e[28]=A):A=e[28],A}function kr(t){const e=$.c(16),{virtualMcpId:n,taskId:a}=t,{openPanel:i}=mt();let r;e[0]!==a||e[1]!==n?(r={virtualMcpId:n,taskId:a},e[0]=a,e[1]=n,e[2]=r):r=e[2];const{tabs:l,activeTab:c,mainOpen:u}=ft(r);if(l.length===0)return null;let o;if(e[3]!==c||e[4]!==u||e[5]!==i||e[6]!==l||e[7]!==n){let f;e[9]!==c||e[10]!==u||e[11]!==i||e[12]!==n?(f=m=>{const h=m.id==="automations"?Mt({activeTab:c,mainOpen:u}):u&&m.id===c;return s.jsxs(pt.Tab,{active:h,onClick:()=>{h||(ce("main_panel_tab_clicked",{virtual_mcp_id:n,tab_id:m.id,tab_kind:m.kind,was_active:!1}),i(m.id))},children:[s.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:s.jsx(ke,{icon:m.icon})}),m.title]},m.id)},e[9]=c,e[10]=u,e[11]=i,e[12]=n,e[13]=f):f=e[13],o=l.map(f),e[3]=c,e[4]=u,e[5]=i,e[6]=l,e[7]=n,e[8]=o}else o=e[8];let d;return e[14]!==o?(d=s.jsx(pt.Tabs,{"data-tour":Ot.surfaceTabs,children:o}),e[14]=o,e[15]=d):d=e[15],d}function Nr(t){const e=$.c(18),{virtualMcpId:n,taskId:a,disableActiveMainToggle:i}=t,r=i===void 0?!1:i,{openPanel:l,closePanel:c}=mt();let u;e[0]!==a||e[1]!==n?(u={virtualMcpId:n,taskId:a},e[0]=a,e[1]=n,e[2]=u):u=e[2];const{tabs:o,activeTab:d,mainOpen:f,setActiveTab:m}=ft(u);let h,g,j;if(e[3]!==d||e[4]!==c||e[5]!==r||e[6]!==f||e[7]!==l||e[8]!==m||e[9]!==o||e[10]!==n){const x=Mt({activeTab:d,mainOpen:f}),v=p=>p.id==="automations"?x:f&&p.id===d,k=p=>{const T=o.find(S=>S.id===p);if(r&&T&&v(T))return;const N=f&&d===p;if(ce("main_panel_tab_clicked",{virtual_mcp_id:n,tab_id:p,tab_kind:T?.kind??null,was_active:N}),p==="automations"){const S=ds({activeTab:d,mainOpen:f});"close"in S?c():l(S.tabId);return}m(p)},y=o.map(p=>({id:p.id,title:p.title,icon:p.icon,active:v(p),locked:r&&v(p),onSelect:()=>k(p.id),labelCollapse:p.kind==="system"?"sooner":"later"}));h="flex items-center min-w-0 gap-0.5 overflow-x-auto no-scrollbar",g=Ot.surfaceTabs,j=y.map(Sr),e[3]=d,e[4]=c,e[5]=r,e[6]=f,e[7]=l,e[8]=m,e[9]=o,e[10]=n,e[11]=h,e[12]=g,e[13]=j}else h=e[11],g=e[12],j=e[13];let b;return e[14]!==h||e[15]!==g||e[16]!==j?(b=s.jsx("div",{className:h,"data-tour":g,children:j}),e[14]=h,e[15]=g,e[16]=j,e[17]=b):b=e[17],b}function Sr(t){return s.jsx(yr,{title:t.title,icon:t.icon,showIcon:t.id!=="site-editor"&&t.id!=="content",active:t.active,locked:t.locked,onClick:t.onSelect,labelCollapse:t.labelCollapse},t.id)}function Tr(t){const e=$.c(3),n=rt();let a;return e[0]!==n||e[1]!==t?(a=n?s.jsx(kr,{...t}):s.jsx(Nr,{...t}),e[0]=n,e[1]=t,e[2]=a):a=e[2],a}function _r(t){return{threadId:t.routeThreadId,providerKey:t.routeThreadId??t.fallbackKey}}const Je="__mobile-main-panel-tab-select__",st="main";function wr({tabs:t,activeTab:e,mainOpen:n,t:a}){const i=t.find(l=>l.id===e),r=a("mainPanelTabs.mobileMainPanelTabSelect.mainView");return n?i?.title??r:i?.title??t[0]?.title??r}const Cr={kind:"component",Component:Fs},Pr={kind:"component",Component:Bs},Ar={kind:"component",Component:Wn},Ir={kind:"component",Component:Rs};function Mr({tabs:t,overlayEnabled:e,t:n}){return[{value:"chat",title:n("mainPanelTabs.mobileMainPanelTabSelect.chat"),icon:Cr},...t.length>0?t.map(a=>({value:a.id,title:a.title,icon:a.icon})):[{value:st,title:n("mainPanelTabs.mobileMainPanelTabSelect.mainView"),icon:Ir}],...e?[{value:"board",title:n("mainPanelTabs.mobileMainPanelTabSelect.tasks"),icon:Pr},{value:"files",title:n("mainPanelTabs.mobileMainPanelTabSelect.library"),icon:Ar}]:[]]}function rs(t){const e=$.c(53),{virtualMcpId:n,taskId:a}=t,i=U(),r=Be(),{openPanel:l}=mt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const u=Se(c);let o;e[1]!==a||e[2]!==n?(o={virtualMcpId:n,taskId:a},e[1]=a,e[2]=n,e[3]=o):o=e[3];const{tabs:d,activeTab:f,mainOpen:m}=ft(o),{org:h}=le(),g=ks();let j;e[4]!==h.id?(j=xt(h.id),e[4]=h.id,e[5]=j):j=e[5];const b=n===j;let x,v,k,y,p,T,N,S,w,_;if(e[6]!==f||e[7]!==m||e[8]!==r||e[9]!==b||e[10]!==l||e[11]!==h.id||e[12]!==u.org||e[13]!==u.taskId||e[14]!==g||e[15]!==i||e[16]!==d||e[17]!==n){y=Symbol.for("react.early_return_sentinel");e:{const P=Mr({tabs:d,overlayEnabled:!!(u.org&&u.taskId),t:i}),M=m?P.find(R=>R.value===f)?.value??st:"chat",I=P.find(R=>R.value===M),D=I?.title??wr({tabs:d,activeTab:f,mainOpen:m,t:i});let E;e[28]!==r?(E=R=>{r({to:".",search:Q=>({...Q,...mn(R)}),replace:!0})},e[28]=r,e[29]=E):E=e[29];const F=E;let L;e[30]!==b||e[31]!==l||e[32]!==h.id||e[33]!==g||e[34]!==F||e[35]!==n?(L=R=>{if(R!==Je){if(ce("main_panel_tab_clicked",{virtual_mcp_id:n,tab_id:R,source:"mobile_select"}),qs({reportsOnly:g,onReportAgent:b,tabId:R})){l(R,{virtualmcpid:xt(h.id),search:Dr});return}if(R==="chat"||R===st){F(R==="chat"?"chat":"main");return}l(R,{search:$r})}},e[30]=b,e[31]=l,e[32]=h.id,e[33]=g,e[34]=F,e[35]=n,e[36]=L):L=e[36];const G=L,O=P.find(R=>R.value!==M);if(P.length===2&&O){y=s.jsxs("button",{type:"button",onClick:()=>G(O.value),"aria-label":i("mainPanelTabs.mobileMainPanelTabSelect.switchTo",{name:O.title}),className:"flex h-10 min-w-0 max-w-[7.5rem] items-center gap-1.5 classic:rounded-md compact:rounded-lg px-1.5 text-xs text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[s.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:s.jsx(ke,{icon:O.icon,className:"size-5"})}),s.jsx("span",{className:"min-w-0 truncate",children:O.title})]});break e}v=Yn,w=Je,_=G;let K;e[37]!==i?(K=i("mainPanelTabs.mobileMainPanelTabSelect.view"),e[37]=i,e[38]=K):K=e[38],k=s.jsx(qn,{"aria-label":K,className:"h-10! w-full min-w-0 max-w-[7.5rem] classic:rounded-md compact:rounded-lg border-0 bg-transparent px-1.5 text-xs shadow-none [--card-shadow:none]",children:s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[I&&s.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:s.jsx(ke,{icon:I.icon,className:"size-5"})}),s.jsx("span",{className:"min-w-0 truncate",children:D})]})}),x=Qn,p="end",T="w-56",e[39]!==D?(N=s.jsx(Xt,{value:Je,disabled:!0,hideCheck:!0,className:"hidden",children:D}),e[39]=D,e[40]=N):N=e[40],S=P.map(Lr)}e[6]=f,e[7]=m,e[8]=r,e[9]=b,e[10]=l,e[11]=h.id,e[12]=u.org,e[13]=u.taskId,e[14]=g,e[15]=i,e[16]=d,e[17]=n,e[18]=x,e[19]=v,e[20]=k,e[21]=y,e[22]=p,e[23]=T,e[24]=N,e[25]=S,e[26]=w,e[27]=_}else x=e[18],v=e[19],k=e[20],y=e[21],p=e[22],T=e[23],N=e[24],S=e[25],w=e[26],_=e[27];if(y!==Symbol.for("react.early_return_sentinel"))return y;let C;e[41]!==x||e[42]!==p||e[43]!==T||e[44]!==N||e[45]!==S?(C=s.jsxs(x,{align:p,className:T,children:[N,S]}),e[41]=x,e[42]=p,e[43]=T,e[44]=N,e[45]=S,e[46]=C):C=e[46];let A;return e[47]!==v||e[48]!==k||e[49]!==C||e[50]!==w||e[51]!==_?(A=s.jsxs(v,{value:w,onValueChange:_,children:[k,C]}),e[47]=v,e[48]=k,e[49]=C,e[50]=w,e[51]=_,e[52]=A):A=e[52],A}function Lr(t){return s.jsx(Xt,{value:t.value,children:s.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:s.jsx(ke,{icon:t.icon})}),s.jsx("span",{className:"min-w-0 truncate",children:t.title})]})},t.value)}function $r(t){return{...t,sidepanel:!1}}function Dr(t){return{...t,thread:void 0,sidepanel:!1}}function Er(t,e,n){const a=$.c(36),i=ct(),{locator:r}=le(),l=B.useSyncExternalStore(i.threads.subscribe,i.threads.get),c=B.useSyncExternalStore(i.threadsStatus.subscribe,i.threadsStatus.get);let u;a[0]!==t||a[1]!==l?(u=t===null?null:l.find(p=>p.id===t&&!p.partial)??null,a[0]=t,a[1]=l,a[2]=u):u=a[2];const o=u,[d,f]=B.useState(void 0);let m;a[3]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{f(void 0)},a[3]=m):m=a[3];let h;a[4]!==t?(h=[t],a[4]=t,a[5]=h):h=a[5],B.useEffect(m,h);let g,j;a[6]!==d||a[7]!==t||a[8]!==o||a[9]!==i||a[10]!==c.kind?(g=()=>{t!==null&&(o||c.kind!=="loading"&&d===void 0&&(f("pending"),i.fetchThreadIntoSlot(t).then(p=>{f(p)})))},j=[t,o,c.kind,d,i],a[6]=d,a[7]=t,a[8]=o,a[9]=i,a[10]=c.kind,a[11]=g,a[12]=j):(g=a[11],j=a[12]),B.useEffect(g,j);let b;a[13]!==n||a[14]!==r||a[15]!==i||a[16]!==e?(b={mutationFn:async p=>i.create({id:p,virtual_mcp_id:e,...n?{branch:n}:{},...tn(sessionStorage,r,p)})},a[13]=n,a[14]=r,a[15]=i,a[16]=e,a[17]=b):b=a[17];const x=us(b);let v,k;if(a[18]!==x||a[19]!==d||a[20]!==t||a[21]!==o||a[22]!==c.kind?(v=()=>{t!==null&&(o||d===null&&c.kind!=="loading"&&(x.isPending||x.variables!==t&&x.mutate(t)))},k=[t,o,d,c.kind,x],a[18]=x,a[19]=d,a[20]=t,a[21]=o,a[22]=c.kind,a[23]=v,a[24]=k):(v=a[23],k=a[24]),B.useEffect(v,k),t===null){let p;return a[25]===Symbol.for("react.memo_cache_sentinel")?(p={status:"ready",task:null},a[25]=p):p=a[25],p}if(o){let p;return a[26]!==o?(p={status:"ready",task:o},a[26]=o,a[27]=p):p=a[27],p}if(d&&typeof d=="object"){let p;return a[28]!==d?(p={status:"ready",task:d},a[28]=d,a[29]=p):p=a[29],p}if(x.data){let p;return a[30]!==x.data?(p={status:"ready",task:x.data},a[30]=x.data,a[31]=p):p=a[31],p}if(x.isError){let p;return a[32]!==x.error?(p={status:"error",error:x.error},a[32]=x.error,a[33]=p):p=a[33],p}if(x.isPending||c.kind!=="loading"){let p;return a[34]===Symbol.for("react.memo_cache_sentinel")?(p={status:"creating"},a[34]=p):p=a[34],p}let y;return a[35]===Symbol.for("react.memo_cache_sentinel")?(y={status:"loading"},a[35]=y):y=a[35],y}function Fr(t){const e=$.c(13),{children:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const i=Se(a);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[1]=r):r=e[1];const l=Oe(r);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={select:Rr},e[2]=c):c=e[2];const u=ms(c),{org:o}=le();let d;e[3]!==o||e[4]!==i.agentId||e[5]!==i.legacyView||e[6]!==i.org||e[7]!==u||e[8]!==l?(d=i.org?fs({pathname:u,org:i.org,pathAgentId:i.agentId,pathLegacyView:i.legacyView,fallbackAgentId:Ne(o.id).id,search:l}):null,e[3]=o,e[4]=i.agentId,e[5]=i.legacyView,e[6]=i.org,e[7]=u,e[8]=l,e[9]=d):d=e[9];const f=d;let m;return e[10]!==n||e[11]!==f?(m=f?s.jsx(ht,{target:f}):n,e[10]=n,e[11]=f,e[12]=m):m=e[12],m}function Rr(t){return t.matches.at(-1)?.pathname??t.location.pathname}function Br(){const t=$.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const n=Se(e);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[1]=a):a=t[1];const i=Oe(a),{org:r}=le(),{org:l,taskId:c}=n;if(!l||c===void 0)return null;let u;return t[2]!==l||t[3]!==r.id||t[4]!==i||t[5]!==c?(u=hs({org:l,taskId:c,fallbackAgentId:Ne(r.id).id,search:i}),t[2]=l,t[3]=r.id,t[4]=i,t[5]=c,t[6]=u):u=t[6],u}function Or(){const t=$.c(2),e=Br();let n;return t[0]!==e?(n=e?s.jsx(ht,{target:e}):null,t[0]=e,t[1]=n):n=t[1],n}function zr(){const t=$.c(6),e=Vt(),n=Be();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[0]=a):a=t[0];const{preview:i}=Oe(a);if(!e||!i)return null;let r;t[1]!==n?(r=()=>n({to:".",search:Gr}),t[1]=n,t[2]=r):r=t[2];let l;return t[3]!==i||t[4]!==r?(l=s.jsx(Xn,{previewPath:i,onClose:r,showSeeInLibrary:!0}),t[3]=i,t[4]=r,t[5]=l):l=t[5],l}function Gr(t){const{preview:e,...n}=t;return n}const Hr=B.createContext(null);function is(){return B.useContext(Hr)}function Ur(t){const e=$.c(13),{children:n}=t,a=U(),i=Jt(),r=is(),l=He()!==null;let c;e[0]!==l||e[1]!==i||e[2]!==r?(c=s.jsx(Ca,{}),e[0]=l,e[1]=i,e[2]=r,e[3]=c):c=e[3];const u=c;let o;e[4]!==a?(o=a("agentShellLayout.agentShellLayout.chatLoadingError"),e[4]=a,e[5]=o):o=e[5];let d;e[6]!==o?(d=s.jsx("div",{role:"alert",className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:o}),e[6]=o,e[7]=d):d=e[7];const f=n??u;let m;e[8]!==f?(m=s.jsx(Fe,{children:f}),e[8]=f,e[9]=m):m=e[9];let h;return e[10]!==d||e[11]!==m?(h=s.jsx(Ct,{fallback:d,children:m}),e[10]=d,e[11]=m,e[12]=h):h=e[12],h}function Vr(t){const e=$.c(13),{threadId:n,children:a}=t;if(U(),is(),n===null){let r;return e[0]!==a?(r=s.jsx(ee.ThreadlessProvider,{children:a}),e[0]=a,e[1]=r):r=e[1],r}let i;return e[10]!==a||e[11]!==n?(i=s.jsx(ee.ActiveTaskProvider,{taskId:n,children:a}),e[10]=a,e[11]=n,e[12]=i):i=e[12],i}function Kr(t){const e=$.c(3),{onNewTaskRef:n,createNewTask:a}=t;let i;return e[0]!==a||e[1]!==n?(i=()=>(n.current=a,()=>{n.current=null}),e[0]=a,e[1]=n,e[2]=i):i=e[2],B.useLayoutEffect(i),null}function Wr({virtualMcpId:t,hasActiveGithubRepo:e,sandboxMap:n,children:a}){const i=U(),{currentBranch:r,activeTask:l,setCurrentTaskBranch:c}=Ge(),u=Jt(),o="agent-sandbox",{data:d}=Re.useSession(),f=d?.user?.id,m=!Cs({isDesktopApp:u,harnessId:l?.harness_id}),h=rn({agentSandboxMap:n,threadSandboxMap:l?.metadata?.sandboxMap,userId:f,ownerId:l?.created_by,branch:r}),g=e||Zs(l?.metadata),j=B.useRef(null),b=m&&ln({threadLoaded:!!l,isOwner:!!f&&l?.created_by===f,hasActiveGithubRepo:g,branch:r??null,attempted:j.current===(l?.id??null)});B.useEffect(()=>{!b||!l||(j.current=l.id,c(et(d?.user?.name||d?.user?.email?.split("@")[0])))},[b,l,d,c]);const{org:x}=le(),v=Ns("cms_auto_fresh_branch"),k=Et(t),y=B.useRef(null),p=v&&k.resolved&&k.runtime==="cms"&&!!x?.slug&&!!r&&y.current!==(l?.id??null),N=nt({...Ss({orgSlug:x?.slug??"",virtualMcpId:t,branch:r??""}),enabled:p}).data?.lastCommitAt??null;B.useEffect(()=>{!p||!l||Ts(N,Date.now())&&(y.current=l.id,c(et(d?.user?.name||d?.user?.email?.split("@")[0])))},[p,N,l,d,c]);const S=de(t),w=Gt(S,r),{releases:_,createRelease:C}=Xs(t),P=!!f&&l?.created_by===f&&!!r&&r!==w&&!_.some(O=>O.branch===r),M=B.useRef(null);B.useEffect(()=>{!P||!r||M.current!==r&&(M.current=r,C({branch:r,name:en(_,i("thread.branchPicker.defaultVersionName")),color:Js(_.length),createdAt:new Date().toISOString()}).catch(()=>{}))},[P,r,_,C,i]);const I=k.resolved?k.runtime:null,D=on(t,r??void 0),F=(f&&r?ea(h?.[f]?.[r]):{})[o]??null,L=F?.previewUrl??null,G=m&&I!=="cms"&&(!!F||D);return m?I==="cms"?s.jsx(jt,{children:a},`${t}:${r??"no-branch"}:${l?.id??""}`):s.jsx(cn,{virtualMcpId:t,branch:r??null,previewUrl:L,enabled:G,children:s.jsx(dn,{executionEnabled:m,virtualMcpId:t,branch:r??null,userId:f??null,hasActiveGithubRepo:g,vmEntry:F,threadId:l?.id??null,children:s.jsx(jt,{children:a},`${t}:${r??"no-branch"}:${l?.id??""}`)})},l?.id??"no-thread"):s.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:s.jsx("div",{className:"flex h-full rounded-[0.75rem] bg-background card-shadow",children:s.jsx(Ht,{image:s.jsx(it,{size:48,className:"text-muted-foreground"}),title:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWeb"),description:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWebDescription")})})})}function qr(){const t=$.c(22),e=rt(),n=hn(),a=U(),{toggleSidebar:i}=vs(),{virtualMcpId:r,taskId:l}=Ge();let c;t[0]!==a?(c=a("layouts.shellControls.toggleSidebar"),t[0]=a,t[1]=c):c=t[1];let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(bs,{size:16}),t[2]=u):u=t[2];let o;t[3]!==c||t[4]!==i?(o=s.jsx(De,{className:"classic:hidden md:hidden",onClick:i,"aria-label":c,children:u}),t[3]=c,t[4]=i,t[5]=o):o=t[5];let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(xr,{}),t[6]=d):d=t[6];let f;t[7]!==o?(f=s.jsxs(Le.Topbar.Left,{children:[o,d]}),t[7]=o,t[8]=f):f=t[8];let m;t[9]!==l||t[10]!==r?(m=s.jsx("div",{className:"classic:hidden min-w-0 md:hidden",children:s.jsx(rs,{virtualMcpId:r,taskId:l})}),t[9]=l,t[10]=r,t[11]=m):m=t[11];let h;t[12]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(br,{}),t[12]=h):h=t[12];let g;t[13]!==e||t[14]!==n?(g=!e&&!n.contentOpen&&s.jsx(pn,{side:"right",open:n.contentOpen,onToggle:n.toggleContent}),t[13]=e,t[14]=n,t[15]=g):g=t[15];let j;t[16]!==g?(j=s.jsxs(Le.Topbar.Right,{className:"shrink-0",children:[h,g]}),t[16]=g,t[17]=j):j=t[17];let b;return t[18]!==f||t[19]!==m||t[20]!==j?(b=s.jsxs(Le.Topbar,{className:"compact:border-b compact:border-border/60 compact:px-3",children:[f,m,j]}),t[18]=f,t[19]=m,t[20]=j,t[21]=b):b=t[21],b}function Yr(t){const e=$.c(24),{layout:n,onNewTaskRef:a,createNewTask:i}=t,{virtualMcpId:r,taskId:l}=Ge(),c=rt(),u=Vt(),o=de(r),d=Kn()??"overview";let f;e[0]!==c||e[1]!==u||e[2]!==l||e[3]!==r?(f=!c&&u&&s.jsx(Le.Topbar.Center.Portal,{children:s.jsx(rs,{virtualMcpId:r,taskId:l})}),e[0]=c,e[1]=u,e[2]=l,e[3]=r,e[4]=f):f=e[4];let m;e[5]!==i||e[6]!==a?(m=s.jsx(Kr,{onNewTaskRef:a,createNewTask:i}),e[5]=i,e[6]=a,e[7]=m):m=e[7];let h;e[8]!==l||e[9]!==r?(h=s.jsx(Tr,{virtualMcpId:r,taskId:l}),e[8]=l,e[9]=r,e[10]=h):h=e[10];let g;e[11]!==o?(g=o&&s.jsx(vr,{virtualMcp:o}),e[11]=o,e[12]=g):g=e[12];let j,b;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(vt.Thread,{topbar:s.jsx(qr,{}),children:s.jsx(Ur,{})}),b=s.jsx(Lt,{}),e[13]=j,e[14]=b):(j=e[13],b=e[14]);let x;e[15]!==d||e[16]!==n||e[17]!==h||e[18]!==g?(x=s.jsxs(vt,{...n,contentKey:d,contentNavigation:h,contentActions:g,children:[j,b]}),e[15]=d,e[16]=n,e[17]=h,e[18]=g,e[19]=x):x=e[19];let v;return e[20]!==f||e[21]!==m||e[22]!==x?(v=s.jsxs(s.Fragment,{children:[f,m,x]}),e[20]=f,e[21]=m,e[22]=x,e[23]=v):v=e[23],v}function Qr(){const t=U(),e=Be(),n=jn(),{create:a}=ut(),{org:i}=le(),l=Se({strict:!1}).org??"",c=Oe({strict:!1}),u=He(),o=Qt(),d=Yt(),[f]=B.useState(()=>crypto.randomUUID()),{data:m}=Re.useSession(),[h]=B.useState(()=>et(m?.user?.name||m?.user?.email?.split("@")[0])),g=ct(),j=B.useSyncExternalStore(g.threads.subscribe,g.threads.get),b=B.useSyncExternalStore(g.threadsStatus.subscribe,g.threadsStatus.get),x=de(o),v=!!(x&&Ut(x)),k=Gt(x,null),y=Er(u,o,h);Pa(y.status==="ready"?y.task:null);const p=x?.metadata?.ui?.layout??null,T=p?{defaultMainView:p.defaultMainView??null,chatDefaultOpen:p.chatDefaultOpen??null}:null,N=fn(T),{threadId:S,providerKey:w}=_r({routeThreadId:u,fallbackKey:f}),_=async()=>{const M=crypto.randomUUID(),I=j.find(D=>D.id===S)?.branch??null;try{await a({id:M,virtual_mcp_id:o,...I?{branch:I}:{}})}catch{}n(M,()=>({}))},C=B.useRef(null);B.useEffect(()=>{const M=I=>{Ys(I)&&I.shiftKey&&I.code==="KeyS"&&!I.repeat&&(I.preventDefault(),C.current?.())};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[]);const A=y.status==="ready"?y.task:null,P=A?.virtual_mcp_id;if(A&&P&&!yn({routeAgentId:o,threadAgentId:P})){const M=ps({org:l,agentId:P,superAgentId:Ne(i.id).id});return s.jsx(ht,{target:{route:M,search:{thread:A.id,sidepanel:c.sidepanel,mainpanel:c.mainpanel,autosend:c.autosend}}})}if(u===null&&d&&x){if(b.kind==="loading")return s.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:s.jsxs("div",{role:"status","aria-live":"polite",className:"flex h-full items-center justify-center bg-background card-shadow rounded-[0.75rem] text-sm text-muted-foreground",children:[s.jsx(je,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})});const I=an(j,o,m?.user?.id,zt(x.metadata),v,{baseBranch:k})?.id??(v?f:null);if(I)return s.jsx(xs,{to:".",replace:!0,search:D=>({...D,thread:I})})}return y.status==="creating"||y.status==="loading"?s.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:s.jsxs("div",{role:"status","aria-live":"polite",className:"flex h-full items-center justify-center bg-background card-shadow rounded-[0.75rem] text-sm text-muted-foreground",children:[s.jsx(je,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})}):y.status==="error"?s.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:s.jsxs("div",{role:"alert",className:"flex flex-col h-full items-center justify-center gap-2 bg-background card-shadow rounded-[0.75rem] p-8 text-sm",children:[s.jsx("div",{className:"font-medium",children:t("agentShellLayout.agentShellLayout.taskUnavailable")}),s.jsx("div",{className:"text-muted-foreground",children:y.error.message})]})}):x?s.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:s.jsx(ee.Provider,{virtualMcpId:o,task:y.status==="ready"?y.task:null,children:s.jsx(Wr,{virtualMcpId:o,hasActiveGithubRepo:v,sandboxMap:x.metadata?.sandboxMap,children:s.jsx(Vr,{threadId:S,children:s.jsx(Fe,{children:s.jsx(Yr,{layout:N,onNewTaskRef:C,createNewTask:_})})},w)})},o)}):s.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:s.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:s.jsx(Ht,{image:s.jsx(it,{size:48,className:"text-muted-foreground"}),title:t("agentShellLayout.agentShellLayout.agentNotFound"),description:t("agentShellLayout.agentShellLayout.agentNotFoundDescription",{virtualMcpId:o}),actions:s.jsx(gs,{variant:"outline",onClick:()=>e({to:"/$org",params:{org:l}}),children:t("agentShellLayout.agentShellLayout.goToOrgHome")})})})})}function pc(){const t=$.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const n=Se(e);if(n.taskId!==void 0){let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Or,{}),t[1]=i):i=t[1],i}if(n._splat!==void 0){let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Lt,{}),t[2]=i):i=t[2],i}let a;return t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Fe,{children:s.jsx(Fr,{children:s.jsx(Zn,{children:s.jsxs(Jn,{children:[s.jsx(Qr,{}),s.jsx(zr,{})]})})})}),t[3]=a):a=t[3],a}export{pc as default};
1
+ import{c as $,b as U,r as B,l as Y,j as s,h as je,a0 as le,au as Ne,at as Fe,E as Ct,a as Re,K as Pt,m as nt,q as ce,a6 as at,av as ls,aw as os,_ as At,t as It,an as cs,d as Be,Z as rt,n as pt,ax as Mt,ay as ds,f as Se,C as xt,e as us,u as Oe,k as ms,az as fs,aA as hs,O as Lt,aB as ps,N as xs,B as gs,P as Le}from"./index-DXBmCj7V.js";import{i as it}from"./AlertCircle-NKpIdBKl.js";import{i as bs}from"./LayoutLeft-CyJFqp-6.js";import{u as vs}from"./sidebar-6rO43IUN.js";import{T as De,p as js}from"./toolbar-icon-button-BIBFTsar.js";import{C as ee,w as ys}from"./index-CQcZAkPo.js";import{u as ks,a as Ns}from"./use-organization-settings-yjdHHrMs.js";import{d as Ss,i as Ts}from"./decofile-api-C6MVAHgF.js";import{u as ze,a as $t,b as Ge,c as Dt,d as _s,e as ws,s as Cs}from"./chat-context-WkB72QDr.js";import{u as Et}from"./use-session-runtime-Dc42TY0X.js";import{u as Ps}from"./use-ai-providers-BwceVIHL.js";import{i as As}from"./CheckCircle-DBlA9wkb.js";import{o as gt,A as ye,p as Is,q as Ms,r as Ls,u as $s,v as Ds,w as Ft,x as Es,y as Fs,z as Rs,n as Bs}from"./agent-icon-Du4foZ5w.js";import{i as Os}from"./XCircle-CB3Q-O1t.js";import{s as bt}from"./XClose-l9OyLGUl.js";import{a as de,b as Rt}from"./use-virtual-mcp-2UFz9K4W.js";import{I as Bt}from"./integration-icon-CAyUCGPQ.js";import{b as zs}from"./use-entitlements-Dx7XqEcC.js";import{t as lt}from"./ChevronUp-BAQXOf5D.js";import{O as Gs,u as Hs}from"./pair-BFIjmC4W.js";import{u as Us,a as Vs}from"./use-thread-outputs-BoiojEnU.js";import{u as Ks}from"./use-deco-credits-6yJRZ2JQ.js";import{a as ot,f as Ws,L as Ot,s as qs,b as Ys}from"./shell-layout-BDka9RLc.js";import{f as Qs,b as Zs}from"./use-project-scope-DHl6lLqa.js";import{g as et,u as Xs,n as Js,a as en}from"./use-releases-CASa78Vi.js";import{d as zt,c as tn}from"./thread-intent-vrMbWjYP.js";import{u as sn,a as ct,b as dt,c as ut}from"./hooks-DdW3hvoh.js";import{f as nn,a as Gt,b as an}from"./use-navigate-to-agent-DIpRW39A.js";import{o as rn,s as ln,u as on,S as cn,a as dn}from"./sandbox-lifecycle-context-BrifGyM7.js";import{E as Ht}from"./empty-state-DATmbbqz.js";import{t as un,m as mn,u as fn}from"./thread-button-DD23ms1j.js";import{g as Ut}from"./github-repo-BknN0SVI.js";import{u as Vt}from"./use-mobile-CRuuooNM.js";import{C as vt,u as hn,P as pn}from"./index-Bb2NSQTG.js";import{a as Kt,b as Wt,P as qt}from"./popover-B1-bCr3Y.js";import{T as Te,a as _e,c as we}from"./tooltip-rAdo_tRS.js";import{i as xn}from"./Tool02-BLokvBBs.js";import{T as gn,a as bn}from"./toggle-group-XcXQjaHX.js";import{u as Yt,a as He,r as vn,b as Qt,c as jn,d as yn}from"./thread-route-QtII8A2p.js";import{d as kn,h as Nn,c as Sn,b as Tn,D as _n}from"./dialog-uPTcsM6n.js";import{c as wn,C as Cn,a as Pn,b as An,e as In,d as Mn}from"./command-CY_32gBM.js";import{i as Zt}from"./Zap-UqD0_RZa.js";import{A as Ln,a as $n,b as Dn,c as En,g as Fn,d as Rn,e as Bn,f as On}from"./alert-dialog-D2J-kRAV.js";import{g as zn,S as Gn}from"./task-status-DZ2zcnv8.js";import{a as Hn}from"./format-time-BtXRrtv4.js";import{i as Un}from"./Globe01-0DpEacUx.js";import{a as Vn}from"./Package-EQg-wMAD.js";import{a as mt,u as Kn}from"./use-panel-navigate-DEBeb2CL.js";import{u as ft}from"./use-main-panel-tabs-Dcfn9hBK.js";import{i as Wn}from"./Share07-adzWfg3s.js";import{b as qn,c as Xt,S as Yn,d as Qn}from"./select-DOrOm388.js";import{L as ht,a as Zn}from"./legacy-main-redirect-DakI8WgO.js";import{L as Xn}from"./preview-dialog-tXexYYvy.js";import{O as Jn}from"./org-file-open-context-B3uxBbrN.js";import{B as jt}from"./blocks-preview-workspace-context-okcOywiO.js";import{u as Jt}from"./use-is-desktop-app-BNujXJc_.js";import{p as ea}from"./virtual-mcp-Be7V69gW.js";import"./sheet-DlPfrw9X.js";import"./X-CvjnZl5e.js";import"./ArrowUp-BgjnqmUz.js";import"./gateway-client-_lcPratN.js";import"./drawer-CJhbJSjB.js";import"./collection-search-DFM5AYUG.js";import"./SearchMd-I-u-Ppkp.js";import"./use-mcp-client-BtmoWWkf.js";import"./auth-DoQ4Nalq.js";import"./use-mcp-prompts-BkeLGKHx.js";import"./index-VAuix8Ds.js";import"./form-CzXfgfFr.js";import"./label-C_cX51We.js";import"./input-CA3NO5_t.js";import"./utils-CVEq3hMx.js";import"./input-DJ90IYpm.js";import"./autosend-Bln98kNi.js";import"./chat-draft-anvjkrXf.js";import"./ArrowRight-8mLQGGMI.js";import"./Image01-BUYhMNkS.js";import"./Upload01-Cv7tN2NN.js";import"./Copy01-wurPIobv.js";import"./ArrowLeft-BKx_QTJr.js";import"./usage-stats-CYrj10jy.js";import"./use-copy-Dcx9tDN2.js";import"./markdown-CqOP0_5N.js";import"./Download01-BWFtS53v.js";import"./ZoomOut-Cq1zMqoM.js";import"./tabs-tFCunu6d.js";import"./tool-namespace-DmnQIdtF.js";import"./use-open-billing-url-C5SPvsb8.js";import"./decopilot-C2LtkKnC.js";import"./checkbox-Yo-_CoUr.js";import"./Tool01-DDTjazFm.js";import"./Key01-BvLdmCTc.js";import"./Settings02-DJVGKnwW.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-DyfIXCt5.js";import"./avatar-1Yn634Bu.js";import"./User01-BI5R-4Xj.js";import"./Eye-BD0ZbSdl.js";import"./download-app-dialog-CSAHR0v5.js";import"./Stars01-BEbgNJbY.js";import"./index-CdCeTCag.js";import"./input-Cl33QWb6.js";import"./hooks-BDNT0Adb.js";import"./use-org-fs-DnKhdb5t.js";import"./Link01-qIayyFAq.js";import"./Plus-BKjrQCsd.js";import"./question-004-sINsf4GQ.js";import"./use-members-DOLKWeYn.js";import"./use-org-auth-client-TdQ8MWNM.js";import"./feature-paywall-C-R3YJVm.js";import"./plan-ladder-BGfca4Fl.js";import"./add-connection-dialog-CCnr4x54.js";import"./extract-connection-data-C-_k_HrX.js";import"./metadata-dUsYcpuu.js";import"./github-D4UJ99TO.js";import"./connection-BtAmcsWV.js";import"./connection-card-DNLyrdBM.js";import"./use-registry-connections-B13lXSQz.js";import"./use-connection-BN3cT5kd.js";import"./useInfiniteQuery-Bvk6obSJ.js";import"./infiniteQueryObserver-DhQG5Ba-.js";import"./retry-i8LvYSZg.js";import"./backoff-8mStPHYB.js";import"./connection-slug-CITJ0kGN.js";import"./slugify-CEUa2lfQ.js";import"./textarea-D-6K9r19.js";import"./UserSquare-C_kKkH0n.js";import"./connection-form-helpers-pqXyLS21.js";import"./Trash01-VGFb49EH.js";import"./authenticate-and-persist-oauth-CMWIzBXQ.js";import"./mcp-oauth-ZZeDQKuh.js";import"./collection-tabs-CU5BwvHd.js";import"./badge-BMrNoDQF.js";import"./use-infinite-scroll-CWWIqkZ2.js";import"./useSuspenseInfiniteQuery-7JvmV8My.js";import"./schema-CQ48zDTU.js";import"./task-board-D3lC_1Th.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-R9ZDtZrh.js";import"./TrendUp01-BPu5TWOk.js";import"./Globe04-D59f7pGB.js";import"./CreditCard01-DjPXzBq6.js";import"./DotsVertical-Bx5qjzcz.js";import"./LinkExternal01-hkxOMKQE.js";import"./Sun-YVYc7YRc.js";import"./Palette-DI15yG1R.js";import"./Play-Cg9yqLoQ.js";import"./SearchLg-RqwylEUM.js";import"./Users01-DVg45Kv0.js";import"./collapsible-Cz7g8j4s.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BrIoKm0G.js";import"./types-CzTQ99AX.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./file-type-icon-x1wD28_F.js";import"./project-icon-I77gr-pK.js";import"./required-auth-layout-D6L2B3lC.js";import"./use-org-sso-D6hDWGLC.js";import"./serial-task-queue-CGOeQgpr.js";import"./sandbox-url-D3mC8qhT.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./use-route-default-main-DSxGO_aw.js";import"./use-in-settings-Bx-OzfKC.js";import"./resizable-DGvuTNz4.js";import"./route-page-header-DPnz1U8f.js";import"./index-U6uQHeCm.js";import"./index-DlTwltzZ.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-mcp-tools-B84418Zt.js";import"./use-task-metadata-jNANkRmK.js";import"./use-project-native-view-presence-CHdUtv7D.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-BJjPt2Ut.js";import"./site-slug-uya6Wp4-.js";import"./preview-content-BJxZz0wL.js";import"./file-preview-BQWchARE.js";import"./utils-1s66UjII.js";import"./editor-DhWDdB15.js";import"./file-share-button-D6ndnz7e.js";function ta({isThreadLocked:t,hasCloudProviderKeys:e}){return t?!1:!e}function sa(){const t=$.c(3),e=Ps(),a=ze()?.isThreadLocked??!1,i=e.length>0;let r;return t[0]!==a||t[1]!==i?(r=ta({isThreadLocked:a,hasCloudProviderKeys:i}),t[0]=a,t[1]=i,t[2]=r):r=t[2],r}function ve(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Qe(t){if(!t)return"—";const e=typeof t=="string"?new Date(t):t;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function na(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function aa(t){const e=$.c(4),{items:n}=t;let a;e[0]!==n?(a=n.map(ra),e[0]=n,e[1]=a):a=e[1];let i;return e[2]!==a?(i=s.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:a}),e[2]=a,e[3]=i):i=e[3],i}function ra(t){return s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[s.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.label}),s.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:t.value})]},t.label)}function ia(t){const e=$.c(33),{userTokens:n,assistantTokens:a,otherTokens:i}=t,r=U(),l=n+a+i,c=l>0?n/l*100:0,u=l>0?a/l*100:0,o=l>0?i/l*100:0;let d;e[0]!==c?(d=c>0&&s.jsx("div",{className:"h-full bg-chart-1",style:{width:`${c}%`}}),e[0]=c,e[1]=d):d=e[1];let f;e[2]!==u?(f=u>0&&s.jsx("div",{className:"h-full bg-chart-2",style:{width:`${u}%`}}),e[2]=u,e[3]=f):f=e[3];let m;e[4]!==o?(m=o>0&&s.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${o}%`}}),e[4]=o,e[5]=m):m=e[5];let h;e[6]!==d||e[7]!==f||e[8]!==m?(h=s.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[d,f,m]}),e[6]=d,e[7]=f,e[8]=m,e[9]=h):h=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=g):g=e[10];let j;e[11]!==r||e[12]!==c?(j=r("chat.contextPanel.userPercent",{pct:c.toFixed(1)}),e[11]=r,e[12]=c,e[13]=j):j=e[13];let b;e[14]!==j?(b=s.jsxs("div",{className:"flex items-center gap-1.5",children:[g,s.jsx("span",{className:"text-xs text-muted-foreground",children:j})]}),e[14]=j,e[15]=b):b=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[16]=x):x=e[16];let v;e[17]!==u||e[18]!==r?(v=r("chat.contextPanel.assistantPercent",{pct:u.toFixed(1)}),e[17]=u,e[18]=r,e[19]=v):v=e[19];let k;e[20]!==v?(k=s.jsxs("div",{className:"flex items-center gap-1.5",children:[x,s.jsx("span",{className:"text-xs text-muted-foreground",children:v})]}),e[20]=v,e[21]=k):k=e[21];let y;e[22]!==o||e[23]!==i||e[24]!==r?(y=i>0&&s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:r("chat.contextPanel.otherPercent",{pct:o.toFixed(1)})})]}),e[22]=o,e[23]=i,e[24]=r,e[25]=y):y=e[25];let p;e[26]!==k||e[27]!==y||e[28]!==b?(p=s.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[b,k,y]}),e[26]=k,e[27]=y,e[28]=b,e[29]=p):p=e[29];let T;return e[30]!==p||e[31]!==h?(T=s.jsxs("div",{className:"flex flex-col gap-2",children:[h,p]}),e[30]=p,e[31]=h,e[32]=T):T=e[32],T}function la(t){const e=$.c(14),{agentId:n,isError:a}=t,i=de(n),r=U();let l;e[0]!==i?.title||e[1]!==r?(l=i?.title??r("chat.subtask.subtaskNoun"),e[0]=i?.title,e[1]=r,e[2]=l):l=e[2];const c=l,u=i?.icon??null;let o;e[3]!==u||e[4]!==c?(o=s.jsx(Bt,{icon:u,name:c,size:"xs",className:"size-6 rounded-md shrink-0"}),e[3]=u,e[4]=c,e[5]=o):o=e[5];const d=a?"text-destructive":"text-foreground";let f;e[6]!==d?(f=Y("shrink-0 font-medium",d),e[6]=d,e[7]=f):f=e[7];let m;e[8]!==c||e[9]!==f?(m=s.jsx("span",{className:f,children:c}),e[8]=c,e[9]=f,e[10]=m):m=e[10];let h;return e[11]!==o||e[12]!==m?(h=s.jsxs(s.Fragment,{children:[o,m]}),e[11]=o,e[12]=m,e[13]=h):h=e[13],h}function oa(t){const e=$.c(12),{isError:n}=t,a=U();let i;e[0]!==a?(i=a("chat.contextPanel.subtask"),e[0]=a,e[1]=i):i=e[1];const r=i;let l;e[2]!==r?(l=s.jsx(Bt,{icon:null,name:r,size:"xs",className:"size-6 rounded-md shrink-0"}),e[2]=r,e[3]=l):l=e[3];const c=n?"text-destructive":"text-foreground";let u;e[4]!==c?(u=Y("shrink-0 font-medium",c),e[4]=c,e[5]=u):u=e[5];let o;e[6]!==r||e[7]!==u?(o=s.jsx("span",{className:u,children:r}),e[6]=r,e[7]=u,e[8]=o):o=e[8];let d;return e[9]!==l||e[10]!==o?(d=s.jsxs(s.Fragment,{children:[l,o]}),e[9]=l,e[10]=o,e[11]=d):d=e[11],d}function ca(t){const e=$.c(18),{part:n}=t,a=n.input?.agent_id,i=n.state==="input-streaming"||n.state==="input-available"||n.state==="output-available"&&n.preliminary===!0,r=n.state==="output-error",l=n.state==="approval-requested";let c;e[0]!==r?(c=s.jsx(oa,{isError:r}),e[0]=r,e[1]=c):c=e[1];let u;e[2]!==a||e[3]!==r?(u=s.jsx(la,{agentId:a,isError:r}),e[2]=a,e[3]=r,e[4]=u):u=e[4];let o;e[5]!==c||e[6]!==u?(o=s.jsx(B.Suspense,{fallback:c,children:u}),e[5]=c,e[6]=u,e[7]=o):o=e[7];let d;e[8]!==n.input?(d=n.input?.prompt&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/50",children:"·"}),s.jsx("span",{className:"truncate text-muted-foreground",children:n.input.prompt})]}),e[8]=n.input,e[9]=d):d=e[9];let f;e[10]!==l||e[11]!==r||e[12]!==i?(f=s.jsx("span",{className:"ml-auto shrink-0",children:i?s.jsx(je,{className:"size-3 text-muted-foreground"}):r?s.jsx(Os,{size:12,className:"text-destructive"}):l?s.jsx(it,{size:12,className:"text-warning"}):s.jsx(As,{size:12,className:"text-success"})}),e[10]=l,e[11]=r,e[12]=i,e[13]=f):f=e[13];let m;return e[14]!==o||e[15]!==d||e[16]!==f?(m=s.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[o,d,f]}),e[14]=o,e[15]=d,e[16]=f,e[17]=m):m=e[17],m}function da(t){const e=$.c(51),{onClose:n,back:a,className:i}=t,r=U(),[l,c]=B.useState(null),{messages:u}=$t(),{activeTask:o}=Ge(),{selectedModel:d,selectedVirtualMcp:f}=Dt(),m=_s(u),h=[...u].reverse().find(ya),g=h?.metadata?.usage,j=h?.metadata?.modelLimits?.contextWindow??d?.limits?.contextWindow??null,b=g?.contextTokens??0,x=j&&j>0?(b/j*100).toFixed(1):null,v=u;let k;e[0]!==v?(k=v.filter(ja).reduce(va,0),e[0]=v,e[1]=k):k=e[1];const y=k,p=u;let T;e[2]!==p?(T=p.filter(ba).reduce(ga,0),e[2]=p,e[3]=T):T=e[3];const N=T,S=Math.max(0,m.totalTokens-y-N),w=u[0],_=u.at(-1),C=w?.metadata?.created_at??o?.created_at,A=_?.metadata?.created_at??o?.updated_at,P=u.filter(xa),M=u.flatMap(ha),I=d?.modelId?na(d.modelId):"—",D=f?.title??"Super Agent",E=zs(),F=[{label:r("chat.contextPanel.sessionLabel"),value:o?.title??r("chat.contextPanel.newChat")},{label:r("chat.contextPanel.messagesLabel"),value:P.length},{label:r("chat.contextPanel.agentLabel"),value:D},...E?[{label:r("chat.contextPanel.modelLabel"),value:I}]:[],{label:r("chat.contextPanel.contextLimitLabel"),value:j?ve(j):"—"},{label:r("chat.contextPanel.sessionTokensLabel"),value:m.totalTokens>0?ve(m.totalTokens):"0"},{label:r("chat.contextPanel.usageLabel"),value:x!==null?`${x}%`:"—"},{label:r("chat.contextPanel.inputTokensLabel"),value:m.inputTokens>0?ve(m.inputTokens):"0"},{label:r("chat.contextPanel.outputTokensLabel"),value:m.outputTokens>0?ve(m.outputTokens):"0"},{label:r("chat.contextPanel.reasoningTokensLabel"),value:m.reasoningTokens>0?ve(m.reasoningTokens):"0"},...E?[{label:r("chat.contextPanel.costLabel"),value:m.cost>0?`$${m.cost<.001?m.cost.toFixed(6):m.cost.toFixed(4)}`:"$0.00"}]:[],{label:r("chat.contextPanel.sessionCreatedLabel"),value:Qe(C)},{label:r("chat.contextPanel.lastActivityLabel"),value:Qe(A)}];if(!o&&P.length===0){let H;e[4]!==i?(H=Y("flex flex-col h-full w-full border-l border-border bg-background",i),e[4]=i,e[5]=H):H=e[5];let q;e[6]!==r?(q=r("chat.contextPanel.title"),e[6]=r,e[7]=q):q=e[7];let ae;e[8]!==q?(ae=s.jsx("span",{className:"text-sm font-medium text-foreground",children:q}),e[8]=q,e[9]=ae):ae=e[9];let ie;e[10]!==a?(ie=a?s.jsx(gt,{size:14,className:"text-muted-foreground"}):s.jsx(bt,{size:14,className:"text-muted-foreground"}),e[10]=a,e[11]=ie):ie=e[11];let J;e[12]!==n||e[13]!==ie?(J=s.jsx("button",{type:"button",onClick:n,className:"flex size-6 items-center justify-center classic:rounded hover:bg-accent transition-colors compact:rounded-lg",children:ie}),e[12]=n,e[13]=ie,e[14]=J):J=e[14];let oe;e[15]!==ae||e[16]!==J?(oe=s.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[ae,J]}),e[15]=ae,e[16]=J,e[17]=oe):oe=e[17];let te;e[18]!==r?(te=r("chat.contextPanel.emptyState"),e[18]=r,e[19]=te):te=e[19];let se;e[20]!==te?(se=s.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:te})}),e[20]=te,e[21]=se):se=e[21];let re;return e[22]!==oe||e[23]!==se||e[24]!==H?(re=s.jsxs("div",{className:H,children:[oe,se]}),e[22]=oe,e[23]=se,e[24]=H,e[25]=re):re=e[25],re}let L;e[26]!==i?(L=Y("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",i),e[26]=i,e[27]=L):L=e[27];let G;e[28]!==r?(G=r("chat.contextPanel.title"),e[28]=r,e[29]=G):G=e[29];let O;e[30]!==G?(O=s.jsx("span",{className:"text-sm font-medium text-foreground",children:G}),e[30]=G,e[31]=O):O=e[31];let K;e[32]!==a?(K=a?s.jsx(gt,{size:14}):s.jsx(bt,{size:14}),e[32]=a,e[33]=K):K=e[33];let R;e[34]!==n||e[35]!==K?(R=s.jsx("button",{type:"button",onClick:n,className:"flex h-7 w-7 items-center justify-center classic:rounded-md compact:rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:K}),e[34]=n,e[35]=K,e[36]=R):R=e[36];let Q;e[37]!==O||e[38]!==R?(Q=s.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[O,R]}),e[37]=O,e[38]=R,e[39]=Q):Q=e[39];let V;e[40]!==r?(V=r("chat.contextPanel.contextBreakdownSection"),e[40]=r,e[41]=V):V=e[41];let W;e[42]!==V?(W=s.jsx("span",{className:"text-xs text-muted-foreground",children:V}),e[42]=V,e[43]=W):W=e[43];let Z;e[44]!==N||e[45]!==S||e[46]!==y?(Z=s.jsx(ia,{userTokens:y,assistantTokens:N,otherTokens:S}),e[44]=N,e[45]=S,e[46]=y,e[47]=Z):Z=e[47];let X;return e[48]!==W||e[49]!==Z?(X=s.jsxs("div",{className:"flex flex-col gap-3",children:[W,Z]}),e[48]=W,e[49]=Z,e[50]=X):X=e[50],s.jsxs("div",{className:L,children:[Q,s.jsxs("div",{className:"flex flex-col gap-8 p-6",children:[M.length>0&&s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:r("chat.contextPanel.subtasksSection")}),s.jsx("div",{className:"flex flex-col gap-1",children:M.map(fa)})]}),s.jsx(aa,{items:F}),X,P.length>0&&s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:r("chat.contextPanel.rawMessagesSection")}),s.jsx("div",{className:"flex flex-col gap-1",children:P.map(H=>{const q=H.metadata?.created_at,ae=l?.id===H.id;return s.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[s.jsxs("button",{type:"button",onClick:()=>c(ae?null:H),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent/50 w-full text-left cursor-pointer",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("span",{className:Y("shrink-0 font-medium",H.role==="user"?"text-chart-1":"text-chart-2"),children:H.role}),s.jsx("span",{className:"text-muted-foreground",children:"•"}),s.jsx("span",{className:"truncate text-muted-foreground font-mono",children:H.id})]}),q&&s.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:Qe(q)})]}),ae&&s.jsxs(s.Fragment,{children:[H.role==="assistant"&&(()=>{const ie=H.metadata?._request;if(!ie)return null;const J=ie.systemSections??[],oe=Math.max(1,...J.map(ma)),te=J.reduce(ua,0);return s.jsxs("div",{className:"border-t border-border/50 px-3 py-2.5 text-xs space-y-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-medium text-foreground",children:r("chat.contextPanel.requestLabel")}),s.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[ie.activeTools??0," / ",ie.tools??0," ",r("chat.contextPanel.toolsActive")]})]}),J.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"text-muted-foreground",children:[r("chat.contextPanel.systemPromptLabel")," ",s.jsxs("span",{className:"tabular-nums",children:["~",Math.round(te/4).toLocaleString()," ",r("chat.contextPanel.tokAbbrev")]})]}),J.map((se,re)=>{const ue=se.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${re}`,ge=se.chars/oe*100,me=Math.round(se.chars/4);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"font-mono text-foreground truncate",children:ue}),s.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["~",me.toLocaleString()," ",r("chat.contextPanel.tokAbbrev")]})]}),s.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full bg-chart-3",style:{width:`${ge}%`}})})]},re)})]})]})})(),s.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(H,null,2)})]})]},H.id)})})]})]})]})}function ua(t,e){return t+e.chars}function ma(t){return t.chars}function fa(t,e){return s.jsx(ca,{part:t},e)}function ha(t){return(t.parts??[]).filter(pa)}function pa(t){return t.type==="tool-subtask"}function xa(t){return t.role!=="system"}function ga(t,e){const n=e.metadata?.usage;return t+(n?.outputTokens??0)}function ba(t){return t.role==="assistant"}function va(t,e){const n=e.metadata?.usage;return t+(n?.inputTokens??0)}function ja(t){return t.role==="user"}function ya(t){return t.role==="assistant"&&t.metadata?.usage}function ka(t){const e=$.c(21),{onOpenContextPanel:n}=t,{org:a}=le(),{selectedVirtualMcp:i}=Dt();let r;e[0]!==a.id?(r=Ne(a.id),e[0]=a.id,e[1]=r):r=e[1];const c=i??r,o=de(c.id)??c,d=o.title??"Super Agent",f=o.icon??null,m=o.description??null;let h;e[2]!==f||e[3]!==d?(h=s.jsx(ye,{icon:f,name:d,size:"lg"}),e[2]=f,e[3]=d,e[4]=h):h=e[4];let g;e[5]!==d?(g=s.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:d}),e[5]=d,e[6]=g):g=e[6];let j;e[7]!==m?(j=m?s.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance",children:m}):null,e[7]=m,e[8]=j):j=e[8];let b;e[9]!==g||e[10]!==j?(b=s.jsxs("div",{className:"space-y-1.5",children:[g,j]}),e[9]=g,e[10]=j,e[11]=b):b=e[11];let x;e[12]!==h||e[13]!==b?(x=s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-4 px-6 text-center overflow-hidden",children:[h,b]}),e[12]=h,e[13]=b,e[14]=x):x=e[14];let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ee.IceBreakers,{className:"pb-3"}),e[15]=v):v=e[15];let k;e[16]!==n?(k=s.jsxs(ee.Footer,{children:[v,s.jsx(ee.Input,{onOpenContextPanel:n})]}),e[16]=n,e[17]=k):k=e[17];let y;return e[18]!==x||e[19]!==k?(y=s.jsxs(s.Fragment,{children:[x,k]}),e[18]=x,e[19]=k,e[20]=y):y=e[20],y}function yt(t){const e=$.c(17),{outputs:n,collapsed:a,onToggle:i,variant:r}=t,l=r==="card"?"rounded-xl border border-border bg-muted/95 shadow-sm backdrop-blur-sm":"border-b border-border bg-background";let c;e[0]!==l?(c=Y(l),e[0]=l,e[1]=c):c=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Files in this task"}),e[2]=u):u=e[2];const o=a&&"-rotate-90";let d;e[3]!==o?(d=Y("size-4 text-muted-foreground transition-transform",o),e[3]=o,e[4]=d):d=e[4];let f;e[5]!==d?(f=s.jsx(lt,{className:d}),e[5]=d,e[6]=f):f=e[6];let m;e[7]!==i||e[8]!==f?(m=s.jsxs("button",{type:"button",onClick:i,className:"flex w-full items-center justify-between px-3 py-2.5 text-left",children:[u,f]}),e[7]=i,e[8]=f,e[9]=m):m=e[9];let h;e[10]!==a||e[11]!==n?(h=!a&&s.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto px-2 pb-2",children:n.map(Na)}),e[10]=a,e[11]=n,e[12]=h):h=e[12];let g;return e[13]!==c||e[14]!==m||e[15]!==h?(g=s.jsxs("div",{className:c,children:[m,h]}),e[13]=c,e[14]=m,e[15]=h,e[16]=g):g=e[16],g}function Na(t){return s.jsx(Gs,{file:t},t.key)}function Sa(){const t=$.c(13),e=ze()?.taskId??null,n=Us();let a;t[0]!==n?(a={enabled:n},t[0]=n,t[1]=a):a=t[1];const{data:i}=Vs(e,a),[r,l]=B.useState(!1),[c,u]=B.useState(!0);if(!e||!i||i.length===0)return null;let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=()=>l(_a),t[2]=o):o=t[2];let d;t[3]!==r||t[4]!==i?(d=s.jsx("div",{className:"absolute top-2 right-2 z-10 hidden w-72 @[1280px]:block",children:s.jsx(yt,{variant:"card",outputs:i,collapsed:r,onToggle:o})}),t[3]=r,t[4]=i,t[5]=d):d=t[5];let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(Ta),t[6]=f):f=t[6];let m;t[7]!==c||t[8]!==i?(m=s.jsx("div",{className:"shrink-0 @[1280px]:hidden",children:s.jsx(yt,{variant:"bar",outputs:i,collapsed:c,onToggle:f})}),t[7]=c,t[8]=i,t[9]=m):m=t[9];let h;return t[10]!==d||t[11]!==m?(h=s.jsxs(s.Fragment,{children:[d,m]}),t[10]=d,t[11]=m,t[12]=h):h=t[12],h}function Ta(t){return!t}function _a(t){return!t}function wa(){const t=$.c(31),{org:e}=le(),n=ze(),{isChatEmpty:a}=$t(),[i,r]=B.useState("chat"),l=Ks(),c=sa(),{runtime:u}=Et(n?.virtualMcpId);if(c&&u!=="cms"){let _;return t[0]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(ee,{className:"animate-in fade-in-0 duration-200",children:s.jsx(ee.Main,{className:"flex flex-col items-center",children:s.jsx(ee.EmptyState,{children:s.jsx(ee.NoAiProviderEmptyState,{})})})}),t[0]=_):_=t[0],_}let d;t[1]!==l.hasDecoKey||t[2]!==l.hasOnlyDecoProvider||t[3]!==l.isLoading||t[4]!==l.isZeroBalance||t[5]!==a||t[6]!==e?(d=l.hasDecoKey&&l.isZeroBalance&&l.hasOnlyDecoProvider&&!l.isLoading&&a&&!ys(e.id),t[1]=l.hasDecoKey,t[2]=l.hasOnlyDecoProvider,t[3]=l.isLoading,t[4]=l.isZeroBalance,t[5]=a,t[6]=e,t[7]=d):d=t[7];const f=d;let m;t[8]!==f?(m=f&&s.jsx(ee.CreditsEmptyState,{}),t[8]=f,t[9]=m):m=t[9];const h=i!=="chat"?!0:void 0,g=i!=="chat",j=i!=="chat"?"opacity-0 pointer-events-none":"opacity-100";let b;t[10]!==j?(b=Y("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",j),t[10]=j,t[11]=b):b=t[11];let x;t[12]!==a||t[13]!==u?(x=a&&u!=="cms"?s.jsx(ka,{onOpenContextPanel:()=>r("context")}):s.jsxs(s.Fragment,{children:[s.jsxs(ee.Main,{className:"relative flex flex-col overflow-hidden @container",children:[s.jsx(Sa,{}),s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(ee.Messages,{})})]}),s.jsx(ee.Footer,{children:s.jsx(ee.Input,{onOpenContextPanel:()=>r("context")})})]}),t[12]=a,t[13]=u,t[14]=x):x=t[14];let v;t[15]!==h||t[16]!==g||t[17]!==b||t[18]!==x?(v=s.jsx("div",{inert:h,"aria-hidden":g,className:b,children:x}),t[15]=h,t[16]=g,t[17]=b,t[18]=x,t[19]=v):v=t[19];const k=i!=="context"?!0:void 0,y=i!=="context",p=i==="context"?"opacity-100":"opacity-0 pointer-events-none";let T;t[20]!==p?(T=Y("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",p),t[20]=p,t[21]=T):T=t[21];let N;t[22]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(da,{back:!0,onClose:()=>r("chat")}),t[22]=N):N=t[22];let S;t[23]!==T||t[24]!==k||t[25]!==y?(S=s.jsx("div",{inert:k,"aria-hidden":y,className:T,children:N}),t[23]=T,t[24]=k,t[25]=y,t[26]=S):S=t[26];let w;return t[27]!==m||t[28]!==S||t[29]!==v?(w=s.jsxs(ee,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[m,v,S]}),t[27]=m,t[28]=S,t[29]=v,t[30]=w):w=t[30],w}function Ca(){const t=$.c(7),e=U();let n;t[0]!==e?(n=e("agentShellLayout.agentShellLayout.chatLoadingError"),t[0]=e,t[1]=n):n=t[1];let a;t[2]!==n?(a=s.jsx("div",{role:"alert",className:"flex h-full flex-1 items-center justify-center text-sm text-muted-foreground",children:n}),t[2]=n,t[3]=a):a=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Fe,{children:s.jsx(wa,{})}),t[4]=i):i=t[4];let r;return t[5]!==a?(r=s.jsx(Ct,{fallback:a,children:i}),t[5]=a,t[6]=r):r=t[6],r}function Pa(t){const e=$.c(10),{org:n}=le(),a=sn(),{data:i}=Re.useSession(),r=i?.user?.id,l=t?.id??null,c=!!t&&!!r&&!!t.created_by&&t.created_by!==r;let u;e[0]!==n.id||e[1]!==l?(u=Pt.viewedThreadMetadataRefresh(n.id,l??""),e[0]=n.id,e[1]=l,e[2]=u):u=e[2];const o=!!a&&!!l&&c;let d;e[3]!==a||e[4]!==l?(d=async()=>(await a?.refreshThreadMetadata(l??""),!0),e[3]=a,e[4]=l,e[5]=d):d=e[5];let f;e[6]!==u||e[7]!==o||e[8]!==d?(f={queryKey:u,enabled:o,staleTime:Number.POSITIVE_INFINITY,queryFn:d},e[6]=u,e[7]=o,e[8]=d,e[9]=f):f=e[9],nt(f)}function Ze(t){const e=$.c(13),{label:n,value:a,onChange:i,options:r}=t;let l;e[0]!==n?(l=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=l):l=e[1];let c;e[2]!==i?(c=f=>f&&i(f),e[2]=i,e[3]=c):c=e[3];let u;e[4]!==r?(u=r.map(Aa),e[4]=r,e[5]=u):u=e[5];let o;e[6]!==c||e[7]!==u||e[8]!==a?(o=s.jsx(bn,{type:"single",size:"sm",value:a,onValueChange:c,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:u}),e[6]=c,e[7]=u,e[8]=a,e[9]=o):o=e[9];let d;return e[10]!==l||e[11]!==o?(d=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l,o]}),e[10]=l,e[11]=o,e[12]=d):d=e[12],d}function Aa(t){return s.jsxs(gn,{value:t.value,className:"h-6 gap-1.5 classic:rounded-md compact:rounded-lg 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 Ia(t){const e=$.c(91),{panel:n,className:a}=t,i=a===void 0?"md:size-[34px]":a,r=U();let l;e[0]!==r?(l=r("sidebar.taskGroupsList.filterChats"),e[0]=r,e[1]=l):l=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(xn,{size:16}),e[2]=c):c=e[2];let u;e[3]!==n.filtersActive?(u=n.filtersActive&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"}),e[3]=n.filtersActive,e[4]=u):u=e[4];let o;e[5]!==i||e[6]!==n.filtersActive||e[7]!==l||e[8]!==u?(o=s.jsx(Te,{asChild:!0,children:s.jsx(Kt,{asChild:!0,children:s.jsxs(De,{"aria-label":l,active:n.filtersActive,className:i,children:[c,u]})})}),e[5]=i,e[6]=n.filtersActive,e[7]=l,e[8]=u,e[9]=o):o=e[9];let d;e[10]!==r?(d=r("sidebar.taskGroupsList.filterChats"),e[10]=r,e[11]=d):d=e[11];let f;e[12]!==d?(f=s.jsx(_e,{side:"bottom",children:d}),e[12]=d,e[13]=f):f=e[13];let m;e[14]!==o||e[15]!==f?(m=s.jsxs(we,{children:[o,f]}),e[14]=o,e[15]=f,e[16]=m):m=e[16];let h;e[17]!==r?(h=r("sidebar.taskGroupsList.filterView"),e[17]=r,e[18]=h):h=e[18];const g=n.groupBy;let j;e[19]!==n?(j=q=>{ce("tasks_panel_group_by_changed",{to_value:q}),n.setGroupBy(q)},e[19]=n,e[20]=j):j=e[20];let b;e[21]!==r?(b=r("sidebar.taskGroupsList.viewList"),e[21]=r,e[22]=b):b=e[22];let x;e[23]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Is,{size:13}),e[23]=x):x=e[23];let v;e[24]!==b?(v={value:"flat",label:b,icon:x},e[24]=b,e[25]=v):v=e[25];let k;e[26]!==r?(k=r("sidebar.taskGroupsList.viewStatus"),e[26]=r,e[27]=k):k=e[27];let y;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ms,{size:13}),e[28]=y):y=e[28];let p;e[29]!==k?(p={value:"status",label:k,icon:y},e[29]=k,e[30]=p):p=e[30];let T;e[31]!==v||e[32]!==p?(T=[v,p],e[31]=v,e[32]=p,e[33]=T):T=e[33];let N;e[34]!==n.groupBy||e[35]!==j||e[36]!==T||e[37]!==h?(N=s.jsx(Ze,{label:h,value:g,onChange:j,options:T}),e[34]=n.groupBy,e[35]=j,e[36]=T,e[37]=h,e[38]=N):N=e[38];let S;e[39]!==r?(S=r("sidebar.taskGroupsList.filterType"),e[39]=r,e[40]=S):S=e[40];const w=n.typeFilter;let _;e[41]!==n?(_=q=>{ce("tasks_panel_filter_changed",{to_value:q}),n.setTypeFilter(q)},e[41]=n,e[42]=_):_=e[42];let C;e[43]!==r?(C=r("sidebar.taskGroupsList.typeAll"),e[43]=r,e[44]=C):C=e[44];let A;e[45]!==C?(A={value:"all",label:C},e[45]=C,e[46]=A):A=e[46];let P;e[47]!==r?(P=r("sidebar.taskGroupsList.typeChats"),e[47]=r,e[48]=P):P=e[48];let M;e[49]!==P?(M={value:"manual",label:P},e[49]=P,e[50]=M):M=e[50];let I;e[51]!==r?(I=r("sidebar.taskGroupsList.typeAuto"),e[51]=r,e[52]=I):I=e[52];let D;e[53]!==I?(D={value:"automation",label:I},e[53]=I,e[54]=D):D=e[54];let E;e[55]!==A||e[56]!==M||e[57]!==D?(E=[A,M,D],e[55]=A,e[56]=M,e[57]=D,e[58]=E):E=e[58];let F;e[59]!==n.typeFilter||e[60]!==S||e[61]!==_||e[62]!==E?(F=s.jsx(Ze,{label:S,value:w,onChange:_,options:E}),e[59]=n.typeFilter,e[60]=S,e[61]=_,e[62]=E,e[63]=F):F=e[63];let L;e[64]!==r?(L=r("sidebar.taskGroupsList.filterScope"),e[64]=r,e[65]=L):L=e[65];const G=n.showAll?"team":"mine";let O;e[66]!==n?(O=q=>n.setShowAll(q==="team"),e[66]=n,e[67]=O):O=e[67];let K;e[68]!==r?(K=r("sidebar.taskGroupsList.scopeMine"),e[68]=r,e[69]=K):K=e[69];let R;e[70]!==K?(R={value:"mine",label:K},e[70]=K,e[71]=R):R=e[71];let Q;e[72]!==r?(Q=r("sidebar.taskGroupsList.scopeTeam"),e[72]=r,e[73]=Q):Q=e[73];let V;e[74]!==Q?(V={value:"team",label:Q},e[74]=Q,e[75]=V):V=e[75];let W;e[76]!==R||e[77]!==V?(W=[R,V],e[76]=R,e[77]=V,e[78]=W):W=e[78];let Z;e[79]!==L||e[80]!==G||e[81]!==O||e[82]!==W?(Z=s.jsx(Ze,{label:L,value:G,onChange:O,options:W}),e[79]=L,e[80]=G,e[81]=O,e[82]=W,e[83]=Z):Z=e[83];let X;e[84]!==N||e[85]!==F||e[86]!==Z?(X=s.jsxs(Wt,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[N,F,Z]}),e[84]=N,e[85]=F,e[86]=Z,e[87]=X):X=e[87];let H;return e[88]!==X||e[89]!==m?(H=s.jsxs(qt,{children:[m,X]}),e[88]=X,e[89]=m,e[90]=H):H=e[90],H}function Ma(t,e){return t.filter(n=>n.id===e||!!n.trigger_id||un(n))}function La(){const t=$.c(2),e=Rt()??[];let n;return t[0]!==e?(n=a=>{if(!a)return;const i=e.find(r=>r.id===a);return i?zt(i.metadata):void 0},t[0]=e,t[1]=n):n=t[1],n}function $a(t){const e=$.c(9),{virtualMcpId:n,size:a,showAutomationBadge:i}=t,r=a===void 0?"sm":a,l=U();let c;e[0]!==r||e[1]!==n?(c=n?s.jsx(Da,{virtualMcpId:n,size:r}):s.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=c):c=e[2];let u;e[3]!==i||e[4]!==l?(u=i&&s.jsx("span",{"aria-label":l("tasksPanel.mcpAvatar.automationTriggered"),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(Zt,{size:10,className:"text-white"})}),e[3]=i,e[4]=l,e[5]=u):u=e[5];let o;return e[6]!==c||e[7]!==u?(o=s.jsxs("div",{className:"relative shrink-0",children:[c,u]}),e[6]=c,e[7]=u,e[8]=o):o=e[8],o}function Da(t){const e=$.c(6),{virtualMcpId:n,size:a}=t,i=de(n);if(!i){let c;return e[0]!==a?(c=s.jsx(ye,{icon:null,name:"?",size:a}),e[0]=a,e[1]=c):c=e[1],c}const r=i.icon??null;let l;return e[2]!==i.title||e[3]!==a||e[4]!==r?(l=s.jsx(ye,{icon:r,name:i.title,size:a}),e[2]=i.title,e[3]=a,e[4]=r,e[5]=l):l=e[5],l}const kt=["thread"];function Ea(t){const e=$.c(53),{open:n,onOpenChange:a}=t,[i,r]=B.useState(""),{org:l}=le(),{setTaskId:c}=ot(),u=at(),o=U();let d,f,m,h;e[0]!==l.id||e[1]!==i?(h=i.trim(),d=h?20:10,m=nt,f=Pt.globalSearch(l.id,h,d,kt),e[0]=l.id,e[1]=i,e[2]=d,e[3]=f,e[4]=m,e[5]=h):(d=e[2],f=e[3],m=e[4],h=e[5]);let g;e[6]!==d||e[7]!==u||e[8]!==h?(g=async()=>{const L=await u.call("GLOBAL_SEARCH",{query:h,limit:d,types:[...kt]});return{...L,items:L.items.filter(Fa)}},e[6]=d,e[7]=u,e[8]=h,e[9]=g):g=e[9];let j;e[10]!==n||e[11]!==f||e[12]!==g?(j={queryKey:f,enabled:n,queryFn:g,staleTime:1e4},e[10]=n,e[11]=f,e[12]=g,e[13]=j):j=e[13];const{data:b,isFetching:x}=m(j);let v;e[14]!==b?.items?(v=b?.items??[],e[14]=b?.items,e[15]=v):v=e[15];const k=v;let y;e[16]!==a?(y=L=>{L||r(""),a(L)},e[16]=a,e[17]=y):y=e[17];const p=y;let T;e[18]!==p||e[19]!==c?(T=L=>{p(!1),c(L.id,L.virtual_mcp_id??void 0)},e[18]=p,e[19]=c,e[20]=T):T=e[20];const N=T;let S;e[21]!==o?(S=o("tasksPanel.globalSearchDialog.title"),e[21]=o,e[22]=S):S=e[22];let w;e[23]!==S?(w=s.jsx(kn,{children:S}),e[23]=S,e[24]=w):w=e[24];let _;e[25]!==o?(_=o("tasksPanel.globalSearchDialog.description"),e[25]=o,e[26]=_):_=e[26];let C;e[27]!==_?(C=s.jsx(Nn,{children:_}),e[27]=_,e[28]=C):C=e[28];let A;e[29]!==C||e[30]!==w?(A=s.jsxs(Sn,{className:"sr-only",children:[w,C]}),e[29]=C,e[30]=w,e[31]=A):A=e[31];let P;e[32]!==o?(P=o("tasksPanel.globalSearchDialog.placeholder"),e[32]=o,e[33]=P):P=e[33];let M;e[34]!==i||e[35]!==P?(M=s.jsx(In,{value:i,onValueChange:r,placeholder:P}),e[34]=i,e[35]=P,e[36]=M):M=e[36];let I;e[37]!==N||e[38]!==x||e[39]!==k||e[40]!==o||e[41]!==h?(I=s.jsx(wn,{children:x&&k.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:o("tasksPanel.globalSearchDialog.searching")}):k.length===0?s.jsx(Cn,{children:o("tasksPanel.globalSearchDialog.noResults")}):s.jsx(Pn,{heading:h?void 0:o("tasksPanel.globalSearchDialog.recent"),children:k.map(L=>L.type==="thread"?s.jsxs(An,{value:`thread:${L.id}:${L.title}`,onSelect:()=>N(L),className:"gap-2.5",children:[s.jsx($a,{virtualMcpId:L.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:L.title||o("tasksPanel.globalSearchDialog.untitledChat")})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(L.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${L.id}`):null)})}),e[37]=N,e[38]=x,e[39]=k,e[40]=o,e[41]=h,e[42]=I):I=e[42];let D;e[43]!==M||e[44]!==I?(D=s.jsxs(Mn,{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:[M,I]}),e[43]=M,e[44]=I,e[45]=D):D=e[45];let E;e[46]!==A||e[47]!==D?(E=s.jsxs(Tn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[A,D]}),e[46]=A,e[47]=D,e[48]=E):E=e[48];let F;return e[49]!==p||e[50]!==n||e[51]!==E?(F=s.jsx(_n,{open:n,onOpenChange:p,children:E}),e[49]=p,e[50]=n,e[51]=E,e[52]=F):F=e[52],F}function Fa(t){return t.type==="thread"}function Ra(t){const e=$.c(43),{branch:n,onOutcome:a}=t,i=U();let r;e[0]!==a?(r=N=>{N||a("cancel")},e[0]=a,e[1]=r):r=e[1];let l;e[2]!==i?(l=i("sidebar.archiveWorktreeDialog.title"),e[2]=i,e[3]=l):l=e[3];let c;e[4]!==l?(c=s.jsx(Ln,{children:l}),e[4]=l,e[5]=c):c=e[5];let u;e[6]!==i?(u=i("sidebar.archiveWorktreeDialog.stopsAndDeletesBefore"),e[6]=i,e[7]=u):u=e[7];let o;e[8]!==n?(o=s.jsx("span",{className:"font-mono",children:n}),e[8]=n,e[9]=o):o=e[9];let d;e[10]!==i?(d=i("sidebar.archiveWorktreeDialog.stopsAndDeletesAfter"),e[10]=i,e[11]=d):d=e[11];let f;e[12]!==u||e[13]!==o||e[14]!==d?(f=s.jsxs($n,{children:[u," ",o," ",d]}),e[12]=u,e[13]=o,e[14]=d,e[15]=f):f=e[15];let m;e[16]!==c||e[17]!==f?(m=s.jsxs(Dn,{children:[c,f]}),e[16]=c,e[17]=f,e[18]=m):m=e[18];let h;e[19]!==a?(h=()=>a("cancel"),e[19]=a,e[20]=h):h=e[20];let g;e[21]!==i?(g=i("sidebar.archiveWorktreeDialog.cancel"),e[21]=i,e[22]=g):g=e[22];let j;e[23]!==g||e[24]!==h?(j=s.jsx(En,{onClick:h,children:g}),e[23]=g,e[24]=h,e[25]=j):j=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=Y(ls({variant:"destructive"})),e[26]=b):b=e[26];let x;e[27]!==a?(x=()=>a("confirm"),e[27]=a,e[28]=x):x=e[28];let v;e[29]!==i?(v=i("sidebar.archiveWorktreeDialog.confirm"),e[29]=i,e[30]=v):v=e[30];let k;e[31]!==x||e[32]!==v?(k=s.jsx(Fn,{className:b,onClick:x,children:v}),e[31]=x,e[32]=v,e[33]=k):k=e[33];let y;e[34]!==j||e[35]!==k?(y=s.jsxs(Rn,{children:[j,k]}),e[34]=j,e[35]=k,e[36]=y):y=e[36];let p;e[37]!==y||e[38]!==m?(p=s.jsxs(Bn,{children:[m,y]}),e[37]=y,e[38]=m,e[39]=p):p=e[39];let T;return e[40]!==r||e[41]!==p?(T=s.jsx(On,{open:!0,onOpenChange:r,children:p}),e[40]=r,e[41]=p,e[42]=T):T=e[42],T}function Ba(t,e,n){if(!n)return;const a=t.findIndex(i=>i.id===e);if(a!==-1){for(let i=a+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=a-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Oa(t){return t==="ephemeral"||t.startsWith("thread:")}function es(t){const e=$.c(45),{task:n,isActive:a,onClick:i,onArchive:r,showAutomationBadge:l,showAgentIcon:c,hideStatusIdle:u,indented:o}=t,d=U(),f=zn(n.status),m=f.icon,h=n.metadata?.kind==="tool_call_run",g=de(h?void 0:n.virtual_mcp_id);let j;e[0]!==g?(j=Ut(g),e[0]=g,e[1]=j):j=e[1];const b=j;Hs(6e4);const x=l||!!n.trigger_id,v=n.id,k="button",y=0;let p;e[2]!==i?(p=O=>{O.target===O.currentTarget&&(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),i())},e[2]=i,e[3]=p):p=e[3];const T=o?"-ml-4 pl-6":"pl-[9px]",N=a?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==T||e[5]!==N?(S=Y("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",T,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=T,e[5]=N,e[6]=S):S=e[6];let w;e[7]!==h||e[8]!==c||e[9]!==g?.icon||e[10]!==g?.title?(w=c&&!h&&s.jsx(ye,{icon:g?.icon??null,name:g?.title??"?",size:"2xs"}),e[7]=h,e[8]=c,e[9]=g?.icon,e[10]=g?.title,e[11]=w):w=e[11];let _;e[12]!==x||e[13]!==d?(_=x&&s.jsx(Zt,{size:12,"aria-label":d("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-blue-500"}),e[12]=x,e[13]=d,e[14]=_):_=e[14];let C;e[15]!==d||e[16]!==n.title?(C=n.title||d("tasksPanel.taskRow.untitledTask"),e[15]=d,e[16]=n.title,e[17]=C):C=e[17];let A;e[18]!==C?(A=s.jsx("div",{className:"text-sm text-foreground truncate",children:C}),e[18]=C,e[19]=A):A=e[19];let P;e[20]!==_||e[21]!==A?(P=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[_,A]}),e[20]=_,e[21]=A,e[22]=P):P=e[22];let M;e[23]!==b||e[24]!==a||e[25]!==n.branch||e[26]!==n.updated_at?(M=n.updated_at&&s.jsxs("div",{className:Y("flex items-center gap-1 text-[11px] min-w-0",a?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Oa(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):b?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[b.owner,"/",b.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Hn(new Date(n.updated_at))})]}),e[23]=b,e[24]=a,e[25]=n.branch,e[26]=n.updated_at,e[27]=M):M=e[27];let I;e[28]!==P||e[29]!==M?(I=s.jsxs("div",{className:"flex-1 min-w-0",children:[P,M]}),e[28]=P,e[29]=M,e[30]=I):I=e[30];const D="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",E=!u&&s.jsx("span",{className:Y("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":d("tasksPanel.taskRow.statusLabel",{status:d(f.labelKey)}),children:n.status==="in_progress"?s.jsx(je,{className:Y("size-3.5",f.iconClassName)}):s.jsx(m,{size:14,className:f.iconClassName})});let F;e[31]!==r||e[32]!==d?(F=r&&s.jsxs(we,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":d("tasksPanel.taskRow.archiveTask"),onClick:O=>{O.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-8 items-center justify-center classic:rounded-md compact:rounded-lg 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(os,{size:14})})}),s.jsx(_e,{side:"right",children:d("tasksPanel.taskRow.archive")})]}),e[31]=r,e[32]=d,e[33]=F):F=e[33];let L;e[34]!==E||e[35]!==F?(L=s.jsxs("div",{className:D,children:[E,F]}),e[34]=E,e[35]=F,e[36]=L):L=e[36];let G;return e[37]!==i||e[38]!==I||e[39]!==L||e[40]!==p||e[41]!==S||e[42]!==w||e[43]!==n.id?(G=s.jsxs("div",{"data-task-id":v,role:k,tabIndex:y,onClick:i,onKeyDown:p,className:S,children:[w,I,L]}),e[37]=i,e[38]=I,e[39]=L,e[40]=p,e[41]=S,e[42]=w,e[43]=n.id,e[44]=G):G=e[44],G}const Nt=["requires_action","in_progress","failed","expired","completed"];function za(t){const e=new Map(Nt.map(n=>[n,[]]));for(const n of t){const a=n.status??"completed";(e.get(a)??e.get("completed")).push(n)}return Nt.map(n=>({status:n,threads:e.get(n)}))}const Ga="sidebar.group.expanded.";function Ha(t,e){const n=$.c(3),[a,i]=At(`${Ga}${t}`,e);let r;return n[0]!==a||n[1]!==i?(r=[a,i],n[0]=a,n[1]=i,n[2]=r):r=n[2],r}function ts(t){const e=$.c(18),{onClick:n,isFetching:a,indented:i}=t,r=U();let l;e[0]!==r?(l=r("sidebar.showMoreButton.ariaLabel"),e[0]=r,e[1]=l):l=e[1];const c=i?"-ml-4 pl-6 pr-2":"px-2";let u;e[2]!==c?(u=Y("flex items-center gap-2 py-1.5 classic:rounded-md compact:rounded-lg text-sm text-muted-foreground",c,"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[2]=c,e[3]=u):u=e[3];let o;e[4]!==a?(o=a&&s.jsx(je,{className:"size-3.5"}),e[4]=a,e[5]=o):o=e[5];let d;e[6]!==a||e[7]!==r?(d=r(a?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=a,e[7]=r,e[8]=d):d=e[8];let f;e[9]!==d?(f=s.jsx("span",{children:d}),e[9]=d,e[10]=f):f=e[10];let m;return e[11]!==a||e[12]!==n||e[13]!==l||e[14]!==u||e[15]!==o||e[16]!==f?(m=s.jsxs("button",{type:"button","aria-label":l,onClick:n,disabled:a,className:u,children:[o,f]}),e[11]=a,e[12]=n,e[13]=l,e[14]=u,e[15]=o,e[16]=f,e[17]=m):m=e[17],m}function Ua(t,e,n,a){return[t,e,n,a.type,a.member,a.currentUserId??""].join("|")}function Va(t){return t.member==="mine"&&!t.currentUserId}const ss=4;let $e=0;const tt=[];function Ka(){for(;$e<ss&&tt.length>0;){const t=tt.shift();t&&t()}}function ns(t){return new Promise((e,n)=>{const a=()=>{$e++,t().then(e,n).finally(()=>{$e--,Ka()})};$e<ss?a():tt.push(a)})}const Ue=10;function St(t,e,n,a,i){const r={hidden:!1};a.member==="mine"&&a.currentUserId&&(r.created_by=a.currentUserId),a.type==="automation"&&(r.has_trigger=!0),a.type==="manual"&&(r.has_trigger=!1);const l={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return l.status=e,l}function Wa(t,e,n,a){let i=0;for(const r of t)as(r,e,n,a)&&i++;return i}function Xe(t,e,n,a){return Wa(t,e,n,a)}function qa(t,e){return!!(t>=Ue||t===0&&e)}function Tt(t,e){return t<e}function Ya(t,e){return e===!1?!1:e===!0?!0:t}function as(t,e,n,a){return!(t.hidden||(t.status??"completed")!==n||a.member==="mine"&&a.currentUserId&&t.created_by!==a.currentUserId||a.type==="automation"&&!t.trigger_id||a.type==="manual"&&t.trigger_id)}const Ee=new Map,Me=new Map;function Qa(t,e){return e?t>=Ue?!0:null:!1}function _t(t){return Ee.get(t)}function Za(t,e){Ee.set(t,e)}function Xa(t,e,n){const a=Ee.get(t);if(a!==void 0){n(a);return}let i=Me.get(t);i||(i=ns(e).then(r=>(Ee.set(t,r),Me.delete(t),r)).catch(()=>(Me.delete(t),Promise.reject(new Error("group probe failed")))),Me.set(t,i)),i.then(n,()=>n(!1))}function wt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ue,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Ja(t,e,n,a,i){let r=0;for(const l of t)e.has(l.id)||as(l,n,a,i)&&r++;return r}function er(t,e,n,a){const i=$.c(8),{org:r}=le(),l=Ua(r.id,t,e,n);let c;i[0]!==n?(c=Va(n),i[0]=n,i[1]=c):c=i[1];const u=c,[o,d]=B.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});o.identity!==l&&d({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const f=ct(),{threads:m,hasMore:h}=dt(),g=Xe(m,t,e,n),j=qa(g,h),b=Qa(g,h),x=at();if(o.identity===l&&o.serverHasMore===null){const N=b??_t(l);N!==void 0&&d({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:o.probeSubscribedIdentity,serverHasMore:N})}!u&&o.identity===l&&o.serverHasMore===null&&b===null&&_t(l)===void 0&&o.probeSubscribedIdentity!==l&&(d(N=>N.identity===l?{...N,isProbing:!0,probeSubscribedIdentity:l}:N),Xa(l,async()=>{const N=St(t,e,0,n,1),S=await x.call("COLLECTION_THREADS_LIST",N),{totalCount:w}=wt(S),_=Xe(f.threads.get(),t,e,n);return w===void 0?!1:Tt(_,w)},N=>{d(S=>S.identity!==l?S:{...S,isProbing:!1,serverHasMore:N})}));const k=async function(){if(o.isFetching||o.isProbing||u)return;const S=l;d(w=>w.identity===S?{...w,isFetching:!0}:w);try{const w=Xe(m,t,e,n),_=St(t,e,w,n,Ue),C=await ns(()=>x.call("COLLECTION_THREADS_LIST",_)),{items:A,hasMore:P,totalCount:M}=wt(C),I=new Set(m.map(tr)),D=Ja(A,I,t,e,n),E=w;f.mergeThreads(A),d(F=>{if(F.identity!==S)return F;let L;return M!==void 0?L=Tt(E+D,M):L=A.length===0||D===0?!1:P,Za(S,L),{...F,isFetching:!1,serverHasMore:L}})}catch(w){const _=w,C=_ instanceof Error?_.message:String(_);It.error(`Could not load more tasks: ${C}`),d(A=>A.identity===S?{...A,isFetching:!1}:A)}},y=o.isFetching||o.isProbing,p=!u&&!y&&Ya(j,o.serverHasMore);let T;return i[2]!==y||i[3]!==k||i[4]!==p||i[5]!==o.isProbing||i[6]!==o.serverHasMore?(T={hasMore:p,isFetching:y,isProbing:o.isProbing,serverHasMore:o.serverHasMore,loadMore:k},i[2]=y,i[3]=k,i[4]=p,i[5]=o.isProbing,i[6]=o.serverHasMore,i[7]=T):T=i[7],T}function tr(t){return t.id}function sr(t){const e=$.c(20),{status:n,threads:a,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:c,filters:u}=t,{isFetching:o,isProbing:d,loadMore:f,hasMore:m,serverHasMore:h}=er("status",n,u),[g,j]=B.useState(!1);!g&&a.length===0&&h===!0&&!o&&!d&&(j(!0),queueMicrotask(()=>{f()}));let b;if(e[0]!==i||e[1]!==c||e[2]!==u||e[3]!==l||e[4]!==r||e[5]!==a){let k;e[7]!==i||e[8]!==c||e[9]!==u||e[10]!==l||e[11]!==r?(k=y=>s.jsx(es,{task:y,isActive:i===y.id,onClick:()=>r(y),onArchive:c&&y.created_by===u.currentUserId?()=>l(y):void 0,showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[7]=i,e[8]=c,e[9]=u,e[10]=l,e[11]=r,e[12]=k):k=e[12],b=a.map(k),e[0]=i,e[1]=c,e[2]=u,e[3]=l,e[4]=r,e[5]=a,e[6]=b}else b=e[6];let x;e[13]!==m||e[14]!==o||e[15]!==f?(x=(m||o)&&s.jsx(ts,{onClick:()=>{f()},isFetching:o,indented:!0}),e[13]=m,e[14]=o,e[15]=f,e[16]=x):x=e[16];let v;return e[17]!==b||e[18]!==x?(v=s.jsxs(s.Fragment,{children:[b,x]}),e[17]=b,e[18]=x,e[19]=v):v=e[19],v}function nr(t){const e=$.c(39),{status:n,threads:a,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:c,filters:u}=t,o=U(),d=Gn[n],f=d.icon,[m,h]=Ha(`status-${n}`,!1);let g;e[0]!==m||e[1]!==h?(g=function(){h(!m)},e[0]=m,e[1]=h,e[2]=g):g=e[2];const j=g;let b;e[3]!==j?(b=_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),j())},e[3]=j,e[4]=b):b=e[4];let x;e[5]!==f||e[6]!==d.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(f,{size:12,className:d.iconClassName})}),e[5]=f,e[6]=d.iconClassName,e[7]=x):x=e[7];let v;e[8]!==m?(v=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:m?s.jsx(lt,{size:14}):s.jsx(cs,{size:14})}),e[8]=m,e[9]=v):v=e[9];let k;e[10]!==x||e[11]!==v?(k=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,v]}),e[10]=x,e[11]=v,e[12]=k):k=e[12];let y;e[13]!==d.labelKey||e[14]!==o?(y=o(d.labelKey),e[13]=d.labelKey,e[14]=o,e[15]=y):y=e[15];let p;e[16]!==y?(p=s.jsx("span",{className:"flex-1 truncate",children:y}),e[16]=y,e[17]=p):p=e[17];let T;e[18]!==a.length?(T=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:a.length})}),e[18]=a.length,e[19]=T):T=e[19];let N;e[20]!==m||e[21]!==j||e[22]!==b||e[23]!==k||e[24]!==p||e[25]!==T?(N=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,onClick:j,onKeyDown:b,className:"group/group flex items-center gap-2 px-2 py-1.5 classic:rounded-md compact:rounded-lg 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:[k,p,T]}),e[20]=m,e[21]=j,e[22]=b,e[23]=k,e[24]=p,e[25]=T,e[26]=N):N=e[26];let S;e[27]!==i||e[28]!==c||e[29]!==m||e[30]!==u||e[31]!==l||e[32]!==r||e[33]!==n||e[34]!==a?(S=m&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(sr,{status:n,threads:a,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:c,filters:u})}),e[27]=i,e[28]=c,e[29]=m,e[30]=u,e[31]=l,e[32]=r,e[33]=n,e[34]=a,e[35]=S):S=e[35];let w;return e[36]!==S||e[37]!==N?(w=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[N,S]}),e[36]=S,e[37]=N,e[38]=w):w=e[38],w}function ar(t){const e=$.c(38),{threads:n,groupBy:a,activeTaskId:i,onSelectTask:r,onArchiveTask:l,filters:c,hasMore:u,isFetchingMore:o,onLoadMore:d,filtersActive:f}=t;if(n.length===0&&!u&&!o){let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ls,{className:"size-6 opacity-60"}),e[0]=b):b=e[0];const x=f?"No chats match your filters":"No chats yet";let v;return e[1]!==x?(v=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[b,s.jsx("p",{className:"text-sm",children:x})]}),e[1]=x,e[2]=v):v=e[2],v}const m=n.length>1||u;if(a==="status"){let b;if(e[3]!==i||e[4]!==m||e[5]!==c||e[6]!==l||e[7]!==r||e[8]!==n){let v;e[10]!==i||e[11]!==m||e[12]!==c||e[13]!==l||e[14]!==r?(v=k=>s.jsx(nr,{status:k.status,threads:k.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:m,filters:c},k.status),e[10]=i,e[11]=m,e[12]=c,e[13]=l,e[14]=r,e[15]=v):v=e[15],b=za(n).map(v),e[3]=i,e[4]=m,e[5]=c,e[6]=l,e[7]=r,e[8]=n,e[9]=b}else b=e[9];let x;return e[16]!==b?(x=s.jsx(s.Fragment,{children:b}),e[16]=b,e[17]=x):x=e[17],x}let h;if(e[18]!==i||e[19]!==m||e[20]!==c||e[21]!==l||e[22]!==r||e[23]!==n){let b;e[25]!==i||e[26]!==m||e[27]!==c||e[28]!==l||e[29]!==r?(b=x=>s.jsx(es,{task:x,isActive:i===x.id,onClick:()=>r(x),onArchive:m&&x.created_by===c.currentUserId?()=>l(x):void 0,showAutomationBadge:!!x.trigger_id,showAgentIcon:!0},x.id),e[25]=i,e[26]=m,e[27]=c,e[28]=l,e[29]=r,e[30]=b):b=e[30],h=n.map(b),e[18]=i,e[19]=m,e[20]=c,e[21]=l,e[22]=r,e[23]=n,e[24]=h}else h=e[24];let g;e[31]!==u||e[32]!==o||e[33]!==d?(g=(u||o)&&s.jsx(ts,{onClick:d,isFetching:o}),e[31]=u,e[32]=o,e[33]=d,e[34]=g):g=e[34];let j;return e[35]!==h||e[36]!==g?(j=s.jsxs(s.Fragment,{children:[h,g]}),e[35]=h,e[36]=g,e[37]=j):j=e[37],j}function rr(t,e){return null}function ir(t,e){return t.some(n=>n.id!==e.taskId&&!n.hidden&&n.branch===e.branch&&n.virtual_mcp_id===e.virtualMcpId)}const lr=["archive","reclaim-worktree"],or=[];function cr(t){return t==="confirm"?lr:or}function dr(t){const e=$.c(11),{panel:n}=t;let a;return e[0]!==n.activeTaskId||e[1]!==n.archiveTask||e[2]!==n.filters||e[3]!==n.filtersActive||e[4]!==n.groupBy||e[5]!==n.hasMore||e[6]!==n.isFetchingMore||e[7]!==n.loadMore||e[8]!==n.selectTask||e[9]!==n.threads?(a=s.jsx(ar,{threads:n.threads,groupBy:n.groupBy,activeTaskId:n.activeTaskId,onSelectTask:n.selectTask,onArchiveTask:n.archiveTask,filters:n.filters,hasMore:n.hasMore,isFetchingMore:n.isFetchingMore,onLoadMore:n.loadMore,filtersActive:n.filtersActive}),e[0]=n.activeTaskId,e[1]=n.archiveTask,e[2]=n.filters,e[3]=n.filtersActive,e[4]=n.groupBy,e[5]=n.hasMore,e[6]=n.isFetchingMore,e[7]=n.loadMore,e[8]=n.selectTask,e[9]=n.threads,e[10]=a):a=e[10],a}function ur(t){const e=$.c(83);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:a}=n,i=U(),{data:r}=Re.useSession(),l=r?.user?.id,{org:c}=le();let u;e[2]!==c.id?(u=Ne(c.id),e[2]=c.id,e[3]=u):u=e[3];const o=u.id,d=La(),{threads:f,hasMore:m,isFetchingMore:h,fetchNextPage:g}=dt(),j=f.filter(pr),{hide:b,setScope:x}=ut(),v=Be(),k=at(),{setTaskId:y,createNewTask:p}=ot(),T=Yt(),N=He();let S;e[4]!==N||e[5]!==f||e[6]!==T?(S=vn({routeAgentId:T,threadVirtualMcpId:f.find(z=>z.id===N)?.virtual_mcp_id}),e[4]=N,e[5]=f,e[6]=T,e[7]=S):S=e[7];const w=S;let _;e[8]!==a?(_=()=>{a?.()},e[8]=a,e[9]=_):_=e[9];const C=_,A=[...j].sort(hr),[P,M]=B.useState("all"),[I,D]=B.useState("flat"),[E,F]=At("sidebar-threads-scope-all",!1),[L,G]=B.useState(!1),[O,K]=B.useState(!1);let R;e[10]!==G?(R=()=>{ce("tasks_panel_search_opened"),K(!0),G(!0)},e[10]=G,e[11]=R):R=e[11];const Q=R,[V,W]=B.useState(null),Z=l??null;let X;e[12]!==Z||e[13]!==P?(X={type:P,member:"mine",currentUserId:Z},e[12]=Z,e[13]=P,e[14]=X):X=e[14];const H=X,q={};E||(q.created_by="me"),x(q);let ae;e[15]!==l?(ae=z=>l?z.filter(ne=>ne.created_by===l):[],e[15]=l,e[16]=ae):ae=e[16];const ie=ae;let J;e[17]!==P?(J=z=>P==="automation"?z.filter(fr):P==="manual"?z.filter(mr):z,e[17]=P,e[18]=J):J=e[18];const oe=J,te=Ma(oe(E?A:ie(A)),N);let se;e[19]!==N||e[20]!==C||e[21]!==l||e[22]!==b||e[23]!==v||e[24]!==c.slug||e[25]!==y||e[26]!==te?(se=z=>{const ne=z.id===N,xe=b(z.id);if(Ws(z.id),!ne)return xe;const be=Ba(te,z.id,l);return C(),be?y(be.id,be.virtual_mcp_id):v({to:"/$org",params:{org:c.slug}}),xe},e[19]=N,e[20]=C,e[21]=l,e[22]=b,e[23]=v,e[24]=c.slug,e[25]=y,e[26]=te,e[27]=se):se=e[27];const re=se;let ue;e[28]!==k||e[29]!==i?(ue=async z=>{try{await k.call("SANDBOX_DELETE",{virtualMcpId:z.virtualMcpId,branch:z.branch,removeWorktree:!0})}catch{It.error(i("sidebar.archiveWorktreeDialog.reclaimFailed",{branch:z.branch}))}},e[28]=k,e[29]=i,e[30]=ue):ue=e[30];const ge=ue;let me;e[31]!==f||e[32]!==re||e[33]!==l||e[34]!==W?(me=z=>{if(l&&z.created_by&&z.created_by!==l)return;const ne=rr();if(!ne||ir(f,ne)){re(z);return}W({task:z,target:ne})},e[31]=f,e[32]=re,e[33]=l,e[34]=W,e[35]=me):me=e[35];const Ve=me;let Ce;e[36]!==re||e[37]!==V||e[38]!==ge||e[39]!==W?(Ce=z=>{const ne=V;ne&&(W(null),(async()=>{for(const xe of cr(z))if(xe==="archive")try{await re(ne.task)}catch{return}else await ge(ne.target)})())},e[36]=re,e[37]=V,e[38]=ge,e[39]=W,e[40]=Ce):Ce=e[40];const Ke=Ce;let Pe;e[41]!==C||e[42]!==y?(Pe=z=>{C(),y(z.id,z.virtual_mcp_id)},e[41]=C,e[42]=y,e[43]=Pe):Pe=e[43];const We=Pe;let Ae;e[44]!==w||e[45]!==N||e[46]!==f||e[47]!==C||e[48]!==p||e[49]!==l||e[50]!==o||e[51]!==d||e[52]!==y?(Ae=()=>{const z=w??o;ce("sidebar_new_thread_clicked",{virtual_mcp_id:z}),C();const ne=nn(f,z,l,d(z));if(ne){y(ne.id,ne.virtual_mcp_id);return}const xe=f.find(be=>be.id===N)?.branch??null;p(z,xe)},e[44]=w,e[45]=N,e[46]=f,e[47]=C,e[48]=p,e[49]=l,e[50]=o,e[51]=d,e[52]=y,e[53]=Ae):Ae=e[53];const qe=Ae;let fe;e[54]!==g?(fe=()=>{g()},e[54]=g,e[55]=fe):fe=e[55];const Ye=I!=="flat"||P!=="all"||E;let he;e[56]!==Ke||e[57]!==V?(he=V?s.jsx(Ra,{branch:V.target.branch,onOutcome:Ke}):null,e[56]=Ke,e[57]=V,e[58]=he):he=e[58];let pe;e[59]!==O||e[60]!==L||e[61]!==G?(pe=O?s.jsx(Ea,{open:L,onOpenChange:G}):null,e[59]=O,e[60]=L,e[61]=G,e[62]=pe):pe=e[62];let Ie;return e[63]!==N||e[64]!==Ve||e[65]!==H||e[66]!==I||e[67]!==m||e[68]!==h||e[69]!==qe||e[70]!==Q||e[71]!==We||e[72]!==D||e[73]!==F||e[74]!==M||e[75]!==E||e[76]!==fe||e[77]!==Ye||e[78]!==he||e[79]!==pe||e[80]!==P||e[81]!==te?(Ie={threads:te,activeTaskId:N,filters:H,hasMore:m,isFetchingMore:h,loadMore:fe,groupBy:I,setGroupBy:D,typeFilter:P,setTypeFilter:M,showAll:E,setShowAll:F,filtersActive:Ye,selectTask:We,archiveTask:Ve,newThread:qe,openSearch:Q,reclaimDialog:he,searchDialog:pe},e[63]=N,e[64]=Ve,e[65]=H,e[66]=I,e[67]=m,e[68]=h,e[69]=qe,e[70]=Q,e[71]=We,e[72]=D,e[73]=F,e[74]=M,e[75]=E,e[76]=fe,e[77]=Ye,e[78]=he,e[79]=pe,e[80]=P,e[81]=te,e[82]=Ie):Ie=e[82],Ie}function mr(t){return!t.trigger_id}function fr(t){return!!t.trigger_id}function hr(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function pr(t){return!t.hidden}function xr(){const t=$.c(60),e=U(),[n,a]=B.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={onNavigate:()=>a(!1)},t[0]=i):i=t[0];const r=ur(i),l=ze()?.activeTask;let c;t[1]!==l?.title||t[2]!==r.activeTaskId||t[3]!==r.threads||t[4]!==e?(c=l?.title||r.threads.find(F=>F.id===r.activeTaskId)?.title||e("tasksPanel.taskRow.untitledTask"),t[1]=l?.title,t[2]=r.activeTaskId,t[3]=r.threads,t[4]=e,t[5]=c):c=t[5];const u=c;let o;t[6]!==r?(o=()=>{a(!1),r.openSearch()},t[6]=r,t[7]=o):o=t[7];const d=o;let f;t[8]!==e?(f=e("chat.threadsMenu.chats"),t[8]=e,t[9]=f):f=t[9];const m=n&&"bg-sidebar-accent";let h;t[10]!==m?(h=Y("flex h-[34px] min-w-0 shrink items-center gap-1.5 rounded-lg px-2 text-sm text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",m),t[10]=m,t[11]=h):h=t[11];let g;t[12]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx($s,{size:16,className:"shrink-0"}),t[12]=g):g=t[12];let j;t[13]!==u?(j=s.jsx("span",{className:"truncate max-w-[10rem] font-medium",children:u}),t[13]=u,t[14]=j):j=t[14];let b;t[15]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(lt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[15]=b):b=t[15];let x;t[16]!==f||t[17]!==h||t[18]!==j?(x=s.jsx(Te,{asChild:!0,children:s.jsx(Kt,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":f,className:h,children:[g,j,b]})})}),t[16]=f,t[17]=h,t[18]=j,t[19]=x):x=t[19];let v;t[20]!==e?(v=e("chat.threadsMenu.chats"),t[20]=e,t[21]=v):v=t[21];let k;t[22]!==v?(k=s.jsx(_e,{side:"bottom",children:v}),t[22]=v,t[23]=k):k=t[23];let y;t[24]!==k||t[25]!==x?(y=s.jsxs(we,{children:[x,k]}),t[24]=k,t[25]=x,t[26]=y):y=t[26];let p;t[27]!==r?(p=s.jsx(Ia,{panel:r,className:"size-8 classic:rounded-lg"}),t[27]=r,t[28]=p):p=t[28];let T;t[29]!==e?(T=e("sidebar.taskGroupsList.searchChats"),t[29]=e,t[30]=T):T=t[30];let N;t[31]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Ds,{size:16}),t[31]=N):N=t[31];let S;t[32]!==d||t[33]!==T?(S=s.jsx(De,{"aria-label":T,onClick:d,className:"size-8 classic:rounded-lg",children:N}),t[32]=d,t[33]=T,t[34]=S):S=t[34];let w;t[35]!==e?(w=e("sidebar.taskGroupsList.newChat"),t[35]=e,t[36]=w):w=t[36];let _;t[37]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ft,{size:16}),t[37]=_):_=t[37];let C;t[38]!==r.newThread||t[39]!==w?(C=s.jsx(De,{"aria-label":w,onClick:r.newThread,className:"size-8 classic:rounded-lg",children:_}),t[38]=r.newThread,t[39]=w,t[40]=C):C=t[40];let A;t[41]!==S||t[42]!==C?(A=s.jsxs("div",{className:"flex items-center gap-0.5",children:[S,C]}),t[41]=S,t[42]=C,t[43]=A):A=t[43];let P;t[44]!==p||t[45]!==A?(P=s.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[p,A]}),t[44]=p,t[45]=A,t[46]=P):P=t[46];let M;t[47]!==r?(M=s.jsx("div",{className:"flex max-h-[60vh] min-h-0 flex-col gap-0.5 overflow-y-auto overscroll-contain",children:s.jsx(dr,{panel:r})}),t[47]=r,t[48]=M):M=t[48];let I;t[49]!==P||t[50]!==M?(I=s.jsxs(Wt,{align:"start",side:"bottom",onOpenAutoFocus:gr,className:"flex w-80 flex-col gap-2 p-2",children:[P,M]}),t[49]=P,t[50]=M,t[51]=I):I=t[51];let D;t[52]!==n||t[53]!==y||t[54]!==I?(D=s.jsxs(qt,{open:n,onOpenChange:a,children:[y,I]}),t[52]=n,t[53]=y,t[54]=I,t[55]=D):D=t[55];let E;return t[56]!==r.reclaimDialog||t[57]!==r.searchDialog||t[58]!==D?(E=s.jsxs(s.Fragment,{children:[D,r.searchDialog,r.reclaimDialog]}),t[56]=r.reclaimDialog,t[57]=r.searchDialog,t[58]=D,t[59]=E):E=t[59],E}function gr(t){return t.preventDefault()}function br(){const t=$.c(20),e=U(),{threads:n}=dt(),{createNewTask:a}=ot(),i=Qt(),r=He();let l;t[0]!==r||t[1]!==n?(l=n.find(b=>b.id===r)?.branch??null,t[0]=r,t[1]=n,t[2]=l):l=t[2];const c=l;let u;t[3]!==i||t[4]!==a||t[5]!==c?(u=()=>{a(i,c)},t[3]=i,t[4]=a,t[5]=c,t[6]=u):u=t[6];const o=u;let d;t[7]!==e?(d=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=d):d=t[8];let f;t[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ft,{size:16}),t[9]=f):f=t[9];let m;t[10]!==o||t[11]!==d?(m=s.jsx(Te,{asChild:!0,children:s.jsx("button",{type:"button",onClick:o,"aria-label":d,className:"flex shrink-0 items-center classic:rounded-md compact:rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:f})}),t[10]=o,t[11]=d,t[12]=m):m=t[12];let h;t[13]!==e?(h=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=h):h=t[14];let g;t[15]!==h?(g=s.jsx(_e,{side:"bottom",children:h}),t[15]=h,t[16]=g):g=t[16];let j;return t[17]!==m||t[18]!==g?(j=s.jsxs(we,{children:[m,g]}),t[17]=m,t[18]=g,t[19]=j):j=t[19],j}function vr(t){const e=$.c(14),{virtualMcp:n}=t,a=U(),i=Rt(),{navigateToTask:r}=ws(),{create:l}=ut();let c,u;if(e[0]!==i||e[1]!==l||e[2]!==r||e[3]!==a||e[4]!==n){u=Symbol.for("react.early_return_sentinel");e:{const o=Qs(n,i);if(!o){u=null;break e}const d=o.mode==="dev";let f;e[7]!==l||e[8]!==r?(f=async x=>{const v=crypto.randomUUID();try{await l({id:v,virtual_mcp_id:x})}catch{}r(v,{virtualMcpId:x})},e[7]=l,e[8]=r,e[9]=f):f=e[9];const m=f,h=(x,v,k)=>s.jsxs("button",{type:"button","aria-pressed":v,"aria-label":x,title:x,onClick:()=>{v||m(o.targetId)},className:Y("inline-flex items-center gap-1.5 px-2.5 py-1 classic:rounded-md compact:rounded-lg transition-colors",v?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[s.jsx(k,{className:"size-3.5 shrink-0"}),s.jsx("span",{className:"@max-3xl/panel-header:hidden",children:x})]});let g;e[10]!==a?(g=a("devAgent.devAgentControl.develop"),e[10]=a,e[11]=g):g=e[11];const j=h(g,d,Es);let b;e[12]!==a?(b=a("devAgent.devAgentControl.live"),e[12]=a,e[13]=b):b=e[13],c=s.jsxs("div",{className:"inline-flex items-center rounded-lg border border-border bg-muted p-0.5 text-xs font-medium",children:[j,h(b,!d,Un)]})}e[0]=i,e[1]=l,e[2]=r,e[3]=a,e[4]=n,e[5]=c,e[6]=u}else c=e[5],u=e[6];return u!==Symbol.for("react.early_return_sentinel")?u:c}function ke(t){const e=$.c(10),{icon:n,className:a}=t,i=a===void 0?"size-4":a;if(n.kind==="component"){const{Component:l}=n;let c;return e[0]!==l||e[1]!==i?(c=s.jsx(l,{className:i}),e[0]=l,e[1]=i,e[2]=c):c=e[2],c}if(n.kind==="url"){const l=n.src;let c;e[3]!==i?(c=Y(i,"rounded-sm object-cover"),e[3]=i,e[4]=c):c=e[4];let u;return e[5]!==n.src||e[6]!==c?(u=s.jsx("img",{src:l,alt:"",className:c}),e[5]=n.src,e[6]=c,e[7]=u):u=e[7],u}let r;return e[8]!==i?(r=s.jsx(Vn,{className:i}),e[8]=i,e[9]=r):r=e[9],r}const jr={sooner:"@max-3xl/panel-header:hidden",later:"@max-xl/panel-header:hidden"};function yr(t){const e=$.c(29),{title:n,icon:a,active:i,onClick:r,disabled:l,locked:c,className:u,testId:o,tooltip:d,labelCollapse:f,showIcon:m}=t,h=l===void 0?!1:l,g=c===void 0?!1:c,j=f===void 0?"later":f,b=m===void 0?!0:m,x=g||void 0;let v;e[0]!==i||e[1]!==u||e[2]!==g?(v=Y("shrink-0 flex items-center gap-1.5 h-7 rounded-md px-2",js(i),"disabled:opacity-40 disabled:pointer-events-none",g&&"pointer-events-none",u),e[0]=i,e[1]=u,e[2]=g,e[3]=v):v=e[3];let k;e[4]!==a||e[5]!==b?(k=b&&s.jsx("span",{className:"flex size-5 items-center justify-center shrink-0",children:s.jsx(ke,{icon:a})}),e[4]=a,e[5]=b,e[6]=k):k=e[6];const y=b&&jr[j];let p;e[7]!==y?(p=Y(y,"whitespace-nowrap text-sm font-medium leading-none"),e[7]=y,e[8]=p):p=e[8];let T;e[9]!==p||e[10]!==n?(T=s.jsx("span",{className:p,children:n}),e[9]=p,e[10]=n,e[11]=T):T=e[11];let N;e[12]!==i||e[13]!==h||e[14]!==r||e[15]!==T||e[16]!==x||e[17]!==v||e[18]!==k||e[19]!==o||e[20]!==n?(N=s.jsxs("button",{type:"button",onClick:r,disabled:h,"data-testid":o,"aria-pressed":i,"aria-disabled":x,"aria-label":n,className:v,children:[k,T]}),e[12]=i,e[13]=h,e[14]=r,e[15]=T,e[16]=x,e[17]=v,e[18]=k,e[19]=o,e[20]=n,e[21]=N):N=e[21];const S=N;let w;e[22]!==S?(w=s.jsx(Te,{asChild:!0,children:S}),e[22]=S,e[23]=w):w=e[23];const _=d??n;let C;e[24]!==_?(C=s.jsx(_e,{side:"bottom",children:_}),e[24]=_,e[25]=C):C=e[25];let A;return e[26]!==w||e[27]!==C?(A=s.jsxs(we,{children:[w,C]}),e[26]=w,e[27]=C,e[28]=A):A=e[28],A}function kr(t){const e=$.c(16),{virtualMcpId:n,taskId:a}=t,{openPanel:i}=mt();let r;e[0]!==a||e[1]!==n?(r={virtualMcpId:n,taskId:a},e[0]=a,e[1]=n,e[2]=r):r=e[2];const{tabs:l,activeTab:c,mainOpen:u}=ft(r);if(l.length===0)return null;let o;if(e[3]!==c||e[4]!==u||e[5]!==i||e[6]!==l||e[7]!==n){let f;e[9]!==c||e[10]!==u||e[11]!==i||e[12]!==n?(f=m=>{const h=m.id==="automations"?Mt({activeTab:c,mainOpen:u}):u&&m.id===c;return s.jsxs(pt.Tab,{active:h,onClick:()=>{h||(ce("main_panel_tab_clicked",{virtual_mcp_id:n,tab_id:m.id,tab_kind:m.kind,was_active:!1}),i(m.id))},children:[s.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:s.jsx(ke,{icon:m.icon})}),m.title]},m.id)},e[9]=c,e[10]=u,e[11]=i,e[12]=n,e[13]=f):f=e[13],o=l.map(f),e[3]=c,e[4]=u,e[5]=i,e[6]=l,e[7]=n,e[8]=o}else o=e[8];let d;return e[14]!==o?(d=s.jsx(pt.Tabs,{"data-tour":Ot.surfaceTabs,children:o}),e[14]=o,e[15]=d):d=e[15],d}function Nr(t){const e=$.c(18),{virtualMcpId:n,taskId:a,disableActiveMainToggle:i}=t,r=i===void 0?!1:i,{openPanel:l,closePanel:c}=mt();let u;e[0]!==a||e[1]!==n?(u={virtualMcpId:n,taskId:a},e[0]=a,e[1]=n,e[2]=u):u=e[2];const{tabs:o,activeTab:d,mainOpen:f,setActiveTab:m}=ft(u);let h,g,j;if(e[3]!==d||e[4]!==c||e[5]!==r||e[6]!==f||e[7]!==l||e[8]!==m||e[9]!==o||e[10]!==n){const x=Mt({activeTab:d,mainOpen:f}),v=p=>p.id==="automations"?x:f&&p.id===d,k=p=>{const T=o.find(S=>S.id===p);if(r&&T&&v(T))return;const N=f&&d===p;if(ce("main_panel_tab_clicked",{virtual_mcp_id:n,tab_id:p,tab_kind:T?.kind??null,was_active:N}),p==="automations"){const S=ds({activeTab:d,mainOpen:f});"close"in S?c():l(S.tabId);return}m(p)},y=o.map(p=>({id:p.id,title:p.title,icon:p.icon,active:v(p),locked:r&&v(p),onSelect:()=>k(p.id),labelCollapse:p.kind==="system"?"sooner":"later"}));h="flex items-center min-w-0 gap-0.5 overflow-x-auto no-scrollbar",g=Ot.surfaceTabs,j=y.map(Sr),e[3]=d,e[4]=c,e[5]=r,e[6]=f,e[7]=l,e[8]=m,e[9]=o,e[10]=n,e[11]=h,e[12]=g,e[13]=j}else h=e[11],g=e[12],j=e[13];let b;return e[14]!==h||e[15]!==g||e[16]!==j?(b=s.jsx("div",{className:h,"data-tour":g,children:j}),e[14]=h,e[15]=g,e[16]=j,e[17]=b):b=e[17],b}function Sr(t){return s.jsx(yr,{title:t.title,icon:t.icon,showIcon:t.id!=="site-editor"&&t.id!=="content",active:t.active,locked:t.locked,onClick:t.onSelect,labelCollapse:t.labelCollapse},t.id)}function Tr(t){const e=$.c(3),n=rt();let a;return e[0]!==n||e[1]!==t?(a=n?s.jsx(kr,{...t}):s.jsx(Nr,{...t}),e[0]=n,e[1]=t,e[2]=a):a=e[2],a}function _r(t){return{threadId:t.routeThreadId,providerKey:t.routeThreadId??t.fallbackKey}}const Je="__mobile-main-panel-tab-select__",st="main";function wr({tabs:t,activeTab:e,mainOpen:n,t:a}){const i=t.find(l=>l.id===e),r=a("mainPanelTabs.mobileMainPanelTabSelect.mainView");return n?i?.title??r:i?.title??t[0]?.title??r}const Cr={kind:"component",Component:Fs},Pr={kind:"component",Component:Bs},Ar={kind:"component",Component:Wn},Ir={kind:"component",Component:Rs};function Mr({tabs:t,overlayEnabled:e,t:n}){return[{value:"chat",title:n("mainPanelTabs.mobileMainPanelTabSelect.chat"),icon:Cr},...t.length>0?t.map(a=>({value:a.id,title:a.title,icon:a.icon})):[{value:st,title:n("mainPanelTabs.mobileMainPanelTabSelect.mainView"),icon:Ir}],...e?[{value:"board",title:n("mainPanelTabs.mobileMainPanelTabSelect.tasks"),icon:Pr},{value:"files",title:n("mainPanelTabs.mobileMainPanelTabSelect.library"),icon:Ar}]:[]]}function rs(t){const e=$.c(53),{virtualMcpId:n,taskId:a}=t,i=U(),r=Be(),{openPanel:l}=mt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const u=Se(c);let o;e[1]!==a||e[2]!==n?(o={virtualMcpId:n,taskId:a},e[1]=a,e[2]=n,e[3]=o):o=e[3];const{tabs:d,activeTab:f,mainOpen:m}=ft(o),{org:h}=le(),g=ks();let j;e[4]!==h.id?(j=xt(h.id),e[4]=h.id,e[5]=j):j=e[5];const b=n===j;let x,v,k,y,p,T,N,S,w,_;if(e[6]!==f||e[7]!==m||e[8]!==r||e[9]!==b||e[10]!==l||e[11]!==h.id||e[12]!==u.org||e[13]!==u.taskId||e[14]!==g||e[15]!==i||e[16]!==d||e[17]!==n){y=Symbol.for("react.early_return_sentinel");e:{const P=Mr({tabs:d,overlayEnabled:!!(u.org&&u.taskId),t:i}),M=m?P.find(R=>R.value===f)?.value??st:"chat",I=P.find(R=>R.value===M),D=I?.title??wr({tabs:d,activeTab:f,mainOpen:m,t:i});let E;e[28]!==r?(E=R=>{r({to:".",search:Q=>({...Q,...mn(R)}),replace:!0})},e[28]=r,e[29]=E):E=e[29];const F=E;let L;e[30]!==b||e[31]!==l||e[32]!==h.id||e[33]!==g||e[34]!==F||e[35]!==n?(L=R=>{if(R!==Je){if(ce("main_panel_tab_clicked",{virtual_mcp_id:n,tab_id:R,source:"mobile_select"}),qs({reportsOnly:g,onReportAgent:b,tabId:R})){l(R,{virtualmcpid:xt(h.id),search:Dr});return}if(R==="chat"||R===st){F(R==="chat"?"chat":"main");return}l(R,{search:$r})}},e[30]=b,e[31]=l,e[32]=h.id,e[33]=g,e[34]=F,e[35]=n,e[36]=L):L=e[36];const G=L,O=P.find(R=>R.value!==M);if(P.length===2&&O){y=s.jsxs("button",{type:"button",onClick:()=>G(O.value),"aria-label":i("mainPanelTabs.mobileMainPanelTabSelect.switchTo",{name:O.title}),className:"flex h-10 min-w-0 max-w-[7.5rem] items-center gap-1.5 classic:rounded-md compact:rounded-lg px-1.5 text-xs text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[s.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:s.jsx(ke,{icon:O.icon,className:"size-5"})}),s.jsx("span",{className:"min-w-0 truncate",children:O.title})]});break e}v=Yn,w=Je,_=G;let K;e[37]!==i?(K=i("mainPanelTabs.mobileMainPanelTabSelect.view"),e[37]=i,e[38]=K):K=e[38],k=s.jsx(qn,{"aria-label":K,className:"h-10! w-full min-w-0 max-w-[7.5rem] classic:rounded-md compact:rounded-lg border-0 bg-transparent px-1.5 text-xs shadow-none [--card-shadow:none]",children:s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[I&&s.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:s.jsx(ke,{icon:I.icon,className:"size-5"})}),s.jsx("span",{className:"min-w-0 truncate",children:D})]})}),x=Qn,p="end",T="w-56",e[39]!==D?(N=s.jsx(Xt,{value:Je,disabled:!0,hideCheck:!0,className:"hidden",children:D}),e[39]=D,e[40]=N):N=e[40],S=P.map(Lr)}e[6]=f,e[7]=m,e[8]=r,e[9]=b,e[10]=l,e[11]=h.id,e[12]=u.org,e[13]=u.taskId,e[14]=g,e[15]=i,e[16]=d,e[17]=n,e[18]=x,e[19]=v,e[20]=k,e[21]=y,e[22]=p,e[23]=T,e[24]=N,e[25]=S,e[26]=w,e[27]=_}else x=e[18],v=e[19],k=e[20],y=e[21],p=e[22],T=e[23],N=e[24],S=e[25],w=e[26],_=e[27];if(y!==Symbol.for("react.early_return_sentinel"))return y;let C;e[41]!==x||e[42]!==p||e[43]!==T||e[44]!==N||e[45]!==S?(C=s.jsxs(x,{align:p,className:T,children:[N,S]}),e[41]=x,e[42]=p,e[43]=T,e[44]=N,e[45]=S,e[46]=C):C=e[46];let A;return e[47]!==v||e[48]!==k||e[49]!==C||e[50]!==w||e[51]!==_?(A=s.jsxs(v,{value:w,onValueChange:_,children:[k,C]}),e[47]=v,e[48]=k,e[49]=C,e[50]=w,e[51]=_,e[52]=A):A=e[52],A}function Lr(t){return s.jsx(Xt,{value:t.value,children:s.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:s.jsx(ke,{icon:t.icon})}),s.jsx("span",{className:"min-w-0 truncate",children:t.title})]})},t.value)}function $r(t){return{...t,sidepanel:!1}}function Dr(t){return{...t,thread:void 0,sidepanel:!1}}function Er(t,e,n){const a=$.c(36),i=ct(),{locator:r}=le(),l=B.useSyncExternalStore(i.threads.subscribe,i.threads.get),c=B.useSyncExternalStore(i.threadsStatus.subscribe,i.threadsStatus.get);let u;a[0]!==t||a[1]!==l?(u=t===null?null:l.find(p=>p.id===t&&!p.partial)??null,a[0]=t,a[1]=l,a[2]=u):u=a[2];const o=u,[d,f]=B.useState(void 0);let m;a[3]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{f(void 0)},a[3]=m):m=a[3];let h;a[4]!==t?(h=[t],a[4]=t,a[5]=h):h=a[5],B.useEffect(m,h);let g,j;a[6]!==d||a[7]!==t||a[8]!==o||a[9]!==i||a[10]!==c.kind?(g=()=>{t!==null&&(o||c.kind!=="loading"&&d===void 0&&(f("pending"),i.fetchThreadIntoSlot(t).then(p=>{f(p)})))},j=[t,o,c.kind,d,i],a[6]=d,a[7]=t,a[8]=o,a[9]=i,a[10]=c.kind,a[11]=g,a[12]=j):(g=a[11],j=a[12]),B.useEffect(g,j);let b;a[13]!==n||a[14]!==r||a[15]!==i||a[16]!==e?(b={mutationFn:async p=>i.create({id:p,virtual_mcp_id:e,...n?{branch:n}:{},...tn(sessionStorage,r,p)})},a[13]=n,a[14]=r,a[15]=i,a[16]=e,a[17]=b):b=a[17];const x=us(b);let v,k;if(a[18]!==x||a[19]!==d||a[20]!==t||a[21]!==o||a[22]!==c.kind?(v=()=>{t!==null&&(o||d===null&&c.kind!=="loading"&&(x.isPending||x.variables!==t&&x.mutate(t)))},k=[t,o,d,c.kind,x],a[18]=x,a[19]=d,a[20]=t,a[21]=o,a[22]=c.kind,a[23]=v,a[24]=k):(v=a[23],k=a[24]),B.useEffect(v,k),t===null){let p;return a[25]===Symbol.for("react.memo_cache_sentinel")?(p={status:"ready",task:null},a[25]=p):p=a[25],p}if(o){let p;return a[26]!==o?(p={status:"ready",task:o},a[26]=o,a[27]=p):p=a[27],p}if(d&&typeof d=="object"){let p;return a[28]!==d?(p={status:"ready",task:d},a[28]=d,a[29]=p):p=a[29],p}if(x.data){let p;return a[30]!==x.data?(p={status:"ready",task:x.data},a[30]=x.data,a[31]=p):p=a[31],p}if(x.isError){let p;return a[32]!==x.error?(p={status:"error",error:x.error},a[32]=x.error,a[33]=p):p=a[33],p}if(x.isPending||c.kind!=="loading"){let p;return a[34]===Symbol.for("react.memo_cache_sentinel")?(p={status:"creating"},a[34]=p):p=a[34],p}let y;return a[35]===Symbol.for("react.memo_cache_sentinel")?(y={status:"loading"},a[35]=y):y=a[35],y}function Fr(t){const e=$.c(13),{children:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const i=Se(a);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[1]=r):r=e[1];const l=Oe(r);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={select:Rr},e[2]=c):c=e[2];const u=ms(c),{org:o}=le();let d;e[3]!==o||e[4]!==i.agentId||e[5]!==i.legacyView||e[6]!==i.org||e[7]!==u||e[8]!==l?(d=i.org?fs({pathname:u,org:i.org,pathAgentId:i.agentId,pathLegacyView:i.legacyView,fallbackAgentId:Ne(o.id).id,search:l}):null,e[3]=o,e[4]=i.agentId,e[5]=i.legacyView,e[6]=i.org,e[7]=u,e[8]=l,e[9]=d):d=e[9];const f=d;let m;return e[10]!==n||e[11]!==f?(m=f?s.jsx(ht,{target:f}):n,e[10]=n,e[11]=f,e[12]=m):m=e[12],m}function Rr(t){return t.matches.at(-1)?.pathname??t.location.pathname}function Br(){const t=$.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const n=Se(e);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[1]=a):a=t[1];const i=Oe(a),{org:r}=le(),{org:l,taskId:c}=n;if(!l||c===void 0)return null;let u;return t[2]!==l||t[3]!==r.id||t[4]!==i||t[5]!==c?(u=hs({org:l,taskId:c,fallbackAgentId:Ne(r.id).id,search:i}),t[2]=l,t[3]=r.id,t[4]=i,t[5]=c,t[6]=u):u=t[6],u}function Or(){const t=$.c(2),e=Br();let n;return t[0]!==e?(n=e?s.jsx(ht,{target:e}):null,t[0]=e,t[1]=n):n=t[1],n}function zr(){const t=$.c(6),e=Vt(),n=Be();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[0]=a):a=t[0];const{preview:i}=Oe(a);if(!e||!i)return null;let r;t[1]!==n?(r=()=>n({to:".",search:Gr}),t[1]=n,t[2]=r):r=t[2];let l;return t[3]!==i||t[4]!==r?(l=s.jsx(Xn,{previewPath:i,onClose:r,showSeeInLibrary:!0}),t[3]=i,t[4]=r,t[5]=l):l=t[5],l}function Gr(t){const{preview:e,...n}=t;return n}const Hr=B.createContext(null);function is(){return B.useContext(Hr)}function Ur(t){const e=$.c(13),{children:n}=t,a=U(),i=Jt(),r=is(),l=He()!==null;let c;e[0]!==l||e[1]!==i||e[2]!==r?(c=s.jsx(Ca,{}),e[0]=l,e[1]=i,e[2]=r,e[3]=c):c=e[3];const u=c;let o;e[4]!==a?(o=a("agentShellLayout.agentShellLayout.chatLoadingError"),e[4]=a,e[5]=o):o=e[5];let d;e[6]!==o?(d=s.jsx("div",{role:"alert",className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:o}),e[6]=o,e[7]=d):d=e[7];const f=n??u;let m;e[8]!==f?(m=s.jsx(Fe,{children:f}),e[8]=f,e[9]=m):m=e[9];let h;return e[10]!==d||e[11]!==m?(h=s.jsx(Ct,{fallback:d,children:m}),e[10]=d,e[11]=m,e[12]=h):h=e[12],h}function Vr(t){const e=$.c(13),{threadId:n,children:a}=t;if(U(),is(),n===null){let r;return e[0]!==a?(r=s.jsx(ee.ThreadlessProvider,{children:a}),e[0]=a,e[1]=r):r=e[1],r}let i;return e[10]!==a||e[11]!==n?(i=s.jsx(ee.ActiveTaskProvider,{taskId:n,children:a}),e[10]=a,e[11]=n,e[12]=i):i=e[12],i}function Kr(t){const e=$.c(3),{onNewTaskRef:n,createNewTask:a}=t;let i;return e[0]!==a||e[1]!==n?(i=()=>(n.current=a,()=>{n.current=null}),e[0]=a,e[1]=n,e[2]=i):i=e[2],B.useLayoutEffect(i),null}function Wr({virtualMcpId:t,hasActiveGithubRepo:e,sandboxMap:n,children:a}){const i=U(),{currentBranch:r,activeTask:l,setCurrentTaskBranch:c}=Ge(),u=Jt(),o="agent-sandbox",{data:d}=Re.useSession(),f=d?.user?.id,m=!Cs({isDesktopApp:u,harnessId:l?.harness_id}),h=rn({agentSandboxMap:n,threadSandboxMap:l?.metadata?.sandboxMap,userId:f,ownerId:l?.created_by,branch:r}),g=e||Zs(l?.metadata),j=B.useRef(null),b=m&&ln({threadLoaded:!!l,isOwner:!!f&&l?.created_by===f,hasActiveGithubRepo:g,branch:r??null,attempted:j.current===(l?.id??null)});B.useEffect(()=>{!b||!l||(j.current=l.id,c(et(d?.user?.name||d?.user?.email?.split("@")[0])))},[b,l,d,c]);const{org:x}=le(),v=Ns("cms_auto_fresh_branch"),k=Et(t),y=B.useRef(null),p=v&&k.resolved&&k.runtime==="cms"&&!!x?.slug&&!!r&&y.current!==(l?.id??null),N=nt({...Ss({orgSlug:x?.slug??"",virtualMcpId:t,branch:r??""}),enabled:p}).data?.lastCommitAt??null;B.useEffect(()=>{!p||!l||Ts(N,Date.now())&&(y.current=l.id,c(et(d?.user?.name||d?.user?.email?.split("@")[0])))},[p,N,l,d,c]);const S=de(t),w=Gt(S,r),{releases:_,createRelease:C}=Xs(t),P=!!f&&l?.created_by===f&&!!r&&r!==w&&!_.some(O=>O.branch===r),M=B.useRef(null);B.useEffect(()=>{!P||!r||M.current!==r&&(M.current=r,C({branch:r,name:en(_,i("thread.branchPicker.defaultVersionName")),color:Js(_.length),createdAt:new Date().toISOString()}).catch(()=>{}))},[P,r,_,C,i]);const I=k.resolved?k.runtime:null,D=on(t,r??void 0),F=(f&&r?ea(h?.[f]?.[r]):{})[o]??null,L=F?.previewUrl??null,G=m&&I!=="cms"&&(!!F||D);return m?I==="cms"?s.jsx(jt,{children:a},`${t}:${r??"no-branch"}:${l?.id??""}`):s.jsx(cn,{virtualMcpId:t,branch:r??null,previewUrl:L,enabled:G,children:s.jsx(dn,{executionEnabled:m,virtualMcpId:t,branch:r??null,userId:f??null,hasActiveGithubRepo:g,vmEntry:F,threadId:l?.id??null,children:s.jsx(jt,{children:a},`${t}:${r??"no-branch"}:${l?.id??""}`)})},l?.id??"no-thread"):s.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:s.jsx("div",{className:"flex h-full rounded-[0.75rem] bg-background card-shadow",children:s.jsx(Ht,{image:s.jsx(it,{size:48,className:"text-muted-foreground"}),title:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWeb"),description:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWebDescription")})})})}function qr(){const t=$.c(22),e=rt(),n=hn(),a=U(),{toggleSidebar:i}=vs(),{virtualMcpId:r,taskId:l}=Ge();let c;t[0]!==a?(c=a("layouts.shellControls.toggleSidebar"),t[0]=a,t[1]=c):c=t[1];let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(bs,{size:16}),t[2]=u):u=t[2];let o;t[3]!==c||t[4]!==i?(o=s.jsx(De,{className:"classic:hidden md:hidden",onClick:i,"aria-label":c,children:u}),t[3]=c,t[4]=i,t[5]=o):o=t[5];let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(xr,{}),t[6]=d):d=t[6];let f;t[7]!==o?(f=s.jsxs(Le.Topbar.Left,{children:[o,d]}),t[7]=o,t[8]=f):f=t[8];let m;t[9]!==l||t[10]!==r?(m=s.jsx("div",{className:"classic:hidden min-w-0 md:hidden",children:s.jsx(rs,{virtualMcpId:r,taskId:l})}),t[9]=l,t[10]=r,t[11]=m):m=t[11];let h;t[12]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(br,{}),t[12]=h):h=t[12];let g;t[13]!==e||t[14]!==n?(g=!e&&!n.contentOpen&&s.jsx(pn,{side:"right",open:n.contentOpen,onToggle:n.toggleContent}),t[13]=e,t[14]=n,t[15]=g):g=t[15];let j;t[16]!==g?(j=s.jsxs(Le.Topbar.Right,{className:"shrink-0",children:[h,g]}),t[16]=g,t[17]=j):j=t[17];let b;return t[18]!==f||t[19]!==m||t[20]!==j?(b=s.jsxs(Le.Topbar,{className:"compact:border-b compact:border-border/60 compact:px-3",children:[f,m,j]}),t[18]=f,t[19]=m,t[20]=j,t[21]=b):b=t[21],b}function Yr(t){const e=$.c(24),{layout:n,onNewTaskRef:a,createNewTask:i}=t,{virtualMcpId:r,taskId:l}=Ge(),c=rt(),u=Vt(),o=de(r),d=Kn()??"overview";let f;e[0]!==c||e[1]!==u||e[2]!==l||e[3]!==r?(f=!c&&u&&s.jsx(Le.Topbar.Center.Portal,{children:s.jsx(rs,{virtualMcpId:r,taskId:l})}),e[0]=c,e[1]=u,e[2]=l,e[3]=r,e[4]=f):f=e[4];let m;e[5]!==i||e[6]!==a?(m=s.jsx(Kr,{onNewTaskRef:a,createNewTask:i}),e[5]=i,e[6]=a,e[7]=m):m=e[7];let h;e[8]!==l||e[9]!==r?(h=s.jsx(Tr,{virtualMcpId:r,taskId:l}),e[8]=l,e[9]=r,e[10]=h):h=e[10];let g;e[11]!==o?(g=o&&s.jsx(vr,{virtualMcp:o}),e[11]=o,e[12]=g):g=e[12];let j,b;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(vt.Thread,{topbar:s.jsx(qr,{}),children:s.jsx(Ur,{})}),b=s.jsx(Lt,{}),e[13]=j,e[14]=b):(j=e[13],b=e[14]);let x;e[15]!==d||e[16]!==n||e[17]!==h||e[18]!==g?(x=s.jsxs(vt,{...n,contentKey:d,contentNavigation:h,contentActions:g,children:[j,b]}),e[15]=d,e[16]=n,e[17]=h,e[18]=g,e[19]=x):x=e[19];let v;return e[20]!==f||e[21]!==m||e[22]!==x?(v=s.jsxs(s.Fragment,{children:[f,m,x]}),e[20]=f,e[21]=m,e[22]=x,e[23]=v):v=e[23],v}function Qr(){const t=U(),e=Be(),n=jn(),{create:a}=ut(),{org:i}=le(),l=Se({strict:!1}).org??"",c=Oe({strict:!1}),u=He(),o=Qt(),d=Yt(),[f]=B.useState(()=>crypto.randomUUID()),{data:m}=Re.useSession(),[h]=B.useState(()=>et(m?.user?.name||m?.user?.email?.split("@")[0])),g=ct(),j=B.useSyncExternalStore(g.threads.subscribe,g.threads.get),b=B.useSyncExternalStore(g.threadsStatus.subscribe,g.threadsStatus.get),x=de(o),v=!!(x&&Ut(x)),k=Gt(x,null),y=Er(u,o,h);Pa(y.status==="ready"?y.task:null);const p=x?.metadata?.ui?.layout??null,T=p?{defaultMainView:p.defaultMainView??null,chatDefaultOpen:p.chatDefaultOpen??null}:null,N=fn(T),{threadId:S,providerKey:w}=_r({routeThreadId:u,fallbackKey:f}),_=async()=>{const M=crypto.randomUUID(),I=j.find(D=>D.id===S)?.branch??null;try{await a({id:M,virtual_mcp_id:o,...I?{branch:I}:{}})}catch{}n(M,()=>({}))},C=B.useRef(null);B.useEffect(()=>{const M=I=>{Ys(I)&&I.shiftKey&&I.code==="KeyS"&&!I.repeat&&(I.preventDefault(),C.current?.())};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[]);const A=y.status==="ready"?y.task:null,P=A?.virtual_mcp_id;if(A&&P&&!yn({routeAgentId:o,threadAgentId:P})){const M=ps({org:l,agentId:P,superAgentId:Ne(i.id).id});return s.jsx(ht,{target:{route:M,search:{thread:A.id,sidepanel:c.sidepanel,mainpanel:c.mainpanel,autosend:c.autosend}}})}if(u===null&&d&&x){if(b.kind==="loading")return s.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:s.jsxs("div",{role:"status","aria-live":"polite",className:"flex h-full items-center justify-center bg-background card-shadow rounded-[0.75rem] text-sm text-muted-foreground",children:[s.jsx(je,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})});const I=an(j,o,m?.user?.id,zt(x.metadata),v,{baseBranch:k})?.id??(v?f:null);if(I)return s.jsx(xs,{to:".",replace:!0,search:D=>({...D,thread:I})})}return y.status==="creating"||y.status==="loading"?s.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:s.jsxs("div",{role:"status","aria-live":"polite",className:"flex h-full items-center justify-center bg-background card-shadow rounded-[0.75rem] text-sm text-muted-foreground",children:[s.jsx(je,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})}):y.status==="error"?s.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:s.jsxs("div",{role:"alert",className:"flex flex-col h-full items-center justify-center gap-2 bg-background card-shadow rounded-[0.75rem] p-8 text-sm",children:[s.jsx("div",{className:"font-medium",children:t("agentShellLayout.agentShellLayout.taskUnavailable")}),s.jsx("div",{className:"text-muted-foreground",children:y.error.message})]})}):x?s.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:s.jsx(ee.Provider,{virtualMcpId:o,task:y.status==="ready"?y.task:null,children:s.jsx(Wr,{virtualMcpId:o,hasActiveGithubRepo:v,sandboxMap:x.metadata?.sandboxMap,children:s.jsx(Vr,{threadId:S,children:s.jsx(Fe,{children:s.jsx(Yr,{layout:N,onNewTaskRef:C,createNewTask:_})})},w)})},o)}):s.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:s.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:s.jsx(Ht,{image:s.jsx(it,{size:48,className:"text-muted-foreground"}),title:t("agentShellLayout.agentShellLayout.agentNotFound"),description:t("agentShellLayout.agentShellLayout.agentNotFoundDescription",{virtualMcpId:o}),actions:s.jsx(gs,{variant:"outline",onClick:()=>e({to:"/$org",params:{org:l}}),children:t("agentShellLayout.agentShellLayout.goToOrgHome")})})})})}function pc(){const t=$.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const n=Se(e);if(n.taskId!==void 0){let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Or,{}),t[1]=i):i=t[1],i}if(n._splat!==void 0){let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Lt,{}),t[2]=i):i=t[2],i}let a;return t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Fe,{children:s.jsx(Fr,{children:s.jsx(Zn,{children:s.jsxs(Jn,{children:[s.jsx(Qr,{}),s.jsx(zr,{})]})})})}),t[3]=a):a=t[3],a}export{pc as default};