@openhands/agent-canvas 1.0.0-rc.6 → 1.0.0-rc.8

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 (255) hide show
  1. package/README.md +1 -3
  2. package/README.windows.md +2 -2
  3. package/build/assets/{QueryClientProvider-2bFjjuvv.js → QueryClientProvider-XcSjsfpb.js} +1 -1
  4. package/build/assets/{Trans-D1xHkKyr.js → Trans-sy4l4TyQ.js} +1 -1
  5. package/build/assets/{acp-providers-Djbp2WMV.js → acp-providers-BqUvf67Q.js} +1 -1
  6. package/build/assets/{active-backend-context-BiVlte2V.js → active-backend-context-CNF2lPkA.js} +1 -1
  7. package/build/assets/add-backend-modal-BywVr6uq.js +1 -0
  8. package/build/assets/{agent-server-adapter-BD6kvwWb.js → agent-server-adapter-k8veH-1O.js} +1 -1
  9. package/build/assets/{agent-server-conversation-service.api-8AC86rC5.js → agent-server-conversation-service.api-CGbkhsLj.js} +1 -1
  10. package/build/assets/{agent-settings-DycVwGfd.js → agent-settings-DoHXHcoA.js} +1 -1
  11. package/build/assets/{alert-banner-BUqPui_3.js → alert-banner-Bsvys-hT.js} +1 -1
  12. package/build/assets/{analytics-consent-form-modal-CdP5JRph.js → analytics-consent-form-modal-CVhsAREx.js} +1 -1
  13. package/build/assets/{api-key-entry-screen-BnvQM0v5.js → api-key-entry-screen-Dnr5TcV0.js} +1 -1
  14. package/build/assets/{app-settings-FRYUtG-Z.js → app-settings-Bgm2-yOM.js} +1 -1
  15. package/build/assets/{automation-detail-DiIq3Vsh.js → automation-detail-86M_yMqz.js} +1 -1
  16. package/build/assets/{automations-list-DQn7k1Ix.js → automations-list-BWUILrqY.js} +1 -1
  17. package/build/assets/{back-nav-button-B8eULM4t.js → back-nav-button-D20Avel_.js} +1 -1
  18. package/build/assets/{backend-form-modal-DY3My0us.js → backend-form-modal-Dl29wkF5.js} +1 -1
  19. package/build/assets/{backend-synced-settings-badge-BW2WPX-c.js → backend-synced-settings-badge-Dcd4712m.js} +1 -1
  20. package/build/assets/{base-modal-B_MCb3rx.js → base-modal-DvuGYyu1.js} +1 -1
  21. package/build/assets/{brand-button-B6g_UvEG.js → brand-button-9SOzmqPP.js} +1 -1
  22. package/build/assets/{browser-tab-DVHx54yn.js → browser-tab-bveyJhG9.js} +1 -1
  23. package/build/assets/{chat-send-button-Ce9rK8Vd.js → chat-send-button-BhoO7T0s.js} +1 -1
  24. package/build/assets/{checkmark-BQIxLn5W.js → checkmark--JWAesua.js} +1 -1
  25. package/build/assets/{circle-plus-check-toggle-DRwQ4Z7K.js → circle-plus-check-toggle-AO9DWyDX.js} +1 -1
  26. package/build/assets/{close-HybccyBS.js → close--W-tHn1h.js} +1 -1
  27. package/build/assets/{code-tag-DZCEX2zo.js → code-tag-chmctf4w.js} +1 -1
  28. package/build/assets/{combobox-caret-kEa3kTvf.js → combobox-caret-C9BNHfSu.js} +1 -1
  29. package/build/assets/{condenser-settings-BlbT8YRd.js → condenser-settings-DgQ0rsAf.js} +1 -1
  30. package/build/assets/{confirmation-modal-CG_Fgrny.js → confirmation-modal-Cq3eqvqH.js} +1 -1
  31. package/build/assets/{context-menu-list-item-CvJv3-kq.js → context-menu-list-item-BQU0jZPq.js} +1 -1
  32. package/build/assets/conversation-CayU5Lrr.js +19 -0
  33. package/build/assets/conversation-erinyBqT.js +1 -0
  34. package/build/assets/conversation-panel-DiI4q-8-.js +1 -0
  35. package/build/assets/{conversation-service.api-CngSQhPh.js → conversation-service.api-shHWtFwu.js} +1 -1
  36. package/build/assets/{conversation-tab-empty-state-B5eOSEGv.js → conversation-tab-empty-state-C8tztloo.js} +1 -1
  37. package/build/assets/{copy-D6CyDz2n.js → copy-CdKN5rtJ.js} +1 -1
  38. package/build/assets/{declaration-BDfM67Kl.js → declaration-D9ucT0fq.js} +1 -1
  39. package/build/assets/{device-verify-CAevP6_3.js → device-verify-YuGXnpRk.js} +1 -1
  40. package/build/assets/{dropdown-classes-CL8egwz_.js → dropdown-classes-CVp0kVdt.js} +1 -1
  41. package/build/assets/{edit-automation-modal-CwLfhSMN.js → edit-automation-modal-8y9Uctxo.js} +1 -1
  42. package/build/assets/{ellipsis-button-Db-AwbLv.js → ellipsis-button-k7HLwYth.js} +1 -1
  43. package/build/assets/{entry.client-BKDpKmdB.js → entry.client-D_wtryHT.js} +2 -2
  44. package/build/assets/{enum-filter-dropdown-DnYXhc1E.js → enum-filter-dropdown-COqUq3mB.js} +1 -1
  45. package/build/assets/{environment-switch-overlay-BgYKFdf6.js → environment-switch-overlay-wB5LxfYZ.js} +1 -1
  46. package/build/assets/{extensions-hub-CgisT2wb.js → extensions-hub-CoWO3SzQ.js} +1 -1
  47. package/build/assets/{extensions-navigation-nurGkQe5.js → extensions-navigation-D5w2sFQe.js} +1 -1
  48. package/build/assets/{files-tab-DIyAYvp0.js → files-tab-CxdtgkIe.js} +1 -1
  49. package/build/assets/{files-tab-store-RScGdwu8.js → files-tab-store-DSKUhziI.js} +1 -1
  50. package/build/assets/{folder-IChmji2Y.js → folder-DPTBlxWb.js} +1 -1
  51. package/build/assets/home-3joHMYSR.js +1 -0
  52. package/build/assets/{install-server-modal-C8fylTet.js → install-server-modal-_7l1gcjd.js} +1 -1
  53. package/build/assets/{launch-BNiqgTvz.js → launch-fU77utLO.js} +1 -1
  54. package/build/assets/{lesson-plan-BdmMvboE.js → lesson-plan-CHGc-B8Y.js} +1 -1
  55. package/build/assets/{lightbulb-DzViGAuw.js → lightbulb-S616sGEL.js} +1 -1
  56. package/build/assets/{link-external-Dwv3oQAx.js → link-external-ooNztGLp.js} +1 -1
  57. package/build/assets/llm-not-configured-banner-BMGzpBPV.js +27 -0
  58. package/build/assets/llm-settings-BRotm_g6.js +1 -0
  59. package/build/assets/{llm-settings-B92l1Z2N.js → llm-settings-yDgbXP6Q.js} +1 -1
  60. package/build/assets/{loading-spinner-Dtm7y-w5.js → loading-spinner-D7bOU6I7.js} +1 -1
  61. package/build/assets/{manage-backends-modal-qpq2M_oN.js → manage-backends-modal-tfdzTXWU.js} +1 -1
  62. package/build/assets/{manifest-05156141.js → manifest-bbc1374e.js} +1 -1
  63. package/build/assets/{markdown-renderer-Dt0RXhUJ.js → markdown-renderer-z446oW0Z.js} +1 -1
  64. package/build/assets/{mcp-BKdD21xY.js → mcp-Dopstf0t.js} +1 -1
  65. package/build/assets/{messages-Ch8Rd1cx.js → messages-CsFUrAen.js} +1 -1
  66. package/build/assets/{modal-backdrop-DmDLoot0.js → modal-backdrop-_VbcKk5K.js} +1 -1
  67. package/build/assets/{modal-body-BWjhfiSa.js → modal-body-Cd-PtMHr.js} +1 -1
  68. package/build/assets/{modal-classes-DbJbhQCW.js → modal-classes-CNm4ovfm.js} +1 -1
  69. package/build/assets/{modal-close-button-DXN6uYvt.js → modal-close-button-Dbo0NAMt.js} +1 -1
  70. package/build/assets/{model-selector-BMn4D5v6.js → model-selector-sioC8xP4.js} +1 -1
  71. package/build/assets/{navigation-context-BrRCrWhm.js → navigation-context-BpAOh_t5.js} +1 -1
  72. package/build/assets/{navigation-link-qUrH_I5_.js → navigation-link-Dci7Nuyf.js} +1 -1
  73. package/build/assets/{onboarding-B50IeNyy.js → onboarding-CQh50i2z.js} +1 -1
  74. package/build/assets/{openhands-logo-DnfHAq7Y.js → openhands-logo-Dzm-d_V_.js} +1 -1
  75. package/build/assets/{option-service.api-lzN_3s9w.js → option-service.api-DjPvPAtd.js} +1 -1
  76. package/build/assets/{organization-service.api-CNmSPGj4.js → organization-service.api-BNc9Kn6n.js} +1 -1
  77. package/build/assets/{path-utils-CKgIQZAY.js → path-utils-YlkpoImJ.js} +1 -1
  78. package/build/assets/{plan-components-D9fU4FFh.js → plan-components-CutRBi0G.js} +1 -1
  79. package/build/assets/{planner-tab-B7kpsTT8.js → planner-tab-DjIFIQDk.js} +1 -1
  80. package/build/assets/{providers-189W9TJO.js → providers-BiWSYwRT.js} +1 -1
  81. package/build/assets/{query-client-config-B9ZI-1_w.js → query-client-config-Ca3tW1AH.js} +1 -1
  82. package/build/assets/{recommended-automations-launcher-C_RcP2yb.js → recommended-automations-launcher-DCi0RXIj.js} +1 -1
  83. package/build/assets/{root-CFnl2e43.js → root-DrHpnAqU.js} +2 -2
  84. package/build/assets/{root-layout-BQGwrist.js → root-layout-Cf7FC9DC.js} +2 -2
  85. package/build/assets/{runtime-waiting-state-DPjfE32a.js → runtime-waiting-state-8i0Z3A_i.js} +1 -1
  86. package/build/assets/{sdk-section-page-ozvrzW4r.js → sdk-section-page-COlGKv4E.js} +1 -1
  87. package/build/assets/{sdk-settings-schema-Ck6f2ON9.js → sdk-settings-schema-Big50zDH.js} +1 -1
  88. package/build/assets/{search-aDWSdSb7.js → search-C_l_XW4e.js} +1 -1
  89. package/build/assets/{secrets-settings-Bga0bwB1.js → secrets-settings-DYfTc5c8.js} +1 -1
  90. package/build/assets/{settings-DHAhcPm2.js → settings-DRmVFdOc.js} +1 -1
  91. package/build/assets/{settings-dropdown-input-N0FtDFkk.js → settings-dropdown-input-BP-arqjU.js} +1 -1
  92. package/build/assets/{settings-gear-D8ao16bi.js → settings-gear-f-zWpxfI.js} +1 -1
  93. package/build/assets/{settings-index-CJvQH5ls.js → settings-index-B035V2pu.js} +1 -1
  94. package/build/assets/{settings-input-CyWJBrqC.js → settings-input-BM8ANxDb.js} +1 -1
  95. package/build/assets/{settings-list-classes-CYRnRf8r.js → settings-list-classes-B9uo5WES.js} +1 -1
  96. package/build/assets/{settings-modal-BeAlR7Be.js → settings-modal-CeRvS5Bc.js} +1 -1
  97. package/build/assets/{settings-section-header-context-1fN7Xkb3.js → settings-section-header-context-Cid25HM2.js} +1 -1
  98. package/build/assets/{settings-switch-D3aEIphL.js → settings-switch-xa6q4M6j.js} +1 -1
  99. package/build/assets/{shared-conversation-CtRf6CQN.js → shared-conversation-CBbpyPaD.js} +1 -1
  100. package/build/assets/{sidebar-mobile-menu-toggle-DkYaKR6Q.js → sidebar-mobile-menu-toggle-SKcwsEtD.js} +1 -1
  101. package/build/assets/{sidebar-nav-link-CzeuB4So.js → sidebar-nav-link-CPWuQ_c6.js} +1 -1
  102. package/build/assets/{skill-card-pill-row-CvLCLqqD.js → skill-card-pill-row-DeodrwPG.js} +1 -1
  103. package/build/assets/{skills-jKeJCunm.js → skills-BE5HJuGM.js} +1 -1
  104. package/build/assets/{skills-plugins-juwPhlEE.js → skills-plugins-Dc4ec3CW.js} +1 -1
  105. package/build/assets/{skills-settings-BW09n_Px.js → skills-settings-B6HwvA0S.js} +1 -1
  106. package/build/assets/{styled-tooltip-B3wz8m5E.js → styled-tooltip-X61SEwqk.js} +1 -1
  107. package/build/assets/{suspense-BpkWt-39.js → suspense-Bqb0V0q1.js} +1 -1
  108. package/build/assets/{switch-skeleton-Cl_Nh2kt.js → switch-skeleton-BbIWemkK.js} +1 -1
  109. package/build/assets/{task-list-tab-DKnHShLG.js → task-list-tab-BFnyHGsn.js} +1 -1
  110. package/build/assets/{telemetry-Ca_YAGcO.js → telemetry-DCFAqpIA.js} +1 -1
  111. package/build/assets/{terminal-BFi5FOMc.js → terminal-B92mACR5.js} +1 -1
  112. package/build/assets/{terminal-CZH2h1J3.js → terminal-CltMeLv4.js} +1 -1
  113. package/build/assets/{toggle-switch-BzaEofjj.js → toggle-switch-CL_wRiGs.js} +1 -1
  114. package/build/assets/{typography-BFj4IzMj.js → typography-BLSEGjph.js} +1 -1
  115. package/build/assets/{u-check-circle-Cs2GOrZ7.js → u-check-circle-dG_VJqx5.js} +1 -1
  116. package/build/assets/{u-check-circle-half-DGgLKVV1.js → u-check-circle-half-D-5ZPRnd.js} +1 -1
  117. package/build/assets/{u-circuit-DniZPNAV.js → u-circuit-BXoisXOA.js} +1 -1
  118. package/build/assets/{u-edit-BvTiDr33.js → u-edit-DIgADxLH.js} +1 -1
  119. package/build/assets/{use-acp-credential-form-8yHKY_py.js → use-acp-credential-form-LjCIhMSK.js} +1 -1
  120. package/build/assets/{use-active-conversation-CLzls6XV.js → use-active-conversation-B0_rXnqa.js} +1 -1
  121. package/build/assets/{use-agent-settings-schema-BCXxH2N-.js → use-agent-settings-schema-D8x5LJVS.js} +1 -1
  122. package/build/assets/{use-agent-state-BocVPR5S.js → use-agent-state-BuOzLeFN.js} +1 -1
  123. package/build/assets/{use-cloud-current-user-id-BjDwnldw.js → use-cloud-current-user-id-DVZXa_WH.js} +1 -1
  124. package/build/assets/use-config-5zEjywCL.js +1 -0
  125. package/build/assets/{use-create-conversation-CIkPp9u9.js → use-create-conversation-pV2eA-e9.js} +1 -1
  126. package/build/assets/{use-create-secret-Bwy6457V.js → use-create-secret-ClPpLBgD.js} +1 -1
  127. package/build/assets/{use-handle-plan-click-CjNwpDeO.js → use-handle-plan-click-CwN_nNib.js} +1 -1
  128. package/build/assets/use-is-authed-B8eLO-Xq.js +1 -0
  129. package/build/assets/{use-launch-skill-in-chat-QmcJQxUY.js → use-launch-skill-in-chat-BTgXIu3N.js} +1 -1
  130. package/build/assets/{use-llm-profiles-CZD1ALup.js → use-llm-profiles-CWLfWjav.js} +1 -1
  131. package/build/assets/use-runtime-is-ready-Bbory9-s.js +1 -0
  132. package/build/assets/{use-save-settings-BjYPOrtF.js → use-save-settings-Xp8DD-jf.js} +1 -1
  133. package/build/assets/{use-settings-YTDcMvj1.js → use-settings-0SeqaDeW.js} +1 -1
  134. package/build/assets/{use-settings-nav-items-DMit9adK.js → use-settings-nav-items-DVrMNk0I.js} +1 -1
  135. package/build/assets/{use-skills-fh_U4ZGe.js → use-skills-Bv8LXrys.js} +1 -1
  136. package/build/assets/{use-tracking-DJ3Z7ha1.js → use-tracking-BhyV5A9i.js} +1 -1
  137. package/build/assets/{use-user-conversation-Ct93yaXj.js → use-user-conversation-6yFVEXiG.js} +1 -1
  138. package/build/assets/{useMutation-B1gQr_yr.js → useMutation-Dm84WAKR.js} +1 -1
  139. package/build/assets/{useQuery-CbqdITLM.js → useQuery-DGRSm7IT.js} +1 -1
  140. package/build/assets/{useTranslation-C-T8J2U-.js → useTranslation-CL6FTf1b.js} +1 -1
  141. package/build/assets/{utils-CXRkUr73.js → utils-eXk6yerZ.js} +1 -1
  142. package/build/assets/{vendor~conversation-panel~conversation-CkFCLbQW.js → vendor~conversation-panel~conversation-D98u43rl.js} +1 -1
  143. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-C1BmvJX4.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dqpi2xyZ.js} +1 -1
  144. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-RuHTcYaf.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-7eqKdLSQ.js} +1 -1
  145. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-B04AZhMW.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-BP3MGAAY.js} +1 -1
  146. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ceijy54y-D7ZsdcLa.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ceijy54y-Dkd2wxJA.js} +1 -1
  147. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~mcp~automati~dou5smdo-DH07jaIY.js → vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~mcp~automati~dou5smdo-DavKsAvB.js} +186 -40
  148. package/build/assets/{vendor~root-layout~home~mcp~automations-list-COlx7Is6.js → vendor~root-layout~home~mcp~automations-list-D40jgugf.js} +1 -1
  149. package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-DuiHR4ce.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BIm99UaF.js} +1 -1
  150. package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-4yr76Evz.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-xCM3k6Rd.js} +1 -1
  151. package/build/assets/{verification-settings-CeIuPtF2.js → verification-settings-Be6NxjuT.js} +1 -1
  152. package/build/assets/{x-mark-BMhi11Sg.js → x-mark-C42svtnu.js} +1 -1
  153. package/build/index.html +4 -4
  154. package/build/locales/ar/openhands.json +45 -40
  155. package/build/locales/ca/openhands.json +41 -36
  156. package/build/locales/de/openhands.json +42 -37
  157. package/build/locales/en/openhands.json +6 -1
  158. package/build/locales/es/openhands.json +44 -39
  159. package/build/locales/fr/openhands.json +44 -39
  160. package/build/locales/it/openhands.json +44 -39
  161. package/build/locales/ja/openhands.json +44 -39
  162. package/build/locales/ko-KR/openhands.json +44 -39
  163. package/build/locales/no/openhands.json +44 -39
  164. package/build/locales/pt/openhands.json +44 -39
  165. package/build/locales/tr/openhands.json +43 -38
  166. package/build/locales/uk/openhands.json +44 -39
  167. package/build/locales/zh-CN/openhands.json +44 -39
  168. package/build/locales/zh-TW/openhands.json +44 -39
  169. package/config/defaults.json +9 -4
  170. package/dist/components/features/backends/backend-form-modal.cjs +1 -1
  171. package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
  172. package/dist/components/features/backends/backend-form-modal.js +1 -1
  173. package/dist/components/features/backends/backend-form-modal.js.map +1 -1
  174. package/dist/components/features/chat/chat-interface.cjs +1 -1
  175. package/dist/components/features/chat/chat-interface.cjs.map +1 -1
  176. package/dist/components/features/chat/chat-interface.js +1 -1
  177. package/dist/components/features/chat/chat-interface.js.map +1 -1
  178. package/dist/components/features/chat/git-control-bar.cjs +1 -1
  179. package/dist/components/features/chat/git-control-bar.cjs.map +1 -1
  180. package/dist/components/features/chat/git-control-bar.js +1 -1
  181. package/dist/components/features/chat/git-control-bar.js.map +1 -1
  182. package/dist/components/features/chat/open-repository-modal.cjs +1 -1
  183. package/dist/components/features/chat/open-repository-modal.cjs.map +1 -1
  184. package/dist/components/features/chat/open-repository-modal.js +0 -3
  185. package/dist/components/features/chat/open-repository-modal.js.map +1 -1
  186. package/dist/components/features/chat/pending-user-messages.cjs +1 -1
  187. package/dist/components/features/chat/pending-user-messages.cjs.map +1 -1
  188. package/dist/components/features/chat/pending-user-messages.js +31 -28
  189. package/dist/components/features/chat/pending-user-messages.js.map +1 -1
  190. package/dist/components/features/home/git-branch-dropdown/git-branch-dropdown.cjs +1 -1
  191. package/dist/components/features/home/git-branch-dropdown/git-branch-dropdown.cjs.map +1 -1
  192. package/dist/components/features/home/git-branch-dropdown/git-branch-dropdown.js +79 -77
  193. package/dist/components/features/home/git-branch-dropdown/git-branch-dropdown.js.map +1 -1
  194. package/dist/components/features/home/git-provider-dropdown/git-provider-dropdown.cjs +1 -1
  195. package/dist/components/features/home/git-provider-dropdown/git-provider-dropdown.cjs.map +1 -1
  196. package/dist/components/features/home/git-provider-dropdown/git-provider-dropdown.js +67 -65
  197. package/dist/components/features/home/git-provider-dropdown/git-provider-dropdown.js.map +1 -1
  198. package/dist/components/features/home/git-repo-dropdown/git-repo-dropdown.cjs +1 -1
  199. package/dist/components/features/home/git-repo-dropdown/git-repo-dropdown.cjs.map +1 -1
  200. package/dist/components/features/home/git-repo-dropdown/git-repo-dropdown.js +2 -2
  201. package/dist/components/features/home/git-repo-dropdown/git-repo-dropdown.js.map +1 -1
  202. package/dist/components/features/settings/settings-navigation.cjs +1 -1
  203. package/dist/components/features/settings/settings-navigation.cjs.map +1 -1
  204. package/dist/components/features/settings/settings-navigation.js +1 -1
  205. package/dist/components/features/settings/settings-navigation.js.map +1 -1
  206. package/dist/components/features/sidebar/sidebar.cjs +1 -1
  207. package/dist/components/features/sidebar/sidebar.cjs.map +1 -1
  208. package/dist/components/features/sidebar/sidebar.js +3 -2
  209. package/dist/components/features/sidebar/sidebar.js.map +1 -1
  210. package/dist/i18n/declaration.cjs +1 -1
  211. package/dist/i18n/declaration.cjs.map +1 -1
  212. package/dist/i18n/declaration.d.ts +6 -1
  213. package/dist/i18n/declaration.js +1 -1
  214. package/dist/i18n/declaration.js.map +1 -1
  215. package/dist/i18n/translation.cjs +3 -3
  216. package/dist/i18n/translation.cjs.map +1 -1
  217. package/dist/i18n/translation.js +612 -527
  218. package/dist/i18n/translation.js.map +1 -1
  219. package/dist/locales/ar/openhands.json +45 -40
  220. package/dist/locales/ca/openhands.json +41 -36
  221. package/dist/locales/de/openhands.json +42 -37
  222. package/dist/locales/en/openhands.json +6 -1
  223. package/dist/locales/es/openhands.json +44 -39
  224. package/dist/locales/fr/openhands.json +44 -39
  225. package/dist/locales/it/openhands.json +44 -39
  226. package/dist/locales/ja/openhands.json +44 -39
  227. package/dist/locales/ko-KR/openhands.json +44 -39
  228. package/dist/locales/no/openhands.json +44 -39
  229. package/dist/locales/pt/openhands.json +44 -39
  230. package/dist/locales/tr/openhands.json +43 -38
  231. package/dist/locales/uk/openhands.json +44 -39
  232. package/dist/locales/zh-CN/openhands.json +44 -39
  233. package/dist/locales/zh-TW/openhands.json +44 -39
  234. package/dist/node_modules/@openhands/extensions/skills/index.cjs +186 -40
  235. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  236. package/dist/node_modules/@openhands/extensions/skills/index.js +2 -2
  237. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  238. package/dist/package.cjs +1 -1
  239. package/dist/package.cjs.map +1 -1
  240. package/dist/package.js +2 -2
  241. package/dist/package.js.map +1 -1
  242. package/package.json +2 -2
  243. package/scripts/check-sdk-version-sync.mjs +6 -6
  244. package/scripts/check-translation-completeness.cjs +149 -59
  245. package/scripts/dev-safe.mjs +1 -1
  246. package/build/assets/add-backend-modal-CSfOPrnr.js +0 -1
  247. package/build/assets/conversation-B7ztPdyS.js +0 -1
  248. package/build/assets/conversation-DZYd8QiZ.js +0 -19
  249. package/build/assets/conversation-panel-CklMXcs6.js +0 -1
  250. package/build/assets/home-iVOrSOWL.js +0 -1
  251. package/build/assets/llm-not-configured-banner-BQgVTo0O.js +0 -27
  252. package/build/assets/llm-settings-ICWFhhjM.js +0 -1
  253. package/build/assets/use-config-C4DX1-nF.js +0 -1
  254. package/build/assets/use-is-authed-7P3xSsit.js +0 -1
  255. package/build/assets/use-runtime-is-ready-B7sbw-q5.js +0 -1
