decocms 4.503.1 → 4.503.2

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 (377) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-B4zRtCcX.js → ActiveShapeUtils-CBLSJqBl.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-B7FQmH_M.js → AlertCircle-BFUZ4yx0.js} +1 -1
  3. package/dist/client/assets/{AreaChart-80AfW8ak.js → AreaChart-DKrmhkRJ.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-DZes_rvl.js → ArrowLeft-CK2OAC0l.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DJaSaDSt.js → ArrowUp-U6_gobY2.js} +1 -1
  6. package/dist/client/assets/{BarChart-BpCZ5QGT.js → BarChart-DBqZyJQX.js} +1 -1
  7. package/dist/client/assets/{Building02-C692k1Je.js → Building02-Ddm6hNyu.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-FZqnb3jh.js → CategoricalChart-DYWjGYq1.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-DTvtIc91.js → CheckCircle-BWW06ZXQ.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-CSoDnwYU.js → ChevronSelectorVertical-DKcwgXpF.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-D6SZVzK-.js → ChevronUp-CTrNq9Nk.js} +1 -1
  12. package/dist/client/assets/{Copy01-CRJ909cy.js → Copy01-TJP2zB12.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-DKW3gWt7.js → CreditCard01-Bm6_xB5H.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-DPFiEMJ2.js → DotsVertical-DKl8j3BE.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-D5rQXK1V.js → ErrorBarContext-CR5xIaDQ.js} +1 -1
  16. package/dist/client/assets/{Globe04-CCnzVN5c.js → Globe04-ClrCqE7c.js} +1 -1
  17. package/dist/client/assets/{Image01-CoKdj_km.js → Image01-Cf_YxPro.js} +1 -1
  18. package/dist/client/assets/{Key01-CZ56XYyu.js → Key01-55Z6tHcr.js} +1 -1
  19. package/dist/client/assets/{Link01-QYs7ouJl.js → Link01-DNXOSsg9.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-C8q-hkDW.js → LinkBroken01-Vuoqu_ZW.js} +1 -1
  21. package/dist/client/assets/{Monitor01-DO9PZtsn.js → Monitor01-C-mB2rao.js} +1 -1
  22. package/dist/client/assets/{Play-B8h_fG9j.js → Play-CUFyJJIt.js} +1 -1
  23. package/dist/client/assets/{Plus-CyJJ3XFV.js → Plus-D-GSl2MA.js} +1 -1
  24. package/dist/client/assets/{SearchMd-Yk_yG6_-.js → SearchMd-CkV8MM4H.js} +1 -1
  25. package/dist/client/assets/{Sector-C-MC544L.js → Sector-CNZsIxmG.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-Cr7oTzOr.js → ShoppingBag01-dI1cRqeE.js} +1 -1
  27. package/dist/client/assets/{Sun-DM7-cZiQ.js → Sun-BPl8u-yx.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-Bv6v-_-V.js → SwitchHorizontal01-KDjTaTLX.js} +1 -1
  29. package/dist/client/assets/{Tool01-D_pOnyrM.js → Tool01-CvAlZ6_R.js} +1 -1
  30. package/dist/client/assets/{Trash01-CLvb-vxo.js → Trash01-BzUZQR5Y.js} +1 -1
  31. package/dist/client/assets/{Upload01-DotbRoth.js → Upload01-CdgDB-zC.js} +1 -1
  32. package/dist/client/assets/{User01-DpzyFtdl.js → User01-CinpYulR.js} +1 -1
  33. package/dist/client/assets/{UserSquare-ii6T7SpT.js → UserSquare-0R6kuy9W.js} +1 -1
  34. package/dist/client/assets/{Users01-BEOgMF3y.js → Users01-DFSTtPtZ.js} +1 -1
  35. package/dist/client/assets/{XAxis--67FjR4u.js → XAxis-CMCcO3jI.js} +1 -1
  36. package/dist/client/assets/{XClose-UJ2K7TVC.js → XClose-CXxsMd9c.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-FPIBUWhA.js → ZoomOut-C1rwTYBB.js} +1 -1
  38. package/dist/client/assets/{access-gate-Cj7Rjcug.js → access-gate-BSx5LbNZ.js} +1 -1
  39. package/dist/client/assets/{add-connection-dialog-DVH8e9NI.js → add-connection-dialog-CNB1XZS8.js} +1 -1
  40. package/dist/client/assets/{agent-analytics-Ce-ZWP9P.js → agent-analytics-BKsJAgnt.js} +1 -1
  41. package/dist/client/assets/agent-app-DBSthuoA.js +1 -0
  42. package/dist/client/assets/{agent-assets-ajh1hAY1.js → agent-assets-CvHLRtfR.js} +1 -1
  43. package/dist/client/assets/{agent-automation-Di1n1bbE.js → agent-automation-DG660AlN.js} +1 -1
  44. package/dist/client/assets/{agent-automations-ClchWctF.js → agent-automations-DkNZsDdV.js} +1 -1
  45. package/dist/client/assets/{agent-connect-sources-BA7V6yxc.js → agent-connect-sources-DFGjLsvu.js} +1 -1
  46. package/dist/client/assets/agent-deck-DW69LMk-.js +1 -0
  47. package/dist/client/assets/{agent-e2e-D8djWDNu.js → agent-e2e-CTTKhY1C.js} +1 -1
  48. package/dist/client/assets/{agent-experiments-C1rYkq-c.js → agent-experiments-B23reQrT.js} +1 -1
  49. package/dist/client/assets/{agent-file-BPspUfYw.js → agent-file-CFgK4Fqg.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-X7gvVXAz.js → agent-hosting-BL7RyxMT.js} +1 -1
  51. package/dist/client/assets/{agent-icon-B7cHtLmN.js → agent-icon-Bmu0Xuy8.js} +1 -1
  52. package/dist/client/assets/agent-library-D9aAC92j.js +1 -0
  53. package/dist/client/assets/agent-library-file-Dlq-Vts6.js +1 -0
  54. package/dist/client/assets/{agent-monitor-gDwyBiKw.js → agent-monitor-Dxt5K5x_.js} +1 -1
  55. package/dist/client/assets/{agent-overview-CNjRMR9E.js → agent-overview-CAzScYJD.js} +1 -1
  56. package/dist/client/assets/{agent-releases-BRTteMcu.js → agent-releases-RSbZ96r7.js} +1 -1
  57. package/dist/client/assets/agent-settings-5EOlZJW6.js +1 -0
  58. package/dist/client/assets/{agent-site-editor-DSS1gTUU.js → agent-site-editor-DFWKub_t.js} +1 -1
  59. package/dist/client/assets/agent-site-editor-code-I8N3vaXE.js +2 -0
  60. package/dist/client/assets/agent-site-editor-content-uhd8Bnc-.js +1 -0
  61. package/dist/client/assets/agent-site-editor-preview-CV5DbDBm.js +1 -0
  62. package/dist/client/assets/agent-view-QNUTYcIi.js +1 -0
  63. package/dist/client/assets/{agent-view-guard-CCih3VTe.js → agent-view-guard-BwubZYi8.js} +1 -1
  64. package/dist/client/assets/{agents-list-CZjV8bbN.js → agents-list-L7YgNFph.js} +1 -1
  65. package/dist/client/assets/{ai-providers-B6JeYxX2.js → ai-providers-DEeLkiCM.js} +1 -1
  66. package/dist/client/assets/{alert-8kyzY3mC.js → alert-CnRQ3m-7.js} +1 -1
  67. package/dist/client/assets/{alert-dialog-Dhk9OY33.js → alert-dialog-BaBKldUA.js} +1 -1
  68. package/dist/client/assets/{analytics-sections-FNv48nRX.js → analytics-sections-BIEC86HP.js} +1 -1
  69. package/dist/client/assets/api-keys-BgtInlXe.js +1 -0
  70. package/dist/client/assets/{api-keys-D5flq3KN.js → api-keys-CmpJo1Rr.js} +1 -1
  71. package/dist/client/assets/{app-editor-BhVwxJJK.js → app-editor-BqvAOKlk.js} +1 -1
  72. package/dist/client/assets/{asset-utils-C2Mu9meV.js → asset-utils--N2gsOKr.js} +1 -1
  73. package/dist/client/assets/{auth-D-N_o1pb.js → auth-BeK8rRbB.js} +1 -1
  74. package/dist/client/assets/{auth-catchall-BBvN2Rx7.js → auth-catchall-fFMHk_ps.js} +1 -1
  75. package/dist/client/assets/{auth-entry-DbRCvj9z.js → auth-entry-C1_Znn_c.js} +1 -1
  76. package/dist/client/assets/{auth-split-layout-CtlyXCmE.js → auth-split-layout-CocPnGfp.js} +1 -1
  77. package/dist/client/assets/{authenticate-and-persist-oauth-1LFr51s5.js → authenticate-and-persist-oauth-DJwJCiC8.js} +1 -1
  78. package/dist/client/assets/{automation-list-row-COpQfJ8e.js → automation-list-row-3WI1rtPZ.js} +1 -1
  79. package/dist/client/assets/{automation-runs-DVpJHzv0.js → automation-runs-dkpbdf4I.js} +1 -1
  80. package/dist/client/assets/{automations-C8_YeRwz.js → automations-CaP79ol1.js} +1 -1
  81. package/dist/client/assets/{autosend-BZJ2TdB9.js → autosend-B-VPnrp2.js} +1 -1
  82. package/dist/client/assets/{avatar-nIzU_VyX.js → avatar-yCbsNNbw.js} +1 -1
  83. package/dist/client/assets/{badge-BPqtGuPz.js → badge-Zdi_g359.js} +1 -1
  84. package/dist/client/assets/{block-document-BKQmJN5N.js → block-document-D4x1DRNW.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-k-h3WbAb.js → blocks-preview-workspace-context-CMtVQxL8.js} +1 -1
  86. package/dist/client/assets/{blocks-tab-states-BBN5TI4p.js → blocks-tab-states-B7_Q2Byx.js} +3 -3
  87. package/dist/client/assets/{blog-schema-BUAdNo1n.js → blog-schema-D0r94Mwa.js} +1 -1
  88. package/dist/client/assets/{board-analytics-DwUwOtky.js → board-analytics-DjFw48Ii.js} +1 -1
  89. package/dist/client/assets/{buckets-CvDtgoPk.js → buckets-DmovZm0n.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-BG4FSKpV.js → build-improve-prompt-doc-Cd4DLFMv.js} +1 -1
  91. package/dist/client/assets/{calendar-CliY99e4.js → calendar-aMW3a7Qx.js} +1 -1
  92. package/dist/client/assets/{capability-load-error-BWT346oK.js → capability-load-error-xmV40q_-.js} +1 -1
  93. package/dist/client/assets/{category-editor-c-rjHBE2.js → category-editor-BYf-_N2d.js} +1 -1
  94. package/dist/client/assets/{chart-BeOqWxx3.js → chart-D1eqwoYD.js} +1 -1
  95. package/dist/client/assets/{chat-context-Bm126Y9d.js → chat-context-C4pDshj1.js} +1 -1
  96. package/dist/client/assets/{chat-draft-DpsQeTSh.js → chat-draft-D5dlb_sl.js} +1 -1
  97. package/dist/client/assets/{checkbox-BHYLtolO.js → checkbox-C2l5tKo2.js} +1 -1
  98. package/dist/client/assets/{choose-editor-BAVCkM9r.js → choose-editor-C_NzKjq2.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-NkKi_-yn.js → cli-auth-success-DSx-mAhh.js} +1 -1
  100. package/dist/client/assets/{client-icons-DiOq8lJC.js → client-icons-BasHQFnS.js} +1 -1
  101. package/dist/client/assets/cms-settings-editor-BB3l1bfM.js +1 -0
  102. package/dist/client/assets/{collapsible-Bnza8CXw.js → collapsible-CDZFoOK-.js} +1 -1
  103. package/dist/client/assets/{collection-detail-B-_hN-JC.js → collection-detail-DkNCk0OQ.js} +1 -1
  104. package/dist/client/assets/{collection-display-button-CrvZt97I.js → collection-display-button--eCg5c5n.js} +1 -1
  105. package/dist/client/assets/{collection-search-BJh6F6XQ.js → collection-search-sopr7ssV.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper--ez0DBTz.js → collection-table-wrapper-Cy3Cbckv.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-jNi4Jv0Y.js → collection-tabs-DU5QTifc.js} +1 -1
  108. package/dist/client/assets/{column-rules-BS9JY-Oa.js → column-rules-Z54WqqNc.js} +1 -1
  109. package/dist/client/assets/{combobox-CsaU06Jl.js → combobox-C2hXpc1p.js} +1 -1
  110. package/dist/client/assets/{command-DSORHlWH.js → command-BSGZ-TwS.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-BBesHoiB.js → companion-mcps-section-d9HGklIc.js} +1 -1
  112. package/dist/client/assets/{config-D3uahd_6.js → config-CddNRjRY.js} +1 -1
  113. package/dist/client/assets/{connect-afghfC6I.js → connect-BGfL3A9r.js} +1 -1
  114. package/dist/client/assets/{connect-layout-CWu2TS6d.js → connect-layout-DoM7vuFX.js} +1 -1
  115. package/dist/client/assets/{connection-VFOGX82d.js → connection-B0eFNfCu.js} +1 -1
  116. package/dist/client/assets/{connection-card-CugVHwbe.js → connection-card-BzTYJa6s.js} +1 -1
  117. package/dist/client/assets/{connection-detail-DOnigZIS.js → connection-detail-Cwz-qT82.js} +1 -1
  118. package/dist/client/assets/{connection-form-helpers-Ht3Y_JTI.js → connection-form-helpers-ChgreO5F.js} +1 -1
  119. package/dist/client/assets/{connections-y4LWYMRk.js → connections-CnirV_66.js} +1 -1
  120. package/dist/client/assets/{content-tab-BbeLE04u.js → content-tab-BIEsoSfa.js} +3 -3
  121. package/dist/client/assets/{context-1CQ99Xh2.js → context-DEuw9CjH.js} +1 -1
  122. package/dist/client/assets/{context-menu-Cf7UvCHV.js → context-menu-CHrxflOD.js} +1 -1
  123. package/dist/client/assets/{core.esm-oiTkWp_q.js → core.esm-CWXW2IWJ.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-Chu_8T3p.js → create-organization-dialog-Bci4qKSS.js} +1 -1
  125. package/dist/client/assets/{daily-pulse-D2siiT-N.js → daily-pulse-CRZ8lDnm.js} +1 -1
  126. package/dist/client/assets/{discover-y_xX0Jww.js → discover-C3iLTVFB.js} +1 -1
  127. package/dist/client/assets/{domain-settings-D3fYG_8u.js → domain-settings-DdY9W_8b.js} +1 -1
  128. package/dist/client/assets/{drawer-BaMAsObr.js → drawer-BpEasqMM.js} +1 -1
  129. package/dist/client/assets/{editor-gEAdAF4z.js → editor-DQK8Gbky.js} +1 -1
  130. package/dist/client/assets/{editor-classes-BkgvFYZG.js → editor-classes-wKHzvXkJ.js} +1 -1
  131. package/dist/client/assets/{empty-state-pgELPzRJ.js → empty-state-Ck0Y0zH4.js} +1 -1
  132. package/dist/client/assets/{empty-state-Qh91SokD.js → empty-state-GUv-DLNf.js} +1 -1
  133. package/dist/client/assets/{extract-connection-data-CmhWlbRd.js → extract-connection-data-CyaR6DQN.js} +1 -1
  134. package/dist/client/assets/{feature-gate-D8bbKoJM.js → feature-gate-Cd3TCuYG.js} +1 -1
  135. package/dist/client/assets/{feature-paywall-yY-LJqXW.js → feature-paywall-HnwykYzM.js} +1 -1
  136. package/dist/client/assets/{file-explorer-D61hIry6.js → file-explorer-B8GvovSI.js} +1 -1
  137. package/dist/client/assets/{file-preview-DA9PL3PH.js → file-preview-KNDU2UhF.js} +1 -1
  138. package/dist/client/assets/{file-share-button-Db4oG9-W.js → file-share-button-BX7_JCXp.js} +1 -1
  139. package/dist/client/assets/{file-type-icon-CmCTgogr.js → file-type-icon-C2WSm6EM.js} +1 -1
  140. package/dist/client/assets/flat-project-XWFiDywx.js +1 -0
  141. package/dist/client/assets/{folder-icon-DxKEGodw.js → folder-icon-DOSAeTvE.js} +1 -1
  142. package/dist/client/assets/{form-B2R0FZpl.js → form-Dz-wry37.js} +1 -1
  143. package/dist/client/assets/{general-DGAJ8SIw.js → general-lahSHdvs.js} +1 -1
  144. package/dist/client/assets/{home-DllK7NjJ.js → home-CfslMwmV.js} +1 -1
  145. package/dist/client/assets/{hosted-publish-feedback-C-78qWJE.js → hosted-publish-feedback-D7K1BgAP.js} +1 -1
  146. package/dist/client/assets/{icon-button-BLmb1aFH.js → icon-button-BbQESQAz.js} +1 -1
  147. package/dist/client/assets/{index-Bi4uPXkI.js → index-BFWcpEys.js} +1 -1
  148. package/dist/client/assets/{index-CMSBZHOC.js → index-BX4Ek3Q9.js} +1 -1
  149. package/dist/client/assets/{index-C5kiFY0N.js → index-BhuMySoe.js} +1 -1
  150. package/dist/client/assets/{index-CNnllo6G.js → index-BoB02eW2.js} +2 -2
  151. package/dist/client/assets/{index-DFDhdIkn.js → index-CAsLc9Zw.js} +1 -1
  152. package/dist/client/assets/{index-LQ6JAM7x.js → index-CD1O2KuY.js} +3 -3
  153. package/dist/client/assets/{index-4S552BvA.js → index-COyZFAVd.js} +1 -1
  154. package/dist/client/assets/{index-DlkNBOKp.js → index-CVeMcxNw.js} +1 -1
  155. package/dist/client/assets/{index-D2K6wJdd.js → index-Cdsu1Nw_.js} +1 -1
  156. package/dist/client/assets/{index-JfKaG8r5.js → index-DSuQX-Dj.js} +1 -1
  157. package/dist/client/assets/{index-B8m-k0Po.js → index-DhnL-yRw.js} +1 -1
  158. package/dist/client/assets/{index-BQe9t0ZU.js → index-DuSo48nd.js} +1 -1
  159. package/dist/client/assets/{index-QaFbqB6H.js → index-Fqg3dcpq.js} +1 -1
  160. package/dist/client/assets/{index-k8d57vb2.js → index-mPiuZtAa.js} +1 -1
  161. package/dist/client/assets/{index-cnt3BCfz.js → index-qp2WMoaq.js} +1 -1
  162. package/dist/client/assets/{index-redirect-CDoOQ7Fs.js → index-redirect-LGC8XAQa.js} +1 -1
  163. package/dist/client/assets/{infiniteQueryObserver-CqK1S2-W.js → infiniteQueryObserver-BuOPvaCd.js} +1 -1
  164. package/dist/client/assets/{infra-billing-BD6Y6fAa.js → infra-billing-C7a9CxBG.js} +1 -1
  165. package/dist/client/assets/{input-Bue-yNpK.js → input-CC2XqVda.js} +1 -1
  166. package/dist/client/assets/{input-DnkGG1pQ.js → input-Dx6Yl3YV.js} +3 -3
  167. package/dist/client/assets/{integration-icon-Dl2m6ce3.js → integration-icon-YHEiRLgT.js} +1 -1
  168. package/dist/client/assets/{jira-icon-BN8gmoGK.js → jira-icon-i9apovX2.js} +1 -1
  169. package/dist/client/assets/{label-C2MI3yAw.js → label-CsyEQPG4.js} +1 -1
  170. package/dist/client/assets/{layout-D3qT5OMX.js → layout-BT112QdT.js} +1 -1
  171. package/dist/client/assets/{legacy-agents-deep-Bh_GWt30.js → legacy-agents-deep-HgU3c2Dz.js} +1 -1
  172. package/dist/client/assets/{legacy-main-redirect-DlBO4F0C.js → legacy-main-redirect-jScx_XSf.js} +1 -1
  173. package/dist/client/assets/library-CWV47kSp.js +1 -0
  174. package/dist/client/assets/{library-tab-ChjG-ita.js → library-tab-9158ORpA.js} +1 -1
  175. package/dist/client/assets/{login-BJJfll2X.js → login-OE28YT2s.js} +1 -1
  176. package/dist/client/assets/{markdown-BzeS6Mup.js → markdown-TXCHEe-4.js} +1 -1
  177. package/dist/client/assets/{mcp-app-renderer-BHQg4BC0.js → mcp-app-renderer-BAlCN3Lv.js} +1 -1
  178. package/dist/client/assets/{mcp-oauth-CCgQhJ0H.js → mcp-oauth-BFqNJ-iQ.js} +1 -1
  179. package/dist/client/assets/{mcp-oauth-C9k0QipU.js → mcp-oauth-CuU6LL15.js} +1 -1
  180. package/dist/client/assets/{members-BJ8Q84sj.js → members-CbEEa2ua.js} +1 -1
  181. package/dist/client/assets/{memory-6DQlmI8s.js → memory-malk94i-.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-Dp287JJW.js → mini-report-page-Dhes7qGv.js} +1 -1
  183. package/dist/client/assets/{mock-board-BrRrzkyb.js → mock-board-B4GBU96k.js} +1 -1
  184. package/dist/client/assets/{monaco-editor-Dqlv9Rx3.js → monaco-editor-DIn5LVAo.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-CHv5bry_.js → monitoring-stats-row-CsXWM1-N.js} +1 -1
  186. package/dist/client/assets/{multi-select-CxacBEPt.js → multi-select-jv5l4gKB.js} +1 -1
  187. package/dist/client/assets/{mustache-DewX4fdh.js → mustache-C3mAjW3w.js} +1 -1
  188. package/dist/client/assets/{new-project-dialog-HwZsHJw7.js → new-project-dialog-DCPZVRuS.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-K69Edssh.js → oauth-callback-C7bM7rgT.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-ai-provider-CpEQmEON.js → oauth-callback-ai-provider-maa6Zm5e.js} +1 -1
  191. package/dist/client/assets/{onboarding-CMSxOCHp.js → onboarding-ds1UbiQ9.js} +1 -1
  192. package/dist/client/assets/{openai-conversation-8f12XdbQ.js → openai-conversation-BSvbWT0F.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-qLHxsO7U.js → optimistic-project-sidebar-views-2rlAyeqj.js} +1 -1
  194. package/dist/client/assets/{order-monitor-day-C2C1WPzt.js → order-monitor-day-CZG8_Uqo.js} +1 -1
  195. package/dist/client/assets/{organization-choice-BlYawX8-.js → organization-choice-CGGV7pYx.js} +1 -1
  196. package/dist/client/assets/{orgs-CGBX8gbU.js → orgs-DSh5ncFV.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-BYVKaWGS.js → page-seo-form-BPMiXtW-.js} +1 -1
  198. package/dist/client/assets/{pair-84suUGZ3.js → pair-C9IKm4JE.js} +1 -1
  199. package/dist/client/assets/{plan-ladder-Ct3CUY0O.js → plan-ladder-DbkDT52b.js} +1 -1
  200. package/dist/client/assets/{popover-Ba56Iai5.js → popover-CzNTcDJM.js} +1 -1
  201. package/dist/client/assets/{post-calendar-RpsbnecM.js → post-calendar-DGIFZvru.js} +1 -1
  202. package/dist/client/assets/{post-editor-C9oD8ESN.js → post-editor-BINaZa6q.js} +1 -1
  203. package/dist/client/assets/{preview-content-DF0BMyfw.js → preview-content-BjX4Mivy.js} +1 -1
  204. package/dist/client/assets/{preview-dialog-DlotDPpC.js → preview-dialog-C8Boj2eR.js} +1 -1
  205. package/dist/client/assets/{preview-panel-BFMr1mkC.js → preview-panel-BTtWNKn9.js} +1 -1
  206. package/dist/client/assets/{preview-tab-AtnwySoZ.js → preview-tab-BYhuHpLV.js} +3 -3
  207. package/dist/client/assets/{product-picker-dialog-JlTB9ihe.js → product-picker-dialog-qxyRXjlS.js} +1 -1
  208. package/dist/client/assets/{profile-NePIrfXd.js → profile-Cgb34CQu.js} +1 -1
  209. package/dist/client/assets/{project-app-view-CZBqblIb.js → project-app-view-B5MD1o9B.js} +1 -1
  210. package/dist/client/assets/{project-feed-Y1MpiHk4.js → project-feed-DnDlefHV.js} +1 -1
  211. package/dist/client/assets/{project-icon-CxJtU18v.js → project-icon-CP0m7tWm.js} +1 -1
  212. package/dist/client/assets/project-reports-8XAuspn6.js +1 -0
  213. package/dist/client/assets/project-tasks-CGbl7DTy.js +1 -0
  214. package/dist/client/assets/{projects-CiRkvKrf.js → projects-DmCmaniu.js} +1 -1
  215. package/dist/client/assets/{projects-empty-state-D7-trQYt.js → projects-empty-state-fIhR2Z5I.js} +1 -1
  216. package/dist/client/assets/{prompts-DNcBfJiD.js → prompts-CW5UUH65.js} +1 -1
  217. package/dist/client/assets/record-editor--8X4AXV_.js +1 -0
  218. package/dist/client/assets/{redirect-editor-CC5Q4Ymt.js → redirect-editor-CxJl2CVJ.js} +1 -1
  219. package/dist/client/assets/{reports-DIGilxrB.js → reports-BXGEiRjn.js} +1 -1
  220. package/dist/client/assets/reports-eZ_It7qc.js +1 -0
  221. package/dist/client/assets/{reports-onboarding-B0pJwCjp.js → reports-onboarding-DNEAbZJV.js} +1 -1
  222. package/dist/client/assets/{reports-tab-BGanWho6.js → reports-tab-CwK-fp7x.js} +2 -2
  223. package/dist/client/assets/{repositories-B2bTWPV9.js → repositories-ClghJilC.js} +1 -1
  224. package/dist/client/assets/{repository-binding-DqlrnpeD.js → repository-binding-BYnKmLVI.js} +1 -1
  225. package/dist/client/assets/{repository-import-picker-BQKO3YmL.js → repository-import-picker-De4qAOck.js} +1 -1
  226. package/dist/client/assets/{repository-picker-1U5-cKDz.js → repository-picker-B7BUYgB7.js} +1 -1
  227. package/dist/client/assets/{require-capability-ojXn93H0.js → require-capability-hn1SreP5.js} +1 -1
  228. package/dist/client/assets/{required-auth-layout-D-YJoBk-.js → required-auth-layout-Mqzz7XgH.js} +1 -1
  229. package/dist/client/assets/{reset-password-BmX8ePKp.js → reset-password-BOpvbCSW.js} +1 -1
  230. package/dist/client/assets/{resizable-CbpZQFpZ.js → resizable-DpCFVPH5.js} +1 -1
  231. package/dist/client/assets/{resolve-tab-icon-D2OV9kBN.js → resolve-tab-icon-8PRTNpAS.js} +1 -1
  232. package/dist/client/assets/{review-settings-DK01glaZ.js → review-settings-Bw0A1sn1.js} +1 -1
  233. package/dist/client/assets/{roles-LZWr7__G.js → roles-BMCtr4MB.js} +1 -1
  234. package/dist/client/assets/{route-Gjmz5E23.js → route-DLSqOpoM.js} +1 -1
  235. package/dist/client/assets/{route-ihwuHnpr.js → route-DnP6JRb8.js} +1 -1
  236. package/dist/client/assets/route-yiouOCXy.js +1 -0
  237. package/dist/client/assets/{sandbox-lifecycle-context-CMe6ziY_.js → sandbox-lifecycle-context-Dg7K5ioC.js} +1 -1
  238. package/dist/client/assets/{schema-DvCj02YW.js → schema-D-qEbXZ-.js} +1 -1
  239. package/dist/client/assets/{schema-j2854AG6.js → schema-zU96PUAb.js} +1 -1
  240. package/dist/client/assets/{scroll-area-DRWJ_F1a.js → scroll-area-D_ro8hTm.js} +1 -1
  241. package/dist/client/assets/{search-input-DqG4kyRF.js → search-input-qNQGHbDh.js} +1 -1
  242. package/dist/client/assets/{search-toggle-CGVfCMLJ.js → search-toggle-Dfh8XGYH.js} +1 -1
  243. package/dist/client/assets/{secret-ciphertext-DXqrbEWb.js → secret-ciphertext-DkD2R7dc.js} +1 -1
  244. package/dist/client/assets/{secret-picker-Diad3aWD.js → secret-picker-CmVVvqgZ.js} +1 -1
  245. package/dist/client/assets/{secrets-_pq8fc-A.js → secrets-BDW-A1kb.js} +1 -1
  246. package/dist/client/assets/{sections-editor-jfQPkYiX.js → sections-editor-BKmXdadO.js} +1 -1
  247. package/dist/client/assets/{select-Jex63p6s.js → select-C4iThYr6.js} +1 -1
  248. package/dist/client/assets/{select-model-BpMhMCHG.js → select-model-BND792Uy.js} +1 -1
  249. package/dist/client/assets/{seo-editor-rID5Th2v.js → seo-editor-ClpJZQda.js} +1 -1
  250. package/dist/client/assets/{separator-laGeAgXV.js → separator-DYHY_XVB.js} +1 -1
  251. package/dist/client/assets/{settings-tab-D4oc-m6U.js → settings-tab-A8T1BHYG.js} +1 -1
  252. package/dist/client/assets/{sheet-BjDciyLt.js → sheet-BXRHJIP3.js} +1 -1
  253. package/dist/client/assets/{shell-layout-ohVxtYQn.js → shell-layout-BhM3Q_22.js} +1 -1
  254. package/dist/client/assets/site-editor-LulM9jUZ.js +1 -0
  255. package/dist/client/assets/{site-editor-toast-Cwor802o.js → site-editor-toast-DPPGE5LH.js} +1 -1
  256. package/dist/client/assets/{skills-BjHMkGI4.js → skills-Kw1j3-7B.js} +1 -1
  257. package/dist/client/assets/{slider-BgVX57Hw.js → slider-CpU4rmfX.js} +1 -1
  258. package/dist/client/assets/{sortable.esm--JfVXwY2.js → sortable.esm-CBSg5QWi.js} +1 -1
  259. package/dist/client/assets/{sso-DtpWrT1m.js → sso-GSEhvAQ2.js} +1 -1
  260. package/dist/client/assets/{suggestion-DmWAjig0.js → suggestion-BPVDnpZj.js} +1 -1
  261. package/dist/client/assets/{switch-BXwkRMsQ.js → switch-63WSXheM.js} +1 -1
  262. package/dist/client/assets/{symbol-DMd_AX9i.js → symbol-rviHpBrN.js} +1 -1
  263. package/dist/client/assets/{synced-repos-DXXyL6dr.js → synced-repos-D3YnOlYC.js} +1 -1
  264. package/dist/client/assets/{tab-icon-glyph-WTogvuRL.js → tab-icon-glyph-Dqe-yN6V.js} +1 -1
  265. package/dist/client/assets/{table-BEoFysnY.js → table-CLaOCONQ.js} +1 -1
  266. package/dist/client/assets/{tabs-BUOCNWab.js → tabs-BQUPeDjf.js} +1 -1
  267. package/dist/client/assets/{task-board-et69go2s.js → task-board-DxxiAR5A.js} +1 -1
  268. package/dist/client/assets/{task-route-DRCZxpHC.js → task-route-Ce6MTE8h.js} +1 -1
  269. package/dist/client/assets/{task-status-Clz_ohkz.js → task-status-CMbp-PaL.js} +1 -1
  270. package/dist/client/assets/taskboard-analytics-_ZvfL2sj.js +1 -0
  271. package/dist/client/assets/{tasks-CI2TSEv1.js → tasks-BarD4hla.js} +1 -1
  272. package/dist/client/assets/tasks-DcunZstc.js +1 -0
  273. package/dist/client/assets/{textarea-BP2sfmUn.js → textarea-CxYAsAPe.js} +1 -1
  274. package/dist/client/assets/{thread-analytics-ClTk6JCf.js → thread-analytics-Cjx1orRq.js} +1 -1
  275. package/dist/client/assets/{thread-intent-B3UX1VYD.js → thread-intent-DikZOwd-.js} +1 -1
  276. package/dist/client/assets/{thread-route-Dj3FHeZv.js → thread-route-CRU_aqN9.js} +1 -1
  277. package/dist/client/assets/{thread-route-C-V5eWkC.js → thread-route-ChugAIRh.js} +1 -1
  278. package/dist/client/assets/{thread-sheet-body-DN2xi_yQ.js → thread-sheet-body-DfFj6DBB.js} +1 -1
  279. package/dist/client/assets/{time-range-picker-BGpEdCr4.js → time-range-picker-Bf6M5ihN.js} +1 -1
  280. package/dist/client/assets/{toggle-group-CElgKi93.js → toggle-group-DbSldXZX.js} +1 -1
  281. package/dist/client/assets/{tool-namespace-CSvvZ9-r.js → tool-namespace-pIFYrei5.js} +1 -1
  282. package/dist/client/assets/{toolbar-icon-button-BHgf03SN.js → toolbar-icon-button-B24Twz-b.js} +1 -1
  283. package/dist/client/assets/{tooltip-D39pwdkl.js → tooltip-Bs0EJaD7.js} +1 -1
  284. package/dist/client/assets/{tooltipContext-v4Ov_BWo.js → tooltipContext-fXkDpiI8.js} +1 -1
  285. package/dist/client/assets/{track-D4y7DnsA.js → track-BzGhLw1A.js} +1 -1
  286. package/dist/client/assets/{types-sLIChj1_.js → types-IpdOmnYx.js} +1 -1
  287. package/dist/client/assets/{url-slug-Ui3mV6vi.js → url-slug-CMCbwnaP.js} +1 -1
  288. package/dist/client/assets/{usage-stats-D62oidTL.js → usage-stats-DuvxTL2m.js} +1 -1
  289. package/dist/client/assets/{use-ai-providers-IcsUWN-K.js → use-ai-providers-Becg3IYt.js} +1 -1
  290. package/dist/client/assets/{use-app-takeover-CIvPyTDt.js → use-app-takeover-DFb1RzQs.js} +1 -1
  291. package/dist/client/assets/{use-automations-D4B7ETWW.js → use-automations-Cp9pysoO.js} +1 -1
  292. package/dist/client/assets/{use-autosave-D9eru9Ze.js → use-autosave-C5CskRdQ.js} +1 -1
  293. package/dist/client/assets/{use-chat-navigation-D_OZ7XLd.js → use-chat-navigation-BJSvg7rH.js} +1 -1
  294. package/dist/client/assets/{use-clock-tick-BEO-m3vD.js → use-clock-tick-B1PaG9d4.js} +1 -1
  295. package/dist/client/assets/{use-connect-companion-Cujc6mJy.js → use-connect-companion-ClLk9Ret.js} +1 -1
  296. package/dist/client/assets/{use-connection-BxJdPGkr.js → use-connection-CLmhN_H7.js} +1 -1
  297. package/dist/client/assets/{use-copy-BlMydeoV.js → use-copy-T3xwaExj.js} +1 -1
  298. package/dist/client/assets/{use-create-virtual-mcp-Bd3ICWl5.js → use-create-virtual-mcp-CVTk_yNo.js} +1 -1
  299. package/dist/client/assets/{use-date-fns-locale-BJ-xFgzl.js → use-date-fns-locale-CYDYn543.js} +1 -1
  300. package/dist/client/assets/{use-debounced-autosave-Dt1irWAn.js → use-debounced-autosave-8fEcHiWI.js} +1 -1
  301. package/dist/client/assets/{use-debounced-value-B_S8lb_4.js → use-debounced-value-d254MtLc.js} +1 -1
  302. package/dist/client/assets/{use-deco-credits-nfiVDn98.js → use-deco-credits-BJdkVUlJ.js} +1 -1
  303. package/dist/client/assets/{use-decopilot-events-qheXoFrz.js → use-decopilot-events-D42PqykU.js} +1 -1
  304. package/dist/client/assets/{use-delete-connection-DJv3D_sh.js → use-delete-connection-Bp41mUbu.js} +1 -1
  305. package/dist/client/assets/{use-deployment-admin-BZx-lcmt.js → use-deployment-admin-Cz36UM7j.js} +1 -1
  306. package/dist/client/assets/{use-ensure-project-folder-568pY7Mx.js → use-ensure-project-folder-DV9pI0pa.js} +1 -1
  307. package/dist/client/assets/{use-fast-preview-draft-url-B5I6D4fe.js → use-fast-preview-draft-url-Dbj9pvCB.js} +1 -1
  308. package/dist/client/assets/{use-file-configs-wZCwveLR.js → use-file-configs-D_kGDRPd.js} +1 -1
  309. package/dist/client/assets/{use-infinite-scroll-yxXaBcmD.js → use-infinite-scroll-C47I-wuH.js} +1 -1
  310. package/dist/client/assets/{use-join-requests-DqmeRmXJ.js → use-join-requests-Cy3hlZv5.js} +1 -1
  311. package/dist/client/assets/{use-main-panel-tabs-CUuCqnlA.js → use-main-panel-tabs-DjhEbRyd.js} +1 -1
  312. package/dist/client/assets/{use-mcp-auth-status-BCDRh6Ej.js → use-mcp-auth-status-5SUSMsp-.js} +1 -1
  313. package/dist/client/assets/{use-mcp-client-cb8e4tvm.js → use-mcp-client-CEKqqblF.js} +1 -1
  314. package/dist/client/assets/{use-mcp-prompts-BfEVPVEx.js → use-mcp-prompts-CwF-bqUg.js} +1 -1
  315. package/dist/client/assets/{use-mcp-tools-DZxb1_zu.js → use-mcp-tools-_07-mu_D.js} +1 -1
  316. package/dist/client/assets/{use-members-D7SiQmGu.js → use-members-CFcpHrvE.js} +1 -1
  317. package/dist/client/assets/{use-mobile-BNQyDf1J.js → use-mobile-CYsZ0F3X.js} +1 -1
  318. package/dist/client/assets/{use-navigate-to-agent-D-kAnKoC.js → use-navigate-to-agent-DNsHLJD8.js} +1 -1
  319. package/dist/client/assets/{use-open-billing-url-CdvtCyZf.js → use-open-billing-url-C1m0KS6b.js} +1 -1
  320. package/dist/client/assets/{use-org-auth-client-D3FbjOmE.js → use-org-auth-client-9ZqTxhaU.js} +1 -1
  321. package/dist/client/assets/{use-org-fs-C9g2s6eE.js → use-org-fs-Wo4_O8nn.js} +1 -1
  322. package/dist/client/assets/{use-org-repo-syncs-U8WqzFiL.js → use-org-repo-syncs-HjlHy8Rb.js} +1 -1
  323. package/dist/client/assets/{use-org-sso-s2tGLzu6.js → use-org-sso-BSkklN8h.js} +1 -1
  324. package/dist/client/assets/{use-organization-roles-Bo-TSZF4.js → use-organization-roles-Dga2ANZJ.js} +1 -1
  325. package/dist/client/assets/{use-organization-settings-CtcFsKQW.js → use-organization-settings-DHSMN_14.js} +1 -1
  326. package/dist/client/assets/{use-panel-navigate-BLgl8f3Y.js → use-panel-navigate-62gIHptt.js} +1 -1
  327. package/dist/client/assets/{use-project-native-view-presence-uvlxs5r_.js → use-project-native-view-presence-D12oGF6A.js} +1 -1
  328. package/dist/client/assets/{use-project-scope-DCmZMFkQ.js → use-project-scope-Dk4Q60O6.js} +1 -1
  329. package/dist/client/assets/{use-recent-apps-DlPuhtE-.js → use-recent-apps-CCwo686W.js} +1 -1
  330. package/dist/client/assets/{use-releases-DtKRf56Y.js → use-releases-wK1mECcA.js} +1 -1
  331. package/dist/client/assets/{use-reports-diagnostic-DYrOUUTZ.js → use-reports-diagnostic-CfPcDRof.js} +1 -1
  332. package/dist/client/assets/{use-secrets-WRKR8ecc.js → use-secrets-Cmhjz2bf.js} +1 -1
  333. package/dist/client/assets/{use-section-preview-base-BNxt4jxu.js → use-section-preview-base-DJFgOhQZ.js} +1 -1
  334. package/dist/client/assets/{use-tags-DiN0kMpJ.js → use-tags-D0LqZNOI.js} +1 -1
  335. package/dist/client/assets/{use-task-board-analytics-1JoUE9AJ.js → use-task-board-analytics-BpQqtB1w.js} +1 -1
  336. package/dist/client/assets/{use-task-board-events-BLTRhUg4.js → use-task-board-events-BrTJpTlj.js} +1 -1
  337. package/dist/client/assets/{use-task-board-item-prs-At19hfLC.js → use-task-board-item-prs-BHRZFWqk.js} +1 -1
  338. package/dist/client/assets/{use-task-board-items-CRXCkQuK.js → use-task-board-items-CZjiF2uB.js} +1 -1
  339. package/dist/client/assets/{use-task-metadata-C3llYFZN.js → use-task-metadata-Bef5UioD.js} +1 -1
  340. package/dist/client/assets/{use-thread-analytics-Co1Kx3t4.js → use-thread-analytics-CiJumHRj.js} +1 -1
  341. package/dist/client/assets/{use-thread-outputs-D5eAX3jD.js → use-thread-outputs-BVEM1vsy.js} +1 -1
  342. package/dist/client/assets/useInfiniteQuery-S3a_-GqY.js +1 -0
  343. package/dist/client/assets/{useQueries-BBbNh9lc.js → useQueries-D52x651p.js} +1 -1
  344. package/dist/client/assets/useSuspenseInfiniteQuery-DiRI5XkI.js +1 -0
  345. package/dist/client/assets/{users-vqq5iPZ9.js → users-DfEzbgjc.js} +1 -1
  346. package/dist/client/assets/{utils-D5Pt5WPE.js → utils-DVs-Bhj-.js} +1 -1
  347. package/dist/client/assets/{variant-calendar-CYUJLh9u.js → variant-calendar-B4damr_G.js} +1 -1
  348. package/dist/client/assets/{variant-draft-pointer-3s80HEa9.js → variant-draft-pointer-BnxZeLy_.js} +1 -1
  349. package/dist/client/assets/{view-mode-toggle-BksAfU6L.js → view-mode-toggle-DKlegHXH.js} +1 -1
  350. package/dist/client/assets/{virtual-mcp-CvKEEaVD.js → virtual-mcp-UT0zZzHO.js} +1 -1
  351. package/dist/client/assets/{watch-sse-pool-BqvFDRe4.js → watch-sse-pool-BdkzrgTO.js} +1 -1
  352. package/dist/client/index.html +1 -1
  353. package/dist/server/server.js +4 -4
  354. package/package.json +1 -1
  355. package/dist/client/assets/agent-app-D7ZbeaeS.js +0 -1
  356. package/dist/client/assets/agent-deck-Bfjkqa9C.js +0 -1
  357. package/dist/client/assets/agent-library-Bi2qzW40.js +0 -1
  358. package/dist/client/assets/agent-library-file-CSltTnVe.js +0 -1
  359. package/dist/client/assets/agent-settings-BLtCRmyO.js +0 -1
  360. package/dist/client/assets/agent-site-editor-code-Od55DzQ1.js +0 -2
  361. package/dist/client/assets/agent-site-editor-content-5qi46g26.js +0 -1
  362. package/dist/client/assets/agent-site-editor-preview-CutGG4Ds.js +0 -1
  363. package/dist/client/assets/agent-view-CEr3hNFJ.js +0 -1
  364. package/dist/client/assets/api-keys-WauVetoj.js +0 -1
  365. package/dist/client/assets/cms-settings-editor-Bo6bMjKH.js +0 -1
  366. package/dist/client/assets/flat-project-CHR1TqE9.js +0 -1
  367. package/dist/client/assets/library-CZ6Ii9aX.js +0 -1
  368. package/dist/client/assets/project-reports-CULNrShG.js +0 -1
  369. package/dist/client/assets/project-tasks-Dvm1hFFM.js +0 -1
  370. package/dist/client/assets/record-editor-B2vAy35C.js +0 -1
  371. package/dist/client/assets/reports-BO8CzHO9.js +0 -1
  372. package/dist/client/assets/route-CVqHXXn6.js +0 -1
  373. package/dist/client/assets/site-editor-CaPr9Ncy.js +0 -1
  374. package/dist/client/assets/taskboard-analytics-Dk7dZzQl.js +0 -1
  375. package/dist/client/assets/tasks-DLgTzQCQ.js +0 -1
  376. package/dist/client/assets/useInfiniteQuery-CfgvSeG1.js +0 -1
  377. package/dist/client/assets/useSuspenseInfiniteQuery-BFK9VyAb.js +0 -1
