@openhands/agent-canvas 1.18.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/acp-providers-BQ4o4vqy.js +1 -0
- package/build/assets/{active-backend-context-BnH4-L8h.js → active-backend-context-BsLfwrXB.js} +1 -1
- package/build/assets/{agent-context-settings-D3peZkjX.js → agent-context-settings-D9i6ezoJ.js} +1 -1
- package/build/assets/{agent-profiles-service.api-DkeZaqIl.js → agent-profiles-service.api-U-9YzDFU.js} +1 -1
- package/build/assets/{agent-profiles-settings-7yMWYjGF.js → agent-profiles-settings-D-bUV2PX.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-BaVQ6NpE.js +88 -0
- package/build/assets/agent-settings-BZJHtaIK.js +2 -0
- package/build/assets/agent-settings-D4snDd6u.js +1 -0
- package/build/assets/{alert-banner-eYyqvHL3.js → alert-banner-BkVt_8Or.js} +1 -1
- package/build/assets/{api-key-entry-screen-CCBvBD8u.js → api-key-entry-screen-fAIld-n7.js} +1 -1
- package/build/assets/{app-settings-BtYDs-Be.js → app-settings-DITbrM2u.js} +1 -1
- package/build/assets/automation-detail-DawHmaOl.js +3 -0
- package/build/assets/automation-disabled-reason-DtgC8Ppt.js +1 -0
- package/build/assets/{automation-export-BJsfi7n2.js → automation-export-Kv6e0bHx.js} +1 -1
- package/build/assets/{automation-git-sync-B7o_Nbl-.js → automation-git-sync-Dd98G_Oz.js} +1 -1
- package/build/assets/{automation-setup-route-qaJ6lLCf.js → automation-setup-route-Cdc109ZD.js} +1 -1
- package/build/assets/{automation-templates-Bb98r-kx.js → automation-templates-Xhr-FDAB.js} +1 -1
- package/build/assets/automations-list-BeP1LuzQ.js +1 -0
- package/build/assets/{back-nav-button-B2yBiVMB.js → back-nav-button-DWNiN277.js} +1 -1
- package/build/assets/backend-form-modal-DeaUJIik.js +1 -0
- package/build/assets/{backend-synced-settings-badge-DLEp6cq7.js → backend-synced-settings-badge-Br85iWIY.js} +1 -1
- package/build/assets/{badge-ehL-kgeO.js → badge-Cdnei7Ly.js} +1 -1
- package/build/assets/{base-modal-C1a0TsSx.js → base-modal-Ds7grR67.js} +1 -1
- package/build/assets/{brand-button-CUMfjb99.js → brand-button-mQq2Ld1I.js} +1 -1
- package/build/assets/{browser-SE24Tk8g.js → browser-Bfum8fkE.js} +2 -2
- package/build/assets/{browser-tab-HjJxHA0V.js → browser-tab-CmYT4j_r.js} +1 -1
- package/build/assets/{canvas-extension-page-BsUGBb1T.js → canvas-extension-page-CokKSVRG.js} +1 -1
- package/build/assets/{canvas-extensions-C9Tm6s_E.js → canvas-extensions-BoQEYG-2.js} +1 -1
- package/build/assets/{canvas-extensions-runtime-B8kxM4rO.js → canvas-extensions-runtime-Du2M5iEX.js} +1 -1
- package/build/assets/{chat-send-button-CGvc2wpE.js → chat-send-button-DM3JgMc2.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-BDX_ctNs.js → circle-plus-check-toggle-BbYBiUwv.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-D5uJ_4JE.js → cloud-funnel-analytics-D02kgq1s.js} +1 -1
- package/build/assets/{cog-CAEugqtV.js → cog-Dy1eWbSZ.js} +1 -1
- package/build/assets/{command-menu-CQxs4mtX.js → command-menu-mehU3Evb.js} +1 -1
- package/build/assets/{commits-tab-D0xgjipP.js → commits-tab-DhQW8CXi.js} +1 -1
- package/build/assets/{condenser-settings-D63NJRBT.js → condenser-settings-eRk6Fkx6.js} +1 -1
- package/build/assets/{confirmation-modal-78sd9Vny.js → confirmation-modal-BmVt_c0I.js} +1 -1
- package/build/assets/{context-menu-list-item-Cm7-7Y-7.js → context-menu-list-item-lx2zk9G7.js} +1 -1
- package/build/assets/{conversation-B_nweu5p.js → conversation-BOj0ENI6.js} +4 -4
- package/build/assets/conversation-SouWlGvs.js +1 -0
- package/build/assets/conversation-panel-SouWlGvs.js +1 -0
- package/build/assets/{conversation-state-store-9D_3P7q4.js → conversation-state-store-C6YncQNo.js} +1 -1
- package/build/assets/{conversation-tab-empty-state-B3dpJXX0.js → conversation-tab-empty-state-DIhwCC2J.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-B1ljgNxO.js → copy-to-clipboard-button-DVNXLylP.js} +1 -1
- package/build/assets/{device-verify-D5QRIS_x.js → device-verify-LP-x7nra.js} +1 -1
- package/build/assets/{dropdown-classes-BGvOvW2_.js → dropdown-classes-goDldkiu.js} +1 -1
- package/build/assets/edit-automation-modal-BJJR9wSW.js +1 -0
- package/build/assets/empty-state-Cd-TFe7i.js +1 -0
- package/build/assets/{entry.client-BMafTpjO.js → entry.client-CJdjIvMZ.js} +2 -2
- package/build/assets/{enum-filter-dropdown-UNaom12H.js → enum-filter-dropdown-pocrz9AL.js} +1 -1
- package/build/assets/{environment-switch-overlay-COibRUA-.js → environment-switch-overlay-Dwe78wRl.js} +1 -1
- package/build/assets/{error-state-Cf8LRuuY.js → error-state-SuWwztxV.js} +1 -1
- package/build/assets/{extensions-hub-C_6ahIua.js → extensions-hub-O0esK3Er.js} +1 -1
- package/build/assets/{extensions-navigation-C5GfpzFe.js → extensions-navigation-CgCVSXje.js} +1 -1
- package/build/assets/{files-tab-D5PPIWI1.js → files-tab-B_6t8ljw.js} +1 -1
- package/build/assets/{form-control-classes-Dbq-7YP_.js → form-control-classes-lQfLxzH4.js} +1 -1
- package/build/assets/{get-git-path-jU2zjqIB.js → get-git-path-Bp5rsUkl.js} +1 -1
- package/build/assets/git-repo-dropdown-CbD0_LPN.js +1 -0
- package/build/assets/{git-repo-dropdown-uxlFw2gn.js → git-repo-dropdown-DPQVumZg.js} +1 -1
- package/build/assets/{highlighted-source-view-C7pAXrT0.js → highlighted-source-view-Bp0sgK-f.js} +1 -1
- package/build/assets/home-BghzJd-D.js +1 -0
- package/build/assets/home-CXZ8zawS.js +1 -0
- package/build/assets/home-automation-run-tooltip-BdpCckKO.js +1 -0
- package/build/assets/{home-store-DCbei3DX.js → home-store-DNQpfIEO.js} +1 -1
- package/build/assets/{hooks-service-Dnmhqc0Z.js → hooks-service-DkxnQa4N.js} +1 -1
- package/build/assets/index-home-Ca6Q5CtT.js +1 -0
- package/build/assets/{install-server-modal-B81I-5OE.js → install-server-modal-DvxxYKia.js} +1 -1
- package/build/assets/{key-O84CMFHb.js → key-CwTE6XJj.js} +1 -1
- package/build/assets/{launch-ZLxI4opd.js → launch-jsRGPRBx.js} +1 -1
- package/build/assets/link-external-B4gx3EeM.js +1 -0
- package/build/assets/{llm-not-configured-banner-Dh_ajcM8.js → llm-not-configured-banner-DMdL1vaX.js} +4 -4
- package/build/assets/{llm-settings-CODhjQzy.js → llm-settings-dkQ5Oq7W.js} +1 -1
- package/build/assets/llm-settings-lNDerSlu.js +1 -0
- package/build/assets/{llm-subscription-service-CgIDc38n.js → llm-subscription-service-BiQaZbvv.js} +1 -1
- package/build/assets/{loading-spinner-BeLV0IXf.js → loading-spinner-DK1sAwVg.js} +1 -1
- package/build/assets/{manage-backends-modal-cMXqCb-B.js → manage-backends-modal-DqCJohsX.js} +1 -1
- package/build/assets/manifest-ff93dc8c.js +1 -0
- package/build/assets/{manifest-subpage-layout-CVZgVKoY.js → manifest-subpage-layout-sxuPqfUr.js} +1 -1
- package/build/assets/{markdown-renderer-DyFl9-mL.js → markdown-renderer-BH5pqDuJ.js} +1 -1
- package/build/assets/mcp-BtaJDXnP.js +1 -0
- package/build/assets/mcp-installed-servers-Br4ZLsjr.js +1 -0
- package/build/assets/mcp-marketplace-utils-BwEnDYqm.js +1 -0
- package/build/assets/mcp-page-DwbnQpVs.js +9 -0
- package/build/assets/{messages-Bk1xhbU2.js → messages-DmFJlW6c.js} +4 -4
- package/build/assets/{modal-body-C24WsdFb.js → modal-body-DBweM2EN.js} +1 -1
- package/build/assets/{modal-classes-B0b9eiL8.js → modal-classes-jvG85nkU.js} +1 -1
- package/build/assets/{modal-close-button-DfqfB2Nj.js → modal-close-button-BrM5fNnn.js} +1 -1
- package/build/assets/onboarding-CQ8T6T0U.js +1 -0
- package/build/assets/{onboarding-modal-BT3Gx_sZ.js → onboarding-modal-CnliiaSN.js} +1 -1
- package/build/assets/{organization-service.api-B5CvmnYQ.js → organization-service.api-DmFUEmu5.js} +1 -1
- package/build/assets/parse-git-remote-url-BG8pcKL8.js +1 -0
- package/build/assets/{planner-tab-CstoOlAB.js → planner-tab-CXph_C9F.js} +1 -1
- package/build/assets/{plugins-management-service-5rqVPEGN.js → plugins-management-service-CcEpfNKz.js} +1 -1
- package/build/assets/{profiles-service.api-D1XKMgr0.js → profiles-service.api-DdF_4Zhe.js} +1 -1
- package/build/assets/{providers-XmZ9HM4Q.js → providers-BWRnl31s.js} +1 -1
- package/build/assets/{proxy-XP6U1Dhv.js → proxy-DbEf3Nqr.js} +1 -1
- package/build/assets/recommended-automations-launcher-r0oI91HN.js +1 -0
- package/build/assets/root-j2fFRlWS.js +2 -0
- package/build/assets/{root-layout-DUquNZTU.js → root-layout-CfGgm2lo.js} +2 -2
- package/build/assets/root-sEWn3ha1.css +1 -0
- package/build/assets/{schema-field-Y3F8JvXd.js → schema-field-c3Ncgm4x.js} +1 -1
- package/build/assets/{sdk-section-page-CNZTLwH9.js → sdk-section-page-DFEiuiFQ.js} +1 -1
- package/build/assets/{secret-form-9-BoGA40.js → secret-form-WXXNFqTM.js} +1 -1
- package/build/assets/{secrets-service-BOIsfD9j.js → secrets-service-DU6wh3wX.js} +1 -1
- package/build/assets/{secrets-settings-CBJgFr42.js → secrets-settings-BEqbPvjy.js} +1 -1
- package/build/assets/{settings-D4hdToD4.js → settings-DjaSQwFh.js} +1 -1
- package/build/assets/{settings-dropdown-input-DBvsZ7-Q.js → settings-dropdown-input-BRR2OZwi.js} +1 -1
- package/build/assets/{settings-index-DeQphyBK.js → settings-index-DHv4XFcM.js} +1 -1
- package/build/assets/{settings-input-dVuzapBA.js → settings-input-Cm4VxUon.js} +1 -1
- package/build/assets/{settings-list-classes-DhAPuXm6.js → settings-list-classes-CaUfKZ33.js} +1 -1
- package/build/assets/{settings-modal-tHiJ8iYV.js → settings-modal-djXuAnBO.js} +1 -1
- package/build/assets/{settings-nav-GAQjW1a-.js → settings-nav-DFb3hBMr.js} +1 -1
- package/build/assets/{settings-service.api-C1vZH9Vh.js → settings-service.api-Q9lKW1TX.js} +1 -1
- package/build/assets/{settings-switch-DDd1cQ8t.js → settings-switch-seaSJc7t.js} +1 -1
- package/build/assets/{shared-conversation-Cyg7m7ns.js → shared-conversation-x3rxVCon.js} +1 -1
- package/build/assets/{sidebar-layout-DH0E-5KW.js → sidebar-layout-B6mcvvdV.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-CQ4iky__.js → sidebar-mobile-menu-toggle-CEqS8KnA.js} +1 -1
- package/build/assets/{sidebar-nav-link-oLQiKUBu.js → sidebar-nav-link-BTHX11LG.js} +1 -1
- package/build/assets/{sidebar-onboarding-checklist-storage-TfvNNnnr.js → sidebar-onboarding-checklist-storage-BP1kzn6p.js} +1 -1
- package/build/assets/{skill-card-pill-row-DfjIfj0K.js → skill-card-pill-row-TD39nfP3.js} +1 -1
- package/build/assets/{skill-filter-DsNLmn76.js → skill-filter-CdBbbwjm.js} +1 -1
- package/build/assets/{skill-icon-badge-0MK_68Nc.js → skill-icon-badge-vUEp7gsC.js} +1 -1
- package/build/assets/{skill-scope-BE-H9TSZ.js → skill-scope-BTRBQt0-.js} +1 -1
- package/build/assets/{skills-plugins-vzSdxSk_.js → skills-plugins-k1tUNAw4.js} +1 -1
- package/build/assets/{skills-settings-BiPOH9H9.js → skills-settings-CENviPT7.js} +1 -1
- package/build/assets/{styled-tooltip-CejG0rqv.js → styled-tooltip-DVAlWYnL.js} +1 -1
- package/build/assets/{task-list-tab-OkZSqnTp.js → task-list-tab-BLKF_x9f.js} +1 -1
- package/build/assets/{terminal-Dph60VFZ.js → terminal-Ckbnqb23.js} +1 -1
- package/build/assets/{toggle-switch-B2uXaAUS.js → toggle-switch-DeiG9Mf6.js} +1 -1
- package/build/assets/trash-CXN2R54L.js +1 -0
- package/build/assets/{typography-DgcLGdHk.js → typography-NarNyelM.js} +1 -1
- package/build/assets/{usage-tab-MCmNRAnR.js → usage-tab-Drd3O006.js} +1 -1
- package/build/assets/{use-acp-credential-form-ychoGqjC.js → use-acp-credential-form-CJ5wPsQm.js} +1 -1
- package/build/assets/{use-activate-agent-profile-8L8Xdghy.js → use-activate-agent-profile-iQZ0U3qV.js} +1 -1
- package/build/assets/{use-agent-profiles-Bi8hSkze.js → use-agent-profiles-LCvb5OXT.js} +1 -1
- package/build/assets/{use-automation-health-U99vvHxx.js → use-automation-health-DdgSa8sA.js} +1 -1
- package/build/assets/{use-automation-permissions-Buus0R6h.js → use-automation-permissions-D3kEeieu.js} +1 -1
- package/build/assets/{use-automations-Bq5hVuv0.js → use-automations-CEubcYTD.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-MzIeEV8F.js → use-can-manage-org-profiles-CB8ybxFK.js} +1 -1
- package/build/assets/{use-canvas-extensions-Ca9KoVEm.js → use-canvas-extensions-BMacwi2v.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-B4ZLUZSa.js → use-cloud-current-user-id-BEKRd6XZ.js} +1 -1
- package/build/assets/{use-config-l5tkDHyD.js → use-config-3WYcJsgC.js} +1 -1
- package/build/assets/{use-create-conversation-i_PdFdIs.js → use-create-conversation-Be-eVpFp.js} +1 -1
- package/build/assets/use-create-secret-Bk9ZxTjl.js +1 -0
- package/build/assets/{use-free-models-gCsJ5BV0.js → use-free-models-Ci3FkKEm.js} +1 -1
- package/build/assets/{use-get-secrets-CMTuWEp_.js → use-get-secrets-fqS0kxt6.js} +1 -1
- package/build/assets/{use-llm-configured-Dl4zg8ht.js → use-llm-configured-B71ZEVg2.js} +1 -1
- package/build/assets/{use-llm-profiles-SWsuFmFu.js → use-llm-profiles-xtCBMbef.js} +1 -1
- package/build/assets/{use-manifest-capabilities-CdqYfUAC.js → use-manifest-capabilities-Bso6A_-A.js} +1 -1
- package/build/assets/{use-onboarding-completion-Xl63ZvzQ.js → use-onboarding-completion-CEgjL02y.js} +1 -1
- package/build/assets/{use-pinned-home-route-BXDIUaxQ.js → use-pinned-home-route-pK4IlJ-p.js} +1 -1
- package/build/assets/{use-plugins-marketplace-BIIaPiaB.js → use-plugins-marketplace-B8-ZEB34.js} +1 -1
- package/build/assets/{use-save-agent-profile-D-ZHHE94.js → use-save-agent-profile-D7hJuW_u.js} +1 -1
- package/build/assets/{use-save-settings-Dapkf4cC.js → use-save-settings-CikTu5xV.js} +1 -1
- package/build/assets/{use-settings-C2KKQKVC.js → use-settings-BWIH5EuN.js} +1 -1
- package/build/assets/{use-settings-nav-items-TOc0Rsfd.js → use-settings-nav-items-DSKwLDnd.js} +1 -1
- package/build/assets/use-tracking-ChnSFChv.js +3 -0
- package/build/assets/{use-user-conversation-5UFqMoO4.js → use-user-conversation-C_l65DqW.js} +1 -1
- package/build/assets/utils-D-gOfhmN.js +1 -0
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js +2 -0
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js +48 -0
- package/build/assets/{verification-settings-DdBpaVPz.js → verification-settings-PKtoIUUY.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +10 -0
- package/build/locales/ca/openhands.json +10 -0
- package/build/locales/de/openhands.json +10 -0
- package/build/locales/en/openhands.json +10 -0
- package/build/locales/es/openhands.json +10 -0
- package/build/locales/fr/openhands.json +10 -0
- package/build/locales/it/openhands.json +10 -0
- package/build/locales/ja/openhands.json +10 -0
- package/build/locales/ko-KR/openhands.json +10 -0
- package/build/locales/no/openhands.json +10 -0
- package/build/locales/pt/openhands.json +10 -0
- package/build/locales/tr/openhands.json +10 -0
- package/build/locales/uk/openhands.json +10 -0
- package/build/locales/zh-CN/openhands.json +10 -0
- package/build/locales/zh-TW/openhands.json +10 -0
- package/config/defaults.json +3 -3
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs +3 -3
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js +12 -16
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js.map +1 -1
- package/dist/components/features/automations/detail/disabled-reason-banner.d.ts +16 -0
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +38 -29
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
- package/dist/components/features/settings/agent-profiles/profile-scope-list.d.ts +20 -0
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +3 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/constants/acp-providers.cjs +1 -1
- package/dist/constants/acp-providers.cjs.map +1 -1
- package/dist/constants/acp-providers.d.ts +0 -5
- package/dist/constants/acp-providers.js +20 -16
- package/dist/constants/acp-providers.js.map +1 -1
- package/dist/constants/profile-scope.d.ts +21 -0
- package/dist/hooks/query/use-automation-sdk-version.cjs +1 -1
- package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -1
- package/dist/hooks/query/use-automation-sdk-version.js +3 -1
- package/dist/hooks/query/use-automation-sdk-version.js.map +1 -1
- package/dist/hooks/use-drag-resize.cjs +1 -1
- package/dist/hooks/use-drag-resize.cjs.map +1 -1
- package/dist/hooks/use-drag-resize.js +8 -9
- package/dist/hooks/use-drag-resize.js.map +1 -1
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +10 -0
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +2 -2
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +170 -0
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +10 -0
- package/dist/locales/ca/openhands.json +10 -0
- package/dist/locales/de/openhands.json +10 -0
- package/dist/locales/en/openhands.json +10 -0
- package/dist/locales/es/openhands.json +10 -0
- package/dist/locales/fr/openhands.json +10 -0
- package/dist/locales/it/openhands.json +10 -0
- package/dist/locales/ja/openhands.json +10 -0
- package/dist/locales/ko-KR/openhands.json +10 -0
- package/dist/locales/no/openhands.json +10 -0
- package/dist/locales/pt/openhands.json +10 -0
- package/dist/locales/tr/openhands.json +10 -0
- package/dist/locales/uk/openhands.json +10 -0
- package/dist/locales/zh-CN/openhands.json +10 -0
- package/dist/locales/zh-TW/openhands.json +10 -0
- package/dist/manifests/manifest-validation.cjs +1 -1
- package/dist/manifests/manifest-validation.cjs.map +1 -1
- package/dist/manifests/manifest-validation.js +2 -2
- package/dist/manifests/manifest-validation.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js +15 -8
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js +11 -13
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +6 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +3 -6
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js +9 -12
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs +2 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js +41 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js +3 -6
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/clients.js +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +199 -61
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js +9 -8
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +2 -2
- package/dist/package.js.map +1 -1
- package/dist/routes/agent-settings.d.ts +5 -0
- package/dist/types/automation.cjs.map +1 -1
- package/dist/types/automation.d.ts +23 -1
- package/dist/types/automation.js.map +1 -1
- package/dist/utils/automation-disabled-reason.cjs +2 -0
- package/dist/utils/automation-disabled-reason.cjs.map +1 -0
- package/dist/utils/automation-disabled-reason.d.ts +32 -0
- package/dist/utils/automation-disabled-reason.js +19 -0
- package/dist/utils/automation-disabled-reason.js.map +1 -0
- package/dist/utils/parse-git-remote-url.cjs +1 -1
- package/dist/utils/parse-git-remote-url.cjs.map +1 -1
- package/dist/utils/parse-git-remote-url.d.ts +5 -1
- package/dist/utils/parse-git-remote-url.js +20 -13
- package/dist/utils/parse-git-remote-url.js.map +1 -1
- package/package.json +2 -2
- package/scripts/check-sdk-version-sync.mjs +79 -8
- package/scripts/dev-safe.mjs +1 -1
- package/scripts/static-server.mjs +24 -7
- package/build/assets/acp-providers-DcY_mKYa.js +0 -1
- package/build/assets/agent-server-conversation-service.api-jiCopc2E.js +0 -88
- package/build/assets/agent-settings-BF8hM6wb.js +0 -2
- package/build/assets/agent-settings-YPutBAeR.js +0 -1
- package/build/assets/automation-detail-BxXhb_m2.js +0 -3
- package/build/assets/automations-list-DEPVNud3.js +0 -1
- package/build/assets/backend-form-modal-DxisQV_6.js +0 -1
- package/build/assets/conversation-edjzrv5w.js +0 -1
- package/build/assets/conversation-panel-edjzrv5w.js +0 -1
- package/build/assets/edit-automation-modal-D_JWSmxT.js +0 -1
- package/build/assets/empty-state-FK_s1B60.js +0 -1
- package/build/assets/git-repo-dropdown-BoDDWXfX.js +0 -1
- package/build/assets/home-BM5_Wz_R.js +0 -1
- package/build/assets/home-Ivfm7KC4.js +0 -1
- package/build/assets/home-automation-run-tooltip-B1N2uO9p.js +0 -1
- package/build/assets/index-home-td9BN2T3.js +0 -1
- package/build/assets/kebab-menu-item-content-SCJBwZnp.js +0 -1
- package/build/assets/link-external-BNZzCM1I.js +0 -1
- package/build/assets/llm-settings-CZaXYgtw.js +0 -1
- package/build/assets/manifest-bfeccb98.js +0 -1
- package/build/assets/mcp-CraxoXQv.js +0 -1
- package/build/assets/mcp-marketplace-utils-C7PYr293.js +0 -1
- package/build/assets/mcp-page-CteH_K0N.js +0 -9
- package/build/assets/onboarding-DXFBRqEy.js +0 -1
- package/build/assets/parse-git-remote-url-DpDM9bK6.js +0 -1
- package/build/assets/recommended-automations-launcher-DEHRKIAg.js +0 -1
- package/build/assets/root-CM6IZHlg.css +0 -1
- package/build/assets/root-DdFkodKW.js +0 -2
- package/build/assets/trash-Ckh7yCaB.js +0 -1
- package/build/assets/use-create-secret-CjWq0J4O.js +0 -1
- package/build/assets/use-tracking-j4uo9VEW.js +0 -3
- package/build/assets/utils-BgLSZdyy.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js +0 -2
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js +0 -48
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-
|
|
2
|
-
import{a as e,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,bt as r,i,xt as a,yt as o}from"./vendor-styling-Ck5D_A2Q.js";import{B as s,F as c,I as l,L as u,O as d,R as f,U as p,V as m,W as h,p as g,z as _}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as v}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as y}from"./useInfiniteQuery-CtSRG7uW.js";import{t as b}from"./useMutation-Cszf8mKy.js";import{t as x}from"./useQuery-DAAacS7O.js";import{i as S}from"./recommended-automations-launcher-DEHRKIAg.js";import{t as C}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js";import{t as w}from"./useTranslation-CCgUjPJF.js";import{E as T,G as E,_ as D,ct as O,d as k,g as A,gt as j,i as M,l as N,n as P,r as ee,st as te,u as ne,v as F,y as I}from"./active-backend-context-BnH4-L8h.js";import{C as re,D as L,E as ie,K as R,t as z,w as B}from"./utils-BgLSZdyy.js";import{p as ae}from"./agent-server-client-options-EHB23gyx.js";import{A as oe,C as se,D as ce,E as le,M as ue,N as de,O as fe,S as pe,T as me,_ as he,a as ge,b as V,c as _e,d as ve,f as ye,g as be,h as xe,i as Se,j as Ce,k as we,l as Te,m as Ee,n as H,o as U,p as De,r as Oe,s as ke,t as Ae,u as je,v as Me,w as Ne,x as Pe,y as Fe}from"./vendor~root-layout-CcdIqs-C.js";import{t as Ie}from"./bot-ByolqPEr.js";import{t as Le}from"./check-Bo8s5Ylg.js";import{t as Re}from"./chevron-down-Cr6Fn_wS.js";import{n as ze,r as Be,t as Ve}from"./vendor~root-layout~conversation-panel~conversation-C3EBV3kp.js";import{t as W}from"./chevron-right-CfdfRn-8.js";import{a as He,i as Ue,n as We,o as Ge,r as Ke,s as qe,t as Je}from"./key-O84CMFHb.js";import{t as Ye}from"./circle-check-5pH3qCji.js";import{r as Xe}from"./map-provider-iRs80q_6.js";import{t as Ze}from"./external-link-Bd7Tga-1.js";import{i as Qe,n as $e,r as et}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{a as tt,c as nt,d as rt,f as it,i as at,l as ot,n as st,o as ct,p as lt,r as ut,s as dt,t as ft,u as G}from"./onboarding-DXFBRqEy.js";import{n as pt,r as mt,t as ht}from"./wrench-B8Wg_nbp.js";import{a as gt,i as _t,n as vt,r as yt,t as bt}from"./sidebar-store-DAZVH-DR.js";import{o as xt}from"./use-acp-credential-form-ychoGqjC.js";import{t as St}from"./list-filter-B8PQk3RA.js";import{o as Ct,r as wt}from"./backend-form-modal-DxisQV_6.js";import{t as Tt}from"./mouse-pointer-click-BXlRN92t.js";import{t as Et}from"./pin-BdroVQdN.js";import{t as Dt}from"./plug-7ACOEbMs.js";import{t as Ot}from"./plus-C2e21TFC.js";import{t as kt}from"./refresh-cw-BtdC3T8P.js";import{n as At,t as jt}from"./x-CX8lVGwm.js";import{a as Mt}from"./llm-settings-CODhjQzy.js";import{t as Nt}from"./trash-2-Bb40zQzs.js";import{n as Pt,r as Ft,t as K}from"./context-menu-list-item-Cm7-7Y-7.js";import{u as It}from"./agent-server-config-C_x8Otd9.js";import{r as Lt}from"./use-free-models-gCsJ5BV0.js";import{t as Rt}from"./react-BX7IV650.js";import{o as zt,t as Bt}from"./use-onboarding-completion-Xl63ZvzQ.js";import{t as Vt}from"./loading-spinner-BeLV0IXf.js";import{t as Ht}from"./use-config-l5tkDHyD.js";import{A as Ut,C as Wt,F as Gt,P as Kt,n as qt,t as Jt}from"./use-tracking-j4uo9VEW.js";import{l as Yt}from"./settings-service.api-C1vZH9Vh.js";import{n as Xt,t as Zt}from"./use-settings-C2KKQKVC.js";import{t as Qt}from"./use-save-settings-Dapkf4cC.js";import{t as $t}from"./modal-backdrop-BSzNhM4r.js";import{n as en,t as tn}from"./modal-body-C24WsdFb.js";import{i as nn,n as rn,r as an}from"./base-modal-C1a0TsSx.js";import{_ as on,c as sn}from"./form-control-classes-Dbq-7YP_.js";import{t as cn}from"./brand-button-CUMfjb99.js";import{n as ln,t as un}from"./navigation-context-CQZwH_tC.js";import{t as dn}from"./openhands-logo-BS-Epajy.js";import{t as fn}from"./navigation-link-Bxo3-4vo.js";import{r as pn,t as mn}from"./use-pinned-home-route-BXDIUaxQ.js";import{a as hn,d as gn,f as _n,i as vn,l as yn,n as bn,r as xn,u as Sn}from"./sidebar-layout-DH0E-5KW.js";import{a as Cn,i as wn,n as Tn,o as En,r as Dn,t as On}from"./sidebar-nav-link-oLQiKUBu.js";import{t as kn}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-CjECvSl5.js";import{t as An}from"./styled-tooltip-CejG0rqv.js";import{a as jn,d as Mn,f as Nn,i as Pn,l as Fn,n as In,o as Ln,r as Rn,u as zn}from"./dropdown-classes-BGvOvW2_.js";import{i as Bn,n as Vn}from"./settings-dropdown-input-DBvsZ7-Q.js";import{a as Hn,c as Un,d as Wn,f as Gn,i as Kn,l as qn,m as Jn,o as Yn,p as Xn,s as Zn,t as Qn,u as $n}from"./use-llm-configured-Dl4zg8ht.js";import{n as er,t as tr}from"./use-cloud-current-user-id-B4ZLUZSa.js";import{s as nr}from"./environment-switch-store-DVQZLFbj.js";import{g as rr,m as ir,t as ar}from"./conversation-store-DC-JlJuq.js";import{t as or}from"./modal-close-button-DfqfB2Nj.js";import{t as sr}from"./manage-backends-modal-cMXqCb-B.js";import{a as cr,i as lr,r as ur,t as dr}from"./agent-server-conversation-service.api-jiCopc2E.js";import{c as fr,d as pr,u as mr}from"./acp-providers-DcY_mKYa.js";import{c as hr,o as gr}from"./skill-enablement-DXeaImBz.js";import{t as _r}from"./use-is-authed-A2Yinlt0.js";import{n as vr,o as yr,s as br,t as xr}from"./conversation-state-store-9D_3P7q4.js";import{a as Sr,c as Cr,d as wr,i as Tr,l as Er,o as Dr,r as Or,s as kr,t as Ar,u as jr}from"./sidebar-mobile-menu-toggle-CQ4iky__.js";import{t as Mr}from"./use-click-outside-element-W6Os4Nlb.js";import{t as Nr}from"./use-llm-profiles-SWsuFmFu.js";import{n as Pr}from"./use-create-conversation-i_PdFdIs.js";import{t as Fr}from"./format-time-delta-BIR5Os7T.js";import{r as Ir,t as Lr}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js";import{a as q,i as Rr,n as zr}from"./use-can-manage-org-profiles-MzIeEV8F.js";import{t as Br}from"./u-edit-DAkcF52u.js";import{t as Vr}from"./skills-B0IliMxw.js";import{i as Hr}from"./format-model-name-Dfh9Udrx.js";import{r as Ur}from"./onboarding-modal-BT3Gx_sZ.js";import{a as Wr,o as Gr,t as Kr}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DXqM7vqB.js";import{m as qr}from"./install-server-modal-B81I-5OE.js";import{n as Jr}from"./toggle-switch-B2uXaAUS.js";import{n as Yr}from"./scroll-fade-state-Dt_fx2kf.js";import{t as Xr}from"./enum-filter-dropdown-UNaom12H.js";import{c as Zr,i as Qr,n as $r,r as ei,s as ti,t as ni}from"./home-store-DCbei3DX.js";import{t as ri}from"./search-BatSpWed.js";import{_ as ii,a as ai,b as oi,c as si,d as ci,f as li,g as ui,h as di,i as fi,l as pi,m as mi,n as hi,o as gi,p as _i,s as vi,t as yi,u as bi,v as xi,y as Si}from"./sidebar-onboarding-checklist-storage-TfvNNnnr.js";import{n as Ci,t as wi}from"./use-automation-health-U99vvHxx.js";import{t as Ti}from"./server-process-C9RKzd1x.js";import{t as Ei}from"./use-automations-Bq5hVuv0.js";import{n as Di,t as Oi}from"./canvas-extensions-runtime-B8kxM4rO.js";import{t as ki}from"./use-user-conversation-5UFqMoO4.js";var J=e(n(),1),Y=o(),Ai=46,ji=30;function Mi({className:e,logoClassName:t,logoWidth:n=Ai,logoHeight:r=ji}={}){let{t:i}=w(`openhands`);return(0,Y.jsx)(fn,{to:`/conversations`,"aria-label":i(R.BRANDING$OPENHANDS_LOGO),className:z(e),children:(0,Y.jsx)(dn,{width:n,height:r,className:z(`shrink-0`,t)})})}function Ni(){return(0,Y.jsx)(`div`,{className:`animate-spin h-4 w-4 border-2 border-transparent border-t-white rounded-full`,"data-testid":`dropdown-loading`})}function Pi({onClear:e}){return(0,Y.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,Y.jsx)(jt,{size:14})})}function Fi({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,Y.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:z(Bn,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,Y.jsx)(Vn,{})})}function Ii({isOpen:e,filteredOptions:t,selectedItem:n,emptyMessage:r,getMenuProps:i,getItemProps:a,footer:o,openUpward:s=!1,fitContent:c=!1}){return(0,Y.jsxs)(`div`,{className:z(`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,Y.jsxs)(`ul`,{...i({className:z(`p-0`,Pn)}),children:[e&&t.length===0&&(0,Y.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,children:r}),e&&t.map((e,t)=>(0,Y.jsxs)(`li`,{...a({item:e,index:t,className:z(Ln,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,Y.jsx)(`span`,{className:zn,children:e.prefix}):null,(0,Y.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label})]},e.value))]}),e&&o?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Jn,{inset:`menu`}),(0,Y.jsx)(`div`,{className:`p-0`,children:o})]}):null]})}function Li({placeholder:e,isDisabled:t,getInputProps:n,italicPlaceholder:r=!0,fitContent:i=!1}){return(0,Y.jsx)(`input`,{...n({placeholder:e,disabled:t,className:z(`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`,sn,`px-0 not-italic text-inherit`)})})}var Ri={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function zi({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 _=J.useRef(null),[v,y]=(0,J.useState)(o?.label??``),[b,x]=(0,J.useState)(``);J.useEffect(()=>()=>{_.current&&=(clearTimeout(_.current),null)},[]);let S=e.filter(e=>e.label.toLowerCase().includes(b.toLowerCase())),{isOpen:C,selectedItem:w,selectItem:T,openMenu:E,closeMenu:D,getToggleButtonProps:O,getMenuProps:k,getItemProps:A,getInputProps:j}=kn({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===kn.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(``))}}),M=r||i,N=w?e.find(e=>e.value===w.value)??w:null,P=e=>j({...e,onChange:e=>{y(e.target.value),x(e.target.value)}});return(0,Y.jsxs)(`div`,{className:z(`relative`,g?`inline-block w-auto`:`w-full`),"data-testid":c,onMouseEnter:m?()=>{_.current&&=(clearTimeout(_.current),null),E()}:void 0,onMouseLeave:m?()=>{_.current&&clearTimeout(_.current),_.current=setTimeout(()=>D(),150)}:void 0,children:[f?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`input`,{...P({"aria-label":a??`Filter options`,tabIndex:-1}),style:Ri}),(0,Y.jsx)(`button`,{type:`button`,...O({tabIndex:-1}),style:Ri,"aria-hidden":!0})]}):(0,Y.jsxs)(`div`,{className:z(Nn,g?`w-auto`:`w-full`,M&&`cursor-not-allowed opacity-60`,l),children:[N?.prefix?(0,Y.jsx)(`span`,{className:`flex items-center shrink-0`,children:N.prefix}):null,(0,Y.jsx)(Li,{placeholder:a,isDisabled:M,getInputProps:P,italicPlaceholder:h,fitContent:g}),r&&(0,Y.jsx)(Ni,{}),n&&w&&(0,Y.jsx)(Pi,{onClear:()=>T(null)}),(0,Y.jsx)(Fi,{isOpen:C,isDisabled:M,getToggleButtonProps:O})]}),(0,Y.jsx)(Ii,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:k,getItemProps:A,footer:u,openUpward:d,fitContent:g})]})}var Bi=t({AddBackendModal:()=>Vi});function Vi({onClose:e}){return(0,Y.jsx)(wt,{mode:`add`,onClose:e})}var Hi=`::`;function Ui(e,t){return t?`${e}${Hi}${t}`:e}function Wi(e){let[t,n]=e.split(Hi);return{backendId:t,orgId:n??null}}function Gi(e){return(0,Y.jsx)(Ct,{isConnected:e?.isConnected??null})}function Ki(){return(0,Y.jsx)(Ct,{isConnected:`unavailable`})}function qi(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:Ui(e.id,null),label:e.name,prefix:Gi(i[e.id])});for(let e of s){let o=n[e.id],s=Gi(i[e.id]);if(!o||o.orgs.length===0)a.push({value:Ui(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:Ui(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function Ji({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:r,onOpenAddBackend:i,onOpenManageBackends:a,sidebarCollapsed:o=!1}={}){let{t:s}=w(`openhands`),{backends:c,active:u,setActive:d}=ee(),p=er(),m=tr(),h=zt(c),g=f(),_=l(`/settings`),v=l(`/settings/*`),y=l(`/conversations/:conversationId`),b=l(`/automations/:automationId`),[x,S]=J.useState(!1),[C,T]=J.useState(!1),E=s(R.BACKEND$PERSONAL_WORKSPACE),D=J.useMemo(()=>qi(c,E,p,m,h),[c,E,p,m,h]),O=ae(u.backend),k=s(R.BACKEND$NO_BACKEND_AVAILABLE),A=Ui(u.backend.id,u.orgId),j=O?void 0:D.find(e=>e.value===A),M=!!(_||v),N=s(R.SIDEBAR$SETTINGS),P=u.orgId?`?org=${encodeURIComponent(u.orgId)}`:``,te=ar(e=>e.isRightPanelShown),ne=!o||y&&te?`top`:`left`,F=Object.values(p).some(e=>e.isLoading);J.useEffect(()=>{if(O||u.backend.kind!==`cloud`||u.orgId)return;let{backend:e}=u,t=p[e.id];if(!t||t.orgs.length===0)return;let n=t.currentOrgId?t.orgs.find(e=>e.id===t.currentOrgId):void 0,r=m[e.id]?.userId??null,i=r?t.orgs.find(e=>e.id===r):void 0,a=n??i??t.orgs[0];a&&d(e.id,a.id)},[u,p,m,d,O]);let I=J.useCallback(()=>{if(i){i(),r?.();return}S(!0)},[i,r]),re=J.useCallback(()=>{if(a){a(),r?.();return}T(!0)},[a,r]),L=It()!==null,ie=L&&u.backend.authMode===`cookie`,B=J.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),oe=J.useCallback(e=>{B(e),I()},[I,B]),se=J.useCallback(e=>{B(e),I()},[I,B]),ce=J.useCallback(e=>{B(e),re()},[re,B]),le=J.useCallback(e=>{B(e),re()},[re,B]),ue=ie?void 0:(0,Y.jsxs)(`div`,{className:Pn,children:[L?null:(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:B,onTouchStart:B,onTouchEnd:se,onClick:oe,className:z(In,`cursor-pointer rounded-md`),children:[(0,Y.jsx)(`span`,{className:zn,"aria-hidden":!0,children:(0,Y.jsx)(Ot,{width:16,height:16})}),s(R.BACKEND$ADD)]}),(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:B,onTouchStart:B,onTouchEnd:le,onClick:ce,className:z(In,`cursor-pointer rounded-md`),children:[(0,Y.jsx)(`span`,{className:zn,"aria-hidden":!0,children:(0,Y.jsx)(yt,{width:16,height:16})}),s(L?R.BACKEND$RECONNECT_CLOUD:R.BACKEND$MANAGE)]})]}),de=J.useCallback(async e=>{if(e===A)return;let{backendId:t,orgId:n}=Wi(e),i=c.find(e=>e.id===t);i&&(nr(D.find(t=>t.value===e)?.label??i.name),await new Promise(e=>{setTimeout(e,400)}),y?g(`/conversations`):b&&g(`/automations`),d(i.id,n),r?.())},[A,c,y,b,g,D,d,s,r]);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 w-full`,children:[(0,Y.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,Y.jsx)(zi,{testId:`backend-selector`,defaultValue:j??{value:A,label:O?k:u.backend.name,prefix:O?Ki():Gi(h[u.backend.id])},footer:ue,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&de(e.value)},placeholder:O?k:u.backend.name,loading:F,options:D,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`},`${A}-${j?.label??``}`)}),t?null:(0,Y.jsx)(An,{content:N,placement:ne,offset:10,children:u.backend.kind===`cloud`?(0,Y.jsx)(`a`,{href:`${u.backend.host.replace(/\/+$/,``)}/settings${P}`,target:L?void 0:`_blank`,rel:L?void 0:`noopener noreferrer`,"data-testid":`backend-selector-settings-link`,"aria-label":N,className:z(`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`,on),children:(0,Y.jsx)(yt,{width:16,height:16})}):(0,Y.jsx)(fn,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":M,"aria-label":N,className:z(M?`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`,on),children:(0,Y.jsx)(yt,{width:16,height:16})})})]}),x?(0,Y.jsx)(Vi,{onClose:()=>S(!1)}):null,C?(0,Y.jsx)(sr,{onClose:()=>T(!1)}):null]})}var Yi=`command-menu-trigger`,Xi=18;function Zi({collapsed:e}){let{t}=w(`openhands`),n=vt(e=>e.open),r=t(R.COMMAND_MENU$OPEN_LABEL),i=(0,Y.jsxs)(`button`,{type:`button`,"data-testid":Yi,"aria-label":r,onClick:n,className:z(_n({collapsed:e}),e?`cursor-pointer`:`group justify-between border border-[var(--oh-border-subtle)] bg-[var(--oh-surface)]/50 hover:border-[var(--oh-border)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[e?(0,Y.jsx)(En,{active:!1,children:(0,Y.jsx)(At,{width:Xi,height:Xi})}):(0,Y.jsx)(`span`,{className:z(hn,`text-[var(--oh-muted)] group-hover:text-white`),"aria-hidden":`true`,children:(0,Y.jsx)(At,{width:Xi,height:Xi})}),(0,Y.jsx)(`span`,{className:Sn(e),children:r})]}),e?null:(0,Y.jsx)(`kbd`,{className:`rounded-md border border-[var(--oh-border)] bg-black/20 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--oh-text-dim)]`,children:t(R.COMMAND_MENU$SHORTCUT)})]});return e?(0,Y.jsx)(An,{content:r,placement:`right`,children:i}):i}var Qi=2e3,$i=[`npm`,`docker`];function ea(e){return e===`npm`?R.SETTINGS$VERSION_NPM_RECOMMENDED:R.SETTINGS$VERSION_DOCKER}function ta({tab:e}){return e===`npm`?(0,Y.jsx)(We,{className:`size-4 shrink-0`,"aria-hidden":!0}):(0,Y.jsx)(Ke,{className:`size-5 shrink-0`,"aria-hidden":!0})}function na({installedVersion:e,latestVersion:t,updateAvailable:n,isChecking:r,onCheckForUpdates:i,onClose:a}){let{t:o}=w(`openhands`),[s,c]=J.useState(`npm`),[l,u]=J.useState(!1),d=J.useRef(null),f=s===`npm`?Ge.npm:Ge.docker;J.useEffect(()=>()=>{d.current!==null&&window.clearTimeout(d.current)},[]),J.useEffect(()=>{u(!1),d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[s]);let p=J.useCallback(()=>{navigator.clipboard?.writeText(f),u(!0),d.current!==null&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>{u(!1),d.current=null},Qi)},[f]);return(0,Y.jsx)($t,{onClose:a,"aria-label":o(R.SETTINGS$VERSION_MODAL_ARIA_LABEL),children:(0,Y.jsxs)(`section`,{className:`relative flex w-[520px] max-w-[90vw] flex-col gap-5 rounded-xl border border-[var(--oh-border)] bg-base-secondary p-6 shadow-xl`,children:[(0,Y.jsx)(or,{onClose:a,testId:`agent-canvas-version-modal-close`}),(0,Y.jsxs)(`header`,{className:`flex items-center gap-3 pr-8`,children:[n?(0,Y.jsx)(qe,{className:`size-7 shrink-0 text-[#3B82F6]`,"aria-hidden":!0}):(0,Y.jsx)(Ye,{className:`size-7 shrink-0 text-[var(--oh-status-success)]`,"aria-hidden":!0}),(0,Y.jsx)(`h2`,{className:`text-base font-semibold leading-6 text-white`,children:o(n?R.SETTINGS$VERSION_UPDATE_AVAILABLE:R.SETTINGS$VERSION_UP_TO_DATE_TITLE)}),n&&t?(0,Y.jsx)(`span`,{className:`rounded-full bg-[#1E3A5F] px-2 py-0.5 text-xs font-semibold text-[#3B82F6]`,children:t}):null]}),(0,Y.jsx)(`div`,{className:`flex flex-col gap-1`,children:n&&t?(0,Y.jsxs)(`p`,{className:`text-sm text-[var(--oh-text)]`,children:[o(R.SETTINGS$VERSION_UPDATE_MESSAGE,{installed:e,latest:t}),` `,(0,Y.jsxs)(`a`,{href:He,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 whitespace-nowrap font-medium text-white hover:text-[var(--oh-text)]`,children:[o(R.SETTINGS$VERSION_RELEASE_NOTES),(0,Y.jsx)(Ze,{className:`size-4 shrink-0`,"aria-hidden":!0})]})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`text-sm text-[var(--oh-text)]`,children:o(R.SETTINGS$VERSION_INSTALLED,{version:e})}),t?(0,Y.jsxs)(`p`,{className:`whitespace-nowrap text-sm text-[var(--oh-status-success)]`,children:[o(R.SETTINGS$VERSION_LATEST_MESSAGE),` `,(0,Y.jsxs)(`a`,{href:He,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 font-medium text-white hover:text-[var(--oh-text)]`,children:[o(R.SETTINGS$VERSION_RELEASE_NOTES),(0,Y.jsx)(Ze,{className:`size-4 shrink-0`,"aria-hidden":!0})]})]}):(0,Y.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:o(R.SETTINGS$VERSION_CHECK_UNAVAILABLE)})]})}),n?(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`flex justify-center`,children:$i.map(e=>(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>c(e),className:z(`inline-flex items-center gap-1.5 px-3 pb-2 text-sm font-medium`,s===e?`border-b border-white text-white`:`text-[var(--oh-muted)] hover:text-white`),children:[(0,Y.jsx)(ta,{tab:e}),o(ea(e))]},e))}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface-deep)] px-4 py-3`,children:[(0,Y.jsx)(`code`,{className:`min-w-0 flex-1 overflow-visible whitespace-nowrap font-mono text-sm text-white`,children:f}),(0,Y.jsx)(`button`,{type:`button`,onClick:p,"aria-label":o(l?R.BUTTON$COPIED:R.SETTINGS$VERSION_COPY_COMMAND),disabled:l,className:`shrink-0 text-[var(--oh-muted)] hover:text-white disabled:hover:text-[var(--oh-muted)]`,children:l?(0,Y.jsx)(Le,{className:`size-4 text-[var(--oh-status-success)]`,"aria-hidden":!0}):(0,Y.jsx)(Xe,{className:`size-4`,"aria-hidden":!0})})]})]}):null,n?null:(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-x-8 gap-y-3`,children:(0,Y.jsxs)(`button`,{type:`button`,onClick:i,className:`inline-flex items-center gap-2 text-sm font-medium text-white hover:text-[var(--oh-text)] disabled:cursor-wait disabled:text-[var(--oh-muted)]`,disabled:r,children:[o(R.SETTINGS$VERSION_CHECK_FOR_UPDATES),(0,Y.jsx)(kt,{className:z(`size-4 shrink-0`,r&&`animate-spin`),"aria-hidden":!0})]})})]})})}function ra({className:e,hideWhenUpToDate:t=!1}){let{t:n}=w(`openhands`),[r,i]=J.useState(!1),a=It()!==null,o=Ue({enabled:!a});if(a)return null;let s=T,c=o.data??null,l=(c===null?null:E(c,s))===1;return t&&!l?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`agent-canvas-version-tile`,onClick:()=>i(!0),"aria-label":n(R.SETTINGS$VERSION_TILE_ARIA_LABEL),className:z(`flex w-full items-center gap-3 rounded-md border border-[var(--oh-border)] bg-base-secondary px-3 py-2 text-left hover:bg-[var(--oh-surface-raised)]`,e),children:[(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`span`,{className:`block truncate text-sm font-semibold leading-5 text-white`,children:n(l?R.SETTINGS$VERSION_TILE_NEW_VERSION:R.SETTINGS$VERSION_PRODUCT_NAME)}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 truncate text-xs leading-5`,children:[(0,Y.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:n(R.SETTINGS$APP_UPDATE_VERSION_LABEL)}),(0,Y.jsx)(`span`,{className:`truncate text-white`,children:l&&c?c:s})]})]}),l?(0,Y.jsx)(qe,{className:`size-5 shrink-0 text-[#3B82F6]`,"aria-hidden":!0}):(0,Y.jsx)(Ye,{className:`size-5 shrink-0 text-[var(--oh-status-success)]`,"aria-hidden":!0})]}),r?(0,Y.jsx)(na,{installedVersion:s,latestVersion:c,updateAvailable:l,isChecking:o.isFetching,onCheckForUpdates:()=>{o.refetch()},onClose:()=>i(!1)}):null]})}var ia=(e=20)=>{let{data:t}=_r(),n=P(),{currentPath:r}=ln(),i=!ae(n.backend);return y({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await dr.searchConversations(e,t),enabled:!!t&&i,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:Gt(r)?!1:3e4,refetchIntervalInBackground:!1,meta:{backendId:n.backend.id}})},aa=(e=10)=>x({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function oa({onConfirm:e,onCancel:t,conversationTitle:n}){let{t:r}=w(`openhands`),i=n!=null&&n!==``?(0,Y.jsx)(C,{ns:`openhands`,i18nKey:R.CONVERSATION$ARCHIVE_WARNING_WITH_TITLE,values:{title:n},components:{title:(0,Y.jsx)(`span`,{className:`text-white`})}}):r(R.CONVERSATION$ARCHIVE_WARNING);return(0,Y.jsx)($t,{onClose:t,children:(0,Y.jsxs)(en,{className:`items-start border border-[var(--oh-border)]`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(an,{title:r(R.CONVERSATION$CONFIRM_ARCHIVE)}),(0,Y.jsx)(rn,{children:i})]}),(0,Y.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsx)(cn,{type:`button`,variant:`secondary`,onClick:t,testId:`cancel-button`,children:r(R.BUTTON$CANCEL)}),(0,Y.jsx)(cn,{type:`button`,variant:`primary`,onClick:e,testId:`confirm-button`,children:r(R.ACTION$CONFIRM_ARCHIVE)})]})]})})}function sa({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=w(`openhands`);return(0,Y.jsx)($t,{onClose:n,children:(0,Y.jsxs)(en,{testID:`confirm-new-conversation-modal`,children:[(0,Y.jsx)(an,{title:r(R.CONVERSATION$EXIT_WARNING)}),(0,Y.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,Y.jsx)(nn,{text:r(R.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,Y.jsx)(nn,{text:r(R.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}var ca=()=>{let e=v();return b({mutationFn:e=>dr.updateConversationTags(e.conversationId,e.tags),onMutate:async t=>{let n=[`user`,`conversation`,t.conversationId];await e.cancelQueries({queryKey:n}),await e.cancelQueries({queryKey:[`user`,`conversations`]});let r=e.getQueriesData({queryKey:n}),i=e.getQueryData([`user`,`conversations`]);return e.setQueriesData({queryKey:n},e=>e&&{...e,tags:t.tags}),e.setQueryData([`user`,`conversations`],e=>e?.map(e=>e.id===t.conversationId?{...e,tags:t.tags}:e)),{previousEntries:r,previousConversations:i}},onError:(t,n,r)=>{r?.previousEntries.forEach(([t,n])=>{e.setQueryData(t,n)}),r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`user`,`conversation`,r.conversationId]})}})},la=/^[a-z0-9]+$/;function ua(e,t){let n={};for(let[t,r]of Object.entries(e??{}))(lr.has(t.trim().toLowerCase())||typeof r!=`string`||r!==``&&r.trim().length===0)&&(n[t]=r);for(let[e,r]of t)n[e]=r;return n}function da({tags:e,onConfirm:t,onCancel:n}){let{t:r}=w(`openhands`),[i,a]=J.useState(()=>cr(e).map(([e,t])=>({key:e,value:t}))),[o,s]=J.useState(``),[c,l]=J.useState(``),[u,d]=J.useState(null),f=J.useRef(null),p=()=>{let e=o.trim(),t=c.trim();return la.test(e)?lr.has(e)?{errorKey:R.CONVERSATION$TAG_KEY_RESERVED}:i.some(t=>t.key===e)?{errorKey:R.CONVERSATION$TAG_KEY_DUPLICATE}:t.length>256?{errorKey:R.CONVERSATION$TAG_VALUE_INVALID}:{row:{key:e,value:t}}:{errorKey:R.CONVERSATION$TAG_KEY_INVALID}},m=()=>{let e=p();if(`errorKey`in e){d(e.errorKey);return}a(t=>[...t,e.row]),s(``),l(``),d(null),f.current?.focus()},h=e=>{e.key===`Enter`&&(e.preventDefault(),m())},g=e=>{a(t=>t.filter(t=>t.key!==e))};return(0,Y.jsx)($t,{onClose:n,children:(0,Y.jsxs)(en,{className:`items-start border border-[var(--oh-border)]`,testID:`edit-conversation-tags-modal`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(an,{title:r(R.CONVERSATION$EDIT_TAGS)}),(0,Y.jsx)(rn,{children:r(R.CONVERSATION$EDIT_TAGS_DESCRIPTION)})]}),(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,onClick:e=>e.stopPropagation(),children:[i.length>0?(0,Y.jsx)(`ul`,{className:`flex w-full flex-col gap-1`,"data-testid":`edit-tags-rows`,children:i.map(e=>(0,Y.jsxs)(`li`,{className:`flex items-center gap-2 rounded-md border border-[var(--oh-border)] px-2 py-1`,"data-testid":`edit-tag-row-${e.key}`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-white`,children:e.value?`${e.key}=${e.value}`:e.key}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":r(R.CONVERSATION$REMOVE_TAG),"data-testid":`remove-tag-${e.key}`,onClick:()=>g(e.key),className:`shrink-0 text-[var(--oh-muted)] hover:text-white`,children:(0,Y.jsx)(jt,{className:`h-3.5 w-3.5`,"aria-hidden":!0})})]},e.key))}):null,(0,Y.jsxs)(`div`,{className:`flex w-full items-center gap-2`,children:[(0,Y.jsx)(`input`,{type:`text`,value:o,placeholder:r(R.CONVERSATION$TAG_KEY_PLACEHOLDER),"aria-label":r(R.CONVERSATION$TAG_KEY_PLACEHOLDER),"data-testid":`new-tag-key-input`,ref:f,onChange:e=>s(e.target.value),onKeyDown:h,className:`w-28 shrink-0 rounded-md border border-[var(--oh-border)] bg-base-secondary px-2 py-1 text-xs text-white placeholder:text-[var(--oh-muted)]`}),(0,Y.jsx)(`input`,{type:`text`,value:c,placeholder:r(R.CONVERSATION$TAG_VALUE_PLACEHOLDER),"aria-label":r(R.CONVERSATION$TAG_VALUE_PLACEHOLDER),"data-testid":`new-tag-value-input`,onChange:e=>l(e.target.value),onKeyDown:h,className:`min-w-0 flex-1 rounded-md border border-[var(--oh-border)] bg-base-secondary px-2 py-1 text-xs text-white placeholder:text-[var(--oh-muted)]`}),(0,Y.jsx)(cn,{type:`button`,variant:`secondary`,onClick:m,testId:`add-tag-button`,children:r(R.BUTTON$ADD)})]}),u?(0,Y.jsx)(`p`,{role:`alert`,"data-testid":`edit-tags-error`,className:`text-xs text-red-400`,children:r(u)}):null]}),(0,Y.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsx)(cn,{type:`button`,variant:`secondary`,onClick:n,testId:`cancel-button`,children:r(R.BUTTON$CANCEL)}),(0,Y.jsx)(cn,{type:`button`,variant:`primary`,onClick:()=>{let n=o.trim()!==``||c.trim()!==``,r=i;if(n){let e=p();if(`errorKey`in e){d(e.errorKey);return}r=[...i,e.row]}t(ua(e,r.map(e=>[e.key,e.value])))},testId:`confirm-button`,children:r(R.BUTTON$SAVE)})]})]})})}function fa({titleMode:e,title:t,onSave:n,isConversationArchived:r}){return e===`edit`?(0,Y.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,Y.jsx)(`p`,{"data-testid":`conversation-card-title`,className:z(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),children:t})}var pa=e=>{switch(e){case L.FINISHED:return`check`;case L.RUNNING:return`working`;case L.IDLE:case L.WAITING_FOR_CONFIRMATION:return`active`;case L.PAUSED:return`paused`;case L.ERROR:case L.STUCK:return`error`;default:return`unknown`}},ma=(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 ha(e){switch(e){case`check`:return(0,Y.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,Y.jsx)(`path`,{d:`M2.5 6.5 5 9l4.5-5.5`})});case`working`:return(0,Y.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,Y.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,Y.jsx)(`span`,{"data-testid":`conversation-status-paused`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-muted)]`});case`error`:return(0,Y.jsx)(`span`,{"data-testid":`conversation-status-error`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-error)]`});default:return(0,Y.jsx)(`span`,{"data-testid":`conversation-status-unknown`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-color-tertiary)]`})}}function ga({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=w(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:pa(e),o=r(ma(a,i)),s=(0,Y.jsx)(`div`,{className:`w-2.5 h-2.5 flex items-center justify-center shrink-0`,children:i?(0,Y.jsx)(Lr,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):ha(a)});return n?(0,Y.jsx)(An,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function _a({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){let a=$n(i);return(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[r!==void 0&&(0,Y.jsx)(`div`,{className:`flex w-[18px] shrink-0 items-center justify-center`,children:(0,Y.jsx)(ga,{executionStatus:r,sandboxStatus:i,showTooltip:!1})}),(0,Y.jsx)(fa,{title:e,titleMode:t,onSave:n,isConversationArchived:a})]})}var va=e(r(),1);function ya({onClose:e,onDelete:t,onArchive:n,onUnarchive:r,onStop:i,onEdit:a,onEditTags:o,onDisplayCost:s,onShowAgentTools:c,onShowSkills:l,onDownloadViaVSCode:u,onDownloadConversation:d,position:f=`bottom`,floatingStyle:p,ignoreOutsideClickRef:m}){let{t:h}=w(`openhands`),{backend:g}=P(),_=Mr(e,m),v=g.kind===`cloud`?R.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:R.COMMON$STOP_CONVERSATION,y=(0,J.useCallback)((e,t,n)=>{let r=e.filter(e=>e!=null);return r.length>0?n?(0,Y.jsx)(J.Fragment,{children:r},t):(0,Y.jsxs)(J.Fragment,{children:[r,(0,Y.jsx)(Jn,{inset:`menu`})]},t):null},[]),b=p!=null;return(0,Y.jsxs)(Pt,{ref:_,testId:`context-menu`,style:b?p:void 0,theme:b?`popover`:`default`,position:b?`none`:f,alignment:b?`none`:`right`,spacing:b?`none`:`default`,className:b?`mt-0 min-w-[200px] w-max max-w-[min(280px,100vw-16px)]`:`z-[200] mt-0`,children:[y([a&&(0,Y.jsx)(K,{testId:`edit-button`,onClick:a,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(Br,{width:16,height:16}),text:h(R.BUTTON$RENAME)})},`edit-button`),o&&(0,Y.jsx)(K,{testId:`edit-tags-button`,onClick:o,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(ge,{className:`h-4 w-4`,"aria-hidden":!0}),text:h(R.CONVERSATION$EDIT_TAGS)})},`edit-tags-button`)],`edit-section`),y([c&&(0,Y.jsx)(K,{testId:`show-agent-tools-button`,onClick:c,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(qn,{width:16,height:16}),text:h(R.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})},`show-agent-tools-button`),l&&(0,Y.jsx)(K,{testId:`show-skills-button`,onClick:l,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(Vr,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:h(R.CONVERSATION$SHOW_SKILLS)})},`show-skills-button`)],`tools-section`),y([i&&(0,Y.jsx)(K,{testId:`stop-button`,onClick:i,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(Un,{width:16,height:16}),text:h(v)})},`stop-button`),u&&(0,Y.jsx)(K,{testId:`download-vscode-button`,onClick:u,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(kr,{width:16,height:16}),text:h(R.BUTTON$DOWNLOAD_VIA_VSCODE)})},`download-vscode-button`),d&&(0,Y.jsx)(K,{testId:`download-trajectory-button`,onClick:d,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(kr,{width:16,height:16}),text:h(R.BUTTON$DOWNLOAD_CONVERSATION_DATA)})},`download-trajectory-button`)],`control-section`),y([s&&(0,Y.jsx)(K,{testId:`display-cost-button`,onClick:s,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(et,{size:16}),text:h(R.BUTTON$DISPLAY_COST)})},`display-cost-button`),n&&(0,Y.jsx)(K,{testId:`archive-button`,onClick:n,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(ue,{className:`h-4 w-4`,"aria-hidden":!0}),text:h(R.COMMON$ARCHIVE_CONVERSATION)})},`archive-button`),r&&(0,Y.jsx)(K,{testId:`unarchive-button`,onClick:r,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(de,{className:`h-4 w-4`,"aria-hidden":!0}),text:h(R.COMMON$UNARCHIVE_CONVERSATION)})},`unarchive-button`),t&&(0,Y.jsx)(K,{testId:`delete-button`,onClick:t,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(Rr,{width:16,height:16}),text:h(R.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function ba({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onArchive:r,onUnarchive:i,onStop:a,onEdit:o,onEditTags:s,onDownloadViaVSCode:c,onDownloadConversation:l,executionStatus:u,conversationId:d,showOptions:f}){let{t:p}=w(`openhands`),m=ie(u),h=B(u),g=(0,J.useRef)(null),[,_]=(0,J.useReducer)(e=>e+1,0);(0,J.useLayoutEffect)(()=>{if(!e)return;_();let t=0,n=()=>{t||=window.requestAnimationFrame(()=>{t=0,_()})};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 v=(()=>{if(!e||!g.current)return;let t=g.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+320+8>r?Math.max(8,t.top-320-4):i+4,right:Math.max(8,n-a),zIndex:1e5}})(),y=typeof document<`u`?document.body:null;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(zr,{ref:g,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},ariaLabel:p(R.COMMON$MORE_OPTIONS),className:z(m&&`opacity-60`)}),e&&v&&y?(0,va.createPortal)((0,Y.jsx)(ya,{ignoreOutsideClickRef:g,floatingStyle:v,onClose:()=>t(!1),onDelete:n,onArchive:r,onUnarchive:i,onStop:h?a:void 0,onEdit:o,onEditTags:s,onDownloadViaVSCode:d&&f?c:void 0,onDownloadConversation:d?l:void 0,position:`bottom`}),y):null]})}var xa=`inline-flex max-w-full min-w-0 shrink-0 items-center gap-0.5 rounded-sm bg-[var(--oh-surface-raised)] px-1 py-px text-[10px] leading-4 text-[var(--oh-muted)]`,Sa=`inline-flex h-4 w-3 shrink-0 items-center justify-center [&_svg]:block`,Ca=`h-3 w-3`,wa=z(xa,`shrink`),Ta={bitbucket:Kr,bitbucket_data_center:Kr,github:Wr,gitlab:Gr};function Ea({selectedRepository:e}){let t=e.git_provider?Ta[e.git_provider]:null,n=e.selected_repository,r=e.selected_branch;return(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 overflow-hidden`,children:[n?(0,Y.jsxs)(`span`,{"data-testid":`conversation-card-selected-repository`,title:n,className:wa,children:[(t||e.git_provider===`azure_devops`)&&(0,Y.jsx)(`span`,{className:`inline-flex h-4 w-3 shrink-0 items-center justify-center [&_svg]:block`,"aria-hidden":!0,children:t?(0,Y.jsx)(t,{className:`h-3 w-3`}):(0,Y.jsx)(Zn,{className:`h-3 w-3`})}),(0,Y.jsx)(`span`,{className:`truncate leading-4`,children:n})]}):null,r?(0,Y.jsxs)(`span`,{"data-testid":`conversation-card-selected-branch`,title:r,className:wa,children:[(0,Y.jsx)(`span`,{className:Sa,"aria-hidden":!0,children:(0,Y.jsx)(Ir,{className:Ca})}),(0,Y.jsx)(`span`,{className:`truncate leading-4`,children:r})]}):null]})}function Da({workspaceWorkingDir:e}){let{t}=w(`openhands`),n=e?vr(e).trim():``;return n?(0,Y.jsxs)(`span`,{"data-testid":`conversation-card-workspace-folder`,className:xa,title:e??void 0,children:[(0,Y.jsx)(`span`,{className:Sa,"aria-hidden":!0,children:(0,Y.jsx)(lt,{className:Ca})}),(0,Y.jsx)(`span`,{className:`truncate leading-4`,children:n})]}):(0,Y.jsxs)(`span`,{"data-testid":`conversation-card-no-repository`,className:xa,children:[(0,Y.jsx)(`span`,{className:Sa,"aria-hidden":!0,children:(0,Y.jsx)(yr,{className:Ca})}),(0,Y.jsx)(`span`,{className:`truncate leading-4`,children:t(R.COMMON$NO_REPOSITORY)})]})}function Oa(e){switch(e.trim().toLowerCase()){case`git_provider`:return`git`;case`repo_name`:case`repo`:case`repository`:return`repo`;case`selected_branch`:case`branch`:return`branch`;case`archiveworkspacepath`:case`workspace`:case`working_dir`:return`workspace`;case`appmode`:case`app_mode`:case`mode`:return`app_mode`;case`worktools`:case`work_tools`:case`tools`:return`work_tools`;case`workwsid`:case`work_wsid`:case`wsid`:case`workspace_id`:return`work_wsid`;default:return`other`}}function ka(e){let t=e.trim();if(!t)return t;let n=t.replace(/[_-]+/g,` `).replace(/\s+/g,` `);return n.charAt(0).toUpperCase()+n.slice(1)}function Aa(e,t){switch(Oa(e)){case`git`:return t(R.CONVERSATION_PANEL$PREVIEW_GIT);case`repo`:return t(R.CONVERSATION_PANEL$PREVIEW_REPO);case`branch`:return t(R.CONVERSATION_PANEL$PREVIEW_BRANCH);case`workspace`:return t(R.CONVERSATION_PANEL$PREVIEW_WORKSPACE);case`app_mode`:return t(R.CONVERSATION_PANEL$PREVIEW_APP_MODE);case`work_tools`:return t(R.CONVERSATION_PANEL$PREVIEW_WORK_TOOLS);case`work_wsid`:return t(R.CONVERSATION_PANEL$PREVIEW_WORK_WSID);default:return ka(e)}}function ja(e,t,n){let r=Aa(e,n);return t?`${r}: ${t}`:r}function Ma(e,t=14){let n=Array.from(e);return n.length<=t?e:t<=1?`…`:`${n.slice(0,t-1).join(``)}…`}function Na(e,t,n={}){let r=n.gapPx??4,i=n.overflowWidthPx??36;if(e.length===0)return 0;if(t<=0)return e.length;let a=0;for(let n=0;n<e.length;n+=1){let o=e[n],s=n>0?r:0,c=e.length-n-1>0?i+r:0;if(a+s+o+c>t)return n;a+=s+o}return e.length}var Pa=new Set([`origin`,`source`,`git_provider`]),Fa=new Set([`appmode`,`app_mode`,`mode`]),Ia={origin:H,source:xe,git_provider:Wr,owner:ce,user:ce,author:ce,assignee:ce,env:Ne,environment:Ne,repo:ze,repository:ze,repo_name:ze,branch:$e,selected_branch:$e,archiveworkspacepath:lt,workspace:lt,working_dir:lt,team:Oe,org:we,organization:we,channel:Me,email:Ee,automation:Ft,webhook:Ae,agent:Ie,project:_e,ticket:Se,issue:Se,pr:mt,pull_request:mt,priority:Pe,status:he,id:xt,integration:Dt,appmode:be,app_mode:be,mode:be,worktools:ht,work_tools:ht,tools:ht,workwsid:V,work_wsid:V,wsid:V,workspace_id:V},La={slack:qr,discord:ye,github:Wr,gitlab:Gr,bitbucket:Kr,bitbucket_data_center:Kr,azure_devops:$e,email:Ee,mail:Ee,api:Dt,webhook:Ae,automation:Ft,review:mt,linear:_e,web:se,ui:se,canvas:se},Ra={work:oe,personal:gt,home:gt,private:gt};function za(e,t){let n=e.trim().toLowerCase(),r=t.trim().toLowerCase();return Pa.has(n)?La[r]??Ia[n]??U:Fa.has(n)?Ra[r]??Ia[n]??be:Ia[n]??U}function Ba({icon:e,keyName:t,testId:n}){return(0,Y.jsx)(`span`,{className:Sa,"aria-hidden":!0,children:(0,Y.jsx)(e,{"data-testid":n,"data-tag-key":t,"aria-hidden":!0,className:Ca})})}function Va({icon:e,keyName:t,value:n,iconTestId:r}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ba,{icon:e,keyName:t,testId:r}),(0,Y.jsx)(`span`,{className:`truncate leading-4`,children:Ma(n||t)})]})}function Ha({tags:e}){let{t}=w(`openhands`),n=J.useRef(null),r=J.useRef(null),i=J.useRef(null),a=J.useRef(null),[o,s]=J.useState(e.length),[c,l]=J.useState(!1),[u,d]=J.useState(null),f=J.useCallback(()=>{let e=n.current,t=r.current;!e||!t||s(Na(Array.from(t.children).map(e=>e.offsetWidth),e.clientWidth))},[]),p=J.useCallback(()=>{let e=i.current;if(!e)return;let t=e.getBoundingClientRect(),n=t.left;n+256>window.innerWidth-8&&(n=Math.max(8,window.innerWidth-8-256)),d({top:t.bottom+4,left:n})},[]),m=e.map(([e,t])=>`${e}=${t}`).join(``),h=J.useRef(null);if(J.useLayoutEffect(()=>{h.current!==m&&(h.current=m,l(!1),f())},[m,f]),J.useEffect(()=>{let e=n.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>f());return t.observe(e),()=>t.disconnect()},[f]),J.useLayoutEffect(()=>{if(!c){d(null);return}return p(),window.addEventListener(`resize`,p),window.addEventListener(`scroll`,p,!0),()=>{window.removeEventListener(`resize`,p),window.removeEventListener(`scroll`,p,!0)}},[c,p]),J.useEffect(()=>{if(!c)return;let e=e=>{let t=e.target;i.current?.contains(t)||a.current?.contains(t)||l(!1)},t=e=>{e.key===`Escape`&&l(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[c]),e.length===0)return null;let g=Math.max(0,e.length-o),_=e.slice(0,o),v=e.slice(o),y=e=>{e.stopPropagation()};return(0,Y.jsxs)(`div`,{"data-testid":`conversation-card-tag-chips`,className:`relative min-w-0 w-full`,children:[(0,Y.jsx)(`div`,{ref:r,"aria-hidden":!0,className:`pointer-events-none fixed top-0 -left-[10000px] z-[-1] flex flex-nowrap items-center gap-1 opacity-0`,children:e.map(([e,t])=>(0,Y.jsx)(`span`,{className:xa,children:(0,Y.jsx)(Va,{icon:za(e,t),keyName:e,value:t})},e))}),(0,Y.jsxs)(`div`,{ref:n,"data-testid":`conversation-card-tag-row`,className:`flex w-full min-w-0 max-w-full flex-nowrap items-center gap-1 overflow-hidden`,children:[_.map(([e,n])=>(0,Y.jsx)(`span`,{"data-testid":`conversation-card-tag-chip`,title:ja(e,n,t),className:xa,children:(0,Y.jsx)(Va,{icon:za(e,n),keyName:e,value:n,iconTestId:`conversation-card-tag-chip-icon`})},e)),g>0?(0,Y.jsxs)(`button`,{ref:i,type:`button`,"data-testid":`conversation-card-tag-overflow`,"aria-expanded":c,"aria-haspopup":`dialog`,"aria-label":t(R.CONVERSATION$TAGS_OVERFLOW_ARIA,{count:g}),onMouseDown:y,onClick:e=>{e.preventDefault(),e.stopPropagation(),l(e=>!e)},className:z(xa,`shrink-0 self-center hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--foreground)]`),children:[(0,Y.jsx)(`span`,{className:`inline-flex h-4 w-0 shrink-0`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`leading-4`,children:`+${g}`})]}):null]}),c&&u&&typeof document<`u`&&(0,va.createPortal)((0,Y.jsx)(`div`,{ref:a,role:`dialog`,"data-testid":`conversation-card-tag-overflow-popover`,className:z(`z-[9999] min-w-[10rem] max-w-[16rem]`,`rounded-md border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface)] p-2 shadow-lg`),style:{position:`fixed`,top:u.top,left:u.left},onMouseDown:y,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,Y.jsx)(`dl`,{className:`m-0 flex flex-col gap-1`,children:v.map(([e,n])=>(0,Y.jsxs)(`div`,{"data-testid":`conversation-card-tag-overflow-row`,className:`grid grid-cols-[minmax(0,auto)_minmax(0,1fr)] gap-x-2 text-[10px] leading-4`,children:[(0,Y.jsxs)(`dt`,{className:`m-0 inline-flex min-w-0 items-center gap-1 whitespace-normal break-words text-[var(--oh-muted)]`,children:[(0,Y.jsx)(Ba,{icon:za(e,n)}),(0,Y.jsx)(`span`,{className:`min-w-0 whitespace-normal break-words leading-4`,children:Aa(e,t)})]}),(0,Y.jsx)(`dd`,{className:`m-0 whitespace-normal break-words text-left leading-4 text-[var(--foreground)]`,title:n,children:n})]},e))})}),document.body)]})}function Ua({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,tags:d=null,showTags:f=!1,isArchived:p=!1}){let{t:m}=w(`openhands`),h=Lt(),g=ie(r),_=null;if(c)if(l===`acp`){let e=fr(u)??m(R.CONVERSATION$ACP_AGENT_GENERIC),t=mr(u,s),n=t??e;_={kind:pr(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(_={kind:`openhands`,text:Hr(s,h)??s,tooltip:s});let v=r===void 0?void 0:`pl-[26px]`,y=f?cr(d):[];return(0,Y.jsxs)(`div`,{className:z(`flex flex-col gap-0.5 mt-0.5 w-full min-w-0`,g&&`opacity-60`),children:[(0,Y.jsxs)(`div`,{className:z(`flex flex-row items-center gap-2 w-full min-w-0`,a&&v),children:[a&&(e?.selected_repository?(0,Y.jsx)(Ea,{selectedRepository:e}):(0,Y.jsx)(Da,{workspaceWorkingDir:i})),(0,Y.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 ml-auto`,children:o&&(n??t)&&(0,Y.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] text-right`,children:(0,Y.jsx)(`time`,{children:`${Fr(t??n)} ${m(R.CONVERSATION$AGO)}`})})})]}),_?(0,Y.jsx)(`div`,{className:v,children:(0,Y.jsxs)(`span`,{"data-testid":`conversation-card-agent-chip`,className:xa,title:_.tooltip,children:[(0,Y.jsx)(`span`,{className:`inline-flex h-4 shrink-0 items-center justify-center [&_svg]:block`,"aria-hidden":!0,children:(0,Y.jsx)(Ur,{kind:_.kind,size:12})}),(0,Y.jsx)(`span`,{className:`truncate leading-4`,children:_.text})]})}):null,p?(0,Y.jsx)(`div`,{className:v,children:(0,Y.jsx)(`span`,{"data-testid":`conversation-card-archived-chip`,className:xa,children:m(R.COMMON$ARCHIVED)})}):null,y.length>0?(0,Y.jsx)(`div`,{className:v,children:(0,Y.jsx)(Ha,{tags:y})}):null]})}function Wa(){let{t:e}=w(`openhands`);return(0,Y.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,Y.jsx)(Yn,{className:`text-white w-3 h-3`}),(0,Y.jsx)(`span`,{children:e(R.COMMON$ERROR)})]})}function Ga({onClick:e,onDelete:t,onArchive:n,onUnarchive:r,onStop:i,onChangeTitle:a,onEditTags:o,showOptions:s,title:c,selectedRepository:l,lastUpdatedAt:u,createdAt:d,conversationId:f,executionStatus:p,sandboxStatus:m,contextMenuOpen:h=!1,onContextMenuToggle:g,isActive:_=!1,workspaceWorkingDir:v,showRepositoryMetadata:y=!0,llmModel:b=null,showLlmProfiles:x=!1,agentKind:S=null,acpServer:C=null,tags:T=null,showTags:E=!1,isArchived:D=!1,isPinned:O=!1,onTogglePin:k,alwaysShowPinIcon:A=!1}){let{t:j}=w(`openhands`),{trackDownloadVsCodeButtonClicked:M}=Jt(),[N,P]=J.useState(`view`),{mutateAsync:ee}=Hn(),te=cr(T),ne=te.length>0,F=E&&ne,I=e=>{e!==``&&e!==c&&a?.(e),P(`view`)},re=e=>{e.preventDefault(),e.stopPropagation(),t?.(),g?.(!1)},L=e=>{e.preventDefault(),e.stopPropagation(),n?.(),g?.(!1)},ie=e=>{e.preventDefault(),e.stopPropagation(),r?.(),g?.(!1)},B=e=>{e.preventDefault(),e.stopPropagation(),i?.(),g?.(!1)},ae=e=>{e.preventDefault(),e.stopPropagation(),P(`edit`),g?.(!1)},oe=e=>{e.preventDefault(),e.stopPropagation(),o?.(),g?.(!1)},se=async e=>{if(e.preventDefault(),e.stopPropagation(),M(),f)try{let e=await br.getVSCodeUrl(f);if(e.vscode_url){let t=Cr(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}g?.(!1)},ce=async e=>{e.preventDefault(),e.stopPropagation(),f&&await ee(f),g?.(!1)},le=e=>{e.preventDefault(),e.stopPropagation(),k?.()},ue=()=>(0,Y.jsx)(`button`,{type:`button`,"data-testid":f?`conversation-pin-toggle-${f}`:`conversation-pin-toggle`,"aria-pressed":O,"aria-label":j(O?R.CONVERSATION_PANEL$UNPIN_CONVERSATION:R.CONVERSATION_PANEL$PIN_CONVERSATION),onClick:le,className:z(`flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1`,`text-[var(--oh-muted)] hover:bg-white/10 hover:text-white`),children:(0,Y.jsx)(Et,{className:z(`h-3.5 w-3.5`,O&&`fill-current`),"aria-hidden":!0})}),de=!!(t||n||r||a||o||s),fe=de||!!k,pe=A&&O&&!!k,me=y||D||x&&(S===`acp`||!!b)||F&&te.length>0;return(0,Y.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":h.toString(),"data-active":_?`true`:`false`,onClick:e,className:z(`group relative h-auto w-full cursor-pointer rounded-md py-1 pl-2 pr-1 transition-colors`,!h&&`hover:bg-[var(--oh-surface)]`,(_||h)&&`bg-[var(--oh-surface)]`),children:[(0,Y.jsxs)(`div`,{className:`flex items-center w-full min-w-0`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[(0,Y.jsx)(_a,{title:c,titleMode:N,onTitleSave:I,executionStatus:p,sandboxStatus:m}),m===`ERROR`&&(0,Y.jsx)(Wa,{})]}),(0,Y.jsxs)(`div`,{"data-testid":`conversation-card-trailing-slot`,className:z(`relative ml-auto pl-2 flex items-center justify-end shrink-0`,pe?`min-w-[3.75rem]`:fe&&wn(h)),children:[!pe&&(d??u)&&(0,Y.jsx)(`p`,{className:z(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,fe&&Cn(h)),children:(0,Y.jsx)(`time`,{children:Fr(u??d)})}),fe?(0,Y.jsxs)(`div`,{"data-testid":`conversation-card-hover-actions`,className:z(`absolute right-0 top-1/2 flex -translate-y-1/2 items-center gap-0.5 transition-opacity`,pe?`pointer-events-auto visible opacity-100`:Tn(h)),children:[k?ue():null,pe&&(d??u)&&de?(0,Y.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,Y.jsx)(`div`,{className:Tn(h),children:(0,Y.jsx)(ba,{contextMenuOpen:h,onContextMenuToggle:g||(()=>{}),onDelete:t&&re,onArchive:n&&L,onUnarchive:r&&ie,onStop:i&&B,onEdit:a&&ae,onEditTags:o&&oe,onDownloadViaVSCode:se,onDownloadConversation:ce,executionStatus:p,conversationId:f,showOptions:s})}),(0,Y.jsx)(`p`,{className:z(`pointer-events-none absolute inset-0 items-center justify-end`,`text-xs text-[var(--oh-muted)] whitespace-nowrap -translate-x-1.5`,Dn(h)),children:(0,Y.jsx)(`time`,{children:Fr(u??d)})})]}):null,!pe&&de?(0,Y.jsx)(ba,{contextMenuOpen:h,onContextMenuToggle:g||(()=>{}),onDelete:t&&re,onArchive:n&&L,onUnarchive:r&&ie,onStop:i&&B,onEdit:a&&ae,onEditTags:o&&oe,onDownloadViaVSCode:se,onDownloadConversation:ce,executionStatus:p,conversationId:f,showOptions:s}):null]}):null]})]}),me&&(0,Y.jsx)(Ua,{selectedRepository:l,lastUpdatedAt:u,createdAt:d,executionStatus:p,workspaceWorkingDir:v,showRepositoryMetadata:y,showTimestamp:!1,llmModel:b,showAgentChip:x,agentKind:S,acpServer:C,tags:T,showTags:F,isArchived:D})]})}var Ka={bitbucket:Kr,bitbucket_data_center:Kr,github:Wr,gitlab:Gr};function qa({label:e,children:t}){return(0,Y.jsxs)(`div`,{className:`flex items-start gap-2 text-xs leading-4`,children:[(0,Y.jsx)(`span`,{className:`w-20 shrink-0 whitespace-normal break-words text-[var(--oh-muted)]`,children:e}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 overflow-visible whitespace-normal break-words text-[var(--oh-foreground)]`,children:t})]})}function Ja({icon:e,children:t,testId:n,tagKey:r}){return(0,Y.jsxs)(`span`,{"data-testid":n,"data-tag-key":r,className:`inline-flex min-w-0 max-w-full items-start gap-1.5`,children:[e?(0,Y.jsx)(`span`,{className:`inline-flex h-4 min-w-3 shrink-0 items-center justify-center [&_svg]:block`,children:e}):null,(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-normal break-all`,children:t})]})}function Ya({title:e,executionStatus:t,sandboxStatus:n,selectedRepository:r,workspaceWorkingDir:i,llmModel:a,agentKind:o=null,acpServer:s=null,createdAt:c,tags:l=null}){let{t:u}=w(`openhands`),d=r?.selected_repository??null,f=r?.selected_branch??null,p=r?.git_provider??null,m=p?Ka[p]:null,h=c?new Date(c).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null,g=cr(l);return(0,Y.jsxs)(`div`,{"data-testid":`conversation-card-preview`,className:`flex w-[280px] max-w-[min(280px,90vw)] flex-col gap-3 overflow-visible p-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start gap-2`,children:[t===void 0?null:(0,Y.jsx)(`span`,{className:`inline-flex h-5 w-2.5 shrink-0 items-center justify-center`,children:(0,Y.jsx)(ga,{executionStatus:t,sandboxStatus:n,showTooltip:!1})}),(0,Y.jsx)(`span`,{className:`break-words text-sm font-medium leading-5 text-white`,children:e})]}),(0,Y.jsxs)(`dl`,{className:`flex flex-col gap-1.5`,children:[d?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(qa,{label:u(R.CONVERSATION_PANEL$PREVIEW_REPO),children:(0,Y.jsx)(Ja,{icon:m?(0,Y.jsx)(m,{size:12}):p===`azure_devops`?(0,Y.jsx)(Zn,{className:`h-3 w-3`}):void 0,children:d})}),f?(0,Y.jsx)(qa,{label:u(R.CONVERSATION_PANEL$PREVIEW_BRANCH),children:(0,Y.jsx)(Ja,{icon:(0,Y.jsx)(Ir,{size:11}),children:f})}):null]}):i?(0,Y.jsx)(qa,{label:u(R.CONVERSATION_PANEL$PREVIEW_DIRECTORY),children:(0,Y.jsx)(Ja,{icon:(0,Y.jsx)(lt,{size:12}),children:i})}):null,a?(0,Y.jsx)(qa,{label:u(R.CONVERSATION_PANEL$PREVIEW_MODEL),children:(0,Y.jsx)(Ja,{testId:`conversation-card-preview-model`,icon:(0,Y.jsx)(Ur,{kind:o===`acp`?pr(s):`openhands`,size:12}),children:a})}):null,g.map(([e,t])=>{let n=za(e,t);return(0,Y.jsx)(qa,{label:Aa(e,u),children:(0,Y.jsx)(Ja,{testId:`conversation-card-preview-tag-row`,tagKey:e,icon:(0,Y.jsx)(n,{"aria-hidden":!0,className:`h-3 w-3`}),children:t||`—`})},e)}),h?(0,Y.jsx)(qa,{label:u(R.CONVERSATION$CREATED),children:h}):null]})]})}function Xa({taskStatus:e}){return(0,Y.jsx)(`div`,{className:z(`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 Za({taskStatus:e}){let{t}=w(`openhands`);return e===`WORKING`?null:(0,Y.jsx)(`span`,{className:z(`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(re(e))})}function Qa({title:e,taskStatus:t}){return(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden mr-2`,children:[(0,Y.jsx)(`div`,{className:`flex items-center`,children:(0,Y.jsx)(Xa,{taskStatus:t})}),(0,Y.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,Y.jsx)(Za,{taskStatus:t})]})}function $a({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=w(`openhands`);return(0,Y.jsxs)(`div`,{className:z(`flex flex-col gap-1 mt-1`),children:[(0,Y.jsxs)(`div`,{className:`flex flex-row justify-between items-center`,children:[e?(0,Y.jsx)(Ea,{selectedRepository:e}):(0,Y.jsx)(Da,{}),t&&(0,Y.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,Y.jsx)(`time`,{children:`${Fr(t)} ${r(R.CONVERSATION$AGO)}`})})]}),n&&(0,Y.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function eo({task:e,onClick:t}){let{t:n}=w(`openhands`),r=e.request.title||e.detail||n(R.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,Y.jsxs)(`div`,{"data-testid":`start-task-card`,onClick:t,className:z(`relative h-auto w-full p-3.5 border-b border-[var(--oh-border)] cursor-pointer`,`hover:bg-tertiary`),children:[(0,Y.jsx)(`div`,{className:`flex items-center justify-between w-full`,children:(0,Y.jsx)(Qa,{title:r,taskStatus:e.status})}),(0,Y.jsx)($a,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function to({compact:e=!1}){return e?(0,Y.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,Y.jsx)(`div`,{className:`h-1.5 w-7 shrink-0 skeleton`},`conversation-skeleton-compact-${e}`))}):(0,Y.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,Y.jsx)(`div`,{className:`h-6 min-h-6 w-full skeleton`},`conversation-skeleton-row-${e}`))})}function no({conversationId:e,title:t,selectedRepository:n,executionStatus:r,sandboxStatus:a,lastUpdatedAt:o,createdAt:s,workspaceWorkingDir:c,isActive:l=!1,onClose:u,showRepositoryMetadata:d=!0,llmModel:f=null,showLlmProfiles:p=!1,agentKind:m=null,acpServer:h=null,tags:g=null,showTags:_=!1}){let{t:v}=w(`openhands`),y=Xn();return(0,Y.jsx)(i,{content:(0,Y.jsxs)(`div`,{className:`w-[260px] p-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,Y.jsx)(ga,{executionStatus:r,sandboxStatus:a,showTooltip:!1}),(0,Y.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||v(R.CONVERSATION$UNTITLED)})]}),(0,Y.jsx)(Ua,{selectedRepository:n,lastUpdatedAt:o,createdAt:s,executionStatus:r,workspaceWorkingDir:c,showRepositoryMetadata:d,llmModel:f,showAgentChip:p,agentKind:m,acpServer:h,tags:g,showTags:_})]}),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,Y.jsx)(fn,{to:y(`/conversations/${e}`),onClick:u,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>z(`flex items-center justify-center w-10 h-9 mx-auto rounded-md`,`transition-colors cursor-pointer`,e||l?`bg-tertiary`:`hover:bg-[var(--oh-surface-raised)]`),children:(0,Y.jsx)(ga,{executionStatus:r,sandboxStatus:a,showTooltip:!1})})})}var ro=[`1h`,`1d`,`7d`,`30d`],io={"1h":3600*1e3,"1d":1440*60*1e3,"7d":10080*60*1e3,"30d":720*60*60*1e3};function ao(e){return typeof e==`string`&&ro.includes(e)}function oo(e,t,n=Date.now()){let r=n-t,i=[],a=[];for(let t of e){let e=t.updated_at?Date.parse(t.updated_at):NaN;Number.isFinite(e)&&e<r?a.push(t):i.push(t)}return{recent:i,older:a}}function so(e,t,n){if(!t)return[...e];let r=e.filter(e=>t.has(e.id));if(n!=null&&!r.some(e=>e.id===n)){let t=e.find(e=>e.id===n);t&&r.push(t)}return r}function co(e,t){let n=t.limit??5,r=so(e,t.discoveryConversationIds,t.activeConversationId),i;if(r.length<=n)i=r;else{let e=t.activeConversationId==null?-1:r.findIndex(e=>e.id===t.activeConversationId);i=e>=n?[...r.slice(0,n-1),r[e]]:r.slice(0,n)}let a=i.length<e.length;return t.expanded?{visibleConversations:[...e],isPreviewTruncated:a,isShowingAll:!0}:{visibleConversations:i,isPreviewTruncated:a,isShowingAll:!a}}function lo(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>n.get(e)).filter(e=>e!=null)}function uo(e,t){if(t.length===0)return[...e];let n=new Set(t);return e.filter(e=>!n.has(e.id))}var fo=`__unnamed__`;function po(e){if(e.trigger===`automation`)return!0;let t=e.tags;return t?ur.some(e=>!!t[e]):!1}function mo(e){return e.tags?.automationname?.trim()||`__unnamed__`}function ho(e){let t=new Set,n=!1;for(let r of e){if(!po(r))continue;let e=mo(r);e===`__unnamed__`?n=!0:t.add(e)}let r=[...t].sort((e,t)=>e.localeCompare(t));return n&&r.push(fo),r}function go(e,t,n,r){if(t===`all`)return[...e];if(t===`hide-automations`)return e.filter(e=>!po(e));let i=new Set(r),a=n.filter(e=>i.has(e)),o=a.length>0?new Set(a):null;return e.filter(e=>po(e)?o===null||o.has(mo(e)):!1)}function _o(e){let t=new Set;for(let n of e)for(let[e,r]of cr(n.tags))t.add(`${e}=${r}`);return[...t].sort((e,t)=>e.localeCompare(t))}function vo(e){return e.endsWith(`=`)?e.slice(0,-1):e}function yo(e,t,n){let r=new Set(n),i=t.filter(e=>r.has(e));if(i.length===0)return[...e];let a=new Set(i);return e.filter(e=>cr(e.tags).some(([e,t])=>a.has(`${e}=${t}`)))}function bo(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 xo(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function So(e,t){let n=t===`created`?`created_at`:`updated_at`;return[...e].sort((e,t)=>xo(t[n])-xo(e[n]))}function Co(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 wo(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 To(e,t){return t===`local`?Co(e):wo(e)}function Eo(e,t,n,r){let i=e.map(e=>({conversationId:e.id,groupId:To(e,n).id,page:t.get(e.id)??0})),a=new Map;for(let{groupId:e,page:t}of i){let n=a.get(e);(n===void 0||t<n)&&a.set(e,t)}let o=new Set;for(let{conversationId:e,groupId:t,page:n}of i)n===a.get(t)&&o.add(e);let s=r?.forceIncludeConversationId;return s!=null&&e.some(e=>e.id===s)&&o.add(s),o}function Do(e,t,n,r,i){let a=new Map;if(t===`local`&&i)for(let e of i){let t=e.path.trim().replace(/\/+$/,``);t&&a.set(`ws:${t}`,{label:e.name,conversations:[]})}for(let n of e){let{id:e,label:i}=To(n,t),o=e===`__none_workspace`?r.emptyWorkspace:e===`__none_repo`?r.emptyRepository:i,s=a.get(e);s?s.conversations.push(n):a.set(e,{label:o,conversations:[n]})}let o=[...a.entries()].map(([e,r])=>{let i=So(r.conversations,n);return{id:e,label:r.label,conversations:i,launch:bo(e,t,i)}}),s=e=>e.conversations.reduce((e,t)=>Math.max(e,xo(n===`created`?t.created_at:t.updated_at)),0);return o.sort((e,t)=>s(t)-s(e)),o}function Oo(e,t){if(t.length===0)return[...e];let n=new Map(e.map(e=>[e.id,e])),r=[],i=new Set;for(let e of t){let t=n.get(e);t&&(r.push(t),i.add(e))}for(let t of e)i.has(t.id)||r.push(t);return r}function ko(e,t,n,r,i=`after`){if(n===r)return[...e];let a=Oo(t.map(e=>({id:e})),e).map(e=>e.id),o=a.indexOf(n),s=a.indexOf(r);if(o<0||s<0)return[...e];let c=[...a];c.splice(o,1);let l=c.indexOf(r),u=i===`before`?l:l+1;return c.splice(u,0,n),c}var Ao={organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`,showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!1,showTagsMetadata:!0,showHoverMetadata:!0},jo={...Ao,olderConversationCutoff:`7d`,showArchivedConversations:!1,automationFilterMode:`all`,selectedAutomationNames:[],selectedTagFacets:[],groupFolderOrder:[]},X=Rt()(rr(e=>({...jo,setShowOlderConversations:t=>e(()=>({showOlderConversations:t})),toggleShowOlderConversations:()=>e(e=>({showOlderConversations:!e.showOlderConversations})),setOlderConversationCutoff:t=>e(()=>({olderConversationCutoff:ao(t)?t:`7d`})),setShowArchivedConversations:t=>e(()=>({showArchivedConversations:t})),toggleShowArchivedConversations:()=>e(e=>({showArchivedConversations:!e.showArchivedConversations})),setShowRepoBranchMetadata:t=>e(()=>({showRepoBranchMetadata:t})),toggleShowRepoBranchMetadata:()=>e(e=>({showRepoBranchMetadata:!e.showRepoBranchMetadata})),setShowLlmProfiles:t=>e(()=>({showLlmProfiles:t})),toggleShowLlmProfiles:()=>e(e=>({showLlmProfiles:!e.showLlmProfiles})),setShowTagsMetadata:t=>e(()=>({showTagsMetadata:t})),toggleShowTagsMetadata:()=>e(e=>({showTagsMetadata:!e.showTagsMetadata})),setShowHoverMetadata:t=>e(()=>({showHoverMetadata:t})),toggleShowHoverMetadata:()=>e(e=>({showHoverMetadata:!e.showHoverMetadata})),setOrganizeMode:t=>e(()=>({organizeMode:t})),setConversationSort:t=>e(()=>({conversationSort:t})),setThreadScope:t=>e(()=>({threadScope:t})),setAutomationFilterMode:t=>e(e=>({automationFilterMode:t,selectedAutomationNames:t===`only-automations`?e.selectedAutomationNames:[]})),toggleAutomationName:t=>e(e=>({selectedAutomationNames:e.selectedAutomationNames.includes(t)?e.selectedAutomationNames.filter(e=>e!==t):[...e.selectedAutomationNames,t]})),clearFilterSelections:()=>e(()=>({selectedTagFacets:[],selectedAutomationNames:[]})),toggleTagFacet:t=>e(e=>({selectedTagFacets:e.selectedTagFacets.includes(t)?e.selectedTagFacets.filter(e=>e!==t):[...e.selectedTagFacets,t]})),setGroupFolderOrder:t=>e(()=>({groupFolderOrder:[...t]})),applyLayoutSettings:t=>e(()=>({...t}))}),{name:`conversation-panel-preferences`,storage:ir(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,olderConversationCutoff:ao(e.olderConversationCutoff)?e.olderConversationCutoff:`7d`,showArchivedConversations:e.showArchivedConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,showTagsMetadata:e.showTagsMetadata,showHoverMetadata:e.showHoverMetadata,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope,automationFilterMode:e.automationFilterMode,selectedAutomationNames:e.selectedAutomationNames,selectedTagFacets:e.selectedTagFacets,groupFolderOrder:e.groupFolderOrder})})),Mo=`px-2 pb-1 pt-1`,No=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function Po({children:e,suffix:t}){return t==null?(0,Y.jsx)(`div`,{role:`presentation`,className:z(Mo,No),children:e}):(0,Y.jsxs)(`div`,{role:`presentation`,className:z(`flex items-baseline justify-between gap-2`,Mo),children:[(0,Y.jsx)(`span`,{className:z(`min-w-0 truncate text-left`,No),children:e}),t]})}function Z({icon:e,label:t,sublabel:n,selected:r,onClick:i,testId:a,disabled:o,destructive:s,variant:c=`radio`}){return(0,Y.jsxs)(`button`,{type:`button`,role:r===void 0?`menuitem`:c===`toggle`?`menuitemcheckbox`:`menuitemradio`,"aria-checked":r===void 0?void 0:!!r,"data-testid":a,disabled:o,onClick:i,className:z(`group`,Ln,`disabled:opacity-50`,s?`text-danger`:`text-[var(--oh-foreground)]`),children:[(0,Y.jsx)(e,{className:z(`h-3.5 w-3.5`,Fn,s&&`text-danger group-hover:text-danger group-focus-visible:text-danger`),"aria-hidden":!0}),(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`span`,{className:`block truncate`,children:t}),n?(0,Y.jsx)(`span`,{className:`block truncate text-[10px] text-[var(--oh-muted)]/70`,children:n}):null]}),r===void 0?null:c===`toggle`?(0,Y.jsx)(Jr,{enabled:!!r,size:`sm`,className:`ml-auto`}):r?(0,Y.jsx)(Le,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}var Fo=e=>(0,Y.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,Y.jsx)(`mask`,{id:`mask0_18339_1445`,style:{maskType:`luminance`},maskUnits:`userSpaceOnUse`,x:1,y:1,width:18,height:18,children:(0,Y.jsx)(`path`,{d:`M19 1H1V19H19V1Z`,fill:`white`})}),(0,Y.jsxs)(`g`,{mask:`url(#mask0_18339_1445)`,children:[(0,Y.jsx)(`path`,{d:`M10 18.1818V16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M10 1.81836V3.45472`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M1.81824 10H3.4546`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M18.1818 10H16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M5.93359 17.1019L6.74359 15.6782`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M14.0663 2.89844L13.2563 4.32208`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M2.89819 5.93359L4.32183 6.74359`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M17.1019 14.0663L15.6782 13.2563`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M5.92542 2.90625L6.7436 4.3217`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M14.0909 17.0854L13.2727 15.6699`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M17.0855 5.90918L15.67 6.72736`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M2.91455 14.0911L4.33001 13.2729`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.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,Y.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`})]})]}),Io={"1h":R.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR,"1d":R.CONVERSATION_PANEL$OLDER_OVER_ONE_DAY,"7d":R.CONVERSATION_PANEL$OLDER_OVER_ONE_WEEK,"30d":R.CONVERSATION_PANEL$OLDER_OVER_THIRTY_DAYS};function Lo(){let{t:e}=w(`openhands`),t=X(e=>e.showOlderConversations),n=X(e=>e.olderConversationCutoff),r=X(e=>e.toggleShowOlderConversations),i=X(e=>e.setOlderConversationCutoff),a=!t,o=ao(n)?n:`7d`;return(0,Y.jsxs)(`div`,{role:`menuitemcheckbox`,"aria-checked":a,"data-testid":`toggle-older-conversations`,tabIndex:0,onClick:r,onKeyDown:e=>{(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),r())},className:z(`group`,Ln,`text-[var(--oh-foreground)]`),children:[(0,Y.jsx)(pe,{className:z(`h-3.5 w-3.5`,Fn),"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`min-w-0 shrink truncate`,children:e(R.CONVERSATION_PANEL$HIDE_CONVERSATIONS)}),(0,Y.jsx)(`div`,{className:`shrink-0`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:(0,Y.jsx)(Xr,{testId:`older-conversation-cutoff`,value:o,onChange:i,options:ro,labelKeyByValue:Io,ariaLabel:e(R.CONVERSATION_PANEL$OLDER_CUTOFF_LABEL),emphasizeNonDefault:!1,triggerClassName:z(`h-7 gap-1 rounded py-0 pl-2 pr-1.5 font-normal`,`text-[var(--oh-foreground)] [&_svg]:h-3 [&_svg]:w-3 [&_svg]:text-[var(--oh-muted)]`)})}),(0,Y.jsx)(Jr,{enabled:a,size:`sm`,className:`ml-auto`})]})}function Ro({open:e,onClose:t,backendKind:n,automationNameFacets:r}){let{t:i}=w(`openhands`),a=X(),o=J.useRef(null),[s,c]=J.useState({top:!1,bottom:!1}),l=J.useCallback(()=>{let e=o.current;e&&c(Yr(e))},[]);if(J.useLayoutEffect(()=>{if(!e)return;l();let t=o.current;if(!t)return;let n=new ResizeObserver(l);return n.observe(t),t.firstElementChild&&n.observe(t.firstElementChild),()=>n.disconnect()},[e,l,a.automationFilterMode]),!e)return null;let u=i(n===`local`?R.CONVERSATION_PANEL$BY_WORKSPACE:R.CONVERSATION_PANEL$BY_REPOSITORY);return(0,Y.jsx)($t,{onClose:t,children:(0,Y.jsxs)(en,{width:`md`,className:z(`relative items-start overflow-hidden border border-[var(--oh-border)]`,tn),testID:`advanced-conversation-options-modal`,children:[(0,Y.jsx)(or,{onClose:t,testId:`advanced-options-modal-close`}),(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pr-8`,children:[(0,Y.jsx)(an,{title:i(R.CONVERSATION_PANEL$ADVANCED_OPTIONS)}),(0,Y.jsx)(rn,{children:i(R.CONVERSATION_PANEL$ADVANCED_OPTIONS_DESCRIPTION)})]}),(0,Y.jsxs)(`div`,{className:`relative -mx-6 w-[calc(100%+3rem)] min-h-0`,children:[(0,Y.jsx)(`div`,{"aria-hidden":!0,"data-testid":`advanced-options-scroll-edge-top`,"data-visible":s.top?`true`:`false`,className:z(`pointer-events-none absolute inset-x-0 top-0 z-10 h-px bg-[var(--oh-border)]`,s.top?`opacity-100`:`opacity-0`)}),(0,Y.jsxs)(`div`,{ref:o,role:`menu`,"aria-orientation":`vertical`,"aria-label":i(R.CONVERSATION_PANEL$ADVANCED_OPTIONS),tabIndex:-1,"data-testid":`advanced-options-scroll`,className:`custom-scrollbar-always flex max-h-[60vh] w-full flex-col overflow-y-auto px-6`,onClick:e=>e.stopPropagation(),onScroll:l,children:[(0,Y.jsx)(Po,{children:i(R.CONVERSATION_PANEL$ORGANIZE)}),(0,Y.jsx)(Z,{icon:lt,label:u,selected:a.organizeMode===`grouped`,testId:`organize-grouped`,onClick:()=>a.setOrganizeMode(`grouped`)}),(0,Y.jsx)(Z,{icon:le,label:i(R.CONVERSATION_PANEL$CHRONOLOGICAL),selected:a.organizeMode===`chronological`,testId:`organize-chronological`,onClick:()=>a.setOrganizeMode(`chronological`)}),(0,Y.jsx)(G,{}),(0,Y.jsx)(Po,{children:i(R.CONVERSATION_PANEL$SORT_BY)}),(0,Y.jsx)(Z,{icon:fe,label:i(R.CONVERSATION_PANEL$SORT_CREATED),selected:a.conversationSort===`created`,testId:`sort-created`,onClick:()=>a.setConversationSort(`created`)}),(0,Y.jsx)(Z,{icon:me,label:i(R.CONVERSATION_PANEL$SORT_UPDATED),selected:a.conversationSort===`updated`,testId:`sort-updated`,onClick:()=>a.setConversationSort(`updated`)}),(0,Y.jsx)(G,{}),(0,Y.jsx)(Po,{children:i(R.CONVERSATION_PANEL$THREADS)}),(0,Y.jsx)(Z,{icon:De,label:i(R.CONVERSATION_PANEL$ALL_THREADS),selected:a.threadScope===`all`,testId:`scope-all`,onClick:()=>a.setThreadScope(`all`)}),(0,Y.jsx)(Z,{icon:ke,label:i(R.CONVERSATION_PANEL$RELEVANT_THREADS),selected:a.threadScope===`relevant`,testId:`scope-relevant`,onClick:()=>a.setThreadScope(`relevant`)}),(0,Y.jsx)(G,{}),(0,Y.jsx)(Po,{children:i(R.CONVERSATION_PANEL$SHOW)}),(0,Y.jsx)(Z,{icon:ue,label:i(R.CONVERSATION_PANEL$SHOW_ARCHIVED),selected:a.showArchivedConversations,variant:`toggle`,testId:`toggle-show-archived`,onClick:a.toggleShowArchivedConversations}),(0,Y.jsx)(Lo,{}),(0,Y.jsx)(G,{}),(0,Y.jsx)(Po,{children:i(R.CONVERSATION_PANEL$AUTOMATIONS)}),(0,Y.jsx)(Z,{icon:De,label:i(R.CONVERSATION_PANEL$AUTOMATIONS_ALL),selected:a.automationFilterMode===`all`,testId:`automation-filter-all`,onClick:()=>a.setAutomationFilterMode(`all`)}),(0,Y.jsx)(Z,{icon:pe,label:i(R.CONVERSATION_PANEL$AUTOMATIONS_HIDE),selected:a.automationFilterMode===`hide-automations`,testId:`automation-filter-hide`,onClick:()=>a.setAutomationFilterMode(`hide-automations`)}),(0,Y.jsx)(Z,{icon:Fo,label:i(R.CONVERSATION_PANEL$AUTOMATIONS_ONLY),selected:a.automationFilterMode===`only-automations`,testId:`automation-filter-only`,onClick:()=>a.setAutomationFilterMode(`only-automations`)}),a.automationFilterMode===`only-automations`?r.map(e=>(0,Y.jsx)(Z,{icon:U,label:e===`__unnamed__`?i(R.CONVERSATION_PANEL$AUTOMATION_UNNAMED):e,selected:a.selectedAutomationNames.includes(e),variant:`toggle`,testId:`automation-name-row-${e}`,onClick:()=>a.toggleAutomationName(e)},e)):null,(0,Y.jsx)(G,{}),(0,Y.jsx)(Po,{children:i(R.CONVERSATION_PANEL$METADATA)}),(0,Y.jsx)(Z,{icon:$e,label:i(R.CONVERSATION_PANEL$REPO_BRANCH),selected:a.showRepoBranchMetadata,variant:`toggle`,testId:`toggle-repo-branch-metadata`,onClick:a.toggleShowRepoBranchMetadata}),(0,Y.jsx)(Z,{icon:Ie,label:i(R.CONVERSATION_PANEL$LLM_MODEL),selected:a.showLlmProfiles,variant:`toggle`,testId:`toggle-llm-profiles`,onClick:a.toggleShowLlmProfiles}),(0,Y.jsx)(Z,{icon:U,label:i(R.CONVERSATION_PANEL$TAG_CHIPS),selected:a.showTagsMetadata,variant:`toggle`,testId:`toggle-tags-metadata`,onClick:a.toggleShowTagsMetadata}),(0,Y.jsx)(Z,{icon:Tt,label:i(R.CONVERSATION_PANEL$HOVER_METADATA),selected:a.showHoverMetadata,variant:`toggle`,testId:`toggle-hover-metadata`,onClick:a.toggleShowHoverMetadata})]}),(0,Y.jsx)(`div`,{"aria-hidden":!0,"data-testid":`advanced-options-scroll-edge-bottom`,"data-visible":s.bottom?`true`:`false`,className:z(`pointer-events-none absolute inset-x-0 bottom-0 z-10 h-px bg-[var(--oh-border)]`,s.bottom?`opacity-100`:`opacity-0`)})]}),(0,Y.jsx)(`div`,{className:`flex w-full justify-end`,onClick:e=>e.stopPropagation(),children:(0,Y.jsx)(cn,{type:`button`,variant:`primary`,onClick:t,testId:`advanced-options-close`,children:i(R.BUTTON$CLOSE)})})]})})}var zo=[{id:`by-workspace`,icon:lt,settings:{...Ao,organizeMode:`grouped`}},{id:`recent-activity`,icon:le,labelKey:R.CONVERSATION_PANEL$LAYOUT_RECENT_ACTIVITY,settings:{...Ao,showOlderConversations:!1}},{id:`focused`,icon:ke,labelKey:R.CONVERSATION_PANEL$LAYOUT_FOCUSED,settings:{...Ao,threadScope:`relevant`,showOlderConversations:!1}},{id:`minimal`,icon:je,labelKey:R.CONVERSATION_PANEL$LAYOUT_MINIMAL,settings:{...Ao,threadScope:`relevant`,showOlderConversations:!1,showRepoBranchMetadata:!1,showLlmProfiles:!1,showTagsMetadata:!1,showHoverMetadata:!1}}];function Bo(e){return zo.find(t=>Object.entries(t.settings).every(([t,n])=>e[t]===n))??null}function Vo({menuOpen:e,setMenuOpen:t,menuRef:n,backendKind:r,tagFacets:i,automationNameFacets:a,totalConversationsCount:o,onRequestDeleteAll:s}){let{t:c}=w(`openhands`),l=X(),[u,d]=J.useState(!1),[f,p]=J.useState(!1),m=c(r===`local`?R.CONVERSATION_PANEL$BY_WORKSPACE:R.CONVERSATION_PANEL$BY_REPOSITORY),h=Bo(l),g=J.useRef(null),_=J.useRef(null),v=J.useRef(e);return J.useEffect(()=>{e?(_.current?.querySelector(`[role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"]`))?.focus():v.current&&g.current?.focus(),v.current=e},[e]),(0,Y.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,Y.jsx)(`button`,{ref:g,type:`button`,"data-testid":`conversation-layouts-toggle`,"aria-label":c(R.CONVERSATION_PANEL$LAYOUTS_HEADING),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:z(`relative 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)]`,Rn),children:(0,Y.jsx)(St,{className:`shrink-0`,size:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,Y.jsxs)(`div`,{ref:_,role:`menu`,"aria-orientation":`vertical`,"aria-label":c(R.CONVERSATION_PANEL$LAYOUTS_HEADING),tabIndex:-1,"data-testid":`conversation-layouts-menu`,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),t(!1);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=_.current;if(!n)return;let r=Array.from(n.querySelectorAll(`[role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"]`)).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:z(`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`,Pn,Mn),children:[(0,Y.jsx)(Po,{children:c(R.CONVERSATION_PANEL$LAYOUTS_HEADING)}),zo.map(e=>(0,Y.jsx)(Z,{icon:e.icon,label:e.labelKey?c(e.labelKey):m,selected:h?.id===e.id,testId:`layout-preset-${e.id}`,onClick:()=>{l.applyLayoutSettings(e.settings),t(!1)}},e.id)),(0,Y.jsx)(G,{}),(0,Y.jsx)(Z,{icon:U,label:c(R.CONVERSATION_PANEL$TAG_FILTERS),testId:`tag-filters-section`,onClick:()=>d(!u)}),u?i.length>0?i.map(e=>(0,Y.jsx)(Z,{icon:U,label:vo(e),selected:l.selectedTagFacets.includes(e),testId:`tag-facet-row-${e}`,onClick:()=>l.toggleTagFacet(e)},e)):(0,Y.jsx)(`p`,{"data-testid":`tag-filters-empty`,className:`px-2 py-1 text-[11px] text-[var(--oh-muted)]/70`,children:c(R.CONVERSATION_PANEL$NO_VISIBLE_TAGS)}):null,(0,Y.jsx)(G,{}),(0,Y.jsx)(Z,{icon:Te,label:h?c(R.CONVERSATION_PANEL$ADVANCED_OPTIONS):`${c(R.CONVERSATION_PANEL$ADVANCED_OPTIONS)} · ${c(R.CONVERSATION_PANEL$ADVANCED_OPTIONS_CUSTOM)}`,testId:`advanced-options-row`,onClick:()=>{t(!1),p(!0)}}),(0,Y.jsx)(G,{}),(0,Y.jsx)(Z,{testId:`delete-all-conversations`,icon:Nt,label:Ho(c(R.CONVERSATION$DELETE_ALL)),disabled:o===0,destructive:!0,onClick:()=>{o!==0&&(s(),t(!1))}})]}):null,(0,Y.jsx)(Ro,{open:f,onClose:()=>p(!1),backendKind:r,automationNameFacets:a})]})}var Ho=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e;function Uo({selectedFacets:e,onToggleFacet:t,selectedAutomationNames:n,onToggleAutomationName:r,onClearAll:i}){let{t:a}=w(`openhands`);if(e.length===0&&n.length===0)return null;let o=`flex min-w-0 max-w-full cursor-pointer items-center gap-1 rounded-full bg-[var(--oh-surface)] px-2 py-0.5 text-[10px] leading-4 text-white hover:bg-white/10`;return(0,Y.jsxs)(`div`,{"data-testid":`conversation-active-tag-filters`,className:`flex min-w-0 items-start gap-1.5 border-b border-[var(--oh-border)] px-4 py-1.5`,children:[(0,Y.jsx)(U,{className:`mt-1 h-3 w-3 shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-1`,children:[e.map(e=>(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`active-tag-filter-${e}`,onClick:()=>t(e),className:o,children:[(0,Y.jsx)(`span`,{className:`truncate`,children:vo(e)}),(0,Y.jsx)(jt,{className:`h-3 w-3 shrink-0`,"aria-hidden":!0})]},e)),n.map(e=>(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`active-automation-filter-${e}`,onClick:()=>r(e),className:o,children:[(0,Y.jsx)(pt,{className:`h-3 w-3 shrink-0`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`truncate`,children:e===`__unnamed__`?a(R.CONVERSATION_PANEL$AUTOMATION_UNNAMED):e}),(0,Y.jsx)(jt,{className:`h-3 w-3 shrink-0`,"aria-hidden":!0})]},e))]}),(0,Y.jsx)(`button`,{type:`button`,"data-testid":`clear-tag-filters`,onClick:i,className:`shrink-0 cursor-pointer text-[10px] leading-5 text-[var(--oh-muted)] hover:text-white`,children:a(R.CONVERSATION_PANEL$CLEAR_FILTERS)})]})}var Wo=z(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,jn);function Go(e,t){let{open:n,enabled:r,targetWidth:i=256}=t,[a,o]=J.useState(null),s=J.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 J.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 Ko({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=w(`openhands`),{navigate:o}=ln(),[s,c]=J.useState(!1),l=J.useRef(null),u=J.useRef(null),d=Go(u,{open:s,enabled:i}),{data:f,error:p}=it(),m=f?.workspaceParents??[],{mutate:h}=dt(),{mutate:g}=nt(),{mutate:_}=ct(),{mutate:v}=ot(),{workspaces:y}=rt(),b=tt(p,a),[x,C]=J.useState(!1),[T,E]=J.useState(!1),{mutate:D,isPending:O}=Pr(),k=S(),A=O||k;J.useEffect(()=>{if(!s||x||T)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,x,T]),J.useEffect(()=>{if(!s||x||T)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,x,T]);let j=e=>{A||D({workingDir:e,entryPoint:`sidebar_local_menu`},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},M=Ln,N=J.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),P=J.useCallback(()=>{c(e=>!e)},[]),ee=s&&(!i||d!==null),te=!!b,ne=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,F=(0,Y.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:te,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),!te&&C(!0)},className:M,children:a(R.HOME$ADD_WORKSPACES)}),I=b?(0,Y.jsx)(An,{content:b,placement:`top`,children:(0,Y.jsx)(`span`,{className:`block`,children:F})}):F;return(0,Y.jsxs)(`div`,{className:z(!i&&`relative`,t),ref:l,children:[(0,Y.jsx)(`span`,{ref:u,className:`inline-flex`,children:e({onClick:P,"aria-expanded":s,"aria-haspopup":`menu`,disabled:A})}),ee&&(0,Y.jsxs)(`div`,{"data-testid":r,className:z(Wo,!i&&z(`absolute top-full mt-0`,n)),style:ne,children:[(0,Y.jsxs)(`ul`,{className:z(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,Pn),children:[(0,Y.jsx)(`li`,{children:(0,Y.jsx)(`button`,{type:`button`,disabled:A,"data-testid":`launch-no-workspace`,onClick:()=>j(),className:M,children:(0,Y.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:a(R.HOME$NO_WORKSPACE_OPTION)})})}),y.map(e=>(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,disabled:A,"data-testid":`launch-workspace`,"data-workspace-path":e.path,onClick:()=>j(e.path),className:M,children:[(0,Y.jsx)(`span`,{className:zn,"aria-hidden":!0,children:(0,Y.jsx)(Zr,{width:14,height:14})}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,Y.jsxs)(`div`,{className:z(`flex flex-col`,Pn),"data-testid":`new-conversation-menu-footer`,children:[(0,Y.jsx)(Jn,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),I,(y.length>0||m.length>0)&&(0,Y.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),E(!0)},className:M,children:a(R.HOME$MANAGE_WORKSPACES)})]})]}),(0,Y.jsx)(at,{isOpen:x,onClose:()=>C(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,Y.jsx)(ut,{isOpen:T,workspaces:y,workspaceParents:m,onClose:()=>E(!1),onRemove:e=>g(e),onRemoveParent:e=>v(e)})]})}function qo({repo:e,disabled:t,onSelect:n,itemClass:r}){return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,disabled:t,"data-testid":`launch-repository`,"data-repo-name":e.full_name,onClick:()=>n(e),className:r,children:[(0,Y.jsx)(`span`,{className:zn,"aria-hidden":!0,children:(0,Y.jsx)(Zr,{width:14,height:14})}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function Jo({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=w(`openhands`),{navigate:o}=ln(),{providers:s}=ti(),{lastSelectedProvider:c,setLastSelectedProvider:l}=ni(),[u,d]=J.useState(!1),f=J.useRef(null),p=J.useRef(null),m=Go(p,{open:u,enabled:i}),[h,g]=J.useState(c??null),[_,v]=J.useState(``),y=$r(_,300);J.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:b,isLoading:x,isError:C,hasNextPage:T,isFetchingNextPage:E,fetchNextPage:D}=Qr({provider:h}),{data:O,isLoading:k}=ei(y,h),A=J.useMemo(()=>b?.pages.flatMap(e=>e.items)??[],[b]),j=y?O??[]:A,{mutate:M,isPending:N}=Pr(),P=S(),ee=N||P;J.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]),J.useEffect(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&d(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u]);let te=e=>{ee||M({repository:{name:e.full_name,gitProvider:e.git_provider,branch:e.main_branch??`main`},entryPoint:`sidebar_cloud_menu`},{onSuccess:e=>{d(!1),o(`/conversations/${e.conversation_id}`)}})},ne=e=>{g(e),l(e),v(``)},F=Ln;J.useEffect(()=>{u&&(y||!T||E||x||j.length===0||j.length>=10||D())},[u,y,T,E,x,j.length,D]);let I=y?k:x,re=!y&&T&&j.length>0,L=J.useCallback(()=>{d(e=>!e)},[]),ie=u&&(!i||m!==null),B=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,Y.jsxs)(`div`,{className:z(!i&&`relative`,t),ref:f,children:[(0,Y.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:L,"aria-expanded":u,"aria-haspopup":`menu`,disabled:ee})}),ie&&(0,Y.jsxs)(`div`,{"data-testid":r,className:z(Wo,!i&&z(`absolute top-full mt-0`,n)),style:B,children:[s.length>1&&(0,Y.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,Y.jsxs)(`button`,{type:`button`,"data-testid":`cloud-provider-tab-${e}`,onClick:()=>ne(e),className:z(`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,Y.jsx)(Kn,{gitProvider:e}),(0,Y.jsx)(`span`,{className:`capitalize`,children:e})]},e)})}),(0,Y.jsx)(`div`,{className:`px-2`,children:(0,Y.jsxs)(`div`,{className:`relative`,children:[(0,Y.jsx)(ri,{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,Y.jsx)(`input`,{type:`text`,"data-testid":`cloud-repo-search-input`,value:_,onChange:e=>v(e.target.value),placeholder:a(R.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:z(`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,Y.jsx)(Jn,{inset:`menu`}),(0,Y.jsxs)(`ul`,{className:z(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,Pn),children:[I&&j.length===0&&(0,Y.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-loading`,children:a(R.HOME$LOADING_REPOSITORIES)}),C&&(0,Y.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(R.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!I&&!C&&j.length===0&&!!h&&(0,Y.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-empty`,children:a(R.GITHUB$NO_RESULTS)}),j.map(e=>(0,Y.jsx)(qo,{repo:e,disabled:ee,onSelect:te,itemClass:F},`${e.git_provider}:${e.id}`)),re&&(0,Y.jsx)(`li`,{children:(0,Y.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:E,onClick:()=>D(),className:F,children:(0,Y.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(E?R.HOME$LOADING_MORE_REPOSITORIES:R.CONVERSATION$LOAD_MORE)})})})]})]})]})}var Yo=z(`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 Xo({backendKind:e}){let{t}=w(`openhands`),n=t(R.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,Y.jsx)(Fe,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,Y.jsx)(Ko,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,Y.jsx)(`button`,{type:`button`,className:Yo,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})}):(0,Y.jsx)(Jo,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,Y.jsx)(`button`,{type:`button`,className:Yo,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})})}function Zo({group:e,expanded:t,previewExpanded:n,isDragging:r,dropIndicatorPosition:i,animateLayout:a,isCreatingConversationFlow:o,activeConversationId:s,discoveryConversationIds:c,onToggleExpanded:l,onDragStart:u,onDragEnd:d,onDragOver:f,onDragLeave:p,onDrop:m,onTogglePreviewExpanded:h,onLaunchFromGroup:g,renderConversationCard:_}){let{t:v}=w(`openhands`),y=(0,J.useRef)(null),b=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,x=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),{visibleConversations:S,isPreviewTruncated:C,isShowingAll:T}=co(e.conversations,{expanded:n,activeConversationId:s,discoveryConversationIds:c??void 0});return(0,Y.jsxs)(Ve.section,{ref:y,layout:a?`position`:!1,transition:{type:`spring`,stiffness:600,damping:45},"aria-labelledby":b,"data-testid":`thread-folder-${x}`,onDragOver:f,onDragLeave:p,onDrop:m,className:`relative rounded-md`,children:[i?(0,Y.jsx)(`div`,{"aria-hidden":!0,"data-testid":`thread-folder-drop-indicator-${x}`,className:z(`pointer-events-none absolute inset-x-0 z-10 h-0.5 rounded-full bg-[var(--oh-accent)]`,i===`before`?`-top-0.5`:`-bottom-0.5`)}):null,(0,Y.jsxs)(`div`,{className:z(r&&`opacity-0`),children:[(0,Y.jsxs)(`div`,{className:z(`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,Y.jsxs)(`button`,{type:`button`,draggable:!0,id:b,"aria-expanded":t,"aria-controls":`thread-folder-content-${x}`,"data-testid":`thread-folder-drag-${x}`,"aria-label":v(t?R.CONVERSATION_PANEL$COLLAPSE_FOLDER:R.CONVERSATION_PANEL$EXPAND_FOLDER,{label:e.label}),onClick:l,onDragStart:t=>{t.stopPropagation();let{dataTransfer:n}=t;if(n){n.effectAllowed=`move`,n.setData(`text/plain`,e.id);let r=y.current;if(r&&typeof n.setDragImage==`function`){let e=r.getBoundingClientRect(),i=r.cloneNode(!0);i.style.position=`fixed`,i.style.top=`0`,i.style.left=`-9999px`,i.style.width=`${e.width}px`,i.style.margin=`0`,i.style.pointerEvents=`none`,i.style.borderRadius=`0.5rem`,i.style.padding=`0.25rem`,i.style.backgroundColor=`var(--oh-surface-raised)`,i.style.boxShadow=`0 8px 24px rgba(0, 0, 0, 0.35)`,document.body.appendChild(i),n.setDragImage(i,t.clientX-e.left,t.clientY-e.top),window.setTimeout(()=>i.remove(),0)}}u()},onDragEnd:e=>{e.stopPropagation(),d()},className:z(`group/folder flex min-h-8 min-w-0 flex-1 cursor-grab items-center gap-2 rounded-md py-1 text-left text-inherit outline-none active:cursor-grabbing`,`focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`),children:[(0,Y.jsx)(lt,{className:z(`h-4 w-4 shrink-0`,t?`hidden group-hover/folder:block`:`block group-hover/folder:hidden`),"aria-hidden":!0}),(0,Y.jsx)(Qe,{className:z(`h-4 w-4 shrink-0`,t?`block group-hover/folder:hidden`:`hidden group-hover/folder:block`),"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,Y.jsx)(`button`,{type:`button`,className:z(`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:o,"aria-label":v(R.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${x}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),g()},children:(0,Y.jsx)(Ot,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),t?(0,Y.jsxs)(`div`,{id:`thread-folder-content-${x}`,className:`mt-0.5 space-y-0.5`,children:[S.map(_),C?(0,Y.jsx)(`div`,{className:`pl-2`,children:(0,Y.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${x}`,onClick:h,className:`cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:v(T?R.CONVERSATION_PANEL$LESS:R.CONVERSATION_PANEL$MORE)})}):null]}):null]})]})}function Qo({groups:e,groupIds:t,groupFolderOrder:n,setGroupFolderOrder:r,collapsedGroupIds:i,expandedGroupPreviewIds:a,discoveryConversationIds:o,onToggleGroupCollapsed:s,onToggleGroupPreviewExpanded:c,isCreatingConversationFlow:l,activeConversationId:u,onLaunchFromGroup:d,renderConversationCard:f}){let{t:p}=w(`openhands`),[m,h]=(0,J.useState)(null),[g,_]=(0,J.useState)(null),[v,y]=(0,J.useState)(null),[b,x]=(0,J.useState)(!1),S=(0,J.useRef)(null);(0,J.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let C=(0,J.useCallback)(()=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{x(!1),S.current=null},300)},[]),T=(0,J.useCallback)(()=>{h(null),_(null),y(null)},[]),E=(0,J.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();return e.clientY<t.top+t.height/2?`before`:`after`},[]),D=(0,J.useCallback)((e,i)=>{if(!m||m===e){T(),C();return}r(ko(n,t,m,e,i)),T(),C()},[m,n,t,T,r,C]);return(0,Y.jsx)(`nav`,{"aria-label":p(R.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:e.map(e=>(0,Y.jsx)(Zo,{group:e,expanded:!i.has(e.id),previewExpanded:a.has(e.id),isDragging:m===e.id,dropIndicatorPosition:g===e.id&&m!==e.id?v:null,animateLayout:b,isCreatingConversationFlow:l,activeConversationId:u,discoveryConversationIds:o,onToggleExpanded:()=>s(e.id),onDragStart:()=>{x(!0),h(e.id)},onDragEnd:()=>{T(),C()},onDragOver:t=>{t.preventDefault();let{dataTransfer:n}=t;n&&(n.dropEffect=`move`),_(e.id),y(E(t))},onDragLeave:()=>{_(t=>t===e.id?null:t)},onDrop:t=>{t.preventDefault(),D(e.id,E(t))},onTogglePreviewExpanded:()=>c(e.id),onLaunchFromGroup:()=>d(e.launch),renderConversationCard:f},e.id))})}function $o({pinnedConversations:e,isPreviewExpanded:t,onTogglePreviewExpanded:n,activeConversationId:r,showDivider:i=!1,renderConversationCard:a}){let{t:o}=w(`openhands`),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=co(e,{limit:5,expanded:t,activeConversationId:r});return(0,Y.jsxs)(`section`,{"data-testid":`conversation-panel-pinned-section`,className:z(`pt-1`,i?`mb-2 border-b border-[var(--oh-border-subtle)] pb-2`:`pb-2`),children:[(0,Y.jsxs)(`h3`,{className:`flex items-center gap-1.5 py-1.5 pl-2 text-sm font-normal text-[var(--oh-muted)]`,children:[(0,Y.jsx)(Et,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),o(R.CONVERSATION_PANEL$PINNED)]}),(0,Y.jsx)(`div`,{className:`space-y-0.5`,children:s.map(a)}),c?(0,Y.jsx)(`div`,{className:`pl-2 pt-0.5`,children:(0,Y.jsx)(`button`,{type:`button`,"data-testid":`conversation-panel-pinned-view-more`,onClick:n,className:`cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:o(l?R.CONVERSATION_PANEL$LESS:R.CONVERSATION_PANEL$MORE)})}):null]})}var es=`archived-conversations`,ts={archivesByBackendId:{}};function ns(e,t){return e[t]??[]}var rs=Rt()(rr((e,t)=>({...ts,archiveConversation:(n,r)=>{let i=ns(t().archivesByBackendId,n);i.includes(r)||e(e=>({archivesByBackendId:{...e.archivesByBackendId,[n]:[r,...i]}}))},removeArchivedConversation:(n,r)=>{let i=ns(t().archivesByBackendId,n);i.includes(r)&&e(e=>({archivesByBackendId:{...e.archivesByBackendId,[n]:i.filter(e=>e!==r)}}))},isArchived:(e,n)=>ns(t().archivesByBackendId,e).includes(n)}),{name:es,storage:ir(()=>localStorage),partialize:e=>({archivesByBackendId:e.archivesByBackendId})})),is={pinsByBackendId:{}};function as(e,t){return e[t]??[]}var os=Rt()(rr((e,t)=>({...is,pinConversation:(n,r)=>{let i=as(t().pinsByBackendId,n);i.includes(r)||e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:[r,...i]}}))},unpinConversation:(n,r)=>{let i=as(t().pinsByBackendId,n);i.includes(r)&&e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:i.filter(e=>e!==r)}}))},togglePin:(e,n)=>{as(t().pinsByBackendId,e).includes(n)?t().unpinConversation(e,n):t().pinConversation(e,n)},pruneMissingConversations:(n,r)=>{let i=new Set(r),a=as(t().pinsByBackendId,n),o=a.filter(e=>i.has(e));o.length!==a.length&&e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:o}}))}}),{name:`pinned-conversations`,storage:ir(()=>localStorage),partialize:e=>({pinsByBackendId:e.pinsByBackendId})})),ss=()=>{},cs=[];function ls({onClose:e,compact:t=!1}){let{t:n}=w(`openhands`),{conversationId:r,navigate:a}=ln(),{backend:o}=P(),s=Xn(),c=Mr(e??ss),[l,u]=J.useState(!1),[d,f]=J.useState(!1),[p,m]=J.useState(!1),[h,g]=J.useState(!1),[_,v]=J.useState(!1),[y,b]=J.useState(!1),x=X(e=>e.showOlderConversations),C=X(e=>e.olderConversationCutoff),T=X(e=>e.showArchivedConversations),E=X(e=>e.showRepoBranchMetadata),D=X(e=>e.showLlmProfiles),k=X(e=>e.showTagsMetadata),A=X(e=>e.showHoverMetadata),j=X(e=>e.organizeMode),M=X(e=>e.conversationSort),N=X(e=>e.threadScope),ee=X(e=>e.automationFilterMode),ne=X(e=>e.selectedAutomationNames),F=X(e=>e.selectedTagFacets),I=X(e=>e.toggleTagFacet),re=X(e=>e.toggleAutomationName),L=X(e=>e.clearFilterSelections),ie=X(e=>e.groupFolderOrder),ae=X(e=>e.setGroupFolderOrder),[oe,se]=J.useState(!1),[ce,le]=J.useState(!1),ue=Mr(()=>{se(!1)}),[de,fe]=J.useState(()=>new Set),[pe,me]=J.useState(()=>new Set),[he,ge]=J.useState(!1),V=os(e=>e.pinsByBackendId[o.id]??cs),_e=os(e=>e.togglePin),ve=os(e=>e.unpinConversation),ye=os(e=>e.pruneMissingConversations),be=rs(e=>e.archivesByBackendId[o.id]??cs),xe=rs(e=>e.archiveConversation),Se=J.useMemo(()=>new Set(be),[be]),Ce=rs(e=>e.removeArchivedConversation),we=J.useCallback(e=>{fe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Te=J.useCallback(e=>{me(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);J.useEffect(()=>{j!==`grouped`&&(fe(new Set),me(new Set))},[j]);let Ee=J.useRef(null),[H,U]=J.useState(null),[De,Oe]=J.useState(null),[ke,Ae]=J.useState(null),{data:je,isLoading:Me,isFetched:Ne,hasNextPage:Pe,isFetching:Fe,isFetchingNextPage:Ie,fetchNextPage:Le}=ia(),{workspaces:Re}=rt(),{data:ze}=aa(),Be=J.useMemo(()=>{let e=je?.pages.flatMap(e=>e.items)??[],t=new Set;return e.filter(e=>t.has(e.id)?!1:(t.add(e.id),!0))},[je]),Ve=J.useMemo(()=>{let e=new Map;return je?.pages.forEach((t,n)=>{t.items.forEach(t=>{e.has(t.id)||e.set(t.id,n)})}),e},[je]),W=J.useMemo(()=>T?Be:Be.filter(e=>!Se.has(e.id)),[Be,Se,T]),He=J.useMemo(()=>ho(W),[W]),Ue=J.useMemo(()=>{if(t||j!==`grouped`||o.kind!==`local`)return[];let e=e=>e.trim().replace(/\/+$/,``),n=new Map;for(let t of Re){let r=e(t.path);r&&n.set(r,t)}for(let t of W){let r=t.selected_workspace?e(t.selected_workspace):``;if(r&&!n.has(r)){let e=r.split(`/`).filter(Boolean).pop()??r;n.set(r,{id:r,name:e,path:r})}}return Array.from(n.values())},[o.kind,t,W,Re,j]),We=J.useMemo(()=>go(W,ee,ne,He),[ee,He,W,ne]),Ge=J.useMemo(()=>_o(W),[W]),Ke=J.useMemo(()=>yo(We,F,Ge),[We,F,Ge]),qe=J.useMemo(()=>lo(V,W),[W,V]);J.useEffect(()=>{if(!Ne)return;let e=je?.pages.flatMap(e=>e.items.map(e=>e.id))??[];ye(o.id,e)},[o.id,je,Ne,ye]),J.useEffect(()=>{V.length===0&&ge(!1)},[V.length]);let Je=J.useMemo(()=>{let e=N===`relevant`?Ke.filter(e=>B(e.execution_status)):Ke;return t?e:uo(e,V)},[Ke,t,V,N]),{recent:Ye,older:Xe}=J.useMemo(()=>oo(Je,io[ao(C)?C:`7d`]),[C,Je]),Ze=J.useMemo(()=>So(x?[...Ye,...Xe]:Ye,M),[Ye,Xe,x,M]),Qe=J.useMemo(()=>({emptyWorkspace:n(R.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(R.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),$e=J.useMemo(()=>t||j!==`grouped`?null:[...Ye,...x?Xe:[]],[t,Xe,j,Ye,x]),et=J.useMemo(()=>$e?Do($e,o.kind,M,Qe,Ue):null,[o.kind,M,Qe,$e,Ue]),tt=J.useMemo(()=>$e?Eo($e,Ve,o.kind,{forceIncludeConversationId:r}):null,[o.kind,Ve,r,$e]),nt=J.useMemo(()=>et?Oo(et,ie):null,[et,ie]),it=J.useMemo(()=>et?.map(e=>e.id)??[],[et]),at=J.useMemo(()=>So(Ye.filter(e=>B(e.execution_status)),M),[M,Ye]),ot=Ze.length,st=nt?.length??0,ct=j===`grouped`&&!t?st===0:ot===0,lt=ct&&ee!==`all`&&W.length>0&&We.length===0,ut=ct&&F.length>0&&We.length>0&&Ke.length===0,dt=j===`grouped`&&!t?st:ot,ft=je?.pages.length??0,[G,pt]=J.useState(null),[mt,ht]=J.useState(null),gt=J.useRef(dt);gt.current=dt;let _t=J.useRef(ft);_t.current=ft;let vt=J.useCallback(()=>{pt(null),ht(null)},[]),yt=J.useCallback(()=>{Pe&&(pt(gt.current),ht(_t.current))},[Pe]);J.useEffect(()=>{if(G!==null){if(dt>G){vt();return}if(j===`grouped`&&!t&&mt!=null&&ft>=mt+3){vt();return}if(!(Fe||Ie)){if(!Pe){vt();return}Le()}}},[vt,t,G,mt,dt,ft,j,Pe,Fe,Ie,Le]);let bt=G!==null||Ie,{mutate:xt,mutateAsync:St}=Gn(),{mutate:Ct}=Wn(),{mutate:wt}=Er(),{mutate:Tt}=ca(),Et=Xe.length>0&&!x,Dt=!!Pe&&!Et&&!t,{mutate:Ot}=Pr(),kt=S(),At=J.useCallback(e=>{kt||Ot({workingDir:e.workingDir,repository:e.repository,entryPoint:`sidebar_relaunch_project`},{onSuccess:e=>{a(`/conversations/${e.conversation_id}`)}})},[Ot,kt,a]),jt=J.useCallback((e,t)=>{u(!0),U(e),Oe(t)},[]),Mt=J.useCallback((e,t)=>{f(!0),U(e),Oe(t)},[]),Nt=J.useCallback(e=>{m(!0),U(e)},[]),Pt=J.useCallback(e=>{H&&Tt({conversationId:H,tags:e},{onSuccess:()=>{O(n(R.CONVERSATION$TAGS_UPDATED))}})},[H,n,Tt]),Ft=J.useCallback(e=>{Ce(o.id,e)},[o.id,Ce]),K=J.useCallback(e=>{g(!0),U(e)},[]),It=J.useCallback((e,t)=>{wt({conversationId:e,newTitle:t},{onSuccess:()=>{O(n(R.CONVERSATION$TITLE_UPDATED))}})},[n,wt]),Lt=()=>{if(H){let e=H;xt({conversationId:e},{onSuccess:()=>{Ce(o.id,e),e===r&&a(`/conversations`)}})}},Rt=()=>{H&&(xe(o.id,H),ve(o.id,H),H===r&&a(`/conversations`))},zt=()=>{H&&Ct({conversationId:H})},Bt=async()=>{let e=Be.map(e=>e.id),t=await Promise.allSettled(e.map(e=>St({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),i=t.length-n.length;for(let e of n)Ce(o.id,e);r!==null&&n.includes(r)&&a(`/conversations`),i>0&&te(`${i} conversation${i===1?``:`s`} could not be deleted.`)},Vt=J.useCallback((n,a)=>{let c=V.includes(n.id),l=Se.has(n.id);return t?(0,Y.jsx)(no,{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:E,llmModel:n.llm_model,showLlmProfiles:D,agentKind:n.agent_kind,acpServer:n.acp_server,tags:n.tags,showTags:k},n.id):(0,Y.jsx)(i,{placement:`right-start`,delay:1e3,closeDelay:100,isDisabled:!A||ke===n.id,disableAnimation:!1,className:`max-w-none overflow-visible rounded-xl border border-[var(--oh-border)] bg-base-secondary p-0 text-white shadow-xl`,content:(0,Y.jsx)(Ya,{title:n.title??``,executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,llmModel:n.llm_model,agentKind:n.agent_kind,acpServer:n.acp_server,createdAt:n.created_at,tags:n.tags}),children:(0,Y.jsx)(fn,{to:s(`/conversations/${n.id}`),onClick:e,className:z(`block rounded-md transition-colors`,ke!==n.id&&`hover:bg-[var(--oh-surface)]`,(n.id===r||ke===n.id)&&`bg-[var(--oh-surface)]`),children:(0,Y.jsx)(Ga,{onDelete:()=>jt(n.id,n.title??``),onArchive:l?void 0:()=>Mt(n.id,n.title??``),onUnarchive:l?()=>Ft(n.id):void 0,onStop:()=>K(n.id),onEditTags:o.kind===`local`?()=>Nt(n.id):void 0,onChangeTitle:e=>It(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:ke===n.id,onContextMenuToggle:e=>Ae(e?n.id:null),isActive:n.id===r,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:E,llmModel:n.llm_model,showLlmProfiles:D,agentKind:n.agent_kind,acpServer:n.acp_server,tags:n.tags,showTags:k,isArchived:l,isPinned:c,onTogglePin:()=>_e(o.id,n.id),alwaysShowPinIcon:c&&!a?.inPinnedSection})})},n.id)},[o.id,o.kind,Se,t,r,Mt,It,jt,Nt,K,Ft,e,ke,V,E,D,k,A,_e]),Ht=Me||!Ne,Ut=!t&&!Ht&&qe.length>0,Wt=j===`grouped`&&!t&&nt!=null&&nt.length>0,Gt=Ne&&!Me&&!t&&ct&&!Ut&&!ze?.length&&!Wt;return(0,Y.jsxs)(`div`,{ref:c,"data-testid":`conversation-panel`,className:`flex h-full min-h-0 w-full flex-col`,children:[!t&&(0,Y.jsx)(`div`,{className:z(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,ce?`border-[var(--oh-border)]`:`border-transparent`),children:(0,Y.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,Y.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-[var(--oh-muted)]`,children:n(R.SIDEBAR$CONVERSATIONS)}),(0,Y.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,Y.jsx)(Xo,{backendKind:o.kind}),(0,Y.jsx)(Vo,{menuOpen:oe,setMenuOpen:se,menuRef:ue,backendKind:o.kind,tagFacets:Ge,automationNameFacets:He,totalConversationsCount:Be.length,onRequestDeleteAll:()=>b(!0)})]})]})}),!t&&(0,Y.jsx)(Uo,{selectedFacets:F,onToggleFacet:I,selectedAutomationNames:ne,onToggleAutomationName:re,onClearAll:L}),(0,Y.jsxs)(`div`,{ref:Ee,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{le(e.currentTarget.scrollTop>0)},className:z(`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:[Ht&&(0,Y.jsx)(to,{compact:t}),!t&&Gt&&(0,Y.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,Y.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:n(lt?R.CONVERSATION_PANEL$NO_AUTOMATION_MATCHES:ut?R.CONVERSATION_PANEL$NO_TAG_MATCHES:R.CONVERSATION$NO_CONVERSATIONS)})}),Ut?(0,Y.jsx)($o,{pinnedConversations:qe,isPreviewExpanded:he,onTogglePreviewExpanded:()=>ge(e=>!e),activeConversationId:r,showDivider:!t&&j===`chronological`,renderConversationCard:e=>Vt(e,{inPinnedSection:!0})}):null,!t&&ze?.map(t=>(0,Y.jsx)(fn,{to:s(`/conversations/task-${t.id}`),onClick:e,className:`block`,children:(0,Y.jsx)(eo,{task:t})},t.id)),!Ht&&t?at.map(e=>Vt(e)):null,!Ht&&!t&&j===`grouped`&&nt&&nt.length>0?(0,Y.jsx)(Qo,{groups:nt,groupIds:it,groupFolderOrder:ie,setGroupFolderOrder:ae,collapsedGroupIds:de,expandedGroupPreviewIds:pe,discoveryConversationIds:tt,onToggleGroupCollapsed:we,onToggleGroupPreviewExpanded:Te,isCreatingConversationFlow:kt,activeConversationId:r,onLaunchFromGroup:At,renderConversationCard:e=>Vt(e)}):null,!Ht&&!t&&j===`chronological`?(0,Y.jsx)(`div`,{className:`space-y-0.5`,children:Ze.map(e=>Vt(e))}):null,Dt&&(bt?(0,Y.jsx)(`div`,{className:`py-1`,children:(0,Y.jsx)(to,{compact:t})}):(0,Y.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,Y.jsx)(`button`,{type:`button`,"data-testid":`load-more-conversations`,onClick:yt,className:`text-xs text-[var(--oh-muted)] hover:text-white`,children:n(R.CONVERSATION$LOAD_MORE)})}))]}),l&&(0,Y.jsx)(wr,{onConfirm:()=>{Lt(),u(!1),Oe(null)},onCancel:()=>{u(!1),Oe(null)},conversationTitle:De??void 0}),d&&(0,Y.jsx)(oa,{onConfirm:()=>{Rt(),f(!1),Oe(null)},onCancel:()=>{f(!1),Oe(null)},conversationTitle:De??void 0}),p&&(0,Y.jsx)(da,{tags:Be.find(e=>e.id===H)?.tags,onConfirm:e=>{Pt(e),m(!1)},onCancel:()=>m(!1)}),y&&(0,Y.jsx)(wr,{title:n(R.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(R.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:Be.length}),onConfirm:async()=>{await Bt(),b(!1)},onCancel:()=>b(!1)}),h&&(0,Y.jsx)(jr,{onConfirm:()=>{zt(),g(!1)},onCancel:()=>g(!1)}),_&&(0,Y.jsx)(sa,{onConfirm:()=>{e?.()},onClose:()=>v(!1),onCancel:()=>v(!1)})]})}function us({collapsed:e}){return e?null:(0,Y.jsx)(`div`,{className:`flex flex-col flex-1 min-h-0`,children:(0,Y.jsx)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col`,children:(0,Y.jsx)(ls,{})})})}var Q=18;function ds(){return(0,Y.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:Q,height:Q,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,Y.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,Y.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,Y.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,Y.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,Y.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,Y.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,Y.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,Y.jsx)(`path`,{d:`m17 16.5v5.17`}),(0,Y.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,Y.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,Y.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,Y.jsx)(`path`,{d:`M12 13.5V8`})]})}function fs({id:e,className:t}){let n=z(`shrink-0 text-white`,t),r=`sidebar-onboarding-checklist-icon-${e}`;switch(e){case`configure-llm`:return(0,Y.jsx)(`span`,{"data-testid":r,className:`inline-flex shrink-0`,children:(0,Y.jsx)(Je,{width:Q,height:Q,className:n,"aria-hidden":!0})});case`start-conversation`:return(0,Y.jsx)(`span`,{"data-testid":r,className:`inline-flex shrink-0`,children:(0,Y.jsx)(Ot,{size:Q,strokeWidth:2,className:n,"aria-hidden":!0})});case`schedule-task`:return(0,Y.jsx)(`span`,{"data-testid":r,className:`inline-flex shrink-0`,children:(0,Y.jsx)(Ci,{width:Q,height:Q,className:n,"aria-hidden":!0})});case`customize-agent`:return(0,Y.jsx)(`span`,{"data-testid":r,className:z(`inline-flex shrink-0`,n),children:(0,Y.jsx)(ds,{})});case`connect-mcp`:return(0,Y.jsx)(`span`,{"data-testid":r,className:`inline-flex shrink-0`,children:(0,Y.jsx)(Ti,{width:Q,height:Q,className:n,"aria-hidden":!0})});case`join-slack`:return(0,Y.jsx)(`span`,{"data-testid":r,className:`inline-flex shrink-0`,children:(0,Y.jsx)(qr,{width:Q,height:Q,className:n,"aria-hidden":!0})});default:return e}}var ps=z(`inline-flex shrink-0 items-center rounded-md bg-white px-2.5 py-1`,`text-xs font-medium text-black transition-colors hover:bg-white/90`);function ms({id:e,onActionClick:t,onDocsClick:n}){let{t:r}=w(`openhands`),i=di[e],a=li[e],o=ci[e],s=mi[e],c=xi(e);return(0,Y.jsxs)(`div`,{className:`flex w-[280px] flex-col gap-2.5 p-3`,"data-testid":`sidebar-onboarding-checklist-preview-${e}`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Y.jsx)(`span`,{className:`mt-0.5 inline-flex shrink-0 items-center justify-center`,children:(0,Y.jsx)(fs,{id:e})}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 text-sm font-medium text-white`,children:r(i)})]}),(0,Y.jsx)(`p`,{className:`text-xs leading-relaxed text-[var(--oh-muted)]`,children:r(a)}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsxs)(`a`,{href:s,target:`_blank`,rel:`noreferrer`,"data-testid":`sidebar-onboarding-checklist-preview-docs-${e}`,className:`inline-flex min-w-0 items-center gap-2 text-xs text-[var(--oh-muted)] transition-colors hover:text-white hover:underline`,onClick:n,children:[(0,Y.jsx)(Ce,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),r(R.SIDEBAR$ONBOARDING_CHECKLIST_DOCS_LINK)]}),c.kind===`external`?(0,Y.jsx)(`a`,{href:c.href,target:`_blank`,rel:`noreferrer`,"data-testid":`sidebar-onboarding-checklist-preview-action-${e}`,className:ps,onClick:t,children:r(o)}):(0,Y.jsx)(fn,{to:c.href,"data-testid":`sidebar-onboarding-checklist-preview-action-${e}`,className:ps,onClick:t,children:r(o)})]})]})}function hs(e){return e?.profiles.some(e=>e.api_key_set===!0)??!1}function gs(e){let t=e?.agent_settings?.llm,n=typeof t?.model==`string`&&t.model.length>0,r=e?.llm_api_key_set===!0||e?.llm_api_key_is_set===!0||t?.auth_type===`subscription`;return n&&r}function _s(e,t,n,r,i){return!!(hs(r)||t||gs(e))}function vs(e){return Object.keys(Yt(e)).length>0}function ys(){let{isCompleted:e}=Bt(),{currentPath:t}=ln(),n=(0,J.useSyncExternalStore)(gi,yi,()=>!1),[r,i]=(0,J.useState)(fi),[a,o]=(0,J.useState)(hi),[s,c]=(0,J.useState)(ai),{data:l}=Xt(),{isConfigured:u,isLoading:d}=Qn(),{data:f,isLoading:p}=Nr(),{data:m}=ia(1),{data:h}=wi(),{data:g}=Ei({limit:1,offset:0,enabled:h?.status===`ok`});(0,J.useEffect)(()=>{Si(t)&&(a||(vi(!0),o(!0)))},[t,a]);let _=(0,J.useMemo)(()=>{let e=(m?.pages[0]?.items.length??0)>0,t=(g?.total??0)>0;return{"configure-llm":_s(l,u,d,f,p),"connect-mcp":vs(l?.agent_settings?.mcp_config),"start-conversation":e,"schedule-task":t,"customize-agent":a,"join-slack":s}},[g?.total,m?.pages,a,s,u,d,p,f,l,l?.agent_settings?.mcp_config]),v=(0,J.useMemo)(()=>ui.map(e=>({id:e,isComplete:_[e]})),[_]),y=v.filter(e=>e.isComplete).length,b=y===v.length,x=e&&!n&&!b;return{items:v,completedCount:y,totalCount:v.length,isVisible:x,isMinimized:r,dismiss:()=>{si(!0)},toggleMinimized:()=>{i(e=>{let t=!e;return pi(t),t})},markJoinSlackComplete:()=>{s||(bi(!0),c(!0))}}}var bs=`rounded-xl border border-[var(--oh-border)] bg-base-secondary p-0 text-white shadow-xl`,xs=z(`flex min-w-0 w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-sm`,`transition-colors hover:bg-[var(--oh-surface)]`);function Ss({isComplete:e}){return(0,Y.jsx)(`span`,{"aria-hidden":!0,className:z(`inline-flex size-4 shrink-0 items-center justify-center rounded-full border`,e?`border-primary bg-primary text-[var(--oh-color-base)]`:`border-[var(--oh-border)] bg-transparent`),children:e?(0,Y.jsx)(Le,{className:`size-2.5`,strokeWidth:3}):null})}function Cs({id:e,isComplete:t,onActivate:n}){let{t:r}=w(`openhands`),{trackOnboardingLinkClicked:a}=Jt(),o=di[e],s=xi(e),c=ii[e],l=()=>{a({linkId:c,destinationType:_i[e],surface:`landing_checklist`,checklistItem:c,isExternal:s.kind===`external`}),n?.()},u=()=>{a({linkId:`open_docs`,destinationType:`documentation`,surface:`landing_checklist`,checklistItem:c,isExternal:!0})},d=z(xs,t?`text-muted`:`text-content`),f=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ss,{isComplete:t}),(0,Y.jsx)(`span`,{className:z(`min-w-0 flex-1 truncate`,t&&`line-through`),children:r(o)})]});return(0,Y.jsx)(`li`,{children:(0,Y.jsx)(i,{placement:`right-start`,delay:0,closeDelay:100,disableAnimation:!1,className:bs,content:(0,Y.jsx)(ms,{id:e,onActionClick:l,onDocsClick:u}),children:s.kind===`external`?(0,Y.jsx)(`a`,{href:s.href,target:`_blank`,rel:`noreferrer`,"data-testid":`sidebar-onboarding-checklist-item-${e}`,className:d,onClick:l,children:f}):(0,Y.jsx)(fn,{to:s.href,"data-testid":`sidebar-onboarding-checklist-item-${e}`,className:d,onClick:l,children:f})})})}function ws({collapsed:e}){let{t}=w(`openhands`),{items:n,completedCount:r,isVisible:i,isMinimized:a,toggleMinimized:o,markJoinSlackComplete:s}=ys();return e||!i?null:(0,Y.jsxs)(`div`,{"data-testid":`sidebar-onboarding-checklist`,"data-minimized":a?`true`:`false`,className:z(`w-full shrink-0 overflow-hidden rounded-xl border border-[var(--oh-border)]`,`bg-[var(--oh-surface-raised)] shadow-sm`),children:[(0,Y.jsx)(`div`,{className:z(`px-1`,a?`py-1`:`pt-2 pb-1`),children:(0,Y.jsxs)(`div`,{className:z(`relative flex w-full items-center gap-0.5 rounded-md px-1.5`,`transition-colors hover:bg-[var(--oh-surface)]`,a?`py-1`:`py-1.5`),children:[(0,Y.jsx)(`button`,{type:`button`,"data-testid":`sidebar-onboarding-checklist-toggle`,"aria-expanded":!a,"aria-label":t(a?R.SIDEBAR$ONBOARDING_CHECKLIST_EXPAND:R.SIDEBAR$ONBOARDING_CHECKLIST_COLLAPSE),onClick:o,className:`absolute inset-0 z-0 cursor-pointer rounded-md`}),(0,Y.jsx)(`div`,{className:`relative z-10 min-w-0 flex-1 px-0.5 pointer-events-none`,children:(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-semibold text-content`,children:t(R.SIDEBAR$ONBOARDING_CHECKLIST_TITLE)}),(0,Y.jsx)(`span`,{className:`text-xs text-muted`,children:t(R.SIDEBAR$ONBOARDING_CHECKLIST_PROGRESS,{completed:r})})]})}),(0,Y.jsx)(`span`,{"data-testid":`sidebar-onboarding-checklist-chevron`,"aria-hidden":!0,className:z(`relative z-10 inline-flex size-7 shrink-0 items-center justify-center`,`pointer-events-none text-[var(--oh-muted)]`),children:(0,Y.jsx)(Re,{className:z(`size-4 transition-transform motion-reduce:transition-none`,a&&`-rotate-90`)})})]})}),a?null:(0,Y.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2.5 pb-2`,children:n.map(e=>(0,Y.jsx)(Cs,{id:e.id,isComplete:e.isComplete,onActivate:oi(e.id)?s:void 0},e.id))})]})}var $=18,Ts=34,Es=Math.round(Ts*30/46);function Ds({collapsed:e,showCollapseToggle:t,showMobileCloseButton:n=!1,onCloseMobile:r,collapseToggleLabel:i,onCollapse:a,onExpand:o,showCollapsedExpandButton:s,isExtensionsActive:c,currentPath:l,activeBackend:u,activeOrgId:d,activeBackendHealth:f,collapsedBackendPopoverOpen:p,setCollapsedBackendPopoverOpen:m,collapsedBackendPopoverRef:h,collapsedBackendCloseTimer:g,onOpenAddBackend:_,onOpenManageBackends:v}){let{t:y}=w(`openhands`),{pages:b}=Di(),x=g,{isPinnedRoute:S,togglePinnedRoute:C}=pn(),T=(e,t)=>{let n=S(e);return{pinned:n,onToggle:()=>C(e),label:y(n?R.SIDEBAR$UNPIN_AS_HOME:R.SIDEBAR$PIN_AS_HOME),testId:t}},E=u.kind===`cloud`,D=d?`?org=${encodeURIComponent(d)}`:``,O=E?`${u.host.replace(/\/+$/,``)}/settings${D}`:null,k=It()!==null;return(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Y.jsxs)(`div`,{className:yn(e),children:[(0,Y.jsxs)(`div`,{className:z(e&&t?bn:`flex min-w-0 shrink-0 items-center`),children:[(0,Y.jsx)(`div`,{className:z(e&&t&&`flex h-full w-full items-center justify-start pl-2.5 transition-opacity duration-150`,e&&s&&`opacity-0`),children:(0,Y.jsx)(Mi,{logoWidth:Ts,logoHeight:Es,logoClassName:`max-w-none`,className:z(hn,`overflow-visible`)})}),e&&t?(0,Y.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":i,onClick:o,className:z(xn,s?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),children:(0,Y.jsx)(W,{width:14,height:14})}):null]}),!e&&t?(0,Y.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":i,onClick:a,className:z(`hidden md:inline-flex ml-auto`,vn,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,Y.jsx)(Be,{width:14,height:14})}):null,!e&&n?(0,Y.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-drawer-close`,onClick:r,"aria-label":y(R.SIDEBAR$CLOSE_MENU),className:z(`inline-flex ml-auto`,vn,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,Y.jsx)(Be,{width:14,height:14})}):null]}),(0,Y.jsxs)(`nav`,{className:gn(e),children:[(0,Y.jsx)(Zi,{collapsed:e}),(0,Y.jsx)(On,{to:`/conversations`,end:!0,label:y(R.SIDEBAR$NEW_CHAT),testId:`sidebar-conversations-link`,collapsed:e,icon:(0,Y.jsx)(Ot,{width:$,height:$})}),(0,Y.jsx)(On,{to:mn,label:y(R.NAV$CUSTOMIZE),testId:`sidebar-skills-link`,collapsed:e,forceActive:c,pinAction:T(mn,`sidebar-pin-home-toggle-customize`),icon:(0,Y.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,Y.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,Y.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,Y.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,Y.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,Y.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,Y.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,Y.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,Y.jsx)(`path`,{d:`m17 16.5v5.17`}),(0,Y.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,Y.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,Y.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,Y.jsx)(`path`,{d:`M12 13.5V8`})]})}),Kt()&&(0,Y.jsx)(On,{to:Wt(),label:Ut().sidebarLabel,testId:`sidebar-automations-link`,collapsed:e,icon:(0,Y.jsx)(Fo,{width:$,height:$}),pinAction:T(Wt(),`sidebar-pin-home-toggle-automations`)}),b.map(t=>(0,Y.jsx)(On,{to:t.href,label:t.contribution.nav_label||t.contribution.title,testId:`sidebar-canvas-extension-${t.extension.name}-${t.contribution.id}`,collapsed:e,icon:(0,Y.jsx)(_t,{width:$,height:$})},`${t.extension.name}:${t.contribution.id}`))]}),(0,Y.jsx)(us,{collapsed:e}),e&&t?(0,Y.jsxs)(`nav`,{className:z(gn(e),`mt-auto pb-2 cursor-pointer`),children:[(0,Y.jsx)(An,{content:y(R.SIDEBAR$SETTINGS),placement:`right`,children:E&&O?(0,Y.jsxs)(`a`,{href:O,target:k?void 0:`_blank`,rel:k?void 0:`noopener noreferrer`,"data-testid":`collapsed-settings-link`,"aria-label":y(R.SIDEBAR$SETTINGS),className:_n({collapsed:!0}),children:[(0,Y.jsx)(En,{active:!1,children:(0,Y.jsx)(yt,{width:$,height:$})}),(0,Y.jsx)(`span`,{className:Sn(!0),children:y(R.SIDEBAR$SETTINGS)})]}):(0,Y.jsxs)(fn,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":y(R.SIDEBAR$SETTINGS),className:_n({collapsed:!0}),children:[(0,Y.jsx)(En,{active:l.startsWith(`/settings`),children:(0,Y.jsx)(yt,{width:$,height:$})}),(0,Y.jsx)(`span`,{className:Sn(!0),children:y(R.SIDEBAR$SETTINGS)})]})}),(0,Y.jsxs)(`div`,{className:`relative`,ref:h,onMouseEnter:()=>{x.current&&=(clearTimeout(x.current),null),m(!0)},onMouseLeave:()=>{x.current=setTimeout(()=>m(!1),150)},children:[(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`collapsed-backend-selector-link`,"aria-label":y(R.BACKEND$MANAGE),"aria-expanded":p,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:z(_n({collapsed:!0}),`relative`),children:[(0,Y.jsx)(En,{active:p,children:(0,Y.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,Y.jsx)(Ct,{isConnected:f?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,Y.jsx)(ve,{width:$,height:$})]})}),(0,Y.jsx)(`span`,{className:Sn(!0),children:y(R.BACKEND$MANAGE)})]}),p?(0,Y.jsx)(`div`,{className:`absolute bottom-[-4px] left-full pl-2.5 z-40 w-[272px]`,onClick:e=>e.stopPropagation(),children:(0,Y.jsx)(Ji,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>m(!1),onOpenAddBackend:_,onOpenManageBackends:v})}):null]})]}):null,e?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`mb-2 shrink-0 pr-2.5`,children:(0,Y.jsx)(ws,{collapsed:e})}),(0,Y.jsxs)(`div`,{className:z(`flex flex-col items-stretch max-w-none box-border shrink-0 gap-2`,`-ml-2.5 w-[calc(100%+0.625rem)] border-t border-[var(--oh-border)] pt-2 px-2.5`),children:[(0,Y.jsx)(ra,{hideWhenUpToDate:!0}),(0,Y.jsx)(Ji,{sidebarCollapsed:e,openUpward:!0})]})]})]})}var Os=J.lazy(()=>a(()=>import(`./settings-modal-tHiJ8iYV.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,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69]))),ks=J.lazy(()=>a(()=>Promise.resolve().then(()=>Bi).then(e=>({default:e.AddBackendModal})),void 0)),As=J.lazy(()=>a(()=>import(`./manage-backends-modal-cMXqCb-B.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([70,1,2,3,4,5,6,7,8,9,10,13,71,72,73,20,22,52,53,54,55,23,74,33,75,32,41,17,36,40,38,76,16,39,77,78,79,80,81,82]))),js=250;function Ms(){let{t:e}=w(`openhands`),{currentPath:t}=ln(),{data:n}=Ht(),{data:r,error:i,isError:a,isFetching:o}=Xt(),{backends:s,active:c}=ee(),l=zt(s)[c.backend.id],u=bt(e=>e.collapsed),d=bt(e=>e.setCollapsed),[f,p]=J.useState(!1),[m,h]=J.useState(!1),g=J.useRef(null),[_,v]=J.useState(!1),[y,b]=J.useState(!1),[x,S]=J.useState(!1),C=J.useRef(!1),[,T]=J.useReducer(e=>e+1,0),{isOpen:E,close:D}=Dr(),[O,k]=J.useState(!1),[A,j]=J.useState(!1),M=Mr(()=>h(!1)),N=Zt(i);J.useEffect(()=>{D()},[t,D]),J.useEffect(()=>{if(E){k(!0);let e=requestAnimationFrame(()=>{j(!0)});return()=>cancelAnimationFrame(e)}j(!1);let e=window.setTimeout(()=>{k(!1)},js);return()=>window.clearTimeout(e)},[E]),J.useEffect(()=>{if(!E)return;let e=e=>{e.key===`Escape`&&D()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[E,D]),J.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&N!==404?te(e(R.SETTINGS$FETCH_ERROR)):N===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,N,n?.feature_flags?.hide_llm_settings,e]);let P=e(u?R.SIDEBAR$EXPAND:R.SIDEBAR$COLLAPSE),ne=J.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]),F={collapseToggleLabel:P,onCollapse:J.useCallback(()=>{S(!1),C.current=!0,T(),d(!0),window.setTimeout(()=>{C.current=!1,T()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&x&&!C.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/apps`||t===`/mcp`,currentPath:t,activeBackend:c.backend,activeOrgId:c.orgId,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:M,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>v(!0),onOpenManageBackends:()=>b(!0)};return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`aside`,{"aria-label":e(R.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:ne,onMouseEnter:()=>{u&&S(!0)},onMouseLeave:()=>{S(!1)},className:z(`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,Y.jsx)(Ds,{collapsed:u,showCollapseToggle:!0,...F})}),O?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:z(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,A?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${js}ms`},onClick:D,"aria-hidden":!A}),(0,Y.jsx)(`aside`,{"aria-label":e(R.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!A,className:z(`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`,A?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${js}ms`},children:(0,Y.jsx)(Ds,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:D,...F})})]}):null,f&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(Os,{settings:r,onClose:()=>p(!1)})}),_&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(ks,{onClose:()=>v(!1)})}),y&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(As,{onClose:()=>b(!1)})})]})}var Ns=`/settings`,Ps=`/customize`,Fs=[`/skills`,`/mcp`,`/plugins`],Is=`/apps`;function Ls(e){return e===Ns?{mode:`menu`}:e.startsWith(`${Ns}/`)&&e.length>9?{mode:`back`,backTo:Ns,backLabelKey:R.SETTINGS$TITLE}:e===Ps?{mode:`menu`}:e===Is||Fs.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:Ps,backLabelKey:R.NAV$CUSTOMIZE}:{mode:`menu`}}function Rs(){let{t:e}=w(`openhands`),{currentPath:t,navigate:n}=ln(),r=Ls(t);return(0,Y.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(R.SIDEBAR$NAVIGATION_LABEL),children:[(0,Y.jsx)(Ar,{}),r.mode===`back`&&r.backTo?(0,Y.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-back-button`,onClick:()=>n(r.backTo),"aria-label":e(r.backLabelKey??R.COMMON$BACK),className:Or,children:(0,Y.jsx)(Be,{size:20,className:Tr,"aria-hidden":!0,strokeWidth:2})}):null]})}function zs(){let{backend:e}=P(),t=e.kind===`local`,{data:n}=Nr(),{mutate:r,isPending:i}=Mt(),a=(0,J.useRef)(null);(0,J.useEffect)(()=>{a.current=null},[e.id]),(0,J.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])}function Bs(){let{backend:e}=P(),t=e.kind===`local`&&!ae(e),{data:n,isLoading:r,isError:i}=Xt(),{mutate:a}=Qt(),o=(0,J.useRef)(null);(0,J.useEffect)(()=>{o.current=null},[e.id]),(0,J.useEffect)(()=>{if(!t||r||i||!n||o.current===e.id)return;o.current=e.id;let s=gr(hr(n));s&&a(s)},[t,r,i,n,e.id,a])}var Vs=()=>{let{backend:e}=P(),{data:t}=Xt(),{mutate:n,isPending:r}=Qt(`personal`,{retry:2}),i=J.useSyncExternalStore(I,N,()=>null),a=J.useRef(null);J.useEffect(()=>{if(t!==void 0){if(i!==null){if((t.user_consents_to_analytics===!0?`granted`:t.user_consents_to_analytics===!1?`denied`:null)===i){a.current=null,e.kind===`cloud`&&M(i);return}if(e.kind!==`cloud`)return;let o=`${e.id}:${i}`;if(r||a.current===o)return;a.current=o,n({user_consents_to_analytics:i===`granted`});return}t.user_consents_to_analytics!==null&&D(t.user_consents_to_analytics===!0?`granted`:`denied`,{syncToCloud:!1})}},[e.id,e.kind,r,i,n,t])};function Hs(){let{backend:e}=P(),t=J.useSyncExternalStore(I,k,()=>`pending`),n=J.useRef(null);J.useEffect(()=>{let r=t===`pending`?ne():null;if(e.kind!==`local`||t===`pending`&&!r)return;let i=t===`granted`?`granted`:`denied`,a=t===`pending`?r:``,o=`${e.id}:${e.host}:${e.apiKey??``}:${i}:${a}`;n.current!==o&&(n.current=o,qt.syncTelemetryConsent(i).catch(()=>{}))},[e.apiKey,e.host,e.id,e.kind,t])}var Us=`agent_canvas_cloud_cookie_backend_added`,Ws=new Set;function Gs(e,t){return`${Us}:${e}:${t}`}function Ks(e,t){let n=Gs(e,t);if(typeof window>`u`)return!0;try{return window.sessionStorage.getItem(n)===`true`||Ws.has(n)}catch{return Ws.has(n)}}function qs(e,t){let n=Gs(e,t);if(!(typeof window>`u`))try{window.sessionStorage.setItem(n,`true`)}catch{Ws.add(n)}}var Js=()=>{let{backend:e,orgId:t}=P(),{data:n}=Xt(),{trackBackendAdded:r}=Jt(),i=J.useRef(r),a=tr(),o=e.kind===`cloud`?a[e.id]:void 0,s=o?.isLoading??!0,c=o?.userId??null,l=(n?.email||n?.git_user_email)?.trim()||void 0;J.useEffect(()=>{i.current=r},[r]),J.useEffect(()=>{if(e.kind!==`cloud`){A(null);return}if(!s){if(!c){A(null),F(null);return}A({userId:c,email:l,orgId:t}),F(c,l?{email:l}:{}),e.authMode===`cookie`&&l&&!Ks(e.id,c)&&(i.current({backendKind:`cloud`,connectionMethod:`cloud_cookie`,hasApiKey:!1,source:`cloud_auto_connect`}),qs(e.id,c))}},[e.authMode,e.connectionRevision,e.id,e.kind,l,s,t,c])};function Ys(e){switch(e){case L.RUNNING:return`🟢`;case L.FINISHED:case L.IDLE:case L.WAITING_FOR_CONFIRMATION:return`✅`;case L.PAUSED:return`⚪`;case L.ERROR:case L.STUCK:return`🔴`;default:return null}}var Xs=`OpenHands`,Zs=()=>{let{conversationId:e}=s(),{data:t}=ki(e??null),n=xr(t=>e?t.executionStatusByConversation[e]??null:null),r=t?.title,i=e&&r?`${r} | ${Xs}`:Xs;if(!e)return i;let a=Ys(n??t?.execution_status??null);return a?`${a} ${i}`:i};function Qs({children:e}){let{pathname:t}=c(),n=f(),r=_(),i=u(),a=J.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,Y.jsx)(un,{value:J.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var $s=J.lazy(()=>a(()=>import(`./environment-switch-overlay-COibRUA-.js`),__vite__mapDeps([83,1,2,22,7,84,10]))),ec=J.lazy(()=>a(()=>import(`./alert-banner-eYyqvHL3.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([85,1,2,86,5,6,22,7,87,88,10,16,89,50,45]))),tc=J.lazy(()=>a(()=>import(`./command-menu-CQxs4mtX.js`).then(e=>({default:e.CommandMenu})),__vite__mapDeps([90,1,2,53,5,6,91,92,3,4,7,8,9,10,13,93,55,94,95,96,28,97,98,99,22,36,17,100,33,101,12,102,23,103,104,105,106,107,45,34,52,54,16]))),nc=h(function(){let e=m(),{t}=w(`openhands`);return d(e)?(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h1`,{children:e.status}),(0,Y.jsx)(`p`,{children:e.statusText}),(0,Y.jsx)(`pre`,{children:e.data instanceof Object?JSON.stringify(e.data):e.data})]}):e instanceof Error?(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h1`,{children:t(R.ERROR$GENERIC)}),(0,Y.jsx)(`pre`,{children:e.message})]}):(0,Y.jsx)(`div`,{children:(0,Y.jsx)(`h1`,{children:t(R.ERROR$UNKNOWN)})})}),rc=p(function(){let e=c(),t=Zs(),{data:n}=Xt(),r=Ht();if(Hs(),Vs(),Js(),zs(),Bs(),J.useEffect(()=>{n?.language&&j.changeLanguage(n.language)},[n?.language]),r.isLoading)return(0,Y.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-base`,children:(0,Y.jsx)(Vt,{size:`large`})});let i=/^\/conversations\/[^/]+/.test(e.pathname),a=st(e.search);return(0,Y.jsx)(Qs,{children:(0,Y.jsx)(Oi,{children:(0,Y.jsxs)(Sr,{children:[(0,Y.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,Y.jsx)(`title`,{children:t}),(0,Y.jsx)(Ms,{}),(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-col w-full min-w-0 h-full gap-3`,children:[i?null:(0,Y.jsx)(Rs,{}),r.data&&(r.data.maintenance_start_time||r.data.faulty_models&&r.data.faulty_models.length>0||r.data.error_message)&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(ec,{maintenanceStartTime:r.data.maintenance_start_time,faultyModels:r.data.faulty_models,errorMessage:r.data.error_message,updatedAt:r.data.updated_at})}),(0,Y.jsx)(`div`,{id:`root-outlet`,className:`relative flex-1 overflow-auto px-0 custom-scrollbar`,children:(0,Y.jsx)(g,{})})]})]}),(0,Y.jsxs)(J.Suspense,{fallback:null,children:[(0,Y.jsx)($s,{}),(0,Y.jsx)(tc,{})]}),a?(0,Y.jsx)(ft,{}):null]})})})});export{nc as ErrorBoundary,rc as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-djXuAnBO.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor-styling-Ck5D_A2Q.js","assets/active-backend-context-BsLfwrXB.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js","assets/agent-server-client-options-EHB23gyx.js","assets/agent-server-config-C_x8Otd9.js","assets/utils-D-gOfhmN.js","assets/llm-settings-dkQ5Oq7W.js","assets/useMutation-Cszf8mKy.js","assets/useQuery-DAAacS7O.js","assets/back-nav-button-DWNiN277.js","assets/navigation-link-Bxo3-4vo.js","assets/navigation-context-CQZwH_tC.js","assets/form-control-classes-lQfLxzH4.js","assets/map-provider-iRs80q_6.js","assets/external-link-Bd7Tga-1.js","assets/info-BcajzHn1.js","assets/triangle-alert-DEdu-b_L.js","assets/useTranslation-CCgUjPJF.js","assets/proxy-DbEf3Nqr.js","assets/profiles-service.api-DdF_4Zhe.js","assets/settings-service.api-Q9lKW1TX.js","assets/settings-CKqk8ZnH.js","assets/use-free-models-Ci3FkKEm.js","assets/react-BX7IV650.js","assets/llm-subscription-service-BiQaZbvv.js","assets/llm-subscription-DTqtBCWz.js","assets/use-can-manage-org-profiles-CB8ybxFK.js","assets/organization-service.api-DmFUEmu5.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js","assets/dropdown-classes-goDldkiu.js","assets/badge-Cdnei7Ly.js","assets/settings-input-Cm4VxUon.js","assets/base-modal-Ds7grR67.js","assets/modal-body-DBweM2EN.js","assets/modal-classes-jvG85nkU.js","assets/modal-backdrop-BSzNhM4r.js","assets/brand-button-mQq2Ld1I.js","assets/sdk-section-page-DFEiuiFQ.js","assets/switch-skeleton-DwOoCqaL.js","assets/schema-field-c3Ncgm4x.js","assets/dist-Bl64nBZL.js","assets/settings-dropdown-input-BRR2OZwi.js","assets/settings-switch-seaSJc7t.js","assets/toggle-switch-DeiG9Mf6.js","assets/use-is-authed-A2Yinlt0.js","assets/typography-NarNyelM.js","assets/use-save-settings-CikTu5xV.js","assets/use-tracking-ChnSFChv.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js","assets/bot-ByolqPEr.js","assets/use-settings-BWIH5EuN.js","assets/extension-module-card-classes-DpeaYhYo.js","assets/copy-to-clipboard-button-DVNXLylP.js","assets/checkmark-XZyokq_Y.js","assets/copy-Drmhc2jD.js","assets/loading-spinner-DK1sAwVg.js","assets/settings-section-header-context-BOJ_Fbak.js","assets/use-llm-profiles-xtCBMbef.js","assets/u-check-circle-BKn1spCL.js","assets/u-edit-DAkcF52u.js","assets/api-error-message-BXo0lCI5.js","assets/format-model-name-Dfh9Udrx.js","assets/settings-list-classes-CaUfKZ33.js","assets/settings-utils-BTaaRhLZ.js","assets/manage-backends-modal-DqCJohsX.js","assets/backend-form-modal-DeaUJIik.js","assets/chevron-down-Cr6Fn_wS.js","assets/cloud-funnel-analytics-D02kgq1s.js","assets/use-onboarding-completion-CEgjL02y.js","assets/useQueries-pUohFMSP.js","assets/modal-close-button-BrM5fNnn.js","assets/pencil-q-ihqDYv.js","assets/plus-C2e21TFC.js","assets/refresh-cw-BtdC3T8P.js","assets/trash-2-Bb40zQzs.js","assets/confirmation-modal-BmVt_c0I.js","assets/use-cloud-current-user-id-BEKRd6XZ.js","assets/environment-switch-overlay-Dwe78wRl.js","assets/environment-switch-store-DVQZLFbj.js","assets/alert-banner-BkVt_8Or.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DXqM7vqB.js","assets/iconBase-C2sR-uAp.js","assets/close-ScPlnwyq.js","assets/command-menu-mehU3Evb.js","assets/settings-nav-DFb3hBMr.js","assets/key-CwTE6XJj.js","assets/u-robot-BvAOA2ZD.js","assets/wrench-B8Wg_nbp.js","assets/sidebar-store-DAZVH-DR.js","assets/conversation-store-DC-JlJuq.js","assets/use-acp-credential-form-CJ5wPsQm.js","assets/check-Bo8s5Ylg.js","assets/loader-circle-BxJgk73D.js","assets/acp-providers-BQ4o4vqy.js","assets/use-create-secret-Bk9ZxTjl.js","assets/secrets-service-DU6wh3wX.js","assets/use-get-secrets-fqS0kxt6.js","assets/list-todo-Caa8E1X_.js","assets/x-CX8lVGwm.js","assets/shield-check-C3Rl0NF8.js","assets/context-menu-list-item-lx2zk9G7.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,bt as r,i,xt as a,yt as o}from"./vendor-styling-Ck5D_A2Q.js";import{B as s,F as c,I as l,L as u,O as d,R as f,U as p,V as m,W as h,p as g,z as _}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as v}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as y}from"./useInfiniteQuery-CtSRG7uW.js";import{t as b}from"./useMutation-Cszf8mKy.js";import{t as x}from"./useQuery-DAAacS7O.js";import{i as S}from"./recommended-automations-launcher-r0oI91HN.js";import{t as C}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js";import{t as w}from"./useTranslation-CCgUjPJF.js";import{E as T,G as E,_ as D,ct as O,d as k,g as A,gt as j,i as M,l as N,n as P,r as ee,st as te,u as ne,v as F,y as I}from"./active-backend-context-BsLfwrXB.js";import{C as re,D as L,E as ie,K as R,t as z,w as B}from"./utils-D-gOfhmN.js";import{p as ae}from"./agent-server-client-options-EHB23gyx.js";import{A as oe,C as se,D as ce,E as le,M as ue,N as de,O as fe,S as pe,T as me,_ as he,a as ge,b as V,c as _e,d as ve,f as ye,g as be,h as xe,i as Se,j as Ce,k as we,l as Te,m as Ee,n as H,o as U,p as De,r as Oe,s as ke,t as Ae,u as je,v as Me,w as Ne,x as Pe,y as Fe}from"./vendor~root-layout-CcdIqs-C.js";import{t as Ie}from"./bot-ByolqPEr.js";import{t as Le}from"./check-Bo8s5Ylg.js";import{t as Re}from"./chevron-down-Cr6Fn_wS.js";import{n as ze,r as Be,t as Ve}from"./vendor~root-layout~conversation-panel~conversation-C3EBV3kp.js";import{t as W}from"./chevron-right-CfdfRn-8.js";import{a as He,i as Ue,n as We,o as Ge,r as Ke,s as qe,t as Je}from"./key-CwTE6XJj.js";import{t as Ye}from"./circle-check-5pH3qCji.js";import{r as Xe}from"./map-provider-iRs80q_6.js";import{t as Ze}from"./external-link-Bd7Tga-1.js";import{i as Qe,n as $e,r as et}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{a as tt,c as nt,d as rt,f as it,i as at,l as ot,n as st,o as ct,p as lt,r as ut,s as dt,t as ft,u as G}from"./onboarding-CQ8T6T0U.js";import{n as pt,r as mt,t as ht}from"./wrench-B8Wg_nbp.js";import{a as gt,i as _t,n as vt,r as yt,t as bt}from"./sidebar-store-DAZVH-DR.js";import{o as xt}from"./use-acp-credential-form-CJ5wPsQm.js";import{t as St}from"./list-filter-B8PQk3RA.js";import{o as Ct,r as wt}from"./backend-form-modal-DeaUJIik.js";import{t as Tt}from"./mouse-pointer-click-BXlRN92t.js";import{t as Et}from"./pin-BdroVQdN.js";import{t as Dt}from"./plug-7ACOEbMs.js";import{t as Ot}from"./plus-C2e21TFC.js";import{t as kt}from"./refresh-cw-BtdC3T8P.js";import{n as At,t as jt}from"./x-CX8lVGwm.js";import{a as Mt}from"./llm-settings-dkQ5Oq7W.js";import{t as Nt}from"./trash-2-Bb40zQzs.js";import{n as Pt,r as Ft,t as K}from"./context-menu-list-item-lx2zk9G7.js";import{u as It}from"./agent-server-config-C_x8Otd9.js";import{r as Lt}from"./use-free-models-Ci3FkKEm.js";import{t as Rt}from"./react-BX7IV650.js";import{o as zt,t as Bt}from"./use-onboarding-completion-CEgjL02y.js";import{t as Vt}from"./loading-spinner-DK1sAwVg.js";import{t as Ht}from"./use-config-3WYcJsgC.js";import{A as Ut,C as Wt,F as Gt,P as Kt,n as qt,t as Jt}from"./use-tracking-ChnSFChv.js";import{l as Yt}from"./settings-service.api-Q9lKW1TX.js";import{n as Xt,t as Zt}from"./use-settings-BWIH5EuN.js";import{t as Qt}from"./use-save-settings-CikTu5xV.js";import{t as $t}from"./modal-backdrop-BSzNhM4r.js";import{n as en,t as tn}from"./modal-body-DBweM2EN.js";import{i as nn,n as rn,r as an}from"./base-modal-Ds7grR67.js";import{_ as on,c as sn}from"./form-control-classes-lQfLxzH4.js";import{t as cn}from"./brand-button-mQq2Ld1I.js";import{n as ln,t as un}from"./navigation-context-CQZwH_tC.js";import{t as dn}from"./openhands-logo-BS-Epajy.js";import{t as fn}from"./navigation-link-Bxo3-4vo.js";import{r as pn,t as mn}from"./use-pinned-home-route-pK4IlJ-p.js";import{a as hn,d as gn,f as _n,i as vn,l as yn,n as bn,r as xn,u as Sn}from"./sidebar-layout-B6mcvvdV.js";import{a as Cn,i as wn,n as Tn,o as En,r as Dn,t as On}from"./sidebar-nav-link-BTHX11LG.js";import{t as kn}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-CjECvSl5.js";import{t as An}from"./styled-tooltip-DVAlWYnL.js";import{a as jn,d as Mn,f as Nn,i as Pn,l as Fn,n as In,o as Ln,r as Rn,u as zn}from"./dropdown-classes-goDldkiu.js";import{i as Bn,n as Vn}from"./settings-dropdown-input-BRR2OZwi.js";import{a as Hn,c as Un,d as Wn,f as Gn,i as Kn,l as qn,m as Jn,o as Yn,p as Xn,s as Zn,t as Qn,u as $n}from"./use-llm-configured-B71ZEVg2.js";import{n as er,t as tr}from"./use-cloud-current-user-id-BEKRd6XZ.js";import{s as nr}from"./environment-switch-store-DVQZLFbj.js";import{g as rr,m as ir,t as ar}from"./conversation-store-DC-JlJuq.js";import{t as or}from"./modal-close-button-BrM5fNnn.js";import{t as sr}from"./manage-backends-modal-DqCJohsX.js";import{a as cr,i as lr,r as ur,t as dr}from"./agent-server-conversation-service.api-BaVQ6NpE.js";import{c as fr,d as pr,u as mr}from"./acp-providers-BQ4o4vqy.js";import{c as hr,o as gr}from"./skill-enablement-DXeaImBz.js";import{t as _r}from"./use-is-authed-A2Yinlt0.js";import{n as vr,o as yr,s as br,t as xr}from"./conversation-state-store-C6YncQNo.js";import{a as Sr,c as Cr,d as wr,i as Tr,l as Er,o as Dr,r as Or,s as kr,t as Ar,u as jr}from"./sidebar-mobile-menu-toggle-CEqS8KnA.js";import{t as Mr}from"./use-click-outside-element-W6Os4Nlb.js";import{t as Nr}from"./use-llm-profiles-xtCBMbef.js";import{n as Pr}from"./use-create-conversation-Be-eVpFp.js";import{t as Fr}from"./format-time-delta-BIR5Os7T.js";import{r as Ir,t as Lr}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js";import{a as q,i as Rr,n as zr}from"./use-can-manage-org-profiles-CB8ybxFK.js";import{t as Br}from"./u-edit-DAkcF52u.js";import{t as Vr}from"./skills-B0IliMxw.js";import{i as Hr}from"./format-model-name-Dfh9Udrx.js";import{r as Ur}from"./onboarding-modal-CnliiaSN.js";import{a as Wr,o as Gr,t as Kr}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DXqM7vqB.js";import{m as qr}from"./install-server-modal-DvxxYKia.js";import{n as Jr}from"./toggle-switch-DeiG9Mf6.js";import{n as Yr}from"./scroll-fade-state-Dt_fx2kf.js";import{t as Xr}from"./enum-filter-dropdown-pocrz9AL.js";import{c as Zr,i as Qr,n as $r,r as ei,s as ti,t as ni}from"./home-store-DNQpfIEO.js";import{t as ri}from"./search-BatSpWed.js";import{_ as ii,a as ai,b as oi,c as si,d as ci,f as li,g as ui,h as di,i as fi,l as pi,m as mi,n as hi,o as gi,p as _i,s as vi,t as yi,u as bi,v as xi,y as Si}from"./sidebar-onboarding-checklist-storage-BP1kzn6p.js";import{n as Ci,t as wi}from"./use-automation-health-DdgSa8sA.js";import{t as Ti}from"./server-process-C9RKzd1x.js";import{t as Ei}from"./use-automations-CEubcYTD.js";import{n as Di,t as Oi}from"./canvas-extensions-runtime-Du2M5iEX.js";import{t as ki}from"./use-user-conversation-C_l65DqW.js";var J=e(n(),1),Y=o(),Ai=46,ji=30;function Mi({className:e,logoClassName:t,logoWidth:n=Ai,logoHeight:r=ji}={}){let{t:i}=w(`openhands`);return(0,Y.jsx)(fn,{to:`/conversations`,"aria-label":i(R.BRANDING$OPENHANDS_LOGO),className:z(e),children:(0,Y.jsx)(dn,{width:n,height:r,className:z(`shrink-0`,t)})})}function Ni(){return(0,Y.jsx)(`div`,{className:`animate-spin h-4 w-4 border-2 border-transparent border-t-white rounded-full`,"data-testid":`dropdown-loading`})}function Pi({onClear:e}){return(0,Y.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,Y.jsx)(jt,{size:14})})}function Fi({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,Y.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:z(Bn,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,Y.jsx)(Vn,{})})}function Ii({isOpen:e,filteredOptions:t,selectedItem:n,emptyMessage:r,getMenuProps:i,getItemProps:a,footer:o,openUpward:s=!1,fitContent:c=!1}){return(0,Y.jsxs)(`div`,{className:z(`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,Y.jsxs)(`ul`,{...i({className:z(`p-0`,Pn)}),children:[e&&t.length===0&&(0,Y.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,children:r}),e&&t.map((e,t)=>(0,Y.jsxs)(`li`,{...a({item:e,index:t,className:z(Ln,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,Y.jsx)(`span`,{className:zn,children:e.prefix}):null,(0,Y.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label})]},e.value))]}),e&&o?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Jn,{inset:`menu`}),(0,Y.jsx)(`div`,{className:`p-0`,children:o})]}):null]})}function Li({placeholder:e,isDisabled:t,getInputProps:n,italicPlaceholder:r=!0,fitContent:i=!1}){return(0,Y.jsx)(`input`,{...n({placeholder:e,disabled:t,className:z(`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`,sn,`px-0 not-italic text-inherit`)})})}var Ri={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function zi({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 _=J.useRef(null),[v,y]=(0,J.useState)(o?.label??``),[b,x]=(0,J.useState)(``);J.useEffect(()=>()=>{_.current&&=(clearTimeout(_.current),null)},[]);let S=e.filter(e=>e.label.toLowerCase().includes(b.toLowerCase())),{isOpen:C,selectedItem:w,selectItem:T,openMenu:E,closeMenu:D,getToggleButtonProps:O,getMenuProps:k,getItemProps:A,getInputProps:j}=kn({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===kn.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(``))}}),M=r||i,N=w?e.find(e=>e.value===w.value)??w:null,P=e=>j({...e,onChange:e=>{y(e.target.value),x(e.target.value)}});return(0,Y.jsxs)(`div`,{className:z(`relative`,g?`inline-block w-auto`:`w-full`),"data-testid":c,onMouseEnter:m?()=>{_.current&&=(clearTimeout(_.current),null),E()}:void 0,onMouseLeave:m?()=>{_.current&&clearTimeout(_.current),_.current=setTimeout(()=>D(),150)}:void 0,children:[f?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`input`,{...P({"aria-label":a??`Filter options`,tabIndex:-1}),style:Ri}),(0,Y.jsx)(`button`,{type:`button`,...O({tabIndex:-1}),style:Ri,"aria-hidden":!0})]}):(0,Y.jsxs)(`div`,{className:z(Nn,g?`w-auto`:`w-full`,M&&`cursor-not-allowed opacity-60`,l),children:[N?.prefix?(0,Y.jsx)(`span`,{className:`flex items-center shrink-0`,children:N.prefix}):null,(0,Y.jsx)(Li,{placeholder:a,isDisabled:M,getInputProps:P,italicPlaceholder:h,fitContent:g}),r&&(0,Y.jsx)(Ni,{}),n&&w&&(0,Y.jsx)(Pi,{onClear:()=>T(null)}),(0,Y.jsx)(Fi,{isOpen:C,isDisabled:M,getToggleButtonProps:O})]}),(0,Y.jsx)(Ii,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:k,getItemProps:A,footer:u,openUpward:d,fitContent:g})]})}var Bi=t({AddBackendModal:()=>Vi});function Vi({onClose:e}){return(0,Y.jsx)(wt,{mode:`add`,onClose:e})}var Hi=`::`;function Ui(e,t){return t?`${e}${Hi}${t}`:e}function Wi(e){let[t,n]=e.split(Hi);return{backendId:t,orgId:n??null}}function Gi(e){return(0,Y.jsx)(Ct,{isConnected:e?.isConnected??null})}function Ki(){return(0,Y.jsx)(Ct,{isConnected:`unavailable`})}function qi(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:Ui(e.id,null),label:e.name,prefix:Gi(i[e.id])});for(let e of s){let o=n[e.id],s=Gi(i[e.id]);if(!o||o.orgs.length===0)a.push({value:Ui(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:Ui(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function Ji({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:r,onOpenAddBackend:i,onOpenManageBackends:a,sidebarCollapsed:o=!1}={}){let{t:s}=w(`openhands`),{backends:c,active:u,setActive:d}=ee(),p=er(),m=tr(),h=zt(c),g=f(),_=l(`/settings`),v=l(`/settings/*`),y=l(`/conversations/:conversationId`),b=l(`/automations/:automationId`),[x,S]=J.useState(!1),[C,T]=J.useState(!1),E=s(R.BACKEND$PERSONAL_WORKSPACE),D=J.useMemo(()=>qi(c,E,p,m,h),[c,E,p,m,h]),O=ae(u.backend),k=s(R.BACKEND$NO_BACKEND_AVAILABLE),A=Ui(u.backend.id,u.orgId),j=O?void 0:D.find(e=>e.value===A),M=!!(_||v),N=s(R.SIDEBAR$SETTINGS),P=u.orgId?`?org=${encodeURIComponent(u.orgId)}`:``,te=ar(e=>e.isRightPanelShown),ne=!o||y&&te?`top`:`left`,F=Object.values(p).some(e=>e.isLoading);J.useEffect(()=>{if(O||u.backend.kind!==`cloud`||u.orgId)return;let{backend:e}=u,t=p[e.id];if(!t||t.orgs.length===0)return;let n=t.currentOrgId?t.orgs.find(e=>e.id===t.currentOrgId):void 0,r=m[e.id]?.userId??null,i=r?t.orgs.find(e=>e.id===r):void 0,a=n??i??t.orgs[0];a&&d(e.id,a.id)},[u,p,m,d,O]);let I=J.useCallback(()=>{if(i){i(),r?.();return}S(!0)},[i,r]),re=J.useCallback(()=>{if(a){a(),r?.();return}T(!0)},[a,r]),L=It()!==null,ie=L&&u.backend.authMode===`cookie`,B=J.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),oe=J.useCallback(e=>{B(e),I()},[I,B]),se=J.useCallback(e=>{B(e),I()},[I,B]),ce=J.useCallback(e=>{B(e),re()},[re,B]),le=J.useCallback(e=>{B(e),re()},[re,B]),ue=ie?void 0:(0,Y.jsxs)(`div`,{className:Pn,children:[L?null:(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:B,onTouchStart:B,onTouchEnd:se,onClick:oe,className:z(In,`cursor-pointer rounded-md`),children:[(0,Y.jsx)(`span`,{className:zn,"aria-hidden":!0,children:(0,Y.jsx)(Ot,{width:16,height:16})}),s(R.BACKEND$ADD)]}),(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:B,onTouchStart:B,onTouchEnd:le,onClick:ce,className:z(In,`cursor-pointer rounded-md`),children:[(0,Y.jsx)(`span`,{className:zn,"aria-hidden":!0,children:(0,Y.jsx)(yt,{width:16,height:16})}),s(L?R.BACKEND$RECONNECT_CLOUD:R.BACKEND$MANAGE)]})]}),de=J.useCallback(async e=>{if(e===A)return;let{backendId:t,orgId:n}=Wi(e),i=c.find(e=>e.id===t);i&&(nr(D.find(t=>t.value===e)?.label??i.name),await new Promise(e=>{setTimeout(e,400)}),y?g(`/conversations`):b&&g(`/automations`),d(i.id,n),r?.())},[A,c,y,b,g,D,d,s,r]);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 w-full`,children:[(0,Y.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,Y.jsx)(zi,{testId:`backend-selector`,defaultValue:j??{value:A,label:O?k:u.backend.name,prefix:O?Ki():Gi(h[u.backend.id])},footer:ue,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&de(e.value)},placeholder:O?k:u.backend.name,loading:F,options:D,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`},`${A}-${j?.label??``}`)}),t?null:(0,Y.jsx)(An,{content:N,placement:ne,offset:10,children:u.backend.kind===`cloud`?(0,Y.jsx)(`a`,{href:`${u.backend.host.replace(/\/+$/,``)}/settings${P}`,target:L?void 0:`_blank`,rel:L?void 0:`noopener noreferrer`,"data-testid":`backend-selector-settings-link`,"aria-label":N,className:z(`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`,on),children:(0,Y.jsx)(yt,{width:16,height:16})}):(0,Y.jsx)(fn,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":M,"aria-label":N,className:z(M?`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`,on),children:(0,Y.jsx)(yt,{width:16,height:16})})})]}),x?(0,Y.jsx)(Vi,{onClose:()=>S(!1)}):null,C?(0,Y.jsx)(sr,{onClose:()=>T(!1)}):null]})}var Yi=`command-menu-trigger`,Xi=18;function Zi({collapsed:e}){let{t}=w(`openhands`),n=vt(e=>e.open),r=t(R.COMMAND_MENU$OPEN_LABEL),i=(0,Y.jsxs)(`button`,{type:`button`,"data-testid":Yi,"aria-label":r,onClick:n,className:z(_n({collapsed:e}),e?`cursor-pointer`:`group justify-between border border-[var(--oh-border-subtle)] bg-[var(--oh-surface)]/50 hover:border-[var(--oh-border)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[e?(0,Y.jsx)(En,{active:!1,children:(0,Y.jsx)(At,{width:Xi,height:Xi})}):(0,Y.jsx)(`span`,{className:z(hn,`text-[var(--oh-muted)] group-hover:text-white`),"aria-hidden":`true`,children:(0,Y.jsx)(At,{width:Xi,height:Xi})}),(0,Y.jsx)(`span`,{className:Sn(e),children:r})]}),e?null:(0,Y.jsx)(`kbd`,{className:`rounded-md border border-[var(--oh-border)] bg-black/20 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--oh-text-dim)]`,children:t(R.COMMAND_MENU$SHORTCUT)})]});return e?(0,Y.jsx)(An,{content:r,placement:`right`,children:i}):i}var Qi=2e3,$i=[`npm`,`docker`];function ea(e){return e===`npm`?R.SETTINGS$VERSION_NPM_RECOMMENDED:R.SETTINGS$VERSION_DOCKER}function ta({tab:e}){return e===`npm`?(0,Y.jsx)(We,{className:`size-4 shrink-0`,"aria-hidden":!0}):(0,Y.jsx)(Ke,{className:`size-5 shrink-0`,"aria-hidden":!0})}function na({installedVersion:e,latestVersion:t,updateAvailable:n,isChecking:r,onCheckForUpdates:i,onClose:a}){let{t:o}=w(`openhands`),[s,c]=J.useState(`npm`),[l,u]=J.useState(!1),d=J.useRef(null),f=s===`npm`?Ge.npm:Ge.docker;J.useEffect(()=>()=>{d.current!==null&&window.clearTimeout(d.current)},[]),J.useEffect(()=>{u(!1),d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[s]);let p=J.useCallback(()=>{navigator.clipboard?.writeText(f),u(!0),d.current!==null&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>{u(!1),d.current=null},Qi)},[f]);return(0,Y.jsx)($t,{onClose:a,"aria-label":o(R.SETTINGS$VERSION_MODAL_ARIA_LABEL),children:(0,Y.jsxs)(`section`,{className:`relative flex w-[520px] max-w-[90vw] flex-col gap-5 rounded-xl border border-[var(--oh-border)] bg-base-secondary p-6 shadow-xl`,children:[(0,Y.jsx)(or,{onClose:a,testId:`agent-canvas-version-modal-close`}),(0,Y.jsxs)(`header`,{className:`flex items-center gap-3 pr-8`,children:[n?(0,Y.jsx)(qe,{className:`size-7 shrink-0 text-[#3B82F6]`,"aria-hidden":!0}):(0,Y.jsx)(Ye,{className:`size-7 shrink-0 text-[var(--oh-status-success)]`,"aria-hidden":!0}),(0,Y.jsx)(`h2`,{className:`text-base font-semibold leading-6 text-white`,children:o(n?R.SETTINGS$VERSION_UPDATE_AVAILABLE:R.SETTINGS$VERSION_UP_TO_DATE_TITLE)}),n&&t?(0,Y.jsx)(`span`,{className:`rounded-full bg-[#1E3A5F] px-2 py-0.5 text-xs font-semibold text-[#3B82F6]`,children:t}):null]}),(0,Y.jsx)(`div`,{className:`flex flex-col gap-1`,children:n&&t?(0,Y.jsxs)(`p`,{className:`text-sm text-[var(--oh-text)]`,children:[o(R.SETTINGS$VERSION_UPDATE_MESSAGE,{installed:e,latest:t}),` `,(0,Y.jsxs)(`a`,{href:He,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 whitespace-nowrap font-medium text-white hover:text-[var(--oh-text)]`,children:[o(R.SETTINGS$VERSION_RELEASE_NOTES),(0,Y.jsx)(Ze,{className:`size-4 shrink-0`,"aria-hidden":!0})]})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`text-sm text-[var(--oh-text)]`,children:o(R.SETTINGS$VERSION_INSTALLED,{version:e})}),t?(0,Y.jsxs)(`p`,{className:`whitespace-nowrap text-sm text-[var(--oh-status-success)]`,children:[o(R.SETTINGS$VERSION_LATEST_MESSAGE),` `,(0,Y.jsxs)(`a`,{href:He,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 font-medium text-white hover:text-[var(--oh-text)]`,children:[o(R.SETTINGS$VERSION_RELEASE_NOTES),(0,Y.jsx)(Ze,{className:`size-4 shrink-0`,"aria-hidden":!0})]})]}):(0,Y.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:o(R.SETTINGS$VERSION_CHECK_UNAVAILABLE)})]})}),n?(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`flex justify-center`,children:$i.map(e=>(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>c(e),className:z(`inline-flex items-center gap-1.5 px-3 pb-2 text-sm font-medium`,s===e?`border-b border-white text-white`:`text-[var(--oh-muted)] hover:text-white`),children:[(0,Y.jsx)(ta,{tab:e}),o(ea(e))]},e))}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface-deep)] px-4 py-3`,children:[(0,Y.jsx)(`code`,{className:`min-w-0 flex-1 overflow-visible whitespace-nowrap font-mono text-sm text-white`,children:f}),(0,Y.jsx)(`button`,{type:`button`,onClick:p,"aria-label":o(l?R.BUTTON$COPIED:R.SETTINGS$VERSION_COPY_COMMAND),disabled:l,className:`shrink-0 text-[var(--oh-muted)] hover:text-white disabled:hover:text-[var(--oh-muted)]`,children:l?(0,Y.jsx)(Le,{className:`size-4 text-[var(--oh-status-success)]`,"aria-hidden":!0}):(0,Y.jsx)(Xe,{className:`size-4`,"aria-hidden":!0})})]})]}):null,n?null:(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-x-8 gap-y-3`,children:(0,Y.jsxs)(`button`,{type:`button`,onClick:i,className:`inline-flex items-center gap-2 text-sm font-medium text-white hover:text-[var(--oh-text)] disabled:cursor-wait disabled:text-[var(--oh-muted)]`,disabled:r,children:[o(R.SETTINGS$VERSION_CHECK_FOR_UPDATES),(0,Y.jsx)(kt,{className:z(`size-4 shrink-0`,r&&`animate-spin`),"aria-hidden":!0})]})})]})})}function ra({className:e,hideWhenUpToDate:t=!1}){let{t:n}=w(`openhands`),[r,i]=J.useState(!1),a=It()!==null,o=Ue({enabled:!a});if(a)return null;let s=T,c=o.data??null,l=(c===null?null:E(c,s))===1;return t&&!l?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`agent-canvas-version-tile`,onClick:()=>i(!0),"aria-label":n(R.SETTINGS$VERSION_TILE_ARIA_LABEL),className:z(`flex w-full items-center gap-3 rounded-md border border-[var(--oh-border)] bg-base-secondary px-3 py-2 text-left hover:bg-[var(--oh-surface-raised)]`,e),children:[(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`span`,{className:`block truncate text-sm font-semibold leading-5 text-white`,children:n(l?R.SETTINGS$VERSION_TILE_NEW_VERSION:R.SETTINGS$VERSION_PRODUCT_NAME)}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 truncate text-xs leading-5`,children:[(0,Y.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:n(R.SETTINGS$APP_UPDATE_VERSION_LABEL)}),(0,Y.jsx)(`span`,{className:`truncate text-white`,children:l&&c?c:s})]})]}),l?(0,Y.jsx)(qe,{className:`size-5 shrink-0 text-[#3B82F6]`,"aria-hidden":!0}):(0,Y.jsx)(Ye,{className:`size-5 shrink-0 text-[var(--oh-status-success)]`,"aria-hidden":!0})]}),r?(0,Y.jsx)(na,{installedVersion:s,latestVersion:c,updateAvailable:l,isChecking:o.isFetching,onCheckForUpdates:()=>{o.refetch()},onClose:()=>i(!1)}):null]})}var ia=(e=20)=>{let{data:t}=_r(),n=P(),{currentPath:r}=ln(),i=!ae(n.backend);return y({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await dr.searchConversations(e,t),enabled:!!t&&i,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:Gt(r)?!1:3e4,refetchIntervalInBackground:!1,meta:{backendId:n.backend.id}})},aa=(e=10)=>x({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function oa({onConfirm:e,onCancel:t,conversationTitle:n}){let{t:r}=w(`openhands`),i=n!=null&&n!==``?(0,Y.jsx)(C,{ns:`openhands`,i18nKey:R.CONVERSATION$ARCHIVE_WARNING_WITH_TITLE,values:{title:n},components:{title:(0,Y.jsx)(`span`,{className:`text-white`})}}):r(R.CONVERSATION$ARCHIVE_WARNING);return(0,Y.jsx)($t,{onClose:t,children:(0,Y.jsxs)(en,{className:`items-start border border-[var(--oh-border)]`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(an,{title:r(R.CONVERSATION$CONFIRM_ARCHIVE)}),(0,Y.jsx)(rn,{children:i})]}),(0,Y.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsx)(cn,{type:`button`,variant:`secondary`,onClick:t,testId:`cancel-button`,children:r(R.BUTTON$CANCEL)}),(0,Y.jsx)(cn,{type:`button`,variant:`primary`,onClick:e,testId:`confirm-button`,children:r(R.ACTION$CONFIRM_ARCHIVE)})]})]})})}function sa({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=w(`openhands`);return(0,Y.jsx)($t,{onClose:n,children:(0,Y.jsxs)(en,{testID:`confirm-new-conversation-modal`,children:[(0,Y.jsx)(an,{title:r(R.CONVERSATION$EXIT_WARNING)}),(0,Y.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,Y.jsx)(nn,{text:r(R.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,Y.jsx)(nn,{text:r(R.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}var ca=()=>{let e=v();return b({mutationFn:e=>dr.updateConversationTags(e.conversationId,e.tags),onMutate:async t=>{let n=[`user`,`conversation`,t.conversationId];await e.cancelQueries({queryKey:n}),await e.cancelQueries({queryKey:[`user`,`conversations`]});let r=e.getQueriesData({queryKey:n}),i=e.getQueryData([`user`,`conversations`]);return e.setQueriesData({queryKey:n},e=>e&&{...e,tags:t.tags}),e.setQueryData([`user`,`conversations`],e=>e?.map(e=>e.id===t.conversationId?{...e,tags:t.tags}:e)),{previousEntries:r,previousConversations:i}},onError:(t,n,r)=>{r?.previousEntries.forEach(([t,n])=>{e.setQueryData(t,n)}),r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`user`,`conversation`,r.conversationId]})}})},la=/^[a-z0-9]+$/;function ua(e,t){let n={};for(let[t,r]of Object.entries(e??{}))(lr.has(t.trim().toLowerCase())||typeof r!=`string`||r!==``&&r.trim().length===0)&&(n[t]=r);for(let[e,r]of t)n[e]=r;return n}function da({tags:e,onConfirm:t,onCancel:n}){let{t:r}=w(`openhands`),[i,a]=J.useState(()=>cr(e).map(([e,t])=>({key:e,value:t}))),[o,s]=J.useState(``),[c,l]=J.useState(``),[u,d]=J.useState(null),f=J.useRef(null),p=()=>{let e=o.trim(),t=c.trim();return la.test(e)?lr.has(e)?{errorKey:R.CONVERSATION$TAG_KEY_RESERVED}:i.some(t=>t.key===e)?{errorKey:R.CONVERSATION$TAG_KEY_DUPLICATE}:t.length>256?{errorKey:R.CONVERSATION$TAG_VALUE_INVALID}:{row:{key:e,value:t}}:{errorKey:R.CONVERSATION$TAG_KEY_INVALID}},m=()=>{let e=p();if(`errorKey`in e){d(e.errorKey);return}a(t=>[...t,e.row]),s(``),l(``),d(null),f.current?.focus()},h=e=>{e.key===`Enter`&&(e.preventDefault(),m())},g=e=>{a(t=>t.filter(t=>t.key!==e))};return(0,Y.jsx)($t,{onClose:n,children:(0,Y.jsxs)(en,{className:`items-start border border-[var(--oh-border)]`,testID:`edit-conversation-tags-modal`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(an,{title:r(R.CONVERSATION$EDIT_TAGS)}),(0,Y.jsx)(rn,{children:r(R.CONVERSATION$EDIT_TAGS_DESCRIPTION)})]}),(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,onClick:e=>e.stopPropagation(),children:[i.length>0?(0,Y.jsx)(`ul`,{className:`flex w-full flex-col gap-1`,"data-testid":`edit-tags-rows`,children:i.map(e=>(0,Y.jsxs)(`li`,{className:`flex items-center gap-2 rounded-md border border-[var(--oh-border)] px-2 py-1`,"data-testid":`edit-tag-row-${e.key}`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-white`,children:e.value?`${e.key}=${e.value}`:e.key}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":r(R.CONVERSATION$REMOVE_TAG),"data-testid":`remove-tag-${e.key}`,onClick:()=>g(e.key),className:`shrink-0 text-[var(--oh-muted)] hover:text-white`,children:(0,Y.jsx)(jt,{className:`h-3.5 w-3.5`,"aria-hidden":!0})})]},e.key))}):null,(0,Y.jsxs)(`div`,{className:`flex w-full items-center gap-2`,children:[(0,Y.jsx)(`input`,{type:`text`,value:o,placeholder:r(R.CONVERSATION$TAG_KEY_PLACEHOLDER),"aria-label":r(R.CONVERSATION$TAG_KEY_PLACEHOLDER),"data-testid":`new-tag-key-input`,ref:f,onChange:e=>s(e.target.value),onKeyDown:h,className:`w-28 shrink-0 rounded-md border border-[var(--oh-border)] bg-base-secondary px-2 py-1 text-xs text-white placeholder:text-[var(--oh-muted)]`}),(0,Y.jsx)(`input`,{type:`text`,value:c,placeholder:r(R.CONVERSATION$TAG_VALUE_PLACEHOLDER),"aria-label":r(R.CONVERSATION$TAG_VALUE_PLACEHOLDER),"data-testid":`new-tag-value-input`,onChange:e=>l(e.target.value),onKeyDown:h,className:`min-w-0 flex-1 rounded-md border border-[var(--oh-border)] bg-base-secondary px-2 py-1 text-xs text-white placeholder:text-[var(--oh-muted)]`}),(0,Y.jsx)(cn,{type:`button`,variant:`secondary`,onClick:m,testId:`add-tag-button`,children:r(R.BUTTON$ADD)})]}),u?(0,Y.jsx)(`p`,{role:`alert`,"data-testid":`edit-tags-error`,className:`text-xs text-red-400`,children:r(u)}):null]}),(0,Y.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsx)(cn,{type:`button`,variant:`secondary`,onClick:n,testId:`cancel-button`,children:r(R.BUTTON$CANCEL)}),(0,Y.jsx)(cn,{type:`button`,variant:`primary`,onClick:()=>{let n=o.trim()!==``||c.trim()!==``,r=i;if(n){let e=p();if(`errorKey`in e){d(e.errorKey);return}r=[...i,e.row]}t(ua(e,r.map(e=>[e.key,e.value])))},testId:`confirm-button`,children:r(R.BUTTON$SAVE)})]})]})})}function fa({titleMode:e,title:t,onSave:n,isConversationArchived:r}){return e===`edit`?(0,Y.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,Y.jsx)(`p`,{"data-testid":`conversation-card-title`,className:z(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),children:t})}var pa=e=>{switch(e){case L.FINISHED:return`check`;case L.RUNNING:return`working`;case L.IDLE:case L.WAITING_FOR_CONFIRMATION:return`active`;case L.PAUSED:return`paused`;case L.ERROR:case L.STUCK:return`error`;default:return`unknown`}},ma=(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 ha(e){switch(e){case`check`:return(0,Y.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,Y.jsx)(`path`,{d:`M2.5 6.5 5 9l4.5-5.5`})});case`working`:return(0,Y.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,Y.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,Y.jsx)(`span`,{"data-testid":`conversation-status-paused`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-muted)]`});case`error`:return(0,Y.jsx)(`span`,{"data-testid":`conversation-status-error`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-error)]`});default:return(0,Y.jsx)(`span`,{"data-testid":`conversation-status-unknown`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-color-tertiary)]`})}}function ga({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=w(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:pa(e),o=r(ma(a,i)),s=(0,Y.jsx)(`div`,{className:`w-2.5 h-2.5 flex items-center justify-center shrink-0`,children:i?(0,Y.jsx)(Lr,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):ha(a)});return n?(0,Y.jsx)(An,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function _a({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){let a=$n(i);return(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[r!==void 0&&(0,Y.jsx)(`div`,{className:`flex w-[18px] shrink-0 items-center justify-center`,children:(0,Y.jsx)(ga,{executionStatus:r,sandboxStatus:i,showTooltip:!1})}),(0,Y.jsx)(fa,{title:e,titleMode:t,onSave:n,isConversationArchived:a})]})}var va=e(r(),1);function ya({onClose:e,onDelete:t,onArchive:n,onUnarchive:r,onStop:i,onEdit:a,onEditTags:o,onDisplayCost:s,onShowAgentTools:c,onShowSkills:l,onDownloadViaVSCode:u,onDownloadConversation:d,position:f=`bottom`,floatingStyle:p,ignoreOutsideClickRef:m}){let{t:h}=w(`openhands`),{backend:g}=P(),_=Mr(e,m),v=g.kind===`cloud`?R.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:R.COMMON$STOP_CONVERSATION,y=(0,J.useCallback)((e,t,n)=>{let r=e.filter(e=>e!=null);return r.length>0?n?(0,Y.jsx)(J.Fragment,{children:r},t):(0,Y.jsxs)(J.Fragment,{children:[r,(0,Y.jsx)(Jn,{inset:`menu`})]},t):null},[]),b=p!=null;return(0,Y.jsxs)(Pt,{ref:_,testId:`context-menu`,style:b?p:void 0,theme:b?`popover`:`default`,position:b?`none`:f,alignment:b?`none`:`right`,spacing:b?`none`:`default`,className:b?`mt-0 min-w-[200px] w-max max-w-[min(280px,100vw-16px)]`:`z-[200] mt-0`,children:[y([a&&(0,Y.jsx)(K,{testId:`edit-button`,onClick:a,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(Br,{width:16,height:16}),text:h(R.BUTTON$RENAME)})},`edit-button`),o&&(0,Y.jsx)(K,{testId:`edit-tags-button`,onClick:o,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(ge,{className:`h-4 w-4`,"aria-hidden":!0}),text:h(R.CONVERSATION$EDIT_TAGS)})},`edit-tags-button`)],`edit-section`),y([c&&(0,Y.jsx)(K,{testId:`show-agent-tools-button`,onClick:c,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(qn,{width:16,height:16}),text:h(R.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})},`show-agent-tools-button`),l&&(0,Y.jsx)(K,{testId:`show-skills-button`,onClick:l,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(Vr,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:h(R.CONVERSATION$SHOW_SKILLS)})},`show-skills-button`)],`tools-section`),y([i&&(0,Y.jsx)(K,{testId:`stop-button`,onClick:i,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(Un,{width:16,height:16}),text:h(v)})},`stop-button`),u&&(0,Y.jsx)(K,{testId:`download-vscode-button`,onClick:u,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(kr,{width:16,height:16}),text:h(R.BUTTON$DOWNLOAD_VIA_VSCODE)})},`download-vscode-button`),d&&(0,Y.jsx)(K,{testId:`download-trajectory-button`,onClick:d,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(kr,{width:16,height:16}),text:h(R.BUTTON$DOWNLOAD_CONVERSATION_DATA)})},`download-trajectory-button`)],`control-section`),y([s&&(0,Y.jsx)(K,{testId:`display-cost-button`,onClick:s,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(et,{size:16}),text:h(R.BUTTON$DISPLAY_COST)})},`display-cost-button`),n&&(0,Y.jsx)(K,{testId:`archive-button`,onClick:n,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(ue,{className:`h-4 w-4`,"aria-hidden":!0}),text:h(R.COMMON$ARCHIVE_CONVERSATION)})},`archive-button`),r&&(0,Y.jsx)(K,{testId:`unarchive-button`,onClick:r,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(de,{className:`h-4 w-4`,"aria-hidden":!0}),text:h(R.COMMON$UNARCHIVE_CONVERSATION)})},`unarchive-button`),t&&(0,Y.jsx)(K,{testId:`delete-button`,onClick:t,children:(0,Y.jsx)(q,{icon:(0,Y.jsx)(Rr,{width:16,height:16}),text:h(R.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function ba({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onArchive:r,onUnarchive:i,onStop:a,onEdit:o,onEditTags:s,onDownloadViaVSCode:c,onDownloadConversation:l,executionStatus:u,conversationId:d,showOptions:f}){let{t:p}=w(`openhands`),m=ie(u),h=B(u),g=(0,J.useRef)(null),[,_]=(0,J.useReducer)(e=>e+1,0);(0,J.useLayoutEffect)(()=>{if(!e)return;_();let t=0,n=()=>{t||=window.requestAnimationFrame(()=>{t=0,_()})};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 v=(()=>{if(!e||!g.current)return;let t=g.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+320+8>r?Math.max(8,t.top-320-4):i+4,right:Math.max(8,n-a),zIndex:1e5}})(),y=typeof document<`u`?document.body:null;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(zr,{ref:g,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},ariaLabel:p(R.COMMON$MORE_OPTIONS),className:z(m&&`opacity-60`)}),e&&v&&y?(0,va.createPortal)((0,Y.jsx)(ya,{ignoreOutsideClickRef:g,floatingStyle:v,onClose:()=>t(!1),onDelete:n,onArchive:r,onUnarchive:i,onStop:h?a:void 0,onEdit:o,onEditTags:s,onDownloadViaVSCode:d&&f?c:void 0,onDownloadConversation:d?l:void 0,position:`bottom`}),y):null]})}var xa=`inline-flex max-w-full min-w-0 shrink-0 items-center gap-0.5 rounded-sm bg-[var(--oh-surface-raised)] px-1 py-px text-[10px] leading-4 text-[var(--oh-muted)]`,Sa=`inline-flex h-4 w-3 shrink-0 items-center justify-center [&_svg]:block`,Ca=`h-3 w-3`,wa=z(xa,`shrink`),Ta={bitbucket:Kr,bitbucket_data_center:Kr,github:Wr,gitlab:Gr};function Ea({selectedRepository:e}){let t=e.git_provider?Ta[e.git_provider]:null,n=e.selected_repository,r=e.selected_branch;return(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 overflow-hidden`,children:[n?(0,Y.jsxs)(`span`,{"data-testid":`conversation-card-selected-repository`,title:n,className:wa,children:[(t||e.git_provider===`azure_devops`)&&(0,Y.jsx)(`span`,{className:`inline-flex h-4 w-3 shrink-0 items-center justify-center [&_svg]:block`,"aria-hidden":!0,children:t?(0,Y.jsx)(t,{className:`h-3 w-3`}):(0,Y.jsx)(Zn,{className:`h-3 w-3`})}),(0,Y.jsx)(`span`,{className:`truncate leading-4`,children:n})]}):null,r?(0,Y.jsxs)(`span`,{"data-testid":`conversation-card-selected-branch`,title:r,className:wa,children:[(0,Y.jsx)(`span`,{className:Sa,"aria-hidden":!0,children:(0,Y.jsx)(Ir,{className:Ca})}),(0,Y.jsx)(`span`,{className:`truncate leading-4`,children:r})]}):null]})}function Da({workspaceWorkingDir:e}){let{t}=w(`openhands`),n=e?vr(e).trim():``;return n?(0,Y.jsxs)(`span`,{"data-testid":`conversation-card-workspace-folder`,className:xa,title:e??void 0,children:[(0,Y.jsx)(`span`,{className:Sa,"aria-hidden":!0,children:(0,Y.jsx)(lt,{className:Ca})}),(0,Y.jsx)(`span`,{className:`truncate leading-4`,children:n})]}):(0,Y.jsxs)(`span`,{"data-testid":`conversation-card-no-repository`,className:xa,children:[(0,Y.jsx)(`span`,{className:Sa,"aria-hidden":!0,children:(0,Y.jsx)(yr,{className:Ca})}),(0,Y.jsx)(`span`,{className:`truncate leading-4`,children:t(R.COMMON$NO_REPOSITORY)})]})}function Oa(e){switch(e.trim().toLowerCase()){case`git_provider`:return`git`;case`repo_name`:case`repo`:case`repository`:return`repo`;case`selected_branch`:case`branch`:return`branch`;case`archiveworkspacepath`:case`workspace`:case`working_dir`:return`workspace`;case`appmode`:case`app_mode`:case`mode`:return`app_mode`;case`worktools`:case`work_tools`:case`tools`:return`work_tools`;case`workwsid`:case`work_wsid`:case`wsid`:case`workspace_id`:return`work_wsid`;default:return`other`}}function ka(e){let t=e.trim();if(!t)return t;let n=t.replace(/[_-]+/g,` `).replace(/\s+/g,` `);return n.charAt(0).toUpperCase()+n.slice(1)}function Aa(e,t){switch(Oa(e)){case`git`:return t(R.CONVERSATION_PANEL$PREVIEW_GIT);case`repo`:return t(R.CONVERSATION_PANEL$PREVIEW_REPO);case`branch`:return t(R.CONVERSATION_PANEL$PREVIEW_BRANCH);case`workspace`:return t(R.CONVERSATION_PANEL$PREVIEW_WORKSPACE);case`app_mode`:return t(R.CONVERSATION_PANEL$PREVIEW_APP_MODE);case`work_tools`:return t(R.CONVERSATION_PANEL$PREVIEW_WORK_TOOLS);case`work_wsid`:return t(R.CONVERSATION_PANEL$PREVIEW_WORK_WSID);default:return ka(e)}}function ja(e,t,n){let r=Aa(e,n);return t?`${r}: ${t}`:r}function Ma(e,t=14){let n=Array.from(e);return n.length<=t?e:t<=1?`…`:`${n.slice(0,t-1).join(``)}…`}function Na(e,t,n={}){let r=n.gapPx??4,i=n.overflowWidthPx??36;if(e.length===0)return 0;if(t<=0)return e.length;let a=0;for(let n=0;n<e.length;n+=1){let o=e[n],s=n>0?r:0,c=e.length-n-1>0?i+r:0;if(a+s+o+c>t)return n;a+=s+o}return e.length}var Pa=new Set([`origin`,`source`,`git_provider`]),Fa=new Set([`appmode`,`app_mode`,`mode`]),Ia={origin:H,source:xe,git_provider:Wr,owner:ce,user:ce,author:ce,assignee:ce,env:Ne,environment:Ne,repo:ze,repository:ze,repo_name:ze,branch:$e,selected_branch:$e,archiveworkspacepath:lt,workspace:lt,working_dir:lt,team:Oe,org:we,organization:we,channel:Me,email:Ee,automation:Ft,webhook:Ae,agent:Ie,project:_e,ticket:Se,issue:Se,pr:mt,pull_request:mt,priority:Pe,status:he,id:xt,integration:Dt,appmode:be,app_mode:be,mode:be,worktools:ht,work_tools:ht,tools:ht,workwsid:V,work_wsid:V,wsid:V,workspace_id:V},La={slack:qr,discord:ye,github:Wr,gitlab:Gr,bitbucket:Kr,bitbucket_data_center:Kr,azure_devops:$e,email:Ee,mail:Ee,api:Dt,webhook:Ae,automation:Ft,review:mt,linear:_e,web:se,ui:se,canvas:se},Ra={work:oe,personal:gt,home:gt,private:gt};function za(e,t){let n=e.trim().toLowerCase(),r=t.trim().toLowerCase();return Pa.has(n)?La[r]??Ia[n]??U:Fa.has(n)?Ra[r]??Ia[n]??be:Ia[n]??U}function Ba({icon:e,keyName:t,testId:n}){return(0,Y.jsx)(`span`,{className:Sa,"aria-hidden":!0,children:(0,Y.jsx)(e,{"data-testid":n,"data-tag-key":t,"aria-hidden":!0,className:Ca})})}function Va({icon:e,keyName:t,value:n,iconTestId:r}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ba,{icon:e,keyName:t,testId:r}),(0,Y.jsx)(`span`,{className:`truncate leading-4`,children:Ma(n||t)})]})}function Ha({tags:e}){let{t}=w(`openhands`),n=J.useRef(null),r=J.useRef(null),i=J.useRef(null),a=J.useRef(null),[o,s]=J.useState(e.length),[c,l]=J.useState(!1),[u,d]=J.useState(null),f=J.useCallback(()=>{let e=n.current,t=r.current;!e||!t||s(Na(Array.from(t.children).map(e=>e.offsetWidth),e.clientWidth))},[]),p=J.useCallback(()=>{let e=i.current;if(!e)return;let t=e.getBoundingClientRect(),n=t.left;n+256>window.innerWidth-8&&(n=Math.max(8,window.innerWidth-8-256)),d({top:t.bottom+4,left:n})},[]),m=e.map(([e,t])=>`${e}=${t}`).join(``),h=J.useRef(null);if(J.useLayoutEffect(()=>{h.current!==m&&(h.current=m,l(!1),f())},[m,f]),J.useEffect(()=>{let e=n.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>f());return t.observe(e),()=>t.disconnect()},[f]),J.useLayoutEffect(()=>{if(!c){d(null);return}return p(),window.addEventListener(`resize`,p),window.addEventListener(`scroll`,p,!0),()=>{window.removeEventListener(`resize`,p),window.removeEventListener(`scroll`,p,!0)}},[c,p]),J.useEffect(()=>{if(!c)return;let e=e=>{let t=e.target;i.current?.contains(t)||a.current?.contains(t)||l(!1)},t=e=>{e.key===`Escape`&&l(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[c]),e.length===0)return null;let g=Math.max(0,e.length-o),_=e.slice(0,o),v=e.slice(o),y=e=>{e.stopPropagation()};return(0,Y.jsxs)(`div`,{"data-testid":`conversation-card-tag-chips`,className:`relative min-w-0 w-full`,children:[(0,Y.jsx)(`div`,{ref:r,"aria-hidden":!0,className:`pointer-events-none fixed top-0 -left-[10000px] z-[-1] flex flex-nowrap items-center gap-1 opacity-0`,children:e.map(([e,t])=>(0,Y.jsx)(`span`,{className:xa,children:(0,Y.jsx)(Va,{icon:za(e,t),keyName:e,value:t})},e))}),(0,Y.jsxs)(`div`,{ref:n,"data-testid":`conversation-card-tag-row`,className:`flex w-full min-w-0 max-w-full flex-nowrap items-center gap-1 overflow-hidden`,children:[_.map(([e,n])=>(0,Y.jsx)(`span`,{"data-testid":`conversation-card-tag-chip`,title:ja(e,n,t),className:xa,children:(0,Y.jsx)(Va,{icon:za(e,n),keyName:e,value:n,iconTestId:`conversation-card-tag-chip-icon`})},e)),g>0?(0,Y.jsxs)(`button`,{ref:i,type:`button`,"data-testid":`conversation-card-tag-overflow`,"aria-expanded":c,"aria-haspopup":`dialog`,"aria-label":t(R.CONVERSATION$TAGS_OVERFLOW_ARIA,{count:g}),onMouseDown:y,onClick:e=>{e.preventDefault(),e.stopPropagation(),l(e=>!e)},className:z(xa,`shrink-0 self-center hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--foreground)]`),children:[(0,Y.jsx)(`span`,{className:`inline-flex h-4 w-0 shrink-0`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`leading-4`,children:`+${g}`})]}):null]}),c&&u&&typeof document<`u`&&(0,va.createPortal)((0,Y.jsx)(`div`,{ref:a,role:`dialog`,"data-testid":`conversation-card-tag-overflow-popover`,className:z(`z-[9999] min-w-[10rem] max-w-[16rem]`,`rounded-md border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface)] p-2 shadow-lg`),style:{position:`fixed`,top:u.top,left:u.left},onMouseDown:y,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,Y.jsx)(`dl`,{className:`m-0 flex flex-col gap-1`,children:v.map(([e,n])=>(0,Y.jsxs)(`div`,{"data-testid":`conversation-card-tag-overflow-row`,className:`grid grid-cols-[minmax(0,auto)_minmax(0,1fr)] gap-x-2 text-[10px] leading-4`,children:[(0,Y.jsxs)(`dt`,{className:`m-0 inline-flex min-w-0 items-center gap-1 whitespace-normal break-words text-[var(--oh-muted)]`,children:[(0,Y.jsx)(Ba,{icon:za(e,n)}),(0,Y.jsx)(`span`,{className:`min-w-0 whitespace-normal break-words leading-4`,children:Aa(e,t)})]}),(0,Y.jsx)(`dd`,{className:`m-0 whitespace-normal break-words text-left leading-4 text-[var(--foreground)]`,title:n,children:n})]},e))})}),document.body)]})}function Ua({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,tags:d=null,showTags:f=!1,isArchived:p=!1}){let{t:m}=w(`openhands`),h=Lt(),g=ie(r),_=null;if(c)if(l===`acp`){let e=fr(u)??m(R.CONVERSATION$ACP_AGENT_GENERIC),t=mr(u,s),n=t??e;_={kind:pr(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(_={kind:`openhands`,text:Hr(s,h)??s,tooltip:s});let v=r===void 0?void 0:`pl-[26px]`,y=f?cr(d):[];return(0,Y.jsxs)(`div`,{className:z(`flex flex-col gap-0.5 mt-0.5 w-full min-w-0`,g&&`opacity-60`),children:[(0,Y.jsxs)(`div`,{className:z(`flex flex-row items-center gap-2 w-full min-w-0`,a&&v),children:[a&&(e?.selected_repository?(0,Y.jsx)(Ea,{selectedRepository:e}):(0,Y.jsx)(Da,{workspaceWorkingDir:i})),(0,Y.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 ml-auto`,children:o&&(n??t)&&(0,Y.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] text-right`,children:(0,Y.jsx)(`time`,{children:`${Fr(t??n)} ${m(R.CONVERSATION$AGO)}`})})})]}),_?(0,Y.jsx)(`div`,{className:v,children:(0,Y.jsxs)(`span`,{"data-testid":`conversation-card-agent-chip`,className:xa,title:_.tooltip,children:[(0,Y.jsx)(`span`,{className:`inline-flex h-4 shrink-0 items-center justify-center [&_svg]:block`,"aria-hidden":!0,children:(0,Y.jsx)(Ur,{kind:_.kind,size:12})}),(0,Y.jsx)(`span`,{className:`truncate leading-4`,children:_.text})]})}):null,p?(0,Y.jsx)(`div`,{className:v,children:(0,Y.jsx)(`span`,{"data-testid":`conversation-card-archived-chip`,className:xa,children:m(R.COMMON$ARCHIVED)})}):null,y.length>0?(0,Y.jsx)(`div`,{className:v,children:(0,Y.jsx)(Ha,{tags:y})}):null]})}function Wa(){let{t:e}=w(`openhands`);return(0,Y.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,Y.jsx)(Yn,{className:`text-white w-3 h-3`}),(0,Y.jsx)(`span`,{children:e(R.COMMON$ERROR)})]})}function Ga({onClick:e,onDelete:t,onArchive:n,onUnarchive:r,onStop:i,onChangeTitle:a,onEditTags:o,showOptions:s,title:c,selectedRepository:l,lastUpdatedAt:u,createdAt:d,conversationId:f,executionStatus:p,sandboxStatus:m,contextMenuOpen:h=!1,onContextMenuToggle:g,isActive:_=!1,workspaceWorkingDir:v,showRepositoryMetadata:y=!0,llmModel:b=null,showLlmProfiles:x=!1,agentKind:S=null,acpServer:C=null,tags:T=null,showTags:E=!1,isArchived:D=!1,isPinned:O=!1,onTogglePin:k,alwaysShowPinIcon:A=!1}){let{t:j}=w(`openhands`),{trackDownloadVsCodeButtonClicked:M}=Jt(),[N,P]=J.useState(`view`),{mutateAsync:ee}=Hn(),te=cr(T),ne=te.length>0,F=E&&ne,I=e=>{e!==``&&e!==c&&a?.(e),P(`view`)},re=e=>{e.preventDefault(),e.stopPropagation(),t?.(),g?.(!1)},L=e=>{e.preventDefault(),e.stopPropagation(),n?.(),g?.(!1)},ie=e=>{e.preventDefault(),e.stopPropagation(),r?.(),g?.(!1)},B=e=>{e.preventDefault(),e.stopPropagation(),i?.(),g?.(!1)},ae=e=>{e.preventDefault(),e.stopPropagation(),P(`edit`),g?.(!1)},oe=e=>{e.preventDefault(),e.stopPropagation(),o?.(),g?.(!1)},se=async e=>{if(e.preventDefault(),e.stopPropagation(),M(),f)try{let e=await br.getVSCodeUrl(f);if(e.vscode_url){let t=Cr(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}g?.(!1)},ce=async e=>{e.preventDefault(),e.stopPropagation(),f&&await ee(f),g?.(!1)},le=e=>{e.preventDefault(),e.stopPropagation(),k?.()},ue=()=>(0,Y.jsx)(`button`,{type:`button`,"data-testid":f?`conversation-pin-toggle-${f}`:`conversation-pin-toggle`,"aria-pressed":O,"aria-label":j(O?R.CONVERSATION_PANEL$UNPIN_CONVERSATION:R.CONVERSATION_PANEL$PIN_CONVERSATION),onClick:le,className:z(`flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1`,`text-[var(--oh-muted)] hover:bg-white/10 hover:text-white`),children:(0,Y.jsx)(Et,{className:z(`h-3.5 w-3.5`,O&&`fill-current`),"aria-hidden":!0})}),de=!!(t||n||r||a||o||s),fe=de||!!k,pe=A&&O&&!!k,me=y||D||x&&(S===`acp`||!!b)||F&&te.length>0;return(0,Y.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":h.toString(),"data-active":_?`true`:`false`,onClick:e,className:z(`group relative h-auto w-full cursor-pointer rounded-md py-1 pl-2 pr-1 transition-colors`,!h&&`hover:bg-[var(--oh-surface)]`,(_||h)&&`bg-[var(--oh-surface)]`),children:[(0,Y.jsxs)(`div`,{className:`flex items-center w-full min-w-0`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[(0,Y.jsx)(_a,{title:c,titleMode:N,onTitleSave:I,executionStatus:p,sandboxStatus:m}),m===`ERROR`&&(0,Y.jsx)(Wa,{})]}),(0,Y.jsxs)(`div`,{"data-testid":`conversation-card-trailing-slot`,className:z(`relative ml-auto pl-2 flex items-center justify-end shrink-0`,pe?`min-w-[3.75rem]`:fe&&wn(h)),children:[!pe&&(d??u)&&(0,Y.jsx)(`p`,{className:z(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,fe&&Cn(h)),children:(0,Y.jsx)(`time`,{children:Fr(u??d)})}),fe?(0,Y.jsxs)(`div`,{"data-testid":`conversation-card-hover-actions`,className:z(`absolute right-0 top-1/2 flex -translate-y-1/2 items-center gap-0.5 transition-opacity`,pe?`pointer-events-auto visible opacity-100`:Tn(h)),children:[k?ue():null,pe&&(d??u)&&de?(0,Y.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,Y.jsx)(`div`,{className:Tn(h),children:(0,Y.jsx)(ba,{contextMenuOpen:h,onContextMenuToggle:g||(()=>{}),onDelete:t&&re,onArchive:n&&L,onUnarchive:r&&ie,onStop:i&&B,onEdit:a&&ae,onEditTags:o&&oe,onDownloadViaVSCode:se,onDownloadConversation:ce,executionStatus:p,conversationId:f,showOptions:s})}),(0,Y.jsx)(`p`,{className:z(`pointer-events-none absolute inset-0 items-center justify-end`,`text-xs text-[var(--oh-muted)] whitespace-nowrap -translate-x-1.5`,Dn(h)),children:(0,Y.jsx)(`time`,{children:Fr(u??d)})})]}):null,!pe&&de?(0,Y.jsx)(ba,{contextMenuOpen:h,onContextMenuToggle:g||(()=>{}),onDelete:t&&re,onArchive:n&&L,onUnarchive:r&&ie,onStop:i&&B,onEdit:a&&ae,onEditTags:o&&oe,onDownloadViaVSCode:se,onDownloadConversation:ce,executionStatus:p,conversationId:f,showOptions:s}):null]}):null]})]}),me&&(0,Y.jsx)(Ua,{selectedRepository:l,lastUpdatedAt:u,createdAt:d,executionStatus:p,workspaceWorkingDir:v,showRepositoryMetadata:y,showTimestamp:!1,llmModel:b,showAgentChip:x,agentKind:S,acpServer:C,tags:T,showTags:F,isArchived:D})]})}var Ka={bitbucket:Kr,bitbucket_data_center:Kr,github:Wr,gitlab:Gr};function qa({label:e,children:t}){return(0,Y.jsxs)(`div`,{className:`flex items-start gap-2 text-xs leading-4`,children:[(0,Y.jsx)(`span`,{className:`w-20 shrink-0 whitespace-normal break-words text-[var(--oh-muted)]`,children:e}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 overflow-visible whitespace-normal break-words text-[var(--oh-foreground)]`,children:t})]})}function Ja({icon:e,children:t,testId:n,tagKey:r}){return(0,Y.jsxs)(`span`,{"data-testid":n,"data-tag-key":r,className:`inline-flex min-w-0 max-w-full items-start gap-1.5`,children:[e?(0,Y.jsx)(`span`,{className:`inline-flex h-4 min-w-3 shrink-0 items-center justify-center [&_svg]:block`,children:e}):null,(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-normal break-all`,children:t})]})}function Ya({title:e,executionStatus:t,sandboxStatus:n,selectedRepository:r,workspaceWorkingDir:i,llmModel:a,agentKind:o=null,acpServer:s=null,createdAt:c,tags:l=null}){let{t:u}=w(`openhands`),d=r?.selected_repository??null,f=r?.selected_branch??null,p=r?.git_provider??null,m=p?Ka[p]:null,h=c?new Date(c).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null,g=cr(l);return(0,Y.jsxs)(`div`,{"data-testid":`conversation-card-preview`,className:`flex w-[280px] max-w-[min(280px,90vw)] flex-col gap-3 overflow-visible p-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start gap-2`,children:[t===void 0?null:(0,Y.jsx)(`span`,{className:`inline-flex h-5 w-2.5 shrink-0 items-center justify-center`,children:(0,Y.jsx)(ga,{executionStatus:t,sandboxStatus:n,showTooltip:!1})}),(0,Y.jsx)(`span`,{className:`break-words text-sm font-medium leading-5 text-white`,children:e})]}),(0,Y.jsxs)(`dl`,{className:`flex flex-col gap-1.5`,children:[d?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(qa,{label:u(R.CONVERSATION_PANEL$PREVIEW_REPO),children:(0,Y.jsx)(Ja,{icon:m?(0,Y.jsx)(m,{size:12}):p===`azure_devops`?(0,Y.jsx)(Zn,{className:`h-3 w-3`}):void 0,children:d})}),f?(0,Y.jsx)(qa,{label:u(R.CONVERSATION_PANEL$PREVIEW_BRANCH),children:(0,Y.jsx)(Ja,{icon:(0,Y.jsx)(Ir,{size:11}),children:f})}):null]}):i?(0,Y.jsx)(qa,{label:u(R.CONVERSATION_PANEL$PREVIEW_DIRECTORY),children:(0,Y.jsx)(Ja,{icon:(0,Y.jsx)(lt,{size:12}),children:i})}):null,a?(0,Y.jsx)(qa,{label:u(R.CONVERSATION_PANEL$PREVIEW_MODEL),children:(0,Y.jsx)(Ja,{testId:`conversation-card-preview-model`,icon:(0,Y.jsx)(Ur,{kind:o===`acp`?pr(s):`openhands`,size:12}),children:a})}):null,g.map(([e,t])=>{let n=za(e,t);return(0,Y.jsx)(qa,{label:Aa(e,u),children:(0,Y.jsx)(Ja,{testId:`conversation-card-preview-tag-row`,tagKey:e,icon:(0,Y.jsx)(n,{"aria-hidden":!0,className:`h-3 w-3`}),children:t||`—`})},e)}),h?(0,Y.jsx)(qa,{label:u(R.CONVERSATION$CREATED),children:h}):null]})]})}function Xa({taskStatus:e}){return(0,Y.jsx)(`div`,{className:z(`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 Za({taskStatus:e}){let{t}=w(`openhands`);return e===`WORKING`?null:(0,Y.jsx)(`span`,{className:z(`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(re(e))})}function Qa({title:e,taskStatus:t}){return(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden mr-2`,children:[(0,Y.jsx)(`div`,{className:`flex items-center`,children:(0,Y.jsx)(Xa,{taskStatus:t})}),(0,Y.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,Y.jsx)(Za,{taskStatus:t})]})}function $a({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=w(`openhands`);return(0,Y.jsxs)(`div`,{className:z(`flex flex-col gap-1 mt-1`),children:[(0,Y.jsxs)(`div`,{className:`flex flex-row justify-between items-center`,children:[e?(0,Y.jsx)(Ea,{selectedRepository:e}):(0,Y.jsx)(Da,{}),t&&(0,Y.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,Y.jsx)(`time`,{children:`${Fr(t)} ${r(R.CONVERSATION$AGO)}`})})]}),n&&(0,Y.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function eo({task:e,onClick:t}){let{t:n}=w(`openhands`),r=e.request.title||e.detail||n(R.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,Y.jsxs)(`div`,{"data-testid":`start-task-card`,onClick:t,className:z(`relative h-auto w-full p-3.5 border-b border-[var(--oh-border)] cursor-pointer`,`hover:bg-tertiary`),children:[(0,Y.jsx)(`div`,{className:`flex items-center justify-between w-full`,children:(0,Y.jsx)(Qa,{title:r,taskStatus:e.status})}),(0,Y.jsx)($a,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function to({compact:e=!1}){return e?(0,Y.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,Y.jsx)(`div`,{className:`h-1.5 w-7 shrink-0 skeleton`},`conversation-skeleton-compact-${e}`))}):(0,Y.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,Y.jsx)(`div`,{className:`h-6 min-h-6 w-full skeleton`},`conversation-skeleton-row-${e}`))})}function no({conversationId:e,title:t,selectedRepository:n,executionStatus:r,sandboxStatus:a,lastUpdatedAt:o,createdAt:s,workspaceWorkingDir:c,isActive:l=!1,onClose:u,showRepositoryMetadata:d=!0,llmModel:f=null,showLlmProfiles:p=!1,agentKind:m=null,acpServer:h=null,tags:g=null,showTags:_=!1}){let{t:v}=w(`openhands`),y=Xn();return(0,Y.jsx)(i,{content:(0,Y.jsxs)(`div`,{className:`w-[260px] p-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,Y.jsx)(ga,{executionStatus:r,sandboxStatus:a,showTooltip:!1}),(0,Y.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||v(R.CONVERSATION$UNTITLED)})]}),(0,Y.jsx)(Ua,{selectedRepository:n,lastUpdatedAt:o,createdAt:s,executionStatus:r,workspaceWorkingDir:c,showRepositoryMetadata:d,llmModel:f,showAgentChip:p,agentKind:m,acpServer:h,tags:g,showTags:_})]}),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,Y.jsx)(fn,{to:y(`/conversations/${e}`),onClick:u,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>z(`flex items-center justify-center w-10 h-9 mx-auto rounded-md`,`transition-colors cursor-pointer`,e||l?`bg-tertiary`:`hover:bg-[var(--oh-surface-raised)]`),children:(0,Y.jsx)(ga,{executionStatus:r,sandboxStatus:a,showTooltip:!1})})})}var ro=[`1h`,`1d`,`7d`,`30d`],io={"1h":3600*1e3,"1d":1440*60*1e3,"7d":10080*60*1e3,"30d":720*60*60*1e3};function ao(e){return typeof e==`string`&&ro.includes(e)}function oo(e,t,n=Date.now()){let r=n-t,i=[],a=[];for(let t of e){let e=t.updated_at?Date.parse(t.updated_at):NaN;Number.isFinite(e)&&e<r?a.push(t):i.push(t)}return{recent:i,older:a}}function so(e,t,n){if(!t)return[...e];let r=e.filter(e=>t.has(e.id));if(n!=null&&!r.some(e=>e.id===n)){let t=e.find(e=>e.id===n);t&&r.push(t)}return r}function co(e,t){let n=t.limit??5,r=so(e,t.discoveryConversationIds,t.activeConversationId),i;if(r.length<=n)i=r;else{let e=t.activeConversationId==null?-1:r.findIndex(e=>e.id===t.activeConversationId);i=e>=n?[...r.slice(0,n-1),r[e]]:r.slice(0,n)}let a=i.length<e.length;return t.expanded?{visibleConversations:[...e],isPreviewTruncated:a,isShowingAll:!0}:{visibleConversations:i,isPreviewTruncated:a,isShowingAll:!a}}function lo(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>n.get(e)).filter(e=>e!=null)}function uo(e,t){if(t.length===0)return[...e];let n=new Set(t);return e.filter(e=>!n.has(e.id))}var fo=`__unnamed__`;function po(e){if(e.trigger===`automation`)return!0;let t=e.tags;return t?ur.some(e=>!!t[e]):!1}function mo(e){return e.tags?.automationname?.trim()||`__unnamed__`}function ho(e){let t=new Set,n=!1;for(let r of e){if(!po(r))continue;let e=mo(r);e===`__unnamed__`?n=!0:t.add(e)}let r=[...t].sort((e,t)=>e.localeCompare(t));return n&&r.push(fo),r}function go(e,t,n,r){if(t===`all`)return[...e];if(t===`hide-automations`)return e.filter(e=>!po(e));let i=new Set(r),a=n.filter(e=>i.has(e)),o=a.length>0?new Set(a):null;return e.filter(e=>po(e)?o===null||o.has(mo(e)):!1)}function _o(e){let t=new Set;for(let n of e)for(let[e,r]of cr(n.tags))t.add(`${e}=${r}`);return[...t].sort((e,t)=>e.localeCompare(t))}function vo(e){return e.endsWith(`=`)?e.slice(0,-1):e}function yo(e,t,n){let r=new Set(n),i=t.filter(e=>r.has(e));if(i.length===0)return[...e];let a=new Set(i);return e.filter(e=>cr(e.tags).some(([e,t])=>a.has(`${e}=${t}`)))}function bo(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 xo(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function So(e,t){let n=t===`created`?`created_at`:`updated_at`;return[...e].sort((e,t)=>xo(t[n])-xo(e[n]))}function Co(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 wo(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 To(e,t){return t===`local`?Co(e):wo(e)}function Eo(e,t,n,r){let i=e.map(e=>({conversationId:e.id,groupId:To(e,n).id,page:t.get(e.id)??0})),a=new Map;for(let{groupId:e,page:t}of i){let n=a.get(e);(n===void 0||t<n)&&a.set(e,t)}let o=new Set;for(let{conversationId:e,groupId:t,page:n}of i)n===a.get(t)&&o.add(e);let s=r?.forceIncludeConversationId;return s!=null&&e.some(e=>e.id===s)&&o.add(s),o}function Do(e,t,n,r,i){let a=new Map;if(t===`local`&&i)for(let e of i){let t=e.path.trim().replace(/\/+$/,``);t&&a.set(`ws:${t}`,{label:e.name,conversations:[]})}for(let n of e){let{id:e,label:i}=To(n,t),o=e===`__none_workspace`?r.emptyWorkspace:e===`__none_repo`?r.emptyRepository:i,s=a.get(e);s?s.conversations.push(n):a.set(e,{label:o,conversations:[n]})}let o=[...a.entries()].map(([e,r])=>{let i=So(r.conversations,n);return{id:e,label:r.label,conversations:i,launch:bo(e,t,i)}}),s=e=>e.conversations.reduce((e,t)=>Math.max(e,xo(n===`created`?t.created_at:t.updated_at)),0);return o.sort((e,t)=>s(t)-s(e)),o}function Oo(e,t){if(t.length===0)return[...e];let n=new Map(e.map(e=>[e.id,e])),r=[],i=new Set;for(let e of t){let t=n.get(e);t&&(r.push(t),i.add(e))}for(let t of e)i.has(t.id)||r.push(t);return r}function ko(e,t,n,r,i=`after`){if(n===r)return[...e];let a=Oo(t.map(e=>({id:e})),e).map(e=>e.id),o=a.indexOf(n),s=a.indexOf(r);if(o<0||s<0)return[...e];let c=[...a];c.splice(o,1);let l=c.indexOf(r),u=i===`before`?l:l+1;return c.splice(u,0,n),c}var Ao={organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`,showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!1,showTagsMetadata:!0,showHoverMetadata:!0},jo={...Ao,olderConversationCutoff:`7d`,showArchivedConversations:!1,automationFilterMode:`all`,selectedAutomationNames:[],selectedTagFacets:[],groupFolderOrder:[]},X=Rt()(rr(e=>({...jo,setShowOlderConversations:t=>e(()=>({showOlderConversations:t})),toggleShowOlderConversations:()=>e(e=>({showOlderConversations:!e.showOlderConversations})),setOlderConversationCutoff:t=>e(()=>({olderConversationCutoff:ao(t)?t:`7d`})),setShowArchivedConversations:t=>e(()=>({showArchivedConversations:t})),toggleShowArchivedConversations:()=>e(e=>({showArchivedConversations:!e.showArchivedConversations})),setShowRepoBranchMetadata:t=>e(()=>({showRepoBranchMetadata:t})),toggleShowRepoBranchMetadata:()=>e(e=>({showRepoBranchMetadata:!e.showRepoBranchMetadata})),setShowLlmProfiles:t=>e(()=>({showLlmProfiles:t})),toggleShowLlmProfiles:()=>e(e=>({showLlmProfiles:!e.showLlmProfiles})),setShowTagsMetadata:t=>e(()=>({showTagsMetadata:t})),toggleShowTagsMetadata:()=>e(e=>({showTagsMetadata:!e.showTagsMetadata})),setShowHoverMetadata:t=>e(()=>({showHoverMetadata:t})),toggleShowHoverMetadata:()=>e(e=>({showHoverMetadata:!e.showHoverMetadata})),setOrganizeMode:t=>e(()=>({organizeMode:t})),setConversationSort:t=>e(()=>({conversationSort:t})),setThreadScope:t=>e(()=>({threadScope:t})),setAutomationFilterMode:t=>e(e=>({automationFilterMode:t,selectedAutomationNames:t===`only-automations`?e.selectedAutomationNames:[]})),toggleAutomationName:t=>e(e=>({selectedAutomationNames:e.selectedAutomationNames.includes(t)?e.selectedAutomationNames.filter(e=>e!==t):[...e.selectedAutomationNames,t]})),clearFilterSelections:()=>e(()=>({selectedTagFacets:[],selectedAutomationNames:[]})),toggleTagFacet:t=>e(e=>({selectedTagFacets:e.selectedTagFacets.includes(t)?e.selectedTagFacets.filter(e=>e!==t):[...e.selectedTagFacets,t]})),setGroupFolderOrder:t=>e(()=>({groupFolderOrder:[...t]})),applyLayoutSettings:t=>e(()=>({...t}))}),{name:`conversation-panel-preferences`,storage:ir(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,olderConversationCutoff:ao(e.olderConversationCutoff)?e.olderConversationCutoff:`7d`,showArchivedConversations:e.showArchivedConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,showTagsMetadata:e.showTagsMetadata,showHoverMetadata:e.showHoverMetadata,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope,automationFilterMode:e.automationFilterMode,selectedAutomationNames:e.selectedAutomationNames,selectedTagFacets:e.selectedTagFacets,groupFolderOrder:e.groupFolderOrder})})),Mo=`px-2 pb-1 pt-1`,No=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function Po({children:e,suffix:t}){return t==null?(0,Y.jsx)(`div`,{role:`presentation`,className:z(Mo,No),children:e}):(0,Y.jsxs)(`div`,{role:`presentation`,className:z(`flex items-baseline justify-between gap-2`,Mo),children:[(0,Y.jsx)(`span`,{className:z(`min-w-0 truncate text-left`,No),children:e}),t]})}function Z({icon:e,label:t,sublabel:n,selected:r,onClick:i,testId:a,disabled:o,destructive:s,variant:c=`radio`}){return(0,Y.jsxs)(`button`,{type:`button`,role:r===void 0?`menuitem`:c===`toggle`?`menuitemcheckbox`:`menuitemradio`,"aria-checked":r===void 0?void 0:!!r,"data-testid":a,disabled:o,onClick:i,className:z(`group`,Ln,`disabled:opacity-50`,s?`text-danger`:`text-[var(--oh-foreground)]`),children:[(0,Y.jsx)(e,{className:z(`h-3.5 w-3.5`,Fn,s&&`text-danger group-hover:text-danger group-focus-visible:text-danger`),"aria-hidden":!0}),(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`span`,{className:`block truncate`,children:t}),n?(0,Y.jsx)(`span`,{className:`block truncate text-[10px] text-[var(--oh-muted)]/70`,children:n}):null]}),r===void 0?null:c===`toggle`?(0,Y.jsx)(Jr,{enabled:!!r,size:`sm`,className:`ml-auto`}):r?(0,Y.jsx)(Le,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}var Fo=e=>(0,Y.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,Y.jsx)(`mask`,{id:`mask0_18339_1445`,style:{maskType:`luminance`},maskUnits:`userSpaceOnUse`,x:1,y:1,width:18,height:18,children:(0,Y.jsx)(`path`,{d:`M19 1H1V19H19V1Z`,fill:`white`})}),(0,Y.jsxs)(`g`,{mask:`url(#mask0_18339_1445)`,children:[(0,Y.jsx)(`path`,{d:`M10 18.1818V16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M10 1.81836V3.45472`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M1.81824 10H3.4546`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M18.1818 10H16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M5.93359 17.1019L6.74359 15.6782`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M14.0663 2.89844L13.2563 4.32208`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M2.89819 5.93359L4.32183 6.74359`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M17.1019 14.0663L15.6782 13.2563`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M5.92542 2.90625L6.7436 4.3217`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M14.0909 17.0854L13.2727 15.6699`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M17.0855 5.90918L15.67 6.72736`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M2.91455 14.0911L4.33001 13.2729`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Y.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,Y.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`})]})]}),Io={"1h":R.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR,"1d":R.CONVERSATION_PANEL$OLDER_OVER_ONE_DAY,"7d":R.CONVERSATION_PANEL$OLDER_OVER_ONE_WEEK,"30d":R.CONVERSATION_PANEL$OLDER_OVER_THIRTY_DAYS};function Lo(){let{t:e}=w(`openhands`),t=X(e=>e.showOlderConversations),n=X(e=>e.olderConversationCutoff),r=X(e=>e.toggleShowOlderConversations),i=X(e=>e.setOlderConversationCutoff),a=!t,o=ao(n)?n:`7d`;return(0,Y.jsxs)(`div`,{role:`menuitemcheckbox`,"aria-checked":a,"data-testid":`toggle-older-conversations`,tabIndex:0,onClick:r,onKeyDown:e=>{(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),r())},className:z(`group`,Ln,`text-[var(--oh-foreground)]`),children:[(0,Y.jsx)(pe,{className:z(`h-3.5 w-3.5`,Fn),"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`min-w-0 shrink truncate`,children:e(R.CONVERSATION_PANEL$HIDE_CONVERSATIONS)}),(0,Y.jsx)(`div`,{className:`shrink-0`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:(0,Y.jsx)(Xr,{testId:`older-conversation-cutoff`,value:o,onChange:i,options:ro,labelKeyByValue:Io,ariaLabel:e(R.CONVERSATION_PANEL$OLDER_CUTOFF_LABEL),emphasizeNonDefault:!1,triggerClassName:z(`h-7 gap-1 rounded py-0 pl-2 pr-1.5 font-normal`,`text-[var(--oh-foreground)] [&_svg]:h-3 [&_svg]:w-3 [&_svg]:text-[var(--oh-muted)]`)})}),(0,Y.jsx)(Jr,{enabled:a,size:`sm`,className:`ml-auto`})]})}function Ro({open:e,onClose:t,backendKind:n,automationNameFacets:r}){let{t:i}=w(`openhands`),a=X(),o=J.useRef(null),[s,c]=J.useState({top:!1,bottom:!1}),l=J.useCallback(()=>{let e=o.current;e&&c(Yr(e))},[]);if(J.useLayoutEffect(()=>{if(!e)return;l();let t=o.current;if(!t)return;let n=new ResizeObserver(l);return n.observe(t),t.firstElementChild&&n.observe(t.firstElementChild),()=>n.disconnect()},[e,l,a.automationFilterMode]),!e)return null;let u=i(n===`local`?R.CONVERSATION_PANEL$BY_WORKSPACE:R.CONVERSATION_PANEL$BY_REPOSITORY);return(0,Y.jsx)($t,{onClose:t,children:(0,Y.jsxs)(en,{width:`md`,className:z(`relative items-start overflow-hidden border border-[var(--oh-border)]`,tn),testID:`advanced-conversation-options-modal`,children:[(0,Y.jsx)(or,{onClose:t,testId:`advanced-options-modal-close`}),(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pr-8`,children:[(0,Y.jsx)(an,{title:i(R.CONVERSATION_PANEL$ADVANCED_OPTIONS)}),(0,Y.jsx)(rn,{children:i(R.CONVERSATION_PANEL$ADVANCED_OPTIONS_DESCRIPTION)})]}),(0,Y.jsxs)(`div`,{className:`relative -mx-6 w-[calc(100%+3rem)] min-h-0`,children:[(0,Y.jsx)(`div`,{"aria-hidden":!0,"data-testid":`advanced-options-scroll-edge-top`,"data-visible":s.top?`true`:`false`,className:z(`pointer-events-none absolute inset-x-0 top-0 z-10 h-px bg-[var(--oh-border)]`,s.top?`opacity-100`:`opacity-0`)}),(0,Y.jsxs)(`div`,{ref:o,role:`menu`,"aria-orientation":`vertical`,"aria-label":i(R.CONVERSATION_PANEL$ADVANCED_OPTIONS),tabIndex:-1,"data-testid":`advanced-options-scroll`,className:`custom-scrollbar-always flex max-h-[60vh] w-full flex-col overflow-y-auto px-6`,onClick:e=>e.stopPropagation(),onScroll:l,children:[(0,Y.jsx)(Po,{children:i(R.CONVERSATION_PANEL$ORGANIZE)}),(0,Y.jsx)(Z,{icon:lt,label:u,selected:a.organizeMode===`grouped`,testId:`organize-grouped`,onClick:()=>a.setOrganizeMode(`grouped`)}),(0,Y.jsx)(Z,{icon:le,label:i(R.CONVERSATION_PANEL$CHRONOLOGICAL),selected:a.organizeMode===`chronological`,testId:`organize-chronological`,onClick:()=>a.setOrganizeMode(`chronological`)}),(0,Y.jsx)(G,{}),(0,Y.jsx)(Po,{children:i(R.CONVERSATION_PANEL$SORT_BY)}),(0,Y.jsx)(Z,{icon:fe,label:i(R.CONVERSATION_PANEL$SORT_CREATED),selected:a.conversationSort===`created`,testId:`sort-created`,onClick:()=>a.setConversationSort(`created`)}),(0,Y.jsx)(Z,{icon:me,label:i(R.CONVERSATION_PANEL$SORT_UPDATED),selected:a.conversationSort===`updated`,testId:`sort-updated`,onClick:()=>a.setConversationSort(`updated`)}),(0,Y.jsx)(G,{}),(0,Y.jsx)(Po,{children:i(R.CONVERSATION_PANEL$THREADS)}),(0,Y.jsx)(Z,{icon:De,label:i(R.CONVERSATION_PANEL$ALL_THREADS),selected:a.threadScope===`all`,testId:`scope-all`,onClick:()=>a.setThreadScope(`all`)}),(0,Y.jsx)(Z,{icon:ke,label:i(R.CONVERSATION_PANEL$RELEVANT_THREADS),selected:a.threadScope===`relevant`,testId:`scope-relevant`,onClick:()=>a.setThreadScope(`relevant`)}),(0,Y.jsx)(G,{}),(0,Y.jsx)(Po,{children:i(R.CONVERSATION_PANEL$SHOW)}),(0,Y.jsx)(Z,{icon:ue,label:i(R.CONVERSATION_PANEL$SHOW_ARCHIVED),selected:a.showArchivedConversations,variant:`toggle`,testId:`toggle-show-archived`,onClick:a.toggleShowArchivedConversations}),(0,Y.jsx)(Lo,{}),(0,Y.jsx)(G,{}),(0,Y.jsx)(Po,{children:i(R.CONVERSATION_PANEL$AUTOMATIONS)}),(0,Y.jsx)(Z,{icon:De,label:i(R.CONVERSATION_PANEL$AUTOMATIONS_ALL),selected:a.automationFilterMode===`all`,testId:`automation-filter-all`,onClick:()=>a.setAutomationFilterMode(`all`)}),(0,Y.jsx)(Z,{icon:pe,label:i(R.CONVERSATION_PANEL$AUTOMATIONS_HIDE),selected:a.automationFilterMode===`hide-automations`,testId:`automation-filter-hide`,onClick:()=>a.setAutomationFilterMode(`hide-automations`)}),(0,Y.jsx)(Z,{icon:Fo,label:i(R.CONVERSATION_PANEL$AUTOMATIONS_ONLY),selected:a.automationFilterMode===`only-automations`,testId:`automation-filter-only`,onClick:()=>a.setAutomationFilterMode(`only-automations`)}),a.automationFilterMode===`only-automations`?r.map(e=>(0,Y.jsx)(Z,{icon:U,label:e===`__unnamed__`?i(R.CONVERSATION_PANEL$AUTOMATION_UNNAMED):e,selected:a.selectedAutomationNames.includes(e),variant:`toggle`,testId:`automation-name-row-${e}`,onClick:()=>a.toggleAutomationName(e)},e)):null,(0,Y.jsx)(G,{}),(0,Y.jsx)(Po,{children:i(R.CONVERSATION_PANEL$METADATA)}),(0,Y.jsx)(Z,{icon:$e,label:i(R.CONVERSATION_PANEL$REPO_BRANCH),selected:a.showRepoBranchMetadata,variant:`toggle`,testId:`toggle-repo-branch-metadata`,onClick:a.toggleShowRepoBranchMetadata}),(0,Y.jsx)(Z,{icon:Ie,label:i(R.CONVERSATION_PANEL$LLM_MODEL),selected:a.showLlmProfiles,variant:`toggle`,testId:`toggle-llm-profiles`,onClick:a.toggleShowLlmProfiles}),(0,Y.jsx)(Z,{icon:U,label:i(R.CONVERSATION_PANEL$TAG_CHIPS),selected:a.showTagsMetadata,variant:`toggle`,testId:`toggle-tags-metadata`,onClick:a.toggleShowTagsMetadata}),(0,Y.jsx)(Z,{icon:Tt,label:i(R.CONVERSATION_PANEL$HOVER_METADATA),selected:a.showHoverMetadata,variant:`toggle`,testId:`toggle-hover-metadata`,onClick:a.toggleShowHoverMetadata})]}),(0,Y.jsx)(`div`,{"aria-hidden":!0,"data-testid":`advanced-options-scroll-edge-bottom`,"data-visible":s.bottom?`true`:`false`,className:z(`pointer-events-none absolute inset-x-0 bottom-0 z-10 h-px bg-[var(--oh-border)]`,s.bottom?`opacity-100`:`opacity-0`)})]}),(0,Y.jsx)(`div`,{className:`flex w-full justify-end`,onClick:e=>e.stopPropagation(),children:(0,Y.jsx)(cn,{type:`button`,variant:`primary`,onClick:t,testId:`advanced-options-close`,children:i(R.BUTTON$CLOSE)})})]})})}var zo=[{id:`by-workspace`,icon:lt,settings:{...Ao,organizeMode:`grouped`}},{id:`recent-activity`,icon:le,labelKey:R.CONVERSATION_PANEL$LAYOUT_RECENT_ACTIVITY,settings:{...Ao,showOlderConversations:!1}},{id:`focused`,icon:ke,labelKey:R.CONVERSATION_PANEL$LAYOUT_FOCUSED,settings:{...Ao,threadScope:`relevant`,showOlderConversations:!1}},{id:`minimal`,icon:je,labelKey:R.CONVERSATION_PANEL$LAYOUT_MINIMAL,settings:{...Ao,threadScope:`relevant`,showOlderConversations:!1,showRepoBranchMetadata:!1,showLlmProfiles:!1,showTagsMetadata:!1,showHoverMetadata:!1}}];function Bo(e){return zo.find(t=>Object.entries(t.settings).every(([t,n])=>e[t]===n))??null}function Vo({menuOpen:e,setMenuOpen:t,menuRef:n,backendKind:r,tagFacets:i,automationNameFacets:a,totalConversationsCount:o,onRequestDeleteAll:s}){let{t:c}=w(`openhands`),l=X(),[u,d]=J.useState(!1),[f,p]=J.useState(!1),m=c(r===`local`?R.CONVERSATION_PANEL$BY_WORKSPACE:R.CONVERSATION_PANEL$BY_REPOSITORY),h=Bo(l),g=J.useRef(null),_=J.useRef(null),v=J.useRef(e);return J.useEffect(()=>{e?(_.current?.querySelector(`[role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"]`))?.focus():v.current&&g.current?.focus(),v.current=e},[e]),(0,Y.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,Y.jsx)(`button`,{ref:g,type:`button`,"data-testid":`conversation-layouts-toggle`,"aria-label":c(R.CONVERSATION_PANEL$LAYOUTS_HEADING),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:z(`relative 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)]`,Rn),children:(0,Y.jsx)(St,{className:`shrink-0`,size:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,Y.jsxs)(`div`,{ref:_,role:`menu`,"aria-orientation":`vertical`,"aria-label":c(R.CONVERSATION_PANEL$LAYOUTS_HEADING),tabIndex:-1,"data-testid":`conversation-layouts-menu`,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),t(!1);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=_.current;if(!n)return;let r=Array.from(n.querySelectorAll(`[role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"]`)).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:z(`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`,Pn,Mn),children:[(0,Y.jsx)(Po,{children:c(R.CONVERSATION_PANEL$LAYOUTS_HEADING)}),zo.map(e=>(0,Y.jsx)(Z,{icon:e.icon,label:e.labelKey?c(e.labelKey):m,selected:h?.id===e.id,testId:`layout-preset-${e.id}`,onClick:()=>{l.applyLayoutSettings(e.settings),t(!1)}},e.id)),(0,Y.jsx)(G,{}),(0,Y.jsx)(Z,{icon:U,label:c(R.CONVERSATION_PANEL$TAG_FILTERS),testId:`tag-filters-section`,onClick:()=>d(!u)}),u?i.length>0?i.map(e=>(0,Y.jsx)(Z,{icon:U,label:vo(e),selected:l.selectedTagFacets.includes(e),testId:`tag-facet-row-${e}`,onClick:()=>l.toggleTagFacet(e)},e)):(0,Y.jsx)(`p`,{"data-testid":`tag-filters-empty`,className:`px-2 py-1 text-[11px] text-[var(--oh-muted)]/70`,children:c(R.CONVERSATION_PANEL$NO_VISIBLE_TAGS)}):null,(0,Y.jsx)(G,{}),(0,Y.jsx)(Z,{icon:Te,label:h?c(R.CONVERSATION_PANEL$ADVANCED_OPTIONS):`${c(R.CONVERSATION_PANEL$ADVANCED_OPTIONS)} · ${c(R.CONVERSATION_PANEL$ADVANCED_OPTIONS_CUSTOM)}`,testId:`advanced-options-row`,onClick:()=>{t(!1),p(!0)}}),(0,Y.jsx)(G,{}),(0,Y.jsx)(Z,{testId:`delete-all-conversations`,icon:Nt,label:Ho(c(R.CONVERSATION$DELETE_ALL)),disabled:o===0,destructive:!0,onClick:()=>{o!==0&&(s(),t(!1))}})]}):null,(0,Y.jsx)(Ro,{open:f,onClose:()=>p(!1),backendKind:r,automationNameFacets:a})]})}var Ho=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e;function Uo({selectedFacets:e,onToggleFacet:t,selectedAutomationNames:n,onToggleAutomationName:r,onClearAll:i}){let{t:a}=w(`openhands`);if(e.length===0&&n.length===0)return null;let o=`flex min-w-0 max-w-full cursor-pointer items-center gap-1 rounded-full bg-[var(--oh-surface)] px-2 py-0.5 text-[10px] leading-4 text-white hover:bg-white/10`;return(0,Y.jsxs)(`div`,{"data-testid":`conversation-active-tag-filters`,className:`flex min-w-0 items-start gap-1.5 border-b border-[var(--oh-border)] px-4 py-1.5`,children:[(0,Y.jsx)(U,{className:`mt-1 h-3 w-3 shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-1`,children:[e.map(e=>(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`active-tag-filter-${e}`,onClick:()=>t(e),className:o,children:[(0,Y.jsx)(`span`,{className:`truncate`,children:vo(e)}),(0,Y.jsx)(jt,{className:`h-3 w-3 shrink-0`,"aria-hidden":!0})]},e)),n.map(e=>(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`active-automation-filter-${e}`,onClick:()=>r(e),className:o,children:[(0,Y.jsx)(pt,{className:`h-3 w-3 shrink-0`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`truncate`,children:e===`__unnamed__`?a(R.CONVERSATION_PANEL$AUTOMATION_UNNAMED):e}),(0,Y.jsx)(jt,{className:`h-3 w-3 shrink-0`,"aria-hidden":!0})]},e))]}),(0,Y.jsx)(`button`,{type:`button`,"data-testid":`clear-tag-filters`,onClick:i,className:`shrink-0 cursor-pointer text-[10px] leading-5 text-[var(--oh-muted)] hover:text-white`,children:a(R.CONVERSATION_PANEL$CLEAR_FILTERS)})]})}var Wo=z(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,jn);function Go(e,t){let{open:n,enabled:r,targetWidth:i=256}=t,[a,o]=J.useState(null),s=J.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 J.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 Ko({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=w(`openhands`),{navigate:o}=ln(),[s,c]=J.useState(!1),l=J.useRef(null),u=J.useRef(null),d=Go(u,{open:s,enabled:i}),{data:f,error:p}=it(),m=f?.workspaceParents??[],{mutate:h}=dt(),{mutate:g}=nt(),{mutate:_}=ct(),{mutate:v}=ot(),{workspaces:y}=rt(),b=tt(p,a),[x,C]=J.useState(!1),[T,E]=J.useState(!1),{mutate:D,isPending:O}=Pr(),k=S(),A=O||k;J.useEffect(()=>{if(!s||x||T)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,x,T]),J.useEffect(()=>{if(!s||x||T)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,x,T]);let j=e=>{A||D({workingDir:e,entryPoint:`sidebar_local_menu`},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},M=Ln,N=J.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),P=J.useCallback(()=>{c(e=>!e)},[]),ee=s&&(!i||d!==null),te=!!b,ne=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,F=(0,Y.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:te,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),!te&&C(!0)},className:M,children:a(R.HOME$ADD_WORKSPACES)}),I=b?(0,Y.jsx)(An,{content:b,placement:`top`,children:(0,Y.jsx)(`span`,{className:`block`,children:F})}):F;return(0,Y.jsxs)(`div`,{className:z(!i&&`relative`,t),ref:l,children:[(0,Y.jsx)(`span`,{ref:u,className:`inline-flex`,children:e({onClick:P,"aria-expanded":s,"aria-haspopup":`menu`,disabled:A})}),ee&&(0,Y.jsxs)(`div`,{"data-testid":r,className:z(Wo,!i&&z(`absolute top-full mt-0`,n)),style:ne,children:[(0,Y.jsxs)(`ul`,{className:z(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,Pn),children:[(0,Y.jsx)(`li`,{children:(0,Y.jsx)(`button`,{type:`button`,disabled:A,"data-testid":`launch-no-workspace`,onClick:()=>j(),className:M,children:(0,Y.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:a(R.HOME$NO_WORKSPACE_OPTION)})})}),y.map(e=>(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,disabled:A,"data-testid":`launch-workspace`,"data-workspace-path":e.path,onClick:()=>j(e.path),className:M,children:[(0,Y.jsx)(`span`,{className:zn,"aria-hidden":!0,children:(0,Y.jsx)(Zr,{width:14,height:14})}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,Y.jsxs)(`div`,{className:z(`flex flex-col`,Pn),"data-testid":`new-conversation-menu-footer`,children:[(0,Y.jsx)(Jn,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),I,(y.length>0||m.length>0)&&(0,Y.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),E(!0)},className:M,children:a(R.HOME$MANAGE_WORKSPACES)})]})]}),(0,Y.jsx)(at,{isOpen:x,onClose:()=>C(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,Y.jsx)(ut,{isOpen:T,workspaces:y,workspaceParents:m,onClose:()=>E(!1),onRemove:e=>g(e),onRemoveParent:e=>v(e)})]})}function qo({repo:e,disabled:t,onSelect:n,itemClass:r}){return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,disabled:t,"data-testid":`launch-repository`,"data-repo-name":e.full_name,onClick:()=>n(e),className:r,children:[(0,Y.jsx)(`span`,{className:zn,"aria-hidden":!0,children:(0,Y.jsx)(Zr,{width:14,height:14})}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function Jo({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=w(`openhands`),{navigate:o}=ln(),{providers:s}=ti(),{lastSelectedProvider:c,setLastSelectedProvider:l}=ni(),[u,d]=J.useState(!1),f=J.useRef(null),p=J.useRef(null),m=Go(p,{open:u,enabled:i}),[h,g]=J.useState(c??null),[_,v]=J.useState(``),y=$r(_,300);J.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:b,isLoading:x,isError:C,hasNextPage:T,isFetchingNextPage:E,fetchNextPage:D}=Qr({provider:h}),{data:O,isLoading:k}=ei(y,h),A=J.useMemo(()=>b?.pages.flatMap(e=>e.items)??[],[b]),j=y?O??[]:A,{mutate:M,isPending:N}=Pr(),P=S(),ee=N||P;J.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]),J.useEffect(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&d(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u]);let te=e=>{ee||M({repository:{name:e.full_name,gitProvider:e.git_provider,branch:e.main_branch??`main`},entryPoint:`sidebar_cloud_menu`},{onSuccess:e=>{d(!1),o(`/conversations/${e.conversation_id}`)}})},ne=e=>{g(e),l(e),v(``)},F=Ln;J.useEffect(()=>{u&&(y||!T||E||x||j.length===0||j.length>=10||D())},[u,y,T,E,x,j.length,D]);let I=y?k:x,re=!y&&T&&j.length>0,L=J.useCallback(()=>{d(e=>!e)},[]),ie=u&&(!i||m!==null),B=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,Y.jsxs)(`div`,{className:z(!i&&`relative`,t),ref:f,children:[(0,Y.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:L,"aria-expanded":u,"aria-haspopup":`menu`,disabled:ee})}),ie&&(0,Y.jsxs)(`div`,{"data-testid":r,className:z(Wo,!i&&z(`absolute top-full mt-0`,n)),style:B,children:[s.length>1&&(0,Y.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,Y.jsxs)(`button`,{type:`button`,"data-testid":`cloud-provider-tab-${e}`,onClick:()=>ne(e),className:z(`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,Y.jsx)(Kn,{gitProvider:e}),(0,Y.jsx)(`span`,{className:`capitalize`,children:e})]},e)})}),(0,Y.jsx)(`div`,{className:`px-2`,children:(0,Y.jsxs)(`div`,{className:`relative`,children:[(0,Y.jsx)(ri,{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,Y.jsx)(`input`,{type:`text`,"data-testid":`cloud-repo-search-input`,value:_,onChange:e=>v(e.target.value),placeholder:a(R.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:z(`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,Y.jsx)(Jn,{inset:`menu`}),(0,Y.jsxs)(`ul`,{className:z(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,Pn),children:[I&&j.length===0&&(0,Y.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-loading`,children:a(R.HOME$LOADING_REPOSITORIES)}),C&&(0,Y.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(R.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!I&&!C&&j.length===0&&!!h&&(0,Y.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-empty`,children:a(R.GITHUB$NO_RESULTS)}),j.map(e=>(0,Y.jsx)(qo,{repo:e,disabled:ee,onSelect:te,itemClass:F},`${e.git_provider}:${e.id}`)),re&&(0,Y.jsx)(`li`,{children:(0,Y.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:E,onClick:()=>D(),className:F,children:(0,Y.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(E?R.HOME$LOADING_MORE_REPOSITORIES:R.CONVERSATION$LOAD_MORE)})})})]})]})]})}var Yo=z(`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 Xo({backendKind:e}){let{t}=w(`openhands`),n=t(R.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,Y.jsx)(Fe,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,Y.jsx)(Ko,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,Y.jsx)(`button`,{type:`button`,className:Yo,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})}):(0,Y.jsx)(Jo,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,Y.jsx)(`button`,{type:`button`,className:Yo,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})})}function Zo({group:e,expanded:t,previewExpanded:n,isDragging:r,dropIndicatorPosition:i,animateLayout:a,isCreatingConversationFlow:o,activeConversationId:s,discoveryConversationIds:c,onToggleExpanded:l,onDragStart:u,onDragEnd:d,onDragOver:f,onDragLeave:p,onDrop:m,onTogglePreviewExpanded:h,onLaunchFromGroup:g,renderConversationCard:_}){let{t:v}=w(`openhands`),y=(0,J.useRef)(null),b=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,x=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),{visibleConversations:S,isPreviewTruncated:C,isShowingAll:T}=co(e.conversations,{expanded:n,activeConversationId:s,discoveryConversationIds:c??void 0});return(0,Y.jsxs)(Ve.section,{ref:y,layout:a?`position`:!1,transition:{type:`spring`,stiffness:600,damping:45},"aria-labelledby":b,"data-testid":`thread-folder-${x}`,onDragOver:f,onDragLeave:p,onDrop:m,className:`relative rounded-md`,children:[i?(0,Y.jsx)(`div`,{"aria-hidden":!0,"data-testid":`thread-folder-drop-indicator-${x}`,className:z(`pointer-events-none absolute inset-x-0 z-10 h-0.5 rounded-full bg-[var(--oh-accent)]`,i===`before`?`-top-0.5`:`-bottom-0.5`)}):null,(0,Y.jsxs)(`div`,{className:z(r&&`opacity-0`),children:[(0,Y.jsxs)(`div`,{className:z(`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,Y.jsxs)(`button`,{type:`button`,draggable:!0,id:b,"aria-expanded":t,"aria-controls":`thread-folder-content-${x}`,"data-testid":`thread-folder-drag-${x}`,"aria-label":v(t?R.CONVERSATION_PANEL$COLLAPSE_FOLDER:R.CONVERSATION_PANEL$EXPAND_FOLDER,{label:e.label}),onClick:l,onDragStart:t=>{t.stopPropagation();let{dataTransfer:n}=t;if(n){n.effectAllowed=`move`,n.setData(`text/plain`,e.id);let r=y.current;if(r&&typeof n.setDragImage==`function`){let e=r.getBoundingClientRect(),i=r.cloneNode(!0);i.style.position=`fixed`,i.style.top=`0`,i.style.left=`-9999px`,i.style.width=`${e.width}px`,i.style.margin=`0`,i.style.pointerEvents=`none`,i.style.borderRadius=`0.5rem`,i.style.padding=`0.25rem`,i.style.backgroundColor=`var(--oh-surface-raised)`,i.style.boxShadow=`0 8px 24px rgba(0, 0, 0, 0.35)`,document.body.appendChild(i),n.setDragImage(i,t.clientX-e.left,t.clientY-e.top),window.setTimeout(()=>i.remove(),0)}}u()},onDragEnd:e=>{e.stopPropagation(),d()},className:z(`group/folder flex min-h-8 min-w-0 flex-1 cursor-grab items-center gap-2 rounded-md py-1 text-left text-inherit outline-none active:cursor-grabbing`,`focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`),children:[(0,Y.jsx)(lt,{className:z(`h-4 w-4 shrink-0`,t?`hidden group-hover/folder:block`:`block group-hover/folder:hidden`),"aria-hidden":!0}),(0,Y.jsx)(Qe,{className:z(`h-4 w-4 shrink-0`,t?`block group-hover/folder:hidden`:`hidden group-hover/folder:block`),"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,Y.jsx)(`button`,{type:`button`,className:z(`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:o,"aria-label":v(R.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${x}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),g()},children:(0,Y.jsx)(Ot,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),t?(0,Y.jsxs)(`div`,{id:`thread-folder-content-${x}`,className:`mt-0.5 space-y-0.5`,children:[S.map(_),C?(0,Y.jsx)(`div`,{className:`pl-2`,children:(0,Y.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${x}`,onClick:h,className:`cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:v(T?R.CONVERSATION_PANEL$LESS:R.CONVERSATION_PANEL$MORE)})}):null]}):null]})]})}function Qo({groups:e,groupIds:t,groupFolderOrder:n,setGroupFolderOrder:r,collapsedGroupIds:i,expandedGroupPreviewIds:a,discoveryConversationIds:o,onToggleGroupCollapsed:s,onToggleGroupPreviewExpanded:c,isCreatingConversationFlow:l,activeConversationId:u,onLaunchFromGroup:d,renderConversationCard:f}){let{t:p}=w(`openhands`),[m,h]=(0,J.useState)(null),[g,_]=(0,J.useState)(null),[v,y]=(0,J.useState)(null),[b,x]=(0,J.useState)(!1),S=(0,J.useRef)(null);(0,J.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let C=(0,J.useCallback)(()=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{x(!1),S.current=null},300)},[]),T=(0,J.useCallback)(()=>{h(null),_(null),y(null)},[]),E=(0,J.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();return e.clientY<t.top+t.height/2?`before`:`after`},[]),D=(0,J.useCallback)((e,i)=>{if(!m||m===e){T(),C();return}r(ko(n,t,m,e,i)),T(),C()},[m,n,t,T,r,C]);return(0,Y.jsx)(`nav`,{"aria-label":p(R.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:e.map(e=>(0,Y.jsx)(Zo,{group:e,expanded:!i.has(e.id),previewExpanded:a.has(e.id),isDragging:m===e.id,dropIndicatorPosition:g===e.id&&m!==e.id?v:null,animateLayout:b,isCreatingConversationFlow:l,activeConversationId:u,discoveryConversationIds:o,onToggleExpanded:()=>s(e.id),onDragStart:()=>{x(!0),h(e.id)},onDragEnd:()=>{T(),C()},onDragOver:t=>{t.preventDefault();let{dataTransfer:n}=t;n&&(n.dropEffect=`move`),_(e.id),y(E(t))},onDragLeave:()=>{_(t=>t===e.id?null:t)},onDrop:t=>{t.preventDefault(),D(e.id,E(t))},onTogglePreviewExpanded:()=>c(e.id),onLaunchFromGroup:()=>d(e.launch),renderConversationCard:f},e.id))})}function $o({pinnedConversations:e,isPreviewExpanded:t,onTogglePreviewExpanded:n,activeConversationId:r,showDivider:i=!1,renderConversationCard:a}){let{t:o}=w(`openhands`),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=co(e,{limit:5,expanded:t,activeConversationId:r});return(0,Y.jsxs)(`section`,{"data-testid":`conversation-panel-pinned-section`,className:z(`pt-1`,i?`mb-2 border-b border-[var(--oh-border-subtle)] pb-2`:`pb-2`),children:[(0,Y.jsxs)(`h3`,{className:`flex items-center gap-1.5 py-1.5 pl-2 text-sm font-normal text-[var(--oh-muted)]`,children:[(0,Y.jsx)(Et,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),o(R.CONVERSATION_PANEL$PINNED)]}),(0,Y.jsx)(`div`,{className:`space-y-0.5`,children:s.map(a)}),c?(0,Y.jsx)(`div`,{className:`pl-2 pt-0.5`,children:(0,Y.jsx)(`button`,{type:`button`,"data-testid":`conversation-panel-pinned-view-more`,onClick:n,className:`cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:o(l?R.CONVERSATION_PANEL$LESS:R.CONVERSATION_PANEL$MORE)})}):null]})}var es=`archived-conversations`,ts={archivesByBackendId:{}};function ns(e,t){return e[t]??[]}var rs=Rt()(rr((e,t)=>({...ts,archiveConversation:(n,r)=>{let i=ns(t().archivesByBackendId,n);i.includes(r)||e(e=>({archivesByBackendId:{...e.archivesByBackendId,[n]:[r,...i]}}))},removeArchivedConversation:(n,r)=>{let i=ns(t().archivesByBackendId,n);i.includes(r)&&e(e=>({archivesByBackendId:{...e.archivesByBackendId,[n]:i.filter(e=>e!==r)}}))},isArchived:(e,n)=>ns(t().archivesByBackendId,e).includes(n)}),{name:es,storage:ir(()=>localStorage),partialize:e=>({archivesByBackendId:e.archivesByBackendId})})),is={pinsByBackendId:{}};function as(e,t){return e[t]??[]}var os=Rt()(rr((e,t)=>({...is,pinConversation:(n,r)=>{let i=as(t().pinsByBackendId,n);i.includes(r)||e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:[r,...i]}}))},unpinConversation:(n,r)=>{let i=as(t().pinsByBackendId,n);i.includes(r)&&e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:i.filter(e=>e!==r)}}))},togglePin:(e,n)=>{as(t().pinsByBackendId,e).includes(n)?t().unpinConversation(e,n):t().pinConversation(e,n)},pruneMissingConversations:(n,r)=>{let i=new Set(r),a=as(t().pinsByBackendId,n),o=a.filter(e=>i.has(e));o.length!==a.length&&e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:o}}))}}),{name:`pinned-conversations`,storage:ir(()=>localStorage),partialize:e=>({pinsByBackendId:e.pinsByBackendId})})),ss=()=>{},cs=[];function ls({onClose:e,compact:t=!1}){let{t:n}=w(`openhands`),{conversationId:r,navigate:a}=ln(),{backend:o}=P(),s=Xn(),c=Mr(e??ss),[l,u]=J.useState(!1),[d,f]=J.useState(!1),[p,m]=J.useState(!1),[h,g]=J.useState(!1),[_,v]=J.useState(!1),[y,b]=J.useState(!1),x=X(e=>e.showOlderConversations),C=X(e=>e.olderConversationCutoff),T=X(e=>e.showArchivedConversations),E=X(e=>e.showRepoBranchMetadata),D=X(e=>e.showLlmProfiles),k=X(e=>e.showTagsMetadata),A=X(e=>e.showHoverMetadata),j=X(e=>e.organizeMode),M=X(e=>e.conversationSort),N=X(e=>e.threadScope),ee=X(e=>e.automationFilterMode),ne=X(e=>e.selectedAutomationNames),F=X(e=>e.selectedTagFacets),I=X(e=>e.toggleTagFacet),re=X(e=>e.toggleAutomationName),L=X(e=>e.clearFilterSelections),ie=X(e=>e.groupFolderOrder),ae=X(e=>e.setGroupFolderOrder),[oe,se]=J.useState(!1),[ce,le]=J.useState(!1),ue=Mr(()=>{se(!1)}),[de,fe]=J.useState(()=>new Set),[pe,me]=J.useState(()=>new Set),[he,ge]=J.useState(!1),V=os(e=>e.pinsByBackendId[o.id]??cs),_e=os(e=>e.togglePin),ve=os(e=>e.unpinConversation),ye=os(e=>e.pruneMissingConversations),be=rs(e=>e.archivesByBackendId[o.id]??cs),xe=rs(e=>e.archiveConversation),Se=J.useMemo(()=>new Set(be),[be]),Ce=rs(e=>e.removeArchivedConversation),we=J.useCallback(e=>{fe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Te=J.useCallback(e=>{me(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);J.useEffect(()=>{j!==`grouped`&&(fe(new Set),me(new Set))},[j]);let Ee=J.useRef(null),[H,U]=J.useState(null),[De,Oe]=J.useState(null),[ke,Ae]=J.useState(null),{data:je,isLoading:Me,isFetched:Ne,hasNextPage:Pe,isFetching:Fe,isFetchingNextPage:Ie,fetchNextPage:Le}=ia(),{workspaces:Re}=rt(),{data:ze}=aa(),Be=J.useMemo(()=>{let e=je?.pages.flatMap(e=>e.items)??[],t=new Set;return e.filter(e=>t.has(e.id)?!1:(t.add(e.id),!0))},[je]),Ve=J.useMemo(()=>{let e=new Map;return je?.pages.forEach((t,n)=>{t.items.forEach(t=>{e.has(t.id)||e.set(t.id,n)})}),e},[je]),W=J.useMemo(()=>T?Be:Be.filter(e=>!Se.has(e.id)),[Be,Se,T]),He=J.useMemo(()=>ho(W),[W]),Ue=J.useMemo(()=>{if(t||j!==`grouped`||o.kind!==`local`)return[];let e=e=>e.trim().replace(/\/+$/,``),n=new Map;for(let t of Re){let r=e(t.path);r&&n.set(r,t)}for(let t of W){let r=t.selected_workspace?e(t.selected_workspace):``;if(r&&!n.has(r)){let e=r.split(`/`).filter(Boolean).pop()??r;n.set(r,{id:r,name:e,path:r})}}return Array.from(n.values())},[o.kind,t,W,Re,j]),We=J.useMemo(()=>go(W,ee,ne,He),[ee,He,W,ne]),Ge=J.useMemo(()=>_o(W),[W]),Ke=J.useMemo(()=>yo(We,F,Ge),[We,F,Ge]),qe=J.useMemo(()=>lo(V,W),[W,V]);J.useEffect(()=>{if(!Ne)return;let e=je?.pages.flatMap(e=>e.items.map(e=>e.id))??[];ye(o.id,e)},[o.id,je,Ne,ye]),J.useEffect(()=>{V.length===0&&ge(!1)},[V.length]);let Je=J.useMemo(()=>{let e=N===`relevant`?Ke.filter(e=>B(e.execution_status)):Ke;return t?e:uo(e,V)},[Ke,t,V,N]),{recent:Ye,older:Xe}=J.useMemo(()=>oo(Je,io[ao(C)?C:`7d`]),[C,Je]),Ze=J.useMemo(()=>So(x?[...Ye,...Xe]:Ye,M),[Ye,Xe,x,M]),Qe=J.useMemo(()=>({emptyWorkspace:n(R.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(R.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),$e=J.useMemo(()=>t||j!==`grouped`?null:[...Ye,...x?Xe:[]],[t,Xe,j,Ye,x]),et=J.useMemo(()=>$e?Do($e,o.kind,M,Qe,Ue):null,[o.kind,M,Qe,$e,Ue]),tt=J.useMemo(()=>$e?Eo($e,Ve,o.kind,{forceIncludeConversationId:r}):null,[o.kind,Ve,r,$e]),nt=J.useMemo(()=>et?Oo(et,ie):null,[et,ie]),it=J.useMemo(()=>et?.map(e=>e.id)??[],[et]),at=J.useMemo(()=>So(Ye.filter(e=>B(e.execution_status)),M),[M,Ye]),ot=Ze.length,st=nt?.length??0,ct=j===`grouped`&&!t?st===0:ot===0,lt=ct&&ee!==`all`&&W.length>0&&We.length===0,ut=ct&&F.length>0&&We.length>0&&Ke.length===0,dt=j===`grouped`&&!t?st:ot,ft=je?.pages.length??0,[G,pt]=J.useState(null),[mt,ht]=J.useState(null),gt=J.useRef(dt);gt.current=dt;let _t=J.useRef(ft);_t.current=ft;let vt=J.useCallback(()=>{pt(null),ht(null)},[]),yt=J.useCallback(()=>{Pe&&(pt(gt.current),ht(_t.current))},[Pe]);J.useEffect(()=>{if(G!==null){if(dt>G){vt();return}if(j===`grouped`&&!t&&mt!=null&&ft>=mt+3){vt();return}if(!(Fe||Ie)){if(!Pe){vt();return}Le()}}},[vt,t,G,mt,dt,ft,j,Pe,Fe,Ie,Le]);let bt=G!==null||Ie,{mutate:xt,mutateAsync:St}=Gn(),{mutate:Ct}=Wn(),{mutate:wt}=Er(),{mutate:Tt}=ca(),Et=Xe.length>0&&!x,Dt=!!Pe&&!Et&&!t,{mutate:Ot}=Pr(),kt=S(),At=J.useCallback(e=>{kt||Ot({workingDir:e.workingDir,repository:e.repository,entryPoint:`sidebar_relaunch_project`},{onSuccess:e=>{a(`/conversations/${e.conversation_id}`)}})},[Ot,kt,a]),jt=J.useCallback((e,t)=>{u(!0),U(e),Oe(t)},[]),Mt=J.useCallback((e,t)=>{f(!0),U(e),Oe(t)},[]),Nt=J.useCallback(e=>{m(!0),U(e)},[]),Pt=J.useCallback(e=>{H&&Tt({conversationId:H,tags:e},{onSuccess:()=>{O(n(R.CONVERSATION$TAGS_UPDATED))}})},[H,n,Tt]),Ft=J.useCallback(e=>{Ce(o.id,e)},[o.id,Ce]),K=J.useCallback(e=>{g(!0),U(e)},[]),It=J.useCallback((e,t)=>{wt({conversationId:e,newTitle:t},{onSuccess:()=>{O(n(R.CONVERSATION$TITLE_UPDATED))}})},[n,wt]),Lt=()=>{if(H){let e=H;xt({conversationId:e},{onSuccess:()=>{Ce(o.id,e),e===r&&a(`/conversations`)}})}},Rt=()=>{H&&(xe(o.id,H),ve(o.id,H),H===r&&a(`/conversations`))},zt=()=>{H&&Ct({conversationId:H})},Bt=async()=>{let e=Be.map(e=>e.id),t=await Promise.allSettled(e.map(e=>St({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),i=t.length-n.length;for(let e of n)Ce(o.id,e);r!==null&&n.includes(r)&&a(`/conversations`),i>0&&te(`${i} conversation${i===1?``:`s`} could not be deleted.`)},Vt=J.useCallback((n,a)=>{let c=V.includes(n.id),l=Se.has(n.id);return t?(0,Y.jsx)(no,{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:E,llmModel:n.llm_model,showLlmProfiles:D,agentKind:n.agent_kind,acpServer:n.acp_server,tags:n.tags,showTags:k},n.id):(0,Y.jsx)(i,{placement:`right-start`,delay:1e3,closeDelay:100,isDisabled:!A||ke===n.id,disableAnimation:!1,className:`max-w-none overflow-visible rounded-xl border border-[var(--oh-border)] bg-base-secondary p-0 text-white shadow-xl`,content:(0,Y.jsx)(Ya,{title:n.title??``,executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,llmModel:n.llm_model,agentKind:n.agent_kind,acpServer:n.acp_server,createdAt:n.created_at,tags:n.tags}),children:(0,Y.jsx)(fn,{to:s(`/conversations/${n.id}`),onClick:e,className:z(`block rounded-md transition-colors`,ke!==n.id&&`hover:bg-[var(--oh-surface)]`,(n.id===r||ke===n.id)&&`bg-[var(--oh-surface)]`),children:(0,Y.jsx)(Ga,{onDelete:()=>jt(n.id,n.title??``),onArchive:l?void 0:()=>Mt(n.id,n.title??``),onUnarchive:l?()=>Ft(n.id):void 0,onStop:()=>K(n.id),onEditTags:o.kind===`local`?()=>Nt(n.id):void 0,onChangeTitle:e=>It(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:ke===n.id,onContextMenuToggle:e=>Ae(e?n.id:null),isActive:n.id===r,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:E,llmModel:n.llm_model,showLlmProfiles:D,agentKind:n.agent_kind,acpServer:n.acp_server,tags:n.tags,showTags:k,isArchived:l,isPinned:c,onTogglePin:()=>_e(o.id,n.id),alwaysShowPinIcon:c&&!a?.inPinnedSection})})},n.id)},[o.id,o.kind,Se,t,r,Mt,It,jt,Nt,K,Ft,e,ke,V,E,D,k,A,_e]),Ht=Me||!Ne,Ut=!t&&!Ht&&qe.length>0,Wt=j===`grouped`&&!t&&nt!=null&&nt.length>0,Gt=Ne&&!Me&&!t&&ct&&!Ut&&!ze?.length&&!Wt;return(0,Y.jsxs)(`div`,{ref:c,"data-testid":`conversation-panel`,className:`flex h-full min-h-0 w-full flex-col`,children:[!t&&(0,Y.jsx)(`div`,{className:z(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,ce?`border-[var(--oh-border)]`:`border-transparent`),children:(0,Y.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,Y.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-[var(--oh-muted)]`,children:n(R.SIDEBAR$CONVERSATIONS)}),(0,Y.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,Y.jsx)(Xo,{backendKind:o.kind}),(0,Y.jsx)(Vo,{menuOpen:oe,setMenuOpen:se,menuRef:ue,backendKind:o.kind,tagFacets:Ge,automationNameFacets:He,totalConversationsCount:Be.length,onRequestDeleteAll:()=>b(!0)})]})]})}),!t&&(0,Y.jsx)(Uo,{selectedFacets:F,onToggleFacet:I,selectedAutomationNames:ne,onToggleAutomationName:re,onClearAll:L}),(0,Y.jsxs)(`div`,{ref:Ee,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{le(e.currentTarget.scrollTop>0)},className:z(`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:[Ht&&(0,Y.jsx)(to,{compact:t}),!t&&Gt&&(0,Y.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,Y.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:n(lt?R.CONVERSATION_PANEL$NO_AUTOMATION_MATCHES:ut?R.CONVERSATION_PANEL$NO_TAG_MATCHES:R.CONVERSATION$NO_CONVERSATIONS)})}),Ut?(0,Y.jsx)($o,{pinnedConversations:qe,isPreviewExpanded:he,onTogglePreviewExpanded:()=>ge(e=>!e),activeConversationId:r,showDivider:!t&&j===`chronological`,renderConversationCard:e=>Vt(e,{inPinnedSection:!0})}):null,!t&&ze?.map(t=>(0,Y.jsx)(fn,{to:s(`/conversations/task-${t.id}`),onClick:e,className:`block`,children:(0,Y.jsx)(eo,{task:t})},t.id)),!Ht&&t?at.map(e=>Vt(e)):null,!Ht&&!t&&j===`grouped`&&nt&&nt.length>0?(0,Y.jsx)(Qo,{groups:nt,groupIds:it,groupFolderOrder:ie,setGroupFolderOrder:ae,collapsedGroupIds:de,expandedGroupPreviewIds:pe,discoveryConversationIds:tt,onToggleGroupCollapsed:we,onToggleGroupPreviewExpanded:Te,isCreatingConversationFlow:kt,activeConversationId:r,onLaunchFromGroup:At,renderConversationCard:e=>Vt(e)}):null,!Ht&&!t&&j===`chronological`?(0,Y.jsx)(`div`,{className:`space-y-0.5`,children:Ze.map(e=>Vt(e))}):null,Dt&&(bt?(0,Y.jsx)(`div`,{className:`py-1`,children:(0,Y.jsx)(to,{compact:t})}):(0,Y.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,Y.jsx)(`button`,{type:`button`,"data-testid":`load-more-conversations`,onClick:yt,className:`text-xs text-[var(--oh-muted)] hover:text-white`,children:n(R.CONVERSATION$LOAD_MORE)})}))]}),l&&(0,Y.jsx)(wr,{onConfirm:()=>{Lt(),u(!1),Oe(null)},onCancel:()=>{u(!1),Oe(null)},conversationTitle:De??void 0}),d&&(0,Y.jsx)(oa,{onConfirm:()=>{Rt(),f(!1),Oe(null)},onCancel:()=>{f(!1),Oe(null)},conversationTitle:De??void 0}),p&&(0,Y.jsx)(da,{tags:Be.find(e=>e.id===H)?.tags,onConfirm:e=>{Pt(e),m(!1)},onCancel:()=>m(!1)}),y&&(0,Y.jsx)(wr,{title:n(R.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(R.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:Be.length}),onConfirm:async()=>{await Bt(),b(!1)},onCancel:()=>b(!1)}),h&&(0,Y.jsx)(jr,{onConfirm:()=>{zt(),g(!1)},onCancel:()=>g(!1)}),_&&(0,Y.jsx)(sa,{onConfirm:()=>{e?.()},onClose:()=>v(!1),onCancel:()=>v(!1)})]})}function us({collapsed:e}){return e?null:(0,Y.jsx)(`div`,{className:`flex flex-col flex-1 min-h-0`,children:(0,Y.jsx)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col`,children:(0,Y.jsx)(ls,{})})})}var Q=18;function ds(){return(0,Y.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:Q,height:Q,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,Y.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,Y.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,Y.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,Y.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,Y.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,Y.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,Y.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,Y.jsx)(`path`,{d:`m17 16.5v5.17`}),(0,Y.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,Y.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,Y.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,Y.jsx)(`path`,{d:`M12 13.5V8`})]})}function fs({id:e,className:t}){let n=z(`shrink-0 text-white`,t),r=`sidebar-onboarding-checklist-icon-${e}`;switch(e){case`configure-llm`:return(0,Y.jsx)(`span`,{"data-testid":r,className:`inline-flex shrink-0`,children:(0,Y.jsx)(Je,{width:Q,height:Q,className:n,"aria-hidden":!0})});case`start-conversation`:return(0,Y.jsx)(`span`,{"data-testid":r,className:`inline-flex shrink-0`,children:(0,Y.jsx)(Ot,{size:Q,strokeWidth:2,className:n,"aria-hidden":!0})});case`schedule-task`:return(0,Y.jsx)(`span`,{"data-testid":r,className:`inline-flex shrink-0`,children:(0,Y.jsx)(Ci,{width:Q,height:Q,className:n,"aria-hidden":!0})});case`customize-agent`:return(0,Y.jsx)(`span`,{"data-testid":r,className:z(`inline-flex shrink-0`,n),children:(0,Y.jsx)(ds,{})});case`connect-mcp`:return(0,Y.jsx)(`span`,{"data-testid":r,className:`inline-flex shrink-0`,children:(0,Y.jsx)(Ti,{width:Q,height:Q,className:n,"aria-hidden":!0})});case`join-slack`:return(0,Y.jsx)(`span`,{"data-testid":r,className:`inline-flex shrink-0`,children:(0,Y.jsx)(qr,{width:Q,height:Q,className:n,"aria-hidden":!0})});default:return e}}var ps=z(`inline-flex shrink-0 items-center rounded-md bg-white px-2.5 py-1`,`text-xs font-medium text-black transition-colors hover:bg-white/90`);function ms({id:e,onActionClick:t,onDocsClick:n}){let{t:r}=w(`openhands`),i=di[e],a=li[e],o=ci[e],s=mi[e],c=xi(e);return(0,Y.jsxs)(`div`,{className:`flex w-[280px] flex-col gap-2.5 p-3`,"data-testid":`sidebar-onboarding-checklist-preview-${e}`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Y.jsx)(`span`,{className:`mt-0.5 inline-flex shrink-0 items-center justify-center`,children:(0,Y.jsx)(fs,{id:e})}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 text-sm font-medium text-white`,children:r(i)})]}),(0,Y.jsx)(`p`,{className:`text-xs leading-relaxed text-[var(--oh-muted)]`,children:r(a)}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsxs)(`a`,{href:s,target:`_blank`,rel:`noreferrer`,"data-testid":`sidebar-onboarding-checklist-preview-docs-${e}`,className:`inline-flex min-w-0 items-center gap-2 text-xs text-[var(--oh-muted)] transition-colors hover:text-white hover:underline`,onClick:n,children:[(0,Y.jsx)(Ce,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),r(R.SIDEBAR$ONBOARDING_CHECKLIST_DOCS_LINK)]}),c.kind===`external`?(0,Y.jsx)(`a`,{href:c.href,target:`_blank`,rel:`noreferrer`,"data-testid":`sidebar-onboarding-checklist-preview-action-${e}`,className:ps,onClick:t,children:r(o)}):(0,Y.jsx)(fn,{to:c.href,"data-testid":`sidebar-onboarding-checklist-preview-action-${e}`,className:ps,onClick:t,children:r(o)})]})]})}function hs(e){return e?.profiles.some(e=>e.api_key_set===!0)??!1}function gs(e){let t=e?.agent_settings?.llm,n=typeof t?.model==`string`&&t.model.length>0,r=e?.llm_api_key_set===!0||e?.llm_api_key_is_set===!0||t?.auth_type===`subscription`;return n&&r}function _s(e,t,n,r,i){return!!(hs(r)||t||gs(e))}function vs(e){return Object.keys(Yt(e)).length>0}function ys(){let{isCompleted:e}=Bt(),{currentPath:t}=ln(),n=(0,J.useSyncExternalStore)(gi,yi,()=>!1),[r,i]=(0,J.useState)(fi),[a,o]=(0,J.useState)(hi),[s,c]=(0,J.useState)(ai),{data:l}=Xt(),{isConfigured:u,isLoading:d}=Qn(),{data:f,isLoading:p}=Nr(),{data:m}=ia(1),{data:h}=wi(),{data:g}=Ei({limit:1,offset:0,enabled:h?.status===`ok`});(0,J.useEffect)(()=>{Si(t)&&(a||(vi(!0),o(!0)))},[t,a]);let _=(0,J.useMemo)(()=>{let e=(m?.pages[0]?.items.length??0)>0,t=(g?.total??0)>0;return{"configure-llm":_s(l,u,d,f,p),"connect-mcp":vs(l?.agent_settings?.mcp_config),"start-conversation":e,"schedule-task":t,"customize-agent":a,"join-slack":s}},[g?.total,m?.pages,a,s,u,d,p,f,l,l?.agent_settings?.mcp_config]),v=(0,J.useMemo)(()=>ui.map(e=>({id:e,isComplete:_[e]})),[_]),y=v.filter(e=>e.isComplete).length,b=y===v.length,x=e&&!n&&!b;return{items:v,completedCount:y,totalCount:v.length,isVisible:x,isMinimized:r,dismiss:()=>{si(!0)},toggleMinimized:()=>{i(e=>{let t=!e;return pi(t),t})},markJoinSlackComplete:()=>{s||(bi(!0),c(!0))}}}var bs=`rounded-xl border border-[var(--oh-border)] bg-base-secondary p-0 text-white shadow-xl`,xs=z(`flex min-w-0 w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-sm`,`transition-colors hover:bg-[var(--oh-surface)]`);function Ss({isComplete:e}){return(0,Y.jsx)(`span`,{"aria-hidden":!0,className:z(`inline-flex size-4 shrink-0 items-center justify-center rounded-full border`,e?`border-primary bg-primary text-[var(--oh-color-base)]`:`border-[var(--oh-border)] bg-transparent`),children:e?(0,Y.jsx)(Le,{className:`size-2.5`,strokeWidth:3}):null})}function Cs({id:e,isComplete:t,onActivate:n}){let{t:r}=w(`openhands`),{trackOnboardingLinkClicked:a}=Jt(),o=di[e],s=xi(e),c=ii[e],l=()=>{a({linkId:c,destinationType:_i[e],surface:`landing_checklist`,checklistItem:c,isExternal:s.kind===`external`}),n?.()},u=()=>{a({linkId:`open_docs`,destinationType:`documentation`,surface:`landing_checklist`,checklistItem:c,isExternal:!0})},d=z(xs,t?`text-muted`:`text-content`),f=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ss,{isComplete:t}),(0,Y.jsx)(`span`,{className:z(`min-w-0 flex-1 truncate`,t&&`line-through`),children:r(o)})]});return(0,Y.jsx)(`li`,{children:(0,Y.jsx)(i,{placement:`right-start`,delay:0,closeDelay:100,disableAnimation:!1,className:bs,content:(0,Y.jsx)(ms,{id:e,onActionClick:l,onDocsClick:u}),children:s.kind===`external`?(0,Y.jsx)(`a`,{href:s.href,target:`_blank`,rel:`noreferrer`,"data-testid":`sidebar-onboarding-checklist-item-${e}`,className:d,onClick:l,children:f}):(0,Y.jsx)(fn,{to:s.href,"data-testid":`sidebar-onboarding-checklist-item-${e}`,className:d,onClick:l,children:f})})})}function ws({collapsed:e}){let{t}=w(`openhands`),{items:n,completedCount:r,isVisible:i,isMinimized:a,toggleMinimized:o,markJoinSlackComplete:s}=ys();return e||!i?null:(0,Y.jsxs)(`div`,{"data-testid":`sidebar-onboarding-checklist`,"data-minimized":a?`true`:`false`,className:z(`w-full shrink-0 overflow-hidden rounded-xl border border-[var(--oh-border)]`,`bg-[var(--oh-surface-raised)] shadow-sm`),children:[(0,Y.jsx)(`div`,{className:z(`px-1`,a?`py-1`:`pt-2 pb-1`),children:(0,Y.jsxs)(`div`,{className:z(`relative flex w-full items-center gap-0.5 rounded-md px-1.5`,`transition-colors hover:bg-[var(--oh-surface)]`,a?`py-1`:`py-1.5`),children:[(0,Y.jsx)(`button`,{type:`button`,"data-testid":`sidebar-onboarding-checklist-toggle`,"aria-expanded":!a,"aria-label":t(a?R.SIDEBAR$ONBOARDING_CHECKLIST_EXPAND:R.SIDEBAR$ONBOARDING_CHECKLIST_COLLAPSE),onClick:o,className:`absolute inset-0 z-0 cursor-pointer rounded-md`}),(0,Y.jsx)(`div`,{className:`relative z-10 min-w-0 flex-1 px-0.5 pointer-events-none`,children:(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-semibold text-content`,children:t(R.SIDEBAR$ONBOARDING_CHECKLIST_TITLE)}),(0,Y.jsx)(`span`,{className:`text-xs text-muted`,children:t(R.SIDEBAR$ONBOARDING_CHECKLIST_PROGRESS,{completed:r})})]})}),(0,Y.jsx)(`span`,{"data-testid":`sidebar-onboarding-checklist-chevron`,"aria-hidden":!0,className:z(`relative z-10 inline-flex size-7 shrink-0 items-center justify-center`,`pointer-events-none text-[var(--oh-muted)]`),children:(0,Y.jsx)(Re,{className:z(`size-4 transition-transform motion-reduce:transition-none`,a&&`-rotate-90`)})})]})}),a?null:(0,Y.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2.5 pb-2`,children:n.map(e=>(0,Y.jsx)(Cs,{id:e.id,isComplete:e.isComplete,onActivate:oi(e.id)?s:void 0},e.id))})]})}var $=18,Ts=34,Es=Math.round(Ts*30/46);function Ds({collapsed:e,showCollapseToggle:t,showMobileCloseButton:n=!1,onCloseMobile:r,collapseToggleLabel:i,onCollapse:a,onExpand:o,showCollapsedExpandButton:s,isExtensionsActive:c,currentPath:l,activeBackend:u,activeOrgId:d,activeBackendHealth:f,collapsedBackendPopoverOpen:p,setCollapsedBackendPopoverOpen:m,collapsedBackendPopoverRef:h,collapsedBackendCloseTimer:g,onOpenAddBackend:_,onOpenManageBackends:v}){let{t:y}=w(`openhands`),{pages:b}=Di(),x=g,{isPinnedRoute:S,togglePinnedRoute:C}=pn(),T=(e,t)=>{let n=S(e);return{pinned:n,onToggle:()=>C(e),label:y(n?R.SIDEBAR$UNPIN_AS_HOME:R.SIDEBAR$PIN_AS_HOME),testId:t}},E=u.kind===`cloud`,D=d?`?org=${encodeURIComponent(d)}`:``,O=E?`${u.host.replace(/\/+$/,``)}/settings${D}`:null,k=It()!==null;return(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Y.jsxs)(`div`,{className:yn(e),children:[(0,Y.jsxs)(`div`,{className:z(e&&t?bn:`flex min-w-0 shrink-0 items-center`),children:[(0,Y.jsx)(`div`,{className:z(e&&t&&`flex h-full w-full items-center justify-start pl-2.5 transition-opacity duration-150`,e&&s&&`opacity-0`),children:(0,Y.jsx)(Mi,{logoWidth:Ts,logoHeight:Es,logoClassName:`max-w-none`,className:z(hn,`overflow-visible`)})}),e&&t?(0,Y.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":i,onClick:o,className:z(xn,s?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),children:(0,Y.jsx)(W,{width:14,height:14})}):null]}),!e&&t?(0,Y.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":i,onClick:a,className:z(`hidden md:inline-flex ml-auto`,vn,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,Y.jsx)(Be,{width:14,height:14})}):null,!e&&n?(0,Y.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-drawer-close`,onClick:r,"aria-label":y(R.SIDEBAR$CLOSE_MENU),className:z(`inline-flex ml-auto`,vn,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,Y.jsx)(Be,{width:14,height:14})}):null]}),(0,Y.jsxs)(`nav`,{className:gn(e),children:[(0,Y.jsx)(Zi,{collapsed:e}),(0,Y.jsx)(On,{to:`/conversations`,end:!0,label:y(R.SIDEBAR$NEW_CHAT),testId:`sidebar-conversations-link`,collapsed:e,icon:(0,Y.jsx)(Ot,{width:$,height:$})}),(0,Y.jsx)(On,{to:mn,label:y(R.NAV$CUSTOMIZE),testId:`sidebar-skills-link`,collapsed:e,forceActive:c,pinAction:T(mn,`sidebar-pin-home-toggle-customize`),icon:(0,Y.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,Y.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,Y.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,Y.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,Y.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,Y.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,Y.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,Y.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,Y.jsx)(`path`,{d:`m17 16.5v5.17`}),(0,Y.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,Y.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,Y.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,Y.jsx)(`path`,{d:`M12 13.5V8`})]})}),Kt()&&(0,Y.jsx)(On,{to:Wt(),label:Ut().sidebarLabel,testId:`sidebar-automations-link`,collapsed:e,icon:(0,Y.jsx)(Fo,{width:$,height:$}),pinAction:T(Wt(),`sidebar-pin-home-toggle-automations`)}),b.map(t=>(0,Y.jsx)(On,{to:t.href,label:t.contribution.nav_label||t.contribution.title,testId:`sidebar-canvas-extension-${t.extension.name}-${t.contribution.id}`,collapsed:e,icon:(0,Y.jsx)(_t,{width:$,height:$})},`${t.extension.name}:${t.contribution.id}`))]}),(0,Y.jsx)(us,{collapsed:e}),e&&t?(0,Y.jsxs)(`nav`,{className:z(gn(e),`mt-auto pb-2 cursor-pointer`),children:[(0,Y.jsx)(An,{content:y(R.SIDEBAR$SETTINGS),placement:`right`,children:E&&O?(0,Y.jsxs)(`a`,{href:O,target:k?void 0:`_blank`,rel:k?void 0:`noopener noreferrer`,"data-testid":`collapsed-settings-link`,"aria-label":y(R.SIDEBAR$SETTINGS),className:_n({collapsed:!0}),children:[(0,Y.jsx)(En,{active:!1,children:(0,Y.jsx)(yt,{width:$,height:$})}),(0,Y.jsx)(`span`,{className:Sn(!0),children:y(R.SIDEBAR$SETTINGS)})]}):(0,Y.jsxs)(fn,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":y(R.SIDEBAR$SETTINGS),className:_n({collapsed:!0}),children:[(0,Y.jsx)(En,{active:l.startsWith(`/settings`),children:(0,Y.jsx)(yt,{width:$,height:$})}),(0,Y.jsx)(`span`,{className:Sn(!0),children:y(R.SIDEBAR$SETTINGS)})]})}),(0,Y.jsxs)(`div`,{className:`relative`,ref:h,onMouseEnter:()=>{x.current&&=(clearTimeout(x.current),null),m(!0)},onMouseLeave:()=>{x.current=setTimeout(()=>m(!1),150)},children:[(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`collapsed-backend-selector-link`,"aria-label":y(R.BACKEND$MANAGE),"aria-expanded":p,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:z(_n({collapsed:!0}),`relative`),children:[(0,Y.jsx)(En,{active:p,children:(0,Y.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,Y.jsx)(Ct,{isConnected:f?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,Y.jsx)(ve,{width:$,height:$})]})}),(0,Y.jsx)(`span`,{className:Sn(!0),children:y(R.BACKEND$MANAGE)})]}),p?(0,Y.jsx)(`div`,{className:`absolute bottom-[-4px] left-full pl-2.5 z-40 w-[272px]`,onClick:e=>e.stopPropagation(),children:(0,Y.jsx)(Ji,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>m(!1),onOpenAddBackend:_,onOpenManageBackends:v})}):null]})]}):null,e?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`mb-2 shrink-0 pr-2.5`,children:(0,Y.jsx)(ws,{collapsed:e})}),(0,Y.jsxs)(`div`,{className:z(`flex flex-col items-stretch max-w-none box-border shrink-0 gap-2`,`-ml-2.5 w-[calc(100%+0.625rem)] border-t border-[var(--oh-border)] pt-2 px-2.5`),children:[(0,Y.jsx)(ra,{hideWhenUpToDate:!0}),(0,Y.jsx)(Ji,{sidebarCollapsed:e,openUpward:!0})]})]})]})}var Os=J.lazy(()=>a(()=>import(`./settings-modal-djXuAnBO.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,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69]))),ks=J.lazy(()=>a(()=>Promise.resolve().then(()=>Bi).then(e=>({default:e.AddBackendModal})),void 0)),As=J.lazy(()=>a(()=>import(`./manage-backends-modal-DqCJohsX.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([70,1,2,3,4,5,6,7,8,9,10,13,71,72,73,20,22,52,53,54,55,23,74,33,75,32,41,17,36,40,38,76,16,39,77,78,79,80,81,82]))),js=250;function Ms(){let{t:e}=w(`openhands`),{currentPath:t}=ln(),{data:n}=Ht(),{data:r,error:i,isError:a,isFetching:o}=Xt(),{backends:s,active:c}=ee(),l=zt(s)[c.backend.id],u=bt(e=>e.collapsed),d=bt(e=>e.setCollapsed),[f,p]=J.useState(!1),[m,h]=J.useState(!1),g=J.useRef(null),[_,v]=J.useState(!1),[y,b]=J.useState(!1),[x,S]=J.useState(!1),C=J.useRef(!1),[,T]=J.useReducer(e=>e+1,0),{isOpen:E,close:D}=Dr(),[O,k]=J.useState(!1),[A,j]=J.useState(!1),M=Mr(()=>h(!1)),N=Zt(i);J.useEffect(()=>{D()},[t,D]),J.useEffect(()=>{if(E){k(!0);let e=requestAnimationFrame(()=>{j(!0)});return()=>cancelAnimationFrame(e)}j(!1);let e=window.setTimeout(()=>{k(!1)},js);return()=>window.clearTimeout(e)},[E]),J.useEffect(()=>{if(!E)return;let e=e=>{e.key===`Escape`&&D()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[E,D]),J.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&N!==404?te(e(R.SETTINGS$FETCH_ERROR)):N===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,N,n?.feature_flags?.hide_llm_settings,e]);let P=e(u?R.SIDEBAR$EXPAND:R.SIDEBAR$COLLAPSE),ne=J.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]),F={collapseToggleLabel:P,onCollapse:J.useCallback(()=>{S(!1),C.current=!0,T(),d(!0),window.setTimeout(()=>{C.current=!1,T()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&x&&!C.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/apps`||t===`/mcp`,currentPath:t,activeBackend:c.backend,activeOrgId:c.orgId,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:M,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>v(!0),onOpenManageBackends:()=>b(!0)};return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`aside`,{"aria-label":e(R.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:ne,onMouseEnter:()=>{u&&S(!0)},onMouseLeave:()=>{S(!1)},className:z(`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,Y.jsx)(Ds,{collapsed:u,showCollapseToggle:!0,...F})}),O?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:z(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,A?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${js}ms`},onClick:D,"aria-hidden":!A}),(0,Y.jsx)(`aside`,{"aria-label":e(R.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!A,className:z(`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`,A?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${js}ms`},children:(0,Y.jsx)(Ds,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:D,...F})})]}):null,f&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(Os,{settings:r,onClose:()=>p(!1)})}),_&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(ks,{onClose:()=>v(!1)})}),y&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(As,{onClose:()=>b(!1)})})]})}var Ns=`/settings`,Ps=`/customize`,Fs=[`/skills`,`/mcp`,`/plugins`],Is=`/apps`;function Ls(e){return e===Ns?{mode:`menu`}:e.startsWith(`${Ns}/`)&&e.length>9?{mode:`back`,backTo:Ns,backLabelKey:R.SETTINGS$TITLE}:e===Ps?{mode:`menu`}:e===Is||Fs.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:Ps,backLabelKey:R.NAV$CUSTOMIZE}:{mode:`menu`}}function Rs(){let{t:e}=w(`openhands`),{currentPath:t,navigate:n}=ln(),r=Ls(t);return(0,Y.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(R.SIDEBAR$NAVIGATION_LABEL),children:[(0,Y.jsx)(Ar,{}),r.mode===`back`&&r.backTo?(0,Y.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-back-button`,onClick:()=>n(r.backTo),"aria-label":e(r.backLabelKey??R.COMMON$BACK),className:Or,children:(0,Y.jsx)(Be,{size:20,className:Tr,"aria-hidden":!0,strokeWidth:2})}):null]})}function zs(){let{backend:e}=P(),t=e.kind===`local`,{data:n}=Nr(),{mutate:r,isPending:i}=Mt(),a=(0,J.useRef)(null);(0,J.useEffect)(()=>{a.current=null},[e.id]),(0,J.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])}function Bs(){let{backend:e}=P(),t=e.kind===`local`&&!ae(e),{data:n,isLoading:r,isError:i}=Xt(),{mutate:a}=Qt(),o=(0,J.useRef)(null);(0,J.useEffect)(()=>{o.current=null},[e.id]),(0,J.useEffect)(()=>{if(!t||r||i||!n||o.current===e.id)return;o.current=e.id;let s=gr(hr(n));s&&a(s)},[t,r,i,n,e.id,a])}var Vs=()=>{let{backend:e}=P(),{data:t}=Xt(),{mutate:n,isPending:r}=Qt(`personal`,{retry:2}),i=J.useSyncExternalStore(I,N,()=>null),a=J.useRef(null);J.useEffect(()=>{if(t!==void 0){if(i!==null){if((t.user_consents_to_analytics===!0?`granted`:t.user_consents_to_analytics===!1?`denied`:null)===i){a.current=null,e.kind===`cloud`&&M(i);return}if(e.kind!==`cloud`)return;let o=`${e.id}:${i}`;if(r||a.current===o)return;a.current=o,n({user_consents_to_analytics:i===`granted`});return}t.user_consents_to_analytics!==null&&D(t.user_consents_to_analytics===!0?`granted`:`denied`,{syncToCloud:!1})}},[e.id,e.kind,r,i,n,t])};function Hs(){let{backend:e}=P(),t=J.useSyncExternalStore(I,k,()=>`pending`),n=J.useRef(null);J.useEffect(()=>{let r=t===`pending`?ne():null;if(e.kind!==`local`||t===`pending`&&!r)return;let i=t===`granted`?`granted`:`denied`,a=t===`pending`?r:``,o=`${e.id}:${e.host}:${e.apiKey??``}:${i}:${a}`;n.current!==o&&(n.current=o,qt.syncTelemetryConsent(i).catch(()=>{}))},[e.apiKey,e.host,e.id,e.kind,t])}var Us=`agent_canvas_cloud_cookie_backend_added`,Ws=new Set;function Gs(e,t){return`${Us}:${e}:${t}`}function Ks(e,t){let n=Gs(e,t);if(typeof window>`u`)return!0;try{return window.sessionStorage.getItem(n)===`true`||Ws.has(n)}catch{return Ws.has(n)}}function qs(e,t){let n=Gs(e,t);if(!(typeof window>`u`))try{window.sessionStorage.setItem(n,`true`)}catch{Ws.add(n)}}var Js=()=>{let{backend:e,orgId:t}=P(),{data:n}=Xt(),{trackBackendAdded:r}=Jt(),i=J.useRef(r),a=tr(),o=e.kind===`cloud`?a[e.id]:void 0,s=o?.isLoading??!0,c=o?.userId??null,l=(n?.email||n?.git_user_email)?.trim()||void 0;J.useEffect(()=>{i.current=r},[r]),J.useEffect(()=>{if(e.kind!==`cloud`){A(null);return}if(!s){if(!c){A(null),F(null);return}A({userId:c,email:l,orgId:t}),F(c,l?{email:l}:{}),e.authMode===`cookie`&&l&&!Ks(e.id,c)&&(i.current({backendKind:`cloud`,connectionMethod:`cloud_cookie`,hasApiKey:!1,source:`cloud_auto_connect`}),qs(e.id,c))}},[e.authMode,e.connectionRevision,e.id,e.kind,l,s,t,c])};function Ys(e){switch(e){case L.RUNNING:return`🟢`;case L.FINISHED:case L.IDLE:case L.WAITING_FOR_CONFIRMATION:return`✅`;case L.PAUSED:return`⚪`;case L.ERROR:case L.STUCK:return`🔴`;default:return null}}var Xs=`OpenHands`,Zs=()=>{let{conversationId:e}=s(),{data:t}=ki(e??null),n=xr(t=>e?t.executionStatusByConversation[e]??null:null),r=t?.title,i=e&&r?`${r} | ${Xs}`:Xs;if(!e)return i;let a=Ys(n??t?.execution_status??null);return a?`${a} ${i}`:i};function Qs({children:e}){let{pathname:t}=c(),n=f(),r=_(),i=u(),a=J.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,Y.jsx)(un,{value:J.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var $s=J.lazy(()=>a(()=>import(`./environment-switch-overlay-Dwe78wRl.js`),__vite__mapDeps([83,1,2,22,7,84,10]))),ec=J.lazy(()=>a(()=>import(`./alert-banner-BkVt_8Or.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([85,1,2,86,5,6,22,7,87,88,10,16,89,50,45]))),tc=J.lazy(()=>a(()=>import(`./command-menu-mehU3Evb.js`).then(e=>({default:e.CommandMenu})),__vite__mapDeps([90,1,2,53,5,6,91,92,3,4,7,8,9,10,13,93,55,94,95,96,28,97,98,99,22,36,17,100,33,101,12,102,23,103,104,105,106,107,45,34,52,54,16]))),nc=h(function(){let e=m(),{t}=w(`openhands`);return d(e)?(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h1`,{children:e.status}),(0,Y.jsx)(`p`,{children:e.statusText}),(0,Y.jsx)(`pre`,{children:e.data instanceof Object?JSON.stringify(e.data):e.data})]}):e instanceof Error?(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h1`,{children:t(R.ERROR$GENERIC)}),(0,Y.jsx)(`pre`,{children:e.message})]}):(0,Y.jsx)(`div`,{children:(0,Y.jsx)(`h1`,{children:t(R.ERROR$UNKNOWN)})})}),rc=p(function(){let e=c(),t=Zs(),{data:n}=Xt(),r=Ht();if(Hs(),Vs(),Js(),zs(),Bs(),J.useEffect(()=>{n?.language&&j.changeLanguage(n.language)},[n?.language]),r.isLoading)return(0,Y.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-base`,children:(0,Y.jsx)(Vt,{size:`large`})});let i=/^\/conversations\/[^/]+/.test(e.pathname),a=st(e.search);return(0,Y.jsx)(Qs,{children:(0,Y.jsx)(Oi,{children:(0,Y.jsxs)(Sr,{children:[(0,Y.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,Y.jsx)(`title`,{children:t}),(0,Y.jsx)(Ms,{}),(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-col w-full min-w-0 h-full gap-3`,children:[i?null:(0,Y.jsx)(Rs,{}),r.data&&(r.data.maintenance_start_time||r.data.faulty_models&&r.data.faulty_models.length>0||r.data.error_message)&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(ec,{maintenanceStartTime:r.data.maintenance_start_time,faultyModels:r.data.faulty_models,errorMessage:r.data.error_message,updatedAt:r.data.updated_at})}),(0,Y.jsx)(`div`,{id:`root-outlet`,className:`relative flex-1 overflow-auto px-0 custom-scrollbar`,children:(0,Y.jsx)(g,{})})]})]}),(0,Y.jsxs)(J.Suspense,{fallback:null,children:[(0,Y.jsx)($s,{}),(0,Y.jsx)(tc,{})]}),a?(0,Y.jsx)(ft,{}):null]})})})});export{nc as ErrorBoundary,rc as default};
|