@@ -1 +1 @@
1
- import{i as e,r as t}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js";import{u as n}from"./suspense-BpkWt-39.js";import{n as r}from"./useQuery-CbqdITLM.js";import{t as i}from"./createLucideIcon-CkGTf9Qj.js";import{a,n as o}from"./agent-server-client-options-B-C8JaTb.js";import{o as s,r as c,t as l}from"./agent-server-conversation-service.api-8AC86rC5.js";var u=class extends n{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(n,r){let{state:i}=n,a=super.createResult(n,r),{isFetching:o,isRefetching:s,isError:c,isRefetchError:l}=a,u=i.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=o&&u===`forward`,p=c&&u===`backward`,m=o&&u===`backward`;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:t(r,i.data),hasPreviousPage:e(r,i.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:s&&!f&&!m}}};function d(e,t){return r(e,u,t)}var f=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),p=async e=>{let t=(await l.batchGetAppConversations([e]))[0];if(!t)throw Error(`V1 conversation not found: ${e}`);return{conversationUrl:t.conversation_url,sessionApiKey:t.session_api_key,sandboxId:t.sandbox_id}},m=async e=>{let{conversationUrl:t,sessionApiKey:n,sandboxId:r}=await p(e);if(a().backend.kind===`cloud`){if(!r)throw Error(`Cannot stop runtime: cloud conversation ${e} has no sandbox_id.`);return await c(r),{success:!0}}return new s(o({conversationUrl:t,sessionApiKey:n})).interruptConversation(e)},h=async(e,t)=>{let{conversationUrl:n,sessionApiKey:r}=await p(e);return new s(o({conversationUrl:n,sessionApiKey:r})).askAgent(e,t)},g=async e=>{let{conversationUrl:t,sessionApiKey:n}=await p(e);return new s(o({conversationUrl:t,sessionApiKey:n})).runConversation(e)},_=(e,t,n)=>{e.setQueriesData({queryKey:[`user`,`conversation`,t]},e=>e&&{...e,...n}),e.setQueriesData({queryKey:[`user`,`conversations`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?{...e,...n}:e)}))})},v=(e,t,n)=>_(e,t,{execution_status:n}),y=(e,t,n)=>_(e,t,{llm_model:n}),b=(e,t)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,t]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]}),e.invalidateQueries({queryKey:[`unified`,`vscode_url`]})},x=e=>{let t=e.match(/^\/workspace\/[^/]+\/(.*)$/);return t?t[1]:e},S=e=>{let t=e.trim();if(!t)return``;let n=t.replace(/[\\/]+$/,``);if(!n||/^[A-Za-z]:$/.test(n))return``;let r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`));return r>=0?n.slice(r+1):n};export{_ as a,v as c,d,b as i,y as l,x as n,m as o,h as r,g as s,S as t,f as u};
1
+ import{i as e,r as t}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js";import{u as n}from"./suspense-Bqb0V0q1.js";import{n as r}from"./useQuery-DGRSm7IT.js";import{t as i}from"./createLucideIcon-CkGTf9Qj.js";import{a,n as o}from"./agent-server-client-options-B-C8JaTb.js";import{o as s,r as c,t as l}from"./agent-server-conversation-service.api-CGbkhsLj.js";var u=class extends n{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(n,r){let{state:i}=n,a=super.createResult(n,r),{isFetching:o,isRefetching:s,isError:c,isRefetchError:l}=a,u=i.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=o&&u===`forward`,p=c&&u===`backward`,m=o&&u===`backward`;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:t(r,i.data),hasPreviousPage:e(r,i.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:s&&!f&&!m}}};function d(e,t){return r(e,u,t)}var f=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),p=async e=>{let t=(await l.batchGetAppConversations([e]))[0];if(!t)throw Error(`V1 conversation not found: ${e}`);return{conversationUrl:t.conversation_url,sessionApiKey:t.session_api_key,sandboxId:t.sandbox_id}},m=async e=>{let{conversationUrl:t,sessionApiKey:n,sandboxId:r}=await p(e);if(a().backend.kind===`cloud`){if(!r)throw Error(`Cannot stop runtime: cloud conversation ${e} has no sandbox_id.`);return await c(r),{success:!0}}return new s(o({conversationUrl:t,sessionApiKey:n})).interruptConversation(e)},h=async(e,t)=>{let{conversationUrl:n,sessionApiKey:r}=await p(e);return new s(o({conversationUrl:n,sessionApiKey:r})).askAgent(e,t)},g=async e=>{let{conversationUrl:t,sessionApiKey:n}=await p(e);return new s(o({conversationUrl:t,sessionApiKey:n})).runConversation(e)},_=(e,t,n)=>{e.setQueriesData({queryKey:[`user`,`conversation`,t]},e=>e&&{...e,...n}),e.setQueriesData({queryKey:[`user`,`conversations`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?{...e,...n}:e)}))})},v=(e,t,n)=>_(e,t,{execution_status:n}),y=(e,t,n)=>_(e,t,{llm_model:n}),b=(e,t)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,t]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]}),e.invalidateQueries({queryKey:[`unified`,`vscode_url`]})},x=e=>{let t=e.match(/^\/workspace\/[^/]+\/(.*)$/);return t?t[1]:e},S=e=>{let t=e.trim();if(!t)return``;let n=t.replace(/[\\/]+$/,``);if(!n||/^[A-Za-z]:$/.test(n))return``;let r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`));return r>=0?n.slice(r+1):n};export{_ as a,v as c,d,b as i,y as l,x as n,m as o,h as r,g as s,S as t,f as u};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n}from"./declaration-BDfM67Kl.js";import{t as r}from"./utils-CXRkUr73.js";var i=e(t(),1);function a(e){let[t,n]=(0,i.useState)(!0),[r,a]=(0,i.useState)(!0),o=(0,i.useRef)(0),s=(0,i.useCallback)(e=>e.scrollTop+e.clientHeight>=e.scrollHeight-20,[]),c=(0,i.useCallback)(e=>{let t=s(e);a(t);let r=e.scrollTop,i=r<o.current;o.current=r,i&&n(!1),t&&n(!0)},[s]);return{scrollRef:e,autoScroll:t,setAutoScroll:n,scrollDomToBottom:(0,i.useCallback)(()=>{let t=e.current;t&&requestAnimationFrame(()=>{n(!0),a(!0),t.scrollTop=t.scrollHeight})},[e]),hitBottom:r,setHitBottom:a,onChatBodyScroll:c}}var o=n();function s(e){return{h1:({children:t,className:n})=>(0,o.jsx)(`h1`,{className:r(`text-lg text-white font-bold leading-6 mb-1.5 mt-3 first:mt-0`,n,e),children:t}),h2:({children:t,className:n})=>(0,o.jsx)(`h2`,{className:r(`text-base font-semibold leading-5 text-white mb-1 mt-2.5 first:mt-0`,n,e),children:t}),h3:({children:t,className:n})=>(0,o.jsx)(`h3`,{className:r(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h4:({children:t,className:n})=>(0,o.jsx)(`h4`,{className:r(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h5:({children:t,className:n})=>(0,o.jsx)(`h5`,{className:r(`text-xs font-semibold text-white mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),h6:({children:t,className:n})=>(0,o.jsx)(`h6`,{className:r(`text-xs font-medium text-[var(--oh-text-tertiary)] mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),p:({children:t,className:n})=>(0,o.jsx)(`p`,{className:r(`py-2.5 first:pt-0 last:pb-0`,n,e),children:t}),ul:({children:t,className:n})=>(0,o.jsx)(`ul`,{className:r(`list-disc ml-5 pl-2 whitespace-normal`,n,e),children:t}),ol:({children:t,className:n,start:i})=>(0,o.jsx)(`ol`,{className:r(`list-decimal ml-5 pl-2 whitespace-normal`,n,e),start:i,children:t}),li:({children:t,className:n})=>(0,o.jsx)(`li`,{className:r(n,e),children:t}),a:({children:t,className:n,href:i})=>(0,o.jsx)(`a`,{className:r(`text-blue-500 hover:underline`,n,e),href:i,target:`_blank`,rel:`noopener noreferrer`,children:t}),code:({children:t,className:n})=>(0,o.jsx)(`code`,{className:r(`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 rounded text-[var(--oh-foreground)] border border-[var(--oh-border-subtle)]`,n,e),children:t})}}var c=s();export{c as n,a as r,s as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n}from"./declaration-D9ucT0fq.js";import{t as r}from"./utils-eXk6yerZ.js";var i=e(t(),1);function a(e){let[t,n]=(0,i.useState)(!0),[r,a]=(0,i.useState)(!0),o=(0,i.useRef)(0),s=(0,i.useCallback)(e=>e.scrollTop+e.clientHeight>=e.scrollHeight-20,[]),c=(0,i.useCallback)(e=>{let t=s(e);a(t);let r=e.scrollTop,i=r<o.current;o.current=r,i&&n(!1),t&&n(!0)},[s]);return{scrollRef:e,autoScroll:t,setAutoScroll:n,scrollDomToBottom:(0,i.useCallback)(()=>{let t=e.current;t&&requestAnimationFrame(()=>{n(!0),a(!0),t.scrollTop=t.scrollHeight})},[e]),hitBottom:r,setHitBottom:a,onChatBodyScroll:c}}var o=n();function s(e){return{h1:({children:t,className:n})=>(0,o.jsx)(`h1`,{className:r(`text-lg text-white font-bold leading-6 mb-1.5 mt-3 first:mt-0`,n,e),children:t}),h2:({children:t,className:n})=>(0,o.jsx)(`h2`,{className:r(`text-base font-semibold leading-5 text-white mb-1 mt-2.5 first:mt-0`,n,e),children:t}),h3:({children:t,className:n})=>(0,o.jsx)(`h3`,{className:r(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h4:({children:t,className:n})=>(0,o.jsx)(`h4`,{className:r(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h5:({children:t,className:n})=>(0,o.jsx)(`h5`,{className:r(`text-xs font-semibold text-white mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),h6:({children:t,className:n})=>(0,o.jsx)(`h6`,{className:r(`text-xs font-medium text-[var(--oh-text-tertiary)] mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),p:({children:t,className:n})=>(0,o.jsx)(`p`,{className:r(`py-2.5 first:pt-0 last:pb-0`,n,e),children:t}),ul:({children:t,className:n})=>(0,o.jsx)(`ul`,{className:r(`list-disc ml-5 pl-2 whitespace-normal`,n,e),children:t}),ol:({children:t,className:n,start:i})=>(0,o.jsx)(`ol`,{className:r(`list-decimal ml-5 pl-2 whitespace-normal`,n,e),start:i,children:t}),li:({children:t,className:n})=>(0,o.jsx)(`li`,{className:r(n,e),children:t}),a:({children:t,className:n,href:i})=>(0,o.jsx)(`a`,{className:r(`text-blue-500 hover:underline`,n,e),href:i,target:`_blank`,rel:`noopener noreferrer`,children:t}),code:({children:t,className:n})=>(0,o.jsx)(`code`,{className:r(`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 rounded text-[var(--oh-foreground)] border border-[var(--oh-border-subtle)]`,n,e),children:t})}}var c=s();export{c as n,a as r,s as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-BDfM67Kl.js";import{t as i}from"./useTranslation-C-T8J2U-.js";import{t as a}from"./list-todo-nCa9zxVE.js";import{t as o}from"./brand-button-B6g_UvEG.js";import{t as s}from"./conversation-store-FQmakEd-.js";import{t as c}from"./use-handle-plan-click-CjNwpDeO.js";import{t as l}from"./markdown-renderer-Dt0RXhUJ.js";import{n as u,r as d}from"./plan-components-D9fU4FFh.js";import{t as f}from"./conversation-tab-empty-state-B5eOSEGv.js";var p=e(t(),1),m=n();function h(){let{t:e}=i(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:h,scrollDomToBottom:g}=d(p.useRef(null)),{planContent:_,conversationMode:v}=s();p.useEffect(()=>{h&&g()},[_,h,g]);let y=v===`plan`,{handlePlanClick:b}=c();return _==null?(0,m.jsx)(f,{icon:(0,m.jsx)(a,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),action:(0,m.jsx)(o,{type:`button`,variant:`secondary`,onClick:b,isDisabled:y,className:`min-w-40 justify-center px-6`,children:e(r.COMMON$CREATE_A_PLAN)}),children:e(r.PLANNER$EMPTY_MESSAGE)}):(0,m.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,m.jsx)(l,{includeStandard:!0,components:u,children:_})})}export{h as default};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-D9ucT0fq.js";import{t as i}from"./useTranslation-CL6FTf1b.js";import{t as a}from"./list-todo-nCa9zxVE.js";import{t as o}from"./brand-button-9SOzmqPP.js";import{t as s}from"./conversation-store-FQmakEd-.js";import{t as c}from"./use-handle-plan-click-CwN_nNib.js";import{t as l}from"./markdown-renderer-z446oW0Z.js";import{n as u,r as d}from"./plan-components-CutRBi0G.js";import{t as f}from"./conversation-tab-empty-state-C8tztloo.js";var p=e(t(),1),m=n();function h(){let{t:e}=i(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:h,scrollDomToBottom:g}=d(p.useRef(null)),{planContent:_,conversationMode:v}=s();p.useEffect(()=>{h&&g()},[_,h,g]);let y=v===`plan`,{handlePlanClick:b}=c();return _==null?(0,m.jsx)(f,{icon:(0,m.jsx)(a,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),action:(0,m.jsx)(o,{type:`button`,variant:`secondary`,onClick:b,isDisabled:y,className:`min-w-40 justify-center px-6`,children:e(r.COMMON$CREATE_A_PLAN)}),children:e(r.PLANNER$EMPTY_MESSAGE)}):(0,m.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,m.jsx)(l,{includeStandard:!0,components:u,children:_})})}export{h as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n}from"./declaration-BDfM67Kl.js";import{n as r,t as i}from"./QueryClientProvider-2bFjjuvv.js";import{t as a}from"./context-CI9FqkUp.js";import{S as o,a as s,b as c,n as l,t as u,v as d,y as f}from"./query-client-config-B9ZI-1_w.js";import{t as p}from"./utils-CXRkUr73.js";import{i as m,s as h,t as g}from"./active-backend-context-BiVlte2V.js";import{t as _}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BmOMM-6e.js";import{t as v}from"./option-service.api-lzN_3s9w.js";import{n as y,t as b}from"./agent-server-ui-style-scope-BwIZYdC1.js";var x=e(t());function S({i18n:e,defaultNS:t,children:n}){let r=(0,x.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,x.createElement)(a.Provider,{value:r},n)}var C=n(),w=`posthog_bootstrap`;function T(){let e=window.location.hash.substring(1),t=new URLSearchParams(e),n=t.get(`distinct_id`),r=t.get(`session_id`);if(n&&r){let e={distinctID:n,sessionID:r};return sessionStorage.setItem(w,JSON.stringify(e)),window.history.replaceState(null,``,window.location.pathname+window.location.search),e}let i=sessionStorage.getItem(w);if(i)return sessionStorage.removeItem(w),JSON.parse(i)}function E({children:e}){let t=r(),[n,i]=x.useState(null),[a,o]=x.useState(!0),s=x.useMemo(()=>T(),[]);return x.useEffect(()=>{(async()=>{try{i((await t.fetchQuery({queryKey:h.WEB_CLIENT_CONFIG,queryFn:v.getConfig,meta:{disableToast:!0},...m})).posthog_client_key)}catch{}finally{o(!1)}})()},[t]),a||!n?e:(0,C.jsx)(_,{apiKey:n,options:{api_host:`https://us.i.posthog.com`,person_profiles:`identified_only`,bootstrap:s},children:e})}function D({children:e,theme:t=y,className:n,style:r,styleOverrides:i,contentClassName:a,...o}){let s=x.useMemo(()=>({...b,...i,...r}),[r,i]);return(0,C.jsx)(`div`,{"data-agent-server-ui":``,...o,className:n,style:s,children:(0,C.jsx)(`div`,{className:p(t,a,`text-foreground`),"data-theme":t,children:e})})}var O={provider:`posthog`};function k({children:e,queryClient:t,analytics:n,i18n:r,className:a,contentClassName:p,style:m,styleOverrides:h,theme:_,withStyleRoot:v=!0}){let y=x.useMemo(()=>t??u(),[t]),b=x.useMemo(()=>r??f(),[r]),w=x.useRef(null);w.current||={queryClient:l(),i18n:c()},s(y),o(b),x.useEffect(()=>()=>{w.current&&(s(w.current.queryClient),o(w.current.i18n))},[]);let T=n&&n.provider===`posthog`?(0,C.jsx)(E,{children:e}):e;return(0,C.jsx)(S,{i18n:b,defaultNS:d,children:(0,C.jsx)(i,{client:y,children:(0,C.jsx)(g,{children:v?(0,C.jsx)(D,{className:a,contentClassName:p,style:m,styleOverrides:h,theme:_,children:T}):T})})})}export{O as n,D as r,k as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n}from"./declaration-D9ucT0fq.js";import{n as r,t as i}from"./QueryClientProvider-XcSjsfpb.js";import{t as a}from"./context-CI9FqkUp.js";import{S as o,a as s,b as c,n as l,t as u,v as d,y as f}from"./query-client-config-Ca3tW1AH.js";import{t as p}from"./utils-eXk6yerZ.js";import{i as m,s as h,t as g}from"./active-backend-context-CNF2lPkA.js";import{t as _}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BmOMM-6e.js";import{t as v}from"./option-service.api-DjPvPAtd.js";import{n as y,t as b}from"./agent-server-ui-style-scope-BwIZYdC1.js";var x=e(t());function S({i18n:e,defaultNS:t,children:n}){let r=(0,x.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,x.createElement)(a.Provider,{value:r},n)}var C=n(),w=`posthog_bootstrap`;function T(){let e=window.location.hash.substring(1),t=new URLSearchParams(e),n=t.get(`distinct_id`),r=t.get(`session_id`);if(n&&r){let e={distinctID:n,sessionID:r};return sessionStorage.setItem(w,JSON.stringify(e)),window.history.replaceState(null,``,window.location.pathname+window.location.search),e}let i=sessionStorage.getItem(w);if(i)return sessionStorage.removeItem(w),JSON.parse(i)}function E({children:e}){let t=r(),[n,i]=x.useState(null),[a,o]=x.useState(!0),s=x.useMemo(()=>T(),[]);return x.useEffect(()=>{(async()=>{try{i((await t.fetchQuery({queryKey:h.WEB_CLIENT_CONFIG,queryFn:v.getConfig,meta:{disableToast:!0},...m})).posthog_client_key)}catch{}finally{o(!1)}})()},[t]),a||!n?e:(0,C.jsx)(_,{apiKey:n,options:{api_host:`https://us.i.posthog.com`,person_profiles:`identified_only`,bootstrap:s},children:e})}function D({children:e,theme:t=y,className:n,style:r,styleOverrides:i,contentClassName:a,...o}){let s=x.useMemo(()=>({...b,...i,...r}),[r,i]);return(0,C.jsx)(`div`,{"data-agent-server-ui":``,...o,className:n,style:s,children:(0,C.jsx)(`div`,{className:p(t,a,`text-foreground`),"data-theme":t,children:e})})}var O={provider:`posthog`};function k({children:e,queryClient:t,analytics:n,i18n:r,className:a,contentClassName:p,style:m,styleOverrides:h,theme:_,withStyleRoot:v=!0}){let y=x.useMemo(()=>t??u(),[t]),b=x.useMemo(()=>r??f(),[r]),w=x.useRef(null);w.current||={queryClient:l(),i18n:c()},s(y),o(b),x.useEffect(()=>()=>{w.current&&(s(w.current.queryClient),o(w.current.i18n))},[]);let T=n&&n.provider===`posthog`?(0,C.jsx)(E,{children:e}):e;return(0,C.jsx)(S,{i18n:b,defaultNS:d,children:(0,C.jsx)(i,{client:y,children:(0,C.jsx)(g,{children:v?(0,C.jsx)(D,{className:a,contentClassName:p,style:m,styleOverrides:h,theme:_,children:T}):T})})})}export{O as n,D as r,k as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./rolldown-runtime-BFRubm34.js";import{t as n}from"./react-CM_dJw1Z.js";import{a as r,c as i,i as a,l as o,n as s,o as ee,r as te,u as ne}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js";import{n as c,o as l,t as u}from"./declaration-BDfM67Kl.js";import{P as re,t as ie}from"./utils-CXRkUr73.js";var d=`openhands`,f=[{label:`English`,value:`en`},{label:`日本語`,value:`ja`},{label:`简体中文`,value:`zh-CN`},{label:`繁體中文`,value:`zh-TW`},{label:`한국어`,value:`ko-KR`},{label:`Norsk`,value:`no`},{label:`Arabic`,value:`ar`},{label:`Deutsch`,value:`de`},{label:`Français`,value:`fr`},{label:`Italiano`,value:`it`},{label:`Português`,value:`pt`},{label:`Español`,value:`es`},{label:`Català`,value:`ca`},{label:`Türkçe`,value:`tr`},{label:`Українська`,value:`uk`}],p=new WeakMap,ae=e=>{if(!p.has(e)){let t=e.use(r).use(a).use(c).init({fallbackLng:`en`,debug:!1,supportedLngs:f.map(e=>e.value),nonExplicitSupportedLngs:!1,ns:[d],defaultNS:d,fallbackNS:d,backend:{loadPath:`/locales/{{lng}}/{{ns}}.json`},interpolation:{escapeValue:!1}});p.set(e,t)}return e},m=()=>ae(ee()),h=null,g=null,_=()=>(h||=m(),h),v=()=>g??_(),oe=e=>(g=e??_(),g),se=async(e=_())=>(await p.get(e),e),y=e=>e?typeof e==`object`&&!Array.isArray(e)?{ns:d,...e}:e:{ns:d},b=new Proxy({},{get:(e,t)=>{let n=v();if(t===`t`)return(e,t)=>n.t(e,y(t));if(t===`exists`)return(e,t)=>n.exists(e,y(t));let r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=v();return Reflect.set(r,t,n,r)}}),x=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`error`in e.response.data&&typeof e.response?.data?.error==`string`,S=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`message`in e.response.data&&typeof e.response?.data?.message==`string`,C=e=>{let t=null;return t=x(e)&&e.response?.data.error?e.response?.data.error:S(e)&&e.response?.data.message?e.response?.data.message:e.message,t},w=e(n(),1),T=(e,t=5e3,n=1e4)=>{if(!e)return t;let r=e.length/(1e3/60)*1e3*1.5;return Math.min(Math.max(r,t),n)},E=l(),D={background:`var(--oh-color-tertiary)`,border:`1px solid var(--oh-border-input)`,color:`#fff`,borderRadius:`var(--oh-radius)`,maxWidth:`400px`,wordBreak:`break-word`,overflowWrap:`anywhere`,whiteSpace:`pre-wrap`},O={position:`top-right`,style:D},ce={...D,color:`var(--oh-muted)`};function le({message:e}){let t=w.useRef(null),[n,r]=w.useState(!1);return w.useLayoutEffect(()=>{let e=t.current;if(!e)return;let n=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);if(!Number.isFinite(t)||t<=0){r(!1);return}r(e.getBoundingClientRect().height>t*1.5)};n();let i=new ResizeObserver(n);return i.observe(e),()=>i.disconnect()},[e]),(0,E.jsxs)(`div`,{className:ie(`flex min-w-0 gap-2`,n?`items-start`:`items-center`),children:[(0,E.jsx)(te,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:re}}),(0,E.jsx)(`span`,{ref:t,className:`min-w-0 flex-1 text-sm leading-5 [word-break:break-word] [overflow-wrap:anywhere]`,children:e})]})}var k={...O,icon:null,style:ce},A=e=>{let t=e||b.t(u.STATUS$ERROR),n=T(t,4e3);s((0,E.jsx)(le,{message:t}),{...k,duration:n})},j=e=>{let t=T(e,5e3);s.success((0,E.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...O,duration:t})},M=e=>{let t=T(e,6e3);s((0,E.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...O,icon:`⚠️`,duration:t})},N=`openhands-backend-health`,P=500;function F(e){if(typeof e!=`object`||!e)return!1;let t=e;return Number.isInteger(t.consecutiveFailures)&&t.consecutiveFailures>=0&&t.consecutiveFailures<=5&&(t.lastError===null||typeof t.lastError==`string`)&&(t.lastFailureAt===null||typeof t.lastFailureAt==`number`)&&typeof t.disabled==`boolean`}function I(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(N);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof e==`string`&&e.length>0&&F(r)&&(n[e]=r);return n}catch{return{}}}function L(e){if(!(typeof window>`u`))try{if(Object.keys(e).length===0){window.localStorage.removeItem(N);return}window.localStorage.setItem(N,JSON.stringify(e))}catch{}}function R(e){let t;return t=e instanceof Error?e.message||e.name||`Unknown error`:typeof e==`string`?e:`Unknown error`,t.length>P?`${t.slice(0,P)}…`:t}var z=I(),B=new Set;function V(){B.forEach(e=>e())}function H(e){z=e,L(e),V()}function U(){return z}function ue(e){return B.add(e),()=>{B.delete(e)}}function de(e,t){let n=z[e],r=Math.min((n?.consecutiveFailures??0)+1,5),i=n?.disabled===!0||r>=5,a={consecutiveFailures:r,lastError:R(t),lastFailureAt:Date.now(),disabled:i};H({...z,[e]:a})}function W(e){if(!(e in z))return;let{[e]:t,...n}=z;H(n)}function fe(e){if(!(e in z))return;let{[e]:t,...n}=z;H(n)}function pe(e){if(!(e in z))return;let{[e]:t,...n}=z;H(n)}var me=t({createAgentServerQueryClient:()=>q,getDefaultQueryClient:()=>X,getQueryClient:()=>Z,queryClient:()=>$,setQueryClient:()=>Q}),G=(e,t)=>{(e?.response?.status===401||e?.status===401)&&t.invalidateQueries({queryKey:[`user`,`authenticated`]})},K=new Set,q=()=>{let e=new i({queryCache:new o({onSuccess:(e,t)=>{let n=t.meta?.backendId??t.options.meta?.backendId;typeof n==`string`&&W(n)},onError:(t,n)=>{if(n.queryKey[0]===`user`&&n.queryKey[1]===`authenticated`||G(t,e),!(n.meta?.disableToast??n.options.meta?.disableToast)){let e=C(t);K.has(e||``)||(A(e||b.t(u.ERROR$GENERIC)),K.add(e||``),setTimeout(()=>{K.delete(e||``)},3e3))}}}),mutationCache:new ne({onError:(t,n,r,i)=>{G(t,e),(i?.meta?.disableToast??i?.options.meta?.disableToast)||A(C(t)||b.t(u.ERROR$GENERIC))}})});return e},J=null,Y=null,X=()=>(J||=q(),J),Z=()=>Y??X(),Q=e=>(Y=e??X(),Y),$=new Proxy({},{get:(e,t)=>{let n=Z(),r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=Z();return Reflect.set(r,t,n,r)}});export{se as C,oe as S,f as _,Q as a,v as b,de as c,ue as d,O as f,C as g,M as h,me as i,W as l,j as m,Z as n,pe as o,A as p,$ as r,U as s,X as t,fe as u,d as v,b as x,_ as y};
1
+ import{a as e,r as t}from"./rolldown-runtime-BFRubm34.js";import{t as n}from"./react-CM_dJw1Z.js";import{a as r,c as i,i as a,l as o,n as s,o as ee,r as te,u as ne}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js";import{n as c,o as l,t as u}from"./declaration-D9ucT0fq.js";import{P as re,t as ie}from"./utils-eXk6yerZ.js";var d=`openhands`,f=[{label:`English`,value:`en`},{label:`日本語`,value:`ja`},{label:`简体中文`,value:`zh-CN`},{label:`繁體中文`,value:`zh-TW`},{label:`한국어`,value:`ko-KR`},{label:`Norsk`,value:`no`},{label:`Arabic`,value:`ar`},{label:`Deutsch`,value:`de`},{label:`Français`,value:`fr`},{label:`Italiano`,value:`it`},{label:`Português`,value:`pt`},{label:`Español`,value:`es`},{label:`Català`,value:`ca`},{label:`Türkçe`,value:`tr`},{label:`Українська`,value:`uk`}],p=new WeakMap,ae=e=>{if(!p.has(e)){let t=e.use(r).use(a).use(c).init({fallbackLng:`en`,debug:!1,supportedLngs:f.map(e=>e.value),nonExplicitSupportedLngs:!1,ns:[d],defaultNS:d,fallbackNS:d,backend:{loadPath:`/locales/{{lng}}/{{ns}}.json`},interpolation:{escapeValue:!1}});p.set(e,t)}return e},m=()=>ae(ee()),h=null,g=null,_=()=>(h||=m(),h),v=()=>g??_(),oe=e=>(g=e??_(),g),se=async(e=_())=>(await p.get(e),e),y=e=>e?typeof e==`object`&&!Array.isArray(e)?{ns:d,...e}:e:{ns:d},b=new Proxy({},{get:(e,t)=>{let n=v();if(t===`t`)return(e,t)=>n.t(e,y(t));if(t===`exists`)return(e,t)=>n.exists(e,y(t));let r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=v();return Reflect.set(r,t,n,r)}}),x=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`error`in e.response.data&&typeof e.response?.data?.error==`string`,S=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`message`in e.response.data&&typeof e.response?.data?.message==`string`,C=e=>{let t=null;return t=x(e)&&e.response?.data.error?e.response?.data.error:S(e)&&e.response?.data.message?e.response?.data.message:e.message,t},w=e(n(),1),T=(e,t=5e3,n=1e4)=>{if(!e)return t;let r=e.length/(1e3/60)*1e3*1.5;return Math.min(Math.max(r,t),n)},E=l(),D={background:`var(--oh-color-tertiary)`,border:`1px solid var(--oh-border-input)`,color:`#fff`,borderRadius:`var(--oh-radius)`,maxWidth:`400px`,wordBreak:`break-word`,overflowWrap:`anywhere`,whiteSpace:`pre-wrap`},O={position:`top-right`,style:D},ce={...D,color:`var(--oh-muted)`};function le({message:e}){let t=w.useRef(null),[n,r]=w.useState(!1);return w.useLayoutEffect(()=>{let e=t.current;if(!e)return;let n=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);if(!Number.isFinite(t)||t<=0){r(!1);return}r(e.getBoundingClientRect().height>t*1.5)};n();let i=new ResizeObserver(n);return i.observe(e),()=>i.disconnect()},[e]),(0,E.jsxs)(`div`,{className:ie(`flex min-w-0 gap-2`,n?`items-start`:`items-center`),children:[(0,E.jsx)(te,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:re}}),(0,E.jsx)(`span`,{ref:t,className:`min-w-0 flex-1 text-sm leading-5 [word-break:break-word] [overflow-wrap:anywhere]`,children:e})]})}var k={...O,icon:null,style:ce},A=e=>{let t=e||b.t(u.STATUS$ERROR),n=T(t,4e3);s((0,E.jsx)(le,{message:t}),{...k,duration:n})},j=e=>{let t=T(e,5e3);s.success((0,E.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...O,duration:t})},M=e=>{let t=T(e,6e3);s((0,E.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...O,icon:`⚠️`,duration:t})},N=`openhands-backend-health`,P=500;function F(e){if(typeof e!=`object`||!e)return!1;let t=e;return Number.isInteger(t.consecutiveFailures)&&t.consecutiveFailures>=0&&t.consecutiveFailures<=5&&(t.lastError===null||typeof t.lastError==`string`)&&(t.lastFailureAt===null||typeof t.lastFailureAt==`number`)&&typeof t.disabled==`boolean`}function I(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(N);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof e==`string`&&e.length>0&&F(r)&&(n[e]=r);return n}catch{return{}}}function L(e){if(!(typeof window>`u`))try{if(Object.keys(e).length===0){window.localStorage.removeItem(N);return}window.localStorage.setItem(N,JSON.stringify(e))}catch{}}function R(e){let t;return t=e instanceof Error?e.message||e.name||`Unknown error`:typeof e==`string`?e:`Unknown error`,t.length>P?`${t.slice(0,P)}…`:t}var z=I(),B=new Set;function V(){B.forEach(e=>e())}function H(e){z=e,L(e),V()}function U(){return z}function ue(e){return B.add(e),()=>{B.delete(e)}}function de(e,t){let n=z[e],r=Math.min((n?.consecutiveFailures??0)+1,5),i=n?.disabled===!0||r>=5,a={consecutiveFailures:r,lastError:R(t),lastFailureAt:Date.now(),disabled:i};H({...z,[e]:a})}function W(e){if(!(e in z))return;let{[e]:t,...n}=z;H(n)}function fe(e){if(!(e in z))return;let{[e]:t,...n}=z;H(n)}function pe(e){if(!(e in z))return;let{[e]:t,...n}=z;H(n)}var me=t({createAgentServerQueryClient:()=>q,getDefaultQueryClient:()=>X,getQueryClient:()=>Z,queryClient:()=>$,setQueryClient:()=>Q}),G=(e,t)=>{(e?.response?.status===401||e?.status===401)&&t.invalidateQueries({queryKey:[`user`,`authenticated`]})},K=new Set,q=()=>{let e=new i({queryCache:new o({onSuccess:(e,t)=>{let n=t.meta?.backendId??t.options.meta?.backendId;typeof n==`string`&&W(n)},onError:(t,n)=>{if(n.queryKey[0]===`user`&&n.queryKey[1]===`authenticated`||G(t,e),!(n.meta?.disableToast??n.options.meta?.disableToast)){let e=C(t);K.has(e||``)||(A(e||b.t(u.ERROR$GENERIC)),K.add(e||``),setTimeout(()=>{K.delete(e||``)},3e3))}}}),mutationCache:new ne({onError:(t,n,r,i)=>{G(t,e),(i?.meta?.disableToast??i?.options.meta?.disableToast)||A(C(t)||b.t(u.ERROR$GENERIC))}})});return e},J=null,Y=null,X=()=>(J||=q(),J),Z=()=>Y??X(),Q=e=>(Y=e??X(),Y),$=new Proxy({},{get:(e,t)=>{let n=Z(),r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=Z();return Reflect.set(r,t,n,r)}});export{se as C,oe as S,f as _,Q as a,v as b,de as c,ue as d,O as f,C as g,M as h,me as i,W as l,j as m,Z as n,pe as o,A as p,$ as r,U as s,X as t,fe as u,d as v,b as x,_ as y};
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{b as n,c as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js";import{o as i,t as a}from"./declaration-BDfM67Kl.js";import{n as o}from"./QueryClientProvider-2bFjjuvv.js";import{t as s}from"./useTranslation-C-T8J2U-.js";import{r as c}from"./vendor~root-layout~home~mcp~automations-list-COlx7Is6.js";import{t as l}from"./circle-plus-check-toggle-DRwQ4Z7K.js";import{t as u}from"./utils-CXRkUr73.js";import{n as d}from"./active-backend-context-BiVlte2V.js";import{n as f}from"./navigation-context-BrRCrWhm.js";import{t as p}from"./conversation-store-FQmakEd-.js";import{a as m,o as h}from"./conversation-local-storage-an3MiIiJ.js";import{i as g,r as _}from"./use-settings-YTDcMvj1.js";import{t as v}from"./use-tracking-DJ3Z7ha1.js";import{t as y}from"./use-create-conversation-CIkPp9u9.js";import{i as b,n as x,r as S,t as C}from"./extension-module-card-classes-DP5J6ngE.js";import{f as w,i as T,l as E,m as D,o as O,t as k,u as A}from"./install-server-modal-C8fylTet.js";import{n as j}from"./skill-card-pill-row-CvLCLqqD.js";var M=e(t(),1);function N(e,t){let n=o(t);return F({filters:{...e,status:`pending`}},n).length}function P(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function F(e={},t){let i=o(t).getMutationCache(),a=M.useRef(e),s=M.useRef(null);return s.current===null&&(s.current=P(i,e)),M.useEffect(()=>{a.current=e}),M.useSyncExternalStore(M.useCallback(e=>i.subscribe(()=>{let t=n(s.current,P(i,a.current));s.current!==t&&(s.current=t,r.schedule(e))}),[i]),()=>s.current,()=>s.current)}var I=()=>{let e=f(),t=N({mutationKey:[`create-conversation`]}),{isNavigating:n}=e;return t>0||n},L=[{id:`github-pr-reviewer`,name:`GitHub Code Review Agent`,category:`Code review`,description:`Watch pull requests, inspect the diff, and leave a concise review with risks and suggested follow-ups.`,requiredIntegrationIds:[`github`],popularityRank:100,estimatedSetupMinutes:4,prompt:`/pr-reviewer:setup`,exampleImplementation:`Trigger: github.pull_request.opened and github.pull_request.synchronize
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{b as n,c as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js";import{o as i,t as a}from"./declaration-D9ucT0fq.js";import{n as o}from"./QueryClientProvider-XcSjsfpb.js";import{t as s}from"./useTranslation-CL6FTf1b.js";import{r as c}from"./vendor~root-layout~home~mcp~automations-list-D40jgugf.js";import{t as l}from"./circle-plus-check-toggle-AO9DWyDX.js";import{t as u}from"./utils-eXk6yerZ.js";import{n as d}from"./active-backend-context-CNF2lPkA.js";import{n as f}from"./navigation-context-BpAOh_t5.js";import{t as p}from"./conversation-store-FQmakEd-.js";import{a as m,o as h}from"./conversation-local-storage-an3MiIiJ.js";import{i as g,r as _}from"./use-settings-0SeqaDeW.js";import{t as v}from"./use-tracking-BhyV5A9i.js";import{t as y}from"./use-create-conversation-pV2eA-e9.js";import{i as b,n as x,r as S,t as C}from"./extension-module-card-classes-DP5J6ngE.js";import{f as w,i as T,l as E,m as D,o as O,t as k,u as A}from"./install-server-modal-_7l1gcjd.js";import{n as j}from"./skill-card-pill-row-DeodrwPG.js";var M=e(t(),1);function N(e,t){let n=o(t);return F({filters:{...e,status:`pending`}},n).length}function P(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function F(e={},t){let i=o(t).getMutationCache(),a=M.useRef(e),s=M.useRef(null);return s.current===null&&(s.current=P(i,e)),M.useEffect(()=>{a.current=e}),M.useSyncExternalStore(M.useCallback(e=>i.subscribe(()=>{let t=n(s.current,P(i,a.current));s.current!==t&&(s.current=t,r.schedule(e))}),[i]),()=>s.current,()=>s.current)}var I=()=>{let e=f(),t=N({mutationKey:[`create-conversation`]}),{isNavigating:n}=e;return t>0||n},L=[{id:`github-pr-reviewer`,name:`GitHub Code Review Agent`,category:`Code review`,description:`Watch pull requests, inspect the diff, and leave a concise review with risks and suggested follow-ups.`,requiredIntegrationIds:[`github`],popularityRank:100,estimatedSetupMinutes:4,prompt:`/pr-reviewer:setup`,exampleImplementation:`Trigger: github.pull_request.opened and github.pull_request.synchronize
2
2
  Required MCP: GitHub
3
3
 
4
4
  1. Read repository, pull_request, and sender from the event payload.
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/manage-backends-modal-qpq2M_oN.js","assets/rolldown-runtime-BFRubm34.js","assets/agent-server-client-options-B-C8JaTb.js","assets/active-backend-context-BiVlte2V.js","assets/declaration-BDfM67Kl.js","assets/react-CM_dJw1Z.js","assets/query-client-config-B9ZI-1_w.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js","assets/createLucideIcon-CkGTf9Qj.js","assets/utils-CXRkUr73.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~nh19ovoo-DJTFnsA1.js","assets/common-Dh7OqABE.js","assets/useQuery-CbqdITLM.js","assets/suspense-BpkWt-39.js","assets/QueryClientProvider-2bFjjuvv.js","assets/pencil-DPEtl5QD.js","assets/plus-DKUID4kd.js","assets/trash-2-C-RvV8WA.js","assets/useTranslation-C-T8J2U-.js","assets/context-CI9FqkUp.js","assets/backend-form-modal-DY3My0us.js","assets/organization-service.api-CNmSPGj4.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-_LydBB1e.js","assets/proxy--Uy1iGsW.js","assets/brand-button-B6g_UvEG.js","assets/settings-input-CyWJBrqC.js","assets/modal-backdrop-DmDLoot0.js","assets/react-dom-hVBnwgwZ.js","assets/modal-body-BWjhfiSa.js","assets/modal-close-button-DXN6uYvt.js","assets/navigation-context-BrRCrWhm.js","assets/modal-classes-DbJbhQCW.js","assets/confirmation-modal-CG_Fgrny.js","assets/api-key-entry-screen-BnvQM0v5.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{L as r,a as i,c as a,d as o,f as s,i as c}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js";import{t as l}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js";import{o as u,t as d}from"./declaration-BDfM67Kl.js";import{n as f}from"./QueryClientProvider-2bFjjuvv.js";import{t as p}from"./useTranslation-C-T8J2U-.js";import{r as m}from"./providers-189W9TJO.js";import{f as h}from"./query-client-config-B9ZI-1_w.js";import{C as g,s as _}from"./agent-server-client-options-B-C8JaTb.js";import{f as v,l as y,s as b,u as x}from"./active-backend-context-BiVlte2V.js";import{a as S,i as C,n as w,o as T,r as E,t as D}from"./telemetry-Ca_YAGcO.js";import{t as O}from"./modal-backdrop-DmDLoot0.js";import{n as k}from"./modal-body-BWjhfiSa.js";import{n as A,r as j}from"./base-modal-B_MCb3rx.js";import{t as M}from"./brand-button-B6g_UvEG.js";import{t as N}from"./loading-spinner-Dtm7y-w5.js";import{t as P}from"./use-config-C4DX1-nF.js";import{i as F,n as I}from"./color-themes-0biOprdo.js";var L=e(t(),1);function R(){let[e,t]=(0,L.useState)(()=>w()),n=(0,L.useRef)(!1);(0,L.useEffect)(()=>{n.current||(n.current=!0,S())},[]),(0,L.useEffect)(()=>{e===`granted`&&T()},[e]);let r=(0,L.useCallback)(async()=>{await E(`granted`),t(`granted`)},[]),i=(0,L.useCallback)(async()=>{await E(`denied`),t(`denied`)},[]),a=(0,L.useCallback)((t,n)=>{e===`granted`&&C(t,n)},[e]),o=(0,L.useCallback)(()=>{D(),t(`pending`)},[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:r,denyConsent:i,track:a,clearData:o}}var z=u();function B({onChoice:e}){let{t,ready:n}=p(`openhands`),{showConsentPrompt:r,grantConsent:i,denyConsent:a}=R(),[o,s]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{if(n&&r){let e=setTimeout(()=>s(!0),50);return()=>clearTimeout(e)}s(!1)},[n,r]),o?(0,z.jsx)(O,{"aria-label":t(d.TELEMETRY$CONSENT_TITLE),children:(0,z.jsx)(`form`,{"data-testid":`telemetry-consent-form`,onSubmit:t=>{t.preventDefault();let n=new FormData(t.currentTarget).get(`analytics`)===`on`;n?i():a(),e?.(n)},className:`flex flex-col gap-2`,children:(0,z.jsxs)(k,{className:`border border-[var(--oh-border)]`,children:[(0,z.jsx)(j,{title:t(d.TELEMETRY$CONSENT_TITLE)}),(0,z.jsx)(A,{children:t(d.TELEMETRY$CONSENT_DESCRIPTION)}),(0,z.jsxs)(`label`,{className:`flex gap-2 items-center self-start text-sm cursor-pointer`,children:[(0,z.jsx)(`input`,{name:`analytics`,type:`checkbox`,defaultChecked:!0,className:`w-4 h-4 cursor-pointer`}),t(d.TELEMETRY$SEND_ANONYMOUS_DATA)]}),(0,z.jsx)(M,{testId:`confirm-telemetry-preferences`,type:`submit`,variant:`primary`,className:`w-full`,children:t(d.TELEMETRY$CONFIRM_PREFERENCES)})]})})}):null}function V(){return L.useEffect(()=>{I(F())},[]),null}var H=L.lazy(()=>n(()=>import(`./manage-backends-modal-qpq2M_oN.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),U=L.lazy(()=>n(()=>import(`./api-key-entry-screen-BnvQM0v5.js`),__vite__mapDeps([34,1,2,3,4,5,6,7,8,9,10,11,12,19,20,21,22,14,15,23,24,13,25,26,27,28,29,30,31,32])));function W({children:e}){return(0,z.jsxs)(`html`,{lang:`en`,children:[(0,z.jsxs)(`head`,{children:[(0,z.jsx)(`meta`,{charSet:`utf-8`}),(0,z.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),(0,z.jsx)(i,{}),(0,z.jsx)(c,{})]}),(0,z.jsxs)(`body`,{"data-agent-server-ui":``,className:`m-0`,children:[(0,z.jsxs)(m,{contentClassName:`min-h-screen`,children:[(0,z.jsx)(V,{}),e,(0,z.jsx)(l,{toastOptions:h}),(0,z.jsx)(B,{}),(0,z.jsx)(`div`,{id:`modal-portal-exit`})]}),(0,z.jsx)(s,{}),(0,z.jsx)(o,{})]})]})}function G(){return(0,z.jsx)(`main`,{className:`min-h-screen bg-base px-6 py-10 text-white`,children:(0,z.jsx)(`div`,{className:`mx-auto flex min-h-screen max-w-6xl items-center justify-center`,children:(0,z.jsx)(`div`,{className:`rounded-3xl border border-white/10 bg-base/80 px-8 py-10 shadow-2xl`,children:(0,z.jsx)(N,{size:`large`})})})})}function K(){let e=f(),t=L.useCallback(()=>{_()&&(y(),e.invalidateQueries({queryKey:b.WEB_CLIENT_CONFIG}))},[e]);return(0,z.jsx)(`main`,{"data-testid":`agent-server-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,z.jsx)(L.Suspense,{fallback:null,children:(0,z.jsx)(H,{onClose:t,recoveryMode:!0})})})}var q=()=>[{rel:`icon`,type:`image/svg+xml`,href:`/favicon.svg`}],J=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],Y=r(function(){let e=g(),t=!!_()?.apiKey,n=e&&!t,r=P({enabled:!n});return n||x(r.error)?(0,z.jsx)(L.Suspense,{fallback:(0,z.jsx)(G,{}),children:(0,z.jsx)(U,{})}):r.isPending||r.isLoading?(0,z.jsx)(G,{}):v(r.error)?(0,z.jsx)(K,{}):(0,z.jsx)(a,{})});export{W as Layout,Y as default,q as links,J as meta};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/manage-backends-modal-tfdzTXWU.js","assets/rolldown-runtime-BFRubm34.js","assets/agent-server-client-options-B-C8JaTb.js","assets/active-backend-context-CNF2lPkA.js","assets/declaration-D9ucT0fq.js","assets/react-CM_dJw1Z.js","assets/query-client-config-Ca3tW1AH.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js","assets/createLucideIcon-CkGTf9Qj.js","assets/utils-eXk6yerZ.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~nh19ovoo-DJTFnsA1.js","assets/common-Dh7OqABE.js","assets/useQuery-DGRSm7IT.js","assets/suspense-Bqb0V0q1.js","assets/QueryClientProvider-XcSjsfpb.js","assets/pencil-DPEtl5QD.js","assets/plus-DKUID4kd.js","assets/trash-2-C-RvV8WA.js","assets/useTranslation-CL6FTf1b.js","assets/context-CI9FqkUp.js","assets/backend-form-modal-Dl29wkF5.js","assets/organization-service.api-BNc9Kn6n.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-_LydBB1e.js","assets/proxy--Uy1iGsW.js","assets/brand-button-9SOzmqPP.js","assets/settings-input-BM8ANxDb.js","assets/modal-backdrop-_VbcKk5K.js","assets/react-dom-hVBnwgwZ.js","assets/modal-body-Cd-PtMHr.js","assets/modal-close-button-Dbo0NAMt.js","assets/navigation-context-BpAOh_t5.js","assets/modal-classes-CNm4ovfm.js","assets/confirmation-modal-Cq3eqvqH.js","assets/api-key-entry-screen-Dnr5TcV0.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{L as r,a as i,c as a,d as o,f as s,i as c}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js";import{t as l}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js";import{o as u,t as d}from"./declaration-D9ucT0fq.js";import{n as f}from"./QueryClientProvider-XcSjsfpb.js";import{t as p}from"./useTranslation-CL6FTf1b.js";import{r as m}from"./providers-BiWSYwRT.js";import{f as h}from"./query-client-config-Ca3tW1AH.js";import{C as g,s as _}from"./agent-server-client-options-B-C8JaTb.js";import{f as v,l as y,s as b,u as x}from"./active-backend-context-CNF2lPkA.js";import{a as S,i as C,n as w,o as T,r as E,t as D}from"./telemetry-DCFAqpIA.js";import{t as O}from"./modal-backdrop-_VbcKk5K.js";import{n as k}from"./modal-body-Cd-PtMHr.js";import{n as A,r as j}from"./base-modal-DvuGYyu1.js";import{t as M}from"./brand-button-9SOzmqPP.js";import{t as N}from"./loading-spinner-D7bOU6I7.js";import{t as P}from"./use-config-5zEjywCL.js";import{i as F,n as I}from"./color-themes-0biOprdo.js";var L=e(t(),1);function R(){let[e,t]=(0,L.useState)(()=>w()),n=(0,L.useRef)(!1);(0,L.useEffect)(()=>{n.current||(n.current=!0,S())},[]),(0,L.useEffect)(()=>{e===`granted`&&T()},[e]);let r=(0,L.useCallback)(async()=>{await E(`granted`),t(`granted`)},[]),i=(0,L.useCallback)(async()=>{await E(`denied`),t(`denied`)},[]),a=(0,L.useCallback)((t,n)=>{e===`granted`&&C(t,n)},[e]),o=(0,L.useCallback)(()=>{D(),t(`pending`)},[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:r,denyConsent:i,track:a,clearData:o}}var z=u();function B({onChoice:e}){let{t,ready:n}=p(`openhands`),{showConsentPrompt:r,grantConsent:i,denyConsent:a}=R(),[o,s]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{if(n&&r){let e=setTimeout(()=>s(!0),50);return()=>clearTimeout(e)}s(!1)},[n,r]),o?(0,z.jsx)(O,{"aria-label":t(d.TELEMETRY$CONSENT_TITLE),children:(0,z.jsx)(`form`,{"data-testid":`telemetry-consent-form`,onSubmit:t=>{t.preventDefault();let n=new FormData(t.currentTarget).get(`analytics`)===`on`;n?i():a(),e?.(n)},className:`flex flex-col gap-2`,children:(0,z.jsxs)(k,{className:`border border-[var(--oh-border)]`,children:[(0,z.jsx)(j,{title:t(d.TELEMETRY$CONSENT_TITLE)}),(0,z.jsx)(A,{children:t(d.TELEMETRY$CONSENT_DESCRIPTION)}),(0,z.jsxs)(`label`,{className:`flex gap-2 items-center self-start text-sm cursor-pointer`,children:[(0,z.jsx)(`input`,{name:`analytics`,type:`checkbox`,defaultChecked:!0,className:`w-4 h-4 cursor-pointer`}),t(d.TELEMETRY$SEND_ANONYMOUS_DATA)]}),(0,z.jsx)(M,{testId:`confirm-telemetry-preferences`,type:`submit`,variant:`primary`,className:`w-full`,children:t(d.TELEMETRY$CONFIRM_PREFERENCES)})]})})}):null}function V(){return L.useEffect(()=>{I(F())},[]),null}var H=L.lazy(()=>n(()=>import(`./manage-backends-modal-tfdzTXWU.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),U=L.lazy(()=>n(()=>import(`./api-key-entry-screen-Dnr5TcV0.js`),__vite__mapDeps([34,1,2,3,4,5,6,7,8,9,10,11,12,19,20,21,22,14,15,23,24,13,25,26,27,28,29,30,31,32])));function W({children:e}){return(0,z.jsxs)(`html`,{lang:`en`,children:[(0,z.jsxs)(`head`,{children:[(0,z.jsx)(`meta`,{charSet:`utf-8`}),(0,z.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),(0,z.jsx)(i,{}),(0,z.jsx)(c,{})]}),(0,z.jsxs)(`body`,{"data-agent-server-ui":``,className:`m-0`,children:[(0,z.jsxs)(m,{contentClassName:`min-h-screen`,children:[(0,z.jsx)(V,{}),e,(0,z.jsx)(l,{toastOptions:h}),(0,z.jsx)(B,{}),(0,z.jsx)(`div`,{id:`modal-portal-exit`})]}),(0,z.jsx)(s,{}),(0,z.jsx)(o,{})]})]})}function G(){return(0,z.jsx)(`main`,{className:`min-h-screen bg-base px-6 py-10 text-white`,children:(0,z.jsx)(`div`,{className:`mx-auto flex min-h-screen max-w-6xl items-center justify-center`,children:(0,z.jsx)(`div`,{className:`rounded-3xl border border-white/10 bg-base/80 px-8 py-10 shadow-2xl`,children:(0,z.jsx)(N,{size:`large`})})})})}function K(){let e=f(),t=L.useCallback(()=>{_()&&(y(),e.invalidateQueries({queryKey:b.WEB_CLIENT_CONFIG}))},[e]);return(0,z.jsx)(`main`,{"data-testid":`agent-server-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,z.jsx)(L.Suspense,{fallback:null,children:(0,z.jsx)(H,{onClose:t,recoveryMode:!0})})})}var q=()=>[{rel:`icon`,type:`image/svg+xml`,href:`/favicon.svg`}],J=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],Y=r(function(){let e=g(),t=!!_()?.apiKey,n=e&&!t,r=P({enabled:!n});return n||x(r.error)?(0,z.jsx)(L.Suspense,{fallback:(0,z.jsx)(G,{}),children:(0,z.jsx)(U,{})}):r.isPending||r.isLoading?(0,z.jsx)(G,{}):v(r.error)?(0,z.jsx)(K,{}):(0,z.jsx)(a,{})});export{W as Layout,Y as default,q as links,J as meta};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-BeAlR7Be.js","assets/rolldown-runtime-BFRubm34.js","assets/model-selector-BMn4D5v6.js","assets/vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-DuiHR4ce.js","assets/preload-helper-CT1Z6Pdu.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-B04AZhMW.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-RuHTcYaf.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~nh19ovoo-DJTFnsA1.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-BmZcy_kH.js","assets/declaration-BDfM67Kl.js","assets/react-CM_dJw1Z.js","assets/vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-4yr76Evz.js","assets/react-dom-hVBnwgwZ.js","assets/agent-server-client-options-B-C8JaTb.js","assets/llm-client-P9f2gKeW.js","assets/useQuery-CbqdITLM.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js","assets/suspense-BpkWt-39.js","assets/QueryClientProvider-2bFjjuvv.js","assets/useTranslation-C-T8J2U-.js","assets/context-CI9FqkUp.js","assets/proxy--Uy1iGsW.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-_LydBB1e.js","assets/brand-button-B6g_UvEG.js","assets/utils-CXRkUr73.js","assets/common-Dh7OqABE.js","assets/combobox-caret-kEa3kTvf.js","assets/sdk-settings-schema-Ck6f2ON9.js","assets/dist-5dObF4p4.js","assets/sdk-settings-field-metadata-p2GVlft7.js","assets/map-provider-BM2SJarp.js","assets/settings-input-CyWJBrqC.js","assets/base-modal-B_MCb3rx.js","assets/modal-body-BWjhfiSa.js","assets/modal-classes-DbJbhQCW.js","assets/modal-backdrop-DmDLoot0.js","assets/navigation-context-BrRCrWhm.js","assets/use-save-settings-BjYPOrtF.js","assets/active-backend-context-BiVlte2V.js","assets/query-client-config-B9ZI-1_w.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js","assets/createLucideIcon-CkGTf9Qj.js","assets/useMutation-B1gQr_yr.js","assets/settings-service.api-CFt5HmXD.js","assets/settings-wh2sLLJM.js","assets/use-settings-YTDcMvj1.js","assets/use-tracking-DJ3Z7ha1.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BmOMM-6e.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-Cl4h-NSi.js","assets/settings-utils--H_EvFjx.js","assets/add-backend-modal-CSfOPrnr.js","assets/backend-form-modal-DY3My0us.js","assets/organization-service.api-CNmSPGj4.js","assets/modal-close-button-DXN6uYvt.js","assets/manage-backends-modal-qpq2M_oN.js","assets/pencil-DPEtl5QD.js","assets/plus-DKUID4kd.js","assets/trash-2-C-RvV8WA.js","assets/confirmation-modal-CG_Fgrny.js","assets/environment-switch-overlay-BgYKFdf6.js","assets/environment-switch-store-CiurvTtK.js","assets/analytics-consent-form-modal-CdP5JRph.js","assets/telemetry-Ca_YAGcO.js","assets/handle-capture-consent-CPMXU29K.js","assets/alert-banner-BUqPui_3.js","assets/vendor~conversation-panel~conversation~alert-banner-CtjHOMO_.js","assets/vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CsO1gYxF.js","assets/iconBase-BVhFI-0E.js","assets/close-HybccyBS.js","assets/typography-BFj4IzMj.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{A as r,C as i,F as a,L as o,M as s,N as c,P as l,R as u,c as d,j as f,k as p}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js";import{t as m}from"./react-dom-hVBnwgwZ.js";import{d as h,t as g,u as _}from"./path-utils-CKgIQZAY.js";import{o as v,t as y}from"./declaration-BDfM67Kl.js";import{t as b}from"./useQuery-CbqdITLM.js";import{r as x}from"./recommended-automations-launcher-C_RcP2yb.js";import{t as S}from"./useTranslation-C-T8J2U-.js";import{m as C,p as w,x as T}from"./query-client-config-B9ZI-1_w.js";import{t as E}from"./createLucideIcon-CkGTf9Qj.js";import{t as D}from"./vendor~root-layout~home~conversation-panel~conversation-eG1kjEbj.js";import{a as O,i as k,o as A}from"./vendor~root-layout~home~mcp~automations-list-COlx7Is6.js";import{t as j}from"./check-BhnsMsWy.js";import{a as M,c as N,d as P,f as F,i as I,l as L,o as ee,p as R,r as z,s as te,t as ne,u as re}from"./sidebar-mobile-menu-toggle-DkYaKR6Q.js";import{a as ie,c as ae,d as oe,f as se,i as B,l as ce,n as le,o as ue,r as de,s as fe,t as pe,u as me}from"./onboarding-B50IeNyy.js";import{t as he}from"./plus-DKUID4kd.js";import{a as ge}from"./llm-settings-B92l1Z2N.js";import{t as _e}from"./trash-2-C-RvV8WA.js";import{t as ve}from"./x-CCfDppg5.js";import{t as V,v as ye,x as be,y as xe}from"./utils-CXRkUr73.js";import{t as H}from"./common-Dh7OqABE.js";import{u as Se}from"./agent-server-client-options-B-C8JaTb.js";import{n as Ce,r as U}from"./active-backend-context-BiVlte2V.js";import{t as W}from"./agent-server-conversation-service.api-8AC86rC5.js";import{n as we}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BmOMM-6e.js";import{t as Te}from"./modal-backdrop-DmDLoot0.js";import{n as G}from"./modal-body-BWjhfiSa.js";import{i as Ee,r as De}from"./base-modal-B_MCb3rx.js";import{g as Oe,s as ke}from"./brand-button-B6g_UvEG.js";import{t as Ae}from"./loading-spinner-Dtm7y-w5.js";import{t as je}from"./use-config-C4DX1-nF.js";import{t as Me}from"./openhands-logo-DnfHAq7Y.js";import{n as Ne,t as Pe}from"./navigation-context-BrRCrWhm.js";import{t as Fe}from"./navigation-link-qUrH_I5_.js";import{a as Ie,d as Le,f as Re,i as ze,m as Be,n as Ve,o as He,p as Ue,s as We,t as Ge}from"./use-cloud-current-user-id-BjDwnldw.js";import{n as Ke,t as qe}from"./sidebar-nav-link-CzeuB4So.js";import{t as Je}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ceijy54y-D7ZsdcLa.js";import{t as K}from"./styled-tooltip-B3wz8m5E.js";import{a as Ye,d as Xe,f as Ze,i as Qe,l as $e,n as et,o as tt,r as nt,u as rt}from"./dropdown-classes-CL8egwz_.js";import{r as it,t as at}from"./combobox-caret-kEa3kTvf.js";import{_ as ot,a as st,c as ct,d as lt,f as ut,g as dt,h as ft,i as pt,l as mt,m as ht,n as gt,o as _t,p as vt,r as yt,u as bt,v as xt,y as St}from"./chat-send-button-Ce9rK8Vd.js";import{o as Ct,r as wt}from"./backend-form-modal-DY3My0us.js";import{s as Tt}from"./environment-switch-store-CiurvTtK.js";import{t as Et}from"./react-Dy05vyj5.js";import{i as Dt,n as Ot,t as kt}from"./conversation-store-FQmakEd-.js";import{t as At}from"./add-backend-modal-CSfOPrnr.js";import{t as jt}from"./manage-backends-modal-qpq2M_oN.js";import{c as Mt,d as Nt,u as Pt}from"./acp-providers-Djbp2WMV.js";import{t as Ft}from"./use-is-authed-7P3xSsit.js";import{t as It}from"./use-click-outside-element-DhxCUyWl.js";import{r as Lt,t as Rt}from"./use-settings-YTDcMvj1.js";import{t as zt}from"./use-tracking-DJ3Z7ha1.js";import{t as Bt}from"./use-llm-profiles-CZD1ALup.js";import{t as Vt}from"./use-create-conversation-CIkPp9u9.js";import{t as Ht}from"./conversation-service.api-CngSQhPh.js";import{r as Ut,t as Wt}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-COLUW-6M.js";import{n as Gt,t as q}from"./context-menu-list-item-CvJv3-kq.js";import{i as J,r as Kt,t as qt}from"./ellipsis-button-Db-AwbLv.js";import{t as Jt}from"./u-edit-BvTiDr33.js";import{t as Yt}from"./skills-jKeJCunm.js";import{a as Xt,o as Zt,t as Qt}from"./vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CsO1gYxF.js";import{t as $t}from"./search-aDWSdSb7.js";import{t as en}from"./handle-capture-consent-CPMXU29K.js";import{t as tn}from"./use-save-settings-BjYPOrtF.js";import{t as nn}from"./use-user-conversation-Ct93yaXj.js";import{t as rn}from"./conversation-state-store-NEktJKfL.js";var an=E(`calendar-arrow-down`,[[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M18 14v8`,key:`irew45`}],[`path`,{d:`M21 11.354V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7.343`,key:`bse4f3`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}]]),on=E(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),sn=E(`clock-arrow-down`,[[`path`,{d:`M12 6v6l2 1`,key:`19cm8n`}],[`path`,{d:`M12.337 21.994a10 10 0 1 1 9.588-8.767`,key:`28moa`}],[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M18 14v8`,key:`irew45`}]]),cn=E(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ln=E(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),un=E(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),dn=E(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),fn=E(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),pn=E(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),mn=E(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),hn=E(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Y=e(t(),1),X=v(),gn=46,_n=30;function vn({className:e,logoClassName:t,logoWidth:n=gn,logoHeight:r=_n}={}){let{t:i}=S(`openhands`);return(0,X.jsx)(Fe,{to:`/conversations`,"aria-label":i(y.BRANDING$OPENHANDS_LOGO),className:V(e),children:(0,X.jsx)(Me,{width:n,height:r,className:V(`shrink-0`,t)})})}function yn(){return(0,X.jsx)(`div`,{className:`animate-spin h-4 w-4 border-2 border-transparent border-t-white rounded-full`,"data-testid":`dropdown-loading`})}function bn({onClear:e}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-clear`,onClick:e,"aria-label":`Clear selection`,className:`text-white hover:text-[var(--oh-text-tertiary)]`,children:(0,X.jsx)(ve,{size:14})})}function xn({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:V(it,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,X.jsx)(at,{})})}function Sn({isOpen:e,filteredOptions:t,selectedItem:n,emptyMessage:r,getMenuProps:i,getItemProps:a,footer:o,openUpward:s=!1,fitContent:c=!1}){return(0,X.jsxs)(`div`,{className:V(`absolute z-50 overflow-hidden text-white`,c?`min-w-full w-max`:`w-full`,s?`bottom-full mb-1`:`mt-1`,`bg-tertiary rounded-[6px] context-menu-box-shadow p-1`,`max-h-60 overflow-auto`,!e&&`hidden`),children:[(0,X.jsxs)(`ul`,{...i({className:V(`p-0`,Qe)}),children:[e&&t.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,children:r}),e&&t.map((e,t)=>(0,X.jsxs)(`li`,{...a({item:e,index:t,className:V(tt,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,X.jsx)(`span`,{className:rt,children:e.prefix}):null,(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label})]},e.value))]}),e&&o?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(St,{inset:`menu`}),(0,X.jsx)(`div`,{className:`p-0`,children:o})]}):null]})}function Cn({placeholder:e,isDisabled:t,getInputProps:n,italicPlaceholder:r=!0,fitContent:i=!1}){return(0,X.jsx)(`input`,{...n({placeholder:e,disabled:t,className:V(`outline-none bg-transparent text-white not-italic`,i?`w-auto field-sizing-content whitespace-nowrap text-sm`:`flex-1 min-w-0`,r&&`placeholder:italic placeholder:text-tertiary-alt`,!r&&`placeholder:text-tertiary-alt`,ke,`px-0 not-italic text-inherit`)})})}var wn={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function Tn({options:e,emptyMessage:t=`No options`,clearable:n=!1,loading:r=!1,disabled:i=!1,placeholder:a,defaultValue:o,onChange:s,testId:c,className:l,footer:u,openUpward:d=!1,hideTrigger:f=!1,defaultOpen:p=!1,openOnHover:m=!1,italicPlaceholder:h=!0,fitContent:g=!1}){let _=Y.useRef(null),[v,y]=(0,Y.useState)(o?.label??``),[b,x]=(0,Y.useState)(``),S=e.filter(e=>e.label.toLowerCase().includes(b.toLowerCase())),{isOpen:C,selectedItem:w,selectItem:T,openMenu:E,closeMenu:O,getToggleButtonProps:k,getMenuProps:A,getItemProps:j,getInputProps:M}=D({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===D.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes,initialIsOpen:p,onInputValueChange:({inputValue:e})=>{y(e??``),x(e??``)},defaultSelectedItem:o,onSelectedItemChange:({selectedItem:e})=>{s?.(e??null)},onIsOpenChange:({isOpen:e,selectedItem:t})=>{e?(y(``),x(``)):(y(t?.label??``),x(``))}}),N=r||i,P=w?e.find(e=>e.value===w.value)??w:null,F=e=>M({...e,onChange:e=>{y(e.target.value),x(e.target.value)}});return(0,X.jsxs)(`div`,{className:V(`relative`,g?`inline-block w-auto`:`w-full`),"data-testid":c,onMouseEnter:m?()=>{_.current&&=(clearTimeout(_.current),null),E()}:void 0,onMouseLeave:m?()=>{_.current=setTimeout(()=>O(),150)}:void 0,children:[f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{...F({"aria-label":a??`Filter options`,tabIndex:-1}),style:wn}),(0,X.jsx)(`button`,{type:`button`,...k({tabIndex:-1}),style:wn,"aria-hidden":!0})]}):(0,X.jsxs)(`div`,{className:V(Ze,g?`w-auto`:`w-full`,N&&`cursor-not-allowed opacity-60`,l),children:[P?.prefix?(0,X.jsx)(`span`,{className:`flex items-center shrink-0`,children:P.prefix}):null,(0,X.jsx)(Cn,{placeholder:a,isDisabled:N,getInputProps:F,italicPlaceholder:h,fitContent:g}),r&&(0,X.jsx)(yn,{}),n&&w&&(0,X.jsx)(bn,{onClear:()=>T(null)}),(0,X.jsx)(xn,{isOpen:C,isDisabled:N,getToggleButtonProps:k})]}),(0,X.jsx)(Sn,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:A,getItemProps:j,footer:u,openUpward:d,fitContent:g})]})}var En=`::`;function Dn(e,t){return t?`${e}${En}${t}`:e}function On(e){let[t,n]=e.split(En);return{backendId:t,orgId:n??null}}function kn(e){return(0,X.jsx)(wt,{isConnected:e?.isConnected??null})}function An(){return(0,X.jsx)(wt,{isConnected:`unavailable`})}function jn(e,t,n,r,i){let a=[],o=e.filter(e=>e.kind===`local`),s=e.filter(e=>e.kind===`cloud`);for(let e of o)a.push({value:Dn(e.id,null),label:e.name,prefix:kn(i[e.id])});for(let e of s){let o=n[e.id],s=kn(i[e.id]);if(!o||o.orgs.length===0)a.push({value:Dn(e.id,null),label:e.name,prefix:s});else{let n=r[e.id]?.userId??null;for(let r of o.orgs){let i=n&&n===r.id?t:r.name;a.push({value:Dn(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function Mn({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:i,onOpenAddBackend:a,onOpenManageBackends:o,sidebarCollapsed:c=!1}={}){let{t:l}=S(`openhands`),{backends:u,active:d,setActive:f}=U(),p=Ve(),m=Ge(),h=Ct(u),g=s(),_=r(`/settings`),v=r(`/settings/*`),b=r(`/conversations/:conversationId`),x=r(`/automations/:automationId`),[C,w]=Y.useState(!1),[T,E]=Y.useState(!1),D=l(y.BACKEND$PERSONAL_WORKSPACE),O=Y.useMemo(()=>jn(u,D,p,m,h),[u,D,p,m,h]),k=Se(d.backend),A=l(y.BACKEND$NO_BACKEND_AVAILABLE),j=Dn(d.backend.id,d.orgId),M=k?void 0:O.find(e=>e.value===j),N=!!(_||v),P=l(y.SIDEBAR$SETTINGS),F=kt(e=>e.isRightPanelShown),I=!c||b&&F?`top`:`left`,L=Object.values(p).some(e=>e.isLoading);Y.useEffect(()=>{if(k||d.backend.kind!==`cloud`||d.orgId)return;let{backend:e}=d,t=p[e.id];if(!t||t.orgs.length===0)return;let n=m[e.id]?.userId??null,r=(n?t.orgs.find(e=>e.id===n):void 0)??t.orgs[0];r&&f(e.id,r.id)},[d,p,m,f,k]);let ee=Y.useCallback(()=>{if(a){a(),i?.();return}w(!0)},[a,i]),R=Y.useCallback(()=>{if(o){o(),i?.();return}E(!0)},[o,i]),z=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),te=(0,X.jsxs)(`div`,{className:Qe,children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:z,onClick:ee,className:V(et,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:rt,"aria-hidden":!0,children:(0,X.jsx)(he,{width:16,height:16})}),l(y.BACKEND$ADD)]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:z,onClick:R,className:V(et,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:rt,"aria-hidden":!0,children:(0,X.jsx)(mn,{width:16,height:16})}),l(y.BACKEND$MANAGE)]})]}),ne=Y.useCallback(async e=>{if(e===j)return;let{backendId:t,orgId:n}=On(e),r=u.find(e=>e.id===t);r&&(Tt(O.find(t=>t.value===e)?.label??r.name),await new Promise(e=>{setTimeout(e,400)}),b?g(`/conversations`):x&&g(`/automations`),f(r.id,n),i?.())},[j,u,b,x,g,O,f,l,i]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 w-full`,children:[(0,X.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,X.jsx)(Tn,{testId:`backend-selector`,defaultValue:M??{value:j,label:k?A:d.backend.name,prefix:k?An():kn(h[d.backend.id])},footer:te,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&ne(e.value)},placeholder:k?A:d.backend.name,loading:L,options:O,className:`h-10 px-2 py-0 bg-transparent border-transparent hover:bg-[var(--oh-surface-raised)] focus-within:bg-[var(--oh-surface-raised)] focus-within:border-transparent focus-within:ring-0`},`${j}-${M?.label??``}`)}),t?null:(0,X.jsx)(K,{content:P,placement:I,offset:10,children:(0,X.jsx)(Fe,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":N,"aria-label":P,className:V(N?`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md bg-tertiary text-white font-normal cursor-pointer`:`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)] cursor-pointer`,Oe),children:(0,X.jsx)(mn,{width:16,height:16})})})]}),C?(0,X.jsx)(At,{onClose:()=>w(!1)}):null,T?(0,X.jsx)(jt,{onClose:()=>E(!1)}):null]})}var Nn=(e=20)=>{let{data:t}=Ft(),n=Ce(),r=!Se(n.backend);return h({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await W.searchConversations(e,t),enabled:!!t&&r,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:n.backend.id}})},Pn=(e=10)=>b({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function Fn({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=S(`openhands`);return(0,X.jsx)(Te,{onClose:n,children:(0,X.jsxs)(G,{testID:`confirm-new-conversation-modal`,children:[(0,X.jsx)(De,{title:r(y.CONVERSATION$EXIT_WARNING)}),(0,X.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,X.jsx)(Ee,{text:r(y.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,X.jsx)(Ee,{text:r(y.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}var In=e=>e.includes(`Z`)||e.match(/[+-]\d{2}:\d{2}$/)!==null?new Date(e):new Date(`${e}Z`),Ln=e=>{let t=typeof e==`string`?In(e):e,n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24),s=Math.floor(o/30),c=Math.floor(s/12);return r<60?`${r}s`:i<60?`${i}m`:a<24?`${a}h`:o<30?`${o}d`:s<12?`${s}mo`:`${c}y`};function Rn({titleMode:e,title:t,onSave:n,isConversationArchived:r}){return e===`edit`?(0,X.jsx)(`input`,{autoFocus:!0,"data-testid":`conversation-card-title`,onClick:e=>{e.preventDefault(),e.stopPropagation()},onBlur:e=>{n(e.currentTarget?.value?.trim?.()??``)},onKeyUp:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&e.currentTarget.blur()},type:`text`,defaultValue:t,className:`text-sm leading-6 font-semibold bg-transparent w-full`}):(0,X.jsx)(`p`,{"data-testid":`conversation-card-title`,className:V(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),title:t,children:t})}var zn=e=>{switch(e){case H.FINISHED:return`check`;case H.RUNNING:return`working`;case H.IDLE:case H.WAITING_FOR_CONFIRMATION:return`active`;case H.PAUSED:return`paused`;case H.ERROR:case H.STUCK:return`error`;default:return`unknown`}},Bn=(e,t)=>{if(t)return`COMMON$ARCHIVED`;switch(e){case`check`:return`COMMON$FINISHED`;case`working`:case`active`:return`COMMON$WORKING`;case`paused`:return`COMMON$PAUSED`;case`error`:return`COMMON$ERROR`;default:return`COMMON$STOPPED`}};function Vn(e){switch(e){case`check`:return(0,X.jsx)(`svg`,{"data-testid":`conversation-status-check`,viewBox:`0 0 12 12`,className:`w-2.5 h-2.5 stroke-[var(--oh-status-success)]`,fill:`none`,strokeWidth:2.25,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M2.5 6.5 5 9l4.5-5.5`})});case`working`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-working`,className:`w-1.5 h-1.5 rounded-full animate-pulse bg-[var(--oh-status-success)]`});case`active`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-active`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-success)]`});case`paused`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-paused`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-muted)]`});case`error`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-error`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-error)]`});default:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-unknown`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-color-tertiary)]`})}}function Hn({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=S(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:zn(e),o=r(Bn(a,i)),s=(0,X.jsx)(`div`,{className:`w-2.5 h-2.5 flex items-center justify-center shrink-0`,children:i?(0,X.jsx)(Wt,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):Vn(a)});return n?(0,X.jsx)(K,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function Un({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){let a=dt(i);return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[r!==void 0&&(0,X.jsx)(`div`,{className:`flex w-[18px] shrink-0 items-center justify-center`,children:(0,X.jsx)(Hn,{executionStatus:r,sandboxStatus:i})}),(0,X.jsx)(Rn,{title:e,titleMode:t,onSave:n,isConversationArchived:a})]})}var Wn=e(m(),1);function Gn({onClose:e,onDelete:t,onStop:n,onEdit:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onDownloadViaVSCode:s,onDownloadConversation:c,position:l=`bottom`,floatingStyle:u,ignoreOutsideClickRef:d}){let{t:f}=S(`openhands`),{backend:p}=Ce(),m=It(e,d),h=p.kind===`cloud`?y.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:y.COMMON$STOP_CONVERSATION,g=(0,Y.useCallback)((e,t,n)=>{let r=e.filter(e=>e!=null);return r.length>0?n?(0,X.jsx)(Y.Fragment,{children:r},t):(0,X.jsxs)(Y.Fragment,{children:[r,(0,X.jsx)(St,{inset:`menu`})]},t):null},[]),_=u!=null;return(0,X.jsxs)(Gt,{ref:m,testId:`context-menu`,style:_?u:void 0,theme:_?`popover`:`default`,position:_?`none`:l,alignment:_?`none`:`right`,spacing:_?`none`:`default`,className:_?`mt-0 min-w-[200px] w-max max-w-[min(280px,100vw-16px)]`:`z-[200] mt-0`,children:[g([r&&(0,X.jsx)(q,{testId:`edit-button`,onClick:r,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Jt,{width:16,height:16}),text:f(y.BUTTON$RENAME)})},`edit-button`)],`edit-section`),g([a&&(0,X.jsx)(q,{testId:`show-agent-tools-button`,onClick:a,children:(0,X.jsx)(J,{icon:(0,X.jsx)(ft,{width:16,height:16}),text:f(y.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})},`show-agent-tools-button`),o&&(0,X.jsx)(q,{testId:`show-skills-button`,onClick:o,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Yt,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:f(y.CONVERSATION$SHOW_SKILLS)})},`show-skills-button`)],`tools-section`),g([n&&(0,X.jsx)(q,{testId:`stop-button`,onClick:n,children:(0,X.jsx)(J,{icon:(0,X.jsx)(ht,{width:16,height:16}),text:f(h)})},`stop-button`),s&&(0,X.jsx)(q,{testId:`download-vscode-button`,onClick:s,children:(0,X.jsx)(J,{icon:(0,X.jsx)(N,{width:16,height:16}),text:f(y.BUTTON$DOWNLOAD_VIA_VSCODE)})},`download-vscode-button`),c&&(0,X.jsx)(q,{testId:`download-trajectory-button`,onClick:c,children:(0,X.jsx)(J,{icon:(0,X.jsx)(N,{width:16,height:16}),text:f(y.BUTTON$EXPORT_CONVERSATION)})},`download-trajectory-button`)],`control-section`),g([i&&(0,X.jsx)(q,{testId:`display-cost-button`,onClick:i,children:(0,X.jsx)(J,{icon:(0,X.jsx)(te,{width:16,height:16}),text:f(y.BUTTON$DISPLAY_COST)})},`display-cost-button`),t&&(0,X.jsx)(q,{testId:`delete-button`,onClick:t,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Kt,{width:16,height:16}),text:f(y.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function Kn({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onStop:r,onEdit:i,onDownloadViaVSCode:a,onDownloadConversation:o,executionStatus:s,conversationId:c,showOptions:l}){let u=be(s),d=xe(s),f=(0,Y.useRef)(null),[,p]=(0,Y.useReducer)(e=>e+1,0);(0,Y.useLayoutEffect)(()=>{if(!e)return;p();let t=0,n=()=>{t||=window.requestAnimationFrame(()=>{t=0,p()})};return window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{t&&window.cancelAnimationFrame(t),window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[e]);let m=(()=>{if(!e||!f.current)return;let t=f.current.getBoundingClientRect(),n=Number(window.innerWidth)||0,r=Number(window.innerHeight)||0,i=Number(t.bottom)||0,a=Number(t.right)||0;return{position:`fixed`,top:i+280+8>r?Math.max(8,t.top-280-4):i+4,right:Math.max(8,n-a),zIndex:1e5}})(),h=typeof document<`u`?document.body:null;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(qt,{ref:f,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},className:V(u&&`opacity-60`)}),e&&m&&h?(0,Wn.createPortal)((0,X.jsx)(Gn,{ignoreOutsideClickRef:f,floatingStyle:m,onClose:()=>t(!1),onDelete:n,onStop:d?r:void 0,onEdit:i,onDownloadViaVSCode:c&&l?a:void 0,onDownloadConversation:c?o:void 0,position:`bottom`}),h):null]})}var qn={bitbucket:Qt,bitbucket_data_center:Qt,github:Xt,gitlab:Zt};function Jn({selectedRepository:e}){let t=e.git_provider?qn[e.git_provider]:null;return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[t&&(0,X.jsx)(t,{size:14,className:`shrink-0 text-[var(--oh-muted)]`}),e.git_provider===`azure_devops`&&(0,X.jsx)(vt,{className:`h-[14px] w-[14px] shrink-0 text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{"data-testid":`conversation-card-selected-repository`,className:`min-w-0 truncate text-xs text-[var(--oh-muted)]`,children:e.selected_repository})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,X.jsx)(Ut,{size:12,className:`shrink-0 text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{"data-testid":`conversation-card-selected-branch`,className:`min-w-0 truncate text-xs text-[var(--oh-muted)]`,children:e.selected_branch})]})]})}function Yn({workspaceWorkingDir:e}){let{t}=S(`openhands`),n=e?g(e).trim():``;return n?(0,X.jsx)(`span`,{className:`truncate min-w-0 text-xs text-[var(--oh-muted)] flex-1`,title:e??void 0,children:n}):(0,X.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-[var(--oh-muted)] flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(ut,{width:14,height:14,className:`text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:t(y.COMMON$NO_REPOSITORY)})]})}function Xn({selectedRepository:e,lastUpdatedAt:t,createdAt:n,executionStatus:r,workspaceWorkingDir:i,showRepositoryMetadata:a=!0,showTimestamp:o=!0,llmModel:s,showAgentChip:c=!1,agentKind:l=null,acpServer:u=null}){let{t:d}=S(`openhands`),f=be(r),p=null;if(c)if(l===`acp`){let e=Mt(u)??d(y.CONVERSATION$ACP_AGENT_GENERIC),t=Pt(u,s),n=t??e;p={kind:Nt(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(p={kind:`openhands`,text:s,tooltip:s});let m=r===void 0?void 0:`pl-[26px]`;return(0,X.jsxs)(`div`,{className:V(`flex flex-col gap-0.5 mt-0.5 w-full min-w-0`,f&&`opacity-60`),children:[p?(0,X.jsx)(`div`,{className:m,children:(0,X.jsxs)(`span`,{"data-testid":`conversation-card-agent-chip`,className:`inline-flex items-center gap-1 text-xs text-[var(--oh-muted)] max-w-full min-w-0`,title:p.tooltip,children:[(0,X.jsx)(se,{kind:p.kind}),(0,X.jsx)(`span`,{className:`truncate`,children:p.text})]})}):null,(0,X.jsxs)(`div`,{className:V(`flex flex-row items-center gap-2 w-full min-w-0`,a&&m),children:[a&&(e?.selected_repository?(0,X.jsx)(Jn,{selectedRepository:e}):(0,X.jsx)(Yn,{workspaceWorkingDir:i})),(0,X.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 ml-auto`,children:o&&(n??t)&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] text-right`,children:(0,X.jsx)(`time`,{children:`${Ln(t??n)} ${d(y.CONVERSATION$AGO)}`})})})]})]})}function Zn(){let{t:e}=S(`openhands`);return(0,X.jsxs)(`span`,{"data-testid":`error-badge`,className:`flex items-center gap-1 px-1.5 py-0.5 bg-[var(--oh-status-error)] text-white text-xs font-medium rounded-full`,children:[(0,X.jsx)(lt,{className:`text-white w-3 h-3`}),(0,X.jsx)(`span`,{children:e(y.COMMON$ERROR)})]})}function Qn({onClick:e,onDelete:t,onStop:n,onChangeTitle:r,showOptions:i,title:a,selectedRepository:o,lastUpdatedAt:s,createdAt:c,conversationId:l,executionStatus:u,sandboxStatus:d,contextMenuOpen:f=!1,onContextMenuToggle:p,isActive:m=!1,workspaceWorkingDir:h,showRepositoryMetadata:g=!0,llmModel:_=null,showLlmProfiles:v=!1,agentKind:y=null,acpServer:b=null}){let{trackDownloadVsCodeButtonClicked:x}=zt(),[S,C]=Y.useState(`view`),{mutateAsync:w}=bt(),T=e=>{e!==``&&e!==a&&r?.(e),C(`view`)},E=e=>{e.preventDefault(),e.stopPropagation(),t?.(),p?.(!1)},D=e=>{e.preventDefault(),e.stopPropagation(),n?.(),p?.(!1)},O=e=>{e.preventDefault(),e.stopPropagation(),C(`edit`),p?.(!1)},k=async e=>{if(e.preventDefault(),e.stopPropagation(),x(),l)try{let e=await Ht.getVSCodeUrl(l);if(e.vscode_url){let t=L(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}p?.(!1)},A=async e=>{e.preventDefault(),e.stopPropagation(),l&&await w(l),p?.(!1)},j=!!(t||r||i),M=g||v&&(y===`acp`||!!_);return(0,X.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":f.toString(),"data-active":m?`true`:`false`,onClick:e,className:V(`group relative h-auto w-full cursor-pointer rounded-md py-1 pl-2 pr-1 transition-colors`,`data-[context-menu-open=false]:hover:bg-[var(--oh-surface)]`,`data-[active=true]:bg-[var(--oh-surface)]`),children:[(0,X.jsxs)(`div`,{className:`flex items-center w-full min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(Un,{title:a,titleMode:S,onTitleSave:T,executionStatus:u,sandboxStatus:d}),d===`ERROR`&&(0,X.jsx)(Zn,{})]}),(0,X.jsxs)(`div`,{className:`relative ml-auto pl-2 flex items-center justify-end shrink-0`,children:[(c??s)&&(0,X.jsx)(`p`,{className:V(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,j&&`group-hover:opacity-0 group-focus-within:opacity-0`,f&&`opacity-0`),children:(0,X.jsx)(`time`,{children:Ln(s??c)})}),j&&(0,X.jsx)(`div`,{className:V(`absolute right-0 top-1/2 -translate-y-1/2 transition-opacity`,`opacity-0 invisible group-hover:opacity-100 group-hover:visible`,f&&`visible opacity-100`),children:(0,X.jsx)(Kn,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&E,onStop:n&&D,onEdit:r&&O,onDownloadViaVSCode:k,onDownloadConversation:A,executionStatus:u,conversationId:l,showOptions:i})})]})]}),M&&(0,X.jsx)(Xn,{selectedRepository:o,lastUpdatedAt:s,createdAt:c,executionStatus:u,workspaceWorkingDir:h,showRepositoryMetadata:g,showTimestamp:!1,llmModel:_,showAgentChip:v,agentKind:y,acpServer:b})]})}function $n({taskStatus:e}){return(0,X.jsx)(`div`,{className:V(`w-2 h-2 rounded-full flex-shrink-0`,(()=>{switch(e){case`READY`:return`bg-green-500`;case`ERROR`:return`bg-red-500`;case`WORKING`:case`WAITING_FOR_SANDBOX`:case`PREPARING_REPOSITORY`:case`RUNNING_SETUP_SCRIPT`:case`SETTING_UP_GIT_HOOKS`:case`SETTING_UP_SKILLS`:case`STARTING_CONVERSATION`:return`bg-yellow-500 animate-pulse`;default:return`bg-[var(--oh-interactive-selected)]`}})()),"aria-label":`Task status: ${e}`})}function er({taskStatus:e}){let{t}=S(`openhands`);return e===`WORKING`?null:(0,X.jsx)(`span`,{className:V(`text-xs font-medium px-2 py-0.5 rounded border flex-shrink-0`,(()=>{switch(e){case`READY`:return`bg-green-500/10 text-green-400 border-green-500/20`;case`ERROR`:return`bg-red-500/10 text-red-400 border-red-500/20`;default:return`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`}})()),children:t(ye(e))})}function tr({title:e,taskStatus:t}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden mr-2`,children:[(0,X.jsx)(`div`,{className:`flex items-center`,children:(0,X.jsx)($n,{taskStatus:t})}),(0,X.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,X.jsx)(er,{taskStatus:t})]})}function nr({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=S(`openhands`);return(0,X.jsxs)(`div`,{className:V(`flex flex-col gap-1 mt-1`),children:[(0,X.jsxs)(`div`,{className:`flex flex-row justify-between items-center`,children:[e?(0,X.jsx)(Jn,{selectedRepository:e}):(0,X.jsx)(Yn,{}),t&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,X.jsx)(`time`,{children:`${Ln(t)} ${r(y.CONVERSATION$AGO)}`})})]}),n&&(0,X.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function rr({task:e,onClick:t}){let{t:n}=S(`openhands`),r=e.request.title||e.detail||n(y.CONVERSATION$STARTING_CONVERSATION),i=e.request.selected_repository?{selected_repository:e.request.selected_repository,selected_branch:e.request.selected_branch||null,git_provider:e.request.git_provider||null}:null;return(0,X.jsxs)(`div`,{"data-testid":`start-task-card`,onClick:t,className:V(`relative h-auto w-full p-3.5 border-b border-[var(--oh-border)] cursor-pointer`,`hover:bg-tertiary`),children:[(0,X.jsx)(`div`,{className:`flex items-center justify-between w-full`,children:(0,X.jsx)(tr,{title:r,taskStatus:e.status})}),(0,X.jsx)(nr,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function ir({compact:e=!1}){return e?(0,X.jsx)(`div`,{"data-testid":`conversation-card-skeleton-compact`,className:`skeleton-stagger flex flex-col items-center gap-1.5 py-1`,"aria-hidden":!0,children:[0,1,2].map(e=>(0,X.jsx)(`div`,{className:`h-1.5 w-7 shrink-0 skeleton`},`conversation-skeleton-compact-${e}`))}):(0,X.jsx)(`div`,{"data-testid":`conversation-card-skeleton`,className:`skeleton-stagger flex flex-col gap-1.5 py-0.5`,"aria-hidden":!0,children:[0,1,2].map(e=>(0,X.jsx)(`div`,{className:`h-6 min-h-6 w-full skeleton`},`conversation-skeleton-row-${e}`))})}function ar({conversationId:e,title:t,selectedRepository:n,executionStatus:r,sandboxStatus:i,lastUpdatedAt:a,createdAt:o,workspaceWorkingDir:s,isActive:c=!1,onClose:l,showRepositoryMetadata:u=!0,llmModel:d=null,showLlmProfiles:f=!1,agentKind:p=null,acpServer:m=null}){return(0,X.jsx)(Je,{content:(0,X.jsxs)(`div`,{className:`w-[260px] p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,X.jsx)(Hn,{executionStatus:r,sandboxStatus:i,showTooltip:!1}),(0,X.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||`(untitled)`})]}),(0,X.jsx)(Xn,{selectedRepository:n,lastUpdatedAt:a,createdAt:o,executionStatus:r,workspaceWorkingDir:s,showRepositoryMetadata:u,llmModel:d,showAgentChip:f,agentKind:p,acpServer:m})]}),placement:`right`,closeDelay:100,className:`bg-[var(--oh-surface)] text-white border border-[var(--oh-border-subtle)] shadow-xl p-0`,disableAnimation:!1,children:(0,X.jsx)(Fe,{to:`/conversations/${e}`,onClick:l,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>V(`flex items-center justify-center w-10 h-9 mx-auto rounded-md`,`transition-colors cursor-pointer`,e||c?`bg-tertiary`:`hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(Hn,{executionStatus:r,sandboxStatus:i,showTooltip:!1})})})}var or={showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!1,organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`},Z=Et()(Dt(e=>({...or,setShowOlderConversations:t=>e(()=>({showOlderConversations:t})),toggleShowOlderConversations:()=>e(e=>({showOlderConversations:!e.showOlderConversations})),setShowRepoBranchMetadata:t=>e(()=>({showRepoBranchMetadata:t})),toggleShowRepoBranchMetadata:()=>e(e=>({showRepoBranchMetadata:!e.showRepoBranchMetadata})),setShowLlmProfiles:t=>e(()=>({showLlmProfiles:t})),toggleShowLlmProfiles:()=>e(e=>({showLlmProfiles:!e.showLlmProfiles})),setOrganizeMode:t=>e(()=>({organizeMode:t})),setConversationSort:t=>e(()=>({conversationSort:t})),setThreadScope:t=>e(()=>({threadScope:t}))}),{name:`conversation-panel-preferences`,storage:Ot(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope})})),sr=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e,cr=`px-2 pb-1 pt-1`,lr=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function ur({children:e,suffix:t}){return t==null?(0,X.jsx)(`div`,{role:`presentation`,className:V(cr,lr),children:e}):(0,X.jsxs)(`div`,{role:`presentation`,className:V(`flex items-baseline justify-between gap-2`,cr),children:[(0,X.jsx)(`span`,{className:V(`min-w-0 truncate text-left`,lr),children:e}),t]})}function dr(){return(0,X.jsx)(St,{inset:`menu`})}function Q({icon:e,label:t,selected:n,onClick:r,testId:i,disabled:a}){return(0,X.jsxs)(`button`,{type:`button`,role:n===void 0?`menuitem`:`menuitemradio`,"aria-checked":n===void 0?void 0:!!n,"data-testid":i,disabled:a,onClick:r,className:V(`group`,tt,`text-[var(--oh-foreground)] disabled:opacity-50`),children:[(0,X.jsx)(e,{className:V(`h-3.5 w-3.5`,$e),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,X.jsx)(j,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}function fr({filterMenuOpen:e,setFilterMenuOpen:t,menuRef:n,backendKind:r,organizeMode:i,setOrganizeMode:a,conversationSort:o,setConversationSort:s,threadScope:c,setThreadScope:l,showOlderConversations:u,toggleShowOlderConversations:d,showRepoBranchMetadata:f,toggleShowRepoBranchMetadata:p,showLlmProfiles:m,toggleShowLlmProfiles:h,totalConversationsCount:g,onRequestDeleteAll:_}){let{t:v}=S(`openhands`),b=v(r===`local`?y.CONVERSATION_PANEL$BY_WORKSPACE:y.CONVERSATION_PANEL$BY_REPOSITORY),x=Y.useRef(null),C=Y.useRef(null),w=Y.useRef(e);return Y.useEffect(()=>{e?(C.current?.querySelector(`[role="menuitem"], [role="menuitemradio"]`))?.focus():w.current&&x.current?.focus(),w.current=e},[e]),(0,X.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,X.jsx)(`button`,{ref:x,type:`button`,"data-testid":`older-conversations-filter-toggle`,"aria-label":v(y.CONVERSATION_PANEL$FILTER_LABEL),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:V(`inline-flex h-7 w-7 items-center justify-center rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`,nt),children:(0,X.jsx)(dn,{className:`lucide lucide-list-filter shrink-0`,width:14,height:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,X.jsxs)(`div`,{ref:C,role:`menu`,"aria-orientation":`vertical`,"aria-label":v(y.CONVERSATION_PANEL$FILTER_LABEL),tabIndex:-1,"data-testid":`older-conversations-filter-menu`,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),t(!1);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=C.current;if(!n)return;let r=Array.from(n.querySelectorAll(`[role="menuitem"], [role="menuitemradio"]`)).filter(e=>!e.disabled);if(r.length===0)return;let i=r.indexOf(document.activeElement),a=e.key===`ArrowDown`?1:-1,o=((i===-1?0:i)+a+r.length)%r.length;e.preventDefault(),r[o]?.focus()},className:V(`absolute right-0 top-full z-50 mt-0 w-64 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-[var(--oh-foreground)] shadow-lg`,Qe,Xe),children:[(0,X.jsx)(ur,{children:v(y.CONVERSATION_PANEL$ORGANIZE)}),(0,X.jsx)(Q,{icon:O,label:b,selected:i===`grouped`,onClick:()=>{a(`grouped`),t(!1)}}),(0,X.jsx)(Q,{icon:on,label:v(y.CONVERSATION_PANEL$CHRONOLOGICAL),selected:i===`chronological`,onClick:()=>{a(`chronological`),t(!1)}}),(0,X.jsx)(dr,{}),(0,X.jsx)(ur,{children:v(y.CONVERSATION_PANEL$SORT_BY)}),(0,X.jsx)(Q,{icon:an,label:v(y.CONVERSATION_PANEL$SORT_CREATED),selected:o===`created`,onClick:()=>{s(`created`),t(!1)}}),(0,X.jsx)(Q,{icon:sn,label:v(y.CONVERSATION_PANEL$SORT_UPDATED),selected:o===`updated`,onClick:()=>{s(`updated`),t(!1)}}),(0,X.jsx)(dr,{}),(0,X.jsx)(ur,{children:v(y.CONVERSATION_PANEL$SHOW)}),(0,X.jsx)(Q,{icon:fn,label:v(y.CONVERSATION_PANEL$ALL_THREADS),selected:c===`all`,onClick:()=>{l(`all`),t(!1)}}),(0,X.jsx)(Q,{icon:hn,label:v(y.CONVERSATION_PANEL$RELEVANT_THREADS),selected:c===`relevant`,onClick:()=>{l(`relevant`),t(!1)}}),(0,X.jsx)(dr,{}),(0,X.jsx)(ur,{children:v(y.CONVERSATION_PANEL$METADATA)}),(0,X.jsx)(Q,{icon:A,label:v(y.CONVERSATION_PANEL$LLM_MODEL),selected:m,testId:`toggle-llm-profiles`,onClick:()=>{h(),t(!1)}}),(0,X.jsx)(Q,{icon:k,label:v(y.CONVERSATION_PANEL$REPO_BRANCH),selected:f,testId:`toggle-repo-branch-metadata`,onClick:()=>{p(),t(!1)}}),(0,X.jsx)(dr,{}),(0,X.jsx)(ur,{suffix:(0,X.jsx)(`span`,{className:`shrink-0 text-right text-[10px] font-medium normal-case tracking-normal text-[var(--oh-muted)]/70`,children:v(y.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR)}),children:v(y.CONVERSATION_PANEL$OLDER_SECTION)}),(0,X.jsx)(Q,{testId:`toggle-older-conversations`,icon:u?cn:ln,label:sr(v(u?y.CONVERSATION$HIDE:y.CONVERSATION$SHOW_ALL)),onClick:()=>{d(),t(!1)}}),(0,X.jsx)(dr,{}),(0,X.jsx)(Q,{testId:`delete-all-conversations`,icon:_e,label:sr(v(y.CONVERSATION$DELETE_ALL)),disabled:g===0,onClick:()=>{g!==0&&(_(),t(!1))}})]}):null]})}var pr=V(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,Ye);function mr(e,t){let{open:n,enabled:r,targetWidth:i=256}=t,[a,o]=Y.useState(null),s=Y.useCallback(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect(),r=Math.min(i,window.innerWidth-16),a=n.right-r;a<8&&(a=8),a+r>window.innerWidth-8&&(a=Math.max(8,window.innerWidth-8-r)),o({top:n.bottom+4,left:a,width:r})},[e,i]);return Y.useLayoutEffect(()=>{if(!n||!r){o(null);return}return s(),window.addEventListener(`resize`,s),window.addEventListener(`scroll`,s,!0),()=>{window.removeEventListener(`resize`,s),window.removeEventListener(`scroll`,s,!0)}},[n,r,s]),a}function hr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Ne(),[s,c]=Y.useState(!1),l=Y.useRef(null),u=Y.useRef(null),d=mr(u,{open:s,enabled:i}),{data:f,error:p}=fe(),m=f?.workspaceParents??[],{mutate:h}=ce(),{mutate:g}=me(),{mutate:_}=ae(),{mutate:v}=oe(),{workspaces:b}=ue(),C=ie(p,a),[w,T]=Y.useState(!1),[E,D]=Y.useState(!1),{mutate:O,isPending:k}=Vt(),A=x(),j=k||A;Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,w,E]),Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,w,E]);let M=e=>{j||O({workingDir:e},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},N=tt,P=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),F=Y.useCallback(()=>{c(e=>!e)},[]),I=s&&(!i||d!==null),L=!!C,ee=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,R=(0,X.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:L,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),!L&&T(!0)},className:N,children:a(y.HOME$ADD_WORKSPACES)}),z=C?(0,X.jsx)(K,{content:C,placement:`top`,children:(0,X.jsx)(`span`,{className:`block`,children:R})}):R;return(0,X.jsxs)(`div`,{className:V(!i&&`relative`,t),ref:l,children:[(0,X.jsx)(`span`,{ref:u,className:`inline-flex`,children:e({onClick:F,"aria-expanded":s,"aria-haspopup":`menu`,disabled:j})}),I&&(0,X.jsxs)(`div`,{"data-testid":r,className:V(pr,!i&&V(`absolute top-full mt-0`,n)),style:ee,children:[(0,X.jsxs)(`ul`,{className:V(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,Qe),children:[(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,disabled:j,"data-testid":`launch-no-workspace`,onClick:()=>M(),className:N,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:a(y.HOME$NO_WORKSPACE_OPTION)})})}),b.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:j,"data-testid":`launch-workspace`,"data-workspace-path":e.path,onClick:()=>M(e.path),className:N,children:[(0,X.jsx)(`span`,{className:rt,"aria-hidden":!0,children:(0,X.jsx)(mt,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,X.jsxs)(`div`,{className:V(`flex flex-col`,Qe),"data-testid":`new-conversation-menu-footer`,children:[(0,X.jsx)(St,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),z,(b.length>0||m.length>0)&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),D(!0)},className:N,children:a(y.HOME$MANAGE_WORKSPACES)})]})]}),(0,X.jsx)(B,{isOpen:w,onClose:()=>T(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,X.jsx)(de,{isOpen:E,workspaces:b,workspaceParents:m,onClose:()=>D(!1),onRemove:e=>g(e),onRemoveParent:e=>v(e)})]})}function gr({repo:e,disabled:t,onSelect:n,itemClass:r}){return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:t,"data-testid":`launch-repository`,"data-repo-name":e.full_name,onClick:()=>n(e),className:r,children:[(0,X.jsx)(`span`,{className:rt,"aria-hidden":!0,children:(0,X.jsx)(mt,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function _r({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Ne(),{providers:s}=ct(),{lastSelectedProvider:c,setLastSelectedProvider:l}=yt(),[u,d]=Y.useState(!1),f=Y.useRef(null),p=Y.useRef(null),m=mr(p,{open:u,enabled:i}),[h,g]=Y.useState(c??null),[_,v]=Y.useState(``),b=pt(_,300);Y.useEffect(()=>{if(s.length===0){h!==null&&g(null);return}h&&s.includes(h)||g(c&&s.includes(c)?c:s[0])},[s,h,c]);let{data:C,isLoading:w,isError:T,hasNextPage:E,isFetchingNextPage:D,fetchNextPage:O}=_t({provider:h}),{data:k,isLoading:A}=st(b,h),j=Y.useMemo(()=>C?.pages.flatMap(e=>e.items)??[],[C]),M=b?k??[]:j,{mutate:N,isPending:P}=Vt(),F=x(),I=P||F;Y.useEffect(()=>{if(!u)return;let e=e=>{f.current&&!f.current.contains(e.target)&&d(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[u]),Y.useEffect(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&d(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u]);let L=e=>{I||N({repository:{name:e.full_name,gitProvider:e.git_provider,branch:e.main_branch??`main`}},{onSuccess:e=>{d(!1),o(`/conversations/${e.conversation_id}`)}})},ee=e=>{g(e),l(e),v(``)},R=tt;Y.useEffect(()=>{u&&(b||!E||D||w||M.length===0||M.length>=10||O())},[u,b,E,D,w,M.length,O]);let z=b?A:w,te=!b&&E&&M.length>0,ne=Y.useCallback(()=>{d(e=>!e)},[]),re=u&&(!i||m!==null),ie=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,X.jsxs)(`div`,{className:V(!i&&`relative`,t),ref:f,children:[(0,X.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:ne,"aria-expanded":u,"aria-haspopup":`menu`,disabled:I})}),re&&(0,X.jsxs)(`div`,{"data-testid":r,className:V(pr,!i&&V(`absolute top-full mt-0`,n)),style:ie,children:[s.length>1&&(0,X.jsx)(`div`,{className:`flex items-center gap-1 px-1 py-1`,"data-testid":`cloud-provider-tabs`,children:s.map(e=>{let t=e===h;return(0,X.jsxs)(`button`,{type:`button`,"data-testid":`cloud-provider-tab-${e}`,onClick:()=>ee(e),className:V(`flex items-center gap-1 rounded border px-2 py-1 text-xs`,`transition-none`,t?`border-[var(--oh-border-subtle)] bg-[var(--oh-interactive-hover)] text-white`:`border-transparent text-[var(--oh-text-secondary)] hover:text-white`),children:[(0,X.jsx)(gt,{gitProvider:e}),(0,X.jsx)(`span`,{className:`capitalize`,children:e})]},e)})}),(0,X.jsx)(`div`,{className:`px-2`,children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)($t,{width:16,height:16,"aria-hidden":!0,className:`pointer-events-none absolute left-0 top-1/2 -translate-y-1/2 text-[var(--oh-muted)]`}),(0,X.jsx)(`input`,{type:`text`,"data-testid":`cloud-repo-search-input`,value:_,onChange:e=>v(e.target.value),placeholder:a(y.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:V(`w-full border-0 bg-transparent py-1.5 pl-6 pr-0 text-sm text-white`,`outline-none placeholder:text-[var(--oh-muted)]`,`focus:outline-none focus:ring-0`,`disabled:cursor-not-allowed disabled:opacity-60`)})]})}),(0,X.jsx)(St,{inset:`menu`}),(0,X.jsxs)(`ul`,{className:V(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,Qe),children:[z&&M.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-loading`,children:a(y.HOME$LOADING_REPOSITORIES)}),T&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(y.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!z&&!T&&M.length===0&&!!h&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-empty`,children:a(y.GITHUB$NO_RESULTS)}),M.map(e=>(0,X.jsx)(gr,{repo:e,disabled:I,onSelect:L,itemClass:R},`${e.git_provider}:${e.id}`)),te&&(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:D,onClick:()=>O(),className:R,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(D?y.HOME$LOADING_MORE_REPOSITORIES:y.CONVERSATION$LOAD_MORE)})})})]})]})]})}var vr=V(`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md`,`text-[var(--oh-muted)] transition-colors`,`hover:bg-[var(--oh-surface-raised)] hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`);function yr({backendKind:e}){let{t}=S(`openhands`),n=t(y.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,X.jsx)(un,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,X.jsx)(hr,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:vr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})}):(0,X.jsx)(_r,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:vr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})})}function br(e,t){let n=t.limit??5;if(t.expanded||e.length<=n)return{visibleConversations:[...e],isPreviewTruncated:e.length>n,isShowingAll:!0};let r=t.activeConversationId==null?-1:e.findIndex(e=>e.id===t.activeConversationId);if(r>=n){let t=e[r];return{visibleConversations:[...e.slice(0,n-1),t],isPreviewTruncated:!0,isShowingAll:!1}}return{visibleConversations:e.slice(0,n),isPreviewTruncated:e.length>n,isShowingAll:!1}}function xr(e,t,n){if(t===`local`)return e===`__none_workspace`?{}:e.startsWith(`ws:`)?{workingDir:e.slice(3)}:{};if(e===`__none_repo`)return{};if(e.startsWith(`repo:`)){let t=e.slice(5),r=n[0];return{repository:{name:t,gitProvider:r?.git_provider??`github`,branch:r?.selected_branch??`main`}}}return{}}function Sr(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function Cr(e,t){let n=t===`created`?`created_at`:`updated_at`;return[...e].sort((e,t)=>Sr(t[n])-Sr(e[n]))}function wr(e){let t=e.selected_workspace?.trim().replace(/\/+$/,``);if(!t)return{id:`__none_workspace`,label:``};let n=t.split(`/`).filter(Boolean).pop()??t;return{id:`ws:${t}`,label:n}}function Tr(e){let t=e.selected_repository?.trim().replace(/\/+$/,``);if(!t)return{id:`__none_repo`,label:``};let n=t.split(`/`).filter(Boolean),r=n.length?(n[n.length-1]??t).replace(/\.git$/,``):t.replace(/\.git$/,``);return{id:`repo:${t}`,label:r}}function Er(e,t,n,r){let i=new Map;for(let n of e){let{id:e,label:a}=t===`local`?wr(n):Tr(n),o=e===`__none_workspace`?r.emptyWorkspace:e===`__none_repo`?r.emptyRepository:a,s=i.get(e);s?s.conversations.push(n):i.set(e,{label:o,conversations:[n]})}let a=[...i.entries()].map(([e,r])=>{let i=Cr(r.conversations,n);return{id:e,label:r.label,conversations:i,launch:xr(e,t,i)}}),o=e=>e.conversations.reduce((e,t)=>Math.max(e,Sr(n===`created`?t.created_at:t.updated_at)),0);return a.sort((e,t)=>o(t)-o(e)),a}var Dr=()=>{},Or=3600*1e3,kr=e=>{let t=Date.now()-Or,n=[],r=[];for(let i of e){let e=i.updated_at?Date.parse(i.updated_at):NaN;Number.isFinite(e)&&e<t?r.push(i):n.push(i)}return{recent:n,older:r}};function Ar({onClose:e,compact:t=!1}){let{t:n}=S(`openhands`),{conversationId:r,navigate:i}=Ne(),{backend:a}=Ce(),o=It(e??Dr),[s,c]=Y.useState(!1),[l,u]=Y.useState(!1),[d,f]=Y.useState(!1),[p,m]=Y.useState(!1),h=Z(e=>e.showOlderConversations),g=Z(e=>e.toggleShowOlderConversations),_=Z(e=>e.showRepoBranchMetadata),v=Z(e=>e.toggleShowRepoBranchMetadata),b=Z(e=>e.showLlmProfiles),T=Z(e=>e.toggleShowLlmProfiles),E=Z(e=>e.organizeMode),D=Z(e=>e.setOrganizeMode),k=Z(e=>e.conversationSort),A=Z(e=>e.setConversationSort),j=Z(e=>e.threadScope),M=Z(e=>e.setThreadScope),[N,I]=Y.useState(!1),[L,ee]=Y.useState(!1),R=It(()=>{I(!1)}),[z,te]=Y.useState(()=>new Set),[ne,ie]=Y.useState(()=>new Set),ae=Y.useCallback(e=>{te(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),oe=Y.useCallback(e=>{ie(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Y.useEffect(()=>{E!==`grouped`&&(te(new Set),ie(new Set))},[E]);let se=Y.useRef(null),[B,ce]=Y.useState(null),[le,ue]=Y.useState(null),[de,fe]=Y.useState(null),{data:pe,isLoading:me,isFetched:ge,hasNextPage:_e,isFetchingNextPage:ve,fetchNextPage:ye}=Nn(),{data:be}=Pn(),H=Y.useMemo(()=>pe?.pages.flatMap(e=>e.items)??[],[pe]),Se=Y.useMemo(()=>j===`relevant`?H.filter(e=>xe(e.execution_status)):H,[H,j]),{recent:U,older:W}=Y.useMemo(()=>kr(Se),[Se]),we=Y.useMemo(()=>Cr(h?[...U,...W]:U,k),[U,W,h,k]),Te=Y.useMemo(()=>({emptyWorkspace:n(y.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(y.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),G=Y.useMemo(()=>t||E!==`grouped`?null:Er([...U,...h?W:[]],a.kind,k,Te),[a.kind,t,k,Te,W,E,U,h]),Ee=Y.useMemo(()=>Cr(U.filter(e=>xe(e.execution_status)),k),[k,U]),De=we.length,Oe=Y.useMemo(()=>G?G.reduce((e,t)=>e+t.conversations.length,0):0,[G]),ke=E===`grouped`&&!t?Oe===0:De===0,{mutate:je,mutateAsync:Me}=xt(),{mutate:Pe}=ot(),{mutate:Ie}=re(),Le=W.length>0&&!h,Re=!!_e&&!Le&&!t&&!ke,{mutate:ze}=Vt(),Be=x(),Ve=Y.useCallback(e=>{Be||ze({workingDir:e.workingDir,repository:e.repository},{onSuccess:e=>{i(`/conversations/${e.conversation_id}`)}})},[ze,Be,i]),He=Y.useCallback((e,t)=>{c(!0),ce(e),ue(t)},[]),Ue=Y.useCallback(e=>{u(!0),ce(e)},[]),We=Y.useCallback((e,t)=>{Ie({conversationId:e,newTitle:t},{onSuccess:()=>{C(n(y.CONVERSATION$TITLE_UPDATED))}})},[n,Ie]),Ge=()=>{B&&je({conversationId:B},{onSuccess:()=>{B===r&&i(`/conversations`)}})},Ke=()=>{B&&Pe({conversationId:B})},qe=async()=>{let e=H.map(e=>e.id),t=await Promise.allSettled(e.map(e=>Me({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),a=t.length-n.length;r!==null&&n.includes(r)&&i(`/conversations`),a>0&&w(`${a} conversation${a===1?``:`s`} could not be deleted.`)},Je=Y.useCallback(n=>t?(0,X.jsx)(ar,{conversationId:n.id,title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,lastUpdatedAt:n.updated_at,createdAt:n.created_at,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,isActive:n.id===r,onClose:e,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:b,agentKind:n.agent_kind,acpServer:n.acp_server},n.id):(0,X.jsx)(Fe,{to:`/conversations/${n.id}`,onClick:e,className:`block`,children:(0,X.jsx)(Qn,{onDelete:()=>He(n.id,n.title??``),onStop:()=>Ue(n.id),onChangeTitle:e=>We(n.id,e),title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},lastUpdatedAt:n.updated_at,createdAt:n.created_at,executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,conversationId:n.id,contextMenuOpen:de===n.id,onContextMenuToggle:e=>fe(e?n.id:null),isActive:n.id===r,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:b,agentKind:n.agent_kind,acpServer:n.acp_server})},n.id),[t,r,We,He,Ue,e,de,_,b]),K=me||!ge,Ye=ge&&!me&&!t&&ke&&!be?.length;return(0,X.jsxs)(`div`,{ref:o,"data-testid":`conversation-panel`,className:`flex h-full min-h-0 w-full flex-col`,children:[!t&&(0,X.jsx)(`div`,{className:V(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,L?`border-[var(--oh-border)]`:`border-transparent`),children:(0,X.jsxs)(`div`,{"data-testid":`older-conversations-summary`,className:`flex min-w-0 flex-nowrap items-center gap-x-2 py-2 pl-4 pr-2.5 text-[var(--oh-muted)]`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-[var(--oh-muted)]`,children:n(y.SIDEBAR$CONVERSATIONS)}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(yr,{backendKind:a.kind}),(0,X.jsx)(fr,{filterMenuOpen:N,setFilterMenuOpen:I,menuRef:R,backendKind:a.kind,organizeMode:E,setOrganizeMode:D,conversationSort:k,setConversationSort:A,threadScope:j,setThreadScope:M,showOlderConversations:h,toggleShowOlderConversations:g,showRepoBranchMetadata:_,toggleShowRepoBranchMetadata:v,showLlmProfiles:b,toggleShowLlmProfiles:T,totalConversationsCount:H.length,onRequestDeleteAll:()=>m(!0)})]})]})}),(0,X.jsxs)(`div`,{ref:se,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{ee(e.currentTarget.scrollTop>0)},className:V(`flex min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden overscroll-contain custom-scrollbar-always`,!t&&`conversation-panel-list-scroll`),children:[K&&(0,X.jsx)(ir,{compact:t}),!t&&Ye&&(0,X.jsx)(`div`,{"data-testid":`conversation-panel-empty-state`,className:`flex min-h-0 flex-1 flex-col items-center justify-center px-4 py-8`,children:(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:n(y.CONVERSATION$NO_CONVERSATIONS)})}),!t&&be?.map(t=>(0,X.jsx)(Fe,{to:`/conversations/task-${t.id}`,onClick:e,className:`block`,children:(0,X.jsx)(rr,{task:t})},t.id)),!K&&t?Ee.map(Je):null,!K&&!t&&E===`grouped`&&G&&G.length>0?(0,X.jsx)(`nav`,{"aria-label":n(y.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:G.map(e=>{let t=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,i=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),a=!z.has(e.id),o=ne.has(e.id),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=br(e.conversations,{expanded:o,activeConversationId:r});return(0,X.jsxs)(`section`,{"aria-labelledby":t,children:[(0,X.jsxs)(`div`,{className:V(`flex h-8 w-full min-w-0 items-center gap-0.5 rounded-md pl-2 pr-1 text-sm font-normal`,`text-[var(--oh-muted)] transition-colors`,`hover:bg-[var(--oh-surface-raised)] hover:text-white`),children:[(0,X.jsxs)(`button`,{type:`button`,id:t,"aria-expanded":a,onClick:()=>ae(e.id),className:`flex min-h-8 min-w-0 flex-1 items-center gap-2 rounded-md py-1 text-left text-inherit outline-none transition-colors focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,children:[(0,X.jsx)(O,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,X.jsx)(`button`,{type:`button`,className:V(`inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md`,`text-inherit transition-colors`,`hover:bg-white/10 hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`),disabled:Be,"aria-label":n(y.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,onClick:t=>{t.preventDefault(),t.stopPropagation(),Ve(e.launch)},children:(0,X.jsx)(he,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),a?(0,X.jsxs)(`div`,{className:`mt-0.5 space-y-0.5`,children:[s.map(Je),c?(0,X.jsx)(`div`,{className:`pl-2`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${i}`,onClick:()=>oe(e.id),className:`ml-[26px] cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:n(l?y.CONVERSATION_PANEL$LESS:y.CONVERSATION_PANEL$MORE)})}):null]}):null]},e.id)})}):null,!K&&!t&&E===`chronological`?(0,X.jsx)(`div`,{className:`space-y-0.5`,children:we.map(Je)}):null,Re&&(0,X.jsx)(`div`,{className:`flex justify-center py-4`,children:ve?(0,X.jsx)(Ae,{size:`small`}):(0,X.jsx)(`button`,{type:`button`,"data-testid":`load-more-conversations`,onClick:()=>ye(),className:`text-xs text-[var(--oh-muted)] hover:text-white`,children:n(y.CONVERSATION$LOAD_MORE)})})]}),s&&(0,X.jsx)(F,{onConfirm:()=>{Ge(),c(!1),ue(null)},onCancel:()=>{c(!1),ue(null)},conversationTitle:le??void 0}),p&&(0,X.jsx)(F,{title:n(y.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(y.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:H.length}),onConfirm:async()=>{await qe(),m(!1)},onCancel:()=>m(!1)}),l&&(0,X.jsx)(P,{onConfirm:()=>{Ke(),u(!1)},onCancel:()=>u(!1)}),d&&(0,X.jsx)(Fn,{onConfirm:()=>{e?.()},onClose:()=>f(!1),onCancel:()=>f(!1)})]})}function jr({collapsed:e}){return e?null:(0,X.jsx)(`div`,{className:`flex flex-col flex-1 min-h-0`,children:(0,X.jsx)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col`,children:(0,X.jsx)(Ar,{})})})}var Mr=e=>(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,X.jsx)(`mask`,{id:`mask0_18339_1445`,style:{maskType:`luminance`},maskUnits:`userSpaceOnUse`,x:1,y:1,width:18,height:18,children:(0,X.jsx)(`path`,{d:`M19 1H1V19H19V1Z`,fill:`white`})}),(0,X.jsxs)(`g`,{mask:`url(#mask0_18339_1445)`,children:[(0,X.jsx)(`path`,{d:`M10 18.1818V16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M10 1.81836V3.45472`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M1.81824 10H3.4546`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M18.1818 10H16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M5.93359 17.1019L6.74359 15.6782`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M14.0663 2.89844L13.2563 4.32208`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M2.89819 5.93359L4.32183 6.74359`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M17.1019 14.0663L15.6782 13.2563`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M5.92542 2.90625L6.7436 4.3217`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M14.0909 17.0854L13.2727 15.6699`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M17.0855 5.90918L15.67 6.72736`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M2.91455 14.0911L4.33001 13.2729`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M10 16.5455C13.615 16.5455 16.5455 13.615 16.5455 10C16.5455 6.38509 13.615 3.45459 10 3.45459C6.38509 3.45459 3.45459 6.38509 3.45459 10C3.45459 13.615 6.38509 16.5455 10 16.5455Z`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M12.5854 9.77916L8.80545 7.59461C8.63363 7.49643 8.41272 7.61916 8.41272 7.81552V12.1846C8.41272 12.381 8.62545 12.5119 8.80545 12.4055L12.5854 10.221C12.7573 10.1228 12.7573 9.86916 12.5854 9.77098V9.77916Z`,fill:`currentColor`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`})]})]}),$=18,Nr=34,Pr=Math.round(Nr*30/46);function Fr({collapsed:e,showCollapseToggle:t,showMobileCloseButton:n=!1,onCloseMobile:r,linkDisabled:i,collapseToggleLabel:a,onCollapse:o,onExpand:s,showCollapsedExpandButton:c,isExtensionsActive:l,currentPath:u,activeBackendHealth:d,collapsedBackendPopoverOpen:f,setCollapsedBackendPopoverOpen:p,collapsedBackendPopoverRef:m,collapsedBackendCloseTimer:h,onOpenAddBackend:g,onOpenManageBackends:v}){let{t:b}=S(`openhands`),x=h;return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:Le(e),children:[(0,X.jsxs)(`div`,{className:V(e&&t?ze:`flex min-w-0 shrink-0 items-center`),children:[(0,X.jsx)(`div`,{className:V(e&&t&&`flex h-full w-full items-center justify-start pl-2.5 transition-opacity duration-150`,e&&c&&`opacity-0`),children:(0,X.jsx)(vn,{logoWidth:Nr,logoHeight:Pr,logoClassName:`max-w-none`,className:V(We,`overflow-visible`)})}),e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":a,onClick:s,className:V(Ie,c?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),children:(0,X.jsx)(_,{width:14,height:14})}):null]}),!e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":a,onClick:o,className:V(`hidden md:inline-flex ml-auto`,He,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(R,{width:14,height:14})}):null,!e&&n?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-drawer-close`,onClick:r,"aria-label":b(y.SIDEBAR$CLOSE_MENU),className:V(`inline-flex ml-auto`,He,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(R,{width:14,height:14})}):null]}),(0,X.jsxs)(`nav`,{className:Ue(e),children:[(0,X.jsx)(qe,{to:`/conversations`,end:!0,label:`New Chat`,testId:`sidebar-conversations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(he,{width:$,height:$})}),(0,X.jsx)(qe,{to:`/customize`,label:`Customize`,testId:`sidebar-skills-link`,disabled:i,collapsed:e,forceActive:l,icon:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:$,height:$,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,X.jsx)(`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}),(0,X.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,X.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,X.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}),(0,X.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,X.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,X.jsx)(`path`,{d:`m17 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}),(0,X.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,X.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,X.jsx)(`path`,{d:`M12 13.5V8`})]})}),(0,X.jsx)(qe,{to:`/automations`,label:b(y.SIDEBAR$AUTOMATIONS),testId:`sidebar-automations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(Mr,{width:$,height:$})})]}),(0,X.jsx)(jr,{collapsed:e}),e&&t?(0,X.jsxs)(`nav`,{className:V(Ue(e),`mt-auto pb-2 cursor-pointer`),children:[(0,X.jsx)(K,{content:b(y.SIDEBAR$SETTINGS),placement:`right`,children:(0,X.jsxs)(Fe,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":b(y.SIDEBAR$SETTINGS),className:Be({collapsed:!0}),children:[(0,X.jsx)(Ke,{active:u.startsWith(`/settings`),children:(0,X.jsx)(mn,{width:$,height:$})}),(0,X.jsx)(`span`,{className:Re(!0),children:b(y.SIDEBAR$SETTINGS)})]})}),(0,X.jsxs)(`div`,{className:`relative`,ref:m,onMouseEnter:()=>{x.current&&=(clearTimeout(x.current),null),p(!0)},onMouseLeave:()=>{x.current=setTimeout(()=>p(!1),150)},children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`collapsed-backend-selector-link`,"aria-label":b(y.BACKEND$MANAGE),"aria-expanded":f,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:V(Be({collapsed:!0}),`relative`),children:[(0,X.jsx)(Ke,{active:f,children:(0,X.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,X.jsx)(wt,{isConnected:d?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,X.jsx)(pn,{width:$,height:$})]})}),(0,X.jsx)(`span`,{className:Re(!0),children:b(y.BACKEND$MANAGE)})]}),f?(0,X.jsx)(`div`,{className:`absolute bottom-[-4px] left-full pl-2.5 z-40 w-[272px]`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(Mn,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>p(!1),onOpenAddBackend:g,onOpenManageBackends:v})}):null]})]}):null,e?null:(0,X.jsx)(`div`,{className:V(`flex flex-col items-stretch max-w-none box-border shrink-0`,`-ml-2.5 w-[calc(100%+0.625rem)] border-t border-[var(--oh-border)] pt-2 px-2.5`),children:(0,X.jsx)(Mn,{sidebarCollapsed:e,openUpward:!0})})]})}var Ir=`openhands-sidebar`,Lr=`openhands-sidebar-collapsed`,Rr=Et()(Dt(e=>({collapsed:!1,setCollapsed:t=>e(e=>({collapsed:typeof t==`function`?t(e.collapsed):t})),toggleCollapsed:()=>e(e=>({collapsed:!e.collapsed}))}),{name:Ir,storage:Ot(()=>localStorage),partialize:e=>({collapsed:e.collapsed})}));if(typeof window<`u`)try{let e=window.localStorage.getItem(Lr);window.localStorage.getItem(Ir)===null&&(e===`true`||e===`false`)&&Rr.setState({collapsed:e===`true`}),e!==null&&window.localStorage.removeItem(Lr)}catch{}var zr=Y.lazy(()=>n(()=>import(`./settings-modal-BeAlR7Be.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]))),Br=Y.lazy(()=>n(()=>import(`./add-backend-modal-CSfOPrnr.js`).then(e=>e.n).then(e=>({default:e.AddBackendModal})),__vite__mapDeps([50,1,9,51,13,38,10,39,40,16,41,24,7,25,52,17,18,22,21,15,19,20,23,31,35,12,33,53,36,34]))),Vr=Y.lazy(()=>n(()=>import(`./manage-backends-modal-qpq2M_oN.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([54,1,13,38,9,10,39,40,16,41,24,7,25,15,17,18,55,56,57,19,20,51,52,22,21,23,31,35,12,33,53,36,34,58]))),Hr=250;function Ur(){let{t:e}=S(`openhands`),{currentPath:t}=Ne(),{data:n}=je(),{data:r,error:i,isError:a,isFetching:o}=Lt(),{backends:s,active:c}=U(),l=Ct(s)[c.backend.id],u=Rr(e=>e.collapsed),d=Rr(e=>e.setCollapsed),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Y.useRef(null),[_,v]=Y.useState(!1),[b,x]=Y.useState(!1),[C,T]=Y.useState(!1),E=Y.useRef(!1),[,D]=Y.useReducer(e=>e+1,0),{isOpen:O,close:k}=ee(),[A,j]=Y.useState(!1),[M,N]=Y.useState(!1),P=It(()=>h(!1)),F=Rt(i);Y.useEffect(()=>{k()},[t,k]),Y.useEffect(()=>{if(O){j(!0);let e=requestAnimationFrame(()=>{N(!0)});return()=>cancelAnimationFrame(e)}N(!1);let e=window.setTimeout(()=>{j(!1)},Hr);return()=>window.clearTimeout(e)},[O]),Y.useEffect(()=>{if(!O)return;let e=e=>{e.key===`Escape`&&k()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[O,k]),Y.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&F!==404?w(`Something went wrong while fetching settings. Please reload the page.`):F===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,F,n?.feature_flags?.hide_llm_settings]);let I=r?.email_verified===!1,L=e(u?y.SIDEBAR$EXPAND:y.SIDEBAR$COLLAPSE),R=Y.useCallback(e=>{if(!u)return;let t=e.target;t instanceof HTMLElement&&(t.closest(`a,button,input,textarea,select,[role='button'],[role='link']`)||d(!1))},[u,d]),z={linkDisabled:I,collapseToggleLabel:L,onCollapse:Y.useCallback(()=>{T(!1),E.current=!0,D(),d(!0),window.setTimeout(()=>{E.current=!1,D()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&C&&!E.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/mcp`,currentPath:t,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:P,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>v(!0),onOpenManageBackends:()=>x(!0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{"aria-label":e(y.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:R,onMouseEnter:()=>{u&&T(!0)},onMouseLeave:()=>{T(!1)},className:V(`max-md:hidden flex bg-base flex-col min-h-0 transition-[width,min-width] duration-200`,`md:border-r md:border-[var(--oh-border)] md:h-full`,u?`md:w-[60px] md:min-w-[60px] md:px-2.5`:`md:w-[300px] md:min-w-[300px] pb-2 md:pl-2.5 md:pr-0`,t===`/`&&`md:pb-3`),children:(0,X.jsx)(Fr,{collapsed:u,showCollapseToggle:!0,...z})}),A?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:V(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,M?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${Hr}ms`},onClick:k,"aria-hidden":!M}),(0,X.jsx)(`aside`,{"aria-label":e(y.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!M,className:V(`fixed inset-y-0 left-0 z-50 flex min-h-0 w-[min(300px,85vw)] flex-col bg-base`,`border-r border-[var(--oh-border)] pb-2 pl-2.5 pr-0 md:hidden`,`transition-transform ease-in-out motion-reduce:transition-none`,M?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${Hr}ms`},children:(0,X.jsx)(Fr,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:k,...z})})]}):null,f&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(zr,{settings:r,onClose:()=>p(!1)})}),_&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Br,{onClose:()=>v(!1)})}),b&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Vr,{onClose:()=>x(!1)})})]})}var Wr=`/settings`,Gr=`/customize`,Kr=[`/skills`,`/mcp`,`/plugins`];function qr(e){return e===Wr?{mode:`menu`}:e.startsWith(`${Wr}/`)&&e.length>9?{mode:`back`,backTo:Wr,backLabelKey:y.SETTINGS$TITLE}:e===Gr?{mode:`menu`}:Kr.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:Gr,backLabelKey:y.NAV$CUSTOMIZE}:{mode:`menu`}}function Jr(){let{t:e}=S(`openhands`),{currentPath:t,navigate:n}=Ne(),r=qr(t);return(0,X.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(y.SIDEBAR$NAVIGATION_LABEL),children:[(0,X.jsx)(ne,{}),r.mode===`back`&&r.backTo?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-back-button`,onClick:()=>n(r.backTo),"aria-label":e(r.backLabelKey??y.COMMON$BACK),className:z,children:(0,X.jsx)(R,{size:20,className:I,"aria-hidden":!0,strokeWidth:2})}):null]})}var Yr=()=>{let e=we(),{mutate:t}=tn();return{migrateUserConsent:Y.useCallback(async n=>{let r=localStorage.getItem(`analytics-consent`);r&&(n?.handleAnalyticsWasPresentInLocalStorage(),t({user_consents_to_analytics:r===`true`},{onSuccess:()=>{en(e,r===`true`)}}),localStorage.removeItem(`analytics-consent`))},[e,t])}};function Xr(){let{backend:e}=Ce(),t=e.kind===`local`,{data:n}=Bt(),{mutate:r,isPending:i}=ge(),a=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{a.current=null},[e.id]),(0,Y.useEffect)(()=>{if(!t||i||!n)return;let{profiles:e,active_profile:o}=n,s=o!=null&&e.some(e=>e.name===o);if(e.length===0||s){a.current=null;return}let c=e.find(e=>e.api_key_set)??e[0];a.current!==c.name&&(a.current=c.name,r(c.name))},[t,n,i,r])}var Zr=()=>{let e=we(),{data:t}=Lt();Y.useEffect(()=>{!e||t===void 0||en(e,t.user_consents_to_analytics===!0)},[e,t])},Qr=()=>{let e=we(),{backend:t}=Ce(),{data:n}=Lt(),r=Ge(),i=Y.useRef(!1),a=t.kind===`cloud`,o=a?r[t.id]?.userId??null:null,s=n?.user_consents_to_analytics;Y.useEffect(()=>{if(!(!e||!a||n===void 0)){if(s===!0&&o){e.identify(o,{email:n.email??n.git_user_email??void 0}),i.current=!0;return}(s===!1||i.current&&!o)&&(e.reset(),i.current=!1)}},[e,a,s,o,n?.email,n])};function $r(e){switch(e){case H.RUNNING:return`🟢`;case H.FINISHED:case H.IDLE:case H.WAITING_FOR_CONFIRMATION:return`✅`;case H.PAUSED:return`⚪`;case H.ERROR:case H.STUCK:return`🔴`;default:return null}}var ei=`OpenHands`,ti=()=>{let{conversationId:e}=l(),{data:t}=nn(e??null),n=rn(e=>e.execution_status),r=t?.title,i=e&&r?`${r} | ${ei}`:ei;if(!e)return i;let a=$r(n??t?.execution_status??null);return a?`${a} ${i}`:i};function ni({children:e}){let{pathname:t}=p(),n=s(),r=c(),i=f(),a=Y.useMemo(()=>{for(let e=i.length-1;e>=0;--e){let t=i[e]?.params?.conversationId;if(t)return t}return null},[i]);return(0,X.jsx)(Pe,{value:Y.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var ri=Y.lazy(()=>n(()=>import(`./environment-switch-overlay-BgYKFdf6.js`),__vite__mapDeps([59,1,12,10,9,19,20,60]))),ii=Y.lazy(()=>n(()=>import(`./analytics-consent-form-modal-CdP5JRph.js`).then(e=>({default:e.AnalyticsConsentFormModal})),__vite__mapDeps([61,47,1,48,10,9,19,20,62,4,23,24,7,25,32,33,34,35,12,37,38,13,39,40,16,41,42,18,43,21,22,44,45,15,17,46,63]))),ai=Y.lazy(()=>n(()=>import(`./alert-banner-BUqPui_3.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([64,1,65,10,9,19,20,66,67,24,7,25,36,68,69,28]))),oi=u(function(){let e=a(),{t}=S(`openhands`);return i(e)?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:e.status}),(0,X.jsx)(`p`,{children:e.statusText}),(0,X.jsx)(`pre`,{children:e.data instanceof Object?JSON.stringify(e.data):e.data})]}):e instanceof Error?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:t(y.ERROR$GENERIC)}),(0,X.jsx)(`pre`,{children:e.message})]}):(0,X.jsx)(`div`,{children:(0,X.jsx)(`h1`,{children:t(y.ERROR$UNKNOWN)})})}),si=o(function(){let e=p(),t=ti(),{data:n}=Lt(),{migrateUserConsent:r}=Yr(),i=je(),[a,o]=Y.useState(!1);if(Zr(),Qr(),Xr(),Y.useEffect(()=>{n?.language&&T.changeLanguage(n.language)},[n?.language]),Y.useEffect(()=>{o(n?.user_consents_to_analytics===null)},[n?.user_consents_to_analytics]),Y.useEffect(()=>{r({handleAnalyticsWasPresentInLocalStorage:()=>{o(!1)}})},[r]),i.isLoading)return(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-base`,children:(0,X.jsx)(Ae,{size:`large`})});let s=/^\/conversations\/[^/]+/.test(e.pathname),c=le(e.search);return(0,X.jsx)(ni,{children:(0,X.jsxs)(M,{children:[(0,X.jsxs)(`div`,{"data-testid":`root-layout`,className:`h-screen lg:min-w-5xl flex flex-col md:flex-row bg-base overflow-hidden p-0`,children:[(0,X.jsx)(`title`,{children:t}),(0,X.jsx)(Ur,{}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col w-full min-w-0 h-full gap-3`,children:[s?null:(0,X.jsx)(Jr,{}),i.data&&(i.data.maintenance_start_time||i.data.faulty_models&&i.data.faulty_models.length>0||i.data.error_message)&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(ai,{maintenanceStartTime:i.data.maintenance_start_time,faultyModels:i.data.faulty_models,errorMessage:i.data.error_message,updatedAt:i.data.updated_at})}),(0,X.jsx)(`div`,{id:`root-outlet`,className:`relative flex-1 overflow-auto px-0 custom-scrollbar`,children:(0,X.jsx)(d,{})})]}),a&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(ii,{onClose:()=>{o(!1)}})})]}),(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(ri,{})}),c?(0,X.jsx)(pe,{}):null]})})});export{oi as ErrorBoundary,si as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-CeRvS5Bc.js","assets/rolldown-runtime-BFRubm34.js","assets/model-selector-sioC8xP4.js","assets/vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BIm99UaF.js","assets/preload-helper-CT1Z6Pdu.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-BP3MGAAY.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-7eqKdLSQ.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~nh19ovoo-DJTFnsA1.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-BmZcy_kH.js","assets/declaration-D9ucT0fq.js","assets/react-CM_dJw1Z.js","assets/vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-xCM3k6Rd.js","assets/react-dom-hVBnwgwZ.js","assets/agent-server-client-options-B-C8JaTb.js","assets/llm-client-P9f2gKeW.js","assets/useQuery-DGRSm7IT.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js","assets/suspense-Bqb0V0q1.js","assets/QueryClientProvider-XcSjsfpb.js","assets/useTranslation-CL6FTf1b.js","assets/context-CI9FqkUp.js","assets/proxy--Uy1iGsW.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-_LydBB1e.js","assets/brand-button-9SOzmqPP.js","assets/utils-eXk6yerZ.js","assets/common-Dh7OqABE.js","assets/combobox-caret-C9BNHfSu.js","assets/sdk-settings-schema-Big50zDH.js","assets/dist-5dObF4p4.js","assets/sdk-settings-field-metadata-p2GVlft7.js","assets/map-provider-BM2SJarp.js","assets/settings-input-BM8ANxDb.js","assets/base-modal-DvuGYyu1.js","assets/modal-body-Cd-PtMHr.js","assets/modal-classes-CNm4ovfm.js","assets/modal-backdrop-_VbcKk5K.js","assets/navigation-context-BpAOh_t5.js","assets/use-save-settings-Xp8DD-jf.js","assets/active-backend-context-CNF2lPkA.js","assets/query-client-config-Ca3tW1AH.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js","assets/createLucideIcon-CkGTf9Qj.js","assets/useMutation-Dm84WAKR.js","assets/settings-service.api-CFt5HmXD.js","assets/settings-wh2sLLJM.js","assets/use-settings-0SeqaDeW.js","assets/use-tracking-BhyV5A9i.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BmOMM-6e.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-Cl4h-NSi.js","assets/settings-utils--H_EvFjx.js","assets/add-backend-modal-BywVr6uq.js","assets/backend-form-modal-Dl29wkF5.js","assets/organization-service.api-BNc9Kn6n.js","assets/modal-close-button-Dbo0NAMt.js","assets/manage-backends-modal-tfdzTXWU.js","assets/pencil-DPEtl5QD.js","assets/plus-DKUID4kd.js","assets/trash-2-C-RvV8WA.js","assets/confirmation-modal-Cq3eqvqH.js","assets/environment-switch-overlay-wB5LxfYZ.js","assets/environment-switch-store-CiurvTtK.js","assets/analytics-consent-form-modal-CVhsAREx.js","assets/telemetry-DCFAqpIA.js","assets/handle-capture-consent-CPMXU29K.js","assets/alert-banner-Bsvys-hT.js","assets/vendor~conversation-panel~conversation~alert-banner-CtjHOMO_.js","assets/vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CsO1gYxF.js","assets/iconBase-BVhFI-0E.js","assets/close--W-tHn1h.js","assets/typography-BLSEGjph.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{A as r,C as i,F as a,L as o,M as s,N as c,P as l,R as u,c as d,j as f,k as p}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js";import{t as m}from"./react-dom-hVBnwgwZ.js";import{d as h,t as g,u as _}from"./path-utils-YlkpoImJ.js";import{o as v,t as y}from"./declaration-D9ucT0fq.js";import{t as b}from"./useQuery-DGRSm7IT.js";import{r as x}from"./recommended-automations-launcher-DCi0RXIj.js";import{t as S}from"./useTranslation-CL6FTf1b.js";import{m as C,p as w,x as T}from"./query-client-config-Ca3tW1AH.js";import{t as E}from"./createLucideIcon-CkGTf9Qj.js";import{t as D}from"./vendor~root-layout~home~conversation-panel~conversation-eG1kjEbj.js";import{a as O,i as k,o as A}from"./vendor~root-layout~home~mcp~automations-list-D40jgugf.js";import{t as j}from"./check-BhnsMsWy.js";import{a as M,c as N,d as P,f as F,i as I,l as L,o as ee,p as R,r as z,s as te,t as ne,u as re}from"./sidebar-mobile-menu-toggle-SKcwsEtD.js";import{a as ie,c as ae,d as oe,f as se,i as B,l as ce,n as le,o as ue,r as de,s as fe,t as pe,u as me}from"./onboarding-CQh50i2z.js";import{t as he}from"./plus-DKUID4kd.js";import{a as ge}from"./llm-settings-yDgbXP6Q.js";import{t as _e}from"./trash-2-C-RvV8WA.js";import{t as ve}from"./x-CCfDppg5.js";import{t as V,v as ye,x as be,y as xe}from"./utils-eXk6yerZ.js";import{t as H}from"./common-Dh7OqABE.js";import{u as Se}from"./agent-server-client-options-B-C8JaTb.js";import{n as Ce,r as U}from"./active-backend-context-CNF2lPkA.js";import{t as W}from"./agent-server-conversation-service.api-CGbkhsLj.js";import{n as we}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BmOMM-6e.js";import{t as Te}from"./modal-backdrop-_VbcKk5K.js";import{n as G}from"./modal-body-Cd-PtMHr.js";import{i as Ee,r as De}from"./base-modal-DvuGYyu1.js";import{g as Oe,s as ke}from"./brand-button-9SOzmqPP.js";import{t as Ae}from"./loading-spinner-D7bOU6I7.js";import{t as je}from"./use-config-5zEjywCL.js";import{t as Me}from"./openhands-logo-Dzm-d_V_.js";import{n as Ne,t as Pe}from"./navigation-context-BpAOh_t5.js";import{t as Fe}from"./navigation-link-Dci7Nuyf.js";import{a as Ie,d as Le,f as Re,i as ze,m as Be,n as Ve,o as He,p as Ue,s as We,t as Ge}from"./use-cloud-current-user-id-DVZXa_WH.js";import{n as Ke,t as qe}from"./sidebar-nav-link-CPWuQ_c6.js";import{t as Je}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ceijy54y-Dkd2wxJA.js";import{t as K}from"./styled-tooltip-X61SEwqk.js";import{a as Ye,d as Xe,f as Ze,i as Qe,l as $e,n as et,o as tt,r as nt,u as rt}from"./dropdown-classes-CVp0kVdt.js";import{r as it,t as at}from"./combobox-caret-C9BNHfSu.js";import{_ as ot,a as st,c as ct,d as lt,f as ut,g as dt,h as ft,i as pt,l as mt,m as ht,n as gt,o as _t,p as vt,r as yt,u as bt,v as xt,y as St}from"./chat-send-button-BhoO7T0s.js";import{o as Ct,r as wt}from"./backend-form-modal-Dl29wkF5.js";import{s as Tt}from"./environment-switch-store-CiurvTtK.js";import{t as Et}from"./react-Dy05vyj5.js";import{i as Dt,n as Ot,t as kt}from"./conversation-store-FQmakEd-.js";import{t as At}from"./add-backend-modal-BywVr6uq.js";import{t as jt}from"./manage-backends-modal-tfdzTXWU.js";import{c as Mt,d as Nt,u as Pt}from"./acp-providers-BqUvf67Q.js";import{t as Ft}from"./use-is-authed-B8eLO-Xq.js";import{t as It}from"./use-click-outside-element-DhxCUyWl.js";import{r as Lt,t as Rt}from"./use-settings-0SeqaDeW.js";import{t as zt}from"./use-tracking-BhyV5A9i.js";import{t as Bt}from"./use-llm-profiles-CWLfWjav.js";import{t as Vt}from"./use-create-conversation-pV2eA-e9.js";import{t as Ht}from"./conversation-service.api-shHWtFwu.js";import{r as Ut,t as Wt}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-COLUW-6M.js";import{n as Gt,t as q}from"./context-menu-list-item-BQU0jZPq.js";import{i as J,r as Kt,t as qt}from"./ellipsis-button-k7HLwYth.js";import{t as Jt}from"./u-edit-DIgADxLH.js";import{t as Yt}from"./skills-BE5HJuGM.js";import{a as Xt,o as Zt,t as Qt}from"./vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CsO1gYxF.js";import{t as $t}from"./search-C_l_XW4e.js";import{t as en}from"./handle-capture-consent-CPMXU29K.js";import{t as tn}from"./use-save-settings-Xp8DD-jf.js";import{t as nn}from"./use-user-conversation-6yFVEXiG.js";import{t as rn}from"./conversation-state-store-NEktJKfL.js";var an=E(`calendar-arrow-down`,[[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M18 14v8`,key:`irew45`}],[`path`,{d:`M21 11.354V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7.343`,key:`bse4f3`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}]]),on=E(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),sn=E(`clock-arrow-down`,[[`path`,{d:`M12 6v6l2 1`,key:`19cm8n`}],[`path`,{d:`M12.337 21.994a10 10 0 1 1 9.588-8.767`,key:`28moa`}],[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M18 14v8`,key:`irew45`}]]),cn=E(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ln=E(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),un=E(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),dn=E(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),fn=E(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),pn=E(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),mn=E(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),hn=E(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Y=e(t(),1),X=v(),gn=46,_n=30;function vn({className:e,logoClassName:t,logoWidth:n=gn,logoHeight:r=_n}={}){let{t:i}=S(`openhands`);return(0,X.jsx)(Fe,{to:`/conversations`,"aria-label":i(y.BRANDING$OPENHANDS_LOGO),className:V(e),children:(0,X.jsx)(Me,{width:n,height:r,className:V(`shrink-0`,t)})})}function yn(){return(0,X.jsx)(`div`,{className:`animate-spin h-4 w-4 border-2 border-transparent border-t-white rounded-full`,"data-testid":`dropdown-loading`})}function bn({onClear:e}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-clear`,onClick:e,"aria-label":`Clear selection`,className:`text-white hover:text-[var(--oh-text-tertiary)]`,children:(0,X.jsx)(ve,{size:14})})}function xn({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:V(it,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,X.jsx)(at,{})})}function Sn({isOpen:e,filteredOptions:t,selectedItem:n,emptyMessage:r,getMenuProps:i,getItemProps:a,footer:o,openUpward:s=!1,fitContent:c=!1}){return(0,X.jsxs)(`div`,{className:V(`absolute z-50 overflow-hidden text-white`,c?`min-w-full w-max`:`w-full`,s?`bottom-full mb-1`:`mt-1`,`bg-tertiary rounded-[6px] context-menu-box-shadow p-1`,`max-h-60 overflow-auto`,!e&&`hidden`),children:[(0,X.jsxs)(`ul`,{...i({className:V(`p-0`,Qe)}),children:[e&&t.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,children:r}),e&&t.map((e,t)=>(0,X.jsxs)(`li`,{...a({item:e,index:t,className:V(tt,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,X.jsx)(`span`,{className:rt,children:e.prefix}):null,(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label})]},e.value))]}),e&&o?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(St,{inset:`menu`}),(0,X.jsx)(`div`,{className:`p-0`,children:o})]}):null]})}function Cn({placeholder:e,isDisabled:t,getInputProps:n,italicPlaceholder:r=!0,fitContent:i=!1}){return(0,X.jsx)(`input`,{...n({placeholder:e,disabled:t,className:V(`outline-none bg-transparent text-white not-italic`,i?`w-auto field-sizing-content whitespace-nowrap text-sm`:`flex-1 min-w-0`,r&&`placeholder:italic placeholder:text-tertiary-alt`,!r&&`placeholder:text-tertiary-alt`,ke,`px-0 not-italic text-inherit`)})})}var wn={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function Tn({options:e,emptyMessage:t=`No options`,clearable:n=!1,loading:r=!1,disabled:i=!1,placeholder:a,defaultValue:o,onChange:s,testId:c,className:l,footer:u,openUpward:d=!1,hideTrigger:f=!1,defaultOpen:p=!1,openOnHover:m=!1,italicPlaceholder:h=!0,fitContent:g=!1}){let _=Y.useRef(null),[v,y]=(0,Y.useState)(o?.label??``),[b,x]=(0,Y.useState)(``),S=e.filter(e=>e.label.toLowerCase().includes(b.toLowerCase())),{isOpen:C,selectedItem:w,selectItem:T,openMenu:E,closeMenu:O,getToggleButtonProps:k,getMenuProps:A,getItemProps:j,getInputProps:M}=D({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===D.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes,initialIsOpen:p,onInputValueChange:({inputValue:e})=>{y(e??``),x(e??``)},defaultSelectedItem:o,onSelectedItemChange:({selectedItem:e})=>{s?.(e??null)},onIsOpenChange:({isOpen:e,selectedItem:t})=>{e?(y(``),x(``)):(y(t?.label??``),x(``))}}),N=r||i,P=w?e.find(e=>e.value===w.value)??w:null,F=e=>M({...e,onChange:e=>{y(e.target.value),x(e.target.value)}});return(0,X.jsxs)(`div`,{className:V(`relative`,g?`inline-block w-auto`:`w-full`),"data-testid":c,onMouseEnter:m?()=>{_.current&&=(clearTimeout(_.current),null),E()}:void 0,onMouseLeave:m?()=>{_.current=setTimeout(()=>O(),150)}:void 0,children:[f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{...F({"aria-label":a??`Filter options`,tabIndex:-1}),style:wn}),(0,X.jsx)(`button`,{type:`button`,...k({tabIndex:-1}),style:wn,"aria-hidden":!0})]}):(0,X.jsxs)(`div`,{className:V(Ze,g?`w-auto`:`w-full`,N&&`cursor-not-allowed opacity-60`,l),children:[P?.prefix?(0,X.jsx)(`span`,{className:`flex items-center shrink-0`,children:P.prefix}):null,(0,X.jsx)(Cn,{placeholder:a,isDisabled:N,getInputProps:F,italicPlaceholder:h,fitContent:g}),r&&(0,X.jsx)(yn,{}),n&&w&&(0,X.jsx)(bn,{onClear:()=>T(null)}),(0,X.jsx)(xn,{isOpen:C,isDisabled:N,getToggleButtonProps:k})]}),(0,X.jsx)(Sn,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:A,getItemProps:j,footer:u,openUpward:d,fitContent:g})]})}var En=`::`;function Dn(e,t){return t?`${e}${En}${t}`:e}function On(e){let[t,n]=e.split(En);return{backendId:t,orgId:n??null}}function kn(e){return(0,X.jsx)(wt,{isConnected:e?.isConnected??null})}function An(){return(0,X.jsx)(wt,{isConnected:`unavailable`})}function jn(e,t,n,r,i){let a=[],o=e.filter(e=>e.kind===`local`),s=e.filter(e=>e.kind===`cloud`);for(let e of o)a.push({value:Dn(e.id,null),label:e.name,prefix:kn(i[e.id])});for(let e of s){let o=n[e.id],s=kn(i[e.id]);if(!o||o.orgs.length===0)a.push({value:Dn(e.id,null),label:e.name,prefix:s});else{let n=r[e.id]?.userId??null;for(let r of o.orgs){let i=n&&n===r.id?t:r.name;a.push({value:Dn(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function Mn({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:i,onOpenAddBackend:a,onOpenManageBackends:o,sidebarCollapsed:c=!1}={}){let{t:l}=S(`openhands`),{backends:u,active:d,setActive:f}=U(),p=Ve(),m=Ge(),h=Ct(u),g=s(),_=r(`/settings`),v=r(`/settings/*`),b=r(`/conversations/:conversationId`),x=r(`/automations/:automationId`),[C,w]=Y.useState(!1),[T,E]=Y.useState(!1),D=l(y.BACKEND$PERSONAL_WORKSPACE),O=Y.useMemo(()=>jn(u,D,p,m,h),[u,D,p,m,h]),k=Se(d.backend),A=l(y.BACKEND$NO_BACKEND_AVAILABLE),j=Dn(d.backend.id,d.orgId),M=k?void 0:O.find(e=>e.value===j),N=!!(_||v),P=l(y.SIDEBAR$SETTINGS),F=kt(e=>e.isRightPanelShown),I=!c||b&&F?`top`:`left`,L=Object.values(p).some(e=>e.isLoading);Y.useEffect(()=>{if(k||d.backend.kind!==`cloud`||d.orgId)return;let{backend:e}=d,t=p[e.id];if(!t||t.orgs.length===0)return;let n=m[e.id]?.userId??null,r=(n?t.orgs.find(e=>e.id===n):void 0)??t.orgs[0];r&&f(e.id,r.id)},[d,p,m,f,k]);let ee=Y.useCallback(()=>{if(a){a(),i?.();return}w(!0)},[a,i]),R=Y.useCallback(()=>{if(o){o(),i?.();return}E(!0)},[o,i]),z=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),te=(0,X.jsxs)(`div`,{className:Qe,children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:z,onClick:ee,className:V(et,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:rt,"aria-hidden":!0,children:(0,X.jsx)(he,{width:16,height:16})}),l(y.BACKEND$ADD)]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:z,onClick:R,className:V(et,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:rt,"aria-hidden":!0,children:(0,X.jsx)(mn,{width:16,height:16})}),l(y.BACKEND$MANAGE)]})]}),ne=Y.useCallback(async e=>{if(e===j)return;let{backendId:t,orgId:n}=On(e),r=u.find(e=>e.id===t);r&&(Tt(O.find(t=>t.value===e)?.label??r.name),await new Promise(e=>{setTimeout(e,400)}),b?g(`/conversations`):x&&g(`/automations`),f(r.id,n),i?.())},[j,u,b,x,g,O,f,l,i]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 w-full`,children:[(0,X.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,X.jsx)(Tn,{testId:`backend-selector`,defaultValue:M??{value:j,label:k?A:d.backend.name,prefix:k?An():kn(h[d.backend.id])},footer:te,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&ne(e.value)},placeholder:k?A:d.backend.name,loading:L,options:O,className:`h-10 px-2 py-0 bg-transparent border-transparent hover:bg-[var(--oh-surface-raised)] focus-within:bg-[var(--oh-surface-raised)] focus-within:border-transparent focus-within:ring-0`},`${j}-${M?.label??``}`)}),t?null:(0,X.jsx)(K,{content:P,placement:I,offset:10,children:(0,X.jsx)(Fe,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":N,"aria-label":P,className:V(N?`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md bg-tertiary text-white font-normal cursor-pointer`:`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)] cursor-pointer`,Oe),children:(0,X.jsx)(mn,{width:16,height:16})})})]}),C?(0,X.jsx)(At,{onClose:()=>w(!1)}):null,T?(0,X.jsx)(jt,{onClose:()=>E(!1)}):null]})}var Nn=(e=20)=>{let{data:t}=Ft(),n=Ce(),r=!Se(n.backend);return h({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await W.searchConversations(e,t),enabled:!!t&&r,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:n.backend.id}})},Pn=(e=10)=>b({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function Fn({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=S(`openhands`);return(0,X.jsx)(Te,{onClose:n,children:(0,X.jsxs)(G,{testID:`confirm-new-conversation-modal`,children:[(0,X.jsx)(De,{title:r(y.CONVERSATION$EXIT_WARNING)}),(0,X.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,X.jsx)(Ee,{text:r(y.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,X.jsx)(Ee,{text:r(y.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}var In=e=>e.includes(`Z`)||e.match(/[+-]\d{2}:\d{2}$/)!==null?new Date(e):new Date(`${e}Z`),Ln=e=>{let t=typeof e==`string`?In(e):e,n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24),s=Math.floor(o/30),c=Math.floor(s/12);return r<60?`${r}s`:i<60?`${i}m`:a<24?`${a}h`:o<30?`${o}d`:s<12?`${s}mo`:`${c}y`};function Rn({titleMode:e,title:t,onSave:n,isConversationArchived:r}){return e===`edit`?(0,X.jsx)(`input`,{autoFocus:!0,"data-testid":`conversation-card-title`,onClick:e=>{e.preventDefault(),e.stopPropagation()},onBlur:e=>{n(e.currentTarget?.value?.trim?.()??``)},onKeyUp:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&e.currentTarget.blur()},type:`text`,defaultValue:t,className:`text-sm leading-6 font-semibold bg-transparent w-full`}):(0,X.jsx)(`p`,{"data-testid":`conversation-card-title`,className:V(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),title:t,children:t})}var zn=e=>{switch(e){case H.FINISHED:return`check`;case H.RUNNING:return`working`;case H.IDLE:case H.WAITING_FOR_CONFIRMATION:return`active`;case H.PAUSED:return`paused`;case H.ERROR:case H.STUCK:return`error`;default:return`unknown`}},Bn=(e,t)=>{if(t)return`COMMON$ARCHIVED`;switch(e){case`check`:return`COMMON$FINISHED`;case`working`:case`active`:return`COMMON$WORKING`;case`paused`:return`COMMON$PAUSED`;case`error`:return`COMMON$ERROR`;default:return`COMMON$STOPPED`}};function Vn(e){switch(e){case`check`:return(0,X.jsx)(`svg`,{"data-testid":`conversation-status-check`,viewBox:`0 0 12 12`,className:`w-2.5 h-2.5 stroke-[var(--oh-status-success)]`,fill:`none`,strokeWidth:2.25,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M2.5 6.5 5 9l4.5-5.5`})});case`working`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-working`,className:`w-1.5 h-1.5 rounded-full animate-pulse bg-[var(--oh-status-success)]`});case`active`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-active`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-success)]`});case`paused`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-paused`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-muted)]`});case`error`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-error`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-error)]`});default:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-unknown`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-color-tertiary)]`})}}function Hn({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=S(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:zn(e),o=r(Bn(a,i)),s=(0,X.jsx)(`div`,{className:`w-2.5 h-2.5 flex items-center justify-center shrink-0`,children:i?(0,X.jsx)(Wt,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):Vn(a)});return n?(0,X.jsx)(K,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function Un({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){let a=dt(i);return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[r!==void 0&&(0,X.jsx)(`div`,{className:`flex w-[18px] shrink-0 items-center justify-center`,children:(0,X.jsx)(Hn,{executionStatus:r,sandboxStatus:i})}),(0,X.jsx)(Rn,{title:e,titleMode:t,onSave:n,isConversationArchived:a})]})}var Wn=e(m(),1);function Gn({onClose:e,onDelete:t,onStop:n,onEdit:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onDownloadViaVSCode:s,onDownloadConversation:c,position:l=`bottom`,floatingStyle:u,ignoreOutsideClickRef:d}){let{t:f}=S(`openhands`),{backend:p}=Ce(),m=It(e,d),h=p.kind===`cloud`?y.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:y.COMMON$STOP_CONVERSATION,g=(0,Y.useCallback)((e,t,n)=>{let r=e.filter(e=>e!=null);return r.length>0?n?(0,X.jsx)(Y.Fragment,{children:r},t):(0,X.jsxs)(Y.Fragment,{children:[r,(0,X.jsx)(St,{inset:`menu`})]},t):null},[]),_=u!=null;return(0,X.jsxs)(Gt,{ref:m,testId:`context-menu`,style:_?u:void 0,theme:_?`popover`:`default`,position:_?`none`:l,alignment:_?`none`:`right`,spacing:_?`none`:`default`,className:_?`mt-0 min-w-[200px] w-max max-w-[min(280px,100vw-16px)]`:`z-[200] mt-0`,children:[g([r&&(0,X.jsx)(q,{testId:`edit-button`,onClick:r,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Jt,{width:16,height:16}),text:f(y.BUTTON$RENAME)})},`edit-button`)],`edit-section`),g([a&&(0,X.jsx)(q,{testId:`show-agent-tools-button`,onClick:a,children:(0,X.jsx)(J,{icon:(0,X.jsx)(ft,{width:16,height:16}),text:f(y.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})},`show-agent-tools-button`),o&&(0,X.jsx)(q,{testId:`show-skills-button`,onClick:o,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Yt,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:f(y.CONVERSATION$SHOW_SKILLS)})},`show-skills-button`)],`tools-section`),g([n&&(0,X.jsx)(q,{testId:`stop-button`,onClick:n,children:(0,X.jsx)(J,{icon:(0,X.jsx)(ht,{width:16,height:16}),text:f(h)})},`stop-button`),s&&(0,X.jsx)(q,{testId:`download-vscode-button`,onClick:s,children:(0,X.jsx)(J,{icon:(0,X.jsx)(N,{width:16,height:16}),text:f(y.BUTTON$DOWNLOAD_VIA_VSCODE)})},`download-vscode-button`),c&&(0,X.jsx)(q,{testId:`download-trajectory-button`,onClick:c,children:(0,X.jsx)(J,{icon:(0,X.jsx)(N,{width:16,height:16}),text:f(y.BUTTON$EXPORT_CONVERSATION)})},`download-trajectory-button`)],`control-section`),g([i&&(0,X.jsx)(q,{testId:`display-cost-button`,onClick:i,children:(0,X.jsx)(J,{icon:(0,X.jsx)(te,{width:16,height:16}),text:f(y.BUTTON$DISPLAY_COST)})},`display-cost-button`),t&&(0,X.jsx)(q,{testId:`delete-button`,onClick:t,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Kt,{width:16,height:16}),text:f(y.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function Kn({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onStop:r,onEdit:i,onDownloadViaVSCode:a,onDownloadConversation:o,executionStatus:s,conversationId:c,showOptions:l}){let u=be(s),d=xe(s),f=(0,Y.useRef)(null),[,p]=(0,Y.useReducer)(e=>e+1,0);(0,Y.useLayoutEffect)(()=>{if(!e)return;p();let t=0,n=()=>{t||=window.requestAnimationFrame(()=>{t=0,p()})};return window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{t&&window.cancelAnimationFrame(t),window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[e]);let m=(()=>{if(!e||!f.current)return;let t=f.current.getBoundingClientRect(),n=Number(window.innerWidth)||0,r=Number(window.innerHeight)||0,i=Number(t.bottom)||0,a=Number(t.right)||0;return{position:`fixed`,top:i+280+8>r?Math.max(8,t.top-280-4):i+4,right:Math.max(8,n-a),zIndex:1e5}})(),h=typeof document<`u`?document.body:null;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(qt,{ref:f,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},className:V(u&&`opacity-60`)}),e&&m&&h?(0,Wn.createPortal)((0,X.jsx)(Gn,{ignoreOutsideClickRef:f,floatingStyle:m,onClose:()=>t(!1),onDelete:n,onStop:d?r:void 0,onEdit:i,onDownloadViaVSCode:c&&l?a:void 0,onDownloadConversation:c?o:void 0,position:`bottom`}),h):null]})}var qn={bitbucket:Qt,bitbucket_data_center:Qt,github:Xt,gitlab:Zt};function Jn({selectedRepository:e}){let t=e.git_provider?qn[e.git_provider]:null;return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[t&&(0,X.jsx)(t,{size:14,className:`shrink-0 text-[var(--oh-muted)]`}),e.git_provider===`azure_devops`&&(0,X.jsx)(vt,{className:`h-[14px] w-[14px] shrink-0 text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{"data-testid":`conversation-card-selected-repository`,className:`min-w-0 truncate text-xs text-[var(--oh-muted)]`,children:e.selected_repository})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,X.jsx)(Ut,{size:12,className:`shrink-0 text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{"data-testid":`conversation-card-selected-branch`,className:`min-w-0 truncate text-xs text-[var(--oh-muted)]`,children:e.selected_branch})]})]})}function Yn({workspaceWorkingDir:e}){let{t}=S(`openhands`),n=e?g(e).trim():``;return n?(0,X.jsx)(`span`,{className:`truncate min-w-0 text-xs text-[var(--oh-muted)] flex-1`,title:e??void 0,children:n}):(0,X.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-[var(--oh-muted)] flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(ut,{width:14,height:14,className:`text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:t(y.COMMON$NO_REPOSITORY)})]})}function Xn({selectedRepository:e,lastUpdatedAt:t,createdAt:n,executionStatus:r,workspaceWorkingDir:i,showRepositoryMetadata:a=!0,showTimestamp:o=!0,llmModel:s,showAgentChip:c=!1,agentKind:l=null,acpServer:u=null}){let{t:d}=S(`openhands`),f=be(r),p=null;if(c)if(l===`acp`){let e=Mt(u)??d(y.CONVERSATION$ACP_AGENT_GENERIC),t=Pt(u,s),n=t??e;p={kind:Nt(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(p={kind:`openhands`,text:s,tooltip:s});let m=r===void 0?void 0:`pl-[26px]`;return(0,X.jsxs)(`div`,{className:V(`flex flex-col gap-0.5 mt-0.5 w-full min-w-0`,f&&`opacity-60`),children:[p?(0,X.jsx)(`div`,{className:m,children:(0,X.jsxs)(`span`,{"data-testid":`conversation-card-agent-chip`,className:`inline-flex items-center gap-1 text-xs text-[var(--oh-muted)] max-w-full min-w-0`,title:p.tooltip,children:[(0,X.jsx)(se,{kind:p.kind}),(0,X.jsx)(`span`,{className:`truncate`,children:p.text})]})}):null,(0,X.jsxs)(`div`,{className:V(`flex flex-row items-center gap-2 w-full min-w-0`,a&&m),children:[a&&(e?.selected_repository?(0,X.jsx)(Jn,{selectedRepository:e}):(0,X.jsx)(Yn,{workspaceWorkingDir:i})),(0,X.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 ml-auto`,children:o&&(n??t)&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] text-right`,children:(0,X.jsx)(`time`,{children:`${Ln(t??n)} ${d(y.CONVERSATION$AGO)}`})})})]})]})}function Zn(){let{t:e}=S(`openhands`);return(0,X.jsxs)(`span`,{"data-testid":`error-badge`,className:`flex items-center gap-1 px-1.5 py-0.5 bg-[var(--oh-status-error)] text-white text-xs font-medium rounded-full`,children:[(0,X.jsx)(lt,{className:`text-white w-3 h-3`}),(0,X.jsx)(`span`,{children:e(y.COMMON$ERROR)})]})}function Qn({onClick:e,onDelete:t,onStop:n,onChangeTitle:r,showOptions:i,title:a,selectedRepository:o,lastUpdatedAt:s,createdAt:c,conversationId:l,executionStatus:u,sandboxStatus:d,contextMenuOpen:f=!1,onContextMenuToggle:p,isActive:m=!1,workspaceWorkingDir:h,showRepositoryMetadata:g=!0,llmModel:_=null,showLlmProfiles:v=!1,agentKind:y=null,acpServer:b=null}){let{trackDownloadVsCodeButtonClicked:x}=zt(),[S,C]=Y.useState(`view`),{mutateAsync:w}=bt(),T=e=>{e!==``&&e!==a&&r?.(e),C(`view`)},E=e=>{e.preventDefault(),e.stopPropagation(),t?.(),p?.(!1)},D=e=>{e.preventDefault(),e.stopPropagation(),n?.(),p?.(!1)},O=e=>{e.preventDefault(),e.stopPropagation(),C(`edit`),p?.(!1)},k=async e=>{if(e.preventDefault(),e.stopPropagation(),x(),l)try{let e=await Ht.getVSCodeUrl(l);if(e.vscode_url){let t=L(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}p?.(!1)},A=async e=>{e.preventDefault(),e.stopPropagation(),l&&await w(l),p?.(!1)},j=!!(t||r||i),M=g||v&&(y===`acp`||!!_);return(0,X.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":f.toString(),"data-active":m?`true`:`false`,onClick:e,className:V(`group relative h-auto w-full cursor-pointer rounded-md py-1 pl-2 pr-1 transition-colors`,`data-[context-menu-open=false]:hover:bg-[var(--oh-surface)]`,`data-[active=true]:bg-[var(--oh-surface)]`),children:[(0,X.jsxs)(`div`,{className:`flex items-center w-full min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(Un,{title:a,titleMode:S,onTitleSave:T,executionStatus:u,sandboxStatus:d}),d===`ERROR`&&(0,X.jsx)(Zn,{})]}),(0,X.jsxs)(`div`,{className:`relative ml-auto pl-2 flex items-center justify-end shrink-0`,children:[(c??s)&&(0,X.jsx)(`p`,{className:V(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,j&&`group-hover:opacity-0 group-focus-within:opacity-0`,f&&`opacity-0`),children:(0,X.jsx)(`time`,{children:Ln(s??c)})}),j&&(0,X.jsx)(`div`,{className:V(`absolute right-0 top-1/2 -translate-y-1/2 transition-opacity`,`opacity-0 invisible group-hover:opacity-100 group-hover:visible`,f&&`visible opacity-100`),children:(0,X.jsx)(Kn,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&E,onStop:n&&D,onEdit:r&&O,onDownloadViaVSCode:k,onDownloadConversation:A,executionStatus:u,conversationId:l,showOptions:i})})]})]}),M&&(0,X.jsx)(Xn,{selectedRepository:o,lastUpdatedAt:s,createdAt:c,executionStatus:u,workspaceWorkingDir:h,showRepositoryMetadata:g,showTimestamp:!1,llmModel:_,showAgentChip:v,agentKind:y,acpServer:b})]})}function $n({taskStatus:e}){return(0,X.jsx)(`div`,{className:V(`w-2 h-2 rounded-full flex-shrink-0`,(()=>{switch(e){case`READY`:return`bg-green-500`;case`ERROR`:return`bg-red-500`;case`WORKING`:case`WAITING_FOR_SANDBOX`:case`PREPARING_REPOSITORY`:case`RUNNING_SETUP_SCRIPT`:case`SETTING_UP_GIT_HOOKS`:case`SETTING_UP_SKILLS`:case`STARTING_CONVERSATION`:return`bg-yellow-500 animate-pulse`;default:return`bg-[var(--oh-interactive-selected)]`}})()),"aria-label":`Task status: ${e}`})}function er({taskStatus:e}){let{t}=S(`openhands`);return e===`WORKING`?null:(0,X.jsx)(`span`,{className:V(`text-xs font-medium px-2 py-0.5 rounded border flex-shrink-0`,(()=>{switch(e){case`READY`:return`bg-green-500/10 text-green-400 border-green-500/20`;case`ERROR`:return`bg-red-500/10 text-red-400 border-red-500/20`;default:return`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`}})()),children:t(ye(e))})}function tr({title:e,taskStatus:t}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden mr-2`,children:[(0,X.jsx)(`div`,{className:`flex items-center`,children:(0,X.jsx)($n,{taskStatus:t})}),(0,X.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,X.jsx)(er,{taskStatus:t})]})}function nr({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=S(`openhands`);return(0,X.jsxs)(`div`,{className:V(`flex flex-col gap-1 mt-1`),children:[(0,X.jsxs)(`div`,{className:`flex flex-row justify-between items-center`,children:[e?(0,X.jsx)(Jn,{selectedRepository:e}):(0,X.jsx)(Yn,{}),t&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,X.jsx)(`time`,{children:`${Ln(t)} ${r(y.CONVERSATION$AGO)}`})})]}),n&&(0,X.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function rr({task:e,onClick:t}){let{t:n}=S(`openhands`),r=e.request.title||e.detail||n(y.CONVERSATION$STARTING_CONVERSATION),i=e.request.selected_repository?{selected_repository:e.request.selected_repository,selected_branch:e.request.selected_branch||null,git_provider:e.request.git_provider||null}:null;return(0,X.jsxs)(`div`,{"data-testid":`start-task-card`,onClick:t,className:V(`relative h-auto w-full p-3.5 border-b border-[var(--oh-border)] cursor-pointer`,`hover:bg-tertiary`),children:[(0,X.jsx)(`div`,{className:`flex items-center justify-between w-full`,children:(0,X.jsx)(tr,{title:r,taskStatus:e.status})}),(0,X.jsx)(nr,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function ir({compact:e=!1}){return e?(0,X.jsx)(`div`,{"data-testid":`conversation-card-skeleton-compact`,className:`skeleton-stagger flex flex-col items-center gap-1.5 py-1`,"aria-hidden":!0,children:[0,1,2].map(e=>(0,X.jsx)(`div`,{className:`h-1.5 w-7 shrink-0 skeleton`},`conversation-skeleton-compact-${e}`))}):(0,X.jsx)(`div`,{"data-testid":`conversation-card-skeleton`,className:`skeleton-stagger flex flex-col gap-1.5 py-0.5`,"aria-hidden":!0,children:[0,1,2].map(e=>(0,X.jsx)(`div`,{className:`h-6 min-h-6 w-full skeleton`},`conversation-skeleton-row-${e}`))})}function ar({conversationId:e,title:t,selectedRepository:n,executionStatus:r,sandboxStatus:i,lastUpdatedAt:a,createdAt:o,workspaceWorkingDir:s,isActive:c=!1,onClose:l,showRepositoryMetadata:u=!0,llmModel:d=null,showLlmProfiles:f=!1,agentKind:p=null,acpServer:m=null}){return(0,X.jsx)(Je,{content:(0,X.jsxs)(`div`,{className:`w-[260px] p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,X.jsx)(Hn,{executionStatus:r,sandboxStatus:i,showTooltip:!1}),(0,X.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||`(untitled)`})]}),(0,X.jsx)(Xn,{selectedRepository:n,lastUpdatedAt:a,createdAt:o,executionStatus:r,workspaceWorkingDir:s,showRepositoryMetadata:u,llmModel:d,showAgentChip:f,agentKind:p,acpServer:m})]}),placement:`right`,closeDelay:100,className:`bg-[var(--oh-surface)] text-white border border-[var(--oh-border-subtle)] shadow-xl p-0`,disableAnimation:!1,children:(0,X.jsx)(Fe,{to:`/conversations/${e}`,onClick:l,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>V(`flex items-center justify-center w-10 h-9 mx-auto rounded-md`,`transition-colors cursor-pointer`,e||c?`bg-tertiary`:`hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(Hn,{executionStatus:r,sandboxStatus:i,showTooltip:!1})})})}var or={showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!1,organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`},Z=Et()(Dt(e=>({...or,setShowOlderConversations:t=>e(()=>({showOlderConversations:t})),toggleShowOlderConversations:()=>e(e=>({showOlderConversations:!e.showOlderConversations})),setShowRepoBranchMetadata:t=>e(()=>({showRepoBranchMetadata:t})),toggleShowRepoBranchMetadata:()=>e(e=>({showRepoBranchMetadata:!e.showRepoBranchMetadata})),setShowLlmProfiles:t=>e(()=>({showLlmProfiles:t})),toggleShowLlmProfiles:()=>e(e=>({showLlmProfiles:!e.showLlmProfiles})),setOrganizeMode:t=>e(()=>({organizeMode:t})),setConversationSort:t=>e(()=>({conversationSort:t})),setThreadScope:t=>e(()=>({threadScope:t}))}),{name:`conversation-panel-preferences`,storage:Ot(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope})})),sr=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e,cr=`px-2 pb-1 pt-1`,lr=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function ur({children:e,suffix:t}){return t==null?(0,X.jsx)(`div`,{role:`presentation`,className:V(cr,lr),children:e}):(0,X.jsxs)(`div`,{role:`presentation`,className:V(`flex items-baseline justify-between gap-2`,cr),children:[(0,X.jsx)(`span`,{className:V(`min-w-0 truncate text-left`,lr),children:e}),t]})}function dr(){return(0,X.jsx)(St,{inset:`menu`})}function Q({icon:e,label:t,selected:n,onClick:r,testId:i,disabled:a}){return(0,X.jsxs)(`button`,{type:`button`,role:n===void 0?`menuitem`:`menuitemradio`,"aria-checked":n===void 0?void 0:!!n,"data-testid":i,disabled:a,onClick:r,className:V(`group`,tt,`text-[var(--oh-foreground)] disabled:opacity-50`),children:[(0,X.jsx)(e,{className:V(`h-3.5 w-3.5`,$e),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,X.jsx)(j,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}function fr({filterMenuOpen:e,setFilterMenuOpen:t,menuRef:n,backendKind:r,organizeMode:i,setOrganizeMode:a,conversationSort:o,setConversationSort:s,threadScope:c,setThreadScope:l,showOlderConversations:u,toggleShowOlderConversations:d,showRepoBranchMetadata:f,toggleShowRepoBranchMetadata:p,showLlmProfiles:m,toggleShowLlmProfiles:h,totalConversationsCount:g,onRequestDeleteAll:_}){let{t:v}=S(`openhands`),b=v(r===`local`?y.CONVERSATION_PANEL$BY_WORKSPACE:y.CONVERSATION_PANEL$BY_REPOSITORY),x=Y.useRef(null),C=Y.useRef(null),w=Y.useRef(e);return Y.useEffect(()=>{e?(C.current?.querySelector(`[role="menuitem"], [role="menuitemradio"]`))?.focus():w.current&&x.current?.focus(),w.current=e},[e]),(0,X.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,X.jsx)(`button`,{ref:x,type:`button`,"data-testid":`older-conversations-filter-toggle`,"aria-label":v(y.CONVERSATION_PANEL$FILTER_LABEL),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:V(`inline-flex h-7 w-7 items-center justify-center rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`,nt),children:(0,X.jsx)(dn,{className:`lucide lucide-list-filter shrink-0`,width:14,height:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,X.jsxs)(`div`,{ref:C,role:`menu`,"aria-orientation":`vertical`,"aria-label":v(y.CONVERSATION_PANEL$FILTER_LABEL),tabIndex:-1,"data-testid":`older-conversations-filter-menu`,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),t(!1);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=C.current;if(!n)return;let r=Array.from(n.querySelectorAll(`[role="menuitem"], [role="menuitemradio"]`)).filter(e=>!e.disabled);if(r.length===0)return;let i=r.indexOf(document.activeElement),a=e.key===`ArrowDown`?1:-1,o=((i===-1?0:i)+a+r.length)%r.length;e.preventDefault(),r[o]?.focus()},className:V(`absolute right-0 top-full z-50 mt-0 w-64 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-[var(--oh-foreground)] shadow-lg`,Qe,Xe),children:[(0,X.jsx)(ur,{children:v(y.CONVERSATION_PANEL$ORGANIZE)}),(0,X.jsx)(Q,{icon:O,label:b,selected:i===`grouped`,onClick:()=>{a(`grouped`),t(!1)}}),(0,X.jsx)(Q,{icon:on,label:v(y.CONVERSATION_PANEL$CHRONOLOGICAL),selected:i===`chronological`,onClick:()=>{a(`chronological`),t(!1)}}),(0,X.jsx)(dr,{}),(0,X.jsx)(ur,{children:v(y.CONVERSATION_PANEL$SORT_BY)}),(0,X.jsx)(Q,{icon:an,label:v(y.CONVERSATION_PANEL$SORT_CREATED),selected:o===`created`,onClick:()=>{s(`created`),t(!1)}}),(0,X.jsx)(Q,{icon:sn,label:v(y.CONVERSATION_PANEL$SORT_UPDATED),selected:o===`updated`,onClick:()=>{s(`updated`),t(!1)}}),(0,X.jsx)(dr,{}),(0,X.jsx)(ur,{children:v(y.CONVERSATION_PANEL$SHOW)}),(0,X.jsx)(Q,{icon:fn,label:v(y.CONVERSATION_PANEL$ALL_THREADS),selected:c===`all`,onClick:()=>{l(`all`),t(!1)}}),(0,X.jsx)(Q,{icon:hn,label:v(y.CONVERSATION_PANEL$RELEVANT_THREADS),selected:c===`relevant`,onClick:()=>{l(`relevant`),t(!1)}}),(0,X.jsx)(dr,{}),(0,X.jsx)(ur,{children:v(y.CONVERSATION_PANEL$METADATA)}),(0,X.jsx)(Q,{icon:A,label:v(y.CONVERSATION_PANEL$LLM_MODEL),selected:m,testId:`toggle-llm-profiles`,onClick:()=>{h(),t(!1)}}),(0,X.jsx)(Q,{icon:k,label:v(y.CONVERSATION_PANEL$REPO_BRANCH),selected:f,testId:`toggle-repo-branch-metadata`,onClick:()=>{p(),t(!1)}}),(0,X.jsx)(dr,{}),(0,X.jsx)(ur,{suffix:(0,X.jsx)(`span`,{className:`shrink-0 text-right text-[10px] font-medium normal-case tracking-normal text-[var(--oh-muted)]/70`,children:v(y.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR)}),children:v(y.CONVERSATION_PANEL$OLDER_SECTION)}),(0,X.jsx)(Q,{testId:`toggle-older-conversations`,icon:u?cn:ln,label:sr(v(u?y.CONVERSATION$HIDE:y.CONVERSATION$SHOW_ALL)),onClick:()=>{d(),t(!1)}}),(0,X.jsx)(dr,{}),(0,X.jsx)(Q,{testId:`delete-all-conversations`,icon:_e,label:sr(v(y.CONVERSATION$DELETE_ALL)),disabled:g===0,onClick:()=>{g!==0&&(_(),t(!1))}})]}):null]})}var pr=V(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,Ye);function mr(e,t){let{open:n,enabled:r,targetWidth:i=256}=t,[a,o]=Y.useState(null),s=Y.useCallback(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect(),r=Math.min(i,window.innerWidth-16),a=n.right-r;a<8&&(a=8),a+r>window.innerWidth-8&&(a=Math.max(8,window.innerWidth-8-r)),o({top:n.bottom+4,left:a,width:r})},[e,i]);return Y.useLayoutEffect(()=>{if(!n||!r){o(null);return}return s(),window.addEventListener(`resize`,s),window.addEventListener(`scroll`,s,!0),()=>{window.removeEventListener(`resize`,s),window.removeEventListener(`scroll`,s,!0)}},[n,r,s]),a}function hr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Ne(),[s,c]=Y.useState(!1),l=Y.useRef(null),u=Y.useRef(null),d=mr(u,{open:s,enabled:i}),{data:f,error:p}=fe(),m=f?.workspaceParents??[],{mutate:h}=ce(),{mutate:g}=me(),{mutate:_}=ae(),{mutate:v}=oe(),{workspaces:b}=ue(),C=ie(p,a),[w,T]=Y.useState(!1),[E,D]=Y.useState(!1),{mutate:O,isPending:k}=Vt(),A=x(),j=k||A;Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,w,E]),Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,w,E]);let M=e=>{j||O({workingDir:e},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},N=tt,P=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),F=Y.useCallback(()=>{c(e=>!e)},[]),I=s&&(!i||d!==null),L=!!C,ee=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,R=(0,X.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:L,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),!L&&T(!0)},className:N,children:a(y.HOME$ADD_WORKSPACES)}),z=C?(0,X.jsx)(K,{content:C,placement:`top`,children:(0,X.jsx)(`span`,{className:`block`,children:R})}):R;return(0,X.jsxs)(`div`,{className:V(!i&&`relative`,t),ref:l,children:[(0,X.jsx)(`span`,{ref:u,className:`inline-flex`,children:e({onClick:F,"aria-expanded":s,"aria-haspopup":`menu`,disabled:j})}),I&&(0,X.jsxs)(`div`,{"data-testid":r,className:V(pr,!i&&V(`absolute top-full mt-0`,n)),style:ee,children:[(0,X.jsxs)(`ul`,{className:V(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,Qe),children:[(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,disabled:j,"data-testid":`launch-no-workspace`,onClick:()=>M(),className:N,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:a(y.HOME$NO_WORKSPACE_OPTION)})})}),b.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:j,"data-testid":`launch-workspace`,"data-workspace-path":e.path,onClick:()=>M(e.path),className:N,children:[(0,X.jsx)(`span`,{className:rt,"aria-hidden":!0,children:(0,X.jsx)(mt,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,X.jsxs)(`div`,{className:V(`flex flex-col`,Qe),"data-testid":`new-conversation-menu-footer`,children:[(0,X.jsx)(St,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),z,(b.length>0||m.length>0)&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),D(!0)},className:N,children:a(y.HOME$MANAGE_WORKSPACES)})]})]}),(0,X.jsx)(B,{isOpen:w,onClose:()=>T(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,X.jsx)(de,{isOpen:E,workspaces:b,workspaceParents:m,onClose:()=>D(!1),onRemove:e=>g(e),onRemoveParent:e=>v(e)})]})}function gr({repo:e,disabled:t,onSelect:n,itemClass:r}){return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:t,"data-testid":`launch-repository`,"data-repo-name":e.full_name,onClick:()=>n(e),className:r,children:[(0,X.jsx)(`span`,{className:rt,"aria-hidden":!0,children:(0,X.jsx)(mt,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function _r({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Ne(),{providers:s}=ct(),{lastSelectedProvider:c,setLastSelectedProvider:l}=yt(),[u,d]=Y.useState(!1),f=Y.useRef(null),p=Y.useRef(null),m=mr(p,{open:u,enabled:i}),[h,g]=Y.useState(c??null),[_,v]=Y.useState(``),b=pt(_,300);Y.useEffect(()=>{if(s.length===0){h!==null&&g(null);return}h&&s.includes(h)||g(c&&s.includes(c)?c:s[0])},[s,h,c]);let{data:C,isLoading:w,isError:T,hasNextPage:E,isFetchingNextPage:D,fetchNextPage:O}=_t({provider:h}),{data:k,isLoading:A}=st(b,h),j=Y.useMemo(()=>C?.pages.flatMap(e=>e.items)??[],[C]),M=b?k??[]:j,{mutate:N,isPending:P}=Vt(),F=x(),I=P||F;Y.useEffect(()=>{if(!u)return;let e=e=>{f.current&&!f.current.contains(e.target)&&d(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[u]),Y.useEffect(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&d(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u]);let L=e=>{I||N({repository:{name:e.full_name,gitProvider:e.git_provider,branch:e.main_branch??`main`}},{onSuccess:e=>{d(!1),o(`/conversations/${e.conversation_id}`)}})},ee=e=>{g(e),l(e),v(``)},R=tt;Y.useEffect(()=>{u&&(b||!E||D||w||M.length===0||M.length>=10||O())},[u,b,E,D,w,M.length,O]);let z=b?A:w,te=!b&&E&&M.length>0,ne=Y.useCallback(()=>{d(e=>!e)},[]),re=u&&(!i||m!==null),ie=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,X.jsxs)(`div`,{className:V(!i&&`relative`,t),ref:f,children:[(0,X.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:ne,"aria-expanded":u,"aria-haspopup":`menu`,disabled:I})}),re&&(0,X.jsxs)(`div`,{"data-testid":r,className:V(pr,!i&&V(`absolute top-full mt-0`,n)),style:ie,children:[s.length>1&&(0,X.jsx)(`div`,{className:`flex items-center gap-1 px-1 py-1`,"data-testid":`cloud-provider-tabs`,children:s.map(e=>{let t=e===h;return(0,X.jsxs)(`button`,{type:`button`,"data-testid":`cloud-provider-tab-${e}`,onClick:()=>ee(e),className:V(`flex items-center gap-1 rounded border px-2 py-1 text-xs`,`transition-none`,t?`border-[var(--oh-border-subtle)] bg-[var(--oh-interactive-hover)] text-white`:`border-transparent text-[var(--oh-text-secondary)] hover:text-white`),children:[(0,X.jsx)(gt,{gitProvider:e}),(0,X.jsx)(`span`,{className:`capitalize`,children:e})]},e)})}),(0,X.jsx)(`div`,{className:`px-2`,children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)($t,{width:16,height:16,"aria-hidden":!0,className:`pointer-events-none absolute left-0 top-1/2 -translate-y-1/2 text-[var(--oh-muted)]`}),(0,X.jsx)(`input`,{type:`text`,"data-testid":`cloud-repo-search-input`,value:_,onChange:e=>v(e.target.value),placeholder:a(y.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:V(`w-full border-0 bg-transparent py-1.5 pl-6 pr-0 text-sm text-white`,`outline-none placeholder:text-[var(--oh-muted)]`,`focus:outline-none focus:ring-0`,`disabled:cursor-not-allowed disabled:opacity-60`)})]})}),(0,X.jsx)(St,{inset:`menu`}),(0,X.jsxs)(`ul`,{className:V(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,Qe),children:[z&&M.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-loading`,children:a(y.HOME$LOADING_REPOSITORIES)}),T&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(y.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!z&&!T&&M.length===0&&!!h&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-empty`,children:a(y.GITHUB$NO_RESULTS)}),M.map(e=>(0,X.jsx)(gr,{repo:e,disabled:I,onSelect:L,itemClass:R},`${e.git_provider}:${e.id}`)),te&&(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:D,onClick:()=>O(),className:R,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(D?y.HOME$LOADING_MORE_REPOSITORIES:y.CONVERSATION$LOAD_MORE)})})})]})]})]})}var vr=V(`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md`,`text-[var(--oh-muted)] transition-colors`,`hover:bg-[var(--oh-surface-raised)] hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`);function yr({backendKind:e}){let{t}=S(`openhands`),n=t(y.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,X.jsx)(un,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,X.jsx)(hr,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:vr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})}):(0,X.jsx)(_r,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:vr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})})}function br(e,t){let n=t.limit??5;if(t.expanded||e.length<=n)return{visibleConversations:[...e],isPreviewTruncated:e.length>n,isShowingAll:!0};let r=t.activeConversationId==null?-1:e.findIndex(e=>e.id===t.activeConversationId);if(r>=n){let t=e[r];return{visibleConversations:[...e.slice(0,n-1),t],isPreviewTruncated:!0,isShowingAll:!1}}return{visibleConversations:e.slice(0,n),isPreviewTruncated:e.length>n,isShowingAll:!1}}function xr(e,t,n){if(t===`local`)return e===`__none_workspace`?{}:e.startsWith(`ws:`)?{workingDir:e.slice(3)}:{};if(e===`__none_repo`)return{};if(e.startsWith(`repo:`)){let t=e.slice(5),r=n[0];return{repository:{name:t,gitProvider:r?.git_provider??`github`,branch:r?.selected_branch??`main`}}}return{}}function Sr(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function Cr(e,t){let n=t===`created`?`created_at`:`updated_at`;return[...e].sort((e,t)=>Sr(t[n])-Sr(e[n]))}function wr(e){let t=e.selected_workspace?.trim().replace(/\/+$/,``);if(!t)return{id:`__none_workspace`,label:``};let n=t.split(`/`).filter(Boolean).pop()??t;return{id:`ws:${t}`,label:n}}function Tr(e){let t=e.selected_repository?.trim().replace(/\/+$/,``);if(!t)return{id:`__none_repo`,label:``};let n=t.split(`/`).filter(Boolean),r=n.length?(n[n.length-1]??t).replace(/\.git$/,``):t.replace(/\.git$/,``);return{id:`repo:${t}`,label:r}}function Er(e,t,n,r){let i=new Map;for(let n of e){let{id:e,label:a}=t===`local`?wr(n):Tr(n),o=e===`__none_workspace`?r.emptyWorkspace:e===`__none_repo`?r.emptyRepository:a,s=i.get(e);s?s.conversations.push(n):i.set(e,{label:o,conversations:[n]})}let a=[...i.entries()].map(([e,r])=>{let i=Cr(r.conversations,n);return{id:e,label:r.label,conversations:i,launch:xr(e,t,i)}}),o=e=>e.conversations.reduce((e,t)=>Math.max(e,Sr(n===`created`?t.created_at:t.updated_at)),0);return a.sort((e,t)=>o(t)-o(e)),a}var Dr=()=>{},Or=3600*1e3,kr=e=>{let t=Date.now()-Or,n=[],r=[];for(let i of e){let e=i.updated_at?Date.parse(i.updated_at):NaN;Number.isFinite(e)&&e<t?r.push(i):n.push(i)}return{recent:n,older:r}};function Ar({onClose:e,compact:t=!1}){let{t:n}=S(`openhands`),{conversationId:r,navigate:i}=Ne(),{backend:a}=Ce(),o=It(e??Dr),[s,c]=Y.useState(!1),[l,u]=Y.useState(!1),[d,f]=Y.useState(!1),[p,m]=Y.useState(!1),h=Z(e=>e.showOlderConversations),g=Z(e=>e.toggleShowOlderConversations),_=Z(e=>e.showRepoBranchMetadata),v=Z(e=>e.toggleShowRepoBranchMetadata),b=Z(e=>e.showLlmProfiles),T=Z(e=>e.toggleShowLlmProfiles),E=Z(e=>e.organizeMode),D=Z(e=>e.setOrganizeMode),k=Z(e=>e.conversationSort),A=Z(e=>e.setConversationSort),j=Z(e=>e.threadScope),M=Z(e=>e.setThreadScope),[N,I]=Y.useState(!1),[L,ee]=Y.useState(!1),R=It(()=>{I(!1)}),[z,te]=Y.useState(()=>new Set),[ne,ie]=Y.useState(()=>new Set),ae=Y.useCallback(e=>{te(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),oe=Y.useCallback(e=>{ie(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Y.useEffect(()=>{E!==`grouped`&&(te(new Set),ie(new Set))},[E]);let se=Y.useRef(null),[B,ce]=Y.useState(null),[le,ue]=Y.useState(null),[de,fe]=Y.useState(null),{data:pe,isLoading:me,isFetched:ge,hasNextPage:_e,isFetchingNextPage:ve,fetchNextPage:ye}=Nn(),{data:be}=Pn(),H=Y.useMemo(()=>pe?.pages.flatMap(e=>e.items)??[],[pe]),Se=Y.useMemo(()=>j===`relevant`?H.filter(e=>xe(e.execution_status)):H,[H,j]),{recent:U,older:W}=Y.useMemo(()=>kr(Se),[Se]),we=Y.useMemo(()=>Cr(h?[...U,...W]:U,k),[U,W,h,k]),Te=Y.useMemo(()=>({emptyWorkspace:n(y.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(y.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),G=Y.useMemo(()=>t||E!==`grouped`?null:Er([...U,...h?W:[]],a.kind,k,Te),[a.kind,t,k,Te,W,E,U,h]),Ee=Y.useMemo(()=>Cr(U.filter(e=>xe(e.execution_status)),k),[k,U]),De=we.length,Oe=Y.useMemo(()=>G?G.reduce((e,t)=>e+t.conversations.length,0):0,[G]),ke=E===`grouped`&&!t?Oe===0:De===0,{mutate:je,mutateAsync:Me}=xt(),{mutate:Pe}=ot(),{mutate:Ie}=re(),Le=W.length>0&&!h,Re=!!_e&&!Le&&!t&&!ke,{mutate:ze}=Vt(),Be=x(),Ve=Y.useCallback(e=>{Be||ze({workingDir:e.workingDir,repository:e.repository},{onSuccess:e=>{i(`/conversations/${e.conversation_id}`)}})},[ze,Be,i]),He=Y.useCallback((e,t)=>{c(!0),ce(e),ue(t)},[]),Ue=Y.useCallback(e=>{u(!0),ce(e)},[]),We=Y.useCallback((e,t)=>{Ie({conversationId:e,newTitle:t},{onSuccess:()=>{C(n(y.CONVERSATION$TITLE_UPDATED))}})},[n,Ie]),Ge=()=>{B&&je({conversationId:B},{onSuccess:()=>{B===r&&i(`/conversations`)}})},Ke=()=>{B&&Pe({conversationId:B})},qe=async()=>{let e=H.map(e=>e.id),t=await Promise.allSettled(e.map(e=>Me({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),a=t.length-n.length;r!==null&&n.includes(r)&&i(`/conversations`),a>0&&w(`${a} conversation${a===1?``:`s`} could not be deleted.`)},Je=Y.useCallback(n=>t?(0,X.jsx)(ar,{conversationId:n.id,title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,lastUpdatedAt:n.updated_at,createdAt:n.created_at,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,isActive:n.id===r,onClose:e,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:b,agentKind:n.agent_kind,acpServer:n.acp_server},n.id):(0,X.jsx)(Fe,{to:`/conversations/${n.id}`,onClick:e,className:`block`,children:(0,X.jsx)(Qn,{onDelete:()=>He(n.id,n.title??``),onStop:()=>Ue(n.id),onChangeTitle:e=>We(n.id,e),title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},lastUpdatedAt:n.updated_at,createdAt:n.created_at,executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,conversationId:n.id,contextMenuOpen:de===n.id,onContextMenuToggle:e=>fe(e?n.id:null),isActive:n.id===r,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:b,agentKind:n.agent_kind,acpServer:n.acp_server})},n.id),[t,r,We,He,Ue,e,de,_,b]),K=me||!ge,Ye=ge&&!me&&!t&&ke&&!be?.length;return(0,X.jsxs)(`div`,{ref:o,"data-testid":`conversation-panel`,className:`flex h-full min-h-0 w-full flex-col`,children:[!t&&(0,X.jsx)(`div`,{className:V(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,L?`border-[var(--oh-border)]`:`border-transparent`),children:(0,X.jsxs)(`div`,{"data-testid":`older-conversations-summary`,className:`flex min-w-0 flex-nowrap items-center gap-x-2 py-2 pl-4 pr-2.5 text-[var(--oh-muted)]`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-[var(--oh-muted)]`,children:n(y.SIDEBAR$CONVERSATIONS)}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(yr,{backendKind:a.kind}),(0,X.jsx)(fr,{filterMenuOpen:N,setFilterMenuOpen:I,menuRef:R,backendKind:a.kind,organizeMode:E,setOrganizeMode:D,conversationSort:k,setConversationSort:A,threadScope:j,setThreadScope:M,showOlderConversations:h,toggleShowOlderConversations:g,showRepoBranchMetadata:_,toggleShowRepoBranchMetadata:v,showLlmProfiles:b,toggleShowLlmProfiles:T,totalConversationsCount:H.length,onRequestDeleteAll:()=>m(!0)})]})]})}),(0,X.jsxs)(`div`,{ref:se,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{ee(e.currentTarget.scrollTop>0)},className:V(`flex min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden overscroll-contain custom-scrollbar-always`,!t&&`conversation-panel-list-scroll`),children:[K&&(0,X.jsx)(ir,{compact:t}),!t&&Ye&&(0,X.jsx)(`div`,{"data-testid":`conversation-panel-empty-state`,className:`flex min-h-0 flex-1 flex-col items-center justify-center px-4 py-8`,children:(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:n(y.CONVERSATION$NO_CONVERSATIONS)})}),!t&&be?.map(t=>(0,X.jsx)(Fe,{to:`/conversations/task-${t.id}`,onClick:e,className:`block`,children:(0,X.jsx)(rr,{task:t})},t.id)),!K&&t?Ee.map(Je):null,!K&&!t&&E===`grouped`&&G&&G.length>0?(0,X.jsx)(`nav`,{"aria-label":n(y.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:G.map(e=>{let t=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,i=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),a=!z.has(e.id),o=ne.has(e.id),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=br(e.conversations,{expanded:o,activeConversationId:r});return(0,X.jsxs)(`section`,{"aria-labelledby":t,children:[(0,X.jsxs)(`div`,{className:V(`flex h-8 w-full min-w-0 items-center gap-0.5 rounded-md pl-2 pr-1 text-sm font-normal`,`text-[var(--oh-muted)] transition-colors`,`hover:bg-[var(--oh-surface-raised)] hover:text-white`),children:[(0,X.jsxs)(`button`,{type:`button`,id:t,"aria-expanded":a,onClick:()=>ae(e.id),className:`flex min-h-8 min-w-0 flex-1 items-center gap-2 rounded-md py-1 text-left text-inherit outline-none transition-colors focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,children:[(0,X.jsx)(O,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,X.jsx)(`button`,{type:`button`,className:V(`inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md`,`text-inherit transition-colors`,`hover:bg-white/10 hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`),disabled:Be,"aria-label":n(y.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,onClick:t=>{t.preventDefault(),t.stopPropagation(),Ve(e.launch)},children:(0,X.jsx)(he,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),a?(0,X.jsxs)(`div`,{className:`mt-0.5 space-y-0.5`,children:[s.map(Je),c?(0,X.jsx)(`div`,{className:`pl-2`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${i}`,onClick:()=>oe(e.id),className:`ml-[26px] cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:n(l?y.CONVERSATION_PANEL$LESS:y.CONVERSATION_PANEL$MORE)})}):null]}):null]},e.id)})}):null,!K&&!t&&E===`chronological`?(0,X.jsx)(`div`,{className:`space-y-0.5`,children:we.map(Je)}):null,Re&&(0,X.jsx)(`div`,{className:`flex justify-center py-4`,children:ve?(0,X.jsx)(Ae,{size:`small`}):(0,X.jsx)(`button`,{type:`button`,"data-testid":`load-more-conversations`,onClick:()=>ye(),className:`text-xs text-[var(--oh-muted)] hover:text-white`,children:n(y.CONVERSATION$LOAD_MORE)})})]}),s&&(0,X.jsx)(F,{onConfirm:()=>{Ge(),c(!1),ue(null)},onCancel:()=>{c(!1),ue(null)},conversationTitle:le??void 0}),p&&(0,X.jsx)(F,{title:n(y.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(y.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:H.length}),onConfirm:async()=>{await qe(),m(!1)},onCancel:()=>m(!1)}),l&&(0,X.jsx)(P,{onConfirm:()=>{Ke(),u(!1)},onCancel:()=>u(!1)}),d&&(0,X.jsx)(Fn,{onConfirm:()=>{e?.()},onClose:()=>f(!1),onCancel:()=>f(!1)})]})}function jr({collapsed:e}){return e?null:(0,X.jsx)(`div`,{className:`flex flex-col flex-1 min-h-0`,children:(0,X.jsx)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col`,children:(0,X.jsx)(Ar,{})})})}var Mr=e=>(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,X.jsx)(`mask`,{id:`mask0_18339_1445`,style:{maskType:`luminance`},maskUnits:`userSpaceOnUse`,x:1,y:1,width:18,height:18,children:(0,X.jsx)(`path`,{d:`M19 1H1V19H19V1Z`,fill:`white`})}),(0,X.jsxs)(`g`,{mask:`url(#mask0_18339_1445)`,children:[(0,X.jsx)(`path`,{d:`M10 18.1818V16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M10 1.81836V3.45472`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M1.81824 10H3.4546`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M18.1818 10H16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M5.93359 17.1019L6.74359 15.6782`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M14.0663 2.89844L13.2563 4.32208`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M2.89819 5.93359L4.32183 6.74359`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M17.1019 14.0663L15.6782 13.2563`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M5.92542 2.90625L6.7436 4.3217`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M14.0909 17.0854L13.2727 15.6699`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M17.0855 5.90918L15.67 6.72736`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M2.91455 14.0911L4.33001 13.2729`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M10 16.5455C13.615 16.5455 16.5455 13.615 16.5455 10C16.5455 6.38509 13.615 3.45459 10 3.45459C6.38509 3.45459 3.45459 6.38509 3.45459 10C3.45459 13.615 6.38509 16.5455 10 16.5455Z`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M12.5854 9.77916L8.80545 7.59461C8.63363 7.49643 8.41272 7.61916 8.41272 7.81552V12.1846C8.41272 12.381 8.62545 12.5119 8.80545 12.4055L12.5854 10.221C12.7573 10.1228 12.7573 9.86916 12.5854 9.77098V9.77916Z`,fill:`currentColor`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`})]})]}),$=18,Nr=34,Pr=Math.round(Nr*30/46);function Fr({collapsed:e,showCollapseToggle:t,showMobileCloseButton:n=!1,onCloseMobile:r,linkDisabled:i,collapseToggleLabel:a,onCollapse:o,onExpand:s,showCollapsedExpandButton:c,isExtensionsActive:l,currentPath:u,activeBackendHealth:d,collapsedBackendPopoverOpen:f,setCollapsedBackendPopoverOpen:p,collapsedBackendPopoverRef:m,collapsedBackendCloseTimer:h,onOpenAddBackend:g,onOpenManageBackends:v}){let{t:b}=S(`openhands`),x=h;return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:Le(e),children:[(0,X.jsxs)(`div`,{className:V(e&&t?ze:`flex min-w-0 shrink-0 items-center`),children:[(0,X.jsx)(`div`,{className:V(e&&t&&`flex h-full w-full items-center justify-start pl-2.5 transition-opacity duration-150`,e&&c&&`opacity-0`),children:(0,X.jsx)(vn,{logoWidth:Nr,logoHeight:Pr,logoClassName:`max-w-none`,className:V(We,`overflow-visible`)})}),e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":a,onClick:s,className:V(Ie,c?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),children:(0,X.jsx)(_,{width:14,height:14})}):null]}),!e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":a,onClick:o,className:V(`hidden md:inline-flex ml-auto`,He,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(R,{width:14,height:14})}):null,!e&&n?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-drawer-close`,onClick:r,"aria-label":b(y.SIDEBAR$CLOSE_MENU),className:V(`inline-flex ml-auto`,He,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(R,{width:14,height:14})}):null]}),(0,X.jsxs)(`nav`,{className:Ue(e),children:[(0,X.jsx)(qe,{to:`/conversations`,end:!0,label:`New Chat`,testId:`sidebar-conversations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(he,{width:$,height:$})}),(0,X.jsx)(qe,{to:`/customize`,label:`Customize`,testId:`sidebar-skills-link`,disabled:i,collapsed:e,forceActive:l,icon:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:$,height:$,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,X.jsx)(`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}),(0,X.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,X.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,X.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}),(0,X.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,X.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,X.jsx)(`path`,{d:`m17 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}),(0,X.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,X.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,X.jsx)(`path`,{d:`M12 13.5V8`})]})}),(0,X.jsx)(qe,{to:`/automations`,label:b(y.SIDEBAR$AUTOMATIONS),testId:`sidebar-automations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(Mr,{width:$,height:$})})]}),(0,X.jsx)(jr,{collapsed:e}),e&&t?(0,X.jsxs)(`nav`,{className:V(Ue(e),`mt-auto pb-2 cursor-pointer`),children:[(0,X.jsx)(K,{content:b(y.SIDEBAR$SETTINGS),placement:`right`,children:(0,X.jsxs)(Fe,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":b(y.SIDEBAR$SETTINGS),className:Be({collapsed:!0}),children:[(0,X.jsx)(Ke,{active:u.startsWith(`/settings`),children:(0,X.jsx)(mn,{width:$,height:$})}),(0,X.jsx)(`span`,{className:Re(!0),children:b(y.SIDEBAR$SETTINGS)})]})}),(0,X.jsxs)(`div`,{className:`relative`,ref:m,onMouseEnter:()=>{x.current&&=(clearTimeout(x.current),null),p(!0)},onMouseLeave:()=>{x.current=setTimeout(()=>p(!1),150)},children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`collapsed-backend-selector-link`,"aria-label":b(y.BACKEND$MANAGE),"aria-expanded":f,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:V(Be({collapsed:!0}),`relative`),children:[(0,X.jsx)(Ke,{active:f,children:(0,X.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,X.jsx)(wt,{isConnected:d?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,X.jsx)(pn,{width:$,height:$})]})}),(0,X.jsx)(`span`,{className:Re(!0),children:b(y.BACKEND$MANAGE)})]}),f?(0,X.jsx)(`div`,{className:`absolute bottom-[-4px] left-full pl-2.5 z-40 w-[272px]`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(Mn,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>p(!1),onOpenAddBackend:g,onOpenManageBackends:v})}):null]})]}):null,e?null:(0,X.jsx)(`div`,{className:V(`flex flex-col items-stretch max-w-none box-border shrink-0`,`-ml-2.5 w-[calc(100%+0.625rem)] border-t border-[var(--oh-border)] pt-2 px-2.5`),children:(0,X.jsx)(Mn,{sidebarCollapsed:e,openUpward:!0})})]})}var Ir=`openhands-sidebar`,Lr=`openhands-sidebar-collapsed`,Rr=Et()(Dt(e=>({collapsed:!1,setCollapsed:t=>e(e=>({collapsed:typeof t==`function`?t(e.collapsed):t})),toggleCollapsed:()=>e(e=>({collapsed:!e.collapsed}))}),{name:Ir,storage:Ot(()=>localStorage),partialize:e=>({collapsed:e.collapsed})}));if(typeof window<`u`)try{let e=window.localStorage.getItem(Lr);window.localStorage.getItem(Ir)===null&&(e===`true`||e===`false`)&&Rr.setState({collapsed:e===`true`}),e!==null&&window.localStorage.removeItem(Lr)}catch{}var zr=Y.lazy(()=>n(()=>import(`./settings-modal-CeRvS5Bc.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]))),Br=Y.lazy(()=>n(()=>import(`./add-backend-modal-BywVr6uq.js`).then(e=>e.n).then(e=>({default:e.AddBackendModal})),__vite__mapDeps([50,1,9,51,13,38,10,39,40,16,41,24,7,25,52,17,18,22,21,15,19,20,23,31,35,12,33,53,36,34]))),Vr=Y.lazy(()=>n(()=>import(`./manage-backends-modal-tfdzTXWU.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([54,1,13,38,9,10,39,40,16,41,24,7,25,15,17,18,55,56,57,19,20,51,52,22,21,23,31,35,12,33,53,36,34,58]))),Hr=250;function Ur(){let{t:e}=S(`openhands`),{currentPath:t}=Ne(),{data:n}=je(),{data:r,error:i,isError:a,isFetching:o}=Lt(),{backends:s,active:c}=U(),l=Ct(s)[c.backend.id],u=Rr(e=>e.collapsed),d=Rr(e=>e.setCollapsed),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Y.useRef(null),[_,v]=Y.useState(!1),[b,x]=Y.useState(!1),[C,T]=Y.useState(!1),E=Y.useRef(!1),[,D]=Y.useReducer(e=>e+1,0),{isOpen:O,close:k}=ee(),[A,j]=Y.useState(!1),[M,N]=Y.useState(!1),P=It(()=>h(!1)),F=Rt(i);Y.useEffect(()=>{k()},[t,k]),Y.useEffect(()=>{if(O){j(!0);let e=requestAnimationFrame(()=>{N(!0)});return()=>cancelAnimationFrame(e)}N(!1);let e=window.setTimeout(()=>{j(!1)},Hr);return()=>window.clearTimeout(e)},[O]),Y.useEffect(()=>{if(!O)return;let e=e=>{e.key===`Escape`&&k()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[O,k]),Y.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&F!==404?w(e(y.SETTINGS$FETCH_ERROR)):F===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,F,n?.feature_flags?.hide_llm_settings,e]);let I=r?.email_verified===!1,L=e(u?y.SIDEBAR$EXPAND:y.SIDEBAR$COLLAPSE),R=Y.useCallback(e=>{if(!u)return;let t=e.target;t instanceof HTMLElement&&(t.closest(`a,button,input,textarea,select,[role='button'],[role='link']`)||d(!1))},[u,d]),z={linkDisabled:I,collapseToggleLabel:L,onCollapse:Y.useCallback(()=>{T(!1),E.current=!0,D(),d(!0),window.setTimeout(()=>{E.current=!1,D()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&C&&!E.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/mcp`,currentPath:t,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:P,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>v(!0),onOpenManageBackends:()=>x(!0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{"aria-label":e(y.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:R,onMouseEnter:()=>{u&&T(!0)},onMouseLeave:()=>{T(!1)},className:V(`max-md:hidden flex bg-base flex-col min-h-0 transition-[width,min-width] duration-200`,`md:border-r md:border-[var(--oh-border)] md:h-full`,u?`md:w-[60px] md:min-w-[60px] md:px-2.5`:`md:w-[300px] md:min-w-[300px] pb-2 md:pl-2.5 md:pr-0`,t===`/`&&`md:pb-3`),children:(0,X.jsx)(Fr,{collapsed:u,showCollapseToggle:!0,...z})}),A?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:V(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,M?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${Hr}ms`},onClick:k,"aria-hidden":!M}),(0,X.jsx)(`aside`,{"aria-label":e(y.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!M,className:V(`fixed inset-y-0 left-0 z-50 flex min-h-0 w-[min(300px,85vw)] flex-col bg-base`,`border-r border-[var(--oh-border)] pb-2 pl-2.5 pr-0 md:hidden`,`transition-transform ease-in-out motion-reduce:transition-none`,M?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${Hr}ms`},children:(0,X.jsx)(Fr,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:k,...z})})]}):null,f&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(zr,{settings:r,onClose:()=>p(!1)})}),_&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Br,{onClose:()=>v(!1)})}),b&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Vr,{onClose:()=>x(!1)})})]})}var Wr=`/settings`,Gr=`/customize`,Kr=[`/skills`,`/mcp`,`/plugins`];function qr(e){return e===Wr?{mode:`menu`}:e.startsWith(`${Wr}/`)&&e.length>9?{mode:`back`,backTo:Wr,backLabelKey:y.SETTINGS$TITLE}:e===Gr?{mode:`menu`}:Kr.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:Gr,backLabelKey:y.NAV$CUSTOMIZE}:{mode:`menu`}}function Jr(){let{t:e}=S(`openhands`),{currentPath:t,navigate:n}=Ne(),r=qr(t);return(0,X.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(y.SIDEBAR$NAVIGATION_LABEL),children:[(0,X.jsx)(ne,{}),r.mode===`back`&&r.backTo?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-back-button`,onClick:()=>n(r.backTo),"aria-label":e(r.backLabelKey??y.COMMON$BACK),className:z,children:(0,X.jsx)(R,{size:20,className:I,"aria-hidden":!0,strokeWidth:2})}):null]})}var Yr=()=>{let e=we(),{mutate:t}=tn();return{migrateUserConsent:Y.useCallback(async n=>{let r=localStorage.getItem(`analytics-consent`);r&&(n?.handleAnalyticsWasPresentInLocalStorage(),t({user_consents_to_analytics:r===`true`},{onSuccess:()=>{en(e,r===`true`)}}),localStorage.removeItem(`analytics-consent`))},[e,t])}};function Xr(){let{backend:e}=Ce(),t=e.kind===`local`,{data:n}=Bt(),{mutate:r,isPending:i}=ge(),a=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{a.current=null},[e.id]),(0,Y.useEffect)(()=>{if(!t||i||!n)return;let{profiles:e,active_profile:o}=n,s=o!=null&&e.some(e=>e.name===o);if(e.length===0||s){a.current=null;return}let c=e.find(e=>e.api_key_set)??e[0];a.current!==c.name&&(a.current=c.name,r(c.name))},[t,n,i,r])}var Zr=()=>{let e=we(),{data:t}=Lt();Y.useEffect(()=>{!e||t===void 0||en(e,t.user_consents_to_analytics===!0)},[e,t])},Qr=()=>{let e=we(),{backend:t}=Ce(),{data:n}=Lt(),r=Ge(),i=Y.useRef(!1),a=t.kind===`cloud`,o=a?r[t.id]?.userId??null:null,s=n?.user_consents_to_analytics;Y.useEffect(()=>{if(!(!e||!a||n===void 0)){if(s===!0&&o){e.identify(o,{email:n.email??n.git_user_email??void 0}),i.current=!0;return}(s===!1||i.current&&!o)&&(e.reset(),i.current=!1)}},[e,a,s,o,n?.email,n])};function $r(e){switch(e){case H.RUNNING:return`🟢`;case H.FINISHED:case H.IDLE:case H.WAITING_FOR_CONFIRMATION:return`✅`;case H.PAUSED:return`⚪`;case H.ERROR:case H.STUCK:return`🔴`;default:return null}}var ei=`OpenHands`,ti=()=>{let{conversationId:e}=l(),{data:t}=nn(e??null),n=rn(e=>e.execution_status),r=t?.title,i=e&&r?`${r} | ${ei}`:ei;if(!e)return i;let a=$r(n??t?.execution_status??null);return a?`${a} ${i}`:i};function ni({children:e}){let{pathname:t}=p(),n=s(),r=c(),i=f(),a=Y.useMemo(()=>{for(let e=i.length-1;e>=0;--e){let t=i[e]?.params?.conversationId;if(t)return t}return null},[i]);return(0,X.jsx)(Pe,{value:Y.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var ri=Y.lazy(()=>n(()=>import(`./environment-switch-overlay-wB5LxfYZ.js`),__vite__mapDeps([59,1,12,10,9,19,20,60]))),ii=Y.lazy(()=>n(()=>import(`./analytics-consent-form-modal-CVhsAREx.js`).then(e=>({default:e.AnalyticsConsentFormModal})),__vite__mapDeps([61,47,1,48,10,9,19,20,62,4,23,24,7,25,32,33,34,35,12,37,38,13,39,40,16,41,42,18,43,21,22,44,45,15,17,46,63]))),ai=Y.lazy(()=>n(()=>import(`./alert-banner-Bsvys-hT.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([64,1,65,10,9,19,20,66,67,24,7,25,36,68,69,28]))),oi=u(function(){let e=a(),{t}=S(`openhands`);return i(e)?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:e.status}),(0,X.jsx)(`p`,{children:e.statusText}),(0,X.jsx)(`pre`,{children:e.data instanceof Object?JSON.stringify(e.data):e.data})]}):e instanceof Error?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:t(y.ERROR$GENERIC)}),(0,X.jsx)(`pre`,{children:e.message})]}):(0,X.jsx)(`div`,{children:(0,X.jsx)(`h1`,{children:t(y.ERROR$UNKNOWN)})})}),si=o(function(){let e=p(),t=ti(),{data:n}=Lt(),{migrateUserConsent:r}=Yr(),i=je(),[a,o]=Y.useState(!1);if(Zr(),Qr(),Xr(),Y.useEffect(()=>{n?.language&&T.changeLanguage(n.language)},[n?.language]),Y.useEffect(()=>{o(n?.user_consents_to_analytics===null)},[n?.user_consents_to_analytics]),Y.useEffect(()=>{r({handleAnalyticsWasPresentInLocalStorage:()=>{o(!1)}})},[r]),i.isLoading)return(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-base`,children:(0,X.jsx)(Ae,{size:`large`})});let s=/^\/conversations\/[^/]+/.test(e.pathname),c=le(e.search);return(0,X.jsx)(ni,{children:(0,X.jsxs)(M,{children:[(0,X.jsxs)(`div`,{"data-testid":`root-layout`,className:`h-screen lg:min-w-5xl flex flex-col md:flex-row bg-base overflow-hidden p-0`,children:[(0,X.jsx)(`title`,{children:t}),(0,X.jsx)(Ur,{}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col w-full min-w-0 h-full gap-3`,children:[s?null:(0,X.jsx)(Jr,{}),i.data&&(i.data.maintenance_start_time||i.data.faulty_models&&i.data.faulty_models.length>0||i.data.error_message)&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(ai,{maintenanceStartTime:i.data.maintenance_start_time,faultyModels:i.data.faulty_models,errorMessage:i.data.error_message,updatedAt:i.data.updated_at})}),(0,X.jsx)(`div`,{id:`root-outlet`,className:`relative flex-1 overflow-auto px-0 custom-scrollbar`,children:(0,X.jsx)(d,{})})]}),a&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(ii,{onClose:()=>{o(!1)}})})]}),(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(ri,{})}),c?(0,X.jsx)(pe,{}):null]})})});export{oi as ErrorBoundary,si as default};
@@ -1 +1 @@
1
- import{o as e,t}from"./declaration-BDfM67Kl.js";import{t as n}from"./useTranslation-C-T8J2U-.js";import{t as r}from"./utils-CXRkUr73.js";import{t as i}from"./loading-spinner-Dtm7y-w5.js";import{r as a}from"./typography-BFj4IzMj.js";var o=e();function s({testId:e=`runtime-waiting`,messageKey:s=t.DIFF_VIEWER$WAITING_FOR_RUNTIME,className:c}){let{t:l}=n(`openhands`);return(0,o.jsxs)(`div`,{"data-testid":e,className:r(`flex h-full w-full flex-col items-center justify-center gap-3 py-8 text-center`,c),children:[(0,o.jsx)(i,{size:`small`}),(0,o.jsx)(a.Text,{className:`text-sm text-[var(--oh-muted)]`,children:l(s)})]})}export{s as t};
1
+ import{o as e,t}from"./declaration-D9ucT0fq.js";import{t as n}from"./useTranslation-CL6FTf1b.js";import{t as r}from"./utils-eXk6yerZ.js";import{t as i}from"./loading-spinner-D7bOU6I7.js";import{r as a}from"./typography-BLSEGjph.js";var o=e();function s({testId:e=`runtime-waiting`,messageKey:s=t.DIFF_VIEWER$WAITING_FOR_RUNTIME,className:c}){let{t:l}=n(`openhands`);return(0,o.jsxs)(`div`,{"data-testid":e,className:r(`flex h-full w-full flex-col items-center justify-center gap-3 py-8 text-center`,c),children:[(0,o.jsx)(i,{size:`small`}),(0,o.jsx)(a.Text,{className:`text-sm text-[var(--oh-muted)]`,children:l(s)})]})}export{s as t};