@@ -1 +1 @@
1
- import{c as A,a2 as ne,a as pe,a9 as Ie,K as fe,m as me,b as K,r as B,l as ee,j as n,h as ve,aL as je,aK as Me,H as pt,y as he,v as qt,aM as Wt,s as Yt,q as Qt,D as Zt,aN as Xt,at as xt,t as Jt,au as es,d as Ae,o as ts,n as st,aO as ss,f as ke,M as nt,e as ns,u as Le,k as as,aP as rs,aQ as is,O as gt,aR as ls,N as os,B as cs,P as De}from"./index-CNnllo6G.js";import{i as qe}from"./AlertCircle-B7FQmH_M.js";import{C as ds,D as at,A as ye,E as us,F as fs,G as ms,H as hs,I as ps,J as xs,K as bt,L as gs,b as bs,M as vs,n as ys,h as js,k as ks}from"./agent-icon-B7cHtLmN.js";import{h as Ss,u as Ts}from"./use-app-takeover-CIvPyTDt.js";import{T as we}from"./toolbar-icon-button-BHgf03SN.js";import{C as W,w as Ns,S as _s}from"./index-D2K6wJdd.js";import{s as vt,C as ws,u as Cs,a as yt,V as Ps,b as Is}from"./input-DnkGG1pQ.js";import{u as $e,b as We,c as Ee,d as jt,e as Ms,s as As}from"./chat-context-Bm126Y9d.js";import{u as Ls,s as kt}from"./use-ai-providers-IcsUWN-K.js";import{b as St,a as $s,u as Es}from"./use-organization-settings-CtcFsKQW.js";import{i as Fs}from"./CheckCircle-DTvtIc91.js";import{s as rt}from"./XClose-UJ2K7TVC.js";import{a as Se,b as Tt,c as Nt,g as _t,p as Rs}from"./repository-binding-DqlrnpeD.js";import{I as wt}from"./integration-icon-Dl2m6ce3.js";import{c as Os}from"./use-decopilot-events-qheXoFrz.js";import{t as Ye}from"./ChevronUp-D6SZVzK-.js";import{O as Bs}from"./pair-84suUGZ3.js";import{u as Ds,a as zs}from"./use-thread-outputs-D5eAX3jD.js";import{u as Gs}from"./use-deco-credits-nfiVDn98.js";import{a as Qe,f as Hs,L as Us,s as Ks,b as Vs}from"./shell-layout-ohVxtYQn.js";import{t as qs,f as Ws,m as Ys,b as Qs,a as Zs}from"./use-project-native-view-presence-uvlxs5r_.js";import{g as Ct,u as Xs,n as Js,a as en}from"./use-releases-DtKRf56Y.js";import{u as tn,d as Pt,a as Ze,b as Xe,c as Je,e as sn}from"./thread-intent-B3UX1VYD.js";import{f as nn,b as It,c as an}from"./use-navigate-to-agent-D-kAnKoC.js";import{o as rn,s as ln,u as on,S as cn}from"./sandbox-lifecycle-context-CMe6ziY_.js";import{E as Mt}from"./empty-state-Qh91SokD.js";import{C as it}from"./index-DlkNBOKp.js";import{a as At,b as Lt,P as $t}from"./popover-Ba56Iai5.js";import{T as Fe,a as Re,c as Oe}from"./tooltip-D39pwdkl.js";import{T as dn,a as un}from"./toggle-group-CElgKi93.js";import{u as Et,a as et,r as fn,b as Ft,c as mn,d as hn}from"./thread-route-Dj3FHeZv.js";import{c as pn,C as xn,a as gn,b as bn,e as vn,d as yn}from"./command-DSORHlWH.js";import{i as Rt}from"./ZoomOut-FPIBUWhA.js";import{g as jn,S as kn}from"./task-status-Clz_ohkz.js";import{a as Sn}from"./format-time-CAj8AQXM.js";import{u as Tn}from"./use-clock-tick-BEO-m3vD.js";import{u as Nn}from"./use-chat-navigation-D_OZ7XLd.js";import{a as Ot,u as _n}from"./use-panel-navigate-BLgl8f3Y.js";import{u as Bt}from"./use-main-panel-tabs-CUuCqnlA.js";import{T as Ce}from"./tab-icon-glyph-WTogvuRL.js";import{a as wn}from"./UserSquare-ii6T7SpT.js";import{b as Cn,c as Dt,S as Pn,d as In}from"./select-Jex63p6s.js";import{L as tt,a as Mn}from"./legacy-main-redirect-DlBO4F0C.js";import{u as An}from"./use-mobile-BNQyDf1J.js";import{L as Ln}from"./preview-dialog-DlotDPpC.js";import{O as $n}from"./markdown-BzeS6Mup.js";import{B as lt}from"./blocks-preview-workspace-context-k-h3WbAb.js";import{p as En}from"./virtual-mcp-CvKEEaVD.js";import"./Tool01-D_pOnyrM.js";import"./ArrowUp-DJaSaDSt.js";import"./ArrowLeft-DZes_rvl.js";import"./LinkBroken01-C8q-hkDW.js";import"./ShoppingBag01-Cr7oTzOr.js";import"./Building02-C692k1Je.js";import"./ChevronSelectorVertical-CSoDnwYU.js";import"./Copy01-CRJ909cy.js";import"./CreditCard01-DKW3gWt7.js";import"./DotsVertical-DPFiEMJ2.js";import"./Image01-CoKdj_km.js";import"./Globe04-CCnzVN5c.js";import"./SwitchHorizontal01-Bv6v-_-V.js";import"./Key01-CZ56XYyu.js";import"./Link01-QYs7ouJl.js";import"./Monitor01-DO9PZtsn.js";import"./Sun-DM7-cZiQ.js";import"./Play-B8h_fG9j.js";import"./Plus-CyJJ3XFV.js";import"./SearchMd-Yk_yG6_-.js";import"./Trash01-CLvb-vxo.js";import"./Upload01-DotbRoth.js";import"./User01-DpzyFtdl.js";import"./Users01-BEOgMF3y.js";import"./sheet-BjDciyLt.js";import"./sandbox-url-D3mC8qhT.js";import"./backoff-CrEUbyZT.js";import"./tool-namespace-CSvvZ9-r.js";import"./drawer-BaMAsObr.js";import"./collection-search-BJh6F6XQ.js";import"./use-mcp-client-cb8e4tvm.js";import"./auth-D-N_o1pb.js";import"./use-mcp-prompts-BfEVPVEx.js";import"./usage-stats-D62oidTL.js";import"./form-B2R0FZpl.js";import"./label-C2MI3yAw.js";import"./utils-CVEq3hMx.js";import"./use-copy-BlMydeoV.js";import"./index-BQe9t0ZU.js";import"./checkbox-BHYLtolO.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-nIzU_VyX.js";import"./feature-paywall-yY-LJqXW.js";import"./plan-ladder-Ct3CUY0O.js";import"./icon-button-BLmb1aFH.js";import"./file-type-icon-CmCTgogr.js";import"./location-BjlyegC2.js";import"./autosend-BZJ2TdB9.js";import"./chat-draft-DpsQeTSh.js";import"./tabs-BUOCNWab.js";import"./use-open-billing-url-CdvtCyZf.js";import"./input-Bue-yNpK.js";import"./suggestion-DmWAjig0.js";import"./use-org-fs-C9g2s6eE.js";import"./useInfiniteQuery-CfgvSeG1.js";import"./infiniteQueryObserver-CqK1S2-W.js";import"./question-004-sINsf4GQ.js";import"./use-members-D7SiQmGu.js";import"./use-org-auth-client-D3FbjOmE.js";import"./add-connection-dialog-DVH8e9NI.js";import"./extract-connection-data-CmhWlbRd.js";import"./metadata-D72DunRR.js";import"./connection-VFOGX82d.js";import"./url-slug-Ui3mV6vi.js";import"./connection-card-CugVHwbe.js";import"./connection-slug-CITJ0kGN.js";import"./slugify-CEUa2lfQ.js";import"./textarea-BP2sfmUn.js";import"./use-connection-BxJdPGkr.js";import"./schema-DvCj02YW.js";import"./connection-form-helpers-Ht3Y_JTI.js";import"./authenticate-and-persist-oauth-1LFr51s5.js";import"./mcp-oauth-CCgQhJ0H.js";import"./mcp-oauth-C9k0QipU.js";import"./collection-tabs-jNi4Jv0Y.js";import"./badge-BPqtGuPz.js";import"./use-infinite-scroll-yxXaBcmD.js";import"./useSuspenseInfiniteQuery-BFK9VyAb.js";import"./use-task-board-events-BLTRhUg4.js";import"./task-board-et69go2s.js";import"./schema-j2854AG6.js";import"./watch-sse-pool-BqvFDRe4.js";import"./collapsible-Bnza8CXw.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BHQg4BC0.js";import"./types-sLIChj1_.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-project-scope-DCmZMFkQ.js";import"./project-icon-CxJtU18v.js";import"./new-project-dialog-HwZsHJw7.js";import"./repository-import-picker-BQKO3YmL.js";import"./repository-picker-1U5-cKDz.js";import"./use-debounced-value-B_S8lb_4.js";import"./required-auth-layout-D-YJoBk-.js";import"./use-org-sso-s2tGLzu6.js";import"./use-file-configs-wZCwveLR.js";import"./site-slug-DebpOoQq.js";import"./serial-task-queue-CGOeQgpr.js";import"./delay-CnY5UFtP.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./resizable-CbpZQFpZ.js";import"./index-JfKaG8r5.js";import"./index-C5kiFY0N.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-mcp-tools-DZxb1_zu.js";import"./resolve-tab-icon-D2OV9kBN.js";import"./use-task-metadata-C3llYFZN.js";import"./preview-source-BsRLGWUP.js";import"./index-BdQq_4o_.js";import"./preview-content-DF0BMyfw.js";import"./file-share-button-Db4oG9-W.js";import"./file-preview-DA9PL3PH.js";import"./utils-D5Pt5WPE.js";import"./editor-gEAdAF4z.js";function Fn({isThreadLocked:t,hasCloudProviderKeys:e,sandboxOnlyChats:s,canRunClaudeCode:r}){return t?null:!e&&!(s&&r)?"provider":s&&!r?"claude-code-provider":null}function Rn(){const t=A.c(25),e=Ls(),s=$e(),r=St(),i=$s("chat_harness_codex"),{org:a}=ne(),{data:o}=pe.useSession(),c=o?.user.id??"",u=Ie(),l=e.some(Bn);let d;t[0]!==a.id?(d=fe.claudeSubscription(a.id),t[0]=a.id,t[1]=d):d=t[1];let m;t[2]!==u?(m=()=>u.call("CLAUDE_SUBSCRIPTION_STATUS",{}),t[2]=u,t[3]=m):m=t[3];const f=r&&!i&&!l;let h;t[4]!==d||t[5]!==m||t[6]!==f?(h={queryKey:d,queryFn:m,enabled:f},t[4]=d,t[5]=m,t[6]=f,t[7]=h):h=t[7];const j=me(h);let k;t[8]!==a.id?(k=fe.githubCopilot(a.id),t[8]=a.id,t[9]=k):k=t[9];let v;t[10]!==u?(v=()=>u.call("GITHUB_COPILOT_STATUS",{}),t[10]=u,t[11]=v):v=t[11];const x=r&&!i&&!l;let g;t[12]!==k||t[13]!==v||t[14]!==x?(g={queryKey:k,queryFn:v,enabled:x},t[12]=k,t[13]=v,t[14]=x,t[15]=g):g=t[15];const b=me(g);let y;t[16]!==a.id||t[17]!==c?(y=fe.codexSubscription(a.id,c),t[16]=a.id,t[17]=c,t[18]=y):y=t[18];let p;t[19]!==u?(p=()=>u.call("CODEX_SUBSCRIPTION_STATUS",{}),t[19]=u,t[20]=p):p=t[20];const S=r&&i;let N;t[21]!==S||t[22]!==y||t[23]!==p?(N={queryKey:y,queryFn:p,enabled:S},t[21]=S,t[22]=y,t[23]=p,t[24]=N):N=t[24];const T=me(N);return r&&i&&!s?.isThreadLocked?e.some(On)||T.data?.connected!==!1?null:"codex-provider":Fn({isThreadLocked:s?.isThreadLocked??!1,hasCloudProviderKeys:e.length>0,sandboxOnlyChats:r,canRunClaudeCode:l||j.data?.connected!==!1||b.data?.connected!==!1||!!b.data?.orgShare})}function On(t){return vt(t.providerId)}function Bn(t){return kt(t.providerId)}function be(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function ze(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 Dn(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function zn(t){const e=A.c(4),{items:s}=t;let r;e[0]!==s?(r=s.map(Gn),e[0]=s,e[1]=r):r=e[1];let i;return e[2]!==r?(i=n.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:r}),e[2]=r,e[3]=i):i=e[3],i}function Gn(t){return n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[n.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.label}),n.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:t.value})]},t.label)}function Hn(t){const e=A.c(33),{userTokens:s,assistantTokens:r,otherTokens:i}=t,a=K(),o=s+r+i,c=o>0?s/o*100:0,u=o>0?r/o*100:0,l=o>0?i/o*100:0;let d;e[0]!==c?(d=c>0&&n.jsx("div",{className:"h-full bg-chart-1",style:{width:`${c}%`}}),e[0]=c,e[1]=d):d=e[1];let m;e[2]!==u?(m=u>0&&n.jsx("div",{className:"h-full bg-chart-2",style:{width:`${u}%`}}),e[2]=u,e[3]=m):m=e[3];let f;e[4]!==l?(f=l>0&&n.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${l}%`}}),e[4]=l,e[5]=f):f=e[5];let h;e[6]!==d||e[7]!==m||e[8]!==f?(h=n.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[d,m,f]}),e[6]=d,e[7]=m,e[8]=f,e[9]=h):h=e[9];let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=j):j=e[10];let k;e[11]!==a||e[12]!==c?(k=a("chat.contextPanel.userPercent",{pct:c.toFixed(1)}),e[11]=a,e[12]=c,e[13]=k):k=e[13];let v;e[14]!==k?(v=n.jsxs("div",{className:"flex items-center gap-1.5",children:[j,n.jsx("span",{className:"text-xs text-muted-foreground",children:k})]}),e[14]=k,e[15]=v):v=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[16]=x):x=e[16];let g;e[17]!==u||e[18]!==a?(g=a("chat.contextPanel.assistantPercent",{pct:u.toFixed(1)}),e[17]=u,e[18]=a,e[19]=g):g=e[19];let b;e[20]!==g?(b=n.jsxs("div",{className:"flex items-center gap-1.5",children:[x,n.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e[20]=g,e[21]=b):b=e[21];let y;e[22]!==l||e[23]!==i||e[24]!==a?(y=i>0&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.otherPercent",{pct:l.toFixed(1)})})]}),e[22]=l,e[23]=i,e[24]=a,e[25]=y):y=e[25];let p;e[26]!==b||e[27]!==y||e[28]!==v?(p=n.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[v,b,y]}),e[26]=b,e[27]=y,e[28]=v,e[29]=p):p=e[29];let S;return e[30]!==p||e[31]!==h?(S=n.jsxs("div",{className:"flex flex-col gap-2",children:[h,p]}),e[30]=p,e[31]=h,e[32]=S):S=e[32],S}function Un(t){const e=A.c(14),{agentId:s,isError:r}=t,i=Se(s),a=K();let o;e[0]!==i?.title||e[1]!==a?(o=i?.title??a("chat.subtask.subtaskNoun"),e[0]=i?.title,e[1]=a,e[2]=o):o=e[2];const c=o,u=i?.icon??null;let l;e[3]!==u||e[4]!==c?(l=n.jsx(wt,{icon:u,name:c,size:"xs",className:"size-6 rounded-md shrink-0"}),e[3]=u,e[4]=c,e[5]=l):l=e[5];const d=r?"text-destructive":"text-foreground";let m;e[6]!==d?(m=ee("shrink-0 font-medium",d),e[6]=d,e[7]=m):m=e[7];let f;e[8]!==c||e[9]!==m?(f=n.jsx("span",{className:m,children:c}),e[8]=c,e[9]=m,e[10]=f):f=e[10];let h;return e[11]!==l||e[12]!==f?(h=n.jsxs(n.Fragment,{children:[l,f]}),e[11]=l,e[12]=f,e[13]=h):h=e[13],h}function Kn(t){const e=A.c(12),{isError:s}=t,r=K();let i;e[0]!==r?(i=r("chat.contextPanel.subtask"),e[0]=r,e[1]=i):i=e[1];const a=i;let o;e[2]!==a?(o=n.jsx(wt,{icon:null,name:a,size:"xs",className:"size-6 rounded-md shrink-0"}),e[2]=a,e[3]=o):o=e[3];const c=s?"text-destructive":"text-foreground";let u;e[4]!==c?(u=ee("shrink-0 font-medium",c),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==a||e[7]!==u?(l=n.jsx("span",{className:u,children:a}),e[6]=a,e[7]=u,e[8]=l):l=e[8];let d;return e[9]!==o||e[10]!==l?(d=n.jsxs(n.Fragment,{children:[o,l]}),e[9]=o,e[10]=l,e[11]=d):d=e[11],d}function Vn(t){const e=A.c(18),{part:s}=t,r=s.input?.agent_id,i=s.state==="input-streaming"||s.state==="input-available"||s.state==="output-available"&&s.preliminary===!0,a=s.state==="output-error",o=s.state==="approval-requested";let c;e[0]!==a?(c=n.jsx(Kn,{isError:a}),e[0]=a,e[1]=c):c=e[1];let u;e[2]!==r||e[3]!==a?(u=n.jsx(Un,{agentId:r,isError:a}),e[2]=r,e[3]=a,e[4]=u):u=e[4];let l;e[5]!==c||e[6]!==u?(l=n.jsx(B.Suspense,{fallback:c,children:u}),e[5]=c,e[6]=u,e[7]=l):l=e[7];let d;e[8]!==s.input?(d=s.input?.prompt&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted-foreground/50",children:"·"}),n.jsx("span",{className:"truncate text-muted-foreground",children:s.input.prompt})]}),e[8]=s.input,e[9]=d):d=e[9];let m;e[10]!==o||e[11]!==a||e[12]!==i?(m=n.jsx("span",{className:"ml-auto shrink-0",children:i?n.jsx(ve,{className:"size-3 text-muted-foreground"}):a?n.jsx(ds,{size:12,className:"text-destructive"}):o?n.jsx(qe,{size:12,className:"text-warning"}):n.jsx(Fs,{size:12,className:"text-success"})}),e[10]=o,e[11]=a,e[12]=i,e[13]=m):m=e[13];let f;return e[14]!==l||e[15]!==d||e[16]!==m?(f=n.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[l,d,m]}),e[14]=l,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function qn(t){const e=A.c(51),{onClose:s,back:r,className:i}=t,a=K(),[o,c]=B.useState(null),{messages:u}=We(),{activeTask:l}=Ee(),{selectedModel:d,selectedVirtualMcp:m}=jt(),f=Ms(u),h=[...u].reverse().find(ra),j=h?.metadata?.usage,k=[...u].reverse().find(aa)?.metadata?.models?.thinking,v=h?.metadata?.modelLimits?.contextWindow??(!k||k.id===d?.modelId?d?.limits?.contextWindow:null)??null,x=j?.contextTokens??0,g=v&&v>0?(x/v*100).toFixed(1):null,b=u;let y;e[0]!==b?(y=b.filter(na).reduce(sa,0),e[0]=b,e[1]=y):y=e[1];const p=y,S=u;let N;e[2]!==S?(N=S.filter(ta).reduce(ea,0),e[2]=S,e[3]=N):N=e[3];const T=N,_=Math.max(0,f.totalTokens-p-T),w=u[0],I=u.at(-1),P=w?.metadata?.created_at??l?.created_at,L=I?.metadata?.created_at??l?.updated_at,$=u.filter(Jn),E=u.flatMap(Zn),F=Dn(k?.id??d?.modelId),R=m?.title??"Super Agent",M=Os(),C=[{label:a("chat.contextPanel.sessionLabel"),value:l?.title??a("chat.contextPanel.newChat")},{label:a("chat.contextPanel.messagesLabel"),value:$.length},{label:a("chat.contextPanel.agentLabel"),value:R},...M?[{label:a("chat.contextPanel.modelLabel"),value:F}]:[],{label:a("chat.contextPanel.contextLimitLabel"),value:v?be(v):"—"},{label:a("chat.contextPanel.sessionTokensLabel"),value:f.totalTokens>0?be(f.totalTokens):"0"},{label:a("chat.contextPanel.usageLabel"),value:g!==null?`${g}%`:"—"},{label:a("chat.contextPanel.inputTokensLabel"),value:f.inputTokens>0?be(f.inputTokens):"0"},{label:a("chat.contextPanel.outputTokensLabel"),value:f.outputTokens>0?be(f.outputTokens):"0"},{label:a("chat.contextPanel.reasoningTokensLabel"),value:f.reasoningTokens>0?be(f.reasoningTokens):"0"},...M?[{label:a("chat.contextPanel.costLabel"),value:f.cost>0?`$${f.cost<.001?f.cost.toFixed(6):f.cost.toFixed(4)}`:"$0.00"}]:[],{label:a("chat.contextPanel.sessionCreatedLabel"),value:ze(P)},{label:a("chat.contextPanel.lastActivityLabel"),value:ze(L)}];if(!l&&$.length===0){let D;e[4]!==i?(D=ee("flex flex-col h-full w-full border-l border-border bg-background",i),e[4]=i,e[5]=D):D=e[5];let re;e[6]!==a?(re=a("chat.contextPanel.title"),e[6]=a,e[7]=re):re=e[7];let X;e[8]!==re?(X=n.jsx("span",{className:"text-sm font-medium text-foreground",children:re}),e[8]=re,e[9]=X):X=e[9];let J;e[10]!==r?(J=r?n.jsx(at,{size:14,className:"text-muted-foreground"}):n.jsx(rt,{size:14,className:"text-muted-foreground"}),e[10]=r,e[11]=J):J=e[11];let te;e[12]!==s||e[13]!==J?(te=n.jsx("button",{type:"button",onClick:s,className:"flex size-6 items-center justify-center hover:bg-accent transition-colors rounded-lg",children:J}),e[12]=s,e[13]=J,e[14]=te):te=e[14];let ae;e[15]!==X||e[16]!==te?(ae=n.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[X,te]}),e[15]=X,e[16]=te,e[17]=ae):ae=e[17];let ie;e[18]!==a?(ie=a("chat.contextPanel.emptyState"),e[18]=a,e[19]=ie):ie=e[19];let se;e[20]!==ie?(se=n.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:n.jsx("p",{className:"text-xs text-muted-foreground",children:ie})}),e[20]=ie,e[21]=se):se=e[21];let oe;return e[22]!==ae||e[23]!==se||e[24]!==D?(oe=n.jsxs("div",{className:D,children:[ae,se]}),e[22]=ae,e[23]=se,e[24]=D,e[25]=oe):oe=e[25],oe}let G;e[26]!==i?(G=ee("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",i),e[26]=i,e[27]=G):G=e[27];let z;e[28]!==a?(z=a("chat.contextPanel.title"),e[28]=a,e[29]=z):z=e[29];let H;e[30]!==z?(H=n.jsx("span",{className:"text-sm font-medium text-foreground",children:z}),e[30]=z,e[31]=H):H=e[31];let O;e[32]!==r?(O=r?n.jsx(at,{size:14}):n.jsx(rt,{size:14}),e[32]=r,e[33]=O):O=e[33];let V;e[34]!==s||e[35]!==O?(V=n.jsx("button",{type:"button",onClick:s,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:O}),e[34]=s,e[35]=O,e[36]=V):V=e[36];let Q;e[37]!==H||e[38]!==V?(Q=n.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[H,V]}),e[37]=H,e[38]=V,e[39]=Q):Q=e[39];let Y;e[40]!==a?(Y=a("chat.contextPanel.contextBreakdownSection"),e[40]=a,e[41]=Y):Y=e[41];let Z;e[42]!==Y?(Z=n.jsx("span",{className:"text-xs text-muted-foreground",children:Y}),e[42]=Y,e[43]=Z):Z=e[43];let q;e[44]!==T||e[45]!==_||e[46]!==p?(q=n.jsx(Hn,{userTokens:p,assistantTokens:T,otherTokens:_}),e[44]=T,e[45]=_,e[46]=p,e[47]=q):q=e[47];let le;return e[48]!==Z||e[49]!==q?(le=n.jsxs("div",{className:"flex flex-col gap-3",children:[Z,q]}),e[48]=Z,e[49]=q,e[50]=le):le=e[50],n.jsxs("div",{className:G,children:[Q,n.jsxs("div",{className:"flex flex-col gap-8 p-6",children:[E.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.subtasksSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:E.map(Qn)})]}),n.jsx(zn,{items:C}),le,$.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.rawMessagesSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:$.map(D=>{const re=D.metadata?.created_at,X=o?.id===D.id;return n.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>c(X?null:D),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:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:ee("shrink-0 font-medium",D.role==="user"?"text-chart-1":"text-chart-2"),children:D.role}),n.jsx("span",{className:"text-muted-foreground",children:"•"}),n.jsx("span",{className:"truncate text-muted-foreground font-mono",children:D.id})]}),re&&n.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:ze(re)})]}),X&&n.jsxs(n.Fragment,{children:[D.role==="assistant"&&(()=>{const J=D.metadata?._request;if(!J)return null;const te=J.systemSections??[],ae=Math.max(1,...te.map(Yn)),ie=te.reduce(Wn,0);return n.jsxs("div",{className:"border-t border-border/50 px-3 py-2.5 text-xs space-y-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"font-medium text-foreground",children:a("chat.contextPanel.requestLabel")}),n.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[J.activeTools??0," / ",J.tools??0," ",a("chat.contextPanel.toolsActive")]})]}),te.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"text-muted-foreground",children:[a("chat.contextPanel.systemPromptLabel")," ",n.jsxs("span",{className:"tabular-nums",children:["~",Math.round(ie/4).toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),te.map((se,oe)=>{const ce=se.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${oe}`,xe=se.chars/ae*100,de=Math.round(se.chars/4);return n.jsxs("div",{className:"space-y-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"font-mono text-foreground truncate",children:ce}),n.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["~",de.toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),n.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-chart-3",style:{width:`${xe}%`}})})]},oe)})]})]})})(),n.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(D,null,2)})]})]},D.id)})})]})]})]})}function Wn(t,e){return t+e.chars}function Yn(t){return t.chars}function Qn(t,e){return n.jsx(Vn,{part:t},e)}function Zn(t){return(t.parts??[]).filter(Xn)}function Xn(t){return t.type==="tool-subtask"}function Jn(t){return t.role!=="system"}function ea(t,e){const s=e.metadata?.usage;return t+(s?.outputTokens??0)}function ta(t){return t.role==="assistant"}function sa(t,e){const s=e.metadata?.usage;return t+(s?.inputTokens??0)}function na(t){return t.role==="user"}function aa(t){return t.role==="assistant"&&t.metadata?.models}function ra(t){return t.role==="assistant"&&t.metadata?.usage}function ia(t){const e=A.c(21),{onOpenContextPanel:s}=t,{org:r}=ne(),{selectedVirtualMcp:i}=jt();let a;e[0]!==r.id?(a=je(r.id),e[0]=r.id,e[1]=a):a=e[1];const c=i??a,l=Se(c.id)??c,d=l.title??"Super Agent",m=l.icon??null,f=l.description??null;let h;e[2]!==m||e[3]!==d?(h=n.jsx(ye,{icon:m,name:d,size:"lg"}),e[2]=m,e[3]=d,e[4]=h):h=e[4];let j;e[5]!==d?(j=n.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:d}),e[5]=d,e[6]=j):j=e[6];let k;e[7]!==f?(k=f?n.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance",children:f}):null,e[7]=f,e[8]=k):k=e[8];let v;e[9]!==j||e[10]!==k?(v=n.jsxs("div",{className:"space-y-1.5",children:[j,k]}),e[9]=j,e[10]=k,e[11]=v):v=e[11];let x;e[12]!==h||e[13]!==v?(x=n.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,v]}),e[12]=h,e[13]=v,e[14]=x):x=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(W.IceBreakers,{className:"pb-3"}),e[15]=g):g=e[15];let b;e[16]!==s?(b=n.jsxs(W.Footer,{children:[g,n.jsx(W.Input,{onOpenContextPanel:s})]}),e[16]=s,e[17]=b):b=e[17];let y;return e[18]!==x||e[19]!==b?(y=n.jsxs(n.Fragment,{children:[x,b]}),e[18]=x,e[19]=b,e[20]=y):y=e[20],y}function ot(t){const e=A.c(17),{outputs:s,collapsed:r,onToggle:i,variant:a}=t,o=a==="card"?"rounded-xl border border-border bg-muted/95 shadow-sm backdrop-blur-sm":"border-b border-border bg-background";let c;e[0]!==o?(c=ee(o),e[0]=o,e[1]=c):c=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Files in this task"}),e[2]=u):u=e[2];const l=r&&"-rotate-90";let d;e[3]!==l?(d=ee("size-4 text-muted-foreground transition-transform",l),e[3]=l,e[4]=d):d=e[4];let m;e[5]!==d?(m=n.jsx(Ye,{className:d}),e[5]=d,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==m?(f=n.jsxs("button",{type:"button",onClick:i,className:"flex w-full items-center justify-between px-3 py-2.5 text-left",children:[u,m]}),e[7]=i,e[8]=m,e[9]=f):f=e[9];let h;e[10]!==r||e[11]!==s?(h=!r&&n.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto px-2 pb-2",children:s.map(la)}),e[10]=r,e[11]=s,e[12]=h):h=e[12];let j;return e[13]!==c||e[14]!==f||e[15]!==h?(j=n.jsxs("div",{className:c,children:[f,h]}),e[13]=c,e[14]=f,e[15]=h,e[16]=j):j=e[16],j}function la(t){return n.jsx(Bs,{file:t},t.key)}function oa(){const t=A.c(13),e=$e()?.taskId??null,s=Ds();let r;t[0]!==s?(r={enabled:s},t[0]=s,t[1]=r):r=t[1];const{data:i}=zs(e,r),[a,o]=B.useState(!1),[c,u]=B.useState(!0);if(!e||!i||i.length===0)return null;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>o(da),t[2]=l):l=t[2];let d;t[3]!==a||t[4]!==i?(d=n.jsx("div",{className:"absolute top-2 right-2 z-10 hidden w-72 @[1280px]:block",children:n.jsx(ot,{variant:"card",outputs:i,collapsed:a,onToggle:l})}),t[3]=a,t[4]=i,t[5]=d):d=t[5];let m;t[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>u(ca),t[6]=m):m=t[6];let f;t[7]!==c||t[8]!==i?(f=n.jsx("div",{className:"shrink-0 @[1280px]:hidden",children:n.jsx(ot,{variant:"bar",outputs:i,collapsed:c,onToggle:m})}),t[7]=c,t[8]=i,t[9]=f):f=t[9];let h;return t[10]!==d||t[11]!==f?(h=n.jsxs(n.Fragment,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=h):h=t[12],h}function ca(t){return!t}function da(t){return!t}function ua(){const t=A.c(1);B.use(We().ready);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ws,{children:n.jsx(fa,{})}),t[0]=e):e=t[0],e}function fa(){const t=A.c(29),{active:e}=Cs(),{org:s}=ne(),r=$e(),{isChatEmpty:i}=We(),[a,o]=B.useState("chat"),c=Gs(),u=K(),l=Rn(),{runtime:d}=yt(r?.virtualMcpId);if(l!==null&&d!=="cms"){let T;return t[0]!==l||t[1]!==u?(T=n.jsx(W,{className:"animate-in fade-in-0 duration-200",children:n.jsx(W.Main,{className:"flex flex-col items-center",children:n.jsx(W.EmptyState,{children:l==="codex-provider"?n.jsx(W.NoAiProviderEmptyState,{title:u("settings.codexSubscription.setupHeading"),description:u("settings.codexSubscription.setupDescription"),providerFilter:vt}):l==="claude-code-provider"?n.jsx(W.NoAiProviderEmptyState,{title:u("chat.noAiProviderEmptyState.supportedHeading"),description:u("chat.noAiProviderEmptyState.supportedSubtitle"),providerFilter:kt}):n.jsx(W.NoAiProviderEmptyState,{})})})}),t[0]=l,t[1]=u,t[2]=T):T=t[2],T}let f;t[3]!==c.hasDecoKey||t[4]!==c.hasOnlyDecoProvider||t[5]!==c.isLoading||t[6]!==c.isZeroBalance||t[7]!==i||t[8]!==s?(f=c.hasDecoKey&&c.isZeroBalance&&c.hasOnlyDecoProvider&&!c.isLoading&&i&&!Ns(s.id),t[3]=c.hasDecoKey,t[4]=c.hasOnlyDecoProvider,t[5]=c.isLoading,t[6]=c.isZeroBalance,t[7]=i,t[8]=s,t[9]=f):f=t[9];const h=f;let j;t[10]!==h?(j=h&&n.jsx(W.CreditsEmptyState,{}),t[10]=h,t[11]=j):j=t[11];let k;t[12]!==a||t[13]!==i||t[14]!==d||t[15]!==e?(k=!e&&n.jsx("div",{inert:a!=="chat"?!0:void 0,"aria-hidden":a!=="chat",className:ee("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",a!=="chat"?"opacity-0 pointer-events-none":"opacity-100"),children:i&&d!=="cms"?n.jsx(ia,{onOpenContextPanel:()=>o("context")}):n.jsxs(n.Fragment,{children:[n.jsxs(W.Main,{className:"relative flex flex-col overflow-hidden @container",children:[n.jsx(oa,{}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(W.Messages,{})})]}),n.jsx(W.Footer,{children:n.jsx(W.Input,{onOpenContextPanel:()=>o("context")})})]})}),t[12]=a,t[13]=i,t[14]=d,t[15]=e,t[16]=k):k=t[16];let v;t[17]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ps,{}),t[17]=v):v=t[17];const x=a!=="context"?!0:void 0,g=a!=="context",b=a==="context"?"opacity-100":"opacity-0 pointer-events-none";let y;t[18]!==b?(y=ee("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",b),t[18]=b,t[19]=y):y=t[19];let p;t[20]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(qn,{back:!0,onClose:()=>o("chat")}),t[20]=p):p=t[20];let S;t[21]!==x||t[22]!==g||t[23]!==y?(S=n.jsx("div",{inert:x,"aria-hidden":g,className:y,children:p}),t[21]=x,t[22]=g,t[23]=y,t[24]=S):S=t[24];let N;return t[25]!==j||t[26]!==k||t[27]!==S?(N=n.jsxs(W,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[j,k,v,S]}),t[25]=j,t[26]=k,t[27]=S,t[28]=N):N=t[28],N}function ma(){const t=A.c(7),e=K();let s;t[0]!==e?(s=e("agentShellLayout.agentShellLayout.chatLoadingError"),t[0]=e,t[1]=s):s=t[1];let r;t[2]!==s?(r=n.jsx("div",{role:"alert",className:"flex h-full flex-1 items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=r):r=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Me,{children:n.jsx(ua,{})}),t[4]=i):i=t[4];let a;return t[5]!==r?(a=n.jsx(pt,{fallback:r,children:i}),t[5]=r,t[6]=a):a=t[6],a}function ha(t){const e=A.c(10),{org:s}=ne(),r=tn(),{data:i}=pe.useSession(),a=i?.user?.id,o=t?.id??null,c=!!t&&!!a&&!!t.created_by&&t.created_by!==a;let u;e[0]!==s.id||e[1]!==o?(u=fe.viewedThreadMetadataRefresh(s.id,o??""),e[0]=s.id,e[1]=o,e[2]=u):u=e[2];const l=!!r&&!!o&&c;let d;e[3]!==r||e[4]!==o?(d=async()=>(await r?.refreshThreadMetadata(o??""),!0),e[3]=r,e[4]=o,e[5]=d):d=e[5];let m;e[6]!==u||e[7]!==l||e[8]!==d?(m={queryKey:u,enabled:l,staleTime:Number.POSITIVE_INFINITY,queryFn:d},e[6]=u,e[7]=l,e[8]=d,e[9]=m):m=e[9],me(m)}function Ge(t){const e=A.c(14),{label:s,value:r,onChange:i,options:a}=t;let o;e[0]!==s?(o=n.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=e[1];let c;e[2]!==i?(c=m=>m&&i(m),e[2]=i,e[3]=c):c=e[3];let u;e[4]!==a?(u=a.map(pa),e[4]=a,e[5]=u):u=e[5];let l;e[6]!==s||e[7]!==c||e[8]!==u||e[9]!==r?(l=n.jsx(un,{type:"single",size:"sm",value:r,onValueChange:c,"aria-label":s,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:u}),e[6]=s,e[7]=c,e[8]=u,e[9]=r,e[10]=l):l=e[10];let d;return e[11]!==o||e[12]!==l?(d=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,l]}),e[11]=o,e[12]=l,e[13]=d):d=e[13],d}function pa(t){return n.jsxs(dn,{value:t.value,className:"h-6 gap-1.5 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 xa(t){const e=A.c(91),{panel:s,className:r}=t,i=r===void 0?"md:size-[34px]":r,a=K();let o;e[0]!==a?(o=a("sidebar.taskGroupsList.filterChats"),e[0]=a,e[1]=o):o=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(us,{size:16}),e[2]=c):c=e[2];let u;e[3]!==s.filtersActive?(u=s.filtersActive&&n.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"}),e[3]=s.filtersActive,e[4]=u):u=e[4];let l;e[5]!==i||e[6]!==s.filtersActive||e[7]!==o||e[8]!==u?(l=n.jsx(Fe,{asChild:!0,children:n.jsx(At,{asChild:!0,children:n.jsxs(we,{"aria-label":o,active:s.filtersActive,className:i,children:[c,u]})})}),e[5]=i,e[6]=s.filtersActive,e[7]=o,e[8]=u,e[9]=l):l=e[9];let d;e[10]!==a?(d=a("sidebar.taskGroupsList.filterChats"),e[10]=a,e[11]=d):d=e[11];let m;e[12]!==d?(m=n.jsx(Re,{side:"bottom",children:d}),e[12]=d,e[13]=m):m=e[13];let f;e[14]!==l||e[15]!==m?(f=n.jsxs(Oe,{children:[l,m]}),e[14]=l,e[15]=m,e[16]=f):f=e[16];let h;e[17]!==a?(h=a("sidebar.taskGroupsList.filterView"),e[17]=a,e[18]=h):h=e[18];const j=s.groupBy;let k;e[19]!==s?(k=D=>{he("tasks_panel_group_by_changed",{to_value:D}),s.setGroupBy(D)},e[19]=s,e[20]=k):k=e[20];let v;e[21]!==a?(v=a("sidebar.taskGroupsList.viewList"),e[21]=a,e[22]=v):v=e[22];let x;e[23]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(fs,{size:13}),e[23]=x):x=e[23];let g;e[24]!==v?(g={value:"flat",label:v,icon:x},e[24]=v,e[25]=g):g=e[25];let b;e[26]!==a?(b=a("sidebar.taskGroupsList.viewStatus"),e[26]=a,e[27]=b):b=e[27];let y;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ms,{size:13}),e[28]=y):y=e[28];let p;e[29]!==b?(p={value:"status",label:b,icon:y},e[29]=b,e[30]=p):p=e[30];let S;e[31]!==g||e[32]!==p?(S=[g,p],e[31]=g,e[32]=p,e[33]=S):S=e[33];let N;e[34]!==s.groupBy||e[35]!==k||e[36]!==S||e[37]!==h?(N=n.jsx(Ge,{label:h,value:j,onChange:k,options:S}),e[34]=s.groupBy,e[35]=k,e[36]=S,e[37]=h,e[38]=N):N=e[38];let T;e[39]!==a?(T=a("sidebar.taskGroupsList.filterType"),e[39]=a,e[40]=T):T=e[40];const _=s.typeFilter;let w;e[41]!==s?(w=D=>{he("tasks_panel_filter_changed",{to_value:D}),s.setTypeFilter(D)},e[41]=s,e[42]=w):w=e[42];let I;e[43]!==a?(I=a("sidebar.taskGroupsList.typeAll"),e[43]=a,e[44]=I):I=e[44];let P;e[45]!==I?(P={value:"all",label:I},e[45]=I,e[46]=P):P=e[46];let L;e[47]!==a?(L=a("sidebar.taskGroupsList.typeChats"),e[47]=a,e[48]=L):L=e[48];let $;e[49]!==L?($={value:"manual",label:L},e[49]=L,e[50]=$):$=e[50];let E;e[51]!==a?(E=a("sidebar.taskGroupsList.typeAuto"),e[51]=a,e[52]=E):E=e[52];let F;e[53]!==E?(F={value:"automation",label:E},e[53]=E,e[54]=F):F=e[54];let R;e[55]!==P||e[56]!==$||e[57]!==F?(R=[P,$,F],e[55]=P,e[56]=$,e[57]=F,e[58]=R):R=e[58];let M;e[59]!==s.typeFilter||e[60]!==T||e[61]!==w||e[62]!==R?(M=n.jsx(Ge,{label:T,value:_,onChange:w,options:R}),e[59]=s.typeFilter,e[60]=T,e[61]=w,e[62]=R,e[63]=M):M=e[63];let C;e[64]!==a?(C=a("sidebar.taskGroupsList.filterScope"),e[64]=a,e[65]=C):C=e[65];const G=s.showAll?"team":"mine";let z;e[66]!==s?(z=D=>s.setShowAll(D==="team"),e[66]=s,e[67]=z):z=e[67];let H;e[68]!==a?(H=a("sidebar.taskGroupsList.scopeMine"),e[68]=a,e[69]=H):H=e[69];let O;e[70]!==H?(O={value:"mine",label:H},e[70]=H,e[71]=O):O=e[71];let V;e[72]!==a?(V=a("sidebar.taskGroupsList.scopeTeam"),e[72]=a,e[73]=V):V=e[73];let Q;e[74]!==V?(Q={value:"team",label:V},e[74]=V,e[75]=Q):Q=e[75];let Y;e[76]!==O||e[77]!==Q?(Y=[O,Q],e[76]=O,e[77]=Q,e[78]=Y):Y=e[78];let Z;e[79]!==C||e[80]!==G||e[81]!==z||e[82]!==Y?(Z=n.jsx(Ge,{label:C,value:G,onChange:z,options:Y}),e[79]=C,e[80]=G,e[81]=z,e[82]=Y,e[83]=Z):Z=e[83];let q;e[84]!==N||e[85]!==M||e[86]!==Z?(q=n.jsxs(Lt,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[N,M,Z]}),e[84]=N,e[85]=M,e[86]=Z,e[87]=q):q=e[87];let le;return e[88]!==q||e[89]!==f?(le=n.jsxs($t,{children:[f,q]}),e[88]=q,e[89]=f,e[90]=le):le=e[90],le}function ga(t,e){return t.filter(s=>s.id===e||!!s.trigger_id||qs(s))}function ba(){const t=A.c(2),e=Tt()??[];let s;return t[0]!==e?(s=r=>{if(!r)return;const i=e.find(a=>a.id===r);return i?Pt(i.metadata):void 0},t[0]=e,t[1]=s):s=t[1],s}function va(t){const e=A.c(9),{virtualMcpId:s,size:r,showAutomationBadge:i}=t,a=r===void 0?"sm":r,o=K();let c;e[0]!==a||e[1]!==s?(c=s?n.jsx(ya,{virtualMcpId:s,size:a}):n.jsx(ye,{icon:null,name:"?",size:a}),e[0]=a,e[1]=s,e[2]=c):c=e[2];let u;e[3]!==i||e[4]!==o?(u=i&&n.jsx("span",{"aria-label":o("tasksPanel.mcpAvatar.automationTriggered"),className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-special border border-special text-special-foreground",children:n.jsx(Rt,{size:10,className:"text-white"})}),e[3]=i,e[4]=o,e[5]=u):u=e[5];let l;return e[6]!==c||e[7]!==u?(l=n.jsxs("div",{className:"relative shrink-0",children:[c,u]}),e[6]=c,e[7]=u,e[8]=l):l=e[8],l}function ya(t){const e=A.c(6),{virtualMcpId:s,size:r}=t,i=Nt(s);if(!i){let c;return e[0]!==r?(c=n.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=c):c=e[1],c}const a=i.icon??null;let o;return e[2]!==i.title||e[3]!==r||e[4]!==a?(o=n.jsx(ye,{icon:a,name:i.title,size:r}),e[2]=i.title,e[3]=r,e[4]=a,e[5]=o):o=e[5],o}const ct=["thread"];function ja(t){const e=A.c(53),{open:s,onOpenChange:r}=t,[i,a]=B.useState(""),{org:o}=ne(),{setTaskId:c}=Qe(),u=Ie(),l=K();let d,m,f,h;e[0]!==o.id||e[1]!==i?(h=i.trim(),d=h?20:10,f=me,m=fe.globalSearch(o.id,h,d,ct),e[0]=o.id,e[1]=i,e[2]=d,e[3]=m,e[4]=f,e[5]=h):(d=e[2],m=e[3],f=e[4],h=e[5]);let j;e[6]!==d||e[7]!==u||e[8]!==h?(j=async()=>{const C=await u.call("GLOBAL_SEARCH",{query:h,limit:d,types:[...ct]});return{...C,items:C.items.filter(ka)}},e[6]=d,e[7]=u,e[8]=h,e[9]=j):j=e[9];let k;e[10]!==s||e[11]!==m||e[12]!==j?(k={queryKey:m,enabled:s,queryFn:j,staleTime:1e4},e[10]=s,e[11]=m,e[12]=j,e[13]=k):k=e[13];const{data:v,isFetching:x}=f(k);let g;e[14]!==v?.items?(g=v?.items??[],e[14]=v?.items,e[15]=g):g=e[15];const b=g;let y;e[16]!==r?(y=C=>{C||a(""),r(C)},e[16]=r,e[17]=y):y=e[17];const p=y;let S;e[18]!==p||e[19]!==c?(S=C=>{p(!1),c(C.id,C.virtual_mcp_id??void 0)},e[18]=p,e[19]=c,e[20]=S):S=e[20];const N=S;let T;e[21]!==l?(T=l("tasksPanel.globalSearchDialog.title"),e[21]=l,e[22]=T):T=e[22];let _;e[23]!==T?(_=n.jsx(qt,{children:T}),e[23]=T,e[24]=_):_=e[24];let w;e[25]!==l?(w=l("tasksPanel.globalSearchDialog.description"),e[25]=l,e[26]=w):w=e[26];let I;e[27]!==w?(I=n.jsx(Wt,{children:w}),e[27]=w,e[28]=I):I=e[28];let P;e[29]!==I||e[30]!==_?(P=n.jsxs(Yt,{className:"sr-only",children:[_,I]}),e[29]=I,e[30]=_,e[31]=P):P=e[31];let L;e[32]!==l?(L=l("tasksPanel.globalSearchDialog.placeholder"),e[32]=l,e[33]=L):L=e[33];let $;e[34]!==i||e[35]!==L?($=n.jsx(vn,{value:i,onValueChange:a,placeholder:L}),e[34]=i,e[35]=L,e[36]=$):$=e[36];let E;e[37]!==N||e[38]!==x||e[39]!==b||e[40]!==l||e[41]!==h?(E=n.jsx(pn,{children:x&&b.length===0?n.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l("tasksPanel.globalSearchDialog.searching")}):b.length===0?n.jsx(xn,{children:l("tasksPanel.globalSearchDialog.noResults")}):n.jsx(gn,{heading:h?void 0:l("tasksPanel.globalSearchDialog.recent"),children:b.map(C=>C.type==="thread"?n.jsxs(bn,{value:`thread:${C.id}:${C.title}`,onSelect:()=>N(C),className:"gap-2.5",children:[n.jsx(va,{virtualMcpId:C.virtual_mcp_id,size:"xs"}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("div",{className:"text-sm text-foreground truncate",children:C.title||l("tasksPanel.globalSearchDialog.untitledChat")})}),n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(C.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${C.id}`):null)})}),e[37]=N,e[38]=x,e[39]=b,e[40]=l,e[41]=h,e[42]=E):E=e[42];let F;e[43]!==$||e[44]!==E?(F=n.jsxs(yn,{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:[$,E]}),e[43]=$,e[44]=E,e[45]=F):F=e[45];let R;e[46]!==P||e[47]!==F?(R=n.jsxs(Qt,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[P,F]}),e[46]=P,e[47]=F,e[48]=R):R=e[48];let M;return e[49]!==p||e[50]!==s||e[51]!==R?(M=n.jsx(Zt,{open:s,onOpenChange:p,children:R}),e[49]=p,e[50]=s,e[51]=R,e[52]=M):M=e[52],M}function ka(t){return t.type==="thread"}function Sa(t,e,s){if(!s)return;const r=t.findIndex(i=>i.id===e);if(r!==-1){for(let i=r+1;i<t.length;i++){const a=t[i];if(a?.created_by===s)return a}for(let i=r-1;i>=0;i--){const a=t[i];if(a?.created_by===s)return a}}}function Ta(t){return t==="ephemeral"||t.startsWith("thread:")}function zt(t){const e=A.c(45),{task:s,isActive:r,onClick:i,onArchive:a,showAutomationBadge:o,showAgentIcon:c,hideStatusIdle:u,indented:l}=t,d=K(),m=jn(s.status),f=m.icon,h=s.metadata?.kind==="tool_call_run",j=Nt(h?void 0:s.virtual_mcp_id);let k;e[0]!==j?(k=_t(j),e[0]=j,e[1]=k):k=e[1];const v=k;Tn(6e4);const x=o||!!s.trigger_id,g=s.id,b="button",y=0;let p;e[2]!==i?(p=z=>{z.target===z.currentTarget&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),i())},e[2]=i,e[3]=p):p=e[3];const S=l?"-ml-4 pl-6":"pl-[9px]",N=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let T;e[4]!==S||e[5]!==N?(T=ee("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",S,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=S,e[5]=N,e[6]=T):T=e[6];let _;e[7]!==h||e[8]!==c||e[9]!==j?.icon||e[10]!==j?.title?(_=c&&!h&&n.jsx(ye,{icon:j?.icon??null,name:j?.title??"?",size:"2xs"}),e[7]=h,e[8]=c,e[9]=j?.icon,e[10]=j?.title,e[11]=_):_=e[11];let w;e[12]!==x||e[13]!==d?(w=x&&n.jsx(Rt,{size:12,"aria-label":d("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-special"}),e[12]=x,e[13]=d,e[14]=w):w=e[14];let I;e[15]!==d||e[16]!==s.title?(I=s.title||d("tasksPanel.taskRow.untitledTask"),e[15]=d,e[16]=s.title,e[17]=I):I=e[17];let P;e[18]!==I?(P=n.jsx("div",{className:"text-sm text-foreground truncate",children:I}),e[18]=I,e[19]=P):P=e[19];let L;e[20]!==w||e[21]!==P?(L=n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[w,P]}),e[20]=w,e[21]=P,e[22]=L):L=e[22];let $;e[23]!==r||e[24]!==v||e[25]!==s.branch||e[26]!==s.updated_at?($=s.updated_at&&n.jsxs("div",{className:ee("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[s.branch&&!Ta(s.branch)?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate font-mono",children:s.branch}),n.jsx("span",{className:"shrink-0",children:"·"})]}):v?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"truncate",children:[v.owner,"/",v.name]}),n.jsx("span",{className:"shrink-0",children:"·"})]}):null,n.jsx("span",{className:"shrink-0",children:Sn(new Date(s.updated_at))})]}),e[23]=r,e[24]=v,e[25]=s.branch,e[26]=s.updated_at,e[27]=$):$=e[27];let E;e[28]!==L||e[29]!==$?(E=n.jsxs("div",{className:"flex-1 min-w-0",children:[L,$]}),e[28]=L,e[29]=$,e[30]=E):E=e[30];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",R=!u&&n.jsx("span",{className:ee("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",a&&"group-hover/row:opacity-0"),"aria-label":d("tasksPanel.taskRow.statusLabel",{status:d(m.labelKey)}),children:s.status==="in_progress"?n.jsx(ve,{className:ee("size-3.5",m.iconClassName)}):n.jsx(f,{size:14,className:m.iconClassName})});let M;e[31]!==a||e[32]!==d?(M=a&&n.jsxs(Oe,{children:[n.jsx(Fe,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":d("tasksPanel.taskRow.archiveTask"),onClick:z=>{z.stopPropagation(),a()},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 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:n.jsx(Xt,{size:14})})}),n.jsx(Re,{side:"right",children:d("tasksPanel.taskRow.archive")})]}),e[31]=a,e[32]=d,e[33]=M):M=e[33];let C;e[34]!==R||e[35]!==M?(C=n.jsxs("div",{className:F,children:[R,M]}),e[34]=R,e[35]=M,e[36]=C):C=e[36];let G;return e[37]!==i||e[38]!==E||e[39]!==C||e[40]!==p||e[41]!==T||e[42]!==_||e[43]!==s.id?(G=n.jsxs("div",{"data-task-id":g,role:b,tabIndex:y,onClick:i,onKeyDown:p,className:T,children:[_,E,C]}),e[37]=i,e[38]=E,e[39]=C,e[40]=p,e[41]=T,e[42]=_,e[43]=s.id,e[44]=G):G=e[44],G}const dt=["requires_action","in_progress","failed","expired","completed"];function Na(t){const e=new Map(dt.map(s=>[s,[]]));for(const s of t){const r=s.status??"completed";(e.get(r)??e.get("completed")).push(s)}return dt.map(s=>({status:s,threads:e.get(s)}))}const _a="sidebar.group.expanded.";function wa(t,e){const s=A.c(3),[r,i]=xt(`${_a}${t}`,e);let a;return s[0]!==r||s[1]!==i?(a=[r,i],s[0]=r,s[1]=i,s[2]=a):a=s[2],a}function Gt(t){const e=A.c(18),{onClick:s,isFetching:r,indented:i}=t,a=K();let o;e[0]!==a?(o=a("sidebar.showMoreButton.ariaLabel"),e[0]=a,e[1]=o):o=e[1];const c=i?"-ml-4 pl-6 pr-2":"px-2";let u;e[2]!==c?(u=ee("flex items-center gap-2 py-1.5 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 l;e[4]!==r?(l=r&&n.jsx(ve,{className:"size-3.5"}),e[4]=r,e[5]=l):l=e[5];let d;e[6]!==r||e[7]!==a?(d=a(r?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=r,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==d?(m=n.jsx("span",{children:d}),e[9]=d,e[10]=m):m=e[10];let f;return e[11]!==r||e[12]!==s||e[13]!==o||e[14]!==u||e[15]!==l||e[16]!==m?(f=n.jsxs("button",{type:"button","aria-label":o,onClick:s,disabled:r,className:u,children:[l,m]}),e[11]=r,e[12]=s,e[13]=o,e[14]=u,e[15]=l,e[16]=m,e[17]=f):f=e[17],f}function Ca(t,e,s,r){return[t,e,s,r.type,r.member,r.currentUserId??""].join("|")}function Pa(t){return t.member==="mine"&&!t.currentUserId}const Ht=4;let _e=0;const Ke=[];function Ia(){for(;_e<Ht&&Ke.length>0;){const t=Ke.shift();t&&t()}}function Ut(t){return new Promise((e,s)=>{const r=()=>{_e++,t().then(e,s).finally(()=>{_e--,Ia()})};_e<Ht?r():Ke.push(r)})}const Be=10;function ut(t,e,s,r,i){const a={hidden:!1};r.member==="mine"&&r.currentUserId&&(a.created_by=r.currentUserId),r.type==="automation"&&(a.has_trigger=!0),r.type==="manual"&&(a.has_trigger=!1);const o={where:a,limit:i,offset:s,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function Ma(t,e,s,r){let i=0;for(const a of t)Kt(a,e,s,r)&&i++;return i}function He(t,e,s,r){return Ma(t,e,s,r)}function Aa(t,e){return!!(t>=Be||t===0&&e)}function ft(t,e){return t<e}function La(t,e){return e===!1?!1:e===!0?!0:t}function Kt(t,e,s,r){return!(t.hidden||(t.status??"completed")!==s||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Pe=new Map,Ne=new Map;function $a(t,e){return e?t>=Be?!0:null:!1}function mt(t){return Pe.get(t)}function Ea(t,e){Pe.set(t,e)}function Fa(t,e,s){const r=Pe.get(t);if(r!==void 0){s(r);return}let i=Ne.get(t);i||(i=Ut(e).then(a=>(Pe.set(t,a),Ne.delete(t),a)).catch(()=>(Ne.delete(t),Promise.reject(new Error("group probe failed")))),Ne.set(t,i)),i.then(s,()=>s(!1))}function ht(t){const e=t,s=Array.isArray(e.items)?e.items:[];return{items:s,hasMore:e.hasMore??s.length===Be,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Ra(t,e,s,r,i){let a=0;for(const o of t)e.has(o.id)||Kt(o,s,r,i)&&a++;return a}function Oa(t,e,s,r){const i=A.c(8),{org:a}=ne(),o=Ca(a.id,t,e,s);let c;i[0]!==s?(c=Pa(s),i[0]=s,i[1]=c):c=i[1];const u=c,[l,d]=B.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});l.identity!==o&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const m=Ze(),{threads:f,hasMore:h}=Xe(),j=He(f,t,e,s),k=Aa(j,h),v=$a(j,h),x=Ie();if(l.identity===o&&l.serverHasMore===null){const N=v??mt(o);N!==void 0&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:l.probeSubscribedIdentity,serverHasMore:N})}!u&&l.identity===o&&l.serverHasMore===null&&v===null&&mt(o)===void 0&&l.probeSubscribedIdentity!==o&&(d(N=>N.identity===o?{...N,isProbing:!0,probeSubscribedIdentity:o}:N),Fa(o,async()=>{const N=ut(t,e,0,s,1),T=await x.call("COLLECTION_THREADS_LIST",N),{totalCount:_}=ht(T),w=He(m.threads.get(),t,e,s);return _===void 0?!1:ft(w,_)},N=>{d(T=>T.identity!==o?T:{...T,isProbing:!1,serverHasMore:N})}));const b=async function(){if(l.isFetching||l.isProbing||u)return;const T=o;d(_=>_.identity===T?{..._,isFetching:!0}:_);try{const _=He(f,t,e,s),w=ut(t,e,_,s,Be),I=await Ut(()=>x.call("COLLECTION_THREADS_LIST",w)),{items:P,hasMore:L,totalCount:$}=ht(I),E=new Set(f.map(Ba)),F=Ra(P,E,t,e,s),R=_;m.mergeThreads(P),d(M=>{if(M.identity!==T)return M;let C;return $!==void 0?C=ft(R+F,$):C=P.length===0||F===0?!1:L,Ea(T,C),{...M,isFetching:!1,serverHasMore:C}})}catch(_){const w=_,I=w instanceof Error?w.message:String(w);Jt.error(`Could not load more tasks: ${I}`),d(P=>P.identity===T?{...P,isFetching:!1}:P)}},y=l.isFetching||l.isProbing,p=!u&&!y&&La(k,l.serverHasMore);let S;return i[2]!==y||i[3]!==b||i[4]!==p||i[5]!==l.isProbing||i[6]!==l.serverHasMore?(S={hasMore:p,isFetching:y,isProbing:l.isProbing,serverHasMore:l.serverHasMore,loadMore:b},i[2]=y,i[3]=b,i[4]=p,i[5]=l.isProbing,i[6]=l.serverHasMore,i[7]=S):S=i[7],S}function Ba(t){return t.id}function Da(t){const e=A.c(20),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,{isFetching:l,isProbing:d,loadMore:m,hasMore:f,serverHasMore:h}=Oa("status",s,u),[j,k]=B.useState(!1);!j&&r.length===0&&h===!0&&!l&&!d&&(k(!0),queueMicrotask(()=>{m()}));let v;if(e[0]!==i||e[1]!==c||e[2]!==u||e[3]!==o||e[4]!==a||e[5]!==r){let b;e[7]!==i||e[8]!==c||e[9]!==u||e[10]!==o||e[11]!==a?(b=y=>n.jsx(zt,{task:y,isActive:i===y.id,onClick:()=>a(y),onArchive:c&&y.created_by===u.currentUserId?()=>o(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]=o,e[11]=a,e[12]=b):b=e[12],v=r.map(b),e[0]=i,e[1]=c,e[2]=u,e[3]=o,e[4]=a,e[5]=r,e[6]=v}else v=e[6];let x;e[13]!==f||e[14]!==l||e[15]!==m?(x=(f||l)&&n.jsx(Gt,{onClick:()=>{m()},isFetching:l,indented:!0}),e[13]=f,e[14]=l,e[15]=m,e[16]=x):x=e[16];let g;return e[17]!==v||e[18]!==x?(g=n.jsxs(n.Fragment,{children:[v,x]}),e[17]=v,e[18]=x,e[19]=g):g=e[19],g}function za(t){const e=A.c(43),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,l=K(),d=kn[s],m=d.icon,[f,h]=wa(`status-${s}`,!1);let j;e[0]!==f||e[1]!==h?(j=function(){h(!f)},e[0]=f,e[1]=h,e[2]=j):j=e[2];const k=j;let v;e[3]!==d.labelKey||e[4]!==l?(v=l("sidebar.taskGroupsList.toggleStatusGroup",{status:l(d.labelKey)}),e[3]=d.labelKey,e[4]=l,e[5]=v):v=e[5];let x;e[6]!==k?(x=I=>{I.target===I.currentTarget&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),k())},e[6]=k,e[7]=x):x=e[7];let g;e[8]!==m||e[9]!==d.iconClassName?(g=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:n.jsx(m,{size:12,className:d.iconClassName})}),e[8]=m,e[9]=d.iconClassName,e[10]=g):g=e[10];let b;e[11]!==f?(b=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:f?n.jsx(Ye,{size:14}):n.jsx(es,{size:14})}),e[11]=f,e[12]=b):b=e[12];let y;e[13]!==g||e[14]!==b?(y=n.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[g,b]}),e[13]=g,e[14]=b,e[15]=y):y=e[15];let p;e[16]!==d.labelKey||e[17]!==l?(p=l(d.labelKey),e[16]=d.labelKey,e[17]=l,e[18]=p):p=e[18];let S;e[19]!==p?(S=n.jsx("span",{className:"flex-1 truncate",children:p}),e[19]=p,e[20]=S):S=e[20];let N;e[21]!==r.length?(N=n.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:n.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[21]=r.length,e[22]=N):N=e[22];let T;e[23]!==f||e[24]!==k||e[25]!==v||e[26]!==x||e[27]!==y||e[28]!==S||e[29]!==N?(T=n.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":f,"aria-label":v,onClick:k,onKeyDown:x,className:"group/group flex items-center gap-2 px-2 py-1.5 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:[y,S,N]}),e[23]=f,e[24]=k,e[25]=v,e[26]=x,e[27]=y,e[28]=S,e[29]=N,e[30]=T):T=e[30];let _;e[31]!==i||e[32]!==c||e[33]!==f||e[34]!==u||e[35]!==o||e[36]!==a||e[37]!==s||e[38]!==r?(_=f&&n.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:n.jsx(Da,{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u})}),e[31]=i,e[32]=c,e[33]=f,e[34]=u,e[35]=o,e[36]=a,e[37]=s,e[38]=r,e[39]=_):_=e[39];let w;return e[40]!==T||e[41]!==_?(w=n.jsxs("div",{className:"flex flex-col gap-0.5",children:[T,_]}),e[40]=T,e[41]=_,e[42]=w):w=e[42],w}function Ga(t){const e=A.c(41),{threads:s,groupBy:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,filters:c,hasMore:u,isFetchingMore:l,onLoadMore:d,filtersActive:m}=t,f=K();if(s.length===0&&!u&&!l){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(hs,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];let g;e[1]!==m||e[2]!==f?(g=f(m?"sidebar.myThreadsSection.noChatsMatchFilters":"sidebar.myThreadsSection.noChatsYet"),e[1]=m,e[2]=f,e[3]=g):g=e[3];let b;return e[4]!==g?(b=n.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,n.jsx("p",{className:"text-sm",children:g})]}),e[4]=g,e[5]=b):b=e[5],b}const h=s.length>1||u;if(r==="status"){let x;if(e[6]!==i||e[7]!==h||e[8]!==c||e[9]!==o||e[10]!==a||e[11]!==s){let b;e[13]!==i||e[14]!==h||e[15]!==c||e[16]!==o||e[17]!==a?(b=y=>n.jsx(za,{status:y.status,threads:y.threads,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:h,filters:c},y.status),e[13]=i,e[14]=h,e[15]=c,e[16]=o,e[17]=a,e[18]=b):b=e[18],x=Na(s).map(b),e[6]=i,e[7]=h,e[8]=c,e[9]=o,e[10]=a,e[11]=s,e[12]=x}else x=e[12];let g;return e[19]!==x?(g=n.jsx(n.Fragment,{children:x}),e[19]=x,e[20]=g):g=e[20],g}let j;if(e[21]!==i||e[22]!==h||e[23]!==c||e[24]!==o||e[25]!==a||e[26]!==s){let x;e[28]!==i||e[29]!==h||e[30]!==c||e[31]!==o||e[32]!==a?(x=g=>n.jsx(zt,{task:g,isActive:i===g.id,onClick:()=>a(g),onArchive:h&&g.created_by===c.currentUserId?()=>o(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[28]=i,e[29]=h,e[30]=c,e[31]=o,e[32]=a,e[33]=x):x=e[33],j=s.map(x),e[21]=i,e[22]=h,e[23]=c,e[24]=o,e[25]=a,e[26]=s,e[27]=j}else j=e[27];let k;e[34]!==u||e[35]!==l||e[36]!==d?(k=(u||l)&&n.jsx(Gt,{onClick:d,isFetching:l}),e[34]=u,e[35]=l,e[36]=d,e[37]=k):k=e[37];let v;return e[38]!==j||e[39]!==k?(v=n.jsxs(n.Fragment,{children:[j,k]}),e[38]=j,e[39]=k,e[40]=v):v=e[40],v}function Ha(t){const e=A.c(11),{panel:s}=t;let r;return e[0]!==s.activeTaskId||e[1]!==s.archiveTask||e[2]!==s.filters||e[3]!==s.filtersActive||e[4]!==s.groupBy||e[5]!==s.hasMore||e[6]!==s.isFetchingMore||e[7]!==s.loadMore||e[8]!==s.selectTask||e[9]!==s.threads?(r=n.jsx(Ga,{threads:s.threads,groupBy:s.groupBy,activeTaskId:s.activeTaskId,onSelectTask:s.selectTask,onArchiveTask:s.archiveTask,filters:s.filters,hasMore:s.hasMore,isFetchingMore:s.isFetchingMore,onLoadMore:s.loadMore,filtersActive:s.filtersActive}),e[0]=s.activeTaskId,e[1]=s.archiveTask,e[2]=s.filters,e[3]=s.filtersActive,e[4]=s.groupBy,e[5]=s.hasMore,e[6]=s.isFetchingMore,e[7]=s.loadMore,e[8]=s.selectTask,e[9]=s.threads,e[10]=r):r=e[10],r}function Ua(t){const e=A.c(67);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{onNavigate:r}=s,{data:i}=pe.useSession(),a=i?.user?.id,{org:o}=ne();let c;e[2]!==o.id?(c=je(o.id),e[2]=o.id,e[3]=c):c=e[3];const u=c.id,l=ba(),d=St(),{threads:m,hasMore:f,isFetchingMore:h,fetchNextPage:j}=Xe(),k=m.filter(Wa),{hide:v,setScope:x}=Je(),g=Ae(),{setTaskId:b,createNewTask:y}=Qe(),p=Et(),S=et();let N;e[4]!==S||e[5]!==m||e[6]!==p?(N=fn({routeAgentId:p,threadVirtualMcpId:m.find(U=>U.id===S)?.virtual_mcp_id}),e[4]=S,e[5]=m,e[6]=p,e[7]=N):N=e[7];const T=N;let _;e[8]!==r?(_=()=>{r?.()},e[8]=r,e[9]=_):_=e[9];const w=_,I=[...k].sort(qa),[P,L]=B.useState("all"),[$,E]=B.useState("flat"),[F,R]=xt("sidebar-threads-scope-all",!1),[M,C]=B.useState(!1),[G,z]=B.useState(!1);let H;e[10]!==C?(H=()=>{he("tasks_panel_search_opened"),z(!0),C(!0)},e[10]=C,e[11]=H):H=e[11];const O=H,V=a??null;let Q;e[12]!==V||e[13]!==P?(Q={type:P,member:"mine",currentUserId:V},e[12]=V,e[13]=P,e[14]=Q):Q=e[14];const Y=Q,Z={};F||(Z.created_by="me"),x(Z);let q;e[15]!==a?(q=U=>a?U.filter(ue=>ue.created_by===a):[],e[15]=a,e[16]=q):q=e[16];const le=q;let D;e[17]!==P?(D=U=>P==="automation"?U.filter(Va):P==="manual"?U.filter(Ka):U,e[17]=P,e[18]=D):D=e[18];const re=D,X=ga(re(F?I:le(I)),S);let J;e[19]!==S||e[20]!==w||e[21]!==a||e[22]!==v||e[23]!==g||e[24]!==o.slug||e[25]!==b||e[26]!==X?(J=U=>{if(a&&U.created_by&&U.created_by!==a)return;const ue=U.id===S;if(v(U.id),Hs(U.id),!ue)return;const ge=Sa(X,U.id,a);w(),ge?b(ge.id,ge.virtual_mcp_id):g({to:"/$org",params:{org:o.slug}})},e[19]=S,e[20]=w,e[21]=a,e[22]=v,e[23]=g,e[24]=o.slug,e[25]=b,e[26]=X,e[27]=J):J=e[27];const te=J;let ae;e[28]!==w||e[29]!==b?(ae=U=>{w(),b(U.id,U.virtual_mcp_id)},e[28]=w,e[29]=b,e[30]=ae):ae=e[30];const ie=ae;let se;e[31]!==T||e[32]!==S||e[33]!==m||e[34]!==w||e[35]!==y||e[36]!==a||e[37]!==u||e[38]!==l||e[39]!==d||e[40]!==b?(se=()=>{const U=T??u;he("sidebar_new_thread_clicked",{virtual_mcp_id:U}),w();const ue=nn(m,U,a,l(U));if(ue){b(ue.id,ue.virtual_mcp_id);return}const ge=d?null:m.find(Vt=>Vt.id===S)?.branch??null;y(U,ge)},e[31]=T,e[32]=S,e[33]=m,e[34]=w,e[35]=y,e[36]=a,e[37]=u,e[38]=l,e[39]=d,e[40]=b,e[41]=se):se=e[41];const oe=se;let ce;e[42]!==j?(ce=()=>{j()},e[42]=j,e[43]=ce):ce=e[43];const xe=$!=="flat"||P!=="all"||F;let de;e[44]!==G||e[45]!==M||e[46]!==C?(de=G?n.jsx(ja,{open:M,onOpenChange:C}):null,e[44]=G,e[45]=M,e[46]=C,e[47]=de):de=e[47];let Te;return e[48]!==S||e[49]!==te||e[50]!==Y||e[51]!==$||e[52]!==f||e[53]!==h||e[54]!==oe||e[55]!==O||e[56]!==ie||e[57]!==E||e[58]!==R||e[59]!==L||e[60]!==F||e[61]!==ce||e[62]!==xe||e[63]!==de||e[64]!==P||e[65]!==X?(Te={threads:X,activeTaskId:S,filters:Y,hasMore:f,isFetchingMore:h,loadMore:ce,groupBy:$,setGroupBy:E,typeFilter:P,setTypeFilter:L,showAll:F,setShowAll:R,filtersActive:xe,selectTask:ie,archiveTask:te,newThread:oe,openSearch:O,searchDialog:de},e[48]=S,e[49]=te,e[50]=Y,e[51]=$,e[52]=f,e[53]=h,e[54]=oe,e[55]=O,e[56]=ie,e[57]=E,e[58]=R,e[59]=L,e[60]=F,e[61]=ce,e[62]=xe,e[63]=de,e[64]=P,e[65]=X,e[66]=Te):Te=e[66],Te}function Ka(t){return!t.trigger_id}function Va(t){return!!t.trigger_id}function qa(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Wa(t){return!t.hidden}function Ya(){const t=A.c(59),e=K(),[s,r]=B.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={onNavigate:()=>r(!1)},t[0]=i):i=t[0];const a=Ua(i),o=$e()?.activeTask;let c;t[1]!==o?.title||t[2]!==a.activeTaskId||t[3]!==a.threads||t[4]!==e?(c=o?.title||a.threads.find(M=>M.id===a.activeTaskId)?.title||e("tasksPanel.taskRow.untitledTask"),t[1]=o?.title,t[2]=a.activeTaskId,t[3]=a.threads,t[4]=e,t[5]=c):c=t[5];const u=c;let l;t[6]!==a?(l=()=>{r(!1),a.openSearch()},t[6]=a,t[7]=l):l=t[7];const d=l;let m;t[8]!==e?(m=e("chat.threadsMenu.chats"),t[8]=e,t[9]=m):m=t[9];const f=s&&"bg-sidebar-accent";let h;t[10]!==f?(h=ee("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",f),t[10]=f,t[11]=h):h=t[11];let j;t[12]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ps,{size:16,className:"shrink-0"}),t[12]=j):j=t[12];let k;t[13]!==u?(k=n.jsx("span",{className:"truncate max-w-[10rem] font-medium",children:u}),t[13]=u,t[14]=k):k=t[14];let v;t[15]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ye,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[15]=v):v=t[15];let x;t[16]!==m||t[17]!==h||t[18]!==k?(x=n.jsx(Fe,{asChild:!0,children:n.jsx(At,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":m,className:h,children:[j,k,v]})})}),t[16]=m,t[17]=h,t[18]=k,t[19]=x):x=t[19];let g;t[20]!==e?(g=e("chat.threadsMenu.chats"),t[20]=e,t[21]=g):g=t[21];let b;t[22]!==g?(b=n.jsx(Re,{side:"bottom",children:g}),t[22]=g,t[23]=b):b=t[23];let y;t[24]!==b||t[25]!==x?(y=n.jsxs(Oe,{children:[x,b]}),t[24]=b,t[25]=x,t[26]=y):y=t[26];let p;t[27]!==a?(p=n.jsx(xa,{panel:a,className:"size-8"}),t[27]=a,t[28]=p):p=t[28];let S;t[29]!==e?(S=e("sidebar.taskGroupsList.searchChats"),t[29]=e,t[30]=S):S=t[30];let N;t[31]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(xs,{size:16}),t[31]=N):N=t[31];let T;t[32]!==d||t[33]!==S?(T=n.jsx(we,{"aria-label":S,onClick:d,className:"size-8",children:N}),t[32]=d,t[33]=S,t[34]=T):T=t[34];let _;t[35]!==e?(_=e("sidebar.taskGroupsList.newChat"),t[35]=e,t[36]=_):_=t[36];let w;t[37]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(bt,{size:16}),t[37]=w):w=t[37];let I;t[38]!==a.newThread||t[39]!==_?(I=n.jsx(we,{"aria-label":_,onClick:a.newThread,className:"size-8",children:w}),t[38]=a.newThread,t[39]=_,t[40]=I):I=t[40];let P;t[41]!==T||t[42]!==I?(P=n.jsxs("div",{className:"flex items-center gap-0.5",children:[T,I]}),t[41]=T,t[42]=I,t[43]=P):P=t[43];let L;t[44]!==p||t[45]!==P?(L=n.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[p,P]}),t[44]=p,t[45]=P,t[46]=L):L=t[46];let $;t[47]!==a?($=n.jsx("div",{className:"flex max-h-[60vh] min-h-0 flex-col gap-0.5 overflow-y-auto overscroll-contain",children:n.jsx(Ha,{panel:a})}),t[47]=a,t[48]=$):$=t[48];let E;t[49]!==L||t[50]!==$?(E=n.jsxs(Lt,{align:"start",side:"bottom",onOpenAutoFocus:Qa,className:"flex w-80 flex-col gap-2 p-2",children:[L,$]}),t[49]=L,t[50]=$,t[51]=E):E=t[51];let F;t[52]!==s||t[53]!==y||t[54]!==E?(F=n.jsxs($t,{open:s,onOpenChange:r,children:[y,E]}),t[52]=s,t[53]=y,t[54]=E,t[55]=F):F=t[55];let R;return t[56]!==a.searchDialog||t[57]!==F?(R=n.jsxs(n.Fragment,{children:[F,a.searchDialog]}),t[56]=a.searchDialog,t[57]=F,t[58]=R):R=t[58],R}function Qa(t){return t.preventDefault()}function Za(){const t=A.c(20),e=K(),{threads:s}=Xe(),{createNewTask:r}=Qe(),i=Ft(),a=et();let o;t[0]!==a||t[1]!==s?(o=s.find(v=>v.id===a)?.branch??null,t[0]=a,t[1]=s,t[2]=o):o=t[2];const c=o;let u;t[3]!==i||t[4]!==r||t[5]!==c?(u=()=>{r(i,c)},t[3]=i,t[4]=r,t[5]=c,t[6]=u):u=t[6];const l=u;let d;t[7]!==e?(d=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=d):d=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(bt,{size:16}),t[9]=m):m=t[9];let f;t[10]!==l||t[11]!==d?(f=n.jsx(Fe,{asChild:!0,children:n.jsx("button",{type:"button",onClick:l,"aria-label":d,className:"flex shrink-0 items-center 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:m})}),t[10]=l,t[11]=d,t[12]=f):f=t[12];let h;t[13]!==e?(h=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=h):h=t[14];let j;t[15]!==h?(j=n.jsx(Re,{side:"bottom",children:h}),t[15]=h,t[16]=j):j=t[16];let k;return t[17]!==f||t[18]!==j?(k=n.jsxs(Oe,{children:[f,j]}),t[17]=f,t[18]=j,t[19]=k):k=t[19],k}function Xa(t){const e=A.c(18),{virtualMcp:s}=t,r=K(),i=Tt(),{navigateToTask:a}=Nn(),{create:o}=Je(),c=ts(),{org:u}=ne();let l,d;if(e[0]!==i||e[1]!==o||e[2]!==a||e[3]!==u||e[4]!==c||e[5]!==r||e[6]!==s){d=Symbol.for("react.early_return_sentinel");e:{const m=Ws(s,i);if(!m){d=null;break e}const f=m.mode==="dev";let h;e[9]!==o||e[10]!==a||e[11]!==u||e[12]!==c?(h=async b=>{const y=crypto.randomUUID();await Promise.all([o({id:y,virtual_mcp_id:b}).catch(er),Rs(c,u,b).catch(Ja)]),a(y,{virtualMcpId:b})},e[9]=o,e[10]=a,e[11]=u,e[12]=c,e[13]=h):h=e[13];const j=h,k=(b,y,p)=>n.jsxs("button",{type:"button","aria-pressed":y,"aria-label":b,title:b,onClick:()=>{y||j(m.targetId)},className:ee("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg transition-colors",y?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[n.jsx(p,{className:"size-3.5 shrink-0"}),n.jsx("span",{className:"@max-3xl/panel-header:hidden",children:b})]});let v;e[14]!==r?(v=r("devAgent.devAgentControl.develop"),e[14]=r,e[15]=v):v=e[15];const x=k(v,f,gs);let g;e[16]!==r?(g=r("devAgent.devAgentControl.live"),e[16]=r,e[17]=g):g=e[17],l=n.jsxs("div",{className:"inline-flex items-center rounded-lg border border-border bg-muted p-0.5 text-xs font-medium",children:[x,k(g,!f,bs)]})}e[0]=i,e[1]=o,e[2]=a,e[3]=u,e[4]=c,e[5]=r,e[6]=s,e[7]=l,e[8]=d}else l=e[7],d=e[8];return d!==Symbol.for("react.early_return_sentinel")?d:l}function Ja(){}function er(){}function tr(t){const e=A.c(16),{virtualMcpId:s,taskId:r}=t,{openPanel:i}=Ot();let a;e[0]!==r||e[1]!==s?(a={virtualMcpId:s,taskId:r},e[0]=r,e[1]=s,e[2]=a):a=e[2];const{tabs:o,activeTab:c,mainOpen:u}=Bt(a);if(o.length===0)return null;let l;if(e[3]!==c||e[4]!==u||e[5]!==i||e[6]!==o||e[7]!==s){let m;e[9]!==c||e[10]!==u||e[11]!==i||e[12]!==s?(m=f=>{const h=f.id==="automations"?ss({activeTab:c,mainOpen:u}):u&&f.id===c;return n.jsxs(st.Tab,{active:h,onClick:()=>{h||(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:f.id,tab_kind:f.kind,was_active:!1}),i(f.id))},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:f.icon})}),f.title]},f.id)},e[9]=c,e[10]=u,e[11]=i,e[12]=s,e[13]=m):m=e[13],l=o.map(m),e[3]=c,e[4]=u,e[5]=i,e[6]=o,e[7]=s,e[8]=l}else l=e[8];let d;return e[14]!==l?(d=n.jsx(st.Tabs,{"data-tour":Us.surfaceTabs,children:l}),e[14]=l,e[15]=d):d=e[15],d}function sr(t){return{threadId:t.routeThreadId,providerKey:t.routeThreadId??t.fallbackKey}}const Ue="__mobile-main-panel-tab-select__",Ve="main";function nr({tabs:t,activeTab:e,mainOpen:s,t:r}){const i=t.find(o=>o.id===e),a=r("mainPanelTabs.mobileMainPanelTabSelect.mainView");return s?i?.title??a:i?.title??t[0]?.title??a}const ar={kind:"component",Component:vs},rr={kind:"component",Component:ys},ir={kind:"component",Component:js},lr={kind:"component",Component:wn};function or({tabs:t,overlayEnabled:e,t:s}){return[{value:"chat",title:s("mainPanelTabs.mobileMainPanelTabSelect.chat"),icon:ar},...t.length>0?t.map(r=>({value:r.id,title:r.title,icon:r.icon})):[{value:Ve,title:s("mainPanelTabs.mobileMainPanelTabSelect.mainView"),icon:lr}],...e?[{value:"board",title:s("mainPanelTabs.mobileMainPanelTabSelect.tasks"),icon:rr},{value:"files",title:s("mainPanelTabs.mobileMainPanelTabSelect.library"),icon:ir}]:[]]}function cr(t){const e=A.c(53),{virtualMcpId:s,taskId:r}=t,i=K(),a=Ae(),{openPanel:o}=Ot();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const u=ke(c);let l;e[1]!==r||e[2]!==s?(l={virtualMcpId:s,taskId:r},e[1]=r,e[2]=s,e[3]=l):l=e[3];const{tabs:d,activeTab:m,mainOpen:f}=Bt(l),{org:h}=ne(),j=Es();let k;e[4]!==h.id?(k=nt(h.id),e[4]=h.id,e[5]=k):k=e[5];const v=s===k;let x,g,b,y,p,S,N,T,_,w;if(e[6]!==m||e[7]!==f||e[8]!==a||e[9]!==v||e[10]!==o||e[11]!==h.id||e[12]!==u.org||e[13]!==u.taskId||e[14]!==j||e[15]!==i||e[16]!==d||e[17]!==s){y=Symbol.for("react.early_return_sentinel");e:{const L=or({tabs:d,overlayEnabled:!!(u.org&&u.taskId),t:i}),$=f?L.find(O=>O.value===m)?.value??Ve:"chat",E=L.find(O=>O.value===$),F=E?.title??nr({tabs:d,activeTab:m,mainOpen:f,t:i});let R;e[28]!==a?(R=O=>{a({to:".",search:V=>({...V,...Ys(O)}),replace:!0})},e[28]=a,e[29]=R):R=e[29];const M=R;let C;e[30]!==v||e[31]!==o||e[32]!==h.id||e[33]!==j||e[34]!==M||e[35]!==s?(C=O=>{if(O!==Ue){if(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:O,source:"mobile_select"}),Ks({reportsOnly:j,onReportAgent:v,tabId:O})){o(O,{virtualmcpid:nt(h.id),search:fr});return}if(O==="chat"||O===Ve){M(O==="chat"?"chat":"main");return}o(O,{search:ur})}},e[30]=v,e[31]=o,e[32]=h.id,e[33]=j,e[34]=M,e[35]=s,e[36]=C):C=e[36];const G=C,z=L.find(O=>O.value!==$);if(L.length===2&&z){y=n.jsxs("button",{type:"button",onClick:()=>G(z.value),"aria-label":i("mainPanelTabs.mobileMainPanelTabSelect.switchTo",{name:z.title}),className:"flex h-10 min-w-0 max-w-[7.5rem] items-center gap-1.5 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:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:z.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:z.title})]});break e}g=Pn,_=Ue,w=G;let H;e[37]!==i?(H=i("mainPanelTabs.mobileMainPanelTabSelect.view"),e[37]=i,e[38]=H):H=e[38],b=n.jsx(Cn,{"aria-label":H,className:"h-10! w-full min-w-0 max-w-[7.5rem] rounded-lg border-0 bg-transparent px-1.5 text-xs shadow-none [--card-shadow:none]",children:n.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[E&&n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:E.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:F})]})}),x=In,p="end",S="w-56",e[39]!==F?(N=n.jsx(Dt,{value:Ue,disabled:!0,hideCheck:!0,className:"hidden",children:F}),e[39]=F,e[40]=N):N=e[40],T=L.map(dr)}e[6]=m,e[7]=f,e[8]=a,e[9]=v,e[10]=o,e[11]=h.id,e[12]=u.org,e[13]=u.taskId,e[14]=j,e[15]=i,e[16]=d,e[17]=s,e[18]=x,e[19]=g,e[20]=b,e[21]=y,e[22]=p,e[23]=S,e[24]=N,e[25]=T,e[26]=_,e[27]=w}else x=e[18],g=e[19],b=e[20],y=e[21],p=e[22],S=e[23],N=e[24],T=e[25],_=e[26],w=e[27];if(y!==Symbol.for("react.early_return_sentinel"))return y;let I;e[41]!==x||e[42]!==p||e[43]!==S||e[44]!==N||e[45]!==T?(I=n.jsxs(x,{align:p,className:S,children:[N,T]}),e[41]=x,e[42]=p,e[43]=S,e[44]=N,e[45]=T,e[46]=I):I=e[46];let P;return e[47]!==g||e[48]!==b||e[49]!==I||e[50]!==_||e[51]!==w?(P=n.jsxs(g,{value:_,onValueChange:w,children:[b,I]}),e[47]=g,e[48]=b,e[49]=I,e[50]=_,e[51]=w,e[52]=P):P=e[52],P}function dr(t){return n.jsx(Dt,{value:t.value,children:n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:t.icon})}),n.jsx("span",{className:"min-w-0 truncate",children:t.title})]})},t.value)}function ur(t){return{...t,sidepanel:!1}}function fr(t){return{...t,thread:void 0,sidepanel:!1}}function mr(t,e,s){const r=A.c(33),i=Ze(),{locator:a}=ne(),o=B.useSyncExternalStore(i.threads.subscribe,i.threads.get),c=B.useSyncExternalStore(i.threadsStatus.subscribe,i.threadsStatus.get);let u;r[0]!==t||r[1]!==o?(u=t===null?null:o.find(p=>p.id===t&&!p.partial)??null,r[0]=t,r[1]=o,r[2]=u):u=r[2];const l=u,[d,m]=B.useState(void 0),[f,h]=B.useState(t);f!==t&&(h(t),m(void 0));let j,k;r[3]!==d||r[4]!==t||r[5]!==l||r[6]!==i||r[7]!==c.kind?(j=()=>{t!==null&&(l||c.kind!=="loading"&&d===void 0&&(m("pending"),i.fetchThreadIntoSlot(t).then(p=>{m(p)})))},k=[t,l,c.kind,d,i],r[3]=d,r[4]=t,r[5]=l,r[6]=i,r[7]=c.kind,r[8]=j,r[9]=k):(j=r[8],k=r[9]),B.useEffect(j,k);let v;r[10]!==s||r[11]!==a||r[12]!==i||r[13]!==e?(v={mutationFn:async p=>i.create({id:p,virtual_mcp_id:e,...s?{branch:s}:{},...sn(sessionStorage,a,p)})},r[10]=s,r[11]=a,r[12]=i,r[13]=e,r[14]=v):v=r[14];const x=ns(v);let g,b;if(r[15]!==x||r[16]!==d||r[17]!==t||r[18]!==l||r[19]!==c.kind?(g=()=>{t!==null&&(l||d===null&&c.kind!=="loading"&&(x.isPending||x.variables!==t&&x.mutate(t)))},b=[t,l,d,c.kind,x],r[15]=x,r[16]=d,r[17]=t,r[18]=l,r[19]=c.kind,r[20]=g,r[21]=b):(g=r[20],b=r[21]),B.useEffect(g,b),t===null){let p;return r[22]===Symbol.for("react.memo_cache_sentinel")?(p={status:"ready",task:null},r[22]=p):p=r[22],p}if(l){let p;return r[23]!==l?(p={status:"ready",task:l},r[23]=l,r[24]=p):p=r[24],p}if(d&&typeof d=="object"){let p;return r[25]!==d?(p={status:"ready",task:d},r[25]=d,r[26]=p):p=r[26],p}if(x.data){let p;return r[27]!==x.data?(p={status:"ready",task:x.data},r[27]=x.data,r[28]=p):p=r[28],p}if(x.isError){let p;return r[29]!==x.error?(p={status:"error",error:x.error},r[29]=x.error,r[30]=p):p=r[30],p}if(x.isPending||c.kind!=="loading"){let p;return r[31]===Symbol.for("react.memo_cache_sentinel")?(p={status:"creating"},r[31]=p):p=r[31],p}let y;return r[32]===Symbol.for("react.memo_cache_sentinel")?(y={status:"loading"},r[32]=y):y=r[32],y}const hr=50;function pr(t,e){const s=A.c(15),{org:r}=ne(),i=Ie(),{data:a}=pe.useSession(),o=a?.user?.id??"";let c;s[0]!==r.id||s[1]!==o||s[2]!==t?(c=fe.agentEntryThreads(r.id,o,t),s[0]=r.id,s[1]=o,s[2]=t,s[3]=c):c=s[3];const u=e&&!!o;let l;s[4]!==i||s[5]!==t?(l=async()=>{try{return(await i.call("COLLECTION_THREADS_LIST",{limit:hr,offset:0,orderBy:[{field:["updated_at"],direction:"desc"}],where:{hidden:!1,created_by:"me",virtual_mcp_id:t}})).items}catch{return[]}},s[4]=i,s[5]=t,s[6]=l):l=s[6];let d;s[7]!==c||s[8]!==u||s[9]!==l?(d={queryKey:c,enabled:u,staleTime:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,queryFn:l},s[7]=c,s[8]=u,s[9]=l,s[10]=d):d=s[10];const m=me(d);if(!e||!o){let h;return s[11]===Symbol.for("react.memo_cache_sentinel")?(h={status:"idle"},s[11]=h):h=s[11],h}if(!m.data||m.isFetching){let h;return s[12]===Symbol.for("react.memo_cache_sentinel")?(h={status:"loading"},s[12]=h):h=s[12],h}let f;return s[13]!==m.data?(f={status:"ready",threads:m.data},s[13]=m.data,s[14]=f):f=s[14],f}function xr(t){const e=A.c(13),{children:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=ke(r);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const o=Le(a);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={select:gr},e[2]=c):c=e[2];const u=as(c),{org:l}=ne();let d;e[3]!==l||e[4]!==i.agentId||e[5]!==i.legacyView||e[6]!==i.org||e[7]!==u||e[8]!==o?(d=i.org?rs({pathname:u,org:i.org,pathAgentId:i.agentId,pathLegacyView:i.legacyView,fallbackAgentId:je(l.id).id,search:o}):null,e[3]=l,e[4]=i.agentId,e[5]=i.legacyView,e[6]=i.org,e[7]=u,e[8]=o,e[9]=d):d=e[9];const m=d;let f;return e[10]!==s||e[11]!==m?(f=m?n.jsx(tt,{target:m}):s,e[10]=s,e[11]=m,e[12]=f):f=e[12],f}function gr(t){return t.matches.at(-1)?.pathname??t.location.pathname}function br(){const t=A.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=ke(e);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[1]=r):r=t[1];const i=Le(r),{org:a}=ne(),{org:o,taskId:c}=s;if(!o||c===void 0)return null;let u;return t[2]!==o||t[3]!==a.id||t[4]!==i||t[5]!==c?(u=is({org:o,taskId:c,fallbackAgentId:je(a.id).id,search:i}),t[2]=o,t[3]=a.id,t[4]=i,t[5]=c,t[6]=u):u=t[6],u}function vr(){const t=A.c(2),e=br();let s;return t[0]!==e?(s=e?n.jsx(tt,{target:e}):null,t[0]=e,t[1]=s):s=t[1],s}function yr(){const t=A.c(6),e=An(),s=Ae();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{preview:i}=Le(r);if(!e||!i)return null;let a;t[1]!==s?(a=()=>s({to:".",search:jr}),t[1]=s,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=n.jsx(Ln,{previewPath:i,onClose:a,showSeeInLibrary:!0}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function jr(t){const{preview:e,...s}=t;return s}function kr(t){const e=A.c(11),{children:s}=t,r=K();let i;e[0]!==r?(i=r("agentShellLayout.agentShellLayout.chatLoadingError"),e[0]=r,e[1]=i):i=e[1];let a;e[2]!==i?(a=n.jsx("div",{role:"alert",className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:i}),e[2]=i,e[3]=a):a=e[3];let o;e[4]!==s?(o=s??n.jsx(ma,{}),e[4]=s,e[5]=o):o=e[5];let c;e[6]!==o?(c=n.jsx(Me,{children:o}),e[6]=o,e[7]=c):c=e[7];let u;return e[8]!==a||e[9]!==c?(u=n.jsx(pt,{fallback:a,children:c}),e[8]=a,e[9]=c,e[10]=u):u=e[10],u}function Sr(t){const e=A.c(5),{threadId:s,children:r}=t;if(s===null){let a;return e[0]!==r?(a=n.jsx(W.ThreadlessProvider,{children:r}),e[0]=r,e[1]=a):a=e[1],a}let i;return e[2]!==r||e[3]!==s?(i=n.jsx(W.ActiveTaskProvider,{taskId:s,children:r}),e[2]=r,e[3]=s,e[4]=i):i=e[4],i}function Tr(t){const e=A.c(3),{onNewTaskRef:s,createNewTask:r}=t;let i;return e[0]!==r||e[1]!==s?(i=()=>(s.current=r,()=>{s.current=null}),e[0]=r,e[1]=s,e[2]=i):i=e[2],B.useLayoutEffect(i),null}function Nr({virtualMcpId:t,hasActiveRepository:e,sandboxMap:s,children:r}){const i=K(),{currentBranch:a,activeTask:o,setCurrentTaskBranch:c}=Ee(),{data:u}=pe.useSession(),l=u?.user?.id,d=!As(o?.harness_id),m=rn({agentSandboxMap:s,threadSandboxMap:o?.metadata?.sandboxMap,userId:l,ownerId:o?.created_by,branch:a}),f=e||Zs(o?.metadata),h=B.useRef(null),j=d&&ln({threadLoaded:!!o,isOwner:!!l&&o?.created_by===l,hasActiveRepository:f,branch:a??null,attempted:h.current===(o?.id??null)});B.useEffect(()=>{!j||!o||(h.current=o.id,c(Ct(u?.user?.name||u?.user?.email?.split("@")[0])))},[j,o,u,c]);const k=yt(t),v=Se(t),x=It(v,a),{releases:g,createRelease:b}=Xs(t),p=!!l&&o?.created_by===l&&!!a&&a!==x&&!g.some(L=>L.branch===a),S=B.useRef(null);B.useEffect(()=>{!p||!a||S.current!==a&&(S.current=a,b({branch:a,name:en(g,i("thread.branchPicker.defaultVersionName")),color:Js(g.length),createdBy:l,createdAt:new Date().toISOString()}).catch(()=>{}))},[p,a,g,b,l,i]);const N=k.resolved?k.runtime:null,T=on(t,a??void 0),w=(l&&a?En(m?.[l]?.[a]):{})["agent-sandbox"]??null,I=w?.previewUrl??null,P=d&&N!=="cms"&&(!!w||T);return d?N==="cms"?n.jsx(lt,{children:r},`${t}:${a??"no-branch"}:${o?.id??""}`):n.jsx(_s,{virtualMcpId:t,branch:a??null,previewUrl:I,enabled:P,children:n.jsx(cn,{executionEnabled:d,virtualMcpId:t,branch:a??null,userId:l??null,hasActiveRepository:f,vmEntry:w,threadId:o?.id??null,children:n.jsx(lt,{children:r},`${t}:${a??"no-branch"}:${o?.id??""}`)})},o?.id??"no-thread"):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex h-full rounded-[0.75rem] bg-background card-shadow",children:n.jsx(Mt,{image:n.jsx(qe,{size:48,className:"text-muted-foreground"}),title:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWeb"),description:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWebDescription")})})})}function _r(){const t=A.c(16),e=K(),{toggleSidebar:s}=Ts(),{virtualMcpId:r,taskId:i}=Ee();let a;t[0]!==e?(a=e("layouts.shellControls.toggleSidebar"),t[0]=e,t[1]=a):a=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ks,{size:16}),t[2]=o):o=t[2];let c;t[3]!==a||t[4]!==s?(c=n.jsx(we,{className:"md:hidden",onClick:s,"aria-label":a,children:o}),t[3]=a,t[4]=s,t[5]=c):c=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Ya,{}),t[6]=u):u=t[6];let l;t[7]!==c?(l=n.jsxs(De.Topbar.Left,{children:[c,u]}),t[7]=c,t[8]=l):l=t[8];let d;t[9]!==i||t[10]!==r?(d=n.jsx("div",{className:"min-w-0 md:hidden",children:n.jsx(cr,{virtualMcpId:r,taskId:i})}),t[9]=i,t[10]=r,t[11]=d):d=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(De.Topbar.Right,{className:"shrink-0",children:n.jsx(Za,{})}),t[12]=m):m=t[12];let f;return t[13]!==l||t[14]!==d?(f=n.jsxs(De.Topbar,{className:"border-b border-border/60 px-3",children:[l,d,m]}),t[13]=l,t[14]=d,t[15]=f):f=t[15],f}function wr(t){const e=A.c(25),{layout:s,onNewTaskRef:r,createNewTask:i}=t,{virtualMcpId:a,taskId:o}=Ee(),c=Se(a),u=_n()??"overview",l=Ss(),[d,m]=B.useState(null),f=d===u,h=l?f:s.threadOpen;let j;e[0]!==u||e[1]!==s||e[2]!==l||e[3]!==f?(j=l?()=>m(f?null:u):s.toggleThread,e[0]=u,e[1]=s,e[2]=l,e[3]=f,e[4]=j):j=e[4];const k=j;let v;e[5]!==i||e[6]!==r?(v=n.jsx(Tr,{onNewTaskRef:r,createNewTask:i}),e[5]=i,e[6]=r,e[7]=v):v=e[7];let x;e[8]!==o||e[9]!==a?(x=n.jsx(tr,{virtualMcpId:a,taskId:o}),e[8]=o,e[9]=a,e[10]=x):x=e[10];let g;e[11]!==c?(g=c&&n.jsx(Xa,{virtualMcp:c}),e[11]=c,e[12]=g):g=e[12];let b,y;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(it.Thread,{topbar:n.jsx(_r,{}),children:n.jsx(kr,{})}),y=n.jsx(gt,{}),e[13]=b,e[14]=y):(b=e[13],y=e[14]);let p;e[15]!==u||e[16]!==s||e[17]!==x||e[18]!==g||e[19]!==h||e[20]!==k?(p=n.jsxs(it,{...s,threadOpen:h,toggleThread:k,contentKey:u,contentNavigation:x,contentActions:g,children:[b,y]}),e[15]=u,e[16]=s,e[17]=x,e[18]=g,e[19]=h,e[20]=k,e[21]=p):p=e[21];let S;return e[22]!==v||e[23]!==p?(S=n.jsxs(n.Fragment,{children:[v,p]}),e[22]=v,e[23]=p,e[24]=S):S=e[24],S}function Cr(){const t=K(),e=Ae(),s=mn(),{create:r}=Je(),{org:i}=ne(),o=ke({strict:!1}).org??"",c=Le({strict:!1}),u=et(),l=Ft(),d=Et(),[m]=B.useState(()=>crypto.randomUUID()),{data:f}=pe.useSession(),[h]=B.useState(()=>Ct(f?.user?.name||f?.user?.email?.split("@")[0])),j=Ze(),k=B.useSyncExternalStore(j.threads.subscribe,j.threads.get),v=B.useSyncExternalStore(j.threadsStatus.subscribe,j.threadsStatus.get),x=Se(l),g=!!(x&&_t(x)),b=It(x,null),y=u===null&&!!d&&!!x,p=M=>an(M,l,f?.user?.id,Pt(x?.metadata),g,{baseBranch:b}),S=y&&v.kind!=="loading"?p(k):void 0,N=pr(l,y&&v.kind!=="loading"&&!S),T=mr(u,l,h);ha(T.status==="ready"?T.task:null);const _=x?.metadata?.ui?.layout??null,w=_?{defaultMainView:_.defaultMainView??null,chatDefaultOpen:_.chatDefaultOpen??null}:null,I=Qs(w),{threadId:P,providerKey:L}=sr({routeThreadId:u,fallbackKey:m}),$=async()=>{const M=crypto.randomUUID(),C=k.find(G=>G.id===P)?.branch??null;try{await r({id:M,virtual_mcp_id:l,...C?{branch:C}:{}})}catch{}s(M,()=>({}))},E=B.useRef(null);B.useEffect(()=>{const M=C=>{Vs(C)&&C.shiftKey&&C.code==="KeyS"&&!C.repeat&&(C.preventDefault(),E.current?.())};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[]);const F=T.status==="ready"?T.task:null,R=F?.virtual_mcp_id;if(F&&R&&!hn({routeAgentId:l,threadAgentId:R})){const M=ls({org:o,agentId:R,superAgentId:je(i.id).id});return n.jsx(tt,{target:{route:M,search:{thread:F.id,sidepanel:c.sidepanel,mainpanel:c.mainpanel,autosend:c.autosend}}})}if(y){if(v.kind==="loading"||N.status==="loading")return n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.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:[n.jsx(ve,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})});const C=(S??(N.status==="ready"?p(N.threads):void 0))?.id??(g?m:null);if(C)return n.jsx(os,{to:".",replace:!0,search:G=>({...G,thread:C})})}return T.status==="creating"||T.status==="loading"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.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:[n.jsx(ve,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})}):T.status==="error"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.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:[n.jsx("div",{className:"font-medium",children:t("agentShellLayout.agentShellLayout.taskUnavailable")}),n.jsx("div",{className:"text-muted-foreground",children:T.error.message})]})}):x?n.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:n.jsx(W.Provider,{virtualMcpId:l,task:T.status==="ready"?T.task:null,children:n.jsx(Is,{layout:I,children:n.jsx(Nr,{virtualMcpId:l,hasActiveRepository:g,sandboxMap:x.metadata?.sandboxMap,children:n.jsx(Sr,{threadId:P,children:n.jsx(Me,{children:n.jsx(wr,{layout:I,onNewTaskRef:E,createNewTask:$})})},L)})})},l)}):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(Mt,{image:n.jsx(qe,{size:48,className:"text-muted-foreground"}),title:t("agentShellLayout.agentShellLayout.agentNotFound"),description:t("agentShellLayout.agentShellLayout.agentNotFoundDescription",{virtualMcpId:l}),actions:n.jsx(cs,{variant:"outline",onClick:()=>e({to:"/$org",params:{org:o}}),children:t("agentShellLayout.agentShellLayout.goToOrgHome")})})})})}function Io(){const t=A.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=ke(e);if(s.taskId!==void 0){let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(vr,{}),t[1]=i):i=t[1],i}if(s._splat!==void 0){let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(gt,{}),t[2]=i):i=t[2],i}let r;return t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Me,{children:n.jsx(xr,{children:n.jsx(Mn,{children:n.jsxs($n,{children:[n.jsx(Cr,{}),n.jsx(yr,{})]})})})}),t[3]=r):r=t[3],r}export{Io as default};
1
+ import{c as A,a2 as ne,a as pe,a9 as Ie,K as fe,m as me,b as K,r as B,l as ee,j as n,h as ve,aL as je,aK as Me,H as pt,y as he,v as qt,aM as Wt,s as Yt,q as Qt,D as Zt,aN as Xt,at as xt,t as Jt,au as es,d as Ae,o as ts,n as st,aO as ss,f as ke,M as nt,e as ns,u as Le,k as as,aP as rs,aQ as is,O as gt,aR as ls,N as os,B as cs,P as De}from"./index-BoB02eW2.js";import{i as qe}from"./AlertCircle-BFUZ4yx0.js";import{C as ds,D as at,A as ye,E as us,F as fs,G as ms,H as hs,I as ps,J as xs,K as bt,L as gs,b as bs,M as vs,n as ys,h as js,k as ks}from"./agent-icon-Bmu0Xuy8.js";import{h as Ss,u as Ts}from"./use-app-takeover-DFb1RzQs.js";import{T as we}from"./toolbar-icon-button-B24Twz-b.js";import{C as W,w as Ns,S as _s}from"./index-Cdsu1Nw_.js";import{s as vt,C as ws,u as Cs,a as yt,V as Ps,b as Is}from"./input-Dx6Yl3YV.js";import{u as $e,b as We,c as Ee,d as jt,e as Ms,s as As}from"./chat-context-C4pDshj1.js";import{u as Ls,s as kt}from"./use-ai-providers-Becg3IYt.js";import{b as St,a as $s,u as Es}from"./use-organization-settings-DHSMN_14.js";import{i as Fs}from"./CheckCircle-BWW06ZXQ.js";import{s as rt}from"./XClose-CXxsMd9c.js";import{a as Se,b as Tt,c as Nt,g as _t,p as Rs}from"./repository-binding-BYnKmLVI.js";import{I as wt}from"./integration-icon-YHEiRLgT.js";import{c as Os}from"./use-decopilot-events-D42PqykU.js";import{t as Ye}from"./ChevronUp-CTrNq9Nk.js";import{O as Bs}from"./pair-C9IKm4JE.js";import{u as Ds,a as zs}from"./use-thread-outputs-BVEM1vsy.js";import{u as Gs}from"./use-deco-credits-BJdkVUlJ.js";import{a as Qe,f as Hs,L as Us,s as Ks,b as Vs}from"./shell-layout-BhM3Q_22.js";import{t as qs,f as Ws,m as Ys,b as Qs,a as Zs}from"./use-project-native-view-presence-D12oGF6A.js";import{g as Ct,u as Xs,n as Js,a as en}from"./use-releases-wK1mECcA.js";import{u as tn,d as Pt,a as Ze,b as Xe,c as Je,e as sn}from"./thread-intent-DikZOwd-.js";import{f as nn,b as It,c as an}from"./use-navigate-to-agent-DNsHLJD8.js";import{o as rn,s as ln,u as on,S as cn}from"./sandbox-lifecycle-context-Dg7K5ioC.js";import{E as Mt}from"./empty-state-GUv-DLNf.js";import{C as it}from"./index-CVeMcxNw.js";import{a as At,b as Lt,P as $t}from"./popover-CzNTcDJM.js";import{T as Fe,a as Re,c as Oe}from"./tooltip-Bs0EJaD7.js";import{T as dn,a as un}from"./toggle-group-DbSldXZX.js";import{u as Et,a as et,r as fn,b as Ft,c as mn,d as hn}from"./thread-route-CRU_aqN9.js";import{c as pn,C as xn,a as gn,b as bn,e as vn,d as yn}from"./command-BSGZ-TwS.js";import{i as Rt}from"./ZoomOut-C1rwTYBB.js";import{g as jn,S as kn}from"./task-status-CMbp-PaL.js";import{a as Sn}from"./format-time-CAj8AQXM.js";import{u as Tn}from"./use-clock-tick-B1PaG9d4.js";import{u as Nn}from"./use-chat-navigation-BJSvg7rH.js";import{a as Ot,u as _n}from"./use-panel-navigate-62gIHptt.js";import{u as Bt}from"./use-main-panel-tabs-DjhEbRyd.js";import{T as Ce}from"./tab-icon-glyph-Dqe-yN6V.js";import{a as wn}from"./UserSquare-0R6kuy9W.js";import{b as Cn,c as Dt,S as Pn,d as In}from"./select-C4iThYr6.js";import{L as tt,a as Mn}from"./legacy-main-redirect-jScx_XSf.js";import{u as An}from"./use-mobile-CYsZ0F3X.js";import{L as Ln}from"./preview-dialog-C8Boj2eR.js";import{O as $n}from"./markdown-TXCHEe-4.js";import{B as lt}from"./blocks-preview-workspace-context-CMtVQxL8.js";import{p as En}from"./virtual-mcp-UT0zZzHO.js";import"./Tool01-CvAlZ6_R.js";import"./ArrowUp-U6_gobY2.js";import"./ArrowLeft-CK2OAC0l.js";import"./LinkBroken01-Vuoqu_ZW.js";import"./ShoppingBag01-dI1cRqeE.js";import"./Building02-Ddm6hNyu.js";import"./ChevronSelectorVertical-DKcwgXpF.js";import"./Copy01-TJP2zB12.js";import"./CreditCard01-Bm6_xB5H.js";import"./DotsVertical-DKl8j3BE.js";import"./Image01-Cf_YxPro.js";import"./Globe04-ClrCqE7c.js";import"./SwitchHorizontal01-KDjTaTLX.js";import"./Key01-55Z6tHcr.js";import"./Link01-DNXOSsg9.js";import"./Monitor01-C-mB2rao.js";import"./Sun-BPl8u-yx.js";import"./Play-CUFyJJIt.js";import"./Plus-D-GSl2MA.js";import"./SearchMd-CkV8MM4H.js";import"./Trash01-BzUZQR5Y.js";import"./Upload01-CdgDB-zC.js";import"./User01-CinpYulR.js";import"./Users01-DFSTtPtZ.js";import"./sheet-BXRHJIP3.js";import"./sandbox-url-D3mC8qhT.js";import"./backoff-CrEUbyZT.js";import"./tool-namespace-pIFYrei5.js";import"./drawer-BpEasqMM.js";import"./collection-search-sopr7ssV.js";import"./use-mcp-client-CEKqqblF.js";import"./auth-BeK8rRbB.js";import"./use-mcp-prompts-CwF-bqUg.js";import"./usage-stats-DuvxTL2m.js";import"./form-Dz-wry37.js";import"./label-CsyEQPG4.js";import"./utils-CVEq3hMx.js";import"./use-copy-T3xwaExj.js";import"./index-DuSo48nd.js";import"./checkbox-C2l5tKo2.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-yCbsNNbw.js";import"./feature-paywall-HnwykYzM.js";import"./plan-ladder-DbkDT52b.js";import"./icon-button-BbQESQAz.js";import"./file-type-icon-C2WSm6EM.js";import"./location-BjlyegC2.js";import"./autosend-B-VPnrp2.js";import"./chat-draft-D5dlb_sl.js";import"./tabs-BQUPeDjf.js";import"./use-open-billing-url-C1m0KS6b.js";import"./input-CC2XqVda.js";import"./suggestion-BPVDnpZj.js";import"./use-org-fs-Wo4_O8nn.js";import"./useInfiniteQuery-S3a_-GqY.js";import"./infiniteQueryObserver-BuOPvaCd.js";import"./question-004-sINsf4GQ.js";import"./use-members-CFcpHrvE.js";import"./use-org-auth-client-9ZqTxhaU.js";import"./add-connection-dialog-CNB1XZS8.js";import"./extract-connection-data-CyaR6DQN.js";import"./metadata-D72DunRR.js";import"./connection-B0eFNfCu.js";import"./url-slug-CMCbwnaP.js";import"./connection-card-BzTYJa6s.js";import"./connection-slug-CITJ0kGN.js";import"./slugify-CEUa2lfQ.js";import"./textarea-CxYAsAPe.js";import"./use-connection-CLmhN_H7.js";import"./schema-D-qEbXZ-.js";import"./connection-form-helpers-ChgreO5F.js";import"./authenticate-and-persist-oauth-DJwJCiC8.js";import"./mcp-oauth-BFqNJ-iQ.js";import"./mcp-oauth-CuU6LL15.js";import"./collection-tabs-DU5QTifc.js";import"./badge-Zdi_g359.js";import"./use-infinite-scroll-C47I-wuH.js";import"./useSuspenseInfiniteQuery-DiRI5XkI.js";import"./use-task-board-events-BrTJpTlj.js";import"./task-board-DxxiAR5A.js";import"./schema-zU96PUAb.js";import"./watch-sse-pool-BdkzrgTO.js";import"./collapsible-CDZFoOK-.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BAlCN3Lv.js";import"./types-IpdOmnYx.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-project-scope-Dk4Q60O6.js";import"./project-icon-CP0m7tWm.js";import"./new-project-dialog-DCPZVRuS.js";import"./repository-import-picker-De4qAOck.js";import"./repository-picker-B7BUYgB7.js";import"./use-debounced-value-d254MtLc.js";import"./required-auth-layout-Mqzz7XgH.js";import"./use-org-sso-BSkklN8h.js";import"./use-file-configs-D_kGDRPd.js";import"./site-slug-DebpOoQq.js";import"./serial-task-queue-CGOeQgpr.js";import"./delay-CnY5UFtP.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./resizable-DpCFVPH5.js";import"./index-DSuQX-Dj.js";import"./index-BhuMySoe.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-mcp-tools-_07-mu_D.js";import"./resolve-tab-icon-8PRTNpAS.js";import"./use-task-metadata-Bef5UioD.js";import"./preview-source-BsRLGWUP.js";import"./index-BdQq_4o_.js";import"./preview-content-BjX4Mivy.js";import"./file-share-button-BX7_JCXp.js";import"./file-preview-KNDU2UhF.js";import"./utils-DVs-Bhj-.js";import"./editor-DQK8Gbky.js";function Fn({isThreadLocked:t,hasCloudProviderKeys:e,sandboxOnlyChats:s,canRunClaudeCode:r}){return t?null:!e&&!(s&&r)?"provider":s&&!r?"claude-code-provider":null}function Rn(){const t=A.c(25),e=Ls(),s=$e(),r=St(),i=$s("chat_harness_codex"),{org:a}=ne(),{data:o}=pe.useSession(),c=o?.user.id??"",u=Ie(),l=e.some(Bn);let d;t[0]!==a.id?(d=fe.claudeSubscription(a.id),t[0]=a.id,t[1]=d):d=t[1];let m;t[2]!==u?(m=()=>u.call("CLAUDE_SUBSCRIPTION_STATUS",{}),t[2]=u,t[3]=m):m=t[3];const f=r&&!i&&!l;let h;t[4]!==d||t[5]!==m||t[6]!==f?(h={queryKey:d,queryFn:m,enabled:f},t[4]=d,t[5]=m,t[6]=f,t[7]=h):h=t[7];const j=me(h);let k;t[8]!==a.id?(k=fe.githubCopilot(a.id),t[8]=a.id,t[9]=k):k=t[9];let v;t[10]!==u?(v=()=>u.call("GITHUB_COPILOT_STATUS",{}),t[10]=u,t[11]=v):v=t[11];const x=r&&!i&&!l;let g;t[12]!==k||t[13]!==v||t[14]!==x?(g={queryKey:k,queryFn:v,enabled:x},t[12]=k,t[13]=v,t[14]=x,t[15]=g):g=t[15];const b=me(g);let y;t[16]!==a.id||t[17]!==c?(y=fe.codexSubscription(a.id,c),t[16]=a.id,t[17]=c,t[18]=y):y=t[18];let p;t[19]!==u?(p=()=>u.call("CODEX_SUBSCRIPTION_STATUS",{}),t[19]=u,t[20]=p):p=t[20];const S=r&&i;let N;t[21]!==S||t[22]!==y||t[23]!==p?(N={queryKey:y,queryFn:p,enabled:S},t[21]=S,t[22]=y,t[23]=p,t[24]=N):N=t[24];const T=me(N);return r&&i&&!s?.isThreadLocked?e.some(On)||T.data?.connected!==!1?null:"codex-provider":Fn({isThreadLocked:s?.isThreadLocked??!1,hasCloudProviderKeys:e.length>0,sandboxOnlyChats:r,canRunClaudeCode:l||j.data?.connected!==!1||b.data?.connected!==!1||!!b.data?.orgShare})}function On(t){return vt(t.providerId)}function Bn(t){return kt(t.providerId)}function be(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function ze(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 Dn(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function zn(t){const e=A.c(4),{items:s}=t;let r;e[0]!==s?(r=s.map(Gn),e[0]=s,e[1]=r):r=e[1];let i;return e[2]!==r?(i=n.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:r}),e[2]=r,e[3]=i):i=e[3],i}function Gn(t){return n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[n.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.label}),n.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:t.value})]},t.label)}function Hn(t){const e=A.c(33),{userTokens:s,assistantTokens:r,otherTokens:i}=t,a=K(),o=s+r+i,c=o>0?s/o*100:0,u=o>0?r/o*100:0,l=o>0?i/o*100:0;let d;e[0]!==c?(d=c>0&&n.jsx("div",{className:"h-full bg-chart-1",style:{width:`${c}%`}}),e[0]=c,e[1]=d):d=e[1];let m;e[2]!==u?(m=u>0&&n.jsx("div",{className:"h-full bg-chart-2",style:{width:`${u}%`}}),e[2]=u,e[3]=m):m=e[3];let f;e[4]!==l?(f=l>0&&n.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${l}%`}}),e[4]=l,e[5]=f):f=e[5];let h;e[6]!==d||e[7]!==m||e[8]!==f?(h=n.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[d,m,f]}),e[6]=d,e[7]=m,e[8]=f,e[9]=h):h=e[9];let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=j):j=e[10];let k;e[11]!==a||e[12]!==c?(k=a("chat.contextPanel.userPercent",{pct:c.toFixed(1)}),e[11]=a,e[12]=c,e[13]=k):k=e[13];let v;e[14]!==k?(v=n.jsxs("div",{className:"flex items-center gap-1.5",children:[j,n.jsx("span",{className:"text-xs text-muted-foreground",children:k})]}),e[14]=k,e[15]=v):v=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[16]=x):x=e[16];let g;e[17]!==u||e[18]!==a?(g=a("chat.contextPanel.assistantPercent",{pct:u.toFixed(1)}),e[17]=u,e[18]=a,e[19]=g):g=e[19];let b;e[20]!==g?(b=n.jsxs("div",{className:"flex items-center gap-1.5",children:[x,n.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e[20]=g,e[21]=b):b=e[21];let y;e[22]!==l||e[23]!==i||e[24]!==a?(y=i>0&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.otherPercent",{pct:l.toFixed(1)})})]}),e[22]=l,e[23]=i,e[24]=a,e[25]=y):y=e[25];let p;e[26]!==b||e[27]!==y||e[28]!==v?(p=n.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[v,b,y]}),e[26]=b,e[27]=y,e[28]=v,e[29]=p):p=e[29];let S;return e[30]!==p||e[31]!==h?(S=n.jsxs("div",{className:"flex flex-col gap-2",children:[h,p]}),e[30]=p,e[31]=h,e[32]=S):S=e[32],S}function Un(t){const e=A.c(14),{agentId:s,isError:r}=t,i=Se(s),a=K();let o;e[0]!==i?.title||e[1]!==a?(o=i?.title??a("chat.subtask.subtaskNoun"),e[0]=i?.title,e[1]=a,e[2]=o):o=e[2];const c=o,u=i?.icon??null;let l;e[3]!==u||e[4]!==c?(l=n.jsx(wt,{icon:u,name:c,size:"xs",className:"size-6 rounded-md shrink-0"}),e[3]=u,e[4]=c,e[5]=l):l=e[5];const d=r?"text-destructive":"text-foreground";let m;e[6]!==d?(m=ee("shrink-0 font-medium",d),e[6]=d,e[7]=m):m=e[7];let f;e[8]!==c||e[9]!==m?(f=n.jsx("span",{className:m,children:c}),e[8]=c,e[9]=m,e[10]=f):f=e[10];let h;return e[11]!==l||e[12]!==f?(h=n.jsxs(n.Fragment,{children:[l,f]}),e[11]=l,e[12]=f,e[13]=h):h=e[13],h}function Kn(t){const e=A.c(12),{isError:s}=t,r=K();let i;e[0]!==r?(i=r("chat.contextPanel.subtask"),e[0]=r,e[1]=i):i=e[1];const a=i;let o;e[2]!==a?(o=n.jsx(wt,{icon:null,name:a,size:"xs",className:"size-6 rounded-md shrink-0"}),e[2]=a,e[3]=o):o=e[3];const c=s?"text-destructive":"text-foreground";let u;e[4]!==c?(u=ee("shrink-0 font-medium",c),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==a||e[7]!==u?(l=n.jsx("span",{className:u,children:a}),e[6]=a,e[7]=u,e[8]=l):l=e[8];let d;return e[9]!==o||e[10]!==l?(d=n.jsxs(n.Fragment,{children:[o,l]}),e[9]=o,e[10]=l,e[11]=d):d=e[11],d}function Vn(t){const e=A.c(18),{part:s}=t,r=s.input?.agent_id,i=s.state==="input-streaming"||s.state==="input-available"||s.state==="output-available"&&s.preliminary===!0,a=s.state==="output-error",o=s.state==="approval-requested";let c;e[0]!==a?(c=n.jsx(Kn,{isError:a}),e[0]=a,e[1]=c):c=e[1];let u;e[2]!==r||e[3]!==a?(u=n.jsx(Un,{agentId:r,isError:a}),e[2]=r,e[3]=a,e[4]=u):u=e[4];let l;e[5]!==c||e[6]!==u?(l=n.jsx(B.Suspense,{fallback:c,children:u}),e[5]=c,e[6]=u,e[7]=l):l=e[7];let d;e[8]!==s.input?(d=s.input?.prompt&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted-foreground/50",children:"·"}),n.jsx("span",{className:"truncate text-muted-foreground",children:s.input.prompt})]}),e[8]=s.input,e[9]=d):d=e[9];let m;e[10]!==o||e[11]!==a||e[12]!==i?(m=n.jsx("span",{className:"ml-auto shrink-0",children:i?n.jsx(ve,{className:"size-3 text-muted-foreground"}):a?n.jsx(ds,{size:12,className:"text-destructive"}):o?n.jsx(qe,{size:12,className:"text-warning"}):n.jsx(Fs,{size:12,className:"text-success"})}),e[10]=o,e[11]=a,e[12]=i,e[13]=m):m=e[13];let f;return e[14]!==l||e[15]!==d||e[16]!==m?(f=n.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[l,d,m]}),e[14]=l,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function qn(t){const e=A.c(51),{onClose:s,back:r,className:i}=t,a=K(),[o,c]=B.useState(null),{messages:u}=We(),{activeTask:l}=Ee(),{selectedModel:d,selectedVirtualMcp:m}=jt(),f=Ms(u),h=[...u].reverse().find(ra),j=h?.metadata?.usage,k=[...u].reverse().find(aa)?.metadata?.models?.thinking,v=h?.metadata?.modelLimits?.contextWindow??(!k||k.id===d?.modelId?d?.limits?.contextWindow:null)??null,x=j?.contextTokens??0,g=v&&v>0?(x/v*100).toFixed(1):null,b=u;let y;e[0]!==b?(y=b.filter(na).reduce(sa,0),e[0]=b,e[1]=y):y=e[1];const p=y,S=u;let N;e[2]!==S?(N=S.filter(ta).reduce(ea,0),e[2]=S,e[3]=N):N=e[3];const T=N,_=Math.max(0,f.totalTokens-p-T),w=u[0],I=u.at(-1),P=w?.metadata?.created_at??l?.created_at,L=I?.metadata?.created_at??l?.updated_at,$=u.filter(Jn),E=u.flatMap(Zn),F=Dn(k?.id??d?.modelId),R=m?.title??"Super Agent",M=Os(),C=[{label:a("chat.contextPanel.sessionLabel"),value:l?.title??a("chat.contextPanel.newChat")},{label:a("chat.contextPanel.messagesLabel"),value:$.length},{label:a("chat.contextPanel.agentLabel"),value:R},...M?[{label:a("chat.contextPanel.modelLabel"),value:F}]:[],{label:a("chat.contextPanel.contextLimitLabel"),value:v?be(v):"—"},{label:a("chat.contextPanel.sessionTokensLabel"),value:f.totalTokens>0?be(f.totalTokens):"0"},{label:a("chat.contextPanel.usageLabel"),value:g!==null?`${g}%`:"—"},{label:a("chat.contextPanel.inputTokensLabel"),value:f.inputTokens>0?be(f.inputTokens):"0"},{label:a("chat.contextPanel.outputTokensLabel"),value:f.outputTokens>0?be(f.outputTokens):"0"},{label:a("chat.contextPanel.reasoningTokensLabel"),value:f.reasoningTokens>0?be(f.reasoningTokens):"0"},...M?[{label:a("chat.contextPanel.costLabel"),value:f.cost>0?`$${f.cost<.001?f.cost.toFixed(6):f.cost.toFixed(4)}`:"$0.00"}]:[],{label:a("chat.contextPanel.sessionCreatedLabel"),value:ze(P)},{label:a("chat.contextPanel.lastActivityLabel"),value:ze(L)}];if(!l&&$.length===0){let D;e[4]!==i?(D=ee("flex flex-col h-full w-full border-l border-border bg-background",i),e[4]=i,e[5]=D):D=e[5];let re;e[6]!==a?(re=a("chat.contextPanel.title"),e[6]=a,e[7]=re):re=e[7];let X;e[8]!==re?(X=n.jsx("span",{className:"text-sm font-medium text-foreground",children:re}),e[8]=re,e[9]=X):X=e[9];let J;e[10]!==r?(J=r?n.jsx(at,{size:14,className:"text-muted-foreground"}):n.jsx(rt,{size:14,className:"text-muted-foreground"}),e[10]=r,e[11]=J):J=e[11];let te;e[12]!==s||e[13]!==J?(te=n.jsx("button",{type:"button",onClick:s,className:"flex size-6 items-center justify-center hover:bg-accent transition-colors rounded-lg",children:J}),e[12]=s,e[13]=J,e[14]=te):te=e[14];let ae;e[15]!==X||e[16]!==te?(ae=n.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[X,te]}),e[15]=X,e[16]=te,e[17]=ae):ae=e[17];let ie;e[18]!==a?(ie=a("chat.contextPanel.emptyState"),e[18]=a,e[19]=ie):ie=e[19];let se;e[20]!==ie?(se=n.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:n.jsx("p",{className:"text-xs text-muted-foreground",children:ie})}),e[20]=ie,e[21]=se):se=e[21];let oe;return e[22]!==ae||e[23]!==se||e[24]!==D?(oe=n.jsxs("div",{className:D,children:[ae,se]}),e[22]=ae,e[23]=se,e[24]=D,e[25]=oe):oe=e[25],oe}let G;e[26]!==i?(G=ee("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",i),e[26]=i,e[27]=G):G=e[27];let z;e[28]!==a?(z=a("chat.contextPanel.title"),e[28]=a,e[29]=z):z=e[29];let H;e[30]!==z?(H=n.jsx("span",{className:"text-sm font-medium text-foreground",children:z}),e[30]=z,e[31]=H):H=e[31];let O;e[32]!==r?(O=r?n.jsx(at,{size:14}):n.jsx(rt,{size:14}),e[32]=r,e[33]=O):O=e[33];let V;e[34]!==s||e[35]!==O?(V=n.jsx("button",{type:"button",onClick:s,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:O}),e[34]=s,e[35]=O,e[36]=V):V=e[36];let Q;e[37]!==H||e[38]!==V?(Q=n.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[H,V]}),e[37]=H,e[38]=V,e[39]=Q):Q=e[39];let Y;e[40]!==a?(Y=a("chat.contextPanel.contextBreakdownSection"),e[40]=a,e[41]=Y):Y=e[41];let Z;e[42]!==Y?(Z=n.jsx("span",{className:"text-xs text-muted-foreground",children:Y}),e[42]=Y,e[43]=Z):Z=e[43];let q;e[44]!==T||e[45]!==_||e[46]!==p?(q=n.jsx(Hn,{userTokens:p,assistantTokens:T,otherTokens:_}),e[44]=T,e[45]=_,e[46]=p,e[47]=q):q=e[47];let le;return e[48]!==Z||e[49]!==q?(le=n.jsxs("div",{className:"flex flex-col gap-3",children:[Z,q]}),e[48]=Z,e[49]=q,e[50]=le):le=e[50],n.jsxs("div",{className:G,children:[Q,n.jsxs("div",{className:"flex flex-col gap-8 p-6",children:[E.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.subtasksSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:E.map(Qn)})]}),n.jsx(zn,{items:C}),le,$.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.rawMessagesSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:$.map(D=>{const re=D.metadata?.created_at,X=o?.id===D.id;return n.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>c(X?null:D),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:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:ee("shrink-0 font-medium",D.role==="user"?"text-chart-1":"text-chart-2"),children:D.role}),n.jsx("span",{className:"text-muted-foreground",children:"•"}),n.jsx("span",{className:"truncate text-muted-foreground font-mono",children:D.id})]}),re&&n.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:ze(re)})]}),X&&n.jsxs(n.Fragment,{children:[D.role==="assistant"&&(()=>{const J=D.metadata?._request;if(!J)return null;const te=J.systemSections??[],ae=Math.max(1,...te.map(Yn)),ie=te.reduce(Wn,0);return n.jsxs("div",{className:"border-t border-border/50 px-3 py-2.5 text-xs space-y-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"font-medium text-foreground",children:a("chat.contextPanel.requestLabel")}),n.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[J.activeTools??0," / ",J.tools??0," ",a("chat.contextPanel.toolsActive")]})]}),te.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"text-muted-foreground",children:[a("chat.contextPanel.systemPromptLabel")," ",n.jsxs("span",{className:"tabular-nums",children:["~",Math.round(ie/4).toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),te.map((se,oe)=>{const ce=se.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${oe}`,xe=se.chars/ae*100,de=Math.round(se.chars/4);return n.jsxs("div",{className:"space-y-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"font-mono text-foreground truncate",children:ce}),n.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["~",de.toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),n.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-chart-3",style:{width:`${xe}%`}})})]},oe)})]})]})})(),n.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(D,null,2)})]})]},D.id)})})]})]})]})}function Wn(t,e){return t+e.chars}function Yn(t){return t.chars}function Qn(t,e){return n.jsx(Vn,{part:t},e)}function Zn(t){return(t.parts??[]).filter(Xn)}function Xn(t){return t.type==="tool-subtask"}function Jn(t){return t.role!=="system"}function ea(t,e){const s=e.metadata?.usage;return t+(s?.outputTokens??0)}function ta(t){return t.role==="assistant"}function sa(t,e){const s=e.metadata?.usage;return t+(s?.inputTokens??0)}function na(t){return t.role==="user"}function aa(t){return t.role==="assistant"&&t.metadata?.models}function ra(t){return t.role==="assistant"&&t.metadata?.usage}function ia(t){const e=A.c(21),{onOpenContextPanel:s}=t,{org:r}=ne(),{selectedVirtualMcp:i}=jt();let a;e[0]!==r.id?(a=je(r.id),e[0]=r.id,e[1]=a):a=e[1];const c=i??a,l=Se(c.id)??c,d=l.title??"Super Agent",m=l.icon??null,f=l.description??null;let h;e[2]!==m||e[3]!==d?(h=n.jsx(ye,{icon:m,name:d,size:"lg"}),e[2]=m,e[3]=d,e[4]=h):h=e[4];let j;e[5]!==d?(j=n.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:d}),e[5]=d,e[6]=j):j=e[6];let k;e[7]!==f?(k=f?n.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance",children:f}):null,e[7]=f,e[8]=k):k=e[8];let v;e[9]!==j||e[10]!==k?(v=n.jsxs("div",{className:"space-y-1.5",children:[j,k]}),e[9]=j,e[10]=k,e[11]=v):v=e[11];let x;e[12]!==h||e[13]!==v?(x=n.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,v]}),e[12]=h,e[13]=v,e[14]=x):x=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(W.IceBreakers,{className:"pb-3"}),e[15]=g):g=e[15];let b;e[16]!==s?(b=n.jsxs(W.Footer,{children:[g,n.jsx(W.Input,{onOpenContextPanel:s})]}),e[16]=s,e[17]=b):b=e[17];let y;return e[18]!==x||e[19]!==b?(y=n.jsxs(n.Fragment,{children:[x,b]}),e[18]=x,e[19]=b,e[20]=y):y=e[20],y}function ot(t){const e=A.c(17),{outputs:s,collapsed:r,onToggle:i,variant:a}=t,o=a==="card"?"rounded-xl border border-border bg-muted/95 shadow-sm backdrop-blur-sm":"border-b border-border bg-background";let c;e[0]!==o?(c=ee(o),e[0]=o,e[1]=c):c=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Files in this task"}),e[2]=u):u=e[2];const l=r&&"-rotate-90";let d;e[3]!==l?(d=ee("size-4 text-muted-foreground transition-transform",l),e[3]=l,e[4]=d):d=e[4];let m;e[5]!==d?(m=n.jsx(Ye,{className:d}),e[5]=d,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==m?(f=n.jsxs("button",{type:"button",onClick:i,className:"flex w-full items-center justify-between px-3 py-2.5 text-left",children:[u,m]}),e[7]=i,e[8]=m,e[9]=f):f=e[9];let h;e[10]!==r||e[11]!==s?(h=!r&&n.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto px-2 pb-2",children:s.map(la)}),e[10]=r,e[11]=s,e[12]=h):h=e[12];let j;return e[13]!==c||e[14]!==f||e[15]!==h?(j=n.jsxs("div",{className:c,children:[f,h]}),e[13]=c,e[14]=f,e[15]=h,e[16]=j):j=e[16],j}function la(t){return n.jsx(Bs,{file:t},t.key)}function oa(){const t=A.c(13),e=$e()?.taskId??null,s=Ds();let r;t[0]!==s?(r={enabled:s},t[0]=s,t[1]=r):r=t[1];const{data:i}=zs(e,r),[a,o]=B.useState(!1),[c,u]=B.useState(!0);if(!e||!i||i.length===0)return null;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>o(da),t[2]=l):l=t[2];let d;t[3]!==a||t[4]!==i?(d=n.jsx("div",{className:"absolute top-2 right-2 z-10 hidden w-72 @[1280px]:block",children:n.jsx(ot,{variant:"card",outputs:i,collapsed:a,onToggle:l})}),t[3]=a,t[4]=i,t[5]=d):d=t[5];let m;t[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>u(ca),t[6]=m):m=t[6];let f;t[7]!==c||t[8]!==i?(f=n.jsx("div",{className:"shrink-0 @[1280px]:hidden",children:n.jsx(ot,{variant:"bar",outputs:i,collapsed:c,onToggle:m})}),t[7]=c,t[8]=i,t[9]=f):f=t[9];let h;return t[10]!==d||t[11]!==f?(h=n.jsxs(n.Fragment,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=h):h=t[12],h}function ca(t){return!t}function da(t){return!t}function ua(){const t=A.c(1);B.use(We().ready);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ws,{children:n.jsx(fa,{})}),t[0]=e):e=t[0],e}function fa(){const t=A.c(29),{active:e}=Cs(),{org:s}=ne(),r=$e(),{isChatEmpty:i}=We(),[a,o]=B.useState("chat"),c=Gs(),u=K(),l=Rn(),{runtime:d}=yt(r?.virtualMcpId);if(l!==null&&d!=="cms"){let T;return t[0]!==l||t[1]!==u?(T=n.jsx(W,{className:"animate-in fade-in-0 duration-200",children:n.jsx(W.Main,{className:"flex flex-col items-center",children:n.jsx(W.EmptyState,{children:l==="codex-provider"?n.jsx(W.NoAiProviderEmptyState,{title:u("settings.codexSubscription.setupHeading"),description:u("settings.codexSubscription.setupDescription"),providerFilter:vt}):l==="claude-code-provider"?n.jsx(W.NoAiProviderEmptyState,{title:u("chat.noAiProviderEmptyState.supportedHeading"),description:u("chat.noAiProviderEmptyState.supportedSubtitle"),providerFilter:kt}):n.jsx(W.NoAiProviderEmptyState,{})})})}),t[0]=l,t[1]=u,t[2]=T):T=t[2],T}let f;t[3]!==c.hasDecoKey||t[4]!==c.hasOnlyDecoProvider||t[5]!==c.isLoading||t[6]!==c.isZeroBalance||t[7]!==i||t[8]!==s?(f=c.hasDecoKey&&c.isZeroBalance&&c.hasOnlyDecoProvider&&!c.isLoading&&i&&!Ns(s.id),t[3]=c.hasDecoKey,t[4]=c.hasOnlyDecoProvider,t[5]=c.isLoading,t[6]=c.isZeroBalance,t[7]=i,t[8]=s,t[9]=f):f=t[9];const h=f;let j;t[10]!==h?(j=h&&n.jsx(W.CreditsEmptyState,{}),t[10]=h,t[11]=j):j=t[11];let k;t[12]!==a||t[13]!==i||t[14]!==d||t[15]!==e?(k=!e&&n.jsx("div",{inert:a!=="chat"?!0:void 0,"aria-hidden":a!=="chat",className:ee("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",a!=="chat"?"opacity-0 pointer-events-none":"opacity-100"),children:i&&d!=="cms"?n.jsx(ia,{onOpenContextPanel:()=>o("context")}):n.jsxs(n.Fragment,{children:[n.jsxs(W.Main,{className:"relative flex flex-col overflow-hidden @container",children:[n.jsx(oa,{}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(W.Messages,{})})]}),n.jsx(W.Footer,{children:n.jsx(W.Input,{onOpenContextPanel:()=>o("context")})})]})}),t[12]=a,t[13]=i,t[14]=d,t[15]=e,t[16]=k):k=t[16];let v;t[17]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ps,{}),t[17]=v):v=t[17];const x=a!=="context"?!0:void 0,g=a!=="context",b=a==="context"?"opacity-100":"opacity-0 pointer-events-none";let y;t[18]!==b?(y=ee("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",b),t[18]=b,t[19]=y):y=t[19];let p;t[20]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(qn,{back:!0,onClose:()=>o("chat")}),t[20]=p):p=t[20];let S;t[21]!==x||t[22]!==g||t[23]!==y?(S=n.jsx("div",{inert:x,"aria-hidden":g,className:y,children:p}),t[21]=x,t[22]=g,t[23]=y,t[24]=S):S=t[24];let N;return t[25]!==j||t[26]!==k||t[27]!==S?(N=n.jsxs(W,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[j,k,v,S]}),t[25]=j,t[26]=k,t[27]=S,t[28]=N):N=t[28],N}function ma(){const t=A.c(7),e=K();let s;t[0]!==e?(s=e("agentShellLayout.agentShellLayout.chatLoadingError"),t[0]=e,t[1]=s):s=t[1];let r;t[2]!==s?(r=n.jsx("div",{role:"alert",className:"flex h-full flex-1 items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=r):r=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Me,{children:n.jsx(ua,{})}),t[4]=i):i=t[4];let a;return t[5]!==r?(a=n.jsx(pt,{fallback:r,children:i}),t[5]=r,t[6]=a):a=t[6],a}function ha(t){const e=A.c(10),{org:s}=ne(),r=tn(),{data:i}=pe.useSession(),a=i?.user?.id,o=t?.id??null,c=!!t&&!!a&&!!t.created_by&&t.created_by!==a;let u;e[0]!==s.id||e[1]!==o?(u=fe.viewedThreadMetadataRefresh(s.id,o??""),e[0]=s.id,e[1]=o,e[2]=u):u=e[2];const l=!!r&&!!o&&c;let d;e[3]!==r||e[4]!==o?(d=async()=>(await r?.refreshThreadMetadata(o??""),!0),e[3]=r,e[4]=o,e[5]=d):d=e[5];let m;e[6]!==u||e[7]!==l||e[8]!==d?(m={queryKey:u,enabled:l,staleTime:Number.POSITIVE_INFINITY,queryFn:d},e[6]=u,e[7]=l,e[8]=d,e[9]=m):m=e[9],me(m)}function Ge(t){const e=A.c(14),{label:s,value:r,onChange:i,options:a}=t;let o;e[0]!==s?(o=n.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=e[1];let c;e[2]!==i?(c=m=>m&&i(m),e[2]=i,e[3]=c):c=e[3];let u;e[4]!==a?(u=a.map(pa),e[4]=a,e[5]=u):u=e[5];let l;e[6]!==s||e[7]!==c||e[8]!==u||e[9]!==r?(l=n.jsx(un,{type:"single",size:"sm",value:r,onValueChange:c,"aria-label":s,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:u}),e[6]=s,e[7]=c,e[8]=u,e[9]=r,e[10]=l):l=e[10];let d;return e[11]!==o||e[12]!==l?(d=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,l]}),e[11]=o,e[12]=l,e[13]=d):d=e[13],d}function pa(t){return n.jsxs(dn,{value:t.value,className:"h-6 gap-1.5 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 xa(t){const e=A.c(91),{panel:s,className:r}=t,i=r===void 0?"md:size-[34px]":r,a=K();let o;e[0]!==a?(o=a("sidebar.taskGroupsList.filterChats"),e[0]=a,e[1]=o):o=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(us,{size:16}),e[2]=c):c=e[2];let u;e[3]!==s.filtersActive?(u=s.filtersActive&&n.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"}),e[3]=s.filtersActive,e[4]=u):u=e[4];let l;e[5]!==i||e[6]!==s.filtersActive||e[7]!==o||e[8]!==u?(l=n.jsx(Fe,{asChild:!0,children:n.jsx(At,{asChild:!0,children:n.jsxs(we,{"aria-label":o,active:s.filtersActive,className:i,children:[c,u]})})}),e[5]=i,e[6]=s.filtersActive,e[7]=o,e[8]=u,e[9]=l):l=e[9];let d;e[10]!==a?(d=a("sidebar.taskGroupsList.filterChats"),e[10]=a,e[11]=d):d=e[11];let m;e[12]!==d?(m=n.jsx(Re,{side:"bottom",children:d}),e[12]=d,e[13]=m):m=e[13];let f;e[14]!==l||e[15]!==m?(f=n.jsxs(Oe,{children:[l,m]}),e[14]=l,e[15]=m,e[16]=f):f=e[16];let h;e[17]!==a?(h=a("sidebar.taskGroupsList.filterView"),e[17]=a,e[18]=h):h=e[18];const j=s.groupBy;let k;e[19]!==s?(k=D=>{he("tasks_panel_group_by_changed",{to_value:D}),s.setGroupBy(D)},e[19]=s,e[20]=k):k=e[20];let v;e[21]!==a?(v=a("sidebar.taskGroupsList.viewList"),e[21]=a,e[22]=v):v=e[22];let x;e[23]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(fs,{size:13}),e[23]=x):x=e[23];let g;e[24]!==v?(g={value:"flat",label:v,icon:x},e[24]=v,e[25]=g):g=e[25];let b;e[26]!==a?(b=a("sidebar.taskGroupsList.viewStatus"),e[26]=a,e[27]=b):b=e[27];let y;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ms,{size:13}),e[28]=y):y=e[28];let p;e[29]!==b?(p={value:"status",label:b,icon:y},e[29]=b,e[30]=p):p=e[30];let S;e[31]!==g||e[32]!==p?(S=[g,p],e[31]=g,e[32]=p,e[33]=S):S=e[33];let N;e[34]!==s.groupBy||e[35]!==k||e[36]!==S||e[37]!==h?(N=n.jsx(Ge,{label:h,value:j,onChange:k,options:S}),e[34]=s.groupBy,e[35]=k,e[36]=S,e[37]=h,e[38]=N):N=e[38];let T;e[39]!==a?(T=a("sidebar.taskGroupsList.filterType"),e[39]=a,e[40]=T):T=e[40];const _=s.typeFilter;let w;e[41]!==s?(w=D=>{he("tasks_panel_filter_changed",{to_value:D}),s.setTypeFilter(D)},e[41]=s,e[42]=w):w=e[42];let I;e[43]!==a?(I=a("sidebar.taskGroupsList.typeAll"),e[43]=a,e[44]=I):I=e[44];let P;e[45]!==I?(P={value:"all",label:I},e[45]=I,e[46]=P):P=e[46];let L;e[47]!==a?(L=a("sidebar.taskGroupsList.typeChats"),e[47]=a,e[48]=L):L=e[48];let $;e[49]!==L?($={value:"manual",label:L},e[49]=L,e[50]=$):$=e[50];let E;e[51]!==a?(E=a("sidebar.taskGroupsList.typeAuto"),e[51]=a,e[52]=E):E=e[52];let F;e[53]!==E?(F={value:"automation",label:E},e[53]=E,e[54]=F):F=e[54];let R;e[55]!==P||e[56]!==$||e[57]!==F?(R=[P,$,F],e[55]=P,e[56]=$,e[57]=F,e[58]=R):R=e[58];let M;e[59]!==s.typeFilter||e[60]!==T||e[61]!==w||e[62]!==R?(M=n.jsx(Ge,{label:T,value:_,onChange:w,options:R}),e[59]=s.typeFilter,e[60]=T,e[61]=w,e[62]=R,e[63]=M):M=e[63];let C;e[64]!==a?(C=a("sidebar.taskGroupsList.filterScope"),e[64]=a,e[65]=C):C=e[65];const G=s.showAll?"team":"mine";let z;e[66]!==s?(z=D=>s.setShowAll(D==="team"),e[66]=s,e[67]=z):z=e[67];let H;e[68]!==a?(H=a("sidebar.taskGroupsList.scopeMine"),e[68]=a,e[69]=H):H=e[69];let O;e[70]!==H?(O={value:"mine",label:H},e[70]=H,e[71]=O):O=e[71];let V;e[72]!==a?(V=a("sidebar.taskGroupsList.scopeTeam"),e[72]=a,e[73]=V):V=e[73];let Q;e[74]!==V?(Q={value:"team",label:V},e[74]=V,e[75]=Q):Q=e[75];let Y;e[76]!==O||e[77]!==Q?(Y=[O,Q],e[76]=O,e[77]=Q,e[78]=Y):Y=e[78];let Z;e[79]!==C||e[80]!==G||e[81]!==z||e[82]!==Y?(Z=n.jsx(Ge,{label:C,value:G,onChange:z,options:Y}),e[79]=C,e[80]=G,e[81]=z,e[82]=Y,e[83]=Z):Z=e[83];let q;e[84]!==N||e[85]!==M||e[86]!==Z?(q=n.jsxs(Lt,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[N,M,Z]}),e[84]=N,e[85]=M,e[86]=Z,e[87]=q):q=e[87];let le;return e[88]!==q||e[89]!==f?(le=n.jsxs($t,{children:[f,q]}),e[88]=q,e[89]=f,e[90]=le):le=e[90],le}function ga(t,e){return t.filter(s=>s.id===e||!!s.trigger_id||qs(s))}function ba(){const t=A.c(2),e=Tt()??[];let s;return t[0]!==e?(s=r=>{if(!r)return;const i=e.find(a=>a.id===r);return i?Pt(i.metadata):void 0},t[0]=e,t[1]=s):s=t[1],s}function va(t){const e=A.c(9),{virtualMcpId:s,size:r,showAutomationBadge:i}=t,a=r===void 0?"sm":r,o=K();let c;e[0]!==a||e[1]!==s?(c=s?n.jsx(ya,{virtualMcpId:s,size:a}):n.jsx(ye,{icon:null,name:"?",size:a}),e[0]=a,e[1]=s,e[2]=c):c=e[2];let u;e[3]!==i||e[4]!==o?(u=i&&n.jsx("span",{"aria-label":o("tasksPanel.mcpAvatar.automationTriggered"),className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-special border border-special text-special-foreground",children:n.jsx(Rt,{size:10,className:"text-white"})}),e[3]=i,e[4]=o,e[5]=u):u=e[5];let l;return e[6]!==c||e[7]!==u?(l=n.jsxs("div",{className:"relative shrink-0",children:[c,u]}),e[6]=c,e[7]=u,e[8]=l):l=e[8],l}function ya(t){const e=A.c(6),{virtualMcpId:s,size:r}=t,i=Nt(s);if(!i){let c;return e[0]!==r?(c=n.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=c):c=e[1],c}const a=i.icon??null;let o;return e[2]!==i.title||e[3]!==r||e[4]!==a?(o=n.jsx(ye,{icon:a,name:i.title,size:r}),e[2]=i.title,e[3]=r,e[4]=a,e[5]=o):o=e[5],o}const ct=["thread"];function ja(t){const e=A.c(53),{open:s,onOpenChange:r}=t,[i,a]=B.useState(""),{org:o}=ne(),{setTaskId:c}=Qe(),u=Ie(),l=K();let d,m,f,h;e[0]!==o.id||e[1]!==i?(h=i.trim(),d=h?20:10,f=me,m=fe.globalSearch(o.id,h,d,ct),e[0]=o.id,e[1]=i,e[2]=d,e[3]=m,e[4]=f,e[5]=h):(d=e[2],m=e[3],f=e[4],h=e[5]);let j;e[6]!==d||e[7]!==u||e[8]!==h?(j=async()=>{const C=await u.call("GLOBAL_SEARCH",{query:h,limit:d,types:[...ct]});return{...C,items:C.items.filter(ka)}},e[6]=d,e[7]=u,e[8]=h,e[9]=j):j=e[9];let k;e[10]!==s||e[11]!==m||e[12]!==j?(k={queryKey:m,enabled:s,queryFn:j,staleTime:1e4},e[10]=s,e[11]=m,e[12]=j,e[13]=k):k=e[13];const{data:v,isFetching:x}=f(k);let g;e[14]!==v?.items?(g=v?.items??[],e[14]=v?.items,e[15]=g):g=e[15];const b=g;let y;e[16]!==r?(y=C=>{C||a(""),r(C)},e[16]=r,e[17]=y):y=e[17];const p=y;let S;e[18]!==p||e[19]!==c?(S=C=>{p(!1),c(C.id,C.virtual_mcp_id??void 0)},e[18]=p,e[19]=c,e[20]=S):S=e[20];const N=S;let T;e[21]!==l?(T=l("tasksPanel.globalSearchDialog.title"),e[21]=l,e[22]=T):T=e[22];let _;e[23]!==T?(_=n.jsx(qt,{children:T}),e[23]=T,e[24]=_):_=e[24];let w;e[25]!==l?(w=l("tasksPanel.globalSearchDialog.description"),e[25]=l,e[26]=w):w=e[26];let I;e[27]!==w?(I=n.jsx(Wt,{children:w}),e[27]=w,e[28]=I):I=e[28];let P;e[29]!==I||e[30]!==_?(P=n.jsxs(Yt,{className:"sr-only",children:[_,I]}),e[29]=I,e[30]=_,e[31]=P):P=e[31];let L;e[32]!==l?(L=l("tasksPanel.globalSearchDialog.placeholder"),e[32]=l,e[33]=L):L=e[33];let $;e[34]!==i||e[35]!==L?($=n.jsx(vn,{value:i,onValueChange:a,placeholder:L}),e[34]=i,e[35]=L,e[36]=$):$=e[36];let E;e[37]!==N||e[38]!==x||e[39]!==b||e[40]!==l||e[41]!==h?(E=n.jsx(pn,{children:x&&b.length===0?n.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l("tasksPanel.globalSearchDialog.searching")}):b.length===0?n.jsx(xn,{children:l("tasksPanel.globalSearchDialog.noResults")}):n.jsx(gn,{heading:h?void 0:l("tasksPanel.globalSearchDialog.recent"),children:b.map(C=>C.type==="thread"?n.jsxs(bn,{value:`thread:${C.id}:${C.title}`,onSelect:()=>N(C),className:"gap-2.5",children:[n.jsx(va,{virtualMcpId:C.virtual_mcp_id,size:"xs"}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("div",{className:"text-sm text-foreground truncate",children:C.title||l("tasksPanel.globalSearchDialog.untitledChat")})}),n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(C.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${C.id}`):null)})}),e[37]=N,e[38]=x,e[39]=b,e[40]=l,e[41]=h,e[42]=E):E=e[42];let F;e[43]!==$||e[44]!==E?(F=n.jsxs(yn,{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:[$,E]}),e[43]=$,e[44]=E,e[45]=F):F=e[45];let R;e[46]!==P||e[47]!==F?(R=n.jsxs(Qt,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[P,F]}),e[46]=P,e[47]=F,e[48]=R):R=e[48];let M;return e[49]!==p||e[50]!==s||e[51]!==R?(M=n.jsx(Zt,{open:s,onOpenChange:p,children:R}),e[49]=p,e[50]=s,e[51]=R,e[52]=M):M=e[52],M}function ka(t){return t.type==="thread"}function Sa(t,e,s){if(!s)return;const r=t.findIndex(i=>i.id===e);if(r!==-1){for(let i=r+1;i<t.length;i++){const a=t[i];if(a?.created_by===s)return a}for(let i=r-1;i>=0;i--){const a=t[i];if(a?.created_by===s)return a}}}function Ta(t){return t==="ephemeral"||t.startsWith("thread:")}function zt(t){const e=A.c(45),{task:s,isActive:r,onClick:i,onArchive:a,showAutomationBadge:o,showAgentIcon:c,hideStatusIdle:u,indented:l}=t,d=K(),m=jn(s.status),f=m.icon,h=s.metadata?.kind==="tool_call_run",j=Nt(h?void 0:s.virtual_mcp_id);let k;e[0]!==j?(k=_t(j),e[0]=j,e[1]=k):k=e[1];const v=k;Tn(6e4);const x=o||!!s.trigger_id,g=s.id,b="button",y=0;let p;e[2]!==i?(p=z=>{z.target===z.currentTarget&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),i())},e[2]=i,e[3]=p):p=e[3];const S=l?"-ml-4 pl-6":"pl-[9px]",N=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let T;e[4]!==S||e[5]!==N?(T=ee("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",S,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=S,e[5]=N,e[6]=T):T=e[6];let _;e[7]!==h||e[8]!==c||e[9]!==j?.icon||e[10]!==j?.title?(_=c&&!h&&n.jsx(ye,{icon:j?.icon??null,name:j?.title??"?",size:"2xs"}),e[7]=h,e[8]=c,e[9]=j?.icon,e[10]=j?.title,e[11]=_):_=e[11];let w;e[12]!==x||e[13]!==d?(w=x&&n.jsx(Rt,{size:12,"aria-label":d("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-special"}),e[12]=x,e[13]=d,e[14]=w):w=e[14];let I;e[15]!==d||e[16]!==s.title?(I=s.title||d("tasksPanel.taskRow.untitledTask"),e[15]=d,e[16]=s.title,e[17]=I):I=e[17];let P;e[18]!==I?(P=n.jsx("div",{className:"text-sm text-foreground truncate",children:I}),e[18]=I,e[19]=P):P=e[19];let L;e[20]!==w||e[21]!==P?(L=n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[w,P]}),e[20]=w,e[21]=P,e[22]=L):L=e[22];let $;e[23]!==r||e[24]!==v||e[25]!==s.branch||e[26]!==s.updated_at?($=s.updated_at&&n.jsxs("div",{className:ee("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[s.branch&&!Ta(s.branch)?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate font-mono",children:s.branch}),n.jsx("span",{className:"shrink-0",children:"·"})]}):v?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"truncate",children:[v.owner,"/",v.name]}),n.jsx("span",{className:"shrink-0",children:"·"})]}):null,n.jsx("span",{className:"shrink-0",children:Sn(new Date(s.updated_at))})]}),e[23]=r,e[24]=v,e[25]=s.branch,e[26]=s.updated_at,e[27]=$):$=e[27];let E;e[28]!==L||e[29]!==$?(E=n.jsxs("div",{className:"flex-1 min-w-0",children:[L,$]}),e[28]=L,e[29]=$,e[30]=E):E=e[30];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",R=!u&&n.jsx("span",{className:ee("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",a&&"group-hover/row:opacity-0"),"aria-label":d("tasksPanel.taskRow.statusLabel",{status:d(m.labelKey)}),children:s.status==="in_progress"?n.jsx(ve,{className:ee("size-3.5",m.iconClassName)}):n.jsx(f,{size:14,className:m.iconClassName})});let M;e[31]!==a||e[32]!==d?(M=a&&n.jsxs(Oe,{children:[n.jsx(Fe,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":d("tasksPanel.taskRow.archiveTask"),onClick:z=>{z.stopPropagation(),a()},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 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:n.jsx(Xt,{size:14})})}),n.jsx(Re,{side:"right",children:d("tasksPanel.taskRow.archive")})]}),e[31]=a,e[32]=d,e[33]=M):M=e[33];let C;e[34]!==R||e[35]!==M?(C=n.jsxs("div",{className:F,children:[R,M]}),e[34]=R,e[35]=M,e[36]=C):C=e[36];let G;return e[37]!==i||e[38]!==E||e[39]!==C||e[40]!==p||e[41]!==T||e[42]!==_||e[43]!==s.id?(G=n.jsxs("div",{"data-task-id":g,role:b,tabIndex:y,onClick:i,onKeyDown:p,className:T,children:[_,E,C]}),e[37]=i,e[38]=E,e[39]=C,e[40]=p,e[41]=T,e[42]=_,e[43]=s.id,e[44]=G):G=e[44],G}const dt=["requires_action","in_progress","failed","expired","completed"];function Na(t){const e=new Map(dt.map(s=>[s,[]]));for(const s of t){const r=s.status??"completed";(e.get(r)??e.get("completed")).push(s)}return dt.map(s=>({status:s,threads:e.get(s)}))}const _a="sidebar.group.expanded.";function wa(t,e){const s=A.c(3),[r,i]=xt(`${_a}${t}`,e);let a;return s[0]!==r||s[1]!==i?(a=[r,i],s[0]=r,s[1]=i,s[2]=a):a=s[2],a}function Gt(t){const e=A.c(18),{onClick:s,isFetching:r,indented:i}=t,a=K();let o;e[0]!==a?(o=a("sidebar.showMoreButton.ariaLabel"),e[0]=a,e[1]=o):o=e[1];const c=i?"-ml-4 pl-6 pr-2":"px-2";let u;e[2]!==c?(u=ee("flex items-center gap-2 py-1.5 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 l;e[4]!==r?(l=r&&n.jsx(ve,{className:"size-3.5"}),e[4]=r,e[5]=l):l=e[5];let d;e[6]!==r||e[7]!==a?(d=a(r?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=r,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==d?(m=n.jsx("span",{children:d}),e[9]=d,e[10]=m):m=e[10];let f;return e[11]!==r||e[12]!==s||e[13]!==o||e[14]!==u||e[15]!==l||e[16]!==m?(f=n.jsxs("button",{type:"button","aria-label":o,onClick:s,disabled:r,className:u,children:[l,m]}),e[11]=r,e[12]=s,e[13]=o,e[14]=u,e[15]=l,e[16]=m,e[17]=f):f=e[17],f}function Ca(t,e,s,r){return[t,e,s,r.type,r.member,r.currentUserId??""].join("|")}function Pa(t){return t.member==="mine"&&!t.currentUserId}const Ht=4;let _e=0;const Ke=[];function Ia(){for(;_e<Ht&&Ke.length>0;){const t=Ke.shift();t&&t()}}function Ut(t){return new Promise((e,s)=>{const r=()=>{_e++,t().then(e,s).finally(()=>{_e--,Ia()})};_e<Ht?r():Ke.push(r)})}const Be=10;function ut(t,e,s,r,i){const a={hidden:!1};r.member==="mine"&&r.currentUserId&&(a.created_by=r.currentUserId),r.type==="automation"&&(a.has_trigger=!0),r.type==="manual"&&(a.has_trigger=!1);const o={where:a,limit:i,offset:s,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function Ma(t,e,s,r){let i=0;for(const a of t)Kt(a,e,s,r)&&i++;return i}function He(t,e,s,r){return Ma(t,e,s,r)}function Aa(t,e){return!!(t>=Be||t===0&&e)}function ft(t,e){return t<e}function La(t,e){return e===!1?!1:e===!0?!0:t}function Kt(t,e,s,r){return!(t.hidden||(t.status??"completed")!==s||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Pe=new Map,Ne=new Map;function $a(t,e){return e?t>=Be?!0:null:!1}function mt(t){return Pe.get(t)}function Ea(t,e){Pe.set(t,e)}function Fa(t,e,s){const r=Pe.get(t);if(r!==void 0){s(r);return}let i=Ne.get(t);i||(i=Ut(e).then(a=>(Pe.set(t,a),Ne.delete(t),a)).catch(()=>(Ne.delete(t),Promise.reject(new Error("group probe failed")))),Ne.set(t,i)),i.then(s,()=>s(!1))}function ht(t){const e=t,s=Array.isArray(e.items)?e.items:[];return{items:s,hasMore:e.hasMore??s.length===Be,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Ra(t,e,s,r,i){let a=0;for(const o of t)e.has(o.id)||Kt(o,s,r,i)&&a++;return a}function Oa(t,e,s,r){const i=A.c(8),{org:a}=ne(),o=Ca(a.id,t,e,s);let c;i[0]!==s?(c=Pa(s),i[0]=s,i[1]=c):c=i[1];const u=c,[l,d]=B.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});l.identity!==o&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const m=Ze(),{threads:f,hasMore:h}=Xe(),j=He(f,t,e,s),k=Aa(j,h),v=$a(j,h),x=Ie();if(l.identity===o&&l.serverHasMore===null){const N=v??mt(o);N!==void 0&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:l.probeSubscribedIdentity,serverHasMore:N})}!u&&l.identity===o&&l.serverHasMore===null&&v===null&&mt(o)===void 0&&l.probeSubscribedIdentity!==o&&(d(N=>N.identity===o?{...N,isProbing:!0,probeSubscribedIdentity:o}:N),Fa(o,async()=>{const N=ut(t,e,0,s,1),T=await x.call("COLLECTION_THREADS_LIST",N),{totalCount:_}=ht(T),w=He(m.threads.get(),t,e,s);return _===void 0?!1:ft(w,_)},N=>{d(T=>T.identity!==o?T:{...T,isProbing:!1,serverHasMore:N})}));const b=async function(){if(l.isFetching||l.isProbing||u)return;const T=o;d(_=>_.identity===T?{..._,isFetching:!0}:_);try{const _=He(f,t,e,s),w=ut(t,e,_,s,Be),I=await Ut(()=>x.call("COLLECTION_THREADS_LIST",w)),{items:P,hasMore:L,totalCount:$}=ht(I),E=new Set(f.map(Ba)),F=Ra(P,E,t,e,s),R=_;m.mergeThreads(P),d(M=>{if(M.identity!==T)return M;let C;return $!==void 0?C=ft(R+F,$):C=P.length===0||F===0?!1:L,Ea(T,C),{...M,isFetching:!1,serverHasMore:C}})}catch(_){const w=_,I=w instanceof Error?w.message:String(w);Jt.error(`Could not load more tasks: ${I}`),d(P=>P.identity===T?{...P,isFetching:!1}:P)}},y=l.isFetching||l.isProbing,p=!u&&!y&&La(k,l.serverHasMore);let S;return i[2]!==y||i[3]!==b||i[4]!==p||i[5]!==l.isProbing||i[6]!==l.serverHasMore?(S={hasMore:p,isFetching:y,isProbing:l.isProbing,serverHasMore:l.serverHasMore,loadMore:b},i[2]=y,i[3]=b,i[4]=p,i[5]=l.isProbing,i[6]=l.serverHasMore,i[7]=S):S=i[7],S}function Ba(t){return t.id}function Da(t){const e=A.c(20),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,{isFetching:l,isProbing:d,loadMore:m,hasMore:f,serverHasMore:h}=Oa("status",s,u),[j,k]=B.useState(!1);!j&&r.length===0&&h===!0&&!l&&!d&&(k(!0),queueMicrotask(()=>{m()}));let v;if(e[0]!==i||e[1]!==c||e[2]!==u||e[3]!==o||e[4]!==a||e[5]!==r){let b;e[7]!==i||e[8]!==c||e[9]!==u||e[10]!==o||e[11]!==a?(b=y=>n.jsx(zt,{task:y,isActive:i===y.id,onClick:()=>a(y),onArchive:c&&y.created_by===u.currentUserId?()=>o(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]=o,e[11]=a,e[12]=b):b=e[12],v=r.map(b),e[0]=i,e[1]=c,e[2]=u,e[3]=o,e[4]=a,e[5]=r,e[6]=v}else v=e[6];let x;e[13]!==f||e[14]!==l||e[15]!==m?(x=(f||l)&&n.jsx(Gt,{onClick:()=>{m()},isFetching:l,indented:!0}),e[13]=f,e[14]=l,e[15]=m,e[16]=x):x=e[16];let g;return e[17]!==v||e[18]!==x?(g=n.jsxs(n.Fragment,{children:[v,x]}),e[17]=v,e[18]=x,e[19]=g):g=e[19],g}function za(t){const e=A.c(43),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,l=K(),d=kn[s],m=d.icon,[f,h]=wa(`status-${s}`,!1);let j;e[0]!==f||e[1]!==h?(j=function(){h(!f)},e[0]=f,e[1]=h,e[2]=j):j=e[2];const k=j;let v;e[3]!==d.labelKey||e[4]!==l?(v=l("sidebar.taskGroupsList.toggleStatusGroup",{status:l(d.labelKey)}),e[3]=d.labelKey,e[4]=l,e[5]=v):v=e[5];let x;e[6]!==k?(x=I=>{I.target===I.currentTarget&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),k())},e[6]=k,e[7]=x):x=e[7];let g;e[8]!==m||e[9]!==d.iconClassName?(g=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:n.jsx(m,{size:12,className:d.iconClassName})}),e[8]=m,e[9]=d.iconClassName,e[10]=g):g=e[10];let b;e[11]!==f?(b=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:f?n.jsx(Ye,{size:14}):n.jsx(es,{size:14})}),e[11]=f,e[12]=b):b=e[12];let y;e[13]!==g||e[14]!==b?(y=n.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[g,b]}),e[13]=g,e[14]=b,e[15]=y):y=e[15];let p;e[16]!==d.labelKey||e[17]!==l?(p=l(d.labelKey),e[16]=d.labelKey,e[17]=l,e[18]=p):p=e[18];let S;e[19]!==p?(S=n.jsx("span",{className:"flex-1 truncate",children:p}),e[19]=p,e[20]=S):S=e[20];let N;e[21]!==r.length?(N=n.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:n.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[21]=r.length,e[22]=N):N=e[22];let T;e[23]!==f||e[24]!==k||e[25]!==v||e[26]!==x||e[27]!==y||e[28]!==S||e[29]!==N?(T=n.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":f,"aria-label":v,onClick:k,onKeyDown:x,className:"group/group flex items-center gap-2 px-2 py-1.5 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:[y,S,N]}),e[23]=f,e[24]=k,e[25]=v,e[26]=x,e[27]=y,e[28]=S,e[29]=N,e[30]=T):T=e[30];let _;e[31]!==i||e[32]!==c||e[33]!==f||e[34]!==u||e[35]!==o||e[36]!==a||e[37]!==s||e[38]!==r?(_=f&&n.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:n.jsx(Da,{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u})}),e[31]=i,e[32]=c,e[33]=f,e[34]=u,e[35]=o,e[36]=a,e[37]=s,e[38]=r,e[39]=_):_=e[39];let w;return e[40]!==T||e[41]!==_?(w=n.jsxs("div",{className:"flex flex-col gap-0.5",children:[T,_]}),e[40]=T,e[41]=_,e[42]=w):w=e[42],w}function Ga(t){const e=A.c(41),{threads:s,groupBy:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,filters:c,hasMore:u,isFetchingMore:l,onLoadMore:d,filtersActive:m}=t,f=K();if(s.length===0&&!u&&!l){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(hs,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];let g;e[1]!==m||e[2]!==f?(g=f(m?"sidebar.myThreadsSection.noChatsMatchFilters":"sidebar.myThreadsSection.noChatsYet"),e[1]=m,e[2]=f,e[3]=g):g=e[3];let b;return e[4]!==g?(b=n.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,n.jsx("p",{className:"text-sm",children:g})]}),e[4]=g,e[5]=b):b=e[5],b}const h=s.length>1||u;if(r==="status"){let x;if(e[6]!==i||e[7]!==h||e[8]!==c||e[9]!==o||e[10]!==a||e[11]!==s){let b;e[13]!==i||e[14]!==h||e[15]!==c||e[16]!==o||e[17]!==a?(b=y=>n.jsx(za,{status:y.status,threads:y.threads,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:h,filters:c},y.status),e[13]=i,e[14]=h,e[15]=c,e[16]=o,e[17]=a,e[18]=b):b=e[18],x=Na(s).map(b),e[6]=i,e[7]=h,e[8]=c,e[9]=o,e[10]=a,e[11]=s,e[12]=x}else x=e[12];let g;return e[19]!==x?(g=n.jsx(n.Fragment,{children:x}),e[19]=x,e[20]=g):g=e[20],g}let j;if(e[21]!==i||e[22]!==h||e[23]!==c||e[24]!==o||e[25]!==a||e[26]!==s){let x;e[28]!==i||e[29]!==h||e[30]!==c||e[31]!==o||e[32]!==a?(x=g=>n.jsx(zt,{task:g,isActive:i===g.id,onClick:()=>a(g),onArchive:h&&g.created_by===c.currentUserId?()=>o(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[28]=i,e[29]=h,e[30]=c,e[31]=o,e[32]=a,e[33]=x):x=e[33],j=s.map(x),e[21]=i,e[22]=h,e[23]=c,e[24]=o,e[25]=a,e[26]=s,e[27]=j}else j=e[27];let k;e[34]!==u||e[35]!==l||e[36]!==d?(k=(u||l)&&n.jsx(Gt,{onClick:d,isFetching:l}),e[34]=u,e[35]=l,e[36]=d,e[37]=k):k=e[37];let v;return e[38]!==j||e[39]!==k?(v=n.jsxs(n.Fragment,{children:[j,k]}),e[38]=j,e[39]=k,e[40]=v):v=e[40],v}function Ha(t){const e=A.c(11),{panel:s}=t;let r;return e[0]!==s.activeTaskId||e[1]!==s.archiveTask||e[2]!==s.filters||e[3]!==s.filtersActive||e[4]!==s.groupBy||e[5]!==s.hasMore||e[6]!==s.isFetchingMore||e[7]!==s.loadMore||e[8]!==s.selectTask||e[9]!==s.threads?(r=n.jsx(Ga,{threads:s.threads,groupBy:s.groupBy,activeTaskId:s.activeTaskId,onSelectTask:s.selectTask,onArchiveTask:s.archiveTask,filters:s.filters,hasMore:s.hasMore,isFetchingMore:s.isFetchingMore,onLoadMore:s.loadMore,filtersActive:s.filtersActive}),e[0]=s.activeTaskId,e[1]=s.archiveTask,e[2]=s.filters,e[3]=s.filtersActive,e[4]=s.groupBy,e[5]=s.hasMore,e[6]=s.isFetchingMore,e[7]=s.loadMore,e[8]=s.selectTask,e[9]=s.threads,e[10]=r):r=e[10],r}function Ua(t){const e=A.c(67);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{onNavigate:r}=s,{data:i}=pe.useSession(),a=i?.user?.id,{org:o}=ne();let c;e[2]!==o.id?(c=je(o.id),e[2]=o.id,e[3]=c):c=e[3];const u=c.id,l=ba(),d=St(),{threads:m,hasMore:f,isFetchingMore:h,fetchNextPage:j}=Xe(),k=m.filter(Wa),{hide:v,setScope:x}=Je(),g=Ae(),{setTaskId:b,createNewTask:y}=Qe(),p=Et(),S=et();let N;e[4]!==S||e[5]!==m||e[6]!==p?(N=fn({routeAgentId:p,threadVirtualMcpId:m.find(U=>U.id===S)?.virtual_mcp_id}),e[4]=S,e[5]=m,e[6]=p,e[7]=N):N=e[7];const T=N;let _;e[8]!==r?(_=()=>{r?.()},e[8]=r,e[9]=_):_=e[9];const w=_,I=[...k].sort(qa),[P,L]=B.useState("all"),[$,E]=B.useState("flat"),[F,R]=xt("sidebar-threads-scope-all",!1),[M,C]=B.useState(!1),[G,z]=B.useState(!1);let H;e[10]!==C?(H=()=>{he("tasks_panel_search_opened"),z(!0),C(!0)},e[10]=C,e[11]=H):H=e[11];const O=H,V=a??null;let Q;e[12]!==V||e[13]!==P?(Q={type:P,member:"mine",currentUserId:V},e[12]=V,e[13]=P,e[14]=Q):Q=e[14];const Y=Q,Z={};F||(Z.created_by="me"),x(Z);let q;e[15]!==a?(q=U=>a?U.filter(ue=>ue.created_by===a):[],e[15]=a,e[16]=q):q=e[16];const le=q;let D;e[17]!==P?(D=U=>P==="automation"?U.filter(Va):P==="manual"?U.filter(Ka):U,e[17]=P,e[18]=D):D=e[18];const re=D,X=ga(re(F?I:le(I)),S);let J;e[19]!==S||e[20]!==w||e[21]!==a||e[22]!==v||e[23]!==g||e[24]!==o.slug||e[25]!==b||e[26]!==X?(J=U=>{if(a&&U.created_by&&U.created_by!==a)return;const ue=U.id===S;if(v(U.id),Hs(U.id),!ue)return;const ge=Sa(X,U.id,a);w(),ge?b(ge.id,ge.virtual_mcp_id):g({to:"/$org",params:{org:o.slug}})},e[19]=S,e[20]=w,e[21]=a,e[22]=v,e[23]=g,e[24]=o.slug,e[25]=b,e[26]=X,e[27]=J):J=e[27];const te=J;let ae;e[28]!==w||e[29]!==b?(ae=U=>{w(),b(U.id,U.virtual_mcp_id)},e[28]=w,e[29]=b,e[30]=ae):ae=e[30];const ie=ae;let se;e[31]!==T||e[32]!==S||e[33]!==m||e[34]!==w||e[35]!==y||e[36]!==a||e[37]!==u||e[38]!==l||e[39]!==d||e[40]!==b?(se=()=>{const U=T??u;he("sidebar_new_thread_clicked",{virtual_mcp_id:U}),w();const ue=nn(m,U,a,l(U));if(ue){b(ue.id,ue.virtual_mcp_id);return}const ge=d?null:m.find(Vt=>Vt.id===S)?.branch??null;y(U,ge)},e[31]=T,e[32]=S,e[33]=m,e[34]=w,e[35]=y,e[36]=a,e[37]=u,e[38]=l,e[39]=d,e[40]=b,e[41]=se):se=e[41];const oe=se;let ce;e[42]!==j?(ce=()=>{j()},e[42]=j,e[43]=ce):ce=e[43];const xe=$!=="flat"||P!=="all"||F;let de;e[44]!==G||e[45]!==M||e[46]!==C?(de=G?n.jsx(ja,{open:M,onOpenChange:C}):null,e[44]=G,e[45]=M,e[46]=C,e[47]=de):de=e[47];let Te;return e[48]!==S||e[49]!==te||e[50]!==Y||e[51]!==$||e[52]!==f||e[53]!==h||e[54]!==oe||e[55]!==O||e[56]!==ie||e[57]!==E||e[58]!==R||e[59]!==L||e[60]!==F||e[61]!==ce||e[62]!==xe||e[63]!==de||e[64]!==P||e[65]!==X?(Te={threads:X,activeTaskId:S,filters:Y,hasMore:f,isFetchingMore:h,loadMore:ce,groupBy:$,setGroupBy:E,typeFilter:P,setTypeFilter:L,showAll:F,setShowAll:R,filtersActive:xe,selectTask:ie,archiveTask:te,newThread:oe,openSearch:O,searchDialog:de},e[48]=S,e[49]=te,e[50]=Y,e[51]=$,e[52]=f,e[53]=h,e[54]=oe,e[55]=O,e[56]=ie,e[57]=E,e[58]=R,e[59]=L,e[60]=F,e[61]=ce,e[62]=xe,e[63]=de,e[64]=P,e[65]=X,e[66]=Te):Te=e[66],Te}function Ka(t){return!t.trigger_id}function Va(t){return!!t.trigger_id}function qa(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Wa(t){return!t.hidden}function Ya(){const t=A.c(59),e=K(),[s,r]=B.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={onNavigate:()=>r(!1)},t[0]=i):i=t[0];const a=Ua(i),o=$e()?.activeTask;let c;t[1]!==o?.title||t[2]!==a.activeTaskId||t[3]!==a.threads||t[4]!==e?(c=o?.title||a.threads.find(M=>M.id===a.activeTaskId)?.title||e("tasksPanel.taskRow.untitledTask"),t[1]=o?.title,t[2]=a.activeTaskId,t[3]=a.threads,t[4]=e,t[5]=c):c=t[5];const u=c;let l;t[6]!==a?(l=()=>{r(!1),a.openSearch()},t[6]=a,t[7]=l):l=t[7];const d=l;let m;t[8]!==e?(m=e("chat.threadsMenu.chats"),t[8]=e,t[9]=m):m=t[9];const f=s&&"bg-sidebar-accent";let h;t[10]!==f?(h=ee("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",f),t[10]=f,t[11]=h):h=t[11];let j;t[12]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ps,{size:16,className:"shrink-0"}),t[12]=j):j=t[12];let k;t[13]!==u?(k=n.jsx("span",{className:"truncate max-w-[10rem] font-medium",children:u}),t[13]=u,t[14]=k):k=t[14];let v;t[15]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ye,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[15]=v):v=t[15];let x;t[16]!==m||t[17]!==h||t[18]!==k?(x=n.jsx(Fe,{asChild:!0,children:n.jsx(At,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":m,className:h,children:[j,k,v]})})}),t[16]=m,t[17]=h,t[18]=k,t[19]=x):x=t[19];let g;t[20]!==e?(g=e("chat.threadsMenu.chats"),t[20]=e,t[21]=g):g=t[21];let b;t[22]!==g?(b=n.jsx(Re,{side:"bottom",children:g}),t[22]=g,t[23]=b):b=t[23];let y;t[24]!==b||t[25]!==x?(y=n.jsxs(Oe,{children:[x,b]}),t[24]=b,t[25]=x,t[26]=y):y=t[26];let p;t[27]!==a?(p=n.jsx(xa,{panel:a,className:"size-8"}),t[27]=a,t[28]=p):p=t[28];let S;t[29]!==e?(S=e("sidebar.taskGroupsList.searchChats"),t[29]=e,t[30]=S):S=t[30];let N;t[31]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(xs,{size:16}),t[31]=N):N=t[31];let T;t[32]!==d||t[33]!==S?(T=n.jsx(we,{"aria-label":S,onClick:d,className:"size-8",children:N}),t[32]=d,t[33]=S,t[34]=T):T=t[34];let _;t[35]!==e?(_=e("sidebar.taskGroupsList.newChat"),t[35]=e,t[36]=_):_=t[36];let w;t[37]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(bt,{size:16}),t[37]=w):w=t[37];let I;t[38]!==a.newThread||t[39]!==_?(I=n.jsx(we,{"aria-label":_,onClick:a.newThread,className:"size-8",children:w}),t[38]=a.newThread,t[39]=_,t[40]=I):I=t[40];let P;t[41]!==T||t[42]!==I?(P=n.jsxs("div",{className:"flex items-center gap-0.5",children:[T,I]}),t[41]=T,t[42]=I,t[43]=P):P=t[43];let L;t[44]!==p||t[45]!==P?(L=n.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[p,P]}),t[44]=p,t[45]=P,t[46]=L):L=t[46];let $;t[47]!==a?($=n.jsx("div",{className:"flex max-h-[60vh] min-h-0 flex-col gap-0.5 overflow-y-auto overscroll-contain",children:n.jsx(Ha,{panel:a})}),t[47]=a,t[48]=$):$=t[48];let E;t[49]!==L||t[50]!==$?(E=n.jsxs(Lt,{align:"start",side:"bottom",onOpenAutoFocus:Qa,className:"flex w-80 flex-col gap-2 p-2",children:[L,$]}),t[49]=L,t[50]=$,t[51]=E):E=t[51];let F;t[52]!==s||t[53]!==y||t[54]!==E?(F=n.jsxs($t,{open:s,onOpenChange:r,children:[y,E]}),t[52]=s,t[53]=y,t[54]=E,t[55]=F):F=t[55];let R;return t[56]!==a.searchDialog||t[57]!==F?(R=n.jsxs(n.Fragment,{children:[F,a.searchDialog]}),t[56]=a.searchDialog,t[57]=F,t[58]=R):R=t[58],R}function Qa(t){return t.preventDefault()}function Za(){const t=A.c(20),e=K(),{threads:s}=Xe(),{createNewTask:r}=Qe(),i=Ft(),a=et();let o;t[0]!==a||t[1]!==s?(o=s.find(v=>v.id===a)?.branch??null,t[0]=a,t[1]=s,t[2]=o):o=t[2];const c=o;let u;t[3]!==i||t[4]!==r||t[5]!==c?(u=()=>{r(i,c)},t[3]=i,t[4]=r,t[5]=c,t[6]=u):u=t[6];const l=u;let d;t[7]!==e?(d=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=d):d=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(bt,{size:16}),t[9]=m):m=t[9];let f;t[10]!==l||t[11]!==d?(f=n.jsx(Fe,{asChild:!0,children:n.jsx("button",{type:"button",onClick:l,"aria-label":d,className:"flex shrink-0 items-center 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:m})}),t[10]=l,t[11]=d,t[12]=f):f=t[12];let h;t[13]!==e?(h=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=h):h=t[14];let j;t[15]!==h?(j=n.jsx(Re,{side:"bottom",children:h}),t[15]=h,t[16]=j):j=t[16];let k;return t[17]!==f||t[18]!==j?(k=n.jsxs(Oe,{children:[f,j]}),t[17]=f,t[18]=j,t[19]=k):k=t[19],k}function Xa(t){const e=A.c(18),{virtualMcp:s}=t,r=K(),i=Tt(),{navigateToTask:a}=Nn(),{create:o}=Je(),c=ts(),{org:u}=ne();let l,d;if(e[0]!==i||e[1]!==o||e[2]!==a||e[3]!==u||e[4]!==c||e[5]!==r||e[6]!==s){d=Symbol.for("react.early_return_sentinel");e:{const m=Ws(s,i);if(!m){d=null;break e}const f=m.mode==="dev";let h;e[9]!==o||e[10]!==a||e[11]!==u||e[12]!==c?(h=async b=>{const y=crypto.randomUUID();await Promise.all([o({id:y,virtual_mcp_id:b}).catch(er),Rs(c,u,b).catch(Ja)]),a(y,{virtualMcpId:b})},e[9]=o,e[10]=a,e[11]=u,e[12]=c,e[13]=h):h=e[13];const j=h,k=(b,y,p)=>n.jsxs("button",{type:"button","aria-pressed":y,"aria-label":b,title:b,onClick:()=>{y||j(m.targetId)},className:ee("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg transition-colors",y?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[n.jsx(p,{className:"size-3.5 shrink-0"}),n.jsx("span",{className:"@max-3xl/panel-header:hidden",children:b})]});let v;e[14]!==r?(v=r("devAgent.devAgentControl.develop"),e[14]=r,e[15]=v):v=e[15];const x=k(v,f,gs);let g;e[16]!==r?(g=r("devAgent.devAgentControl.live"),e[16]=r,e[17]=g):g=e[17],l=n.jsxs("div",{className:"inline-flex items-center rounded-lg border border-border bg-muted p-0.5 text-xs font-medium",children:[x,k(g,!f,bs)]})}e[0]=i,e[1]=o,e[2]=a,e[3]=u,e[4]=c,e[5]=r,e[6]=s,e[7]=l,e[8]=d}else l=e[7],d=e[8];return d!==Symbol.for("react.early_return_sentinel")?d:l}function Ja(){}function er(){}function tr(t){const e=A.c(16),{virtualMcpId:s,taskId:r}=t,{openPanel:i}=Ot();let a;e[0]!==r||e[1]!==s?(a={virtualMcpId:s,taskId:r},e[0]=r,e[1]=s,e[2]=a):a=e[2];const{tabs:o,activeTab:c,mainOpen:u}=Bt(a);if(o.length===0)return null;let l;if(e[3]!==c||e[4]!==u||e[5]!==i||e[6]!==o||e[7]!==s){let m;e[9]!==c||e[10]!==u||e[11]!==i||e[12]!==s?(m=f=>{const h=f.id==="automations"?ss({activeTab:c,mainOpen:u}):u&&f.id===c;return n.jsxs(st.Tab,{active:h,onClick:()=>{h||(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:f.id,tab_kind:f.kind,was_active:!1}),i(f.id))},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:f.icon})}),f.title]},f.id)},e[9]=c,e[10]=u,e[11]=i,e[12]=s,e[13]=m):m=e[13],l=o.map(m),e[3]=c,e[4]=u,e[5]=i,e[6]=o,e[7]=s,e[8]=l}else l=e[8];let d;return e[14]!==l?(d=n.jsx(st.Tabs,{"data-tour":Us.surfaceTabs,children:l}),e[14]=l,e[15]=d):d=e[15],d}function sr(t){return{threadId:t.routeThreadId,providerKey:t.routeThreadId??t.fallbackKey}}const Ue="__mobile-main-panel-tab-select__",Ve="main";function nr({tabs:t,activeTab:e,mainOpen:s,t:r}){const i=t.find(o=>o.id===e),a=r("mainPanelTabs.mobileMainPanelTabSelect.mainView");return s?i?.title??a:i?.title??t[0]?.title??a}const ar={kind:"component",Component:vs},rr={kind:"component",Component:ys},ir={kind:"component",Component:js},lr={kind:"component",Component:wn};function or({tabs:t,overlayEnabled:e,t:s}){return[{value:"chat",title:s("mainPanelTabs.mobileMainPanelTabSelect.chat"),icon:ar},...t.length>0?t.map(r=>({value:r.id,title:r.title,icon:r.icon})):[{value:Ve,title:s("mainPanelTabs.mobileMainPanelTabSelect.mainView"),icon:lr}],...e?[{value:"board",title:s("mainPanelTabs.mobileMainPanelTabSelect.tasks"),icon:rr},{value:"files",title:s("mainPanelTabs.mobileMainPanelTabSelect.library"),icon:ir}]:[]]}function cr(t){const e=A.c(53),{virtualMcpId:s,taskId:r}=t,i=K(),a=Ae(),{openPanel:o}=Ot();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const u=ke(c);let l;e[1]!==r||e[2]!==s?(l={virtualMcpId:s,taskId:r},e[1]=r,e[2]=s,e[3]=l):l=e[3];const{tabs:d,activeTab:m,mainOpen:f}=Bt(l),{org:h}=ne(),j=Es();let k;e[4]!==h.id?(k=nt(h.id),e[4]=h.id,e[5]=k):k=e[5];const v=s===k;let x,g,b,y,p,S,N,T,_,w;if(e[6]!==m||e[7]!==f||e[8]!==a||e[9]!==v||e[10]!==o||e[11]!==h.id||e[12]!==u.org||e[13]!==u.taskId||e[14]!==j||e[15]!==i||e[16]!==d||e[17]!==s){y=Symbol.for("react.early_return_sentinel");e:{const L=or({tabs:d,overlayEnabled:!!(u.org&&u.taskId),t:i}),$=f?L.find(O=>O.value===m)?.value??Ve:"chat",E=L.find(O=>O.value===$),F=E?.title??nr({tabs:d,activeTab:m,mainOpen:f,t:i});let R;e[28]!==a?(R=O=>{a({to:".",search:V=>({...V,...Ys(O)}),replace:!0})},e[28]=a,e[29]=R):R=e[29];const M=R;let C;e[30]!==v||e[31]!==o||e[32]!==h.id||e[33]!==j||e[34]!==M||e[35]!==s?(C=O=>{if(O!==Ue){if(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:O,source:"mobile_select"}),Ks({reportsOnly:j,onReportAgent:v,tabId:O})){o(O,{virtualmcpid:nt(h.id),search:fr});return}if(O==="chat"||O===Ve){M(O==="chat"?"chat":"main");return}o(O,{search:ur})}},e[30]=v,e[31]=o,e[32]=h.id,e[33]=j,e[34]=M,e[35]=s,e[36]=C):C=e[36];const G=C,z=L.find(O=>O.value!==$);if(L.length===2&&z){y=n.jsxs("button",{type:"button",onClick:()=>G(z.value),"aria-label":i("mainPanelTabs.mobileMainPanelTabSelect.switchTo",{name:z.title}),className:"flex h-10 min-w-0 max-w-[7.5rem] items-center gap-1.5 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:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:z.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:z.title})]});break e}g=Pn,_=Ue,w=G;let H;e[37]!==i?(H=i("mainPanelTabs.mobileMainPanelTabSelect.view"),e[37]=i,e[38]=H):H=e[38],b=n.jsx(Cn,{"aria-label":H,className:"h-10! w-full min-w-0 max-w-[7.5rem] rounded-lg border-0 bg-transparent px-1.5 text-xs shadow-none [--card-shadow:none]",children:n.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[E&&n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:E.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:F})]})}),x=In,p="end",S="w-56",e[39]!==F?(N=n.jsx(Dt,{value:Ue,disabled:!0,hideCheck:!0,className:"hidden",children:F}),e[39]=F,e[40]=N):N=e[40],T=L.map(dr)}e[6]=m,e[7]=f,e[8]=a,e[9]=v,e[10]=o,e[11]=h.id,e[12]=u.org,e[13]=u.taskId,e[14]=j,e[15]=i,e[16]=d,e[17]=s,e[18]=x,e[19]=g,e[20]=b,e[21]=y,e[22]=p,e[23]=S,e[24]=N,e[25]=T,e[26]=_,e[27]=w}else x=e[18],g=e[19],b=e[20],y=e[21],p=e[22],S=e[23],N=e[24],T=e[25],_=e[26],w=e[27];if(y!==Symbol.for("react.early_return_sentinel"))return y;let I;e[41]!==x||e[42]!==p||e[43]!==S||e[44]!==N||e[45]!==T?(I=n.jsxs(x,{align:p,className:S,children:[N,T]}),e[41]=x,e[42]=p,e[43]=S,e[44]=N,e[45]=T,e[46]=I):I=e[46];let P;return e[47]!==g||e[48]!==b||e[49]!==I||e[50]!==_||e[51]!==w?(P=n.jsxs(g,{value:_,onValueChange:w,children:[b,I]}),e[47]=g,e[48]=b,e[49]=I,e[50]=_,e[51]=w,e[52]=P):P=e[52],P}function dr(t){return n.jsx(Dt,{value:t.value,children:n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:t.icon})}),n.jsx("span",{className:"min-w-0 truncate",children:t.title})]})},t.value)}function ur(t){return{...t,sidepanel:!1}}function fr(t){return{...t,thread:void 0,sidepanel:!1}}function mr(t,e,s){const r=A.c(33),i=Ze(),{locator:a}=ne(),o=B.useSyncExternalStore(i.threads.subscribe,i.threads.get),c=B.useSyncExternalStore(i.threadsStatus.subscribe,i.threadsStatus.get);let u;r[0]!==t||r[1]!==o?(u=t===null?null:o.find(p=>p.id===t&&!p.partial)??null,r[0]=t,r[1]=o,r[2]=u):u=r[2];const l=u,[d,m]=B.useState(void 0),[f,h]=B.useState(t);f!==t&&(h(t),m(void 0));let j,k;r[3]!==d||r[4]!==t||r[5]!==l||r[6]!==i||r[7]!==c.kind?(j=()=>{t!==null&&(l||c.kind!=="loading"&&d===void 0&&(m("pending"),i.fetchThreadIntoSlot(t).then(p=>{m(p)})))},k=[t,l,c.kind,d,i],r[3]=d,r[4]=t,r[5]=l,r[6]=i,r[7]=c.kind,r[8]=j,r[9]=k):(j=r[8],k=r[9]),B.useEffect(j,k);let v;r[10]!==s||r[11]!==a||r[12]!==i||r[13]!==e?(v={mutationFn:async p=>i.create({id:p,virtual_mcp_id:e,...s?{branch:s}:{},...sn(sessionStorage,a,p)})},r[10]=s,r[11]=a,r[12]=i,r[13]=e,r[14]=v):v=r[14];const x=ns(v);let g,b;if(r[15]!==x||r[16]!==d||r[17]!==t||r[18]!==l||r[19]!==c.kind?(g=()=>{t!==null&&(l||d===null&&c.kind!=="loading"&&(x.isPending||x.variables!==t&&x.mutate(t)))},b=[t,l,d,c.kind,x],r[15]=x,r[16]=d,r[17]=t,r[18]=l,r[19]=c.kind,r[20]=g,r[21]=b):(g=r[20],b=r[21]),B.useEffect(g,b),t===null){let p;return r[22]===Symbol.for("react.memo_cache_sentinel")?(p={status:"ready",task:null},r[22]=p):p=r[22],p}if(l){let p;return r[23]!==l?(p={status:"ready",task:l},r[23]=l,r[24]=p):p=r[24],p}if(d&&typeof d=="object"){let p;return r[25]!==d?(p={status:"ready",task:d},r[25]=d,r[26]=p):p=r[26],p}if(x.data){let p;return r[27]!==x.data?(p={status:"ready",task:x.data},r[27]=x.data,r[28]=p):p=r[28],p}if(x.isError){let p;return r[29]!==x.error?(p={status:"error",error:x.error},r[29]=x.error,r[30]=p):p=r[30],p}if(x.isPending||c.kind!=="loading"){let p;return r[31]===Symbol.for("react.memo_cache_sentinel")?(p={status:"creating"},r[31]=p):p=r[31],p}let y;return r[32]===Symbol.for("react.memo_cache_sentinel")?(y={status:"loading"},r[32]=y):y=r[32],y}const hr=50;function pr(t,e){const s=A.c(15),{org:r}=ne(),i=Ie(),{data:a}=pe.useSession(),o=a?.user?.id??"";let c;s[0]!==r.id||s[1]!==o||s[2]!==t?(c=fe.agentEntryThreads(r.id,o,t),s[0]=r.id,s[1]=o,s[2]=t,s[3]=c):c=s[3];const u=e&&!!o;let l;s[4]!==i||s[5]!==t?(l=async()=>{try{return(await i.call("COLLECTION_THREADS_LIST",{limit:hr,offset:0,orderBy:[{field:["updated_at"],direction:"desc"}],where:{hidden:!1,created_by:"me",virtual_mcp_id:t}})).items}catch{return[]}},s[4]=i,s[5]=t,s[6]=l):l=s[6];let d;s[7]!==c||s[8]!==u||s[9]!==l?(d={queryKey:c,enabled:u,staleTime:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,queryFn:l},s[7]=c,s[8]=u,s[9]=l,s[10]=d):d=s[10];const m=me(d);if(!e||!o){let h;return s[11]===Symbol.for("react.memo_cache_sentinel")?(h={status:"idle"},s[11]=h):h=s[11],h}if(!m.data||m.isFetching){let h;return s[12]===Symbol.for("react.memo_cache_sentinel")?(h={status:"loading"},s[12]=h):h=s[12],h}let f;return s[13]!==m.data?(f={status:"ready",threads:m.data},s[13]=m.data,s[14]=f):f=s[14],f}function xr(t){const e=A.c(13),{children:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=ke(r);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const o=Le(a);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={select:gr},e[2]=c):c=e[2];const u=as(c),{org:l}=ne();let d;e[3]!==l||e[4]!==i.agentId||e[5]!==i.legacyView||e[6]!==i.org||e[7]!==u||e[8]!==o?(d=i.org?rs({pathname:u,org:i.org,pathAgentId:i.agentId,pathLegacyView:i.legacyView,fallbackAgentId:je(l.id).id,search:o}):null,e[3]=l,e[4]=i.agentId,e[5]=i.legacyView,e[6]=i.org,e[7]=u,e[8]=o,e[9]=d):d=e[9];const m=d;let f;return e[10]!==s||e[11]!==m?(f=m?n.jsx(tt,{target:m}):s,e[10]=s,e[11]=m,e[12]=f):f=e[12],f}function gr(t){return t.matches.at(-1)?.pathname??t.location.pathname}function br(){const t=A.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=ke(e);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[1]=r):r=t[1];const i=Le(r),{org:a}=ne(),{org:o,taskId:c}=s;if(!o||c===void 0)return null;let u;return t[2]!==o||t[3]!==a.id||t[4]!==i||t[5]!==c?(u=is({org:o,taskId:c,fallbackAgentId:je(a.id).id,search:i}),t[2]=o,t[3]=a.id,t[4]=i,t[5]=c,t[6]=u):u=t[6],u}function vr(){const t=A.c(2),e=br();let s;return t[0]!==e?(s=e?n.jsx(tt,{target:e}):null,t[0]=e,t[1]=s):s=t[1],s}function yr(){const t=A.c(6),e=An(),s=Ae();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{preview:i}=Le(r);if(!e||!i)return null;let a;t[1]!==s?(a=()=>s({to:".",search:jr}),t[1]=s,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=n.jsx(Ln,{previewPath:i,onClose:a,showSeeInLibrary:!0}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function jr(t){const{preview:e,...s}=t;return s}function kr(t){const e=A.c(11),{children:s}=t,r=K();let i;e[0]!==r?(i=r("agentShellLayout.agentShellLayout.chatLoadingError"),e[0]=r,e[1]=i):i=e[1];let a;e[2]!==i?(a=n.jsx("div",{role:"alert",className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:i}),e[2]=i,e[3]=a):a=e[3];let o;e[4]!==s?(o=s??n.jsx(ma,{}),e[4]=s,e[5]=o):o=e[5];let c;e[6]!==o?(c=n.jsx(Me,{children:o}),e[6]=o,e[7]=c):c=e[7];let u;return e[8]!==a||e[9]!==c?(u=n.jsx(pt,{fallback:a,children:c}),e[8]=a,e[9]=c,e[10]=u):u=e[10],u}function Sr(t){const e=A.c(5),{threadId:s,children:r}=t;if(s===null){let a;return e[0]!==r?(a=n.jsx(W.ThreadlessProvider,{children:r}),e[0]=r,e[1]=a):a=e[1],a}let i;return e[2]!==r||e[3]!==s?(i=n.jsx(W.ActiveTaskProvider,{taskId:s,children:r}),e[2]=r,e[3]=s,e[4]=i):i=e[4],i}function Tr(t){const e=A.c(3),{onNewTaskRef:s,createNewTask:r}=t;let i;return e[0]!==r||e[1]!==s?(i=()=>(s.current=r,()=>{s.current=null}),e[0]=r,e[1]=s,e[2]=i):i=e[2],B.useLayoutEffect(i),null}function Nr({virtualMcpId:t,hasActiveRepository:e,sandboxMap:s,children:r}){const i=K(),{currentBranch:a,activeTask:o,setCurrentTaskBranch:c}=Ee(),{data:u}=pe.useSession(),l=u?.user?.id,d=!As(o?.harness_id),m=rn({agentSandboxMap:s,threadSandboxMap:o?.metadata?.sandboxMap,userId:l,ownerId:o?.created_by,branch:a}),f=e||Zs(o?.metadata),h=B.useRef(null),j=d&&ln({threadLoaded:!!o,isOwner:!!l&&o?.created_by===l,hasActiveRepository:f,branch:a??null,attempted:h.current===(o?.id??null)});B.useEffect(()=>{!j||!o||(h.current=o.id,c(Ct(u?.user?.name||u?.user?.email?.split("@")[0])))},[j,o,u,c]);const k=yt(t),v=Se(t),x=It(v,a),{releases:g,createRelease:b}=Xs(t),p=!!l&&o?.created_by===l&&!!a&&a!==x&&!g.some(L=>L.branch===a),S=B.useRef(null);B.useEffect(()=>{!p||!a||S.current!==a&&(S.current=a,b({branch:a,name:en(g,i("thread.branchPicker.defaultVersionName")),color:Js(g.length),createdBy:l,createdAt:new Date().toISOString()}).catch(()=>{}))},[p,a,g,b,l,i]);const N=k.resolved?k.runtime:null,T=on(t,a??void 0),w=(l&&a?En(m?.[l]?.[a]):{})["agent-sandbox"]??null,I=w?.previewUrl??null,P=d&&N!=="cms"&&(!!w||T);return d?N==="cms"?n.jsx(lt,{children:r},`${t}:${a??"no-branch"}:${o?.id??""}`):n.jsx(_s,{virtualMcpId:t,branch:a??null,previewUrl:I,enabled:P,children:n.jsx(cn,{executionEnabled:d,virtualMcpId:t,branch:a??null,userId:l??null,hasActiveRepository:f,vmEntry:w,threadId:o?.id??null,children:n.jsx(lt,{children:r},`${t}:${a??"no-branch"}:${o?.id??""}`)})},o?.id??"no-thread"):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex h-full rounded-[0.75rem] bg-background card-shadow",children:n.jsx(Mt,{image:n.jsx(qe,{size:48,className:"text-muted-foreground"}),title:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWeb"),description:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWebDescription")})})})}function _r(){const t=A.c(16),e=K(),{toggleSidebar:s}=Ts(),{virtualMcpId:r,taskId:i}=Ee();let a;t[0]!==e?(a=e("layouts.shellControls.toggleSidebar"),t[0]=e,t[1]=a):a=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ks,{size:16}),t[2]=o):o=t[2];let c;t[3]!==a||t[4]!==s?(c=n.jsx(we,{className:"md:hidden",onClick:s,"aria-label":a,children:o}),t[3]=a,t[4]=s,t[5]=c):c=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Ya,{}),t[6]=u):u=t[6];let l;t[7]!==c?(l=n.jsxs(De.Topbar.Left,{children:[c,u]}),t[7]=c,t[8]=l):l=t[8];let d;t[9]!==i||t[10]!==r?(d=n.jsx("div",{className:"min-w-0 md:hidden",children:n.jsx(cr,{virtualMcpId:r,taskId:i})}),t[9]=i,t[10]=r,t[11]=d):d=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(De.Topbar.Right,{className:"shrink-0",children:n.jsx(Za,{})}),t[12]=m):m=t[12];let f;return t[13]!==l||t[14]!==d?(f=n.jsxs(De.Topbar,{className:"border-b border-border/60 px-3",children:[l,d,m]}),t[13]=l,t[14]=d,t[15]=f):f=t[15],f}function wr(t){const e=A.c(25),{layout:s,onNewTaskRef:r,createNewTask:i}=t,{virtualMcpId:a,taskId:o}=Ee(),c=Se(a),u=_n()??"overview",l=Ss(),[d,m]=B.useState(null),f=d===u,h=l?f:s.threadOpen;let j;e[0]!==u||e[1]!==s||e[2]!==l||e[3]!==f?(j=l?()=>m(f?null:u):s.toggleThread,e[0]=u,e[1]=s,e[2]=l,e[3]=f,e[4]=j):j=e[4];const k=j;let v;e[5]!==i||e[6]!==r?(v=n.jsx(Tr,{onNewTaskRef:r,createNewTask:i}),e[5]=i,e[6]=r,e[7]=v):v=e[7];let x;e[8]!==o||e[9]!==a?(x=n.jsx(tr,{virtualMcpId:a,taskId:o}),e[8]=o,e[9]=a,e[10]=x):x=e[10];let g;e[11]!==c?(g=c&&n.jsx(Xa,{virtualMcp:c}),e[11]=c,e[12]=g):g=e[12];let b,y;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(it.Thread,{topbar:n.jsx(_r,{}),children:n.jsx(kr,{})}),y=n.jsx(gt,{}),e[13]=b,e[14]=y):(b=e[13],y=e[14]);let p;e[15]!==u||e[16]!==s||e[17]!==x||e[18]!==g||e[19]!==h||e[20]!==k?(p=n.jsxs(it,{...s,threadOpen:h,toggleThread:k,contentKey:u,contentNavigation:x,contentActions:g,children:[b,y]}),e[15]=u,e[16]=s,e[17]=x,e[18]=g,e[19]=h,e[20]=k,e[21]=p):p=e[21];let S;return e[22]!==v||e[23]!==p?(S=n.jsxs(n.Fragment,{children:[v,p]}),e[22]=v,e[23]=p,e[24]=S):S=e[24],S}function Cr(){const t=K(),e=Ae(),s=mn(),{create:r}=Je(),{org:i}=ne(),o=ke({strict:!1}).org??"",c=Le({strict:!1}),u=et(),l=Ft(),d=Et(),[m]=B.useState(()=>crypto.randomUUID()),{data:f}=pe.useSession(),[h]=B.useState(()=>Ct(f?.user?.name||f?.user?.email?.split("@")[0])),j=Ze(),k=B.useSyncExternalStore(j.threads.subscribe,j.threads.get),v=B.useSyncExternalStore(j.threadsStatus.subscribe,j.threadsStatus.get),x=Se(l),g=!!(x&&_t(x)),b=It(x,null),y=u===null&&!!d&&!!x,p=M=>an(M,l,f?.user?.id,Pt(x?.metadata),g,{baseBranch:b}),S=y&&v.kind!=="loading"?p(k):void 0,N=pr(l,y&&v.kind!=="loading"&&!S),T=mr(u,l,h);ha(T.status==="ready"?T.task:null);const _=x?.metadata?.ui?.layout??null,w=_?{defaultMainView:_.defaultMainView??null,chatDefaultOpen:_.chatDefaultOpen??null}:null,I=Qs(w),{threadId:P,providerKey:L}=sr({routeThreadId:u,fallbackKey:m}),$=async()=>{const M=crypto.randomUUID(),C=k.find(G=>G.id===P)?.branch??null;try{await r({id:M,virtual_mcp_id:l,...C?{branch:C}:{}})}catch{}s(M,()=>({}))},E=B.useRef(null);B.useEffect(()=>{const M=C=>{Vs(C)&&C.shiftKey&&C.code==="KeyS"&&!C.repeat&&(C.preventDefault(),E.current?.())};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[]);const F=T.status==="ready"?T.task:null,R=F?.virtual_mcp_id;if(F&&R&&!hn({routeAgentId:l,threadAgentId:R})){const M=ls({org:o,agentId:R,superAgentId:je(i.id).id});return n.jsx(tt,{target:{route:M,search:{thread:F.id,sidepanel:c.sidepanel,mainpanel:c.mainpanel,autosend:c.autosend}}})}if(y){if(v.kind==="loading"||N.status==="loading")return n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.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:[n.jsx(ve,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})});const C=(S??(N.status==="ready"?p(N.threads):void 0))?.id??(g?m:null);if(C)return n.jsx(os,{to:".",replace:!0,search:G=>({...G,thread:C})})}return T.status==="creating"||T.status==="loading"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.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:[n.jsx(ve,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})}):T.status==="error"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.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:[n.jsx("div",{className:"font-medium",children:t("agentShellLayout.agentShellLayout.taskUnavailable")}),n.jsx("div",{className:"text-muted-foreground",children:T.error.message})]})}):x?n.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:n.jsx(W.Provider,{virtualMcpId:l,task:T.status==="ready"?T.task:null,children:n.jsx(Is,{layout:I,children:n.jsx(Nr,{virtualMcpId:l,hasActiveRepository:g,sandboxMap:x.metadata?.sandboxMap,children:n.jsx(Sr,{threadId:P,children:n.jsx(Me,{children:n.jsx(wr,{layout:I,onNewTaskRef:E,createNewTask:$})})},L)})})},l)}):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(Mt,{image:n.jsx(qe,{size:48,className:"text-muted-foreground"}),title:t("agentShellLayout.agentShellLayout.agentNotFound"),description:t("agentShellLayout.agentShellLayout.agentNotFoundDescription",{virtualMcpId:l}),actions:n.jsx(cs,{variant:"outline",onClick:()=>e({to:"/$org",params:{org:o}}),children:t("agentShellLayout.agentShellLayout.goToOrgHome")})})})})}function Io(){const t=A.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=ke(e);if(s.taskId!==void 0){let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(vr,{}),t[1]=i):i=t[1],i}if(s._splat!==void 0){let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(gt,{}),t[2]=i):i=t[2],i}let r;return t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Me,{children:n.jsx(xr,{children:n.jsx(Mn,{children:n.jsxs($n,{children:[n.jsx(Cr,{}),n.jsx(yr,{})]})})})}),t[3]=r):r=t[3],r}export{Io as default};