@openhands/agent-canvas 1.18.0 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (420) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/acp-providers-DOKcGeaV.js +1 -0
  4. package/build/assets/active-backend-context-BETEdaJl.js +2 -0
  5. package/build/assets/{agent-context-settings-D3peZkjX.js → agent-context-settings-Dir0loAn.js} +1 -1
  6. package/build/assets/{agent-profiles-service.api-DkeZaqIl.js → agent-profiles-service.api-CiMVQAIT.js} +1 -1
  7. package/build/assets/{agent-profiles-settings-7yMWYjGF.js → agent-profiles-settings-CT5owzRT.js} +1 -1
  8. package/build/assets/agent-server-conversation-service.api-BtOlitCD.js +88 -0
  9. package/build/assets/agent-settings-BnzyTgCb.js +2 -0
  10. package/build/assets/agent-settings-CeXj3xK-.js +1 -0
  11. package/build/assets/{alert-banner-eYyqvHL3.js → alert-banner-Ccx1Du6n.js} +1 -1
  12. package/build/assets/{api-key-entry-screen-CCBvBD8u.js → api-key-entry-screen-DXIuzBjY.js} +1 -1
  13. package/build/assets/{app-settings-BtYDs-Be.js → app-settings-DkIJVTKL.js} +1 -1
  14. package/build/assets/automation-detail-CF2SweVs.js +3 -0
  15. package/build/assets/automation-disabled-reason-QFtMrdOr.js +1 -0
  16. package/build/assets/{automation-export-BJsfi7n2.js → automation-export-CkvehhPF.js} +1 -1
  17. package/build/assets/{automation-git-sync-B7o_Nbl-.js → automation-git-sync-di4tBAyZ.js} +1 -1
  18. package/build/assets/automation-setup-route-FERj7WEe.js +3 -0
  19. package/build/assets/{automation-templates-Bb98r-kx.js → automation-templates-DlaCRvD-.js} +1 -1
  20. package/build/assets/automations-list-yK7ETmYP.js +1 -0
  21. package/build/assets/{back-nav-button-B2yBiVMB.js → back-nav-button-oDvIxpQ5.js} +1 -1
  22. package/build/assets/backend-form-modal-DzYf_arO.js +1 -0
  23. package/build/assets/{backend-synced-settings-badge-DLEp6cq7.js → backend-synced-settings-badge-DXDDHWX4.js} +1 -1
  24. package/build/assets/{badge-ehL-kgeO.js → badge-CDHZEVeN.js} +1 -1
  25. package/build/assets/{base-modal-C1a0TsSx.js → base-modal-CZq4kB_H.js} +1 -1
  26. package/build/assets/{brand-button-CUMfjb99.js → brand-button-CGUwj6zK.js} +1 -1
  27. package/build/assets/{browser-SE24Tk8g.js → browser-kY6jN61T.js} +2 -2
  28. package/build/assets/{browser-tab-HjJxHA0V.js → browser-tab-DFyZXsnB.js} +1 -1
  29. package/build/assets/{canvas-extension-page-BsUGBb1T.js → canvas-extension-page-DsGq1DtT.js} +1 -1
  30. package/build/assets/{canvas-extensions-C9Tm6s_E.js → canvas-extensions-Cb2Z0Hdc.js} +1 -1
  31. package/build/assets/{canvas-extensions-runtime-B8kxM4rO.js → canvas-extensions-runtime-DS6eT4nK.js} +1 -1
  32. package/build/assets/{chat-send-button-CGvc2wpE.js → chat-send-button-B6aVaD9V.js} +1 -1
  33. package/build/assets/{circle-plus-check-toggle-BDX_ctNs.js → circle-plus-check-toggle-ZOXpJ3I2.js} +1 -1
  34. package/build/assets/{cloud-funnel-analytics-D5uJ_4JE.js → cloud-funnel-analytics-BH_zxjiO.js} +1 -1
  35. package/build/assets/{cog-CAEugqtV.js → cog-DVZT1f0s.js} +1 -1
  36. package/build/assets/{command-menu-CQxs4mtX.js → command-menu-ImeHQ6c2.js} +1 -1
  37. package/build/assets/{commits-tab-D0xgjipP.js → commits-tab-B5SUF66c.js} +1 -1
  38. package/build/assets/{condenser-settings-D63NJRBT.js → condenser-settings-BlGOXEXM.js} +1 -1
  39. package/build/assets/{confirmation-modal-78sd9Vny.js → confirmation-modal-oN1EId79.js} +1 -1
  40. package/build/assets/{context-menu-list-item-Cm7-7Y-7.js → context-menu-list-item-DIm5xQg6.js} +1 -1
  41. package/build/assets/{conversation-B_nweu5p.js → conversation-9a53tdbO.js} +4 -4
  42. package/build/assets/conversation-XRsI28ZM.js +1 -0
  43. package/build/assets/conversation-panel-XRsI28ZM.js +1 -0
  44. package/build/assets/{conversation-state-store-9D_3P7q4.js → conversation-state-store-Br-eE-gg.js} +1 -1
  45. package/build/assets/{conversation-tab-empty-state-B3dpJXX0.js → conversation-tab-empty-state-BT1GrnKP.js} +1 -1
  46. package/build/assets/{copy-to-clipboard-button-B1ljgNxO.js → copy-to-clipboard-button-CvTHqY13.js} +1 -1
  47. package/build/assets/{device-verify-D5QRIS_x.js → device-verify-DX0xdNjo.js} +1 -1
  48. package/build/assets/{dropdown-classes-BGvOvW2_.js → dropdown-classes-DyyMaaXl.js} +1 -1
  49. package/build/assets/edit-automation-modal-bfD-5NIc.js +1 -0
  50. package/build/assets/empty-state-B5advKVW.js +1 -0
  51. package/build/assets/{entry.client-BMafTpjO.js → entry.client-D_2gnSyB.js} +2 -2
  52. package/build/assets/{enum-filter-dropdown-UNaom12H.js → enum-filter-dropdown-VAJp5mqh.js} +1 -1
  53. package/build/assets/{environment-switch-overlay-COibRUA-.js → environment-switch-overlay-C7x_yhEs.js} +1 -1
  54. package/build/assets/{error-state-Cf8LRuuY.js → error-state-BgYl7YeB.js} +1 -1
  55. package/build/assets/{extensions-hub-C_6ahIua.js → extensions-hub-DjhOed1I.js} +1 -1
  56. package/build/assets/{extensions-navigation-C5GfpzFe.js → extensions-navigation-Di-J2KUR.js} +1 -1
  57. package/build/assets/{files-tab-D5PPIWI1.js → files-tab-BNDp3e_x.js} +1 -1
  58. package/build/assets/{form-control-classes-Dbq-7YP_.js → form-control-classes-BVI_szaj.js} +1 -1
  59. package/build/assets/{get-git-path-jU2zjqIB.js → get-git-path-DOe6PM_a.js} +1 -1
  60. package/build/assets/git-repo-dropdown-1fZGYtYm.js +1 -0
  61. package/build/assets/{git-repo-dropdown-uxlFw2gn.js → git-repo-dropdown-DNlinQ7r.js} +1 -1
  62. package/build/assets/{highlighted-source-view-C7pAXrT0.js → highlighted-source-view-DPerL6tF.js} +1 -1
  63. package/build/assets/home-4lyLzYjG.js +1 -0
  64. package/build/assets/home-BGaB0EeK.js +1 -0
  65. package/build/assets/home-automation-run-tooltip-v5n7zXR0.js +1 -0
  66. package/build/assets/{home-store-DCbei3DX.js → home-store-roz1x6D5.js} +1 -1
  67. package/build/assets/{hooks-service-Dnmhqc0Z.js → hooks-service-tzRqtAlm.js} +1 -1
  68. package/build/assets/index-home-6Y_Y7kOo.js +1 -0
  69. package/build/assets/{install-server-modal-B81I-5OE.js → install-server-modal-DkMCfj0J.js} +1 -1
  70. package/build/assets/{key-O84CMFHb.js → key-DpfBWQbk.js} +1 -1
  71. package/build/assets/{launch-ZLxI4opd.js → launch-TrnYlJe6.js} +1 -1
  72. package/build/assets/link-external-B4gx3EeM.js +1 -0
  73. package/build/assets/llm-not-configured-banner-BdjItKQR.js +27 -0
  74. package/build/assets/{llm-settings-CODhjQzy.js → llm-settings-CUgt39uu.js} +1 -1
  75. package/build/assets/llm-settings-DEfw-fUJ.js +1 -0
  76. package/build/assets/{llm-subscription-service-CgIDc38n.js → llm-subscription-service-LGYVzyAc.js} +1 -1
  77. package/build/assets/{loading-spinner-BeLV0IXf.js → loading-spinner-BJc2J0Dw.js} +1 -1
  78. package/build/assets/{manage-backends-modal-cMXqCb-B.js → manage-backends-modal-CIjk0B2H.js} +1 -1
  79. package/build/assets/manifest-23d79467.js +1 -0
  80. package/build/assets/{manifest-subpage-layout-CVZgVKoY.js → manifest-subpage-layout-DGYRoP_8.js} +1 -1
  81. package/build/assets/{markdown-renderer-DyFl9-mL.js → markdown-renderer-DRpwRlNm.js} +1 -1
  82. package/build/assets/mcp-CoUOIGBF.js +1 -0
  83. package/build/assets/mcp-installed-servers-BW51n6PC.js +1 -0
  84. package/build/assets/mcp-marketplace-utils-BwEnDYqm.js +1 -0
  85. package/build/assets/mcp-page-hZ4aJjj_.js +9 -0
  86. package/build/assets/{messages-Bk1xhbU2.js → messages-WUb9Yh-p.js} +4 -4
  87. package/build/assets/{modal-body-C24WsdFb.js → modal-body-B_95ci1c.js} +1 -1
  88. package/build/assets/{modal-classes-B0b9eiL8.js → modal-classes-BPcBCWVj.js} +1 -1
  89. package/build/assets/{modal-close-button-DfqfB2Nj.js → modal-close-button-Cq3dma5u.js} +1 -1
  90. package/build/assets/onboarding-Cc4Av7bi.js +1 -0
  91. package/build/assets/{onboarding-modal-BT3Gx_sZ.js → onboarding-modal-DCFD4Dsa.js} +1 -1
  92. package/build/assets/{organization-service.api-B5CvmnYQ.js → organization-service.api-zhHpQU0t.js} +1 -1
  93. package/build/assets/parse-git-remote-url-BG8pcKL8.js +1 -0
  94. package/build/assets/{planner-tab-CstoOlAB.js → planner-tab-yISBVUKu.js} +1 -1
  95. package/build/assets/{plugins-management-service-5rqVPEGN.js → plugins-management-service-2oP6_tWr.js} +1 -1
  96. package/build/assets/{profiles-service.api-D1XKMgr0.js → profiles-service.api-B5thiTI3.js} +1 -1
  97. package/build/assets/{providers-XmZ9HM4Q.js → providers-Co9PsD0s.js} +1 -1
  98. package/build/assets/{proxy-XP6U1Dhv.js → proxy-BCCQUna8.js} +1 -1
  99. package/build/assets/recommended-automations-launcher-D1Do753p.js +1 -0
  100. package/build/assets/root-D1y82Lhg.js +2 -0
  101. package/build/assets/{root-layout-DUquNZTU.js → root-layout-cQTYEG2w.js} +2 -2
  102. package/build/assets/root-sEWn3ha1.css +1 -0
  103. package/build/assets/{schema-field-Y3F8JvXd.js → schema-field-DSi0d7a8.js} +1 -1
  104. package/build/assets/{sdk-section-page-CNZTLwH9.js → sdk-section-page-DCoI2dtd.js} +1 -1
  105. package/build/assets/{secret-form-9-BoGA40.js → secret-form-BDvzojzN.js} +1 -1
  106. package/build/assets/{secrets-service-BOIsfD9j.js → secrets-service-C3CNNEpY.js} +1 -1
  107. package/build/assets/{secrets-settings-CBJgFr42.js → secrets-settings-BKqfYQt5.js} +1 -1
  108. package/build/assets/{settings-D4hdToD4.js → settings-C8ZLONyx.js} +1 -1
  109. package/build/assets/{settings-dropdown-input-DBvsZ7-Q.js → settings-dropdown-input-Df_HXRk4.js} +1 -1
  110. package/build/assets/{settings-index-DeQphyBK.js → settings-index-BWvlGHg3.js} +1 -1
  111. package/build/assets/{settings-input-dVuzapBA.js → settings-input-B3i5U9GL.js} +1 -1
  112. package/build/assets/{settings-list-classes-DhAPuXm6.js → settings-list-classes-DbqcSiVW.js} +1 -1
  113. package/build/assets/{settings-modal-tHiJ8iYV.js → settings-modal-DHKJSBPL.js} +1 -1
  114. package/build/assets/{settings-nav-GAQjW1a-.js → settings-nav-BThjwLWD.js} +1 -1
  115. package/build/assets/{settings-service.api-C1vZH9Vh.js → settings-service.api-CYBTLGOd.js} +1 -1
  116. package/build/assets/{settings-switch-DDd1cQ8t.js → settings-switch-CI93Iozg.js} +1 -1
  117. package/build/assets/{shared-conversation-Cyg7m7ns.js → shared-conversation-C7OILS-U.js} +1 -1
  118. package/build/assets/{sidebar-layout-DH0E-5KW.js → sidebar-layout-Csb6Geq0.js} +1 -1
  119. package/build/assets/{sidebar-mobile-menu-toggle-CQ4iky__.js → sidebar-mobile-menu-toggle-B2xwXm4s.js} +1 -1
  120. package/build/assets/{sidebar-nav-link-oLQiKUBu.js → sidebar-nav-link-Xv7QEMVS.js} +1 -1
  121. package/build/assets/{sidebar-onboarding-checklist-storage-TfvNNnnr.js → sidebar-onboarding-checklist-storage-_zxMqHS0.js} +1 -1
  122. package/build/assets/{skill-card-pill-row-DfjIfj0K.js → skill-card-pill-row-CxOFySng.js} +1 -1
  123. package/build/assets/{skill-enablement-DXeaImBz.js → skill-enablement-BBKya60C.js} +1 -1
  124. package/build/assets/{skill-filter-DsNLmn76.js → skill-filter-BvtbD--b.js} +1 -1
  125. package/build/assets/{skill-icon-badge-0MK_68Nc.js → skill-icon-badge-CVxE42yg.js} +1 -1
  126. package/build/assets/{skill-scope-BE-H9TSZ.js → skill-scope-C0NxJnpT.js} +1 -1
  127. package/build/assets/{skills-plugins-vzSdxSk_.js → skills-plugins-BGjX4jve.js} +1 -1
  128. package/build/assets/{skills-settings-BiPOH9H9.js → skills-settings-d3ZwIjSP.js} +1 -1
  129. package/build/assets/{styled-tooltip-CejG0rqv.js → styled-tooltip-CknPQH4Y.js} +1 -1
  130. package/build/assets/{task-list-tab-OkZSqnTp.js → task-list-tab-CQisRcPh.js} +1 -1
  131. package/build/assets/{terminal-Dph60VFZ.js → terminal-Bs50gJPC.js} +1 -1
  132. package/build/assets/{toggle-switch-B2uXaAUS.js → toggle-switch-D3TBxlsc.js} +1 -1
  133. package/build/assets/trash-D1QMHInX.js +1 -0
  134. package/build/assets/{typography-DgcLGdHk.js → typography-BdAApXGl.js} +1 -1
  135. package/build/assets/{usage-tab-MCmNRAnR.js → usage-tab-ClVHAFJy.js} +1 -1
  136. package/build/assets/{use-acp-credential-form-ychoGqjC.js → use-acp-credential-form-GfqcTJl5.js} +1 -1
  137. package/build/assets/{use-activate-agent-profile-8L8Xdghy.js → use-activate-agent-profile-DO6SNPkK.js} +1 -1
  138. package/build/assets/{use-agent-profiles-Bi8hSkze.js → use-agent-profiles-YsBlt3tT.js} +1 -1
  139. package/build/assets/{use-automation-health-U99vvHxx.js → use-automation-health-CbQ9n-k7.js} +1 -1
  140. package/build/assets/{use-automation-permissions-Buus0R6h.js → use-automation-permissions-gFy-2VD0.js} +1 -1
  141. package/build/assets/{use-automations-Bq5hVuv0.js → use-automations-7_XBXHQK.js} +1 -1
  142. package/build/assets/{use-can-manage-org-profiles-MzIeEV8F.js → use-can-manage-org-profiles-Dt4YkPO7.js} +1 -1
  143. package/build/assets/{use-canvas-extensions-Ca9KoVEm.js → use-canvas-extensions-BhYQrtMK.js} +1 -1
  144. package/build/assets/{use-cloud-current-user-id-B4ZLUZSa.js → use-cloud-current-user-id-Dqw6qQUg.js} +1 -1
  145. package/build/assets/{use-config-l5tkDHyD.js → use-config-BJ_FJCjV.js} +1 -1
  146. package/build/assets/use-create-conversation-D15Px574.js +1 -0
  147. package/build/assets/use-create-secret-D_qPU88t.js +1 -0
  148. package/build/assets/{use-free-models-gCsJ5BV0.js → use-free-models-FAk2nngq.js} +1 -1
  149. package/build/assets/{use-get-secrets-CMTuWEp_.js → use-get-secrets-Pbo9jh2A.js} +1 -1
  150. package/build/assets/{use-llm-configured-Dl4zg8ht.js → use-llm-configured-DF9BYmIe.js} +1 -1
  151. package/build/assets/{use-llm-profiles-SWsuFmFu.js → use-llm-profiles-U4u1gzuk.js} +1 -1
  152. package/build/assets/use-manifest-capabilities-D81_YdAF.js +1 -0
  153. package/build/assets/{use-onboarding-completion-Xl63ZvzQ.js → use-onboarding-completion-C4W-m2Jk.js} +1 -1
  154. package/build/assets/{use-pinned-home-route-BXDIUaxQ.js → use-pinned-home-route-DByWTojw.js} +1 -1
  155. package/build/assets/{use-plugins-marketplace-BIIaPiaB.js → use-plugins-marketplace-CTRoukH0.js} +1 -1
  156. package/build/assets/{use-save-agent-profile-D-ZHHE94.js → use-save-agent-profile-xpHBxMZM.js} +1 -1
  157. package/build/assets/{use-save-settings-Dapkf4cC.js → use-save-settings-CmX41wlf.js} +1 -1
  158. package/build/assets/{use-settings-C2KKQKVC.js → use-settings-D69cw06D.js} +1 -1
  159. package/build/assets/{use-settings-nav-items-TOc0Rsfd.js → use-settings-nav-items-CVz0SnDr.js} +1 -1
  160. package/build/assets/use-tracking-BAFpgpgq.js +3 -0
  161. package/build/assets/{use-user-conversation-5UFqMoO4.js → use-user-conversation-BBDXUbOc.js} +1 -1
  162. package/build/assets/utils-CbjwNcR-.js +1 -0
  163. package/build/assets/{vendor~browser-hbU4u2Ag.js → vendor~browser-BZ-zIfb6.js} +1 -1
  164. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js +2 -0
  165. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js → vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js} +1 -1
  166. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js +48 -0
  167. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js} +3579 -165
  168. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js} +794 -227
  169. package/build/assets/{verification-settings-DdBpaVPz.js → verification-settings-BXspn27q.js} +1 -1
  170. package/build/index.html +4 -4
  171. package/build/locales/ar/openhands.json +18 -1
  172. package/build/locales/ca/openhands.json +18 -1
  173. package/build/locales/de/openhands.json +18 -1
  174. package/build/locales/en/openhands.json +18 -1
  175. package/build/locales/es/openhands.json +18 -1
  176. package/build/locales/fr/openhands.json +18 -1
  177. package/build/locales/it/openhands.json +18 -1
  178. package/build/locales/ja/openhands.json +18 -1
  179. package/build/locales/ko-KR/openhands.json +18 -1
  180. package/build/locales/no/openhands.json +18 -1
  181. package/build/locales/pt/openhands.json +18 -1
  182. package/build/locales/tr/openhands.json +18 -1
  183. package/build/locales/uk/openhands.json +18 -1
  184. package/build/locales/zh-CN/openhands.json +18 -1
  185. package/build/locales/zh-TW/openhands.json +18 -1
  186. package/config/defaults.json +3 -3
  187. package/dist/api/agent-profiles-service/profile-field-support.d.ts +2 -0
  188. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs +3 -3
  189. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs.map +1 -1
  190. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js +12 -16
  191. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js.map +1 -1
  192. package/dist/components/features/automations/agent-profile-selector.d.ts +7 -0
  193. package/dist/components/features/automations/detail/disabled-reason-banner.d.ts +16 -0
  194. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
  195. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
  196. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +38 -29
  197. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
  198. package/dist/components/features/settings/agent-profiles/profile-scope-list.d.ts +20 -0
  199. package/dist/config/defaults.cjs +1 -1
  200. package/dist/config/defaults.cjs.map +1 -1
  201. package/dist/config/defaults.js +3 -3
  202. package/dist/config/defaults.js.map +1 -1
  203. package/dist/constants/acp-providers.cjs +1 -1
  204. package/dist/constants/acp-providers.cjs.map +1 -1
  205. package/dist/constants/acp-providers.d.ts +0 -5
  206. package/dist/constants/acp-providers.js +20 -16
  207. package/dist/constants/acp-providers.js.map +1 -1
  208. package/dist/constants/profile-scope.d.ts +21 -0
  209. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  210. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  211. package/dist/hooks/mutation/use-create-conversation.js +30 -19
  212. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  213. package/dist/hooks/mutation/use-switch-acp-model.cjs +1 -1
  214. package/dist/hooks/mutation/use-switch-acp-model.cjs.map +1 -1
  215. package/dist/hooks/mutation/use-switch-acp-model.js +11 -12
  216. package/dist/hooks/mutation/use-switch-acp-model.js.map +1 -1
  217. package/dist/hooks/query/query-keys.cjs +1 -1
  218. package/dist/hooks/query/query-keys.cjs.map +1 -1
  219. package/dist/hooks/query/query-keys.d.ts +1 -0
  220. package/dist/hooks/query/query-keys.js +10 -1
  221. package/dist/hooks/query/query-keys.js.map +1 -1
  222. package/dist/hooks/query/use-active-acp-profile-detail.cjs +1 -1
  223. package/dist/hooks/query/use-active-acp-profile-detail.cjs.map +1 -1
  224. package/dist/hooks/query/use-active-acp-profile-detail.d.ts +0 -9
  225. package/dist/hooks/query/use-active-acp-profile-detail.js +4 -13
  226. package/dist/hooks/query/use-active-acp-profile-detail.js.map +1 -1
  227. package/dist/hooks/query/use-automation-sdk-version.cjs +1 -1
  228. package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -1
  229. package/dist/hooks/query/use-automation-sdk-version.js +3 -1
  230. package/dist/hooks/query/use-automation-sdk-version.js.map +1 -1
  231. package/dist/hooks/use-drag-resize.cjs +1 -1
  232. package/dist/hooks/use-drag-resize.cjs.map +1 -1
  233. package/dist/hooks/use-drag-resize.js +8 -9
  234. package/dist/hooks/use-drag-resize.js.map +1 -1
  235. package/dist/i18n/declaration.cjs +1 -1
  236. package/dist/i18n/declaration.cjs.map +1 -1
  237. package/dist/i18n/declaration.d.ts +18 -1
  238. package/dist/i18n/declaration.js +1 -1
  239. package/dist/i18n/declaration.js.map +1 -1
  240. package/dist/i18n/translation.cjs +3 -3
  241. package/dist/i18n/translation.cjs.map +1 -1
  242. package/dist/i18n/translation.js +289 -0
  243. package/dist/i18n/translation.js.map +1 -1
  244. package/dist/locales/ar/openhands.json +18 -1
  245. package/dist/locales/ca/openhands.json +18 -1
  246. package/dist/locales/de/openhands.json +18 -1
  247. package/dist/locales/en/openhands.json +18 -1
  248. package/dist/locales/es/openhands.json +18 -1
  249. package/dist/locales/fr/openhands.json +18 -1
  250. package/dist/locales/it/openhands.json +18 -1
  251. package/dist/locales/ja/openhands.json +18 -1
  252. package/dist/locales/ko-KR/openhands.json +18 -1
  253. package/dist/locales/no/openhands.json +18 -1
  254. package/dist/locales/pt/openhands.json +18 -1
  255. package/dist/locales/tr/openhands.json +18 -1
  256. package/dist/locales/uk/openhands.json +18 -1
  257. package/dist/locales/zh-CN/openhands.json +18 -1
  258. package/dist/locales/zh-TW/openhands.json +18 -1
  259. package/dist/manifests/automation-setup.cjs.map +1 -1
  260. package/dist/manifests/automation-setup.js.map +1 -1
  261. package/dist/manifests/manifest-local-validation.cjs.map +1 -1
  262. package/dist/manifests/manifest-local-validation.js.map +1 -1
  263. package/dist/manifests/manifest-validation.cjs +1 -1
  264. package/dist/manifests/manifest-validation.cjs.map +1 -1
  265. package/dist/manifests/manifest-validation.js +2 -2
  266. package/dist/manifests/manifest-validation.js.map +1 -1
  267. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs +3670 -247
  268. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs.map +1 -1
  269. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js +26 -3
  270. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js.map +1 -1
  271. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs +1 -1
  272. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs.map +1 -1
  273. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js +4 -1
  274. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js.map +1 -1
  275. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs +2 -0
  276. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs.map +1 -0
  277. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js +79 -0
  278. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js.map +1 -0
  279. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs +1 -11
  280. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs.map +1 -1
  281. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js +25 -11
  282. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js.map +1 -1
  283. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs +2 -0
  284. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs.map +1 -0
  285. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js +72 -0
  286. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js.map +1 -0
  287. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +1 -10
  288. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -1
  289. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +24 -11
  290. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -1
  291. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs +12 -0
  292. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs.map +1 -0
  293. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js +115 -0
  294. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js.map +1 -0
  295. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
  296. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
  297. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +20 -14
  298. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
  299. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs +2 -0
  300. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs.map +1 -0
  301. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js +73 -0
  302. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js.map +1 -0
  303. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
  304. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
  305. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +9 -7
  306. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
  307. package/dist/node_modules/@openhands/extensions/skills/index.cjs +794 -227
  308. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  309. package/dist/node_modules/@openhands/extensions/skills/index.js +46 -6
  310. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  311. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs +1 -1
  312. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs.map +1 -1
  313. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js +15 -8
  314. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js.map +1 -1
  315. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs +1 -1
  316. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs.map +1 -1
  317. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js +11 -13
  318. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js.map +1 -1
  319. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
  320. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
  321. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +6 -0
  322. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
  323. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs +1 -1
  324. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs.map +1 -1
  325. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js +9 -12
  326. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js.map +1 -1
  327. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
  328. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
  329. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +9 -10
  330. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
  331. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs +2 -0
  332. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs.map +1 -0
  333. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js +41 -0
  334. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js.map +1 -0
  335. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs +1 -1
  336. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs.map +1 -1
  337. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js +2 -2
  338. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
  339. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs +1 -1
  340. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs.map +1 -1
  341. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js +3 -6
  342. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js.map +1 -1
  343. package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
  344. package/dist/node_modules/@openhands/typescript-client/dist/clients.js +1 -2
  345. package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.cjs +1 -1
  346. package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.js +0 -1
  347. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  348. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  349. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +199 -61
  350. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  351. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs +1 -1
  352. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs.map +1 -1
  353. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js +9 -8
  354. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js.map +1 -1
  355. package/dist/package.cjs +1 -1
  356. package/dist/package.cjs.map +1 -1
  357. package/dist/package.js +3 -3
  358. package/dist/package.js.map +1 -1
  359. package/dist/routes/agent-settings.d.ts +11 -0
  360. package/dist/types/automation.cjs.map +1 -1
  361. package/dist/types/automation.d.ts +26 -2
  362. package/dist/types/automation.js.map +1 -1
  363. package/dist/utils/automation-disabled-reason.cjs +2 -0
  364. package/dist/utils/automation-disabled-reason.cjs.map +1 -0
  365. package/dist/utils/automation-disabled-reason.d.ts +32 -0
  366. package/dist/utils/automation-disabled-reason.js +19 -0
  367. package/dist/utils/automation-disabled-reason.js.map +1 -0
  368. package/dist/utils/parse-git-remote-url.cjs +1 -1
  369. package/dist/utils/parse-git-remote-url.cjs.map +1 -1
  370. package/dist/utils/parse-git-remote-url.d.ts +5 -1
  371. package/dist/utils/parse-git-remote-url.js +20 -13
  372. package/dist/utils/parse-git-remote-url.js.map +1 -1
  373. package/package.json +3 -3
  374. package/scripts/check-sdk-version-sync.mjs +79 -8
  375. package/scripts/dev-safe.mjs +14 -1
  376. package/scripts/docker-build.mjs +3 -0
  377. package/scripts/static-server.mjs +24 -7
  378. package/build/assets/acp-providers-DcY_mKYa.js +0 -1
  379. package/build/assets/active-backend-context-BnH4-L8h.js +0 -2
  380. package/build/assets/agent-server-conversation-service.api-jiCopc2E.js +0 -88
  381. package/build/assets/agent-settings-BF8hM6wb.js +0 -2
  382. package/build/assets/agent-settings-YPutBAeR.js +0 -1
  383. package/build/assets/automation-detail-BxXhb_m2.js +0 -3
  384. package/build/assets/automation-setup-route-qaJ6lLCf.js +0 -3
  385. package/build/assets/automations-list-DEPVNud3.js +0 -1
  386. package/build/assets/backend-form-modal-DxisQV_6.js +0 -1
  387. package/build/assets/conversation-edjzrv5w.js +0 -1
  388. package/build/assets/conversation-panel-edjzrv5w.js +0 -1
  389. package/build/assets/edit-automation-modal-D_JWSmxT.js +0 -1
  390. package/build/assets/empty-state-FK_s1B60.js +0 -1
  391. package/build/assets/git-repo-dropdown-BoDDWXfX.js +0 -1
  392. package/build/assets/home-BM5_Wz_R.js +0 -1
  393. package/build/assets/home-Ivfm7KC4.js +0 -1
  394. package/build/assets/home-automation-run-tooltip-B1N2uO9p.js +0 -1
  395. package/build/assets/index-home-td9BN2T3.js +0 -1
  396. package/build/assets/kebab-menu-item-content-SCJBwZnp.js +0 -1
  397. package/build/assets/link-external-BNZzCM1I.js +0 -1
  398. package/build/assets/llm-not-configured-banner-Dh_ajcM8.js +0 -27
  399. package/build/assets/llm-settings-CZaXYgtw.js +0 -1
  400. package/build/assets/manifest-bfeccb98.js +0 -1
  401. package/build/assets/mcp-CraxoXQv.js +0 -1
  402. package/build/assets/mcp-marketplace-utils-C7PYr293.js +0 -1
  403. package/build/assets/mcp-page-CteH_K0N.js +0 -9
  404. package/build/assets/onboarding-DXFBRqEy.js +0 -1
  405. package/build/assets/parse-git-remote-url-DpDM9bK6.js +0 -1
  406. package/build/assets/recommended-automations-launcher-DEHRKIAg.js +0 -1
  407. package/build/assets/root-CM6IZHlg.css +0 -1
  408. package/build/assets/root-DdFkodKW.js +0 -2
  409. package/build/assets/trash-Ckh7yCaB.js +0 -1
  410. package/build/assets/use-create-conversation-i_PdFdIs.js +0 -1
  411. package/build/assets/use-create-secret-CjWq0J4O.js +0 -1
  412. package/build/assets/use-manifest-capabilities-CdqYfUAC.js +0 -1
  413. package/build/assets/use-tracking-j4uo9VEW.js +0 -3
  414. package/build/assets/utils-BgLSZdyy.js +0 -1
  415. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js +0 -2
  416. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js +0 -48
  417. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +0 -2
  418. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +0 -1
  419. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +0 -21
  420. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +0 -1
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,i as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{i as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{K as a,t as o}from"./utils-CbjwNcR-.js";import{c as s}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js";import{t as c}from"./loader-circle-BxJgk73D.js";import{t as l}from"./styled-tooltip-CknPQH4Y.js";import{u}from"./dropdown-classes-DyyMaaXl.js";import{n as d}from"./use-automation-health-CbQ9n-k7.js";import{t as f}from"./automation-C_eCrGyP.js";var p=r(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);e();var m=n(),ee=e=>(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,m.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456z`})}),te=[`success`,`partial_success`,`blocked`,`failed`,`unknown`];function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g(e){return typeof e==`string`&&te.includes(e)}function _(e){return typeof e==`string`&&e.trim()||null}var v=new Set([`status`,`outcome_summary`]);function y(e){return e.run_metadata?.finish_tool_response??null}function b(e){let t=_(e);if(t)return t;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(e==null)return null;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function x(e){if(e==null)return null;if(!h(e))return e;let t=Object.entries(e).filter(([e])=>!v.has(e));return t.length>0?Object.fromEntries(t):`status`in e&&!g(e.status)?{status:e.status}:null}function ne(e){let t=y(e);if(!h(t))return null;let n=_(t.outcome_summary);return typeof t.status!=`string`&&!n?null:{status:g(t.status)?t.status:`unknown`,outcomeSummary:n}}function S(e){let t=y(e),n=x(t),r=b(n),i=ne(e),a=_(e.error_detail);return e.status===f.COMPLETED?{badgeStatus:i?.status??(t===null?`success`:`unknown`),summary:i?.outcomeSummary??null,taskOutcome:i,customTaskMetadata:n,customTaskMetadataText:r}:{badgeStatus:e.status,summary:a,taskOutcome:i,customTaskMetadata:n,customTaskMetadataText:r}}function C(e){switch(e){case f.COMPLETED:case`success`:return a.AUTOMATIONS$DETAIL$SUCCESSFUL;case f.FAILED:case`failed`:return a.AUTOMATIONS$DETAIL$FAILED;case f.PENDING:return a.AUTOMATIONS$DETAIL$PENDING;case f.RUNNING:return a.AUTOMATIONS$DETAIL$RUNNING;case f.CANCELLED:return a.AUTOMATIONS$DETAIL$CANCELLED;case f.SKIPPED:return a.AUTOMATIONS$DETAIL$SKIPPED;case`blocked`:return a.AUTOMATIONS$DETAIL$BLOCKED;case`partial_success`:return a.AUTOMATIONS$DETAIL$PARTIAL;case`unknown`:return a.AUTOMATIONS$DETAIL$NEEDS_REVIEW;default:return a.FEATURED_AUTOMATIONS$STATUS_UNKNOWN}}var w=/^(\d+)$/;function T(e,t,n){let r=e.match(w);if(!r)return null;let i=Number(r[1]);return Number.isNaN(i)||i<t||i>n?null:i}function re(e){let t=(e??``).trim();if(!t)return{kind:`custom`,raw:``};let n=t.split(/\s+/);if(n.length!==5)return{kind:`custom`,raw:t};let[r,i,a,o,s]=n,c=T(r,0,59),l=T(i,0,23);if(c===null||l===null)return{kind:`custom`,raw:t};if(a!==`*`||o!==`*`)return{kind:`custom`,raw:t,hour:l,minute:c};if(s===`*`||s===`0-6`)return{kind:`daily`,hour:l,minute:c};if(s===`1-5`)return{kind:`weekdays`,hour:l,minute:c};let u=T(s,0,6);return u===null?{kind:`custom`,raw:t,hour:l,minute:c}:{kind:`weekly`,hour:l,minute:c,weekday:u}}function ie(e){let{kind:t,hour:n,minute:r,weekday:i}=e;switch(t){case`daily`:return`${r} ${n} * * *`;case`weekdays`:return`${r} ${n} * * 1-5`;case`weekly`:return`${r} ${n} * * ${i??1}`;default:return t}}function ae(e,t){return`${String(e).padStart(2,`0`)}:${String(t).padStart(2,`0`)}`}function E(e){let t=e.match(/^(\d{1,2}):(\d{2})$/);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return Number.isNaN(n)||Number.isNaN(r)||n<0||n>23||r<0||r>59?null:{hour:n,minute:r}}function D(e){return e?Array.isArray(e)?e.join(`, `):e:`—`}var O=`*/10 * * * *`,k=new Set([`@yearly`,`@annually`,`@monthly`,`@weekly`,`@daily`,`@midnight`,`@hourly`]),A=5,j=7,M=[[0,59],[0,23],[1,31],[1,12],[0,7]],N=2,P=3,F=[0,31,29,31,30,31,30,31,31,30,31,30,31],I=`JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC`,L=`SUN|MON|TUE|WED|THU|FRI|SAT`,R=/^(\*|\d+(?:-\d+)?)(?:\/(\d+))?$/,z=[null,null,/^(?:\?|L|\d+W)$/i,RegExp(`^(?:${I})(?:-(?:${I}))?(?:/\\d+)?$`,`i`),RegExp(`^(?:(?:${L}|\\d+)(?:-(?:${L}|\\d+))?(?:/\\d+)?(?:#\\d+)?|\\?)$`,`i`)];function B(e,[t,n],r){let i=new Set;for(let a of e.split(`,`)){let e=a.match(R);if(!e)return r?.test(a)?{kind:`unmodelled`}:{kind:`invalid`};let[,o,s]=e,c=s===void 0?1:Number(s);if(c<1)return{kind:`invalid`};if(o===`*`){for(let e=t;e<=n;e+=c)i.add(e);continue}let[l,u]=o.split(`-`),d=T(l,t,n);if(d===null)return{kind:`invalid`};if(u===void 0){i.add(d);continue}let f=T(u,t,n);if(f===null)return{kind:`invalid`};if(f<d)return{kind:`unmodelled`};for(let e=d;e<=f;e+=c)i.add(e)}return{kind:`values`,values:[...i]}}function V(e){let t=e.trim();if(!t)return{errorKey:a.AUTOMATIONS$ERROR_CRON_INVALID};if(t.startsWith(`@`))return k.has(t.toLowerCase())?{schedule:t}:{errorKey:a.AUTOMATIONS$ERROR_CRON_INVALID};let n=t.split(/\s+/);if(n.length<A||n.length>j)return{errorKey:a.AUTOMATIONS$ERROR_CRON_INVALID};let r=M.map((e,t)=>B(n[t],e,z[t]));if(r.some(e=>e.kind===`invalid`))return{errorKey:a.AUTOMATIONS$ERROR_CRON_INVALID};let i=r[N],o=r[P];return i.kind===`values`&&o.kind===`values`&&!o.values.some(e=>i.values.some(t=>t<=F[e]))?{errorKey:a.AUTOMATIONS$ERROR_CRON_UNREACHABLE}:{schedule:t}}function H(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`short`,day:`numeric`})}function U(e){if(!e)return!0;let t=new Date(e).getTime();return Number.isNaN(t)||t===0}function W(e,t,n){let r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4),o=Math.floor(r/36e5),s=Math.floor(r/864e5);return i<1?n(a.AUTOMATIONS$DETAIL$TIME_JUST_NOW):i<60?n(a.AUTOMATIONS$DETAIL$TIME_MINUTES_AGO,{count:i}):o<24?n(a.AUTOMATIONS$DETAIL$TIME_HOURS_AGO,{count:o}):s===1?n(a.AUTOMATIONS$DETAIL$TIME_YESTERDAY):s<7?n(a.AUTOMATIONS$DETAIL$TIME_DAYS_AGO,{count:s}):H(e,t)}function G(e){return e===f.FAILED||e===f.PENDING||e===f.RUNNING}function K(e){return e===f.PENDING||e===f.RUNNING}var q={queued:a.AUTOMATIONS$DETAIL$PHASE_QUEUED,sandbox_provisioning:a.AUTOMATIONS$DETAIL$PHASE_SANDBOX_PROVISIONING,bundle_upload:a.AUTOMATIONS$DETAIL$PHASE_BUNDLE_UPLOAD,entrypoint_start:a.AUTOMATIONS$DETAIL$PHASE_ENTRYPOINT_START,preparing:a.AUTOMATIONS$DETAIL$PHASE_PREPARING,running_agent:a.AUTOMATIONS$DETAIL$PHASE_RUNNING_AGENT};function J(e,t,n){let r=t&&Object.hasOwn(q,t)?q[t]:void 0;return r?e(r):n?.trim()||t?.trim()||null}function oe(e,t,n){return!e||U(e)?null:W(e,t,n)}function Y({status:e,code:t,label:n,updatedAt:r}){let{t:a,i18n:o}=i(`openhands`),s=J(a,t,n);return s?{text:s,age:K(e)?oe(r,o.language,a):null}:null}function se({status:e,code:n,label:r,updatedAt:i,wide:a=!1}){let s=Y({status:e,code:n,label:r,updatedAt:i});if(!s)return null;let{text:c,age:l}=s;return(0,m.jsx)(t,{content:(0,m.jsxs)(m.Fragment,{children:[c,l?(0,m.jsx)(`span`,{className:`mt-1 block text-muted`,children:l}):null]}),placement:`top`,closeDelay:100,disableAnimation:!1,classNames:{content:`max-w-xs whitespace-pre-wrap break-words rounded-xl border border-[var(--oh-border)] bg-base-secondary px-3 py-2 text-left text-xs text-white shadow-xl`},children:(0,m.jsxs)(`span`,{className:`flex min-w-0 cursor-default items-center gap-1`,children:[(0,m.jsx)(`span`,{"data-testid":`run-phase`,className:o(`min-w-0 truncate text-xs text-muted`,a?`max-w-[28rem]`:`max-w-[12rem]`),children:c}),l?(0,m.jsxs)(`span`,{"data-testid":`run-phase-age`,className:`shrink-0 whitespace-nowrap text-xs text-muted`,children:[`· `,l]}):null]})})}var X=e=>(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,m.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),ce=e=>(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,m.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),Z={[f.COMPLETED]:{style:`bg-[var(--oh-success)]/10 text-[var(--oh-success)]`,iconTone:`text-[var(--oh-success)]`},success:{style:`bg-[var(--oh-success)]/10 text-[var(--oh-success)]`,iconTone:`text-[var(--oh-success)]`},[f.FAILED]:{style:`bg-[var(--oh-danger)]/10 text-danger`,iconTone:`text-danger`},failed:{style:`bg-[var(--oh-danger)]/10 text-danger`,iconTone:`text-danger`},blocked:{style:`bg-[var(--oh-warning)]/10 text-[var(--oh-warning)]`,iconTone:`text-[var(--oh-warning)]`},partial_success:{style:`bg-[var(--oh-warning)]/10 text-[var(--oh-warning)]`,iconTone:`text-[var(--oh-warning)]`},unknown:{style:`bg-[var(--oh-warning)]/10 text-[var(--oh-warning)]`,iconTone:`text-[var(--oh-warning)]`},[f.PENDING]:{style:`bg-surface-raised text-muted`,iconTone:`text-muted`},[f.RUNNING]:{style:`bg-surface-raised text-muted`,iconTone:`text-muted`},[f.CANCELLED]:{style:`bg-surface-raised text-muted`,iconTone:`text-muted`},[f.SKIPPED]:{style:`bg-surface-raised text-muted`,iconTone:`text-muted`}};function Q({status:e,compact:t=!1}){let n=t?`size-3`:`size-3.5`;switch(e){case f.COMPLETED:case`success`:return(0,m.jsx)(X,{"data-testid":`run-status-icon-completed`,className:n});case f.FAILED:case`failed`:return(0,m.jsx)(ce,{"data-testid":`run-status-icon-failed`,className:n});case f.RUNNING:return(0,m.jsx)(c,{"data-testid":`run-status-icon-running`,className:o(n,`animate-spin motion-reduce:animate-none`),"aria-hidden":`true`});case`blocked`:case`partial_success`:return(0,m.jsx)(s,{"data-testid":`run-status-icon-warning`,className:n,"aria-hidden":`true`});case`unknown`:return(0,m.jsx)(p,{"data-testid":`run-status-icon-needs-review`,className:n,"aria-hidden":`true`});default:return(0,m.jsx)(d,{"data-testid":`run-status-icon-pending`,className:n})}}function le({status:e,iconOnly:t=!1,showLabel:n=!1,compact:r=!1}){let{t:a}=i(`openhands`),s=Z[e]??Z[f.PENDING],c=a(C(e));return t?n?(0,m.jsxs)(`span`,{"data-testid":`run-status-badge-icon`,className:o(`inline-flex min-w-0 shrink-0 items-center gap-1.5 text-xs font-medium`,s.iconTone),children:[(0,m.jsx)(Q,{status:e,compact:r}),(0,m.jsx)(`span`,{className:`truncate`,children:c})]}):(0,m.jsx)(l,{content:c,placement:`top`,children:(0,m.jsx)(`span`,{role:`img`,"aria-label":c,"data-testid":`run-status-badge-icon`,className:o(`inline-flex shrink-0 cursor-default items-center justify-center`,s.iconTone),children:(0,m.jsx)(Q,{status:e,compact:r})})}):(0,m.jsxs)(`span`,{className:o(`inline-flex items-center rounded-full font-medium`,r?`gap-1 pl-1 pr-1.5 py-0 text-[10px] leading-4`:`gap-1.5 pl-2 pr-2.5 py-1 text-xs`,s.style),children:[(0,m.jsx)(Q,{status:e,compact:r}),c]})}var ue=e=>(0,m.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,m.jsx)(`path`,{d:`M8.4 3.9c-1.1-.66-2.5.13-2.5 1.4v13.4c0 1.27 1.4 2.06 2.5 1.4l11.2-6.7c1.06-.64 1.06-2.16 0-2.8L8.4 3.9Z`,fill:`currentColor`})}),de=e=>(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,m.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5.636 5.636a9 9 0 1012.728 0M12 3v9`})});function fe({icon:e,label:t}){return(0,m.jsxs)(`span`,{className:`flex min-w-0 w-full items-center gap-2`,children:[(0,m.jsx)(`span`,{className:o(`[&_svg]:size-4`,u),"aria-hidden":!0,children:e}),(0,m.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t})]})}var pe=new Set([`user`]),me=new Set([`manual`,`manual_delete`]);function $(e){return!e.enabled&&!!e.disabled_reason}function he(e){let t=e.disabled_reason;if(t&&me.has(t))return!0;let n=e.disabled_detail?.source;return!!(n&&pe.has(n))}function ge(e,t){return $(e)?he(e)?{text:t(a.AUTOMATIONS$DETAIL$DISABLED_MANUAL)}:{text:e.disabled_reason}:null}export{ee as C,S,ae as _,ue as a,V as b,se as c,H as d,W as f,D as g,ie as h,de as i,G as l,O as m,$ as n,le as o,U as p,fe as r,X as s,ge as t,Y as u,re as v,C as x,E as y};
@@ -1,2 +1,2 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./useTranslation-CCgUjPJF.js";import{K as n}from"./utils-BgLSZdyy.js";import{k as r}from"./use-tracking-j4uo9VEW.js";import{r as i}from"./modal-classes-B0b9eiL8.js";import{t as a}from"./x-mark-BopmFoBq.js";var o=e();function s({automationName:e,isOpen:r,onConfirm:s,onCancel:c}){let{t:l}=t(`openhands`);return r?(0,o.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,o.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:c,onKeyDown:e=>{e.key===`Escape`&&c()},role:`presentation`}),(0,o.jsxs)(`div`,{className:`relative w-full max-w-sm rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,o.jsx)(`button`,{type:`button`,onClick:c,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":l(n.BUTTON$CLOSE),children:(0,o.jsx)(a,{className:`size-5`})}),(0,o.jsx)(`h2`,{className:i,children:l(n.AUTOMATIONS$DELETE_CONFIRM_TITLE)}),(0,o.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:l(n.AUTOMATIONS$DELETE_CONFIRM_MESSAGE,{name:e})}),(0,o.jsxs)(`div`,{className:`mt-6 flex justify-end gap-3`,children:[(0,o.jsx)(`button`,{type:`button`,onClick:c,className:`rounded-lg border border-[var(--oh-border)] px-4 py-2 text-sm text-white hover:bg-surface-raised`,children:l(n.AUTOMATIONS$CANCEL)}),(0,o.jsx)(`button`,{type:`button`,onClick:s,className:`rounded-lg bg-danger px-4 py-2 text-sm text-white hover:bg-danger/80`,children:l(n.AUTOMATIONS$DELETE)})]})]})]}):null}var c=new Set([`cron`,`schedule`,`event`]),l=class extends Error{issues;constructor(e){super(e.join(`
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./useTranslation-CCgUjPJF.js";import{K as n}from"./utils-CbjwNcR-.js";import{k as r}from"./use-tracking-BAFpgpgq.js";import{r as i}from"./modal-classes-BPcBCWVj.js";import{t as a}from"./x-mark-BopmFoBq.js";var o=e();function s({automationName:e,isOpen:r,onConfirm:s,onCancel:c}){let{t:l}=t(`openhands`);return r?(0,o.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,o.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:c,onKeyDown:e=>{e.key===`Escape`&&c()},role:`presentation`}),(0,o.jsxs)(`div`,{className:`relative w-full max-w-sm rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,o.jsx)(`button`,{type:`button`,onClick:c,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":l(n.BUTTON$CLOSE),children:(0,o.jsx)(a,{className:`size-5`})}),(0,o.jsx)(`h2`,{className:i,children:l(n.AUTOMATIONS$DELETE_CONFIRM_TITLE)}),(0,o.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:l(n.AUTOMATIONS$DELETE_CONFIRM_MESSAGE,{name:e})}),(0,o.jsxs)(`div`,{className:`mt-6 flex justify-end gap-3`,children:[(0,o.jsx)(`button`,{type:`button`,onClick:c,className:`rounded-lg border border-[var(--oh-border)] px-4 py-2 text-sm text-white hover:bg-surface-raised`,children:l(n.AUTOMATIONS$CANCEL)}),(0,o.jsx)(`button`,{type:`button`,onClick:s,className:`rounded-lg bg-danger px-4 py-2 text-sm text-white hover:bg-danger/80`,children:l(n.AUTOMATIONS$DELETE)})]})]})]}):null}var c=new Set([`cron`,`schedule`,`event`]),l=class extends Error{issues;constructor(e){super(e.join(`
2
2
  `)),this.name=`AutomationFileValidationError`,this.issues=e}};function u(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function d(e,t,n,r){let i=e[t];if(typeof i!=`string`||i.trim().length===0){r.push(`${n}: expected a non-empty string`);return}return i}function f(e,t,n,r){let i=e[t];if(i!==void 0){if(typeof i!=`string`){r.push(`${n}: expected a string`);return}return i}}function p(e,t){if(!u(e)){t.push(`spec.trigger: expected an object`);return}let n=d(e,`type`,`spec.trigger.type`,t);n&&!c.has(n)&&t.push(`spec.trigger.type: expected one of "cron", "schedule", or "event"`);let r=f(e,`schedule`,`spec.trigger.schedule`,t),i=f(e,`schedule_human`,`spec.trigger.schedule_human`,t),a=f(e,`timezone`,`spec.trigger.timezone`,t),o=f(e,`source`,`spec.trigger.source`,t),s=f(e,`filter`,`spec.trigger.filter`,t),l;if(e.on!==void 0&&(typeof e.on==`string`||Array.isArray(e.on)&&e.on.length>0&&e.on.every(e=>typeof e==`string`&&e.trim().length>0)?l=e.on:t.push(`spec.trigger.on: expected a string or a non-empty array of strings`)),(n===`cron`||n===`schedule`)&&!r?.trim()&&t.push(`spec.trigger.schedule: required for a scheduled trigger`),n===`event`&&(o?.trim()||t.push(`spec.trigger.source: required for an event trigger`),(l===void 0||typeof l==`string`&&l.trim().length===0)&&t.push(`spec.trigger.on: required for an event trigger`)),!(!n||!c.has(n)))return{type:n,...r!==void 0&&{schedule:r},...i!==void 0&&{schedule_human:i},...a!==void 0&&{timezone:a},...o!==void 0&&{source:o},...l!==void 0&&{on:l},...s!==void 0&&{filter:s}}}function m(e){let t=e.timezone??e.trigger.timezone,n={name:e.name,trigger:{...e.trigger},enabled:e.enabled,prompt:e.prompt,...e.repository!==void 0&&{repository:e.repository},...e.model!==void 0&&{model:e.model},...e.timeout!=null&&{timeout:e.timeout},...e.branch!==void 0&&{branch:e.branch},...e.plugins!==void 0&&{plugins:[...e.plugins]},...e.notification!==void 0&&{notification:e.notification},...t!==void 0&&{timezone:t}},i=r();return{version:i.fileVersion,kind:i.fileKind,spec:n}}function h(e){return`${e.name.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||e.id}${r().filenameSuffix}`}function g(e){let t=[];if(!u(e))throw new l([`file: expected a JSON object`]);let n=r();if(e.version!==n.fileVersion&&t.push(`version: expected ${n.fileVersion}`),e.kind!==n.fileKind&&t.push(`kind: expected "${n.fileKind}"`),!u(e.spec))throw t.push(`spec: expected an object`),new l(t);let i=d(e.spec,`name`,`spec.name`,t),a=d(e.spec,`prompt`,`spec.prompt`,t),o=p(e.spec.trigger,t),s=e.spec.enabled;typeof s!=`boolean`&&t.push(`spec.enabled: expected a boolean`);let c=f(e.spec,`repository`,`spec.repository`,t),m=f(e.spec,`branch`,`spec.branch`,t),h=f(e.spec,`notification`,`spec.notification`,t),g=f(e.spec,`timezone`,`spec.timezone`,t),_;e.spec.model===null||e.spec.model===void 0||typeof e.spec.model==`string`&&e.spec.model.trim().length>0?_=e.spec.model:t.push(`spec.model: expected a non-empty string or null`);let v;e.spec.timeout===null||e.spec.timeout===void 0||typeof e.spec.timeout==`number`&&Number.isInteger(e.spec.timeout)&&e.spec.timeout>0?v=e.spec.timeout:t.push(`spec.timeout: expected a positive integer`);let y;if(e.spec.plugins!==void 0&&(Array.isArray(e.spec.plugins)&&e.spec.plugins.every(e=>typeof e==`string`&&e.trim().length>0)?y=[...e.spec.plugins]:t.push(`spec.plugins: expected an array of non-empty strings`)),t.length>0||!i||!a||!o)throw new l(t);return{name:i,prompt:a,trigger:o,enabled:s,...c!==void 0&&{repository:c},..._!==void 0&&{model:_},...v!==void 0&&{timeout:v},...m!==void 0&&{branch:m},...y!==void 0&&{plugins:y},...h!==void 0&&{notification:h},...g!==void 0&&{timezone:g}}}export{s as i,g as n,m as r,h as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as a}from"./useMutation-Cszf8mKy.js";import{t as o}from"./useQuery-DAAacS7O.js";import{t as s}from"./useTranslation-CCgUjPJF.js";import{ct as c,n as l,st as u}from"./active-backend-context-BnH4-L8h.js";import{K as d,t as f}from"./utils-BgLSZdyy.js";import{t as p}from"./check-Bo8s5Ylg.js";import{t as m}from"./refresh-cw-BtdC3T8P.js";import{t as h}from"./triangle-alert-DEdu-b_L.js";import{n as g,t as _}from"./use-tracking-j4uo9VEW.js";import{t as v}from"./use-settings-C2KKQKVC.js";import{t as y}from"./brand-button-CUMfjb99.js";import{t as b}from"./settings-input-dVuzapBA.js";import{t as x}from"./format-time-delta-BIR5Os7T.js";import{t as S}from"./folder-C1ou4_DT.js";import{n as C,t as w}from"./use-automation-health-U99vvHxx.js";import{t as T}from"./settings-switch-DDd1cQ8t.js";import{n as E}from"./api-error-message-BXo0lCI5.js";import{t as D}from"./use-automation-permissions-Buus0R6h.js";import{t as O}from"./parse-git-remote-url-DpDM9bK6.js";import{n as k,r as A,t as j}from"./error-state-Cf8LRuuY.js";import{a as M,i as N,n as P,r as F,t as ee}from"./cog-CAEugqtV.js";var I=e(t()),L=[`git-sync-status`];function R(e={}){let{enabled:t=!0,refetchInterval:n=!1}=e,r=l();return o({queryKey:[...L,r.backend.id,r.orgId],queryFn:()=>g.getGitSyncStatus(),staleTime:10*1e3,enabled:t,refetchInterval:n,retry:(e,t)=>v(t)===void 0&&e<2,meta:{disableToast:!0}})}function te(){let e=i(),t=l(),{trackGitSyncConfigUpdated:n}=_();return a({mutationFn:e=>g.updateGitSyncConfig(e),onSuccess:async r=>{let i=[...L,t.backend.id,t.orgId];await e.cancelQueries({queryKey:i}),e.setQueryData(i,r),n({backendKind:t.backend.kind})},meta:{disableToast:!0}})}function ne(){return a({mutationFn:e=>g.checkGitSyncConfig(e),retry:!1,meta:{disableToast:!0}})}function z(){let e=i(),t=l(),{trackGitSyncTriggered:n}=_();return a({mutationFn:()=>g.triggerGitSync(),onSuccess:()=>{e.invalidateQueries({queryKey:L}),n({backendKind:t.backend.kind})},meta:{disableToast:!0}})}var B=n();function V({className:e}){return(0,B.jsx)(`div`,{className:f(`animate-pulse rounded bg-surface-raised`,e)})}function H(){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`git-sync-skeleton`,children:[(0,B.jsx)(V,{className:`h-5 w-40`}),(0,B.jsx)(V,{className:`h-6 w-48`}),(0,B.jsx)(V,{className:`h-5 w-96`}),(0,B.jsx)(V,{className:`h-48 w-full rounded-2xl`}),(0,B.jsx)(V,{className:`h-96 w-full rounded-2xl`})]})}function U(){let{t:e}=s(`openhands`);return(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,B.jsx)(A,{className:`size-12 text-muted`}),(0,B.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(d.AUTOMATIONS$GIT_SYNC$NOT_LOCAL_TITLE)}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(d.AUTOMATIONS$GIT_SYNC$NOT_LOCAL_MESSAGE)}),(0,B.jsx)(`div`,{className:`mt-6`,children:(0,B.jsx)(M,{})})]})}function W(){let{t:e}=s(`openhands`);return(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,B.jsx)(A,{className:`size-12 text-muted`}),(0,B.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(d.AUTOMATIONS$GIT_SYNC$UNSUPPORTED_TITLE)}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(d.AUTOMATIONS$GIT_SYNC$UNSUPPORTED_MESSAGE)}),(0,B.jsx)(`div`,{className:`mt-6`,children:(0,B.jsx)(M,{})})]})}function G({error:e,errorAt:t}){let{t:n}=s(`openhands`);return(0,B.jsxs)(`div`,{role:`alert`,"data-testid":`git-sync-error-banner`,className:`rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm text-red-300 whitespace-pre-wrap break-words`,children:[(0,B.jsx)(`p`,{className:`font-medium`,children:n(d.AUTOMATIONS$GIT_SYNC$LAST_ERROR_TITLE)}),(0,B.jsx)(`p`,{className:`mt-1`,children:e}),t&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-red-300/70`,children:`${x(t)} ${n(d.CONVERSATION$AGO)}`})]})}var K=e=>(0,B.jsx)(`svg`,{viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,B.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2.4375 9C2.4375 5.37563 5.37563 2.4375 9 2.4375C12.6244 2.4375 15.5625 5.37563 15.5625 9C15.5625 12.6244 12.6244 15.5625 9 15.5625C5.37563 15.5625 2.4375 12.6244 2.4375 9ZM4.13812 6.5625C4.81317 5.21867 6.02897 4.19333 7.49996 3.77204C7.15155 4.17641 6.85182 4.65395 6.60713 5.17892C6.40828 5.60556 6.24263 6.06975 6.11494 6.5625H4.13812ZM3.72196 7.6875C3.61778 8.10783 3.5625 8.54746 3.5625 9C3.5625 9.45254 3.61778 9.89217 3.72196 10.3125H5.89738C5.84161 9.88758 5.8125 9.44852 5.8125 8.99998C5.8125 8.55142 5.84161 8.11239 5.89737 7.6875H3.72196ZM7.0333 7.6875C6.97087 8.10689 6.9375 8.54634 6.9375 8.99998C6.9375 9.45367 6.97087 9.89313 7.0333 10.3125H10.9667C11.0291 9.89311 11.0625 9.45367 11.0625 9.00002C11.0625 8.54637 11.0291 8.1069 10.9667 7.6875H7.0333ZM12.1026 7.6875C12.1584 8.1124 12.1875 8.55145 12.1875 9.00002C12.1875 9.44858 12.1584 9.88762 12.1026 10.3125H14.278C14.3822 9.89217 14.4375 9.45254 14.4375 9C14.4375 8.54746 14.3822 8.10783 14.278 7.6875H12.1026ZM13.8619 6.5625H11.885C11.7574 6.06976 11.5917 5.6056 11.3929 5.17897C11.1482 4.65397 10.8484 4.1764 10.5 3.77203C11.971 4.19331 13.1868 5.21866 13.8619 6.5625ZM10.7171 6.5625H7.28293C7.38007 6.23971 7.49559 5.93571 7.62681 5.65419C7.99835 4.85708 8.48101 4.26914 8.99997 3.92442C9.51895 4.26913 10.0016 4.8571 10.3732 5.65424C10.5044 5.93575 10.6199 6.23973 10.7171 6.5625ZM4.13812 11.4375H6.11496C6.24963 11.9572 6.42655 12.4452 6.64015 12.8909C6.87835 13.3879 7.16685 13.8413 7.50006 14.228C6.02902 13.8067 4.81318 12.7814 4.13812 11.4375ZM10.7171 11.4375H7.28295C7.3869 11.7829 7.51191 12.1068 7.65465 12.4047C8.02305 13.1733 8.49456 13.7398 9.00007 14.0756C9.51902 13.7308 10.0017 13.1429 10.3732 12.3458C10.5044 12.0643 10.6199 11.7603 10.7171 11.4375ZM11.3929 12.8211C11.5917 12.3944 11.7574 11.9303 11.8851 11.4375H13.8619C13.1868 12.7813 11.971 13.8067 10.5 14.228C10.8485 13.8236 11.1482 13.346 11.3929 12.8211Z`,fill:`currentColor`})});function q({tone:e,label:t,testId:n}){return(0,B.jsx)(`span`,{"data-testid":n,className:f(`inline-flex items-center rounded-full px-3 py-1 text-xs font-medium`,e===`success`&&`bg-[var(--oh-success)]/15 text-[var(--oh-success)]`,e===`warning`&&`bg-[var(--oh-warning)]/15 text-[var(--oh-warning)]`,e===`neutral`&&`bg-surface-raised text-muted`),children:t})}function J(e){let[,t]=(0,I.useState)(0);(0,I.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(n)},[e])}function Y({state:e,startedAt:t,pendingCount:n}){let{t:r}=s(`openhands`),i=e===`running`;if(J(i&&t!==null),e===`idle`)return null;let a=e===`failed`;return(0,B.jsxs)(`div`,{"data-testid":`git-sync-activity-row`,"data-state":e,className:f(`mt-4 flex flex-wrap items-center gap-x-2 gap-y-1 rounded-md px-3 py-2 text-sm`,i&&`bg-tertiary text-content`,e===`succeeded`&&`bg-green-500/10 text-green-300`,a&&`bg-red-500/10 text-red-300`),children:[i&&(0,B.jsx)(m,{className:`size-4 animate-spin`,"aria-hidden":!0}),e===`succeeded`&&(0,B.jsx)(p,{className:`size-4`,"aria-hidden":!0}),a&&(0,B.jsx)(h,{className:`size-4`,"aria-hidden":!0}),(0,B.jsxs)(`span`,{className:`font-medium`,children:[i&&r(d.AUTOMATIONS$GIT_SYNC$SYNCING),e===`succeeded`&&r(d.AUTOMATIONS$GIT_SYNC$SYNC_COMPLETED),a&&r(d.AUTOMATIONS$GIT_SYNC$SYNC_FAILED)]}),i&&t&&(0,B.jsx)(`span`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$SYNC_STARTED_AGO,{time:x(t)})}),i&&n>0&&(0,B.jsx)(`span`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$SYNC_PENDING_COUNT,{count:n})})]})}function X(e){let t=O(e);if(!t?.host||!t.repository)return null;if(/^https?:\/\//i.test(t.url)){let e=new URL(t.url);return e.username=``,e.password=``,e.pathname=e.pathname.replace(/\.git$/,``),e.toString()}return`https://${t.host}/${t.repository}`}function Z({status:e,onSyncNow:t,isSyncing:n,syncActivity:r,syncStartedAt:i,canManage:a}){let{t:o}=s(`openhands`),c=X(e.repo_url);return(0,B.jsxs)(F,{icon:(0,B.jsx)(N,{className:`size-4`}),title:o(d.AUTOMATIONS$GIT_SYNC$STATUS_TITLE),children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(q,{testId:`git-sync-enabled-pill`,tone:e.enabled?`success`:`neutral`,label:o(e.enabled?d.AUTOMATIONS$GIT_SYNC$ENABLED:d.AUTOMATIONS$GIT_SYNC$DISABLED)}),(0,B.jsx)(q,{testId:`git-sync-encryption-pill`,tone:e.encryption_enabled?`success`:`neutral`,label:o(e.encryption_enabled?d.AUTOMATIONS$GIT_SYNC$ENCRYPTED:d.AUTOMATIONS$GIT_SYNC$NOT_ENCRYPTED)})]}),(0,B.jsx)(y,{testId:`git-sync-now-button`,type:`button`,variant:`secondary`,isDisabled:!a||!e.enabled||n,onClick:t,startContent:(0,B.jsx)(m,{className:f(`size-4`,n&&`animate-spin`),"aria-hidden":!0}),children:o(n?d.AUTOMATIONS$GIT_SYNC$SYNCING:d.AUTOMATIONS$GIT_SYNC$SYNC_NOW)})]}),(0,B.jsx)(Y,{state:r,startedAt:i,pendingCount:e.dirty_count}),(0,B.jsxs)(`div`,{className:`mt-5 grid grid-cols-2 gap-x-4 gap-y-5`,children:[(0,B.jsx)(P,{icon:(0,B.jsx)(K,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$REPOSITORY),children:c?(0,B.jsx)(`a`,{"data-testid":`git-sync-repo-link`,href:c,target:`_blank`,rel:`noopener noreferrer`,className:`break-all underline transition-colors hover:text-foreground`,children:e.repo_url}):(0,B.jsx)(`span`,{className:`break-all`,children:e.repo_url||o(d.AUTOMATIONS$GIT_SYNC$NOT_CONFIGURED)})}),(0,B.jsx)(P,{icon:(0,B.jsx)(N,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$FIELD_BRANCH),children:e.branch}),(0,B.jsx)(P,{icon:(0,B.jsx)(S,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$FIELD_PATH),children:e.path}),(0,B.jsx)(P,{icon:(0,B.jsx)(N,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$LAST_SYNCED_COMMIT),children:e.last_synced_commit?(0,B.jsx)(`span`,{className:`font-mono`,children:e.last_synced_commit.slice(0,7)}):o(d.AUTOMATIONS$GIT_SYNC$NEVER_SYNCED)}),(0,B.jsx)(P,{icon:(0,B.jsx)(C,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$LAST_SYNCED_AT),children:e.last_synced_at?`${x(e.last_synced_at)} ${o(d.CONVERSATION$AGO)}`:o(d.AUTOMATIONS$GIT_SYNC$NEVER_SYNCED)}),(0,B.jsx)(P,{icon:(0,B.jsx)(C,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$FIELD_INTERVAL),children:e.interval_seconds>0?o(d.AUTOMATIONS$GIT_SYNC$EVERY_N_SECONDS,{count:e.interval_seconds}):o(d.AUTOMATIONS$GIT_SYNC$MANUAL_ONLY)}),(0,B.jsx)(P,{icon:(0,B.jsx)(C,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$PENDING_CHANGES),children:(0,B.jsx)(`span`,{className:f(e.dirty_count>0&&`text-[var(--oh-warning)]`),children:e.dirty_count})})]})]})}var Q=`git-sync-save-and-sync`;function $({status:e,canManage:t,onSyncNow:n}){let{t:r}=s(`openhands`),{mutate:i,isPending:a}=te(),{mutateAsync:o,isPending:l}=ne(),[f,p]=(0,I.useState)(null),[m,h]=(0,I.useState)(!1),[g,_]=(0,I.useState)(!1),[x,S]=(0,I.useState)(!1),[C,w]=(0,I.useState)(!1),[D,O]=(0,I.useState)(!1),[k,A]=(0,I.useState)(!1),[j,M]=(0,I.useState)(null),N=j??e.enabled,P=j!==null&&N!==e.enabled,[L,R]=(0,I.useState)(``),[z,V]=(0,I.useState)(!1),[H,U]=(0,I.useState)(``),[W,G]=(0,I.useState)(!1),K=L.trim().length>0||z,q=H.trim().length>0||W,J=!P&&!m&&!g&&!x&&!C&&!D&&!k&&!K&&!q,Y=()=>{M(null),h(!1),_(!1),S(!1),w(!1),O(!1),A(!1),R(``),V(!1),U(``),G(!1),p(null)},X=e=>{V(e),R(``)},Z=e=>{G(e),U(``)},$=(e,t)=>e.get(t)?.toString().trim()||null,re=(e,t)=>{i(e,{onSuccess:()=>{c(r(d.AUTOMATIONS$GIT_SYNC$CONFIG_SAVED)),Y(),t&&n()},onError:e=>{u(v(e)===409?r(d.AUTOMATIONS$GIT_SYNC$ENABLE_BLOCKED_ERROR):E(e,r(d.ERROR$GENERIC)))}})},ie=e=>[`repo_url`,`branch`,`token`].filter(t=>t in e).map(t=>`${t}=${e[t]}`).join(`&`),ae=async e=>{try{let t=await o(e);return t.ok?null:t.detail??r(d.AUTOMATIONS$GIT_SYNC$CHECK_FAILED_TITLE)}catch{return null}};return(0,B.jsx)(F,{icon:(0,B.jsx)(ee,{className:`size-4`}),title:r(d.AUTOMATIONS$GIT_SYNC$CONFIG_TITLE),children:(0,B.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault();let t=e.nativeEvent.submitter?.getAttribute(`name`)===Q,n=new FormData(e.currentTarget),r={};if(P&&(r.enabled=N),m){let e=n.get(`git-sync-interval-input`)?.toString().trim(),t=Number(e);r.interval_seconds=e&&Number.isFinite(t)?Math.max(0,Math.trunc(t)):0}g&&(r.repo_url=$(n,`git-sync-repo-url-input`)),x&&(r.branch=$(n,`git-sync-branch-input`)),C&&(r.path=$(n,`git-sync-path-input`)),D&&(r.author_name=$(n,`git-sync-author-name-input`)),k&&(r.author_email=$(n,`git-sync-author-email-input`));let i=L.trim(),a=H.trim();z?r.token=null:i&&(r.token=i),W?r.encryption_key=null:a&&(r.encryption_key=a);let o=ie(r);if(o&&f?.key!==o){let e=await ae(r);if(e){p({key:o,detail:e});return}}p(null),re(r,t)},className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(T,{testId:`git-sync-enabled-switch`,isToggled:N,isDisabled:!t,onToggle:M,children:r(d.AUTOMATIONS$GIT_SYNC$FIELD_ENABLED)}),(0,B.jsx)(`p`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$ENABLED_HELP)})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(b,{testId:`git-sync-interval-input`,name:`git-sync-interval-input`,type:`number`,min:0,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_INTERVAL),defaultValue:String(e.interval_seconds),isDisabled:!t,onChange:t=>h(t.trim()!==String(e.interval_seconds))}),(0,B.jsx)(`p`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$INTERVAL_HELP)})]}),(0,B.jsx)(b,{testId:`git-sync-repo-url-input`,name:`git-sync-repo-url-input`,type:`text`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_REPO_URL),defaultValue:e.repo_url,placeholder:r(d.AUTOMATIONS$GIT_SYNC$REPO_URL_PLACEHOLDER),isDisabled:!t,onChange:t=>_(t.trim()!==e.repo_url)}),(0,B.jsx)(b,{testId:`git-sync-branch-input`,name:`git-sync-branch-input`,type:`text`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_BRANCH),defaultValue:e.branch,placeholder:r(d.AUTOMATIONS$GIT_SYNC$BRANCH_PLACEHOLDER),isDisabled:!t,onChange:t=>S(t.trim()!==e.branch)}),(0,B.jsx)(b,{testId:`git-sync-path-input`,name:`git-sync-path-input`,type:`text`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_PATH),defaultValue:e.path,placeholder:r(d.AUTOMATIONS$GIT_SYNC$PATH_PLACEHOLDER),isDisabled:!t,onChange:t=>w(t.trim()!==e.path)}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(b,{testId:`git-sync-author-name-input`,name:`git-sync-author-name-input`,type:`text`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_AUTHOR_NAME),showOptionalTag:!0,defaultValue:``,isDisabled:!t,onChange:()=>O(!0)}),(0,B.jsx)(b,{testId:`git-sync-author-email-input`,name:`git-sync-author-email-input`,type:`email`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_AUTHOR_EMAIL),showOptionalTag:!0,defaultValue:``,isDisabled:!t,onChange:()=>A(!0)}),(0,B.jsx)(`p`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$AUTHOR_HELP)})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(b,{testId:`git-sync-token-input`,name:`git-sync-token-input`,type:`password`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_TOKEN),placeholder:r(d.AUTOMATIONS$GIT_SYNC$TOKEN_PLACEHOLDER),isDisabled:!t||z,onChange:R},z?`token-cleared`:`token-editable`),(0,B.jsx)(`p`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$TOKEN_HELP)}),(0,B.jsx)(T,{testId:`git-sync-clear-token-switch`,isToggled:z,isDisabled:!t,onToggle:X,children:r(d.AUTOMATIONS$GIT_SYNC$CLEAR_TOKEN)})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(b,{testId:`git-sync-encryption-key-input`,name:`git-sync-encryption-key-input`,type:`password`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_ENCRYPTION_KEY),placeholder:r(e.encryption_enabled?d.AUTOMATIONS$GIT_SYNC$KEY_SET_PLACEHOLDER:d.AUTOMATIONS$GIT_SYNC$KEY_UNSET_PLACEHOLDER),isDisabled:!t||W,onChange:U},W?`key-cleared`:`key-editable`),(0,B.jsx)(`p`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$ENCRYPTION_KEY_HELP)}),(0,B.jsx)(T,{testId:`git-sync-clear-encryption-key-switch`,isToggled:W,isDisabled:!t,onToggle:Z,children:r(d.AUTOMATIONS$GIT_SYNC$CLEAR_ENCRYPTION_KEY)})]}),f&&(0,B.jsxs)(`div`,{role:`alert`,"data-testid":`git-sync-check-failure`,className:`rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm text-red-300 whitespace-pre-wrap break-words`,children:[(0,B.jsx)(`p`,{className:`font-medium`,children:r(d.AUTOMATIONS$GIT_SYNC$CHECK_FAILED_TITLE)}),(0,B.jsx)(`p`,{className:`mt-1`,children:f.detail}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-red-300/70`,children:r(d.AUTOMATIONS$GIT_SYNC$CHECK_FAILED_HINT)})]}),(0,B.jsxs)(`div`,{className:`flex justify-start gap-3`,children:[(0,B.jsxs)(y,{testId:`git-sync-save-button`,variant:`primary`,type:`submit`,isDisabled:!t||a||l||J,children:[!a&&!l&&r(d.SETTINGS$SAVE_CHANGES),l&&r(d.AUTOMATIONS$GIT_SYNC$CHECKING),a&&r(d.SETTINGS$SAVING)]}),(0,B.jsx)(y,{testId:`git-sync-save-and-sync-button`,name:Q,variant:`secondary`,type:`submit`,isDisabled:!t||a||l||J||!N,children:r(d.AUTOMATIONS$GIT_SYNC$SAVE_AND_SYNC)})]})]})})}var re=3e3,ie=15e3,ae=3e4,oe=e=>({state:`running`,startedAt:e.sync_started_at??new Date().toISOString(),lastSyncedAt:e.last_synced_at,lastErrorAt:e.last_error_at}),se=r(function(){let{t:e}=s(`openhands`),t=l(),{canManage:n}=D(),[r,i]=(0,I.useState)({state:`idle`}),a=r.state===`running`,{data:o,isLoading:c,refetch:f}=w(),p=o?.status===`ok`,m=t.backend.kind===`local`,{data:h,isLoading:g,error:_,refetch:y}=R({enabled:p&&m,refetchInterval:a?re:ie});(0,I.useEffect)(()=>{h?.sync_in_progress&&i(e=>e.state===`running`?e:oe(h))},[h]),(0,I.useEffect)(()=>{r.state!==`running`||!h||(h.last_error_at&&h.last_error_at!==r.lastErrorAt?i({state:`failed`}):h.last_synced_at&&h.last_synced_at!==r.lastSyncedAt&&i({state:`succeeded`}))},[h,r]),(0,I.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>i({state:`idle`}),ae);return()=>clearTimeout(e)},[a,r]);let b=z();if(!m)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(U,{})})});if(c)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(H,{})})});if(!p)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(k,{onRetry:f})})});if(g)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(H,{})})});if(!h)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:v(_)===404?(0,B.jsx)(W,{}):(0,B.jsx)(j,{onRetry:()=>y()})})});let x=()=>{b.mutate(void 0,{onSuccess:()=>i(oe(h)),onError:t=>{u(v(t)===503?e(d.AUTOMATIONS$GIT_SYNC$SYNC_DISABLED_ERROR):E(t,e(d.ERROR$GENERIC)))}})};return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,B.jsx)(M,{}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-xl font-semibold text-content`,children:e(d.AUTOMATIONS$GIT_SYNC$TITLE)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:e(d.AUTOMATIONS$GIT_SYNC$SUBTITLE)})]}),h.last_error&&(0,B.jsx)(G,{error:h.last_error,errorAt:h.last_error_at}),(0,B.jsx)(Z,{status:h,onSyncNow:x,isSyncing:b.isPending||a,syncActivity:r.state,syncStartedAt:a?r.startedAt:null,canManage:n}),(0,B.jsx)($,{status:h,canManage:n,onSyncNow:x})]})})})});export{se as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as a}from"./useMutation-Cszf8mKy.js";import{t as o}from"./useQuery-DAAacS7O.js";import{t as s}from"./useTranslation-CCgUjPJF.js";import{ct as c,n as l,st as u}from"./active-backend-context-BETEdaJl.js";import{K as d,t as f}from"./utils-CbjwNcR-.js";import{t as p}from"./check-Bo8s5Ylg.js";import{t as m}from"./refresh-cw-BtdC3T8P.js";import{t as h}from"./triangle-alert-DEdu-b_L.js";import{n as g,t as _}from"./use-tracking-BAFpgpgq.js";import{t as v}from"./use-settings-D69cw06D.js";import{t as y}from"./brand-button-CGUwj6zK.js";import{t as b}from"./settings-input-B3i5U9GL.js";import{t as x}from"./format-time-delta-BIR5Os7T.js";import{t as S}from"./folder-C1ou4_DT.js";import{n as C,t as w}from"./use-automation-health-CbQ9n-k7.js";import{t as T}from"./settings-switch-CI93Iozg.js";import{n as E}from"./api-error-message-BXo0lCI5.js";import{t as D}from"./use-automation-permissions-gFy-2VD0.js";import{t as O}from"./parse-git-remote-url-BG8pcKL8.js";import{n as k,r as A,t as j}from"./error-state-BgYl7YeB.js";import{a as M,i as N,n as P,r as F,t as ee}from"./cog-DVZT1f0s.js";var I=e(t()),L=[`git-sync-status`];function R(e={}){let{enabled:t=!0,refetchInterval:n=!1}=e,r=l();return o({queryKey:[...L,r.backend.id,r.orgId],queryFn:()=>g.getGitSyncStatus(),staleTime:10*1e3,enabled:t,refetchInterval:n,retry:(e,t)=>v(t)===void 0&&e<2,meta:{disableToast:!0}})}function te(){let e=i(),t=l(),{trackGitSyncConfigUpdated:n}=_();return a({mutationFn:e=>g.updateGitSyncConfig(e),onSuccess:async r=>{let i=[...L,t.backend.id,t.orgId];await e.cancelQueries({queryKey:i}),e.setQueryData(i,r),n({backendKind:t.backend.kind})},meta:{disableToast:!0}})}function ne(){return a({mutationFn:e=>g.checkGitSyncConfig(e),retry:!1,meta:{disableToast:!0}})}function z(){let e=i(),t=l(),{trackGitSyncTriggered:n}=_();return a({mutationFn:()=>g.triggerGitSync(),onSuccess:()=>{e.invalidateQueries({queryKey:L}),n({backendKind:t.backend.kind})},meta:{disableToast:!0}})}var B=n();function V({className:e}){return(0,B.jsx)(`div`,{className:f(`animate-pulse rounded bg-surface-raised`,e)})}function H(){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`git-sync-skeleton`,children:[(0,B.jsx)(V,{className:`h-5 w-40`}),(0,B.jsx)(V,{className:`h-6 w-48`}),(0,B.jsx)(V,{className:`h-5 w-96`}),(0,B.jsx)(V,{className:`h-48 w-full rounded-2xl`}),(0,B.jsx)(V,{className:`h-96 w-full rounded-2xl`})]})}function U(){let{t:e}=s(`openhands`);return(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,B.jsx)(A,{className:`size-12 text-muted`}),(0,B.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(d.AUTOMATIONS$GIT_SYNC$NOT_LOCAL_TITLE)}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(d.AUTOMATIONS$GIT_SYNC$NOT_LOCAL_MESSAGE)}),(0,B.jsx)(`div`,{className:`mt-6`,children:(0,B.jsx)(M,{})})]})}function W(){let{t:e}=s(`openhands`);return(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,B.jsx)(A,{className:`size-12 text-muted`}),(0,B.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(d.AUTOMATIONS$GIT_SYNC$UNSUPPORTED_TITLE)}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(d.AUTOMATIONS$GIT_SYNC$UNSUPPORTED_MESSAGE)}),(0,B.jsx)(`div`,{className:`mt-6`,children:(0,B.jsx)(M,{})})]})}function G({error:e,errorAt:t}){let{t:n}=s(`openhands`);return(0,B.jsxs)(`div`,{role:`alert`,"data-testid":`git-sync-error-banner`,className:`rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm text-red-300 whitespace-pre-wrap break-words`,children:[(0,B.jsx)(`p`,{className:`font-medium`,children:n(d.AUTOMATIONS$GIT_SYNC$LAST_ERROR_TITLE)}),(0,B.jsx)(`p`,{className:`mt-1`,children:e}),t&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-red-300/70`,children:`${x(t)} ${n(d.CONVERSATION$AGO)}`})]})}var K=e=>(0,B.jsx)(`svg`,{viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,B.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2.4375 9C2.4375 5.37563 5.37563 2.4375 9 2.4375C12.6244 2.4375 15.5625 5.37563 15.5625 9C15.5625 12.6244 12.6244 15.5625 9 15.5625C5.37563 15.5625 2.4375 12.6244 2.4375 9ZM4.13812 6.5625C4.81317 5.21867 6.02897 4.19333 7.49996 3.77204C7.15155 4.17641 6.85182 4.65395 6.60713 5.17892C6.40828 5.60556 6.24263 6.06975 6.11494 6.5625H4.13812ZM3.72196 7.6875C3.61778 8.10783 3.5625 8.54746 3.5625 9C3.5625 9.45254 3.61778 9.89217 3.72196 10.3125H5.89738C5.84161 9.88758 5.8125 9.44852 5.8125 8.99998C5.8125 8.55142 5.84161 8.11239 5.89737 7.6875H3.72196ZM7.0333 7.6875C6.97087 8.10689 6.9375 8.54634 6.9375 8.99998C6.9375 9.45367 6.97087 9.89313 7.0333 10.3125H10.9667C11.0291 9.89311 11.0625 9.45367 11.0625 9.00002C11.0625 8.54637 11.0291 8.1069 10.9667 7.6875H7.0333ZM12.1026 7.6875C12.1584 8.1124 12.1875 8.55145 12.1875 9.00002C12.1875 9.44858 12.1584 9.88762 12.1026 10.3125H14.278C14.3822 9.89217 14.4375 9.45254 14.4375 9C14.4375 8.54746 14.3822 8.10783 14.278 7.6875H12.1026ZM13.8619 6.5625H11.885C11.7574 6.06976 11.5917 5.6056 11.3929 5.17897C11.1482 4.65397 10.8484 4.1764 10.5 3.77203C11.971 4.19331 13.1868 5.21866 13.8619 6.5625ZM10.7171 6.5625H7.28293C7.38007 6.23971 7.49559 5.93571 7.62681 5.65419C7.99835 4.85708 8.48101 4.26914 8.99997 3.92442C9.51895 4.26913 10.0016 4.8571 10.3732 5.65424C10.5044 5.93575 10.6199 6.23973 10.7171 6.5625ZM4.13812 11.4375H6.11496C6.24963 11.9572 6.42655 12.4452 6.64015 12.8909C6.87835 13.3879 7.16685 13.8413 7.50006 14.228C6.02902 13.8067 4.81318 12.7814 4.13812 11.4375ZM10.7171 11.4375H7.28295C7.3869 11.7829 7.51191 12.1068 7.65465 12.4047C8.02305 13.1733 8.49456 13.7398 9.00007 14.0756C9.51902 13.7308 10.0017 13.1429 10.3732 12.3458C10.5044 12.0643 10.6199 11.7603 10.7171 11.4375ZM11.3929 12.8211C11.5917 12.3944 11.7574 11.9303 11.8851 11.4375H13.8619C13.1868 12.7813 11.971 13.8067 10.5 14.228C10.8485 13.8236 11.1482 13.346 11.3929 12.8211Z`,fill:`currentColor`})});function q({tone:e,label:t,testId:n}){return(0,B.jsx)(`span`,{"data-testid":n,className:f(`inline-flex items-center rounded-full px-3 py-1 text-xs font-medium`,e===`success`&&`bg-[var(--oh-success)]/15 text-[var(--oh-success)]`,e===`warning`&&`bg-[var(--oh-warning)]/15 text-[var(--oh-warning)]`,e===`neutral`&&`bg-surface-raised text-muted`),children:t})}function J(e){let[,t]=(0,I.useState)(0);(0,I.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(n)},[e])}function Y({state:e,startedAt:t,pendingCount:n}){let{t:r}=s(`openhands`),i=e===`running`;if(J(i&&t!==null),e===`idle`)return null;let a=e===`failed`;return(0,B.jsxs)(`div`,{"data-testid":`git-sync-activity-row`,"data-state":e,className:f(`mt-4 flex flex-wrap items-center gap-x-2 gap-y-1 rounded-md px-3 py-2 text-sm`,i&&`bg-tertiary text-content`,e===`succeeded`&&`bg-green-500/10 text-green-300`,a&&`bg-red-500/10 text-red-300`),children:[i&&(0,B.jsx)(m,{className:`size-4 animate-spin`,"aria-hidden":!0}),e===`succeeded`&&(0,B.jsx)(p,{className:`size-4`,"aria-hidden":!0}),a&&(0,B.jsx)(h,{className:`size-4`,"aria-hidden":!0}),(0,B.jsxs)(`span`,{className:`font-medium`,children:[i&&r(d.AUTOMATIONS$GIT_SYNC$SYNCING),e===`succeeded`&&r(d.AUTOMATIONS$GIT_SYNC$SYNC_COMPLETED),a&&r(d.AUTOMATIONS$GIT_SYNC$SYNC_FAILED)]}),i&&t&&(0,B.jsx)(`span`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$SYNC_STARTED_AGO,{time:x(t)})}),i&&n>0&&(0,B.jsx)(`span`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$SYNC_PENDING_COUNT,{count:n})})]})}function X(e){let t=O(e);if(!t?.host||!t.repository)return null;if(/^https?:\/\//i.test(t.url)){let e=new URL(t.url);return e.username=``,e.password=``,e.pathname=e.pathname.replace(/\.git$/,``),e.toString()}return`https://${t.host}/${t.repository}`}function Z({status:e,onSyncNow:t,isSyncing:n,syncActivity:r,syncStartedAt:i,canManage:a}){let{t:o}=s(`openhands`),c=X(e.repo_url);return(0,B.jsxs)(F,{icon:(0,B.jsx)(N,{className:`size-4`}),title:o(d.AUTOMATIONS$GIT_SYNC$STATUS_TITLE),children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(q,{testId:`git-sync-enabled-pill`,tone:e.enabled?`success`:`neutral`,label:o(e.enabled?d.AUTOMATIONS$GIT_SYNC$ENABLED:d.AUTOMATIONS$GIT_SYNC$DISABLED)}),(0,B.jsx)(q,{testId:`git-sync-encryption-pill`,tone:e.encryption_enabled?`success`:`neutral`,label:o(e.encryption_enabled?d.AUTOMATIONS$GIT_SYNC$ENCRYPTED:d.AUTOMATIONS$GIT_SYNC$NOT_ENCRYPTED)})]}),(0,B.jsx)(y,{testId:`git-sync-now-button`,type:`button`,variant:`secondary`,isDisabled:!a||!e.enabled||n,onClick:t,startContent:(0,B.jsx)(m,{className:f(`size-4`,n&&`animate-spin`),"aria-hidden":!0}),children:o(n?d.AUTOMATIONS$GIT_SYNC$SYNCING:d.AUTOMATIONS$GIT_SYNC$SYNC_NOW)})]}),(0,B.jsx)(Y,{state:r,startedAt:i,pendingCount:e.dirty_count}),(0,B.jsxs)(`div`,{className:`mt-5 grid grid-cols-2 gap-x-4 gap-y-5`,children:[(0,B.jsx)(P,{icon:(0,B.jsx)(K,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$REPOSITORY),children:c?(0,B.jsx)(`a`,{"data-testid":`git-sync-repo-link`,href:c,target:`_blank`,rel:`noopener noreferrer`,className:`break-all underline transition-colors hover:text-foreground`,children:e.repo_url}):(0,B.jsx)(`span`,{className:`break-all`,children:e.repo_url||o(d.AUTOMATIONS$GIT_SYNC$NOT_CONFIGURED)})}),(0,B.jsx)(P,{icon:(0,B.jsx)(N,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$FIELD_BRANCH),children:e.branch}),(0,B.jsx)(P,{icon:(0,B.jsx)(S,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$FIELD_PATH),children:e.path}),(0,B.jsx)(P,{icon:(0,B.jsx)(N,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$LAST_SYNCED_COMMIT),children:e.last_synced_commit?(0,B.jsx)(`span`,{className:`font-mono`,children:e.last_synced_commit.slice(0,7)}):o(d.AUTOMATIONS$GIT_SYNC$NEVER_SYNCED)}),(0,B.jsx)(P,{icon:(0,B.jsx)(C,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$LAST_SYNCED_AT),children:e.last_synced_at?`${x(e.last_synced_at)} ${o(d.CONVERSATION$AGO)}`:o(d.AUTOMATIONS$GIT_SYNC$NEVER_SYNCED)}),(0,B.jsx)(P,{icon:(0,B.jsx)(C,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$FIELD_INTERVAL),children:e.interval_seconds>0?o(d.AUTOMATIONS$GIT_SYNC$EVERY_N_SECONDS,{count:e.interval_seconds}):o(d.AUTOMATIONS$GIT_SYNC$MANUAL_ONLY)}),(0,B.jsx)(P,{icon:(0,B.jsx)(C,{className:`size-3.5`}),label:o(d.AUTOMATIONS$GIT_SYNC$PENDING_CHANGES),children:(0,B.jsx)(`span`,{className:f(e.dirty_count>0&&`text-[var(--oh-warning)]`),children:e.dirty_count})})]})]})}var Q=`git-sync-save-and-sync`;function $({status:e,canManage:t,onSyncNow:n}){let{t:r}=s(`openhands`),{mutate:i,isPending:a}=te(),{mutateAsync:o,isPending:l}=ne(),[f,p]=(0,I.useState)(null),[m,h]=(0,I.useState)(!1),[g,_]=(0,I.useState)(!1),[x,S]=(0,I.useState)(!1),[C,w]=(0,I.useState)(!1),[D,O]=(0,I.useState)(!1),[k,A]=(0,I.useState)(!1),[j,M]=(0,I.useState)(null),N=j??e.enabled,P=j!==null&&N!==e.enabled,[L,R]=(0,I.useState)(``),[z,V]=(0,I.useState)(!1),[H,U]=(0,I.useState)(``),[W,G]=(0,I.useState)(!1),K=L.trim().length>0||z,q=H.trim().length>0||W,J=!P&&!m&&!g&&!x&&!C&&!D&&!k&&!K&&!q,Y=()=>{M(null),h(!1),_(!1),S(!1),w(!1),O(!1),A(!1),R(``),V(!1),U(``),G(!1),p(null)},X=e=>{V(e),R(``)},Z=e=>{G(e),U(``)},$=(e,t)=>e.get(t)?.toString().trim()||null,re=(e,t)=>{i(e,{onSuccess:()=>{c(r(d.AUTOMATIONS$GIT_SYNC$CONFIG_SAVED)),Y(),t&&n()},onError:e=>{u(v(e)===409?r(d.AUTOMATIONS$GIT_SYNC$ENABLE_BLOCKED_ERROR):E(e,r(d.ERROR$GENERIC)))}})},ie=e=>[`repo_url`,`branch`,`token`].filter(t=>t in e).map(t=>`${t}=${e[t]}`).join(`&`),ae=async e=>{try{let t=await o(e);return t.ok?null:t.detail??r(d.AUTOMATIONS$GIT_SYNC$CHECK_FAILED_TITLE)}catch{return null}};return(0,B.jsx)(F,{icon:(0,B.jsx)(ee,{className:`size-4`}),title:r(d.AUTOMATIONS$GIT_SYNC$CONFIG_TITLE),children:(0,B.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault();let t=e.nativeEvent.submitter?.getAttribute(`name`)===Q,n=new FormData(e.currentTarget),r={};if(P&&(r.enabled=N),m){let e=n.get(`git-sync-interval-input`)?.toString().trim(),t=Number(e);r.interval_seconds=e&&Number.isFinite(t)?Math.max(0,Math.trunc(t)):0}g&&(r.repo_url=$(n,`git-sync-repo-url-input`)),x&&(r.branch=$(n,`git-sync-branch-input`)),C&&(r.path=$(n,`git-sync-path-input`)),D&&(r.author_name=$(n,`git-sync-author-name-input`)),k&&(r.author_email=$(n,`git-sync-author-email-input`));let i=L.trim(),a=H.trim();z?r.token=null:i&&(r.token=i),W?r.encryption_key=null:a&&(r.encryption_key=a);let o=ie(r);if(o&&f?.key!==o){let e=await ae(r);if(e){p({key:o,detail:e});return}}p(null),re(r,t)},className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(T,{testId:`git-sync-enabled-switch`,isToggled:N,isDisabled:!t,onToggle:M,children:r(d.AUTOMATIONS$GIT_SYNC$FIELD_ENABLED)}),(0,B.jsx)(`p`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$ENABLED_HELP)})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(b,{testId:`git-sync-interval-input`,name:`git-sync-interval-input`,type:`number`,min:0,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_INTERVAL),defaultValue:String(e.interval_seconds),isDisabled:!t,onChange:t=>h(t.trim()!==String(e.interval_seconds))}),(0,B.jsx)(`p`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$INTERVAL_HELP)})]}),(0,B.jsx)(b,{testId:`git-sync-repo-url-input`,name:`git-sync-repo-url-input`,type:`text`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_REPO_URL),defaultValue:e.repo_url,placeholder:r(d.AUTOMATIONS$GIT_SYNC$REPO_URL_PLACEHOLDER),isDisabled:!t,onChange:t=>_(t.trim()!==e.repo_url)}),(0,B.jsx)(b,{testId:`git-sync-branch-input`,name:`git-sync-branch-input`,type:`text`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_BRANCH),defaultValue:e.branch,placeholder:r(d.AUTOMATIONS$GIT_SYNC$BRANCH_PLACEHOLDER),isDisabled:!t,onChange:t=>S(t.trim()!==e.branch)}),(0,B.jsx)(b,{testId:`git-sync-path-input`,name:`git-sync-path-input`,type:`text`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_PATH),defaultValue:e.path,placeholder:r(d.AUTOMATIONS$GIT_SYNC$PATH_PLACEHOLDER),isDisabled:!t,onChange:t=>w(t.trim()!==e.path)}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(b,{testId:`git-sync-author-name-input`,name:`git-sync-author-name-input`,type:`text`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_AUTHOR_NAME),showOptionalTag:!0,defaultValue:``,isDisabled:!t,onChange:()=>O(!0)}),(0,B.jsx)(b,{testId:`git-sync-author-email-input`,name:`git-sync-author-email-input`,type:`email`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_AUTHOR_EMAIL),showOptionalTag:!0,defaultValue:``,isDisabled:!t,onChange:()=>A(!0)}),(0,B.jsx)(`p`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$AUTHOR_HELP)})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(b,{testId:`git-sync-token-input`,name:`git-sync-token-input`,type:`password`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_TOKEN),placeholder:r(d.AUTOMATIONS$GIT_SYNC$TOKEN_PLACEHOLDER),isDisabled:!t||z,onChange:R},z?`token-cleared`:`token-editable`),(0,B.jsx)(`p`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$TOKEN_HELP)}),(0,B.jsx)(T,{testId:`git-sync-clear-token-switch`,isToggled:z,isDisabled:!t,onToggle:X,children:r(d.AUTOMATIONS$GIT_SYNC$CLEAR_TOKEN)})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(b,{testId:`git-sync-encryption-key-input`,name:`git-sync-encryption-key-input`,type:`password`,label:r(d.AUTOMATIONS$GIT_SYNC$FIELD_ENCRYPTION_KEY),placeholder:r(e.encryption_enabled?d.AUTOMATIONS$GIT_SYNC$KEY_SET_PLACEHOLDER:d.AUTOMATIONS$GIT_SYNC$KEY_UNSET_PLACEHOLDER),isDisabled:!t||W,onChange:U},W?`key-cleared`:`key-editable`),(0,B.jsx)(`p`,{className:`text-xs text-muted`,children:r(d.AUTOMATIONS$GIT_SYNC$ENCRYPTION_KEY_HELP)}),(0,B.jsx)(T,{testId:`git-sync-clear-encryption-key-switch`,isToggled:W,isDisabled:!t,onToggle:Z,children:r(d.AUTOMATIONS$GIT_SYNC$CLEAR_ENCRYPTION_KEY)})]}),f&&(0,B.jsxs)(`div`,{role:`alert`,"data-testid":`git-sync-check-failure`,className:`rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm text-red-300 whitespace-pre-wrap break-words`,children:[(0,B.jsx)(`p`,{className:`font-medium`,children:r(d.AUTOMATIONS$GIT_SYNC$CHECK_FAILED_TITLE)}),(0,B.jsx)(`p`,{className:`mt-1`,children:f.detail}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-red-300/70`,children:r(d.AUTOMATIONS$GIT_SYNC$CHECK_FAILED_HINT)})]}),(0,B.jsxs)(`div`,{className:`flex justify-start gap-3`,children:[(0,B.jsxs)(y,{testId:`git-sync-save-button`,variant:`primary`,type:`submit`,isDisabled:!t||a||l||J,children:[!a&&!l&&r(d.SETTINGS$SAVE_CHANGES),l&&r(d.AUTOMATIONS$GIT_SYNC$CHECKING),a&&r(d.SETTINGS$SAVING)]}),(0,B.jsx)(y,{testId:`git-sync-save-and-sync-button`,name:Q,variant:`secondary`,type:`submit`,isDisabled:!t||a||l||J||!N,children:r(d.AUTOMATIONS$GIT_SYNC$SAVE_AND_SYNC)})]})]})})}var re=3e3,ie=15e3,ae=3e4,oe=e=>({state:`running`,startedAt:e.sync_started_at??new Date().toISOString(),lastSyncedAt:e.last_synced_at,lastErrorAt:e.last_error_at}),se=r(function(){let{t:e}=s(`openhands`),t=l(),{canManage:n}=D(),[r,i]=(0,I.useState)({state:`idle`}),a=r.state===`running`,{data:o,isLoading:c,refetch:f}=w(),p=o?.status===`ok`,m=t.backend.kind===`local`,{data:h,isLoading:g,error:_,refetch:y}=R({enabled:p&&m,refetchInterval:a?re:ie});(0,I.useEffect)(()=>{h?.sync_in_progress&&i(e=>e.state===`running`?e:oe(h))},[h]),(0,I.useEffect)(()=>{r.state!==`running`||!h||(h.last_error_at&&h.last_error_at!==r.lastErrorAt?i({state:`failed`}):h.last_synced_at&&h.last_synced_at!==r.lastSyncedAt&&i({state:`succeeded`}))},[h,r]),(0,I.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>i({state:`idle`}),ae);return()=>clearTimeout(e)},[a,r]);let b=z();if(!m)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(U,{})})});if(c)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(H,{})})});if(!p)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(k,{onRetry:f})})});if(g)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(H,{})})});if(!h)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:v(_)===404?(0,B.jsx)(W,{}):(0,B.jsx)(j,{onRetry:()=>y()})})});let x=()=>{b.mutate(void 0,{onSuccess:()=>i(oe(h)),onError:t=>{u(v(t)===503?e(d.AUTOMATIONS$GIT_SYNC$SYNC_DISABLED_ERROR):E(t,e(d.ERROR$GENERIC)))}})};return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,B.jsx)(M,{}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-xl font-semibold text-content`,children:e(d.AUTOMATIONS$GIT_SYNC$TITLE)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:e(d.AUTOMATIONS$GIT_SYNC$SUBTITLE)})]}),h.last_error&&(0,B.jsx)(G,{error:h.last_error,errorAt:h.last_error_at}),(0,B.jsx)(Z,{status:h,onSyncNow:x,isSyncing:b.isPending||a,syncActivity:r.state,syncStartedAt:a?r.startedAt:null,canManage:n}),(0,B.jsx)($,{status:h,canManage:n,onSyncNow:x})]})})})});export{se as default};
@@ -0,0 +1,3 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{F as r,P as i,R as a,U as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{l as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as c}from"./useTranslation-CCgUjPJF.js";import{$ as l,n as u}from"./active-backend-context-BETEdaJl.js";import{K as d,t as f}from"./utils-CbjwNcR-.js";import{r as p}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js";import{t as m}from"./loading-spinner-BJc2J0Dw.js";import{C as h,I as g,L as _,P as v,R as ee,S as y,_ as te,a as b,b as ne,c as x,d as re,f as S,g as ie,h as C,i as w,l as ae,m as oe,n as T,o as se,p as E,r as ce,s as D,t as le,u as ue,v as de,y as fe}from"./use-tracking-BAFpgpgq.js";import{l as O}from"./settings-service.api-CYBTLGOd.js";import{n as pe}from"./use-settings-D69cw06D.js";import{t as me}from"./modal-backdrop-BSzNhM4r.js";import{n as he}from"./modal-classes-BPcBCWVj.js";import{f as ge,l as _e}from"./form-control-classes-BVI_szaj.js";import{t as k}from"./brand-button-CGUwj6zK.js";import{t as A}from"./navigation-link-Bxo3-4vo.js";import{t as ve}from"./settings-dropdown-input-Df_HXRk4.js";import{o as ye,s as j,t as M}from"./conversation-store-DC-JlJuq.js";import{t as be}from"./modal-close-button-Cq3dma5u.js";import{t as N}from"./settings-input-B3i5U9GL.js";import{t as xe}from"./use-llm-profiles-U4u1gzuk.js";import{n as P}from"./use-create-conversation-D15Px574.js";import{t as Se}from"./api-error-message-BXo0lCI5.js";import{t as F}from"./mcp-installed-servers-BW51n6PC.js";import{t as I}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js";import{n as L,o as Ce,s as R}from"./mcp-marketplace-utils-BwEnDYqm.js";import{a as we,i as Te,n as Ee,r as De}from"./use-manifest-capabilities-D81_YdAF.js";import{t as z}from"./git-repo-dropdown-DNlinQ7r.js";import"./git-repo-dropdown-1fZGYtYm.js";var B=e(t(),1);function Oe(e){let t=e.requires.integrations,{data:n,isLoading:r}=pe(),i=(0,B.useMemo)(()=>F(O(n?.agent_settings?.mcp_config)),[n?.agent_settings?.mcp_config]),a=(0,B.useMemo)(()=>{let e=R(I);return Object.entries(t).map(([t,n])=>({id:t,requirement:n,entry:Ce(t,e)??null})).filter(({entry:e})=>!e||!L(e,i))},[t,i]),o=a.filter(({requirement:e})=>e.required!==!1);return{blockingIntegrations:o,warningIntegrations:a.filter(({requirement:e})=>e.required===!1),isBlocked:o.length>0,isLoading:r}}var V={fieldErrors:{},formErrors:[]};function H(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function U(e,t){let n=e[0]===`body`?e.slice(1):e,r=[],i=t;return n.forEach(e=>{if(typeof e==`number`){Array.isArray(i)&&r.length>0&&(r[r.length-1]+=`[${e}]`,i=i[e]);return}H(i)&&e in i&&(r.push(e),i=i[e])}),r.join(`.`)}function ke(e,t){if(!H(e))return[];if(Array.isArray(e.errors))return e.errors.flatMap(e=>!H(e)||typeof e.message!=`string`?[]:[{path:typeof e.field==`string`?e.field:``,message:e.message}]);let{detail:n}=e;return typeof n==`string`?[{path:``,message:n}]:Array.isArray(n)?n.flatMap(e=>!H(e)||typeof e.msg!=`string`?[]:[{path:U(Array.isArray(e.loc)?e.loc:[],t),message:e.msg}]):[]}function Ae(e,t){return t[e]??t[e.replace(/\[\d+\]/g,`[0]`)]}function je(e,t){if(e.length===0)return V;let n={},r=[];return e.forEach(({path:e,message:i})=>{let a=e?Ae(e,t):void 0;if(!a?.length){r.push(i);return}a.forEach(e=>{e in n||(n[e]=i)})}),{fieldErrors:n,formErrors:r}}var Me={fieldErrors:{},formErrors:[]},W=[404,501];function G(e){return W.some(t=>l(e,t)||s.isAxiosError(e)&&e.response?.status===t)}function Ne(e){let t=(0,B.useRef)(0);return(0,B.useCallback)(async(n,r,i)=>{try{let a=b(e,n,r,i);if(!a)return null;t.current+=1;let o=t.current,s=await T.validateDraft(a);return o===t.current?s?.valid?Me:je(ke(s,a.draft),se(e,r,i)):null}catch(e){return G(e)||console.warn(`Automation setup preflight failed:`,e),null}},[e])}var K=new TextEncoder,q=512,Pe=100,J=148;function Fe(e,t,n){let r=new Uint8Array(q),i=(e,t)=>{for(let n=0;n<t.length;n+=1)r[e+n]=t.charCodeAt(n)&127},a=(e,t,n)=>i(e,n.toString(8).padStart(t-1,`0`));return r.set(t,0),a(100,8,e.mode??420),a(108,8,0),a(116,8,0),a(124,12,n),a(136,12,0),r[156]=48,i(257,`ustar`),i(263,`00`),r.fill(32,J,156),i(J,r.reduce((e,t)=>e+t,0).toString(8).padStart(6,`0`)),r[154]=0,r[155]=32,r}function Ie(e){let t=[];for(let n of e){let e=K.encode(n.name);if(e.length>Pe)throw Error(`tar: name too long for a ustar header: ${n.name}`);let r=K.encode(n.content);t.push(Fe(n,e,r.length));let i=new Uint8Array(Math.ceil(r.length/q)*q);i.set(r),t.push(i)}t.push(new Uint8Array(q*2));let n=t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(new ArrayBuffer(n)),i=0;for(let e of t)r.set(e,i),i+=e.length;return r}async function Le(e){let t=Ie(e),n=new ReadableStream({start(e){e.enqueue(t),e.close()}}),r=new Response(n.pipeThrough(new CompressionStream(`gzip`)));return new Uint8Array(await r.arrayBuffer())}function Re(e){let t=p?.(e);if(!t||Object.keys(t).length===0)throw Error(`The published extensions package ships no bundle files for '${e}'.`);return t}function ze(e){let t=(e.entrypoint.trim().split(` `)[0]??``).replace(/^\.\//,``);return new Set([e.setupScript,t in e.files?t:void 0].filter(e=>e!==void 0))}async function Be(e,t){let n=e.setup.bundle;if(!n)throw Error(`'${e.id}' declares no bundle.`);let r=Re(e.id),i=Object.keys(n.files).filter(e=>typeof r[e]!=`string`);if(i.length>0)throw Error(`The published extensions package is missing bundle files for '${e.id}': ${i.join(`, `)}.`);let a=w(e,t)?.template,o=ze(n),s=Object.keys(n.files).sort().map(e=>({name:e,content:r[e],mode:o.has(e)?493:420}));return s.push({name:_,content:`${JSON.stringify(a?.config??{},null,2)}\n`}),Le(s)}function Ve(e){return typeof File<`u`&&e instanceof File}function He(e,t,n){let r=t.tarball,i=Ve(r)?{name:r.name,size:r.size,lastModified:r.lastModified}:r;return`${e.id}
2
+ ${n??``}
3
+ ${JSON.stringify({...t,tarball:i})}`}async function Ue(e){let t=e.tarball;if(!Ve(t))throw Error(`Choose a tarball before creating this automation.`);return new Uint8Array(await t.arrayBuffer())}function We(){let e=P(),t=M(e=>e.setMessageToSend),n=(0,B.useRef)(null),r=(0,B.useCallback)(async n=>{let r=await e.mutateAsync({});return r.conversation_id.startsWith(`task-`)&&r.task_id?j(r.task_id,n):ye(r.conversation_id,{draftMessage:n}),window.setTimeout(()=>t(n),0),{response:{...r}}},[e,t]);return(0,B.useCallback)(async(e,t,i,a,o)=>{if(!i)return r(ce(e,t));if(D(e)||x(e,o)){let r=He(e,t,o),i=n.current?.path??null;if(n.current?.key!==r||i===null){let a=D(e)?await Be(e,t):await Ue(t);i=await T.uploadAutomationTarball(e.id,a),n.current={key:r,path:i}}let s=w(e,t,i,a,o);if(!s)throw Error(`'${e.id}' produced no create request.`);return{response:await T.createAutomationDraft(s,e,o)}}return{response:await T.createAutomationDraft(i,e,o)}},[r])}var Y=n();function Ge({name:e,field:t,values:n,canListRepositories:r,placeholder:i,disabled:a,onChange:o,onBlur:s}){let{t:l}=c(`openhands`),[u,f]=(0,B.useState)(``),p=e=>{let t=e.trim();!t||n.includes(t)||(o([...n,t]),f(``),s())},m=e=>{o(n.filter(t=>t!==e)),s()};return(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,"data-testid":`setup-list-${e}`,children:[n.length>0&&(0,Y.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:n.map(t=>(0,Y.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-md border border-[var(--oh-border)] px-3 py-1.5`,children:[(0,Y.jsx)(`span`,{className:`truncate text-sm`,children:t}),(0,Y.jsx)(k,{testId:`setup-list-${e}-remove-${t}`,type:`button`,variant:`ghost-danger`,isDisabled:a,ariaLabel:l(d.COMMON$REMOVE),onClick:()=>m(t),children:l(d.COMMON$REMOVE)})]},t))}),r?(0,Y.jsx)(z,{provider:t.provider??`github`,value:null,repositoryName:null,placeholder:i,disabled:a,onChange:e=>{e?.full_name&&p(e.full_name)}}):(0,Y.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,Y.jsx)(`div`,{className:`grow`,children:(0,Y.jsx)(N,{testId:`setup-field-${e}`,name:e,label:``,ariaLabel:t.label,type:`text`,value:u,placeholder:i,isDisabled:a,onChange:f,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),p(u))},onBlur:()=>p(u)})}),(0,Y.jsx)(k,{testId:`setup-list-${e}-add`,type:`button`,variant:`secondary`,isDisabled:a||u.trim()===``,onClick:()=>p(u),children:l(d.BUTTON$ADD)})]})]})}function Ke({name:e,field:t,value:n,error:r,options:i,isOptionsLoading:a=!1,repository:o,disabled:s,onChange:l,onRepositoryChange:p,onBlur:m}){let{t:h}=c(`openhands`),{backend:g}=u(),_=`setup-field-${e}`,v=(0,Y.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:t.help}),ee=g.kind===`cloud`,y=t.placeholder??h(d.SETUP$REPOSITORY_PLACEHOLDER);if(t.type===`repo-picker`&&t.multiple)return(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,Y.jsx)(Z,{field:t}),(0,Y.jsx)(Ge,{name:e,field:t,values:E(n),canListRepositories:ee,placeholder:y,disabled:s,onChange:l,onBlur:m}),(0,Y.jsx)(Q,{testId:_,error:r}),v]});if(t.type===`repo-picker`&&ee)return(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,Y.jsx)(Z,{field:t}),(0,Y.jsx)(z,{provider:t.provider??`github`,value:o?.id??null,repositoryName:o?.full_name??S(n)??null,placeholder:t.placeholder,disabled:s,onChange:e=>{p(e??null),l(e?.full_name??``),m()}}),(0,Y.jsx)(Q,{testId:_,error:r}),v]});if(t.type===`select`||t.type===`llm-profile`||[`timezone`,`event-source`,`event-type`].includes(t.type)&&i.length>0){let o=i.length>0,c=t.type===`llm-profile`&&!a&&!o;return(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,Y.jsx)(ve,{testId:_,name:e,label:(0,Y.jsx)(X,{field:t}),items:i.map(e=>({key:e.value,label:e.label})),selectedKey:S(n)||void 0,placeholder:c?h(d.MODEL$NO_SAVED_PROFILES):t.placeholder,isDisabled:s||c,isLoading:a,required:t.required,onSelectionChange:e=>{l(e===null?``:String(e)),m()}}),(0,Y.jsx)(Q,{testId:_,error:r}),v]})}if(t.type===`plugin-sources`)return(0,Y.jsxs)(`label`,{className:`flex w-full flex-col gap-2.5`,children:[(0,Y.jsx)(X,{field:t}),(0,Y.jsx)(`textarea`,{"data-testid":_,name:e,rows:4,value:S(n),placeholder:t.placeholder,disabled:s,"aria-invalid":!!r,onChange:e=>l(e.target.value),onBlur:m,className:f(_e,r&&`border-red-500`)}),(0,Y.jsx)(Q,{testId:_,error:r}),v]});if(t.type===`tarball-upload`)return(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,Y.jsx)(Z,{field:t}),(0,Y.jsx)(`input`,{"data-testid":_,name:e,type:`file`,accept:`.tar,.tar.gz,.tgz,application/gzip,application/x-tar`,disabled:s,"aria-invalid":!!r,onChange:e=>{l(e.target.files?.[0]??``),m()},className:f(ge,`file:mr-3 file:rounded-md file:border-0 file:bg-neutral-700 file:px-3 file:py-1.5 file:text-sm file:text-white`,r&&`border-red-500`)}),S(n)&&(0,Y.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:S(n)}),(0,Y.jsx)(Q,{testId:_,error:r}),v]});if(t.type===`textarea`)return(0,Y.jsxs)(`label`,{className:`flex w-full flex-col gap-2.5`,children:[(0,Y.jsx)(X,{field:t}),(0,Y.jsx)(`textarea`,{"data-testid":_,name:e,rows:4,value:S(n),placeholder:t.placeholder,disabled:s,"aria-invalid":!!r,onChange:e=>l(e.target.value),onBlur:m,className:f(_e,r&&`border-red-500`)}),(0,Y.jsx)(Q,{testId:_,error:r}),v]});let te=t.type===`repo-picker`?y:t.placeholder;return(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,Y.jsx)(N,{testId:_,name:e,type:t.type===`number`?`number`:`text`,label:t.label,value:S(n),placeholder:te,isDisabled:s,min:t.constraints?.min,max:t.constraints?.max,showRequiredTag:t.required,error:r,onChange:l,onBlur:m}),v]})}function X({field:e}){return(0,Y.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[e.label,e.required&&(0,Y.jsx)(`span`,{className:`text-sm leading-none text-red-400`,"aria-hidden":!0,children:`*`})]})}function Z({field:e}){return(0,Y.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Y.jsx)(X,{field:e})})}function Q({testId:e,error:t}){return t?(0,Y.jsx)(`p`,{role:`alert`,"data-testid":`${e}-error`,className:`-mt-1 text-xs text-red-400`,children:t}):null}var qe=`/mcp`;function Je({prerequisites:e}){let{t}=c(`openhands`),{blockingIntegrations:n,warningIntegrations:r}=e;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`setup-prerequisites`,children:[[...n,...r].map(({id:e,requirement:t,entry:n})=>(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`span`,{className:`text-sm`,children:n?.name??e}),(0,Y.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:t.message})]},e)),(0,Y.jsx)(A,{to:qe,className:`text-sm underline`,children:t(d.SETUP$MANAGE_INTEGRATIONS)})]})}function Ye({setup:e,values:t,selectedTrigger:n,selectedAction:r}){let{t:i}=c(`openhands`);return(0,Y.jsx)(`div`,{className:`flex flex-col gap-4`,"data-testid":`setup-review`,children:(0,Y.jsxs)(`dl`,{className:`flex flex-col gap-3`,children:[r&&e.actions?.[r]&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-[var(--oh-muted)]`,children:i(d.SETUP$ACTION_LABEL)}),(0,Y.jsx)(`dd`,{className:`text-sm break-words`,children:e.actions[r]?.label})]}),Object.entries(re(e,n,r)).map(([e,n])=>(0,Y.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-[var(--oh-muted)]`,children:n.label}),(0,Y.jsx)(`dd`,{className:`text-sm break-words`,children:E(t[e]).join(`, `)||i(d.SETUP$EMPTY_VALUE)})]},e))]})})}var Xe=400,$={fieldErrors:{},formErrors:[]};function Ze(e){return e.formErrors.length>0||Object.keys(e.fieldErrors).length>0}function Qe(e){return typeof e.conversation_id==`string`?`/conversations/${e.conversation_id}`:typeof e.id==`string`?y(e.id):null}function $e({entry:e,onClose:t}){let{t:n}=c(`openhands`),r=a(),i=Ee(e),o=Oe(e),s=Ne(e),l=We(),{trackAutomationSetupOpened:u,trackAutomationSetupValidated:p,trackAutomationSetupCreated:h,trackAutomationSetupFailed:g}=le(),[_,v]=(0,B.useState)(`prerequisites`),y=(0,B.useMemo)(()=>fe(e.setup),[e]),b=(0,B.useMemo)(()=>y.length===0?[]:i.capabilities?Te(e,i.capabilities):y,[y,i.capabilities,e]),x=(0,B.useMemo)(()=>ue(e.setup),[e]),[S,T]=(0,B.useState)(()=>te(e.setup)),[E,ce]=(0,B.useState)(()=>ie(e.setup)),[D,O]=(0,B.useState)(()=>C(e.setup,te(e.setup),ie(e.setup))),[pe,ge]=(0,B.useState)({}),[_e,A]=(0,B.useState)({}),[ye,j]=(0,B.useState)($),[M,N]=(0,B.useState)(!1),P=(0,B.useRef)(D),F=(0,B.useRef)(null);(0,B.useEffect)(()=>()=>{F.current&&window.clearTimeout(F.current)},[]);let I=(0,B.useMemo)(()=>x.length===0?[]:(i.capabilities?De(e,i.capabilities):x).filter(t=>ae(e,t).length===0),[x,i.capabilities,e]),L=(0,B.useMemo)(()=>re(e.setup,S,E),[e,S,E]),Ce=D.agent_profile_id?Object.fromEntries(Object.entries(L).filter(([,e])=>e.type!==`llm-profile`)):L,R=(0,B.useMemo)(()=>Object.values(L).some(e=>e.type===`llm-profile`),[L]),{data:z,isLoading:V}=xe({enabled:R}),H=(0,B.useMemo)(()=>(z?.profiles??[]).map(e=>({value:e.name,label:e.name})),[z?.profiles]),U=(0,B.useMemo)(()=>{let t=de(e.setup,i.capabilities,S,E);return!R||V?t:Object.entries(L).reduce((e,[t,n])=>n.type===`llm-profile`?{...e,[t]:{options:H}}:e,t)},[e.setup,i.capabilities,S,E,R,V,L,H]),Ae=(0,B.useMemo)(()=>w(e,D,void 0,S,E),[e,D,S,E]),Me=(0,B.useMemo)(()=>se(e,S,E),[e,S,E]),W=(0,B.useRef)(!1);(0,B.useEffect)(()=>{W.current||(W.current=!0,u({automationId:e.id}))},[e.id,u]);let G=(0,B.useMemo)(()=>ae(e,E),[e,E]),K=i.supported===!1||G.length>0,q=[...i.unmet,...G],Pe=o.blockingIntegrations.length>0||o.warningIntegrations.length>0,J=_===`prerequisites`&&!Pe?`form`:_,Fe=t=>{T(t),P.current={...C(e.setup,t,E),...P.current},O(P.current),A({}),j($)},Ie=t=>{ce(t),P.current={...C(e.setup,S,t),...P.current},O(P.current),A({}),j($)};(0,B.useEffect)(()=>{y.length===0||i.isLoading||S&&b.includes(S)||b.length>0&&Fe(b[0])},[b,y.length,i.isLoading,S]),(0,B.useEffect)(()=>{x.length===0||i.isLoading||E&&I.includes(E)||I.length>0&&Ie(I[0])},[I,x.length,i.isLoading,E]);let Le=(e,t)=>{P.current={...P.current,[e]:t},O(P.current),A(({[e]:t,...n})=>n),j(t=>{if(!(e in t.fieldErrors))return t;let{[e]:n,...r}=t.fieldErrors;return{...t,fieldErrors:r}})},Re=()=>{F.current&&window.clearTimeout(F.current),F.current=window.setTimeout(()=>{s(P.current,S,E).then(e=>{e&&j(e)})},Xe)},ze=async()=>{if(J===`prerequisites`){v(`form`);return}let t=ne(e.setup,D,U,S,E);if(Object.keys(t).length>0){A(t);return}A({});let n=await s(D,S,E);if(n&&Ze(n)){j(n);return}j($),p({automationId:e.id}),v(`review`)},Be=async(i,a)=>{N(!0);try{let{response:n}=await l(e,D,i,S,E);h({automationId:e.id,setupMode:a});let o=Qe(n);o?r(o,{replace:!0}):t()}catch(t){g({automationId:e.id,setupMode:a});let r=je(ke(Se(t),i),Me);j(Ze(r)?r:{fieldErrors:{},formErrors:[n(d.SETUP$SUBMIT_FAILED)]}),v(`form`)}finally{N(!1)}},Ve=()=>Be(Ae,e.setup.mode),He=()=>Be(null,`assisted`),Ue=e.setup.mode===`direct`&&(ee(e)!==null||e.setup.message!==void 0),Ge=e=>{let t=_e[e];return t?et(t,n):ye.fieldErrors[e]},X=i.isLoading||o.isLoading,Z=R&&V,Q=K?n(d.SETUP$UNAVAILABLE_TITLE):J===`prerequisites`?n(d.SETUP$PREREQUISITES_TITLE):J===`review`?n(d.SETUP$REVIEW_TITLE):e.name;return(0,Y.jsx)(me,{onClose:t,"aria-label":e.name,children:(0,Y.jsxs)(`div`,{"data-testid":`setup-dialog`,className:`relative flex max-h-[85vh] w-[92vw] max-w-lg flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,Y.jsx)(be,{onClose:t,testId:`setup-dialog-close`,disabled:M}),(0,Y.jsx)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:(0,Y.jsx)(`h2`,{className:f(`pr-6`,he),children:Q})}),(0,Y.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6`,children:[X&&(0,Y.jsx)(`div`,{className:`flex justify-center py-6`,children:(0,Y.jsx)(m,{size:`small`})}),!X&&K&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(d.SETUP$UNSUPPORTED_MESSAGE)}),q.length>0&&(0,Y.jsx)(`p`,{"data-testid":`setup-unmet-requirements`,className:`text-sm text-[var(--oh-muted)]`,children:q.join(`, `)})]}),!X&&!K&&J===`prerequisites`&&(0,Y.jsx)(Je,{prerequisites:o}),!X&&!K&&J===`form`&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:e.description}),e.setup.form.note&&(0,Y.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:e.setup.form.note}),x.length>1&&I.length>1&&(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,Y.jsx)(ve,{testId:`setup-action-kind`,name:`actionKind`,label:n(d.SETUP$ACTION_LABEL),items:I.map(t=>({key:t,label:e.setup.actions?.[t]?.label??t})),selectedKey:E??void 0,isDisabled:M,required:!0,onSelectionChange:e=>{e!==null&&Ie(String(e))}}),E&&e.setup.actions?.[E]&&(0,Y.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:e.setup.actions[E]?.help})]}),b.length>1&&(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,Y.jsx)(ve,{testId:`setup-trigger-kind`,name:`triggerKind`,label:n(d.SETUP$TRIGGER_LABEL),items:b.map(e=>({key:e,label:e===`cron`?`Scheduled`:`Event`})),selectedKey:S??void 0,isDisabled:M,required:!0,onSelectionChange:e=>{e!==null&&Fe(String(e))}}),(0,Y.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:n(d.SETUP$TRIGGER_HELP)})]}),i.capabilities?.features.includes(`agentProfiles`)&&(0,Y.jsx)(we,{value:typeof D.agent_profile_id==`string`?D.agent_profile_id:null,onChange:e=>Le(`agent_profile_id`,e??``)}),Object.entries(Ce).map(([e,t])=>(0,Y.jsx)(Ke,{name:e,field:t,value:D[e]??``,error:Ge(e),options:oe(e,t,U),repository:pe[e]??null,disabled:M,isOptionsLoading:t.type===`llm-profile`&&Z,onChange:t=>Le(e,t),onRepositoryChange:t=>ge(n=>({...n,[e]:t})),onBlur:Re},e))]}),!X&&!K&&J===`review`&&(0,Y.jsx)(Ye,{setup:e.setup,values:D,selectedTrigger:S,selectedAction:E}),ye.formErrors.map(e=>(0,Y.jsx)(`p`,{role:`alert`,"data-testid":`setup-form-error`,className:`pt-4 text-sm text-red-400`,children:e},e))]}),(0,Y.jsxs)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:[J===`review`&&(0,Y.jsx)(k,{testId:`setup-back-button`,type:`button`,variant:`secondary`,isDisabled:M,onClick:()=>v(`form`),children:n(d.BUTTON$BACK)}),K?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(k,{type:`button`,variant:`secondary`,isDisabled:M,onClick:t,children:n(d.BUTTON$CLOSE)}),Ue&&(0,Y.jsx)(k,{testId:`setup-fallback-conversation`,type:`button`,variant:`primary`,isDisabled:M,onClick:He,children:n(d.SETUP$FALLBACK_CONVERSATION)})]}):(0,Y.jsx)(k,{testId:`setup-continue-button`,type:`button`,variant:`primary`,isDisabled:X||Z||M||J===`prerequisites`&&o.isBlocked,onClick:J===`review`?Ve:ze,children:n(J===`review`?d.SETUP$CONFIRM:d.BUTTON$CONTINUE)})]})]})})}function et(e,t){switch(e.code){case`required`:return t(d.SETUP$VALIDATION_REQUIRED);case`minLength`:return t(d.SETUP$VALIDATION_MIN_LENGTH,{length:e.length});case`maxLength`:return t(d.SETUP$VALIDATION_MAX_LENGTH,{length:e.length});case`min`:return`Must be at least ${e.value}.`;case`max`:return`Must be at most ${e.value}.`;case`invalidOption`:return t(d.SETUP$VALIDATION_INVALID_OPTION);case`unsafeExpressionLiteral`:return t(d.SETUP$VALIDATION_UNSAFE_VALUE);default:return e}}var tt=({params:e})=>{let t=g.findById(e.automationId??``);if(!t||!v())throw new Response(null,{status:404,statusText:`Not Found`});return{automationId:t.id}},nt=o(function(){let{automationId:e}=i(),t=r(),n=a(),o=g.findById(e);return o?(0,Y.jsx)($e,{entry:o,onClose:()=>{t.key==="default"?n(h(),{replace:!0}):n(-1)}}):null});export{tt as clientLoader,nt as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as i}from"./recommended-automations-launcher-DEHRKIAg.js";import{N as a}from"./use-tracking-j4uo9VEW.js";import{n as o,r as s,t as c}from"./manifest-subpage-layout-CVZgVKoY.js";var l=e(t(),1),u=n(),d=()=>{if(!a())throw new Response(null,{status:404,statusText:`Not Found`});return null},f=r(function(){let[e,t]=(0,l.useState)(``),n=a(),r=o();return!n||!r?null:(0,u.jsxs)(c,{heading:r.heading,navTestIdBase:`automations-navbar`,items:r.items,children:[(0,u.jsxs)(`div`,{className:`min-w-0`,children:[(0,u.jsx)(`h1`,{className:`text-xl font-semibold text-content`,children:n.title}),(0,u.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:n.description})]}),(0,u.jsx)(`div`,{className:`w-full`,children:(0,u.jsx)(s,{value:e,onChange:t})}),(0,u.jsx)(i,{query:e})]})});export{d as clientLoader,f as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as i}from"./recommended-automations-launcher-D1Do753p.js";import{N as a}from"./use-tracking-BAFpgpgq.js";import{n as o,r as s,t as c}from"./manifest-subpage-layout-DGYRoP_8.js";var l=e(t(),1),u=n(),d=()=>{if(!a())throw new Response(null,{status:404,statusText:`Not Found`});return null},f=r(function(){let[e,t]=(0,l.useState)(``),n=a(),r=o();return!n||!r?null:(0,u.jsxs)(c,{heading:r.heading,navTestIdBase:`automations-navbar`,items:r.items,children:[(0,u.jsxs)(`div`,{className:`min-w-0`,children:[(0,u.jsx)(`h1`,{className:`text-xl font-semibold text-content`,children:n.title}),(0,u.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:n.description})]}),(0,u.jsx)(`div`,{className:`w-full`,children:(0,u.jsx)(s,{value:e,onChange:t})}),(0,u.jsx)(i,{query:e})]})});export{d as clientLoader,f as default};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{i as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as o}from"./useQueries-pUohFMSP.js";import{t as s}from"./recommended-automations-launcher-D1Do753p.js";import{t as c}from"./useTranslation-CCgUjPJF.js";import{ct as l,lt as u,n as d,st as f}from"./active-backend-context-BETEdaJl.js";import{K as p,a as m,t as h}from"./utils-CbjwNcR-.js";import{t as g}from"./check-Bo8s5Ylg.js";import{t as _}from"./chevron-down-Cr6Fn_wS.js";import{g as v,r as y}from"./automation-disabled-reason-QFtMrdOr.js";import{i as b,n as ee,r as te,t as ne}from"./empty-state-B5advKVW.js";import{P as x,_ as re,c as ie,g as ae,h as oe,l as se,m as ce}from"./home-automation-run-tooltip-v5n7zXR0.js";import{t as S}from"./list-filter-B8PQk3RA.js";import{t as C}from"./plus-C2e21TFC.js";import{t as le}from"./refresh-cw-BtdC3T8P.js";import{n as w,t as T}from"./context-menu-list-item-DIm5xQg6.js";import{A as ue,D as de,G as fe,P as E,S as pe,W as me,n as D,t as he,x as O}from"./use-tracking-BAFpgpgq.js";import{t as k}from"./modal-backdrop-BSzNhM4r.js";import{n as ge}from"./modal-classes-BPcBCWVj.js";import{t as A}from"./brand-button-CGUwj6zK.js";import{n as _e}from"./navigation-context-CQZwH_tC.js";import{t as j,u as M}from"./dropdown-classes-DyyMaaXl.js";import{t as N}from"./modal-close-button-Cq3dma5u.js";import{t as P}from"./use-click-outside-element-W6Os4Nlb.js";import{t as F}from"./enum-filter-dropdown-VAJp5mqh.js";import{t as ve}from"./use-automation-health-CbQ9n-k7.js";import{t as I}from"./automation-C_eCrGyP.js";import{a as ye,c as L,i as be,o as xe,r as Se,t as Ce}from"./use-automations-7_XBXHQK.js";import{a as R}from"./extension-module-card-classes-DpeaYhYo.js";import{n as we}from"./api-error-message-BXo0lCI5.js";import{t as Te}from"./edit-automation-modal-bfD-5NIc.js";import{t as Ee}from"./use-automation-permissions-gFy-2VD0.js";import{n as De,t as Oe}from"./error-state-BgYl7YeB.js";import{n as ke,r as Ae,t as je}from"./manifest-subpage-layout-DGYRoP_8.js";import{i as Me,n as Ne,r as Pe,t as Fe}from"./automation-export-CkvehhPF.js";var z=a(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),Ie=a(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),Le=a(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),B=e(t(),1),V=e(n(),1),H=r();function U({icon:e,label:t,isSelected:n}){return(0,H.jsxs)(`span`,{className:`flex min-w-0 w-full items-center gap-2`,children:[(0,H.jsx)(`span`,{className:M,"aria-hidden":!0,children:(0,H.jsx)(e,{})}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,H.jsx)(g,{className:`size-4 shrink-0`,"aria-hidden":!0}):null]})}var W=[{value:`grid`,icon:Ie,labelKey:p.AUTOMATIONS$VIEW_GRID,testId:`automations-view-toggle-grid`},{value:`list`,icon:Le,labelKey:p.AUTOMATIONS$VIEW_LIST,testId:`automations-view-toggle-list`}];function Re({view:e,onChange:t,disabled:n=!1}){let{t:r}=c(`openhands`),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(),l=(0,B.useRef)(null),u=(0,B.useRef)(null),d=(W.find(t=>t.value===e)??W[0]).icon;(0,B.useLayoutEffect)(()=>{if(!i||!l.current)return;let e=()=>{let e=l.current?.getBoundingClientRect();e&&s({position:`fixed`,zIndex:9999,top:e.bottom+4,right:window.innerWidth-e.right})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[i]),(0,B.useEffect)(()=>{if(!i)return;let e=e=>{let t=e.target;l.current?.contains(t)||u.current?.contains(t)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]);let f=i&&o?(0,H.jsx)(w,{ref:u,theme:`popover`,className:`min-w-[10rem]`,children:W.map(n=>(0,H.jsx)(`li`,{children:(0,H.jsx)(T,{testId:n.testId,onClick:()=>{t(n.value),a(!1)},className:`group`,children:(0,H.jsx)(U,{icon:n.icon,label:r(n.labelKey),isSelected:e===n.value})})},n.value))}):null;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{ref:l,type:`button`,"data-testid":`automations-view-toggle`,"aria-label":r(p.AUTOMATIONS$VIEW_MODE),"aria-haspopup":`menu`,"aria-expanded":i,"aria-disabled":n,disabled:n,onClick:()=>{n||a(e=>!e)},className:h(`inline-flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-[var(--oh-border)] bg-base-secondary text-white transition-colors hover:bg-[var(--oh-interactive-hover)] focus-visible:border-white/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/20`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-base-secondary`),children:(0,H.jsx)(d,{className:`size-4`,"aria-hidden":!0})}),i&&o&&typeof document<`u`?V.createPortal((0,H.jsx)(`div`,{style:o,children:f}),document.body):null]})}function ze({onAdd:e,onImport:t,isAddDisabled:n=!1}){let{t:r}=c(`openhands`),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(),l=(0,B.useRef)(null),u=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(!i||!l.current)return;let e=()=>{let e=l.current?.getBoundingClientRect();e&&s({position:`fixed`,zIndex:9999,top:e.bottom+2,right:window.innerWidth-e.right})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[i]),(0,B.useEffect)(()=>{if(!i)return;let e=e=>{let t=e.target;l.current?.contains(t)||u.current?.contains(t)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]);let d=e=>{e(),a(!1)},f=i&&o?(0,H.jsxs)(w,{ref:u,testId:`automations-add-automation-menu`,theme:`popover`,position:`none`,alignment:`none`,spacing:`none`,className:`min-w-[10rem]`,children:[(0,H.jsx)(`li`,{children:(0,H.jsx)(T,{testId:`automations-add-automation-create`,isDisabled:n,className:`group`,onClick:()=>{n||d(e)},children:(0,H.jsx)(y,{icon:(0,H.jsx)(C,{className:`size-4`,"aria-hidden":!0}),label:r(p.AUTOMATIONS$CREATE_AUTOMATION_BUTTON)})})}),(0,H.jsx)(`li`,{children:(0,H.jsx)(T,{testId:`automations-import-automation`,className:`group`,onClick:()=>d(t),children:(0,H.jsx)(y,{icon:(0,H.jsx)(z,{className:`size-4`,"aria-hidden":!0}),label:r(p.AUTOMATIONS$IMPORT)})})})]}):null;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(A,{ref:l,type:`button`,variant:`secondary`,testId:`automations-add-automation`,className:`whitespace-nowrap`,"aria-haspopup":`menu`,"aria-expanded":i,onClick:()=>a(e=>!e),children:[r(p.AUTOMATIONS$ADD_AUTOMATION),(0,H.jsx)(_,{className:`size-4 shrink-0`,"aria-hidden":!0})]}),i&&o&&typeof document<`u`?V.createPortal((0,H.jsx)(`div`,{style:o,children:f}),document.body):null]})}function G({label:e,value:t}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`dt`,{className:`text-xs font-medium uppercase tracking-wide text-muted`,children:e}),(0,H.jsx)(`dd`,{className:`whitespace-pre-wrap break-words text-sm text-content`,children:t})]})}function K(e){let t=e.dataTransfer?.files;return t&&t.length>0?t[0]:null}function Be({onFile:e}){let{t}=c(`openhands`),n=(0,B.useRef)(null),[r,i]=(0,B.useState)(!1),a=()=>n.current?.click();return(0,H.jsxs)(`div`,{className:`flex flex-col gap-5 px-6 pb-6`,children:[(0,H.jsxs)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:[t(p.AUTOMATIONS$IMPORT_EXPLAIN),` `,(0,H.jsx)(`a`,{href:O,target:`_blank`,rel:`noopener noreferrer`,"data-testid":`import-automation-format-docs`,className:`text-white no-underline transition-colors hover:text-white`,children:t(p.AUTOMATIONS$IMPORT_FORMAT_DOCS)})]}),(0,H.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:t(p.AUTOMATIONS$IMPORT_DISABLED_NOTICE)}),(0,H.jsx)(`input`,{ref:n,type:`file`,accept:`application/json,.json`,className:`hidden`,"data-testid":`automations-import-file`,onChange:()=>{let t=n.current,r=t?.files?.[0];t&&(t.value=``),r&&e(r)}}),(0,H.jsxs)(`div`,{"data-testid":`import-automation-dropzone`,"data-active":r?`true`:`false`,onClick:a,onDragEnter:e=>{e.preventDefault(),i(!0)},onDragOver:e=>{e.preventDefault(),i(!0)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||i(!1)},onDrop:t=>{t.preventDefault(),i(!1);let n=K(t);n&&e(n)},className:h(`flex cursor-pointer flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-10 text-center`,r?`border-[var(--oh-focus)] bg-[var(--oh-interactive-hover)]`:`border-[var(--oh-border)] bg-[var(--oh-surface)]`),children:[(0,H.jsx)(z,{className:`size-8 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,H.jsx)(`p`,{className:`text-sm font-medium text-content`,children:t(p.AUTOMATIONS$IMPORT_DROPZONE)}),(0,H.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:t(p.AUTOMATIONS$IMPORT_OR)}),(0,H.jsx)(A,{testId:`import-automation-choose-file`,type:`button`,variant:`secondary`,onClick:e=>{e?.stopPropagation(),a()},children:t(p.AUTOMATIONS$IMPORT_CHOOSE_FILE)})]})]})}function Ve({isOpen:e,spec:t,isImporting:n,onClose:r,onImport:i,onFile:a}){let{t:o}=c(`openhands`);if(!e)return null;let s=t?t.trigger.type===`event`?[t.trigger.source,v(t.trigger.on)].filter(Boolean).join(`: `):[t.trigger.schedule_human??t.trigger.schedule,t.timezone??t.trigger.timezone].filter(Boolean).join(` · `):``;return(0,H.jsx)(k,{onClose:n?void 0:r,closeOnEscape:!n,closeOnBackdropClick:!n,"aria-label":o(p.AUTOMATIONS$IMPORT),children:(0,H.jsxs)(`div`,{"data-testid":`import-automation-modal`,"data-view":t?`preview`:`picker`,className:`relative flex max-h-[85vh] w-[min(36rem,calc(100vw-2rem))] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,H.jsx)(N,{onClose:r,testId:`import-automation-modal-close`,disabled:n}),(0,H.jsxs)(`header`,{className:`px-6 pb-4 pt-6`,children:[(0,H.jsx)(`h2`,{className:h(`pr-6`,ge),children:o(p.AUTOMATIONS$IMPORT)}),t?(0,H.jsx)(`p`,{className:`mt-2 text-sm text-tertiary-light`,children:o(p.AUTOMATIONS$IMPORT_PREVIEW_DESCRIPTION)}):null]}),t?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`dl`,{className:`mx-6 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] px-4 py-4`,children:[(0,H.jsx)(G,{label:o(p.AUTOMATIONS$NAME),value:t.name}),(0,H.jsx)(G,{label:o(p.AUTOMATIONS$DETAIL$TRIGGER),value:s}),(0,H.jsx)(G,{label:o(p.AUTOMATIONS$PROMPT),value:t.prompt??``}),t.plugins&&t.plugins.length>0?(0,H.jsx)(G,{label:o(p.AUTOMATIONS$DETAIL$PLUGINS),value:t.plugins.join(`, `)}):null]}),(0,H.jsxs)(`footer`,{className:`px-6 py-5`,children:[(0,H.jsx)(`p`,{className:`mb-4 text-sm text-tertiary-light`,children:o(p.AUTOMATIONS$IMPORT_DISABLED_NOTICE)}),(0,H.jsxs)(`div`,{className:`flex justify-end gap-3`,children:[(0,H.jsx)(A,{testId:`import-automation-cancel`,type:`button`,variant:`secondary`,onClick:r,isDisabled:n,children:o(p.AUTOMATIONS$CANCEL)}),(0,H.jsx)(A,{testId:`import-automation-confirm`,type:`button`,variant:`primary`,onClick:i,isDisabled:n,"aria-busy":n,children:o(n?p.AUTOMATIONS$IMPORTING:p.AUTOMATIONS$IMPORT)})]})]})]}):(0,H.jsx)(Be,{onFile:a})]})})}var q=20,He=15e3,Ue=e=>e.status===I.PENDING||e.status===I.RUNNING;function We(e,t={}){let{enabled:n=!0}=t,r=d();return o({queries:e.map(e=>({queryKey:[...L,e.id,{limit:q,offset:0},r.backend.id,r.orgId],queryFn:({signal:t})=>x.run(()=>D.getAutomationRuns(e.id,q,0),t),staleTime:60*1e3,retry:!1,refetchOnWindowFocus:!1,meta:{disableToast:!0},enabled:n&&!!e.id,refetchInterval:e=>{let t=e.state.data?.runs?.[0];return t&&Ue(t)?He:!1}})),combine:t=>{let n=new Map;return e.forEach((e,r)=>{let i=t[r];n.set(e.id,{summary:i.data?re(i.data):null,isLoading:i.isLoading,isError:i.isError})}),n}})}function J({label:e,children:t}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:e}),t]})}function Y(e){return Object.fromEntries(e.map(e=>[e.value,e.label]))}function Ge({spec:e,status:t,trigger:n,sort:r,onStatusChange:i,onTriggerChange:a,onSortChange:o}){let{t:s}=c(`openhands`),[l,u]=(0,B.useState)(!1),d=P(()=>u(!1)),f=e.filters.find(e=>e.id===`status`),m=e.filters.find(e=>e.id===`trigger`),g=[f&&t!==f.options[0]?.value,m&&n!==m.options[0]?.value,r!==e.sort.default].filter(Boolean).length,v=s(p.AUTOMATIONS$FILTERS),y=f?.options[0]?.value,b=m?.options[0]?.value;return(0,H.jsxs)(`div`,{ref:d,className:`relative shrink-0 w-auto`,"data-testid":`automations-filters`,children:[(0,H.jsxs)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,"aria-haspopup":`true`,"aria-expanded":l,"aria-label":v,onClick:()=>u(e=>!e),className:h(j,`h-9 py-0`,g>0&&`border-white/60 bg-white/10`),children:[(0,H.jsx)(S,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`whitespace-nowrap`,children:v}),g>0?(0,H.jsx)(`span`,{className:`rounded-full bg-white px-1.5 text-[11px] font-medium text-black`,children:g}):null,(0,H.jsx)(_,{className:h(`h-4 w-4 shrink-0 text-tertiary-alt transition-transform`,l&&`rotate-180`),"aria-hidden":!0})]}),l?(0,H.jsxs)(`div`,{role:`group`,"data-testid":`automations-filters-menu`,"aria-label":v,className:`absolute right-0 top-full z-50 mt-1 flex min-w-[16rem] w-max flex-col gap-3 overflow-visible rounded-[6px] bg-tertiary p-3 context-menu-box-shadow`,children:[f?(0,H.jsx)(J,{label:f.label,children:(0,H.jsx)(F,{testId:`automations-filter-status`,value:t,onChange:i,options:f.options.map(e=>e.value),labelByValue:Y(f.options),ariaLabel:f.label,fullWidth:!0})}):null,m?(0,H.jsx)(J,{label:m.label,children:(0,H.jsx)(F,{testId:`automations-filter-trigger`,value:n,onChange:a,options:m.options.map(e=>e.value),labelByValue:Y(m.options),ariaLabel:m.label,fullWidth:!0})}):null,(0,H.jsx)(J,{label:e.sort.label,children:(0,H.jsx)(F,{testId:`automations-sort`,value:r,onChange:o,options:e.sort.options.map(e=>e.value),labelByValue:Y(e.sort.options),ariaLabel:e.sort.label,fullWidth:!0})}),g>0?(0,H.jsx)(`button`,{type:`button`,"data-testid":`automations-filters-reset`,onClick:()=>{y&&i(y),b&&a(b),o(e.sort.default)},className:`self-start text-sm text-muted hover:text-foreground`,children:s(p.AUTOMATIONS$RESET_ALL)}):null]}):null]})}function Ke({onClear:e}){let{t}=c(`openhands`);return(0,H.jsxs)(`div`,{"data-testid":`automations-filtered-empty`,className:`rounded-xl border border-dashed border-[var(--oh-border)] p-8 text-center`,children:[(0,H.jsx)(`p`,{className:`text-sm text-muted`,children:t(p.AUTOMATIONS$NO_FILTER_MATCHES)}),(0,H.jsx)(`button`,{type:`button`,"data-testid":`automations-clear-filters`,onClick:e,className:`mt-2 text-sm text-white underline-offset-2 hover:underline`,children:t(p.AUTOMATIONS$CLEAR_FILTERS)})]})}function qe({label:e,tiles:t}){return(0,H.jsx)(`section`,{"aria-label":e,className:`grid grid-cols-2 gap-3 xl:grid-cols-4`,children:t.map(e=>(0,H.jsxs)(`div`,{"data-testid":`overview-tile-${e.key}`,className:h(R,`p-4`),children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-xs text-muted`,children:e.label}),(0,H.jsx)(e.Icon,{className:`size-4 shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0})]}),(0,H.jsx)(`div`,{className:`mt-2 text-xl font-semibold text-content`,children:e.value}),(0,H.jsx)(`div`,{className:`mt-1 truncate text-xs text-muted`,children:e.detail})]},e.key))})}var Je=50,X=()=>{if(!E())throw new Response(null,{status:404,statusText:`Not Found`});return null},Z=i(function(){let{t:e}=c(`openhands`),t=ue(),n=(0,B.useMemo)(()=>de(),[]),r=ke(),i=n&&r?{spec:n,nav:r}:null,[a,o]=(0,B.useState)(``),[g,_]=(0,B.useState)(`all`),[v,y]=(0,B.useState)(`all`),[x,re]=(0,B.useState)(n?.sort.default??`last-run`),[S,C]=(0,B.useState)(()=>ie()),[w,T]=(0,B.useState)(Je),[E,D]=(0,B.useState)(null),[O,k]=(0,B.useState)(null),[ge,j]=(0,B.useState)(!1),[M,N]=(0,B.useState)(null),[P,F]=(0,B.useState)(!1),I=d(),{navigate:L}=_e(),R=I.backend.kind===`local`,{canManage:z}=Ee(),{data:Ie,isLoading:Le,refetch:V}=ve(),U=Ie?.status===`ok`,{data:W,isLoading:G,isError:K,refetch:Be}=Ce({limit:w,offset:0,enabled:U}),q=We(W?.automations??[],{enabled:U&&i!==null}),{trackPrebuiltAutomationEnabled:He,trackAutomationExported:Ue}=he(),J=xe(),Y=Se(),X=be(),Z=ye(),Q=(0,B.useMemo)(()=>W?.automations?n?ce(W.automations,{search:a,status:g,trigger:v,sort:x},q):W.automations.filter(e=>ae(e,a)):[],[W?.automations,n,a,g,v,x,q]),$=(0,B.useMemo)(()=>Q.filter(e=>e.enabled),[Q]),Ye=(0,B.useMemo)(()=>Q.filter(e=>!e.enabled),[Q]),Xe=(e,t)=>{let n=!t;if(J.mutate({id:e,enabled:n}),n){let t=W?.automations.find(t=>t.id===e);He({automationId:e,automationName:t?.name??e})}},Ze=t=>{X.mutate(t,{onSuccess:()=>{l(e(p.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{f(we(t,e(p.AUTOMATIONS$RUN_NOW_ERROR)))}})},Qe=e=>{let t=W?.automations.find(t=>t.id===e);t&&D({id:e,name:t.name})},$e=e=>{let t=W?.automations.find(t=>t.id===e);t&&k(t)},et=e=>{let t=`${JSON.stringify(Pe(e),null,2)}\n`;m(new Blob([t],{type:`application/json`}),Fe(e)),Ue({backendKind:I.backend.kind})},tt=async t=>{try{let n;try{n=JSON.parse(await t.text())}catch{f(e(p.AUTOMATIONS$IMPORT_INVALID_JSON));return}N(Ne(n))}catch(t){f(t instanceof Error?t.message:e(p.ERROR$GENERIC))}},nt=()=>{M&&Z.mutate({...M,enabled:!1},{onSuccess:t=>{F(!1),N(null),u(e(p.AUTOMATIONS$IMPORT_SUCCESS,{name:t.name}),e(p.AUTOMATIONS$IMPORT_VIEW),pe(t.id))},onError:t=>{f(we(t,e(p.ERROR$GENERIC)))}})},rt=()=>{E&&(Y.mutate(E.id),D(null))},it=(0,B.useCallback)(e=>{C(e),se(e)},[]),at=()=>{o(``),_(`all`),y(`all`)},ot=(0,B.useMemo)(()=>{if(!n)return[];let e=W?.automations??[];return n.overview.tiles.map(t=>{let n=oe(t.metric,e,q),r=n.isZero&&t.zeroDetail?t.zeroDetail:t.detail;return{key:t.metric,label:t.label,value:n.display,detail:me(r,n.placeholderValues),Icon:fe[t.icon]}})},[n,W?.automations,q]),st=i?{spec:i.spec.insights,byId:q}:void 0,ct=e=>i?(0,H.jsx)(je,{heading:i.nav.heading,navTestIdBase:`automations-navbar`,items:i.nav.items,children:e}):(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:e})}),lt=W?W.total>W.automations.length:!1,ut=!G&&!K&&W?.automations.length===0;return ct(Le?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:t.listTitle}),(0,H.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:t.listSubtitle}),(0,H.jsx)(`div`,{className:`mt-6 flex flex-col gap-3`,children:Array.from({length:3}).map((e,t)=>(0,H.jsx)(b,{},`skeleton-${String(t)}`))})]}):U?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h1`,{className:`text-xl font-semibold text-content`,children:t.listTitle}),(0,H.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:t.listSubtitle})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-2`,children:[R&&(0,H.jsx)(A,{type:`button`,variant:`secondary`,testId:`automations-git-sync`,className:`whitespace-nowrap`,onClick:()=>L?.(`/automations/git-sync`),startContent:(0,H.jsx)(le,{className:`size-4`,"aria-hidden":!0}),children:e(p.AUTOMATIONS$GIT_SYNC$NAV_BUTTON)}),z?(0,H.jsx)(ze,{onAdd:()=>j(!0),onImport:()=>F(!0)}):null]})]}),i&&(0,H.jsx)(qe,{label:i.spec.overview.label,tiles:ot}),(0,H.jsxs)(`div`,{className:h(`flex items-stretch gap-2`,i?`flex-wrap`:`mt-6`),children:[(0,H.jsx)(Ae,{value:a,onChange:o}),i&&(0,H.jsx)(Ge,{spec:i.spec,status:g,trigger:v,sort:x,onStatusChange:_,onTriggerChange:y,onSortChange:re}),(0,H.jsx)(Re,{view:S,onChange:it,disabled:ut})]}),(0,H.jsxs)(`div`,{className:h(`flex flex-col gap-6`,!i&&`mt-6`),children:[G&&(0,H.jsx)(`div`,{className:`flex flex-col gap-3`,children:Array.from({length:3}).map((e,t)=>(0,H.jsx)(b,{},`skeleton-${String(t)}`))}),K&&!G&&(0,H.jsx)(Oe,{onRetry:Be}),ut&&(0,H.jsx)(ne,{}),!G&&!K&&W&&W.automations.length>0&&(i&&Q.length===0?(0,H.jsx)(Ke,{onClear:at}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(te,{title:e(p.AUTOMATIONS$ACTIVE),count:$.length,automations:$,view:S,onToggle:Xe,onRunNow:Ze,runPendingId:X.isPending?X.variables??null:null,onDelete:Qe,onExport:et,onEdit:$e,insights:st}),(0,H.jsx)(te,{title:e(p.AUTOMATIONS$INACTIVE),count:Ye.length,automations:Ye,view:S,onToggle:Xe,onRunNow:Ze,runPendingId:X.isPending?X.variables??null:null,onDelete:Qe,onExport:et,onEdit:$e,insights:st}),lt&&(0,H.jsx)(`button`,{type:`button`,onClick:()=>T(e=>e+Je),className:`self-center rounded-lg border border-[var(--oh-border)] px-6 py-2 text-sm text-white hover:bg-surface-raised`,children:e(p.AUTOMATIONS$LOAD_MORE)})]}))]}),!i&&(0,H.jsx)(`div`,{className:`mt-6`,children:(0,H.jsx)(s,{query:a})}),(0,H.jsx)(Me,{automationName:E?.name??``,isOpen:E!==null,onConfirm:rt,onCancel:()=>D(null)}),O&&(0,H.jsx)(Te,{automation:O,isOpen:O!==null,onClose:()=>k(null)}),(0,H.jsx)(ee,{isOpen:ge,onClose:()=>j(!1)}),(0,H.jsx)(Ve,{isOpen:P,spec:M,isImporting:Z.isPending,onClose:()=>{F(!1),N(null)},onImport:nt,onFile:tt})]}):(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:t.listTitle}),(0,H.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:t.listSubtitle}),(0,H.jsx)(De,{onRetry:V})]}))});export{X as clientLoader,Z as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{i as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as r}from"./utils-BgLSZdyy.js";import{r as i}from"./form-control-classes-Dbq-7YP_.js";import{t as a}from"./navigation-link-Bxo3-4vo.js";var o=n(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);e();var s=t();function c({children:e}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o,{size:20,"aria-hidden":!0}),e]})}function l(e){let{children:t,testId:n,className:o}=e,l=r(i,o);return`to`in e?(0,s.jsx)(a,{to:e.to,onClick:e.onClick,"data-testid":n,className:l,children:(0,s.jsx)(c,{children:t})}):(0,s.jsx)(`button`,{type:`button`,onClick:e.onClick,"data-testid":n,className:l,children:(0,s.jsx)(c,{children:t})})}export{l as t};
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{i as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as r}from"./utils-CbjwNcR-.js";import{r as i}from"./form-control-classes-BVI_szaj.js";import{t as a}from"./navigation-link-Bxo3-4vo.js";var o=n(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);e();var s=t();function c({children:e}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o,{size:20,"aria-hidden":!0}),e]})}function l(e){let{children:t,testId:n,className:o}=e,l=r(i,o);return`to`in e?(0,s.jsx)(a,{to:e.to,onClick:e.onClick,"data-testid":n,className:l,children:(0,s.jsx)(c,{children:t})}):(0,s.jsx)(`button`,{type:`button`,onClick:e.onClick,"data-testid":n,className:l,children:(0,s.jsx)(c,{children:t})})}export{l as t};
@@ -0,0 +1 @@
1
+ import{a as e,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as a}from"./useQuery-DAAacS7O.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{J as s,r as c,tt as l,w as u}from"./active-backend-context-BETEdaJl.js";import{K as d,t as f}from"./utils-CbjwNcR-.js";import{A as p,D as m,O as h,n as g}from"./agent-server-client-options-EHB23gyx.js";import{t as _}from"./chevron-down-Cr6Fn_wS.js";import{a as v,i as y,n as b,r as x}from"./cloud-funnel-analytics-BH_zxjiO.js";import{t as S}from"./info-BcajzHn1.js";import{u as C}from"./agent-server-config-C_x8Otd9.js";import{S as w,a as T,i as E,n as D,r as O}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{a as k,i as A,n as j,o as ee,r as M}from"./use-onboarding-completion-C4W-m2Jk.js";import{t as N}from"./use-tracking-BAFpgpgq.js";import{t as P}from"./modal-backdrop-BSzNhM4r.js";import{n as F,r as te,t as ne}from"./modal-body-B_95ci1c.js";import{n as re,r as ie}from"./modal-classes-BPcBCWVj.js";import{t as I}from"./brand-button-CGUwj6zK.js";import{n as ae}from"./navigation-context-CQZwH_tC.js";import{t as oe}from"./modal-close-button-Cq3dma5u.js";import{t as L}from"./settings-input-B3i5U9GL.js";var se=i(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),R=e(n()),z=r(),B=e=>(0,z.jsxs)(`svg`,{width:1365,height:1365,viewBox:`0 -24 148 148`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,z.jsx)(`path`,{d:`M71.7542 16.863V2.97414C71.7542 1.82355 72.6872 0.890503 73.8378 0.890503C74.9884 0.890503 75.9214 1.82355 75.9214 2.97414V16.863C75.9214 18.0136 74.9884 18.9466 73.8378 18.9466C72.6872 18.9466 71.7542 18.0136 71.7542 16.863Z`,fill:`white`}),(0,z.jsx)(`path`,{d:`M82.5272 18.9329L89.4716 6.90477C90.0469 5.90832 91.3215 5.5668 92.3179 6.1421C93.3144 6.7174 93.6559 7.99197 93.0806 8.98841L86.1362 21.0165C85.5609 22.0129 84.2863 22.3545 83.2899 21.7792C82.2934 21.2039 81.9519 19.9293 82.5272 18.9329Z`,fill:`white`}),(0,z.jsx)(`path`,{d:`M65.1481 18.9329L58.2037 6.90477C57.6284 5.90832 56.3538 5.5668 55.3574 6.1421C54.3609 6.7174 54.0194 7.99197 54.5947 8.98841L61.5391 21.0165C62.1144 22.0129 63.389 22.3545 64.3854 21.7792C65.3819 21.2039 65.7234 19.9293 65.1481 18.9329Z`,fill:`white`}),(0,z.jsx)(`path`,{d:`M140.606 62.0292C140.606 58.409 141.583 47.6748 141.89 44.1323C142.097 41.7374 141.809 40.4247 141.424 39.7542C141.141 39.2626 140.699 38.915 139.634 38.8436C138.865 38.7921 138.027 39.0114 137.401 39.5761C136.814 40.1052 136.159 41.1682 136.159 43.3176L136.155 43.4388L135.198 59.758C135.164 60.3451 134.883 60.8911 134.424 61.2599C133.966 61.6284 133.374 61.7859 132.793 61.6941L122.764 60.1068L111.948 58.6703C110.949 58.5376 110.188 57.7084 110.142 56.7016L109.561 44.1323C109.535 43.621 109.51 43.1141 109.484 42.6146C109.241 37.9294 109.022 33.7805 109.022 32.4282C109.022 28.3859 108.338 26.6806 107.74 25.9634C107.263 25.3915 106.577 25.1402 105.11 25.1402C104.583 25.1402 104.212 25.2481 103.933 25.4111C103.659 25.5714 103.346 25.8587 103.049 26.4208C102.41 27.6257 101.945 29.891 102.118 33.8479C102.342 38.9804 102.692 42.8146 103.035 46.2718C103.377 49.7231 103.718 52.8561 103.908 56.4971C104.204 62.1966 104.178 66.1256 103.945 68.7924C103.828 70.124 103.656 71.1996 103.423 72.0501C103.202 72.8558 102.871 73.6757 102.296 74.2887C101.6 75.0303 100.608 75.3844 99.577 75.136C98.7592 74.9389 98.1847 74.4215 97.8706 74.0916C97.2141 73.4017 96.7501 72.5106 96.568 72.0512C95.5097 69.3812 92.2352 63.1808 87.8023 59.6811C86.5089 58.6599 85.5666 58.3652 84.9736 58.3204C84.4148 58.2783 84.0094 58.4436 83.6909 58.6967C83.34 58.9756 83.0781 59.3811 82.9479 59.7643C82.9019 59.8999 82.8823 59.9968 82.8741 60.0584C84.0759 62.0865 88.8421 69.5222 91.0896 77.069C92.7648 82.6941 96.8038 88.4259 99.8194 90.8809C102.74 93.258 107.988 94.7313 113.9 95.0218C119.756 95.3095 125.788 94.4121 130.033 92.5092C138.233 88.8334 139.903 80.7382 140.651 77.2292C141.232 74.5057 141.243 71.5987 141.087 68.9009C141.01 67.5551 140.894 66.2969 140.793 65.1373C140.695 64.0105 140.606 62.9215 140.606 62.0292ZM120.986 27.0953C120.986 25.8314 120.648 24.7049 120.089 23.9514C119.583 23.27 118.84 22.7987 117.646 22.7984C116.668 22.7982 116.011 22.9187 115.546 23.1167C115.13 23.2943 114.781 23.5699 114.463 24.0831C113.73 25.2671 113.192 27.6455 113.189 32.384L113.721 43.9088C113.91 47.5661 114.106 51.4922 114.235 54.7707L120.986 55.6666V27.0953ZM125.153 56.2652L131.172 57.218L131.992 43.267V32.5083C131.992 31.031 131.39 30.1275 130.678 29.5489C129.884 28.9039 128.957 28.6731 128.519 28.6731C127.722 28.6731 126.899 28.797 126.306 29.2179C125.849 29.5421 125.153 30.3087 125.153 32.5083V56.2652ZM136.159 35.4278C137.406 34.8069 138.74 34.6083 139.912 34.6868C142.037 34.8292 143.91 35.718 145.037 37.6779C146.06 39.4592 146.273 41.8136 146.041 44.4927C145.72 48.1949 144.772 58.6457 144.772 62.0292C144.772 62.708 144.843 63.6116 144.944 64.7758C145.042 65.907 145.165 67.2389 145.247 68.6606C145.411 71.4987 145.422 74.8383 144.727 78.0987C144.002 81.4953 142.041 91.6918 131.738 96.3108C126.731 98.5551 120.002 99.4936 113.696 99.1838C107.445 98.8767 101.128 97.3189 97.1887 94.1122C93.4809 91.0937 88.9938 84.6307 87.0962 78.2589C84.9529 71.0619 80.3109 63.9646 79.1527 61.9533C78.4706 60.7689 78.684 59.3628 79.0019 58.4258C79.3607 57.3688 80.0554 56.2631 81.0993 55.4337C82.1758 54.5784 83.6043 54.0377 85.2876 54.1647C86.9369 54.2893 88.6462 55.0393 90.3834 56.4107C94.8541 59.9401 98.1342 65.5082 99.7424 68.9231C99.759 68.7664 99.779 68.6024 99.7941 68.4298C100.003 66.0435 100.039 62.3344 99.7467 56.7132C99.5635 53.1942 99.2356 50.1809 98.8888 46.6828C98.5425 43.1904 98.184 39.2713 97.955 34.0302C97.7722 29.8481 98.2012 26.6722 99.3672 24.471C99.9716 23.3302 100.79 22.4223 101.83 21.814C102.866 21.2087 103.995 20.974 105.11 20.974C106.759 20.974 108.813 21.2062 110.448 22.7678C110.593 22.4576 110.75 22.1652 110.921 21.8899C111.676 20.6698 112.681 19.8084 113.912 19.2835C115.095 18.7791 116.378 18.6309 117.646 18.6311C120.195 18.6315 122.164 19.7567 123.434 21.4683C124.256 22.576 124.75 23.8775 124.985 25.1982C126.338 24.5876 127.691 24.5068 128.519 24.5068C129.933 24.5068 131.784 25.0791 133.305 26.3154C134.908 27.6179 136.159 29.6733 136.159 32.5083V35.4278Z`,fill:`white`}),(0,z.jsx)(`path`,{d:`M7.15661 62.0292C7.15661 58.409 6.17994 47.6748 5.87291 44.1323C5.6654 41.7374 5.95357 40.4247 6.33875 39.7542C6.62116 39.2626 7.06336 38.915 8.12834 38.8436C8.89759 38.7921 9.73544 39.0114 10.3616 39.5761C10.9484 40.1052 11.6032 41.1682 11.6032 43.3176L11.6074 43.4388L12.5644 59.758C12.5988 60.3451 12.8798 60.8911 13.338 61.2599C13.7961 61.6284 14.3887 61.7859 14.9695 61.6941L24.9988 60.1068L35.8143 58.6703C36.8135 58.5376 37.5741 57.7084 37.6208 56.7016L38.2015 44.1323C38.2279 43.621 38.2525 43.1141 38.2784 42.6146C38.5218 37.9294 38.7401 33.7805 38.7401 32.4282C38.7401 28.3859 39.4246 26.6806 40.0227 25.9634C40.4996 25.3915 41.185 25.1402 42.6523 25.1402C43.1794 25.1402 43.5505 25.2481 43.8295 25.4111C44.1038 25.5714 44.416 25.8587 44.7138 26.4208C45.3521 27.6257 45.8173 29.891 45.6444 33.8479C45.4201 38.9804 45.0703 42.8146 44.7275 46.2718C44.3853 49.7231 44.0443 52.8561 43.8548 56.4971C43.5582 62.1966 43.5847 66.1256 43.8179 68.7924C43.9344 70.124 44.1069 71.1996 44.3396 72.0501C44.5601 72.8558 44.891 73.6757 45.4663 74.2887C46.1625 75.0303 47.1546 75.3844 48.1855 75.136C49.0033 74.9389 49.5778 74.4215 49.8918 74.0916C50.5484 73.4017 51.0123 72.5106 51.1945 72.0512C52.2527 69.3812 55.5272 63.1808 59.9601 59.6811C61.2536 58.6599 62.1958 58.3652 62.7889 58.3204C63.3476 58.2783 63.753 58.4436 64.0715 58.6967C64.4225 58.9756 64.6844 59.3811 64.8146 59.7643C64.8606 59.8999 64.8801 59.9968 64.8883 60.0584C63.6866 62.0865 58.9204 69.5222 56.6729 77.069C54.9977 82.6941 50.9586 88.4259 47.9431 90.8809C45.0229 93.258 39.7747 94.7313 33.8624 95.0218C28.0068 95.3095 21.9748 94.4121 17.7297 92.5092C9.52988 88.8334 7.85961 80.7382 7.11129 77.2292C6.53054 74.5057 6.5195 71.5987 6.67496 68.9009C6.75251 67.5551 6.86809 66.2969 6.96901 65.1373C7.06707 64.0105 7.1566 62.9215 7.15661 62.0292ZM26.7768 27.0953C26.7768 25.8314 27.1147 24.7049 27.6737 23.9514C28.1792 23.27 28.9221 22.7987 30.1167 22.7984C31.0942 22.7982 31.7518 22.9187 32.2162 23.1167C32.6326 23.2943 32.9817 23.5699 33.2996 24.0831C34.0328 25.2671 34.5705 27.6455 34.5738 32.384L34.0416 43.9088C33.8524 47.5661 33.6565 51.4922 33.5273 54.7707L26.7768 55.6666V27.0953ZM22.6095 56.2652L16.5904 57.218L15.7705 43.267V32.5083C15.7705 31.031 16.3726 30.1275 17.0847 29.5489C17.8785 28.9039 18.8058 28.6731 19.2432 28.6731C20.0404 28.6731 20.8634 28.797 21.4565 29.2179C21.9131 29.5421 22.6095 30.3087 22.6095 32.5083V56.2652ZM11.6032 35.4278C10.3568 34.8069 9.02265 34.6083 7.8501 34.6868C5.72541 34.8292 3.85197 35.718 2.72584 37.6779C1.70247 39.4592 1.48924 41.8136 1.72143 44.4927C2.0423 48.1949 2.99038 58.6457 2.99038 62.0292C2.99037 62.708 2.91991 63.6116 2.81859 64.7758C2.72014 65.907 2.59699 67.2389 2.51505 68.6606C2.3515 71.4987 2.34041 74.8383 3.0357 78.0987C3.76005 81.4953 5.72154 91.6918 16.0245 96.3108C21.0311 98.5551 27.7601 99.4936 34.0669 99.1838C40.3172 98.8767 46.6346 97.3189 50.5737 94.1122C54.2816 91.0937 58.7686 84.6307 60.6662 78.2589C62.8095 71.0619 67.4515 63.9646 68.6098 61.9533C69.2919 60.7689 69.0785 59.3628 68.7605 58.4258C68.4018 57.3688 67.707 56.2631 66.6632 55.4337C65.5867 54.5784 64.1582 54.0377 62.4748 54.1647C60.8256 54.2893 59.1162 55.0393 57.379 56.4107C52.9083 59.9401 49.6283 65.5082 48.02 68.9231C48.0034 68.7664 47.9835 68.6024 47.9684 68.4298C47.7597 66.0435 47.7232 62.3344 48.0158 56.7132C48.1989 53.1942 48.5269 50.1809 48.8737 46.6828C49.22 43.1904 49.5784 39.2713 49.8075 34.0302C49.9903 29.8481 49.5612 26.6722 48.3952 24.471C47.7909 23.3302 46.9729 22.4223 45.9321 21.814C44.8964 21.2087 43.7676 20.974 42.6523 20.974C41.0038 20.974 38.9497 21.2062 37.3141 22.7678C37.1698 22.4576 37.0124 22.1652 36.8419 21.8899C36.0863 20.6698 35.0817 19.8084 33.8508 19.2835C32.6679 18.7791 31.3849 18.6309 30.1167 18.6311C27.5677 18.6315 25.5986 19.7567 24.3285 21.4683C23.5066 22.576 23.0121 23.8775 22.7771 25.1982C21.4247 24.5876 20.0718 24.5068 19.2432 24.5068C17.8298 24.5068 15.9788 25.0791 14.4573 26.3154C12.8542 27.6179 11.6032 29.6733 11.6032 32.5083V35.4278Z`,fill:`white`})]});function ce(e){return T(e,{headers:u})}function le(e,t,n){return E(e,t,{...n,headers:u})}var V=e=>(0,z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M15.3235 10.9352L11.5016 14.2111L7.67969 10.9352L8.6152 9.84375L11.5016 12.3178L14.388 9.84375L15.3235 10.9352Z`,fill:`currentColor`})}),H=e=>(0,z.jsxs)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,z.jsx)(`path`,{d:`M13 3H8.33337V4H11.2929L7.31315 7.97978L8.02026 8.68689L12 4.70711V7.66667H13V3Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M4.33333 3.66667C3.59695 3.66667 3 4.26362 3 5V11.6667C3 12.403 3.59695 13 4.33333 13H11C11.7364 13 12.3333 12.403 12.3333 11.6667V9.66667H11.3333V11.6667C11.3333 11.8508 11.1841 12 11 12H4.33333C4.14924 12 4 11.8508 4 11.6667V5C4 4.81591 4.14924 4.66667 4.33333 4.66667H6.33333V3.66667H4.33333Z`,fill:`currentColor`})]}),ue=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,z.jsx)(`path`,{d:`M8.25 9.75C8.10166 9.75 7.95666 9.79399 7.83332 9.8764C7.70999 9.95881 7.61386 10.0759 7.55709 10.213C7.50032 10.35 7.48547 10.5008 7.51441 10.6463C7.54335 10.7918 7.61478 10.9254 7.71967 11.0303C7.82456 11.1352 7.9582 11.2066 8.10368 11.2356C8.24917 11.2645 8.39997 11.2497 8.53701 11.1929C8.67406 11.1361 8.79119 11.04 8.8736 10.9167C8.95601 10.7933 9 10.6483 9 10.5C9 10.3011 8.92098 10.1103 8.78033 9.96967C8.63968 9.82902 8.44891 9.75 8.25 9.75ZM5.25 9.75C5.10166 9.75 4.95666 9.79399 4.83332 9.8764C4.70999 9.95881 4.61386 10.0759 4.55709 10.213C4.50032 10.35 4.48547 10.5008 4.51441 10.6463C4.54335 10.7918 4.61478 10.9254 4.71967 11.0303C4.82456 11.1352 4.9582 11.2066 5.10368 11.2356C5.24917 11.2645 5.39997 11.2497 5.53701 11.1929C5.67406 11.1361 5.79119 11.04 5.8736 10.9167C5.95601 10.7933 6 10.6483 6 10.5C6 10.3011 5.92098 10.1103 5.78033 9.96967C5.63968 9.82902 5.44891 9.75 5.25 9.75ZM16.5 3C16.5 2.40326 16.2629 1.83097 15.841 1.40901C15.419 0.987053 14.8467 0.75 14.25 0.75H3.75C3.15326 0.75 2.58097 0.987053 2.15901 1.40901C1.73705 1.83097 1.5 2.40326 1.5 3V6C1.50331 6.55504 1.71166 7.08927 2.085 7.5C1.71166 7.91073 1.50331 8.44496 1.5 9V12C1.5 12.5967 1.73705 13.169 2.15901 13.591C2.58097 14.0129 3.15326 14.25 3.75 14.25H8.25V15.75H2.25C2.05109 15.75 1.86032 15.829 1.71967 15.9697C1.57902 16.1103 1.5 16.3011 1.5 16.5C1.5 16.6989 1.57902 16.8897 1.71967 17.0303C1.86032 17.171 2.05109 17.25 2.25 17.25H15.75C15.9489 17.25 16.1397 17.171 16.2803 17.0303C16.421 16.8897 16.5 16.6989 16.5 16.5C16.5 16.3011 16.421 16.1103 16.2803 15.9697C16.1397 15.829 15.9489 15.75 15.75 15.75H9.75V14.25H14.25C14.8467 14.25 15.419 14.0129 15.841 13.591C16.2629 13.169 16.5 12.5967 16.5 12V9C16.4967 8.44496 16.2883 7.91073 15.915 7.5C16.2883 7.08927 16.4967 6.55504 16.5 6V3ZM15 12C15 12.1989 14.921 12.3897 14.7803 12.5303C14.6397 12.671 14.4489 12.75 14.25 12.75H3.75C3.55109 12.75 3.36032 12.671 3.21967 12.5303C3.07902 12.3897 3 12.1989 3 12V9C3 8.80109 3.07902 8.61032 3.21967 8.46967C3.36032 8.32902 3.55109 8.25 3.75 8.25H14.25C14.4489 8.25 14.6397 8.32902 14.7803 8.46967C14.921 8.61032 15 8.80109 15 9V12ZM15 6C15 6.19891 14.921 6.38968 14.7803 6.53033C14.6397 6.67098 14.4489 6.75 14.25 6.75H3.75C3.55109 6.75 3.36032 6.67098 3.21967 6.53033C3.07902 6.38968 3 6.19891 3 6V3C3 2.80109 3.07902 2.61032 3.21967 2.46967C3.36032 2.32902 3.55109 2.25 3.75 2.25H14.25C14.4489 2.25 14.6397 2.32902 14.7803 2.46967C14.921 2.61032 15 2.80109 15 3V6ZM8.25 3.75C8.10166 3.75 7.95666 3.79399 7.83332 3.8764C7.70999 3.95881 7.61386 4.07594 7.55709 4.21299C7.50032 4.35003 7.48547 4.50083 7.51441 4.64632C7.54335 4.7918 7.61478 4.92544 7.71967 5.03033C7.82456 5.13522 7.9582 5.20665 8.10368 5.23559C8.24917 5.26453 8.39997 5.24968 8.53701 5.19291C8.67406 5.13614 8.79119 5.04001 8.8736 4.91668C8.95601 4.79334 9 4.64834 9 4.5C9 4.30109 8.92098 4.11032 8.78033 3.96967C8.63968 3.82902 8.44891 3.75 8.25 3.75ZM5.25 3.75C5.10166 3.75 4.95666 3.79399 4.83332 3.8764C4.70999 3.95881 4.61386 4.07594 4.55709 4.21299C4.50032 4.35003 4.48547 4.50083 4.51441 4.64632C4.54335 4.7918 4.61478 4.92544 4.71967 5.03033C4.82456 5.13522 4.9582 5.20665 5.10368 5.23559C5.24917 5.26453 5.39997 5.24968 5.53701 5.19291C5.67406 5.13614 5.79119 5.04001 5.8736 4.91668C5.95601 4.79334 6 4.64834 6 4.5C6 4.30109 5.92098 4.11032 5.78033 3.96967C5.63968 3.82902 5.44891 3.75 5.25 3.75Z`,fill:`currentColor`})});function U(e,t,n){let r=n?.lastError??null,i=t?.kind===`cloud`;return i&&!t?.apiKey?.trim()||k(r)?e(d.BACKEND$STATUS_DISCONNECTED_ADD_API_KEY):A(r)?e(d.BACKEND$STATUS_DISCONNECTED_CHECK_API_KEY):M(r)?e(d.BACKEND$LOGGED_OUT):n?.isConnected===!0?e(d.ONBOARDING$BACKEND_STATUS_CONNECTED):i&&n?.isConnected===!1&&(j(r)||p(r))?e(d.BACKEND$STATUS_DISCONNECTED_CHECK_CLOUD_ACCESS):n?.isConnected===!1&&h(r)?e(d.BACKEND$STATUS_DISCONNECTED_CHECK_TUNNEL):n?.isConnected===!1&&p(r)?e(d.BACKEND$STATUS_DISCONNECTED_CHECK_URL_OR_NETWORK):n?.isConnected===!1?e(d.ONBOARDING$BACKEND_STATUS_DISCONNECTED):e(d.ONBOARDING$BACKEND_STATUS_CHECKING)}function W({isConnected:e,className:t}){let n,r,i;return e===`unavailable`?(n=`bg-[var(--oh-text-tertiary)]`,r=`No Backend Available`,i=`unavailable`):e===!0?(n=`bg-[var(--oh-status-success)]`,r=`Connected`,i=`connected`):e===!1?(n=`bg-red-500`,r=`Disconnected`,i=`disconnected`):(n=`bg-[var(--oh-interactive-selected)]`,r=`Checking connection`,i=`checking`),(0,z.jsx)(`span`,{"data-testid":`backend-status-dot`,"data-status":i,"aria-label":r,title:r,role:`status`,className:f(`inline-block w-2 h-2 rounded-full shrink-0`,n,t)})}var G={status:`idle`,verificationUrl:null,userCode:null,apiKey:null,error:null,errorCode:null};function de(){let[e,t]=R.useState(G),n=R.useRef(null),r=R.useCallback((e,r)=>{n.current?.abort();let i=new AbortController;n.current=i,t({...G,status:`starting`}),(async()=>{let n;try{n=await ce(e)}catch(e){if(i.signal.aborted)return;let n=e instanceof Error?e.message:`Failed to start device flow`,r=e instanceof D?e.code:void 0;t({...G,status:`error`,error:n,errorCode:r??null});return}if(!i.signal.aborted){b(e,r),t({...G,status:`awaiting_authorization`,verificationUrl:n.verification_uri_complete,userCode:n.user_code});try{let a=await le(e,n.device_code,{interval:n.interval,signal:i.signal});if(i.signal.aborted)return;x(e,r),t({...G,status:`success`,apiKey:a.access_token})}catch(e){if(i.signal.aborted)return;if(e instanceof D&&e.code===`cancelled`){t(G);return}let n=e instanceof Error?e.message:`Authorization failed`,r=e instanceof D?e.code:void 0;t({...G,status:`error`,error:n,errorCode:r??null})}}})()},[]),i=R.useCallback(()=>{n.current?.abort(),n.current=null,t(G)},[]),a=R.useCallback(()=>{n.current?.abort(),n.current=null,t(G)},[]);return R.useEffect(()=>()=>{n.current?.abort()},[]),{...e,start:r,cancel:i,reset:a}}function K(e){try{return new URL(e).protocol===`https:`}catch{return!1}}function q({host:e,onSuccess:t,testIdRoot:n,isDisabled:r=!1,idleButtonLabel:i,idleButtonContent:a,idleDescription:s,idleFooter:c,className:l,buttonClassName:u,buttonVariant:p=`primary`,statusDisplay:m=`inline`,analyticsSource:h}){let{t:g}=o(`openhands`),_=de(),v=R.useRef(null);R.useEffect(()=>()=>{v.current?.close()},[]),R.useEffect(()=>{if(_.status===`awaiting_authorization`&&_.verificationUrl&&v.current&&!v.current.closed){if(!K(_.verificationUrl)){console.error(`Invalid verification URL protocol`);return}try{v.current.location.href=_.verificationUrl}catch{v.current=window.open(_.verificationUrl,`_blank`,`noopener,noreferrer`)}}},[_.status,_.verificationUrl]),R.useEffect(()=>{if(_.status===`success`&&_.apiKey)try{t(_.apiKey)}finally{_.reset(),v.current?.close()}},[_.status,_.apiKey,_.reset,t]);let y=()=>{let t=e.trim().replace(/\/+$/,``),n=/^https?:\/\//i.test(t)?t:`https://${t}`;try{let e=new URL(n);if(e.username||e.password)throw Error(`Invalid URL format`)}catch{return}v.current=window.open(`about:blank`,`_blank`),v.current||console.warn(`Popup blocked - user will need to use manual link`),_.start(n,h)},b=()=>{_.cancel(),v.current?.close()},x=(0,z.jsx)(fe,{status:_.status,error:_.error,verificationUrl:_.verificationUrl,testIdRoot:n,onCancel:b,onRetry:y}),S=m===`modal`&&_.status!==`idle`,C=i??g(d.BACKEND$LOGIN_WITH_OPENHANDS);return(0,z.jsxs)(`div`,{"data-testid":`${n}-device-flow`,className:f(`flex flex-col gap-3`,l),children:[_.status===`idle`?s:null,_.status===`idle`&&p===`unstyled`&&(0,z.jsx)(`button`,{type:`button`,onClick:y,"data-testid":`${n}-login-button`,className:u,disabled:r,"aria-label":a?C:void 0,children:a??C}),_.status===`idle`&&p!==`unstyled`&&(0,z.jsx)(I,{type:`button`,variant:p,onClick:y,testId:`${n}-login-button`,className:u,isDisabled:r,ariaLabel:a?C:void 0,children:a??C}),_.status===`idle`?c:null,m===`inline`?x:null,S?(0,z.jsx)(P,{onClose:b,"aria-label":g(d.BACKEND$LOGIN_WITH_OPENHANDS),closeOnBackdropClick:!1,children:(0,z.jsx)(F,{testID:`${n}-auth-modal`,width:`sm`,className:`items-stretch border border-[var(--oh-border)]`,children:x})}):null]})}function fe({status:e,error:t,verificationUrl:n,testIdRoot:r,onCancel:i,onRetry:a}){let{t:s}=o(`openhands`);if(e===`idle`||e===`success`)return null;if(e===`starting`)return(0,z.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,"data-testid":`${r}-auth-starting`,role:`status`,"aria-live":`polite`,children:[(0,z.jsx)(pe,{}),(0,z.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:s(d.BACKEND$AUTH_STARTING)})]});if(e===`awaiting_authorization`){let e=n&&K(n)?n:null;return(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`${r}-auth-awaiting`,role:`status`,"aria-live":`polite`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[(0,z.jsx)(pe,{}),(0,z.jsx)(`span`,{className:`text-sm font-medium text-white`,children:s(d.BACKEND$AUTH_AWAITING)})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,z.jsx)(`p`,{className:`text-center text-sm leading-5 text-[var(--oh-text-tertiary)]`,children:e?`${s(d.BACKEND$AUTH_BROWSER_OPENED)} ${s(d.BACKEND$AUTH_OPEN_MANUALLY)}`:s(d.BACKEND$AUTH_BROWSER_OPENED)}),e?(0,z.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`max-h-16 overflow-auto break-all text-center text-xs text-blue-400 hover:underline`,children:e}):null]}),(0,z.jsx)(I,{type:`button`,variant:`secondary`,onClick:i,testId:`${r}-auth-cancel`,className:`w-full`,children:s(d.BACKEND$AUTH_CANCEL)})]})}return(0,z.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg border border-red-700 bg-red-900/20 p-4`,"data-testid":`${r}-auth-error`,role:`alert`,children:[(0,z.jsx)(`p`,{className:`text-sm text-red-400`,children:t}),(0,z.jsx)(I,{type:`button`,variant:`secondary`,onClick:a,testId:`${r}-auth-retry`,className:`w-full`,children:s(d.BACKEND$AUTH_RETRY)})]})}function pe(){return(0,z.jsx)(`svg`,{className:`animate-spin h-4 w-4 text-white`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})})}var me=t({BackendConnectionOptions:()=>De,BackendForm:()=>Q,BackendFormModal:()=>Pe});function he(e){return O(e)?`cloud`:`local`}function ge(e){let t=e.toLowerCase().replace(/^\[|\]$/g,``);return!!(t===`localhost`||t===`::1`||t===`::`||t===`0.0.0.0`||/^127\./.test(t)||/^::ffff:127\./i.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2\d|3[01])\./.test(t)||/^fe[89ab][0-9a-f]:/i.test(t)||/^f[cd][0-9a-f]{2}:/i.test(t)||t.endsWith(`.local`)||!t.includes(`.`)&&!t.includes(`:`))}function J(e){let t=e.trim().replace(/\/+$/,``);if(!t)return``;if(/^https?:\/\//i.test(t))return t;let n=t.match(/^\[([^\]]+)\]/);return`${ge(n?n[1]:(t.match(/:/g)??[]).length>1?t:t.split(`:`)[0])?`http`:`https`}://${t}`}function Y(e){let t=e.trim();if(!t||/\s/.test(t))return!1;let n=J(t);if(!n)return!1;try{let e=new URL(n);return(e.protocol===`http:`||e.protocol===`https:`)&&e.hostname.length>0}catch{return!1}}var X=`https://app.all-hands.dev`,_e=`agent-canvas --backend-only --port 8001`,ve=`https://github.com/OpenHands/OpenHands/blob/main/docs/DEVELOPMENT.md#alternative-development-workflows`,ye=`https://github.com/OpenHands/OpenHands/blob/main/docs/SELF_HOSTING.md`,be=`https://docs.openhands.dev/overview/introduction`;function xe(e,t){return e(d.BACKEND$CONNECTION_TEST_FAILED,{host:t,interpolation:{escapeValue:!1}})}function Se(e){return m(e)}function Ce(e,t){let n=Se(t);return n?`${e}\n${n}`:e}async function we(e){return e.kind===`local`?{agentServerVersion:await l(e,5e3)}:{agentServerVersion:null}}function Te({backend:e,testIdRoot:t}){let{t:n}=o(`openhands`),r=ee([e])[e.id],i=r?.isConnected??null,c=r?.disabled===!0,l=r?.consecutiveFailures??0,u=r?.lastError??null,{data:f}=a({queryKey:[`backend-version`,e.host,e.apiKey],queryFn:async()=>s(await new w(g({host:e.host,sessionApiKey:e.apiKey||null,timeout:5e3})).getServerInfo()),retry:!1,staleTime:6e4,enabled:e.kind===`local`&&!c}),p=U(n,e,r),m=e.kind===`cloud`?n(d.BACKEND$KIND_CLOUD):n(d.BACKEND$KIND_LOCAL);return(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,z.jsxs)(`div`,{"data-testid":`${t}-status`,className:`flex items-center gap-3 text-sm`,children:[(0,z.jsx)(W,{isConnected:i}),(0,z.jsx)(`span`,{className:`text-white`,"data-testid":`${t}-status-label`,children:p}),(0,z.jsx)(`span`,{className:`text-tertiary-alt`,children:`·`}),(0,z.jsx)(`span`,{className:`text-[var(--oh-text-tertiary)]`,children:m}),f?(0,z.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,"data-testid":`${t}-version`,children:n(d.BACKEND$VERSION_LABEL,{version:f})}):null]}),c?(0,z.jsxs)(`div`,{"data-testid":`${t}-status-error`,className:`flex flex-col gap-1 rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm`,children:[(0,z.jsx)(`span`,{className:`font-semibold text-red-300`,children:n(d.BACKEND$HEALTH_FAILED_TITLE)}),(0,z.jsx)(`span`,{className:`text-xs text-[var(--oh-text-tertiary)]`,children:n(d.BACKEND$HEALTH_FAILED_DETAIL,{count:l})}),u?(0,z.jsx)(`span`,{"data-testid":`${t}-status-error-message`,className:`text-xs text-red-300 whitespace-pre-wrap break-words`,children:u}):null]}):null]})}function Z({initialName:e=``,initialHost:t=``,initialApiKey:n=``,onTestConnection:r,onSuccess:i,requireApiKey:a=!1,onSubmitOverride:s,fixedKind:c}){let{t:l}=o(`openhands`),[u,d]=R.useState(e),[f,p]=R.useState(t),[m,h]=R.useState(n),[g,_]=R.useState(null),[v,y]=R.useState(!1),[b,x]=R.useState(null),S=c??b??he(f),C=a||S!==`local`,w=u.trim().length>0&&Y(f)&&(!C||m.trim().length>0);return{name:u,setName:d,host:f,setHost:p,apiKey:m,setApiKey:h,connectionError:g,setConnectionError:_,isSubmitting:v,kind:S,setKind:x,canSubmit:w,handleSubmit:R.useCallback(async e=>{if(e.preventDefault(),!w||v)return;let t={name:u.trim(),host:J(f),apiKey:m.trim(),kind:S};_(null),y(!0);try{s?await s(t):i(await r(t))}catch(e){_(Ce(xe(l,t.host),e))}finally{y(!1)}},[w,v,u,f,m,S,r,i,a,s,c,l])}}function Q({mode:e,backend:t,onSubmitted:n,renderActions:r,testIdRoot:i,hostReadOnly:a,requireApiKey:s,hideConfigurationFields:l=!1,onSubmitOverride:u}){let{t:p}=o(`openhands`),{addBackend:m,updateBackend:h}=c(),g=e===`edit`&&t?t.kind:null,{name:_,setName:v,host:y,setHost:b,apiKey:x,setApiKey:S,connectionError:C,setConnectionError:w,isSubmitting:T,kind:E,handleSubmit:D}=Z({initialName:t?.name??``,initialHost:t?.host??``,initialApiKey:t?.apiKey??``,onTestConnection:we,onSuccess:async()=>{let r={name:_.trim(),host:J(y),apiKey:x.trim(),kind:g??E};e===`edit`&&t?h(t.id,r):m(r),n()},requireApiKey:s,onSubmitOverride:u}),[O,k]=R.useState(!1),[A,j]=R.useState(!1),ee=g??E,M=i??(e===`edit`?`edit-backend`:`add-backend`),N=s||ee!==`local`,P=_.trim().length>0&&Y(y)&&(!N||x.trim().length>0),F=O&&!_.trim()?p(d.BACKEND$NAME_REQUIRED):void 0,te=A?y.trim()?Y(y)?void 0:p(d.BACKEND$HOST_INVALID):p(d.BACKEND$HOST_REQUIRED):void 0;return(0,z.jsxs)(`form`,{"data-testid":`${M}-form`,onSubmit:async e=>{if(!P){k(!0),j(!0);return}await D(e)},className:`flex flex-col gap-4`,children:[(0,z.jsxs)(`div`,{"data-testid":`${M}-configuration-fields`,className:f(`flex flex-col gap-4`,l&&`hidden`),children:[(0,z.jsx)(L,{testId:`${M}-name`,name:`${M}-name`,type:`text`,label:p(d.BACKEND$NAME_LABEL),value:_,onChange:e=>{v(e),w(null)},onBlur:()=>k(!0),placeholder:`Production`,className:`w-full`,showRequiredTag:!0,error:F}),(0,z.jsx)(L,{testId:`${M}-host`,name:`${M}-host`,type:`text`,label:p(d.BACKEND$HOST_LABEL),value:y,onChange:a?void 0:e=>{b(e),w(null)},onBlur:()=>j(!0),placeholder:X,className:`w-full`,showRequiredTag:!0,error:te,isDisabled:a}),(0,z.jsx)(L,{testId:`${M}-api-key`,name:`${M}-api-key`,type:`password`,label:p(d.BACKEND$KEY_LABEL),value:x,onChange:e=>{S(e),w(null)},placeholder:``,className:`w-full`}),C?(0,z.jsx)(`div`,{role:`alert`,"data-testid":`${M}-error`,className:`rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm text-red-300 whitespace-pre-wrap break-words`,children:C}):null,e===`edit`&&t&&(0,z.jsx)(Te,{backend:t,testIdRoot:M})]}),r?r({canSubmit:P&&!T,isSubmitting:T,testIdRoot:M}):(0,z.jsxs)(`div`,{className:`flex justify-end gap-2 mt-2 w-full`,children:[(0,z.jsx)(I,{type:`button`,variant:`secondary`,onClick:n,testId:`${M}-cancel`,children:p(d.BUTTON$CANCEL)}),(0,z.jsx)(I,{type:`submit`,variant:`primary`,isDisabled:!P||T,testId:`${M}-submit`,children:p(d.BACKEND$SAVE)})]})]})}function Ee(){let{currentPath:e,navigate:t}=ae();return R.useCallback(()=>{/^\/automations\/[^/]+/.test(e)?t(`/automations`):/^\/conversations\/[^/]+/.test(e)&&t(`/conversations`)},[e,t])}function De({onConnected:e,testIdRoot:t=`add-backend`,initialManualBackend:n,requireManualApiKey:r=!1,manualSubmitLabel:i,manualSubmittingLabel:a,manualSubmitTestId:s,analyticsSource:c}){let{t:l}=o(`openhands`),u=C();return u?(0,z.jsx)(`div`,{"data-testid":`${t}-connection-options`,className:`flex justify-center`,children:(0,z.jsx)(`div`,{className:`w-full`,children:(0,z.jsx)($,{onConnected:e,testIdRoot:t,lockedHost:u,analyticsSource:c})})}):(0,z.jsxs)(`div`,{"data-testid":`${t}-connection-options`,className:`flex flex-col gap-6 md:flex-row`,children:[(0,z.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,z.jsx)(Oe,{onConnected:e,testIdRoot:t,initialBackend:n,requireApiKey:r,submitLabel:i??l(d.BACKEND$CONNECT),submittingLabel:a??l(d.ONBOARDING$BACKEND_STATUS_CHECKING),submitTestId:s})}),(0,z.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,z.jsx)($,{onConnected:e,testIdRoot:t,analyticsSource:c})})]})}function Oe({onConnected:e,testIdRoot:t,initialBackend:n,requireApiKey:r,submitLabel:i,submittingLabel:a,submitTestId:s,fixedKind:c,showKindSelector:l=!0}){let{t:u}=o(`openhands`),{name:f,setName:p,host:m,setHost:h,apiKey:g,setApiKey:_,connectionError:v,setConnectionError:b,isSubmitting:x,kind:S,setKind:C,canSubmit:w,handleSubmit:T}=Z({initialName:n?.name??``,initialHost:n?.host??``,initialApiKey:n?.apiKey??``,onTestConnection:we,onSuccess:t=>{e({name:f.trim(),host:J(m),apiKey:g.trim(),kind:S},`manual`,t)},requireApiKey:r,fixedKind:c});return(0,z.jsxs)(`form`,{"data-testid":`${t}-form`,onSubmit:T,className:`flex flex-col gap-4 flex-1 min-w-0`,children:[(0,z.jsx)(L,{testId:`${t}-name`,name:`${t}-name`,type:`text`,label:u(d.BACKEND$NAME_LABEL),hint:u(d.BACKEND$NAME_HELPER),value:f,onChange:e=>{p(e),b(null)},placeholder:`e.g. My Server`,className:`w-full`}),(0,z.jsx)(L,{testId:`${t}-host`,name:`${t}-host`,type:`text`,label:u(d.BACKEND$HOST_LABEL),hint:u(d.BACKEND$HOST_HELPER),value:m,onChange:e=>{h(e),b(null)},placeholder:`http://localhost:8000`,className:`w-full`}),l?(0,z.jsxs)(`div`,{className:`flex flex-col items-start gap-2.5`,children:[(0,z.jsx)(`span`,{className:`text-sm`,children:u(d.BACKEND$KIND_LABEL)}),(0,z.jsx)(y,{value:S,options:[{value:`local`,label:u(d.BACKEND$KIND_LOCAL)},{value:`cloud`,label:u(d.BACKEND$KIND_CLOUD)}],onChange:e=>C(e),ariaLabel:u(d.BACKEND$KIND_LABEL),testId:`${t}-kind`})]}):null,(0,z.jsx)(L,{testId:`${t}-api-key`,name:`${t}-api-key`,type:`password`,label:u(d.BACKEND$KEY_LABEL),value:g,onChange:e=>{_(e),b(null)},placeholder:`sk-••••••••••`,className:`w-full`}),v?(0,z.jsx)(`div`,{role:`alert`,"data-testid":`${t}-error`,className:`rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm text-red-300 whitespace-pre-wrap break-words`,children:v}):null,(0,z.jsx)(I,{type:`submit`,variant:`secondary`,isDisabled:!w||x,testId:s??`${t}-submit`,className:`w-full text-center`,children:x?a:i})]})}function $({onConnected:e,testIdRoot:t,lockedHost:n,analyticsSource:r,showBranding:i=!0}){let{t:a}=o(`openhands`),[s,c]=R.useState(!1),[l,u]=R.useState(``),p=`${t}-advanced-panel`,m=n??(l.trim()||X);return(0,z.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-center gap-3`,children:[i?(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,z.jsx)(B,{width:56,height:56,"aria-hidden":!0}),(0,z.jsx)(`h4`,{className:ie,"data-testid":`${t}-cloud-title`,children:a(d.BACKEND$CLOUD_TITLE)})]}):null,(0,z.jsx)(q,{host:m,onSuccess:t=>{e({name:`OpenHands Cloud`,host:J(m),apiKey:t,kind:`cloud`},`cloud_login`)},testIdRoot:t,analyticsSource:r,className:`w-full items-center`,idleDescription:(0,z.jsx)(`p`,{className:`text-center text-sm leading-relaxed text-[var(--oh-muted)]`,"data-testid":`${t}-cloud-description`,children:a(d.BACKEND$CLOUD_DESCRIPTION)}),idleFooter:n?null:(0,z.jsxs)(`div`,{className:`mx-auto w-full max-w-md`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>c(e=>!e),"aria-expanded":s,"aria-controls":p,"data-testid":`${t}-advanced-toggle`,className:`flex w-full cursor-pointer items-center justify-center gap-1 text-center text-xs text-[var(--oh-muted)] transition-colors hover:text-content-2`,children:[(0,z.jsx)(`span`,{children:a(d.BACKEND$ADVANCED)}),(0,z.jsx)(V,{className:f(`h-4 w-4 shrink-0 text-muted transition-transform duration-200 ease-out`,s&&`rotate-180`),"aria-hidden":!0})]}),(0,z.jsx)(`div`,{className:f(`grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`,s?`grid-rows-[1fr]`:`grid-rows-[0fr]`),children:(0,z.jsx)(`div`,{className:`overflow-hidden`,children:(0,z.jsxs)(`div`,{id:p,"data-testid":`${t}-advanced-panel`,"aria-hidden":!s,inert:s?void 0:!0,className:f(`pt-3 transition-opacity duration-200 ease-out motion-reduce:transition-none`,s?`opacity-100`:`opacity-0`),children:[(0,z.jsx)(L,{testId:`${t}-cloud-host`,name:`${t}-cloud-host`,type:`text`,label:a(d.BACKEND$HOST_LABEL),value:l,onChange:u,placeholder:X,className:`w-full`}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-[var(--oh-muted)]`,children:a(d.BACKEND$LOGIN_CLOUD_HINT)})]})})})]})})]})}function ke({value:e,selectedValue:t,title:n,description:r,icon:i,onSelect:a,panelId:o,testId:s}){let c=e===t;return(0,z.jsxs)(`button`,{id:`${s}-tab`,type:`button`,role:`tab`,"aria-selected":c,"aria-controls":o,"data-testid":s,onClick:()=>a(e),className:f(`relative flex min-h-16 w-full cursor-pointer items-center gap-3 px-3 py-3 text-left transition-colors`,`first:border-r first:border-r-[var(--oh-border)]`,`focus-visible:z-10 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-blue-300`,c?`bg-[var(--oh-surface-raised)] text-white after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-primary`:`text-[var(--oh-muted)] hover:bg-[var(--oh-surface-raised)] hover:text-white`),children:[(0,z.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center`,"aria-hidden":!0,children:i}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:n}),(0,z.jsx)(`span`,{className:`mt-0.5 block text-xs leading-tight text-[var(--oh-muted)]`,children:r})]})]})}function Ae({children:e}){let t=R.useRef(null),[n,r]=R.useState();return R.useLayoutEffect(()=>{let e=t.current;if(!e)return;let n=()=>{let t=e.getBoundingClientRect().height;r(t>0?t:void 0)};if(n(),typeof ResizeObserver>`u`)return;let i=new ResizeObserver(n);return i.observe(e),()=>i.disconnect()},[]),(0,z.jsx)(`div`,{"data-testid":`add-backend-panel-height`,style:n===void 0?void 0:{height:n},className:`overflow-hidden transition-[height] duration-300 ease-in-out motion-reduce:transition-none`,children:(0,z.jsx)(`div`,{ref:t,children:e})})}function je({location:e}){let{t}=o(`openhands`),[n,r]=R.useState(!1),i=e===`remote`,a=t(i?d.BACKEND$REMOTE_SETUP_TITLE:d.BACKEND$BEFORE_CONNECT_TITLE),s=t(i?d.BACKEND$REMOTE_SETUP_DESCRIPTION:d.BACKEND$LOCAL_SETUP_DESCRIPTION),c=i?ye:ve,l=t(i?d.BACKEND$REMOTE_SETUP_DOCS:d.BACKEND$LOCAL_SETUP_DOCS),u=i?`add-backend-remote`:`add-backend-local`,p=`${u}-guidance-toggle`,m=`${u}-guidance-body`;return(0,z.jsxs)(`aside`,{"data-testid":`${u}-guidance`,className:`rounded-lg bg-[var(--oh-surface-raised)] text-sm text-[var(--oh-muted)]`,children:[(0,z.jsx)(`h4`,{className:`text-white`,children:(0,z.jsxs)(`button`,{id:p,type:`button`,onClick:()=>r(e=>!e),"aria-expanded":n,"aria-controls":m,"data-testid":p,className:f(`flex w-full cursor-pointer items-center justify-between gap-2 rounded-lg px-3 py-2 text-left font-medium`,`transition-colors hover:bg-[var(--oh-interactive-hover)]`,`focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-300`),children:[(0,z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,z.jsx)(S,{className:`size-4 shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate`,children:a})]}),(0,z.jsx)(_,{className:f(`size-5 shrink-0 text-[var(--oh-muted)] transition-transform duration-200 ease-out`,n&&`rotate-180`),"aria-hidden":!0})]})}),(0,z.jsx)(`div`,{className:f(`grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`,n?`grid-rows-[1fr]`:`grid-rows-[0fr]`),children:(0,z.jsx)(`div`,{className:`overflow-hidden`,children:(0,z.jsxs)(`div`,{id:m,"data-testid":m,role:`region`,"aria-labelledby":p,"aria-hidden":!n,inert:n?void 0:!0,className:f(`flex flex-col gap-2 px-3 pb-3 transition-opacity duration-200 ease-out motion-reduce:transition-none`,n?`opacity-100`:`opacity-0`),children:[(0,z.jsx)(`p`,{className:`leading-5`,children:s}),i?(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h5`,{className:`font-medium text-white`,children:t(d.BACKEND$REMOTE_CONNECTION_TITLE)}),(0,z.jsx)(`p`,{className:`mt-1 leading-5`,children:t(d.BACKEND$REMOTE_CONNECTION_DESCRIPTION)})]}):(0,z.jsx)(`code`,{className:`block break-words font-mono text-xs text-white`,children:_e}),(0,z.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,"data-testid":`${u}-docs-link`,tabIndex:n?void 0:-1,className:`inline-flex w-fit items-center gap-1.5 text-primary hover:underline`,children:[(0,z.jsx)(`span`,{children:l}),(0,z.jsx)(H,{className:`size-4 shrink-0`,"aria-hidden":!0})]})]})})})]})}function Me({onConnected:e,source:t}){let{t:n}=o(`openhands`),[r,i]=R.useState(`cloud`),[a,s]=R.useState(`local`),c=`add-backend-selected-panel`,l=`add-backend-option-${r}-tab`,u=r===`cloud`;return(0,z.jsxs)(`div`,{"data-testid":`add-backend-chooser`,className:`flex flex-col`,children:[(0,z.jsxs)(`div`,{role:`tablist`,"aria-label":n(d.BACKEND$CHOOSER_TITLE),className:`grid grid-cols-2 overflow-hidden rounded-lg border border-[var(--oh-border)]`,children:[(0,z.jsx)(ke,{value:`cloud`,selectedValue:r,title:n(d.BACKEND$CLOUD_TITLE),description:n(d.BACKEND$CLOUD_OPTION_DESCRIPTION),icon:(0,z.jsx)(B,{width:32,height:32,"data-testid":`add-backend-option-cloud-logo`}),onSelect:i,panelId:c,testId:`add-backend-option-cloud`}),(0,z.jsx)(ke,{value:`agent-server`,selectedValue:r,title:n(d.BACKEND$AGENT_SERVER_TITLE),description:n(d.BACKEND$AGENT_SERVER_OPTION_DESCRIPTION),icon:(0,z.jsx)(ue,{className:`size-6`}),onSelect:i,panelId:c,testId:`add-backend-option-agent-server`})]}),(0,z.jsx)(`div`,{className:`mt-6`,children:(0,z.jsx)(Ae,{children:(0,z.jsx)(`section`,{id:c,role:`tabpanel`,"aria-labelledby":l,className:`min-w-0`,children:u?(0,z.jsx)(`div`,{"data-testid":`add-backend-cloud-panel`,className:f(`relative isolate flex min-h-[13.5rem] w-full items-center justify-center rounded-xl border border-[var(--oh-border)] px-5 py-6`,`before:pointer-events-none before:absolute before:inset-0 before:-z-10 before:rounded-xl`,`before:bg-[radial-gradient(75%_75%_at_50%_50%,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0)_70%)]`),children:(0,z.jsx)($,{onConnected:e,testIdRoot:`add-backend`,analyticsSource:t,showBranding:!1})}):(0,z.jsxs)(`div`,{"data-testid":`add-backend-agent-server-panel`,className:`mx-auto w-full max-w-xl`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(`span`,{className:`h-px flex-1 bg-[var(--oh-border)]`,"aria-hidden":!0}),(0,z.jsx)(y,{value:a,options:[{value:`local`,label:n(d.BACKEND$KIND_LOCAL),icon:(0,z.jsx)(se,{"aria-hidden":!0})},{value:`remote`,label:n(d.BACKEND$KIND_REMOTE),icon:(0,z.jsx)(v,{"aria-hidden":!0})}],onChange:s,ariaLabel:n(d.BACKEND$AGENT_SERVER_LOCATION),testId:`add-backend-location`}),(0,z.jsx)(`span`,{className:`h-px flex-1 bg-[var(--oh-border)]`,"aria-hidden":!0})]}),(0,z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-4`,children:[(0,z.jsx)(je,{location:a},a),(0,z.jsx)(Oe,{onConnected:e,testIdRoot:`add-backend`,requireApiKey:a===`remote`,submitLabel:n(d.BACKEND$CONNECT),submittingLabel:n(d.ONBOARDING$BACKEND_STATUS_CHECKING),fixedKind:`local`,showKindSelector:!1})]})]})})})})]})}function Ne({onClose:e,source:t}){let{addBackend:n}=c(),r=Ee(),{trackBackendAdded:i}=N(),a=C(),o=R.useCallback((a,o,s)=>{n(a),i({backendKind:a.kind,connectionMethod:o,hasApiKey:!!a.apiKey,source:t,agentServerVersion:s?.agentServerVersion}),r(),e()},[n,r,e,i,t]);return a?(0,z.jsx)($,{onConnected:o,testIdRoot:`add-backend`,lockedHost:a,analyticsSource:t}):(0,z.jsx)(Me,{onConnected:o,source:t})}function Pe({mode:e,backend:t,onClose:n,source:r=`add_backend_modal`,hideCloseButton:i=!1}){let{t:a}=o(`openhands`);if(e===`add`)return(0,z.jsx)(P,{onClose:i?void 0:n,closeOnEscape:!1,closeOnBackdropClick:!i,"aria-label":a(d.BACKEND$ADD_TITLE),children:(0,z.jsxs)(`div`,{"data-testid":i?`onboarding-modal`:`add-backend-modal`,className:f(`relative max-h-[92vh] w-[720px] overflow-y-auto rounded-xl border border-[var(--oh-border)] bg-base-secondary p-6`,ne),children:[i?null:(0,z.jsx)(oe,{onClose:n,testId:`add-backend-close`}),i?null:(0,z.jsxs)(`div`,{className:`pr-8`,children:[(0,z.jsx)(`h2`,{className:re,children:a(d.BACKEND$CHOOSER_TITLE)}),(0,z.jsxs)(`p`,{className:`mt-2 text-sm leading-6 text-[var(--oh-muted)]`,"data-testid":`add-backend-description`,children:[a(d.BACKEND$CHOOSER_DESCRIPTION),` `,(0,z.jsxs)(`a`,{href:be,target:`_blank`,rel:`noopener noreferrer`,"aria-label":a(d.BACKEND$DEPLOYMENT_OPTIONS),"data-testid":`add-backend-deployment-options-link`,className:`text-primary hover:underline`,children:[a(d.CTA$LEARN_MORE),(0,z.jsx)(H,{className:`ml-1 inline size-3.5 align-[-0.125em]`,"aria-hidden":!0})]})]})]}),(0,z.jsx)(`div`,{className:i?void 0:`mt-5`,children:(0,z.jsx)(Ne,{onClose:n,source:r})})]})});let s=`edit-backend`;return(0,z.jsx)(P,{onClose:n,closeOnEscape:!1,"aria-label":a(d.BACKEND$EDIT_TITLE),children:(0,z.jsxs)(`div`,{"data-testid":`${s}-modal`,className:f(`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]`,te(`md`)),children:[(0,z.jsx)(oe,{onClose:n,testId:`${s}-close`}),(0,z.jsx)(`h2`,{className:f(`pr-6`,re),children:a(d.BACKEND$EDIT_TITLE)}),(0,z.jsx)(Q,{mode:`edit`,backend:t,onSubmitted:n,testIdRoot:s})]})})}export{q as a,V as c,me as i,Q as n,W as o,Pe as r,U as s,De as t};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./useTranslation-CCgUjPJF.js";import{n}from"./active-backend-context-BnH4-L8h.js";import{K as r}from"./utils-BgLSZdyy.js";import{n as i,t as a}from"./use-cloud-current-user-id-B4ZLUZSa.js";import{r as o}from"./typography-DgcLGdHk.js";var s=e();function c(){let{t:e}=t(),o=n(),s=i(),c=a();if(o.backend.kind!==`cloud`||!o.orgId)return o.backend.name;let l=s[o.backend.id]?.orgs.find(e=>e.id===o.orgId);if(!l)return o.backend.name;let u=c[o.backend.id]?.userId??null,d=u&&l.id===u?e(r.BACKEND$PERSONAL_WORKSPACE):l.name;return`${o.backend.name} – ${d}`}function l(){let{t:e}=t(),i=n(),a=c();return(0,s.jsx)(`div`,{"data-testid":`backend-synced-settings-badge`,className:`flex items-center`,children:(0,s.jsx)(o.Text,{className:`text-[11px] font-medium text-[var(--oh-text-dim)] leading-5`,children:e(r.SETTINGS$BACKEND_SYNCED_BADGE,{name:a,host:i.backend.host,interpolation:{escapeValue:!1}})})})}export{l as t};
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./useTranslation-CCgUjPJF.js";import{n}from"./active-backend-context-BETEdaJl.js";import{K as r}from"./utils-CbjwNcR-.js";import{n as i,t as a}from"./use-cloud-current-user-id-Dqw6qQUg.js";import{r as o}from"./typography-BdAApXGl.js";var s=e();function c(){let{t:e}=t(),o=n(),s=i(),c=a();if(o.backend.kind!==`cloud`||!o.orgId)return o.backend.name;let l=s[o.backend.id]?.orgs.find(e=>e.id===o.orgId);if(!l)return o.backend.name;let u=c[o.backend.id]?.userId??null,d=u&&l.id===u?e(r.BACKEND$PERSONAL_WORKSPACE):l.name;return`${o.backend.name} – ${d}`}function l(){let{t:e}=t(),i=n(),a=c();return(0,s.jsx)(`div`,{"data-testid":`backend-synced-settings-badge`,className:`flex items-center`,children:(0,s.jsx)(o.Text,{className:`text-[11px] font-medium text-[var(--oh-text-dim)] leading-5`,children:e(r.SETTINGS$BACKEND_SYNCED_BADGE,{name:a,host:i.backend.host,interpolation:{escapeValue:!1}})})})}export{l as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-BgLSZdyy.js";import{t as o}from"./modal-backdrop-BSzNhM4r.js";import{r as s,t as c}from"./modal-body-C24WsdFb.js";import{r as l}from"./base-modal-C1a0TsSx.js";import{t as u}from"./settings-input-dVuzapBA.js";import{a as d}from"./use-can-manage-org-profiles-MzIeEV8F.js";var f=e(t(),1),p=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;function m(e,{isRequired:t=!1}={}){return e===``?!t:p.test(e)}function h(e){let t=e.split(`/`),n=(t[t.length-1]||e).replace(/[^A-Za-z0-9._-]/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&!/^[A-Za-z0-9]/.test(n)&&(n=`profile-${n}`),n.length>64&&(n=n.substring(0,64).replace(/-+$/,``)),n||`default-profile`}var g=n(),_=(0,f.forwardRef)(function({testId:e,ruleTestId:t,value:n,onChange:o,onKeyDown:s,placeholder:c,isDisabled:l,isOptional:d,isRequired:p=!1},h){let{t:_}=r(`openhands`),v=m(n,{isRequired:p}),y=d?`${_(i.SETTINGS$PROFILE_NAME_LABEL)} (${_(i.COMMON$OPTIONAL)})`:_(i.SETTINGS$PROFILE_NAME_LABEL),b=f.useId(),x=t??`${b}-rule`;return(0,g.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,g.jsx)(u,{ref:h,testId:e,label:y,type:`text`,className:`w-full`,value:n,placeholder:c??_(i.SETTINGS$PROFILE_NAME_PLACEHOLDER),onChange:o,onKeyDown:s,isDisabled:l,ariaDescribedBy:x,ariaInvalid:!v}),(0,g.jsx)(`p`,{id:x,"data-testid":t,className:a(`text-xs`,v?`text-[var(--oh-muted)]`:`text-red-400`),children:_(i.SETTINGS$PROFILE_NAME_RULE)})]})});function v({isOpen:e,title:t,width:n=`md`,children:r,footer:i,onClose:u,initialFocusRef:d}){let p=(0,f.useRef)(null);return(0,f.useEffect)(()=>{if(!e)return;let t=d?.current??p.current;if(t){let e=setTimeout(()=>{t.focus()},0);return()=>clearTimeout(e)}},[e,d]),(0,f.useEffect)(()=>{if(!e||!p.current)return;let t=p.current,n=e=>{if(e.key!==`Tab`)return;let n=t.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`),r=n[0],i=n[n.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),i?.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r?.focus())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e]),e?(0,g.jsx)(o,{onClose:u,children:(0,g.jsxs)(`div`,{ref:p,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`modal-title`,className:a(`bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]`,s(n),c),children:[(0,g.jsx)(l,{id:`modal-title`,title:t}),r,(0,g.jsx)(`div`,{className:`w-full flex justify-end gap-2 mt-2`,children:i})]})}):null}function y({index:e,icon:t,label:n,onClick:r,onKeyDown:i,menuItemsRef:o,disabled:s,testId:c}){return(0,g.jsx)(`button`,{ref:t=>{o.current[e]=t},type:`button`,onClick:r,onKeyDown:t=>i(t,e),disabled:s,className:a(`group w-full cursor-pointer rounded px-2 py-2 text-start text-nowrap text-sm font-normal`,`text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`),role:`menuitem`,"data-testid":c,children:(0,g.jsx)(d,{icon:t,text:n})})}function b({children:e,className:t,...n}){return(0,g.jsx)(`span`,{className:a(`text-sm leading-4 text-black font-semibold tracking-tighter bg-primary p-1 rounded-full`,t),...n,children:e})}export{h as a,_ as i,y as n,m as o,v as r,b as t};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-CbjwNcR-.js";import{t as o}from"./modal-backdrop-BSzNhM4r.js";import{r as s,t as c}from"./modal-body-B_95ci1c.js";import{r as l}from"./base-modal-CZq4kB_H.js";import{t as u}from"./settings-input-B3i5U9GL.js";import{a as d}from"./use-can-manage-org-profiles-Dt4YkPO7.js";var f=e(t(),1),p=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;function m(e,{isRequired:t=!1}={}){return e===``?!t:p.test(e)}function h(e){let t=e.split(`/`),n=(t[t.length-1]||e).replace(/[^A-Za-z0-9._-]/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&!/^[A-Za-z0-9]/.test(n)&&(n=`profile-${n}`),n.length>64&&(n=n.substring(0,64).replace(/-+$/,``)),n||`default-profile`}var g=n(),_=(0,f.forwardRef)(function({testId:e,ruleTestId:t,value:n,onChange:o,onKeyDown:s,placeholder:c,isDisabled:l,isOptional:d,isRequired:p=!1},h){let{t:_}=r(`openhands`),v=m(n,{isRequired:p}),y=d?`${_(i.SETTINGS$PROFILE_NAME_LABEL)} (${_(i.COMMON$OPTIONAL)})`:_(i.SETTINGS$PROFILE_NAME_LABEL),b=f.useId(),x=t??`${b}-rule`;return(0,g.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,g.jsx)(u,{ref:h,testId:e,label:y,type:`text`,className:`w-full`,value:n,placeholder:c??_(i.SETTINGS$PROFILE_NAME_PLACEHOLDER),onChange:o,onKeyDown:s,isDisabled:l,ariaDescribedBy:x,ariaInvalid:!v}),(0,g.jsx)(`p`,{id:x,"data-testid":t,className:a(`text-xs`,v?`text-[var(--oh-muted)]`:`text-red-400`),children:_(i.SETTINGS$PROFILE_NAME_RULE)})]})});function v({isOpen:e,title:t,width:n=`md`,children:r,footer:i,onClose:u,initialFocusRef:d}){let p=(0,f.useRef)(null);return(0,f.useEffect)(()=>{if(!e)return;let t=d?.current??p.current;if(t){let e=setTimeout(()=>{t.focus()},0);return()=>clearTimeout(e)}},[e,d]),(0,f.useEffect)(()=>{if(!e||!p.current)return;let t=p.current,n=e=>{if(e.key!==`Tab`)return;let n=t.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`),r=n[0],i=n[n.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),i?.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r?.focus())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e]),e?(0,g.jsx)(o,{onClose:u,children:(0,g.jsxs)(`div`,{ref:p,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`modal-title`,className:a(`bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]`,s(n),c),children:[(0,g.jsx)(l,{id:`modal-title`,title:t}),r,(0,g.jsx)(`div`,{className:`w-full flex justify-end gap-2 mt-2`,children:i})]})}):null}function y({index:e,icon:t,label:n,onClick:r,onKeyDown:i,menuItemsRef:o,disabled:s,testId:c}){return(0,g.jsx)(`button`,{ref:t=>{o.current[e]=t},type:`button`,onClick:r,onKeyDown:t=>i(t,e),disabled:s,className:a(`group w-full cursor-pointer rounded px-2 py-2 text-start text-nowrap text-sm font-normal`,`text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`),role:`menuitem`,"data-testid":c,children:(0,g.jsx)(d,{icon:t,text:n})})}function b({children:e,className:t,...n}){return(0,g.jsx)(`span`,{className:a(`text-sm leading-4 text-black font-semibold tracking-tighter bg-primary p-1 rounded-full`,t),...n,children:e})}export{h as a,_ as i,y as n,m as o,v as r,b as t};
@@ -1 +1 @@
1
- import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,vt as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./utils-BgLSZdyy.js";import{n as i}from"./modal-body-C24WsdFb.js";import{t as a}from"./modal-classes-B0b9eiL8.js";e();var o=n();function s({testId:e,variant:n=`default`,onClick:r,text:i,className:a,icon:s,type:c=`button`,disabled:l,intent:u}){return(0,o.jsxs)(`button`,{"data-testid":e,type:c===`submit`?`submit`:`button`,disabled:l,onClick:r,className:t(n==="default"&&`text-sm font-normal py-[10px] rounded-sm`,n===`text-like`&&`text-xs leading-4 font-normal`,s&&`flex items-center justify-center gap-2`,l&&`opacity-50 cursor-not-allowed`,a),name:u&&`intent`,value:u,children:[s,i]})}function c({title:e,id:t,className:n}){return(0,o.jsx)(`span`,{id:t,className:r(a,n),children:e})}function l({description:e,children:t}){return(0,o.jsx)(`span`,{className:`text-sm text-modal-muted`,children:t||e})}function u({testId:e,title:t,description:n,buttons:r}){return(0,o.jsxs)(i,{testID:e,children:[(0,o.jsxs)(`div`,{className:`flex flex-col gap-2 self-start`,children:[(0,o.jsx)(c,{title:t}),(0,o.jsx)(l,{description:n})]}),(0,o.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:r.map((e,t)=>(0,o.jsx)(s,{onClick:e.onClick,text:e.text,className:e.className},t))})]})}export{s as i,l as n,c as r,u as t};
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,vt as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./utils-CbjwNcR-.js";import{n as i}from"./modal-body-B_95ci1c.js";import{t as a}from"./modal-classes-BPcBCWVj.js";e();var o=n();function s({testId:e,variant:n=`default`,onClick:r,text:i,className:a,icon:s,type:c=`button`,disabled:l,intent:u}){return(0,o.jsxs)(`button`,{"data-testid":e,type:c===`submit`?`submit`:`button`,disabled:l,onClick:r,className:t(n==="default"&&`text-sm font-normal py-[10px] rounded-sm`,n===`text-like`&&`text-xs leading-4 font-normal`,s&&`flex items-center justify-center gap-2`,l&&`opacity-50 cursor-not-allowed`,a),name:u&&`intent`,value:u,children:[s,i]})}function c({title:e,id:t,className:n}){return(0,o.jsx)(`span`,{id:t,className:r(a,n),children:e})}function l({description:e,children:t}){return(0,o.jsx)(`span`,{className:`text-sm text-modal-muted`,children:t||e})}function u({testId:e,title:t,description:n,buttons:r}){return(0,o.jsxs)(i,{testID:e,children:[(0,o.jsxs)(`div`,{className:`flex flex-col gap-2 self-start`,children:[(0,o.jsx)(c,{title:t}),(0,o.jsx)(l,{description:n})]}),(0,o.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:r.map((e,t)=>(0,o.jsx)(s,{onClick:e.onClick,text:e.text,className:e.className},t))})]})}export{s as i,l as n,c as r,u as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./utils-BgLSZdyy.js";import{a as i}from"./form-control-classes-Dbq-7YP_.js";var a=e(t(),1),o=n(),s=(0,a.forwardRef)(function({testId:e,name:t,children:n,variant:a,type:s,isDisabled:c,className:l,onClick:u,startContent:d,ariaLabel:f,"aria-busy":p,"aria-haspopup":m,"aria-expanded":h},g){return(0,o.jsxs)(`button`,{ref:g,name:t,"data-testid":e,disabled:c,type:s,onClick:u,"aria-label":f,"aria-busy":p,"aria-haspopup":m,"aria-expanded":h,className:r(i,a===`primary`&&`bg-primary text-[var(--oh-color-base)] hover:opacity-80 disabled:bg-[var(--oh-interactive-hover)] disabled:text-[var(--oh-muted)] disabled:opacity-100`,a===`secondary`&&`border border-[var(--oh-border)] bg-base-secondary text-white hover:bg-surface-raised`,a===`tertiary`&&`bg-[var(--oh-interactive-hover)] text-white hover:opacity-80`,a===`danger`&&`bg-red-600 text-white hover:bg-red-700`,a===`ghost-danger`&&`h-auto min-h-0 bg-transparent px-0 text-red-600 underline hover:text-red-700 hover:no-underline font-normal`,d&&`flex items-center justify-center gap-2`,l),children:[d,n]})});export{s as t};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./utils-CbjwNcR-.js";import{a as i}from"./form-control-classes-BVI_szaj.js";var a=e(t(),1),o=n(),s=(0,a.forwardRef)(function({testId:e,name:t,children:n,variant:a,type:s,isDisabled:c,className:l,onClick:u,startContent:d,ariaLabel:f,"aria-busy":p,"aria-haspopup":m,"aria-expanded":h},g){return(0,o.jsxs)(`button`,{ref:g,name:t,"data-testid":e,disabled:c,type:s,onClick:u,"aria-label":f,"aria-busy":p,"aria-haspopup":m,"aria-expanded":h,className:r(i,a===`primary`&&`bg-primary text-[var(--oh-color-base)] hover:opacity-80 disabled:bg-[var(--oh-interactive-hover)] disabled:text-[var(--oh-muted)] disabled:opacity-100`,a===`secondary`&&`border border-[var(--oh-border)] bg-base-secondary text-white hover:bg-surface-raised`,a===`tertiary`&&`bg-[var(--oh-interactive-hover)] text-white hover:opacity-80`,a===`danger`&&`bg-red-600 text-white hover:bg-red-700`,a===`ghost-danger`&&`h-auto min-h-0 bg-transparent px-0 text-red-600 underline hover:text-red-700 hover:no-underline font-normal`,d&&`flex items-center justify-center gap-2`,l),children:[d,n]})});export{s as t};