@xopcai/xopc 0.0.416 → 0.0.418

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 (807) hide show
  1. package/README.md +2 -2
  2. package/README.zh-CN.md +2 -2
  3. package/dist/browser-ext/dist/assets/{page-context-CVvmTWZb.js → page-context-BKnEwsOO.js} +2881 -1372
  4. package/dist/browser-ext/dist/background.js +1 -1
  5. package/dist/browser-ext/dist/sidepanel.html +1 -1
  6. package/dist/browser-ext/dist/sidepanel.js +481 -346
  7. package/dist/browser-ext/manifest.json +1 -1
  8. package/dist/extensions/telegram/xopc.extension.json +1 -1
  9. package/dist/gateway/static/root/assets/activity-YogQEteU.js +1 -0
  10. package/dist/gateway/static/root/assets/activity-store-DnqOM8GN.js +1 -0
  11. package/dist/gateway/static/root/assets/agent-avatar-dicebear-1UABT2KS.js +1 -0
  12. package/dist/gateway/static/root/assets/agent-avatar-display-Cy50vjbq.js +2 -0
  13. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-V4NX_cWz.js +1 -0
  14. package/dist/gateway/static/root/assets/agent-display-names-Bje7vfSn.js +1 -0
  15. package/dist/gateway/static/root/assets/agent-plugin-dialog-CQ5LLDMO.js +1 -0
  16. package/dist/gateway/static/root/assets/agents-O7mago-m.js +77 -0
  17. package/dist/gateway/static/root/assets/{agents-admin-api-B1p-ghg9.js → agents-admin-api-CyjykMEh.js} +2 -2
  18. package/dist/gateway/static/root/assets/agents-app-path-ciChvpCS.js +1 -0
  19. package/dist/gateway/static/root/assets/api-C1dxxDZx.js +1 -0
  20. package/dist/gateway/static/root/assets/api-Ddrs70xV.js +1 -0
  21. package/dist/gateway/static/root/assets/app-chrome-BeB4KgOf.js +1 -0
  22. package/dist/gateway/static/root/assets/app-link-CytZ5zkp.js +1 -0
  23. package/dist/gateway/static/root/assets/app-management-settings-panel-C1Zs-eha.js +1 -0
  24. package/dist/gateway/static/root/assets/appearance-settings-lIfGokbz.js +1 -0
  25. package/dist/gateway/static/root/assets/apps-page-CUvtsRYD.js +1 -0
  26. package/dist/gateway/static/root/assets/archive-Dz0hferG.js +1 -0
  27. package/dist/gateway/static/root/assets/{archive-plugin-B4btCsiV.js → archive-plugin-n5lPr79c.js} +1 -1
  28. package/dist/gateway/static/root/assets/arrow-left-D880xG-P.js +1 -0
  29. package/dist/gateway/static/root/assets/arrow-right-DSSvoX71.js +1 -0
  30. package/dist/gateway/static/root/assets/arrow-up-D5ZtR1QT.js +1 -0
  31. package/dist/gateway/static/root/assets/arrow-up-right-T72JbQ1Q.js +1 -0
  32. package/dist/gateway/static/root/assets/{attachment-preview-renderer-wzIchDSv.js → attachment-preview-renderer-DdOEgexg.js} +3 -3
  33. package/dist/gateway/static/root/assets/{attachment-process-heavy-Db4nTY5N.js → attachment-process-heavy-DGZZ-M85.js} +2 -2
  34. package/dist/gateway/static/root/assets/automation-api-Bld8blNl.js +1 -0
  35. package/dist/gateway/static/root/assets/automation-display-BcfZOQTC.js +2 -0
  36. package/dist/gateway/static/root/assets/{automations-page-yb1EL_3N.js → automations-page-oLsNzu_6.js} +1 -1
  37. package/dist/gateway/static/root/assets/automations-workspace-BgtYY2Mm.js +8 -0
  38. package/dist/gateway/static/root/assets/beta-badge-BnzdzIEl.js +1 -0
  39. package/dist/gateway/static/root/assets/{binary-plugins-DQT9e258.js → binary-plugins-D9VW7dWP.js} +2 -2
  40. package/dist/gateway/static/root/assets/{block-editor-B50rU9tL.js → block-editor-C477bTtO.js} +23 -23
  41. package/dist/gateway/static/root/assets/book-open-CCGtrT3R.js +1 -0
  42. package/dist/gateway/static/root/assets/bot-DjLkhyZL.js +1 -0
  43. package/dist/gateway/static/root/assets/box-DvYoGszj.js +1 -0
  44. package/dist/gateway/static/root/assets/braces-Cfmtagno.js +1 -0
  45. package/dist/gateway/static/root/assets/brand-logo-CgT9zQfr.js +1 -0
  46. package/dist/gateway/static/root/assets/briefcase-business-BsoCaI_t.js +1 -0
  47. package/dist/gateway/static/root/assets/browser-BLJWD7WI.js +8 -0
  48. package/dist/gateway/static/root/assets/{browser-automation-inputs-D6AccXaA.js → browser-automation-inputs-CCiYXxmh.js} +1 -1
  49. package/dist/gateway/static/root/assets/browser-automations-page-DIUNY94X.js +3 -0
  50. package/dist/gateway/static/root/assets/browser-control-api-Y3fvmeBk.js +6 -0
  51. package/dist/gateway/static/root/assets/browser-notification-delivery-DmE2FgGc.js +1 -0
  52. package/dist/gateway/static/root/assets/browser-settings-page-DjkGahlz.js +3 -0
  53. package/dist/gateway/static/root/assets/{button-aIC072nz.js → button-CnRSIP6m.js} +1 -1
  54. package/dist/gateway/static/root/assets/calendar-clock-D-quYVPe.js +1 -0
  55. package/dist/gateway/static/root/assets/calendar-days-hw_Y-g-s.js +1 -0
  56. package/dist/gateway/static/root/assets/capabilities-DAyA681v.js +1 -0
  57. package/dist/gateway/static/root/assets/capabilities-DRVXLssH.js +1 -0
  58. package/dist/gateway/static/root/assets/capabilities-page-DFW4Y0x8.js +2 -0
  59. package/dist/gateway/static/root/assets/capabilities-settings-panel-uOHSMQPZ.js +8 -0
  60. package/dist/gateway/static/root/assets/capability-header-actions-CTUCuBlW.js +1 -0
  61. package/dist/gateway/static/root/assets/capability-icon-DVoZxEgW.js +1 -0
  62. package/dist/gateway/static/root/assets/capability-links-DzQWK1Fh.js +1 -0
  63. package/dist/gateway/static/root/assets/channels-D2a69dSt.js +1 -0
  64. package/dist/gateway/static/root/assets/channels-routes-r2g-9DdC.js +1 -0
  65. package/dist/gateway/static/root/assets/chat-agents-api-D5nR_JVe.js +1 -0
  66. package/dist/gateway/static/root/assets/chat-chart-block-K2t333qv.js +2 -0
  67. package/dist/gateway/static/root/assets/chat-page-CG38tCHE.js +71 -0
  68. package/dist/gateway/static/root/assets/chat-page-zQeUaawJ.css +1 -0
  69. package/dist/gateway/static/root/assets/chat-terminal-dock-CkFG6mA3.js +35 -0
  70. package/dist/gateway/static/root/assets/chevron-left-DqFhpbvK.js +1 -0
  71. package/dist/gateway/static/root/assets/chevron-right-BweFrslA.js +1 -0
  72. package/dist/gateway/static/root/assets/chunk-D32TOXHM-DQIy-Baq.js +156 -0
  73. package/dist/gateway/static/root/assets/chunk-KS7C4IRE-CiwuuyV8.js +4 -0
  74. package/dist/gateway/static/root/assets/circle-BoO4YvTx.js +1 -0
  75. package/dist/gateway/static/root/assets/circle-alert-BEjgurr2.js +1 -0
  76. package/dist/gateway/static/root/assets/circle-pause-CN9jYH2s.js +1 -0
  77. package/dist/gateway/static/root/assets/circle-x-DFsCKeya.js +1 -0
  78. package/dist/gateway/static/root/assets/clock-3-DnrAnuyZ.js +1 -0
  79. package/dist/gateway/static/root/assets/cloud-C4-yfnnk.js +1 -0
  80. package/dist/gateway/static/root/assets/cloud-credits-B-nbtkqv.js +1 -0
  81. package/dist/gateway/static/root/assets/code-xml-DJtYhZUF.js +1 -0
  82. package/dist/gateway/static/root/assets/coins-DjP27vUx.js +1 -0
  83. package/dist/gateway/static/root/assets/command-palette-api-Do_66X1B.js +1 -0
  84. package/dist/gateway/static/root/assets/composer-payload-handoff-BU3B-C26.js +1 -0
  85. package/dist/gateway/static/root/assets/computer-settings-page-DBxOcMko.js +1 -0
  86. package/dist/gateway/static/root/assets/confirm-dialog-XGclfBqe.js +1 -0
  87. package/dist/gateway/static/root/assets/connected-providers-grid-Dmnu2zle.js +1 -0
  88. package/dist/gateway/static/root/assets/connector-filters-Cfcx9EA2.js +1 -0
  89. package/dist/gateway/static/root/assets/connector-service-page-rWpnchb3.js +1 -0
  90. package/dist/gateway/static/root/assets/connectors-api-DIBG72k4.js +1 -0
  91. package/dist/gateway/static/root/assets/connectors-page-DT_WrC1y.js +1 -0
  92. package/dist/gateway/static/root/assets/constants-DBtMsXdW.js +1 -0
  93. package/dist/gateway/static/root/assets/copy-text-row-CYIv7RfP.js +1 -0
  94. package/dist/gateway/static/root/assets/cpu-B247669f.js +1 -0
  95. package/dist/gateway/static/root/assets/database-CjjeZfRG.js +1 -0
  96. package/dist/gateway/static/root/assets/date-picker-CE-cZFCU.js +1 -0
  97. package/dist/gateway/static/root/assets/dependency-picker-7SpSfDSg.js +1 -0
  98. package/dist/gateway/static/root/assets/desktop-pet-lorocS9j.js +1 -0
  99. package/dist/gateway/static/root/assets/desktop-pet-narrative-CS8qJpNO.js +1 -0
  100. package/dist/gateway/static/root/assets/desktop-pet-settings-CEcohlZq.js +1 -0
  101. package/dist/gateway/static/root/assets/{desktop-pet-sprite-Bd-aOI7N.js → desktop-pet-sprite-D5YYq2zC.js} +1 -1
  102. package/dist/gateway/static/root/assets/dev-view-store-57HgVuZ6.js +1 -0
  103. package/dist/gateway/static/root/assets/device-pairing-wizard-CLCPuf4R.js +1 -0
  104. package/dist/gateway/static/root/assets/directory-picker-path-field-D4jMhpka.js +1 -0
  105. package/dist/gateway/static/root/assets/discussion-annotation-sync-BKjf9gWe.js +1 -0
  106. package/dist/gateway/static/root/assets/dist-CaUuvp8-.js +1 -0
  107. package/dist/gateway/static/root/assets/dist-DNCdG_qB.js +1 -0
  108. package/dist/gateway/static/root/assets/dist-DfWfZ9iu.js +1 -0
  109. package/dist/gateway/static/root/assets/dist-DusecO_p.js +1 -0
  110. package/dist/gateway/static/root/assets/docx-preview-CnIClbYi.js +20 -0
  111. package/dist/gateway/static/root/assets/earth-BMhZtzcj.js +1 -0
  112. package/dist/gateway/static/root/assets/echarts-runtime-QSmTlXOu.js +18 -0
  113. package/dist/gateway/static/root/assets/electron-env-DHOGevH3.js +1 -0
  114. package/dist/gateway/static/root/assets/extension-debug-page-BsK2LMXQ.js +1 -0
  115. package/dist/gateway/static/root/assets/extension-iframe-host-Dhkk5JV2.js +1 -0
  116. package/dist/gateway/static/root/assets/extension-marketplace-api-CVJPqJOB.js +1 -0
  117. package/dist/gateway/static/root/assets/extension-page-Brps2XDP.js +1 -0
  118. package/dist/gateway/static/root/assets/extension-paths-DvuaZJuy.js +1 -0
  119. package/dist/gateway/static/root/assets/extension-provider-Byrd8Sor.js +1 -0
  120. package/dist/gateway/static/root/assets/extension-settings-page-CHY68DpG.js +1 -0
  121. package/dist/gateway/static/root/assets/file-BqMS_3DT.js +1 -0
  122. package/dist/gateway/static/root/assets/file-archive-DanfQJNe.js +1 -0
  123. package/dist/gateway/static/root/assets/file-preview-surface-BlprUrIs.js +1 -0
  124. package/dist/gateway/static/root/assets/file-text-D12HbeVy.js +1 -0
  125. package/dist/gateway/static/root/assets/file-tree-CFlZnV3Y.js +1 -0
  126. package/dist/gateway/static/root/assets/file-tree-utils-DJs1faGv.js +1 -0
  127. package/dist/gateway/static/root/assets/files-BNL4kkSB.js +1 -0
  128. package/dist/gateway/static/root/assets/floating-ui.dom-seOukHzT.js +1 -0
  129. package/dist/gateway/static/root/assets/folder-CN-pC3XL.js +1 -0
  130. package/dist/gateway/static/root/assets/folder-kanban-CpLlFI1o.js +1 -0
  131. package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +1 -0
  132. package/dist/gateway/static/root/assets/{gateway-config-swr-fQKBHBi1.js → gateway-config-swr-BAmUhiP1.js} +1 -1
  133. package/dist/gateway/static/root/assets/gateway-realtime-CsykKL4l.js +1 -0
  134. package/dist/gateway/static/root/assets/gateway-realtime-store-DQqMBruB.js +1 -0
  135. package/dist/gateway/static/root/assets/gateway-restart-Ch128Lrr.js +1 -0
  136. package/dist/gateway/static/root/assets/gateway-settings-BA5-Uuwx.js +1 -0
  137. package/dist/gateway/static/root/assets/{gateway-startup-retry-Cfwxof4k.js → gateway-startup-retry-CtUB3g6N.js} +1 -1
  138. package/dist/gateway/static/root/assets/gauge-C78eD2BA.js +1 -0
  139. package/dist/gateway/static/root/assets/git-branch-Dh9uxTot.js +1 -0
  140. package/dist/gateway/static/root/assets/global-defaults-api-CINf-C6a.js +2 -0
  141. package/dist/gateway/static/root/assets/heart-Cp4rgrqn.js +1 -0
  142. package/dist/gateway/static/root/assets/highlight-code-BH65IIbJ.js +1 -0
  143. package/dist/gateway/static/root/assets/highlighted-body-KQOG7T2V-DKGma5wI.js +1 -0
  144. package/dist/gateway/static/root/assets/history-DXH_9jsE.js +1 -0
  145. package/dist/gateway/static/root/assets/home-page-DaMFBYo1.js +2 -0
  146. package/dist/gateway/static/root/assets/image-Cwyalflz.js +1 -0
  147. package/dist/gateway/static/root/assets/image-generation-api-I_JgLL_m.js +1 -0
  148. package/dist/gateway/static/root/assets/imports-page-BWShtGRQ.js +1 -0
  149. package/dist/gateway/static/root/assets/index-DY2Y83b9.css +1 -0
  150. package/dist/gateway/static/root/assets/index-fKpEKELX.js +11 -0
  151. package/dist/gateway/static/root/assets/index.module-Cd9ENXfk.js +1 -0
  152. package/dist/gateway/static/root/assets/info-CDrmIZhb.js +1 -0
  153. package/dist/gateway/static/root/assets/install-connector-dialog-DU1Tz7B3.js +1 -0
  154. package/dist/gateway/static/root/assets/interaction-BdhHBbYa.js +1 -0
  155. package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +1 -0
  156. package/dist/gateway/static/root/assets/{jszip.min-DT31yWkU.js → jszip.min-Dj17eJqX.js} +1 -1
  157. package/dist/gateway/static/root/assets/key-round-DWbpyU2U.js +1 -0
  158. package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-CdM4BQwp.js +1 -0
  159. package/dist/gateway/static/root/assets/languages-zXtNocoy.js +2 -0
  160. package/dist/gateway/static/root/assets/laptop-CI3hBVrl.js +1 -0
  161. package/dist/gateway/static/root/assets/layers-mJW7JJKm.js +1 -0
  162. package/dist/gateway/static/root/assets/layout-grid-CEVZdVFU.js +1 -0
  163. package/dist/gateway/static/root/assets/list-checks-BbsExAoq.js +1 -0
  164. package/dist/gateway/static/root/assets/list-filter-COkzTdOz.js +1 -0
  165. package/dist/gateway/static/root/assets/list-todo-CTVRto8O.js +1 -0
  166. package/dist/gateway/static/root/assets/list-tree-B0OMswgM.js +1 -0
  167. package/dist/gateway/static/root/assets/local-app-workbench-page-qPflPuQD.js +1 -0
  168. package/dist/gateway/static/root/assets/local-apps-Ck6kACsY.js +1 -0
  169. package/dist/gateway/static/root/assets/local-apps-page-CxyRVfjD.js +1 -0
  170. package/dist/gateway/static/root/assets/local-session-drafts-B9ZPwotC.js +1 -0
  171. package/dist/gateway/static/root/assets/{locale-store-B7s2Hb35.js → locale-store-lIXD1FMw.js} +1 -1
  172. package/dist/gateway/static/root/assets/lock-keyhole-DEK5kH0u.js +1 -0
  173. package/dist/gateway/static/root/assets/logs-page-CbY1N-zi.js +2 -0
  174. package/dist/gateway/static/root/assets/loopi-C09I2mNj.css +1 -0
  175. package/dist/gateway/static/root/assets/loopi-CNtmi9FU.js +1 -0
  176. package/dist/gateway/static/root/assets/management-settings-Diy12JfQ.js +1 -0
  177. package/dist/gateway/static/root/assets/{markdown-editor-phTQ0mox.js → markdown-editor-BuuGlcfG.js} +1 -1
  178. package/dist/gateway/static/root/assets/markdown-view-C-DHb3Io.css +1 -0
  179. package/dist/gateway/static/root/assets/markdown-view-CJt-i2Dp.js +324 -0
  180. package/dist/gateway/static/root/assets/{media-plugins-CIx1koXw.js → media-plugins-D_bR23mA.js} +1 -1
  181. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-Ur99GwOg.js +1 -0
  182. package/dist/gateway/static/root/assets/mermaid-render-oOellPHt.js +134 -0
  183. package/dist/gateway/static/root/assets/message-circle-Badhj-4D.js +1 -0
  184. package/dist/gateway/static/root/assets/message-square-fVE7Ghj1.js +1 -0
  185. package/dist/gateway/static/root/assets/message-square-plus-XP0tGdlV.js +1 -0
  186. package/dist/gateway/static/root/assets/{messages-BYq0cPbn.js → messages-DRR9N3HC.js} +1 -1
  187. package/dist/gateway/static/root/assets/messages-square-BckAJrEW.js +1 -0
  188. package/dist/gateway/static/root/assets/mic-CuUb7zc-.js +1 -0
  189. package/dist/gateway/static/root/assets/minimize-2-DtOGrlpo.js +1 -0
  190. package/dist/gateway/static/root/assets/mobile-pair-qr-CuIbmw5x.js +1 -0
  191. package/dist/gateway/static/root/assets/model-selector-DCYA_ntf.js +1 -0
  192. package/dist/gateway/static/root/assets/models-hub-cache-za2fWJLg.js +1 -0
  193. package/dist/gateway/static/root/assets/monitor-Af5eAvF7.js +1 -0
  194. package/dist/gateway/static/root/assets/mouse-pointer-2-DZ51Onvj.js +1 -0
  195. package/dist/gateway/static/root/assets/navigation-BkjnOw30.js +1 -0
  196. package/dist/gateway/static/root/assets/network-BUQLY1BV.js +1 -0
  197. package/dist/gateway/static/root/assets/new-session-preferences-gb411vZP.js +1 -0
  198. package/dist/gateway/static/root/assets/note-detail-panel-DBs1yHLy.js +5 -0
  199. package/dist/gateway/static/root/assets/note-image-lightbox-CivkB6LB.js +1 -0
  200. package/dist/gateway/static/root/assets/notes-api-C_458rv5.js +1 -0
  201. package/dist/gateway/static/root/assets/notes-page-DL3c-41a.js +8 -0
  202. package/dist/gateway/static/root/assets/number-input-El7Szeln.js +1 -0
  203. package/dist/gateway/static/root/assets/oauth-api-C3X9FLYw.js +1 -0
  204. package/dist/gateway/static/root/assets/oauth-authorization-window-o6URRos4.js +1 -0
  205. package/dist/gateway/static/root/assets/oauth-provider-connect-H81se_3n.js +1 -0
  206. package/dist/gateway/static/root/assets/package-wATCyihJ.js +1 -0
  207. package/dist/gateway/static/root/assets/page-context-capture-button-BkAlQ7cB.js +1 -0
  208. package/dist/gateway/static/root/assets/page-context-draft-ClLgaOaD.js +1 -0
  209. package/dist/gateway/static/root/assets/page-header-store-DH8K0xii.js +1 -0
  210. package/dist/gateway/static/root/assets/page-tabs-oeTY7z3_.js +1 -0
  211. package/dist/gateway/static/root/assets/panel-left-C8MqSXRZ.js +1 -0
  212. package/dist/gateway/static/root/assets/panel-right-CFGrHTsD.js +1 -0
  213. package/dist/gateway/static/root/assets/paperclip-f1HujQY1.js +1 -0
  214. package/dist/gateway/static/root/assets/pause-DuPxgSxk.js +1 -0
  215. package/dist/gateway/static/root/assets/{pdf-D4PI9qAw.js → pdf-EQHMWEbX.js} +3 -3
  216. package/dist/gateway/static/root/assets/pdf-runtime-JnUAvfIa.js +2 -0
  217. package/dist/gateway/static/root/assets/{pdf.worker.min-B4E34YdZ.js → pdf.worker.min-bpyjgR8v.js} +7 -7
  218. package/dist/gateway/static/root/assets/pencil-DmIY3Oa-.js +1 -0
  219. package/dist/gateway/static/root/assets/personal-avatar-BLtHt8fV.js +1 -0
  220. package/dist/gateway/static/root/assets/personal-avatar-BUCb7OiW.css +1 -0
  221. package/dist/gateway/static/root/assets/personal-page-B5DP3lO-.js +1 -0
  222. package/dist/gateway/static/root/assets/personal-proactivity-DaRnbB1f.js +1 -0
  223. package/dist/gateway/static/root/assets/personal-settings-panel-DjDc5Kaz.js +1 -0
  224. package/dist/gateway/static/root/assets/phone-dependencies-card-DISHarj8.js +1 -0
  225. package/dist/gateway/static/root/assets/phone-model-picker-u8YIQCgo.js +1 -0
  226. package/dist/gateway/static/root/assets/phone-settings-page-el3pT0PD.js +1 -0
  227. package/dist/gateway/static/root/assets/phone-workspace-store-fhnZrgy_.js +1 -0
  228. package/dist/gateway/static/root/assets/pin-off-BMRv-Kxr.js +1 -0
  229. package/dist/gateway/static/root/assets/play-kxZvpBg8.js +1 -0
  230. package/dist/gateway/static/root/assets/plug-DKYPEgkR.js +1 -0
  231. package/dist/gateway/static/root/assets/plug-zap-L8NMe3Sv.js +1 -0
  232. package/dist/gateway/static/root/assets/plugin-details-dialog-CTBs1Jde.js +1 -0
  233. package/dist/gateway/static/root/assets/plus-Q2yW6OE7.js +1 -0
  234. package/dist/gateway/static/root/assets/popover-select-DniHw2dy.js +1 -0
  235. package/dist/gateway/static/root/assets/power-ZI-pBczI.js +1 -0
  236. package/dist/gateway/static/root/assets/power-off-CwwQ7Gp7.js +1 -0
  237. package/dist/gateway/static/root/assets/preference-select-fields-D7oluyHN.js +1 -0
  238. package/dist/gateway/static/root/assets/preload-helper-Czpn1I53.js +1 -0
  239. package/dist/gateway/static/root/assets/preview-open-alternatives-CY_hjK4b.js +1 -0
  240. package/dist/gateway/static/root/assets/product-automation-feedback-DsUSqCOX.js +7 -0
  241. package/dist/gateway/static/root/assets/product-delivery-BU_H84jL.js +1 -0
  242. package/dist/gateway/static/root/assets/product-navigation-Co8pLbDP.js +1 -0
  243. package/dist/gateway/static/root/assets/product-open-page-xn9G4hSI.js +1 -0
  244. package/dist/gateway/static/root/assets/product-preview-content-DcoK-iZe.js +1 -0
  245. package/dist/gateway/static/root/assets/product-preview-modal-Ruw9WSKK.js +2 -0
  246. package/dist/gateway/static/root/assets/project-detail-page-BKvWLiMw.js +7 -0
  247. package/dist/gateway/static/root/assets/project-understanding-BCQr0AZ_.js +1 -0
  248. package/dist/gateway/static/root/assets/projects-page-D4g7bB7X.js +1 -0
  249. package/dist/gateway/static/root/assets/providers-api-CzVkFKFg.js +1 -0
  250. package/dist/gateway/static/root/assets/puzzle-BptcPjKI.js +1 -0
  251. package/dist/gateway/static/root/assets/recording-upload-0jxahBMo.js +1 -0
  252. package/dist/gateway/static/root/assets/refresh-button-bU_0NarN.js +1 -0
  253. package/dist/gateway/static/root/assets/{registry-api-BcfoLEna.js → registry-api-n8TwtJ_j.js} +2 -2
  254. package/dist/gateway/static/root/assets/remote-access-hub-cZpBi4Rk.js +1 -0
  255. package/dist/gateway/static/root/assets/rotate-ccw-JM1TBLpp.js +1 -0
  256. package/dist/gateway/static/root/assets/rotate-cw-LIg3Am9S.js +1 -0
  257. package/dist/gateway/static/root/assets/route-preload-B5UiReO7.js +2 -0
  258. package/dist/gateway/static/root/assets/runtime-health-D2TDFLLq.js +1 -0
  259. package/dist/gateway/static/root/assets/{runtime-tools-api-DesqGCnE.js → runtime-tools-api-D-8KjYK6.js} +1 -1
  260. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-MKlLFuow.js +1 -0
  261. package/dist/gateway/static/root/assets/save-DRDABU--.js +1 -0
  262. package/dist/gateway/static/root/assets/schema-form-v4N4lawq.js +1 -0
  263. package/dist/gateway/static/root/assets/schemas-CCWMleym.js +55 -0
  264. package/dist/gateway/static/root/assets/search-DA7gz22f.js +1 -0
  265. package/dist/gateway/static/root/assets/secret-input-BQvFXqzz.js +1 -0
  266. package/dist/gateway/static/root/assets/secret-input-labels-B5Jl5HqK.js +1 -0
  267. package/dist/gateway/static/root/assets/segmented-styles-Cqb91xsn.js +1 -0
  268. package/dist/gateway/static/root/assets/send-1f1Ntw6E.js +1 -0
  269. package/dist/gateway/static/root/assets/server-BlHCBjiE.js +1 -0
  270. package/dist/gateway/static/root/assets/service-recommendation-list-B1xuVT3N.js +1 -0
  271. package/dist/gateway/static/root/assets/{session-api-DdQnMwkl.js → session-api-CsCoI2im.js} +1 -1
  272. package/dist/gateway/static/root/assets/session-channel-icon-SsY70Z6t.js +1 -0
  273. package/dist/gateway/static/root/assets/session-identity-label-B7sgG1PE.js +1 -0
  274. package/dist/gateway/static/root/assets/session-manager-5l9q0cd5.js +16 -0
  275. package/dist/gateway/static/root/assets/sessions-page-DsLw2aMD.js +1 -0
  276. package/dist/gateway/static/root/assets/settings-2-D-csvaET.js +1 -0
  277. package/dist/gateway/static/root/assets/settings-advanced-gate-B5lQeVNi.js +1 -0
  278. package/dist/gateway/static/root/assets/settings-advanced-section-BqoVSko2.js +1 -0
  279. package/dist/gateway/static/root/assets/settings-form-draft-Dy10ldo8.js +1 -0
  280. package/dist/gateway/static/root/assets/settings-form-section-num14vSv.js +1 -0
  281. package/dist/gateway/static/root/assets/settings-loading-skeleton-BTqvr_Fw.js +1 -0
  282. package/dist/gateway/static/root/assets/settings-mode-store-CBsJ-Qg2.js +1 -0
  283. package/dist/gateway/static/root/assets/settings-page-DROUGyJl.js +1 -0
  284. package/dist/gateway/static/root/assets/settings-page-header-Bv-kQFTm.js +1 -0
  285. package/dist/gateway/static/root/assets/settings-page-layout-DHP6MrrL.js +1 -0
  286. package/dist/gateway/static/root/assets/settings-uiTATseT.js +1 -0
  287. package/dist/gateway/static/root/assets/setup-status-panel-MJE3B_LX.js +1 -0
  288. package/dist/gateway/static/root/assets/share-link-dialog-BJHRQVKC.js +1 -0
  289. package/dist/gateway/static/root/assets/share-preview-page-Bsrv_zOQ.js +2 -0
  290. package/dist/gateway/static/root/assets/shares-api-rtWVHA_d.js +1 -0
  291. package/dist/gateway/static/root/assets/shares-settings-CfIRv4uX.js +1 -0
  292. package/dist/gateway/static/root/assets/shield-B1sI_cxl.js +1 -0
  293. package/dist/gateway/static/root/assets/shield-check-BU58siTV.js +1 -0
  294. package/dist/gateway/static/root/assets/shield-off-2jsucUds.js +1 -0
  295. package/dist/gateway/static/root/assets/side-chat-shortcut-BIw-1TTD.js +1 -0
  296. package/dist/gateway/static/root/assets/skill-api-B_W1K3sv.js +1 -0
  297. package/dist/gateway/static/root/assets/skill-api-utils-C7V4JVXM.js +1 -0
  298. package/dist/gateway/static/root/assets/skill-list-api-BzlKXPsE.js +1 -0
  299. package/dist/gateway/static/root/assets/skill-reload-api-Cff2GgZb.js +1 -0
  300. package/dist/gateway/static/root/assets/skill-wire-pattern-BPpeIcCi.js +1 -0
  301. package/dist/gateway/static/root/assets/skills-page-DtBloYeU.js +2 -0
  302. package/dist/gateway/static/root/assets/sliders-horizontal-DqsYor6I.js +1 -0
  303. package/dist/gateway/static/root/assets/sliding-tab-list-DuQyViqe.js +1 -0
  304. package/dist/gateway/static/root/assets/smartphone-DSSsQFqA.js +1 -0
  305. package/dist/gateway/static/root/assets/{source-workspace-editor-BIvi89Zx.js → source-workspace-editor-kxosllTu.js} +1 -1
  306. package/dist/gateway/static/root/assets/sparkles-DHlfQFAF.js +1 -0
  307. package/dist/gateway/static/root/assets/specialists-xbB3xL9e.js +1 -0
  308. package/dist/gateway/static/root/assets/square-DMK_fB-3.js +1 -0
  309. package/dist/gateway/static/root/assets/square-pen-B8FsvqNu.js +1 -0
  310. package/dist/gateway/static/root/assets/square-terminal-K87bylpZ.js +1 -0
  311. package/dist/gateway/static/root/assets/star-BUWJqJ5c.js +1 -0
  312. package/dist/gateway/static/root/assets/stethoscope-DRqTAtjD.js +1 -0
  313. package/dist/gateway/static/root/assets/sticky-note-fzP7NAJq.js +1 -0
  314. package/dist/gateway/static/root/assets/store-SzD1Jvgm.js +1 -0
  315. package/dist/gateway/static/root/assets/system-settings-panel-BeQeUUMH.js +1 -0
  316. package/dist/gateway/static/root/assets/task-detail-page-Drrv-Hp0.js +2 -0
  317. package/dist/gateway/static/root/assets/task-result-evidence-D1Kyskm_.js +1 -0
  318. package/dist/gateway/static/root/assets/tasks-DRmd6sWt.js +1 -0
  319. package/dist/gateway/static/root/assets/terminal-oKqqZdiG.js +1 -0
  320. package/dist/gateway/static/root/assets/terminal-panel-store-5Fzctajw.js +1 -0
  321. package/dist/gateway/static/root/assets/theme-store-DW45fWYQ.js +1 -0
  322. package/dist/gateway/static/root/assets/timer-rCwGHjuO.js +1 -0
  323. package/dist/gateway/static/root/assets/tool-friendly-title-DGmi7rCQ.js +1 -0
  324. package/dist/gateway/static/root/assets/tracing-settings-page-B12u5D9A.js +1 -0
  325. package/dist/gateway/static/root/assets/trash-2-DusmjVPV.js +1 -0
  326. package/dist/gateway/static/root/assets/triangle-alert-2JXFNNKU.js +1 -0
  327. package/dist/gateway/static/root/assets/tunnel-api-DGO56LQU.js +1 -0
  328. package/dist/gateway/static/root/assets/understanding-activity-store-CTe6TFB0.js +1 -0
  329. package/dist/gateway/static/root/assets/understanding-refresh-store-mE9OKG6q.js +1 -0
  330. package/dist/gateway/static/root/assets/unlink-BEuthaaq.js +1 -0
  331. package/dist/gateway/static/root/assets/upload-rrb46c3c.js +1 -0
  332. package/dist/gateway/static/root/assets/usage-page-Ud2U9UG1.js +1 -0
  333. package/dist/gateway/static/root/assets/use-async-resource-BHFGZCY2.js +1 -0
  334. package/dist/gateway/static/root/assets/use-autosave-Cs2Ga_Y_.js +1 -0
  335. package/dist/gateway/static/root/assets/use-composer-attachments-BCbMj-MN.js +2 -0
  336. package/dist/gateway/static/root/assets/use-directory-picker-C4p7AgWY.js +1 -0
  337. package/dist/gateway/static/root/assets/use-file-preview-expanded-DSpCRXUW.js +2 -0
  338. package/dist/gateway/static/root/assets/use-media-query-ady-FgjK.js +1 -0
  339. package/dist/gateway/static/root/assets/use-personal-profile-BHL2AxWU.js +1 -0
  340. package/dist/gateway/static/root/assets/use-workspace-tree-CnmPZrpx.js +1 -0
  341. package/dist/gateway/static/root/assets/user-model-page-p5iPfnwl.js +2 -0
  342. package/dist/gateway/static/root/assets/user-round-C9jxPhMR.js +1 -0
  343. package/dist/gateway/static/root/assets/{vendor-codemirror-Qdcjid65.js → vendor-codemirror-aCQ0FcJT.js} +8 -8
  344. package/dist/gateway/static/root/assets/{vendor-swr-BIWyz7Rc.js → vendor-swr-CdRzEUwF.js} +1 -1
  345. package/dist/gateway/static/root/assets/video-B6V0GFss.js +1 -0
  346. package/dist/gateway/static/root/assets/voice-api-key-field-3gyc2UV3.js +1 -0
  347. package/dist/gateway/static/root/assets/voice-call-context-BM2A4bLz.js +1 -0
  348. package/dist/gateway/static/root/assets/{voice-config-api-BkUlN7GH.js → voice-config-api-Cda2uBIC.js} +1 -1
  349. package/dist/gateway/static/root/assets/voice-input-shortcut-events-DtYHsPLF.js +1 -0
  350. package/dist/gateway/static/root/assets/voice-transcribe-api-TInEfIYo.js +1 -0
  351. package/dist/gateway/static/root/assets/volume-2-BSJhAY97.js +1 -0
  352. package/dist/gateway/static/root/assets/wand-sparkles-CkSL-3Fy.js +1 -0
  353. package/dist/gateway/static/root/assets/{with-selector-aYPsXwdl.js → with-selector-xonYxPoM.js} +1 -1
  354. package/dist/gateway/static/root/assets/work-discovery-overlay-Dqu5CQCS.js +1 -0
  355. package/dist/gateway/static/root/assets/work-discovery-page-p-8ciZ0i.js +1 -0
  356. package/dist/gateway/static/root/assets/working-directory-picker-modal-DHl2cZY1.js +1 -0
  357. package/dist/gateway/static/root/assets/workspace-api-CtDbI6T7.js +2 -0
  358. package/dist/gateway/static/root/assets/workspace-editor-agent-store-B94Q2nN8.js +1 -0
  359. package/dist/gateway/static/root/assets/workspace-file-preview-dialog-CTIbUfKb.js +1 -0
  360. package/dist/gateway/static/root/assets/workspace-open-location-menu-BwxouqdZ.js +1 -0
  361. package/dist/gateway/static/root/assets/x-B_N4OPjy.js +1 -0
  362. package/dist/gateway/static/root/assets/{xlsx-CKkngM-o.js → xlsx-Cl_0CZaL.js} +11 -11
  363. package/dist/gateway/static/root/assets/xml-_d7dTN2Q.js +3 -0
  364. package/dist/gateway/static/root/assets/xopc-cloud-account-card-CFb-23rS.js +1 -0
  365. package/dist/gateway/static/root/assets/zap-dximCGjy.js +1 -0
  366. package/dist/gateway/static/root/index.html +266 -48
  367. package/dist/package.js +1 -1
  368. package/dist/src/activity/emitter.js +1 -2
  369. package/dist/src/activity/service.js +1 -2
  370. package/dist/src/agent/agent-manager.d.ts +1 -0
  371. package/dist/src/agent/agent-manager.js +3 -4
  372. package/dist/src/agent/background-review/run-background-review.js +1 -2
  373. package/dist/src/agent/context/execution-context.js +1 -2
  374. package/dist/src/agent/context/execution-scope.js +1 -2
  375. package/dist/src/agent/context/project-context.js +1 -2
  376. package/dist/src/agent/embedded/agent-profile-context.js +1 -2
  377. package/dist/src/agent/embedded/run-turn.js +2 -4
  378. package/dist/src/agent/embedded/sqlite-hydrating-session-manager.js +1 -2
  379. package/dist/src/agent/external-tools/cliProvider.js +1 -2
  380. package/dist/src/agent/external-tools/composio-provider.js +1 -2
  381. package/dist/src/agent/memory/compaction-promotion.js +1 -2
  382. package/dist/src/agent/orchestration/research-checkpoint.js +26 -31
  383. package/dist/src/agent/prompt/response-language.js +1 -2
  384. package/dist/src/agent/prompt/service-prompt-builder.js +3 -6
  385. package/dist/src/agent/prompt/system-prompt.js +1 -2
  386. package/dist/src/agent/service/direct-turn-helpers.js +1 -2
  387. package/dist/src/agent/service/process-direct-streaming.js +1 -2
  388. package/dist/src/agent/service/webchat-tts.js +1 -2
  389. package/dist/src/agent/service.js +2 -2
  390. package/dist/src/agent/service.types.d.ts +1 -0
  391. package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
  392. package/dist/src/agent/tool-manuals/computer.js +2 -0
  393. package/dist/src/agent/tool-manuals/phone.d.ts +1 -1
  394. package/dist/src/agent/tool-manuals/phone.js +14 -4
  395. package/dist/src/agent/tool-manuals/xopc-configuration.d.ts +2 -2
  396. package/dist/src/agent/tool-manuals/xopc-configuration.js +27 -23
  397. package/dist/src/agent/tools/delegate-tool.js +2 -4
  398. package/dist/src/agent/tools/factory.d.ts +1 -0
  399. package/dist/src/agent/tools/factory.js +12 -8
  400. package/dist/src/agent/tools/personal-task-tool.js +1 -2
  401. package/dist/src/agent/tools/phone-use-tool.d.ts +1 -0
  402. package/dist/src/agent/tools/phone-use-tool.js +71 -4
  403. package/dist/src/agent/tools/research-checkpoint-tool.js +1 -2
  404. package/dist/src/agent/tools/xopc-use-tool.d.ts +1 -0
  405. package/dist/src/agent/tools/xopc-use-tool.js +7 -4
  406. package/dist/src/agent-catalog/repository.js +2 -3
  407. package/dist/src/agent-catalog/test-support.js +1 -2
  408. package/dist/src/agent-matching/selection-repository.js +1 -2
  409. package/dist/src/automations/capabilities/drafts.js +2 -4
  410. package/dist/src/bootstrap/application-state.js +1 -2
  411. package/dist/src/browser/automations/repository.js +1 -2
  412. package/dist/src/browser/native-messaging-host.js +2 -4
  413. package/dist/src/browser/providers/realtime-extension.js +1 -2
  414. package/dist/src/browser/recordings/service.js +1 -2
  415. package/dist/src/browser/setup/service.d.ts +9 -4
  416. package/dist/src/browser/setup/service.js +48 -19
  417. package/dist/src/chat-previews/store.js +1 -2
  418. package/dist/src/cli/commands/doctor/checks/automation-integrity.js +1 -2
  419. package/dist/src/cli/commands/doctor/checks/database-relations.js +1 -2
  420. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -2
  421. package/dist/src/cli/commands/doctor/checks/node-version.js +6 -6
  422. package/dist/src/cli/commands/doctor/checks/session-integrity.js +1 -2
  423. package/dist/src/cli/commands/gateway/shared.js +1 -2
  424. package/dist/src/cli/commands/history.js +1 -2
  425. package/dist/src/cli/commands/project.js +1 -2
  426. package/dist/src/computer/diagnostics.d.ts +7 -7
  427. package/dist/src/computer/diagnostics.js +8 -2
  428. package/dist/src/computer/errors.js +9 -1
  429. package/dist/src/computer/evaluation.d.ts +4 -4
  430. package/dist/src/computer/keyboard.d.ts +1 -1
  431. package/dist/src/computer/keyboard.js +10 -2
  432. package/dist/src/computer/model-adapter.js +27 -7
  433. package/dist/src/config/gateway-bind.js +1 -2
  434. package/dist/src/config/schema.d.ts +5 -0
  435. package/dist/src/connectors/cli/lifecycle.js +1 -2
  436. package/dist/src/connectors/composio-managed-events.js +1 -2
  437. package/dist/src/connectors/connected-source-ingestion.js +1 -2
  438. package/dist/src/connectors/connected-source-understanding.js +2 -4
  439. package/dist/src/connectors/content-enrichment.js +1 -2
  440. package/dist/src/connectors/learning-coordinator.js +1 -2
  441. package/dist/src/connectors/runtime-adapter-registry.js +1 -2
  442. package/dist/src/daemon/constants.js +9 -14
  443. package/dist/src/daemon/index.js +1 -4
  444. package/dist/src/daemon/install-plan.js +1 -2
  445. package/dist/src/daemon/launchd.js +1 -2
  446. package/dist/src/daemon/schtasks.js +1 -2
  447. package/dist/src/daemon/service-audit.js +1 -2
  448. package/dist/src/daemon/service.js +1 -2
  449. package/dist/src/daemon/systemd.js +1 -2
  450. package/dist/src/discussions/analyzer.d.ts +3 -3
  451. package/dist/src/endpoint-tools/runtime.js +1 -2
  452. package/dist/src/execution-environments/subject.js +1 -2
  453. package/dist/src/extensions/agent-plugins/branding.js +2 -1
  454. package/dist/src/extensions/agent-plugins/cli-authorization.js +2 -1
  455. package/dist/src/extensions/agent-plugins/contained-path.d.ts +1 -0
  456. package/dist/src/extensions/agent-plugins/contained-path.js +29 -0
  457. package/dist/src/extensions/agent-plugins/mcp-adapter.js +2 -1
  458. package/dist/src/extensions/agent-plugins/resources.js +1 -1
  459. package/dist/src/extensions/agent-plugins/skill-catalog.js +2 -1
  460. package/dist/src/extensions/agent-plugins/source-catalog.js +1 -1
  461. package/dist/src/extensions/agent-plugins/store.js +2 -1
  462. package/dist/src/extensions/agent-plugins/validation.d.ts +1 -2
  463. package/dist/src/extensions/agent-plugins/validation.js +2 -25
  464. package/dist/src/gateway/client-ip.js +1 -2
  465. package/dist/src/gateway/file-space-service.js +1 -2
  466. package/dist/src/gateway/hono/app.js +2 -4
  467. package/dist/src/gateway/hono/middleware/auth.js +3 -6
  468. package/dist/src/gateway/hono/middleware/logger.js +1 -2
  469. package/dist/src/gateway/hono/middleware/public-device-rate-limit.js +1 -2
  470. package/dist/src/gateway/hono/middleware/scopes.js +1 -2
  471. package/dist/src/gateway/hono/middleware/strict-rate-limit.js +1 -2
  472. package/dist/src/gateway/hono/oauth-async.js +1 -2
  473. package/dist/src/gateway/hono/routes/browser-session.js +1 -2
  474. package/dist/src/gateway/hono/routes/browser.js +3 -6
  475. package/dist/src/gateway/hono/routes/cli-connectors.js +1 -2
  476. package/dist/src/gateway/hono/routes/composer-history.js +1 -2
  477. package/dist/src/gateway/hono/routes/config.js +1 -2
  478. package/dist/src/gateway/hono/routes/connectors.js +2 -4
  479. package/dist/src/gateway/hono/routes/context-sources.js +1 -2
  480. package/dist/src/gateway/hono/routes/device-pairing-approval.js +2 -4
  481. package/dist/src/gateway/hono/routes/device-push.js +1 -2
  482. package/dist/src/gateway/hono/routes/devices.js +4 -8
  483. package/dist/src/gateway/hono/routes/discussions.js +1 -2
  484. package/dist/src/gateway/hono/routes/endpoint-tools.js +1 -2
  485. package/dist/src/gateway/hono/routes/home.js +1 -2
  486. package/dist/src/gateway/hono/routes/interaction-state.js +1 -2
  487. package/dist/src/gateway/hono/routes/memory-learning.js +1 -2
  488. package/dist/src/gateway/hono/routes/personal-agent.js +1 -2
  489. package/dist/src/gateway/hono/routes/phone-dependencies.js +1 -6
  490. package/dist/src/gateway/hono/routes/phone-setup.js +71 -2
  491. package/dist/src/gateway/hono/routes/phone-wireless.d.ts +4 -0
  492. package/dist/src/gateway/hono/routes/phone-wireless.js +63 -0
  493. package/dist/src/gateway/hono/routes/phone.js +116 -21
  494. package/dist/src/gateway/hono/routes/projects.js +1 -2
  495. package/dist/src/gateway/hono/routes/public-gateway.js +1 -2
  496. package/dist/src/gateway/hono/routes/sessions.js +2 -4
  497. package/dist/src/gateway/hono/routes/shares.js +2 -4
  498. package/dist/src/gateway/hono/routes/tasks.js +1 -2
  499. package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -2
  500. package/dist/src/gateway/hono/routes/user-model.js +1 -2
  501. package/dist/src/gateway/host.js +4 -9
  502. package/dist/src/gateway/index.js +2 -6
  503. package/dist/src/gateway/listen.js +1 -2
  504. package/dist/src/gateway/next-turn-suggestions/service.js +1 -2
  505. package/dist/src/gateway/next-turn-suggestions/snapshot.js +1 -2
  506. package/dist/src/gateway/rate-limit/auth-policy.js +11 -7
  507. package/dist/src/gateway/rate-limit/buckets.js +220 -211
  508. package/dist/src/gateway/rate-limit/env-flags.js +1 -4
  509. package/dist/src/gateway/rate-limit/index.js +4 -13
  510. package/dist/src/gateway/runtime-config.js +2 -4
  511. package/dist/src/gateway/security/audit.js +1 -2
  512. package/dist/src/gateway/security/browser-session.js +1 -2
  513. package/dist/src/gateway/security/device-request-proof.d.ts +1 -2
  514. package/dist/src/gateway/security/device-request-proof.js +2 -4
  515. package/dist/src/gateway/security/gateway-scopes.js +2 -6
  516. package/dist/src/gateway/security/index.js +1 -4
  517. package/dist/src/gateway/security/loopback.js +6 -7
  518. package/dist/src/gateway/service/agent-runner.js +2 -4
  519. package/dist/src/gateway/service/app-context-access.js +1 -2
  520. package/dist/src/gateway/service/config-coordinator.d.ts +2 -0
  521. package/dist/src/gateway/service/run-gateway-agent.js +2 -4
  522. package/dist/src/gateway/service/session-input-coordinator.js +3 -6
  523. package/dist/src/gateway/service.js +16 -19
  524. package/dist/src/gateway/session-context-summary.js +2 -4
  525. package/dist/src/gateway/tailscale-auth.js +1 -2
  526. package/dist/src/gateway/ws-security.js +1 -2
  527. package/dist/src/infra/rate-limit/failure-limiter.js +90 -78
  528. package/dist/src/infra/rate-limit/index.js +3 -11
  529. package/dist/src/infra/rate-limit/keyed-store.js +47 -52
  530. package/dist/src/infra/rate-limit/rate-limiter.js +58 -55
  531. package/dist/src/infra/update-service-refresh.js +1 -2
  532. package/dist/src/knowledge/chunks.js +1 -4
  533. package/dist/src/knowledge/connected-knowledge-pipeline.js +3 -6
  534. package/dist/src/knowledge/ingestion-service.js +1 -2
  535. package/dist/src/knowledge-memory/repository.js +1 -2
  536. package/dist/src/local-apps/store.js +1 -2
  537. package/dist/src/media/session-references.js +1 -2
  538. package/dist/src/memory-learning/forget-capture.js +1 -2
  539. package/dist/src/memory-learning/forgotten-history.js +3 -6
  540. package/dist/src/memory-learning/service.js +1 -2
  541. package/dist/src/memory-learning/source-learning.js +3 -3
  542. package/dist/src/memory-learning/task-receipts.js +1 -2
  543. package/dist/src/memory-learning/work-candidate.d.ts +29 -0
  544. package/dist/src/memory-learning/work-candidate.js +31 -0
  545. package/dist/src/memory-learning/work-capture.d.ts +2 -29
  546. package/dist/src/memory-learning/work-capture.js +2 -30
  547. package/dist/src/memory-maintenance/service.js +1 -2
  548. package/dist/src/notes/agent-context.js +1 -2
  549. package/dist/src/notes/attachment-ref.js +4 -8
  550. package/dist/src/notes/note-attachment-sync.js +1 -2
  551. package/dist/src/notes/note-index-meta.js +7 -14
  552. package/dist/src/notes/note-markdown.js +7 -13
  553. package/dist/src/notes/service.js +3 -6
  554. package/dist/src/notes/store.js +2 -4
  555. package/dist/src/notifications/clarification.js +1 -2
  556. package/dist/src/notifications/service.js +1 -2
  557. package/dist/src/personal-agent/proactivity/repository.js +1 -2
  558. package/dist/src/personal-agent/proactivity/service.js +1 -2
  559. package/dist/src/personal-agent/prompt-context.js +1 -2
  560. package/dist/src/personal-agent/reply-composer.js +4 -5
  561. package/dist/src/personal-agent/repository.js +1 -2
  562. package/dist/src/personal-agent/request-delivery.js +1 -2
  563. package/dist/src/personal-agent/result-extraction.js +71 -71
  564. package/dist/src/personal-agent/service.js +1 -2
  565. package/dist/src/phone/adb-command.d.ts +1 -0
  566. package/dist/src/phone/adb-command.js +12 -0
  567. package/dist/src/phone/adb-driver.d.ts +4 -2
  568. package/dist/src/phone/adb-driver.js +44 -38
  569. package/dist/src/phone/cloud-adb-connection.d.ts +34 -0
  570. package/dist/src/phone/cloud-adb-connection.js +324 -0
  571. package/dist/src/phone/cloud-adb-writable.d.ts +3 -0
  572. package/dist/src/phone/cloud-adb-writable.js +21 -0
  573. package/dist/src/phone/cloud-adb.d.ts +3 -32
  574. package/dist/src/phone/cloud-adb.js +3 -259
  575. package/dist/src/phone/cloud-key-permissions.d.ts +2 -0
  576. package/dist/src/phone/cloud-key-permissions.js +66 -0
  577. package/dist/src/phone/cloud-phones.js +2 -1
  578. package/dist/src/phone/cloud-scrcpy.d.ts +1 -1
  579. package/dist/src/phone/cloud-scrcpy.js +3 -2
  580. package/dist/src/phone/contracts.d.ts +157 -1
  581. package/dist/src/phone/contracts.js +41 -5
  582. package/dist/src/phone/foreground.d.ts +1 -0
  583. package/dist/src/phone/foreground.js +18 -0
  584. package/dist/src/phone/live-state.d.ts +2 -0
  585. package/dist/src/phone/live-state.js +5 -0
  586. package/dist/src/phone/model-adapter.d.ts +6 -2
  587. package/dist/src/phone/model-adapter.js +79 -64
  588. package/dist/src/phone/reliability.d.ts +2 -2
  589. package/dist/src/phone/reliability.js +19 -6
  590. package/dist/src/phone/repository.d.ts +3 -1
  591. package/dist/src/phone/repository.js +9 -1
  592. package/dist/src/phone/runtime.d.ts +79 -3
  593. package/dist/src/phone/runtime.js +631 -41
  594. package/dist/src/phone/scrcpy.js +3 -2
  595. package/dist/src/phone/setup/service.d.ts +20 -67
  596. package/dist/src/phone/setup/service.js +52 -7
  597. package/dist/src/phone/task-feedback.d.ts +4 -0
  598. package/dist/src/phone/task-feedback.js +47 -0
  599. package/dist/src/phone/ui-dump-binary.d.ts +1 -0
  600. package/dist/src/phone/ui-dump-binary.js +4 -0
  601. package/dist/src/phone/wireless.d.ts +80 -0
  602. package/dist/src/phone/wireless.js +244 -0
  603. package/dist/src/projects/capabilities/write.js +1 -2
  604. package/dist/src/projects/project-service.js +1 -2
  605. package/dist/src/projects/workspace.js +1 -2
  606. package/dist/src/realtime/runtime.d.ts +3 -0
  607. package/dist/src/realtime/runtime.js +15 -2
  608. package/dist/src/remote-access/exposure-guards.js +1 -2
  609. package/dist/src/runtime-tools/catalog.d.ts +1 -1
  610. package/dist/src/runtime-tools/catalog.js +2 -2
  611. package/dist/src/session/config-store.js +1 -2
  612. package/dist/src/session/init-session-turn.js +1 -2
  613. package/dist/src/session/resolve-session.js +1 -2
  614. package/dist/src/session/store.js +2 -4
  615. package/dist/src/share/share-rate-limit.js +1 -2
  616. package/dist/src/share/share-url.js +1 -2
  617. package/dist/src/share/site-share-router.js +1 -2
  618. package/dist/src/storage/sqlite/activity-repository.js +2 -6
  619. package/dist/src/storage/sqlite/browser-tab-binding-repository.js +2 -6
  620. package/dist/src/storage/sqlite/clarification-wait-repository.js +9 -14
  621. package/dist/src/storage/sqlite/collaboration-rule-repository.js +3 -8
  622. package/dist/src/storage/sqlite/composer-input-history-repository.js +3 -8
  623. package/dist/src/storage/sqlite/config-repository.js +5 -9
  624. package/dist/src/storage/sqlite/connector-learning-repository.js +2 -6
  625. package/dist/src/storage/sqlite/connector-sync-policy-repository.js +2 -6
  626. package/dist/src/storage/sqlite/context-evidence-repository.js +3 -8
  627. package/dist/src/storage/sqlite/context-extraction-repository.js +3 -8
  628. package/dist/src/storage/sqlite/device-access-repository.js +16 -23
  629. package/dist/src/storage/sqlite/device-pairing-approval.js +2 -6
  630. package/dist/src/storage/sqlite/device-pairing-repository.js +5 -10
  631. package/dist/src/storage/sqlite/endpoint-principal-repository.js +2 -6
  632. package/dist/src/storage/sqlite/endpoint-session-binding-repository.js +2 -6
  633. package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +2 -6
  634. package/dist/src/storage/sqlite/gateway-identity-repository.js +2 -6
  635. package/dist/src/storage/sqlite/home-attention-repository.js +2 -6
  636. package/dist/src/storage/sqlite/index.js +40 -72
  637. package/dist/src/storage/sqlite/interaction-state-repository.js +4 -10
  638. package/dist/src/storage/sqlite/knowledge-repository.js +3 -8
  639. package/dist/src/storage/sqlite/note-agent-context-repository.js +2 -6
  640. package/dist/src/storage/sqlite/notes-repository.js +4 -9
  641. package/dist/src/storage/sqlite/research-checkpoint-repository.js +3 -8
  642. package/dist/src/storage/sqlite/session-creation-repository.js +2 -4
  643. package/dist/src/storage/sqlite/session-task-plan-repository.js +9 -14
  644. package/dist/src/storage/sqlite/session-turn-replace-repository.js +5 -9
  645. package/dist/src/storage/sqlite/sidebar-layout-repository.js +9 -14
  646. package/dist/src/storage/sqlite/transcript-repository.js +6 -10
  647. package/dist/src/storage/sqlite/user-people-repository.js +3 -8
  648. package/dist/src/storage/sqlite/user-trust-repository.js +4 -9
  649. package/dist/src/tasks/execution-context.js +1 -2
  650. package/dist/src/tasks/home-query-service.js +1 -2
  651. package/dist/src/tasks/task-allocation-repository.js +1 -2
  652. package/dist/src/tasks/task-context-assembler.js +1 -2
  653. package/dist/src/tasks/task-handoff.js +2 -4
  654. package/dist/src/tasks/task-instruction-sequence.d.ts +1 -0
  655. package/dist/src/tasks/task-instruction-sequence.js +7 -0
  656. package/dist/src/tasks/task-language.js +1 -2
  657. package/dist/src/tasks/task-research-result.d.ts +1 -2
  658. package/dist/src/tasks/task-research-result.js +1 -3
  659. package/dist/src/tasks/task-result-delivery-repository.js +1 -1
  660. package/dist/src/tasks/task-result-delivery-service.js +3 -3
  661. package/dist/src/tasks/task-run-coordinator.js +3 -3
  662. package/dist/src/tasks/task-run-dispatcher.js +1 -2
  663. package/dist/src/tasks/task-value-metrics-service.js +1 -2
  664. package/dist/src/tui/backends/embedded-backend.js +1 -2
  665. package/dist/src/tui/tui-commands.js +1 -2
  666. package/dist/src/tunnel/registration-proof.js +1 -2
  667. package/dist/src/tunnel/tunnel-rate-limit.js +1 -2
  668. package/dist/src/user-context/access-policy.js +1 -2
  669. package/dist/src/user-context/domain.js +13 -18
  670. package/dist/src/user-context/extraction/registry.js +1 -2
  671. package/dist/src/user-context/interaction-state.js +1 -4
  672. package/dist/src/user-context/relationship-continuity.js +1 -2
  673. package/dist/src/user-context/sources/consent-repository.js +1 -2
  674. package/dist/src/user-context/trust-policy.js +8 -13
  675. package/dist/src/user-model/action-rule-suggestions.js +1 -2
  676. package/dist/src/user-model/bootstrap.js +1 -2
  677. package/dist/src/user-model/capture/executor.js +2 -4
  678. package/dist/src/user-model/capture/semantic.d.ts +1 -1
  679. package/dist/src/user-model/capture/semantic.js +1 -1
  680. package/dist/src/user-model/domain.js +30 -35
  681. package/dist/src/user-model/goals.js +1 -2
  682. package/dist/src/user-model/index.js +1 -4
  683. package/dist/src/user-model/observation-repository.js +1 -2
  684. package/dist/src/user-model/repository.js +1 -2
  685. package/dist/src/user-model/usage-policy.js +1 -2
  686. package/dist/src/voice/realtime/memory-context.js +1 -2
  687. package/dist/src/work-discovery/service.js +2 -4
  688. package/package.json +5 -5
  689. package/skills/tools/configure-xopc/SKILL.md +10 -3
  690. package/skills/tools/configure-xopc/references/browser/acceptance.md +4 -3
  691. package/skills/tools/configure-xopc/references/browser/chrome-extension.md +19 -15
  692. package/skills/tools/configure-xopc/references/browser/overview.md +14 -17
  693. package/skills/tools/configure-xopc/references/browser/permissions.md +3 -5
  694. package/skills/tools/configure-xopc/references/browser/troubleshooting.md +2 -2
  695. package/skills/tools/configure-xopc/references/phone/acceptance.md +5 -3
  696. package/skills/tools/configure-xopc/references/phone/dependencies.md +4 -4
  697. package/skills/tools/configure-xopc/references/phone/local.md +5 -5
  698. package/skills/tools/configure-xopc/references/phone/models.md +17 -14
  699. package/skills/tools/configure-xopc/references/phone/overview.md +20 -25
  700. package/skills/tools/configure-xopc/references/phone/troubleshooting.md +3 -0
  701. package/dist/gateway/static/root/assets/agent-avatar-dicebear-CufU7cqe.js +0 -1
  702. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DHDAcss8.js +0 -1
  703. package/dist/gateway/static/root/assets/agents-BV3dAoa0.js +0 -77
  704. package/dist/gateway/static/root/assets/app-management-settings-panel-D4-n1uBg.js +0 -1
  705. package/dist/gateway/static/root/assets/appearance-settings-Cgn4eNsX.js +0 -1
  706. package/dist/gateway/static/root/assets/apps-page-BOYzD7Zz.js +0 -1
  707. package/dist/gateway/static/root/assets/automation-display-BFN7zWBg.js +0 -2
  708. package/dist/gateway/static/root/assets/automations-workspace-J7LJ4RuV.js +0 -8
  709. package/dist/gateway/static/root/assets/browser-automations-page-BiQz6lJA.js +0 -3
  710. package/dist/gateway/static/root/assets/browser-settings-page-W9kuxBbE.js +0 -3
  711. package/dist/gateway/static/root/assets/capabilities-BlxF36t-.js +0 -1
  712. package/dist/gateway/static/root/assets/capabilities-page-iXe87MdG.js +0 -2
  713. package/dist/gateway/static/root/assets/capabilities-settings-panel-CRLSXe7Z.js +0 -8
  714. package/dist/gateway/static/root/assets/capability-header-actions-BMnbzHms.js +0 -1
  715. package/dist/gateway/static/root/assets/channels-CrRJkOKX.js +0 -1
  716. package/dist/gateway/static/root/assets/chat-terminal-dock-Bd3af4gL.js +0 -36
  717. package/dist/gateway/static/root/assets/chunk-KS7C4IRE-BvcCCgTW.js +0 -4
  718. package/dist/gateway/static/root/assets/cloud-credits-BMYMiiNn.js +0 -1
  719. package/dist/gateway/static/root/assets/computer-settings-page-DXfqy7xh.js +0 -1
  720. package/dist/gateway/static/root/assets/connector-service-page-B-cw0CPU.js +0 -1
  721. package/dist/gateway/static/root/assets/connectors-page-DbFxc0Fd.js +0 -1
  722. package/dist/gateway/static/root/assets/constants-DeXt1mV-.js +0 -1
  723. package/dist/gateway/static/root/assets/date-picker-CqzXevH6.js +0 -1
  724. package/dist/gateway/static/root/assets/dependency-picker-pgT4Gyaf.js +0 -1
  725. package/dist/gateway/static/root/assets/desktop-pet-settings-Dy_-i2L8.js +0 -1
  726. package/dist/gateway/static/root/assets/desktop-pet-zICeqw9c.js +0 -1
  727. package/dist/gateway/static/root/assets/device-pairing-wizard-ByGbxqkg.js +0 -1
  728. package/dist/gateway/static/root/assets/directory-picker-path-field-C-aQ7qoM.js +0 -1
  729. package/dist/gateway/static/root/assets/dist-C3DSFZCi.js +0 -1
  730. package/dist/gateway/static/root/assets/dist-CI_fqRk-.js +0 -1
  731. package/dist/gateway/static/root/assets/docx-preview-CajIk2FR.js +0 -20
  732. package/dist/gateway/static/root/assets/echarts-runtime-tcHc9TOS.js +0 -18
  733. package/dist/gateway/static/root/assets/electron-env-Dit0bHgy.js +0 -1
  734. package/dist/gateway/static/root/assets/extension-debug-page-2NwpYkS5.js +0 -1
  735. package/dist/gateway/static/root/assets/extension-page-y9J0z7_Q.js +0 -1
  736. package/dist/gateway/static/root/assets/extension-settings-page-BtowusUh.js +0 -1
  737. package/dist/gateway/static/root/assets/files-Bw4SBGdM.js +0 -1
  738. package/dist/gateway/static/root/assets/floating-ui.dom-B7uQOZZW.js +0 -1
  739. package/dist/gateway/static/root/assets/gateway-realtime-C52ghnBK.js +0 -1
  740. package/dist/gateway/static/root/assets/gateway-realtime-store-Bx9KCID-.js +0 -1
  741. package/dist/gateway/static/root/assets/gateway-settings-BYSKzUMR.js +0 -1
  742. package/dist/gateway/static/root/assets/highlight-code-Cz6eeDH5.js +0 -1
  743. package/dist/gateway/static/root/assets/highlighted-body-KQOG7T2V-BiAa8HKC.js +0 -1
  744. package/dist/gateway/static/root/assets/home-page-Cd1BjYHj.js +0 -2
  745. package/dist/gateway/static/root/assets/image-generation-api-gBFro48x.js +0 -1
  746. package/dist/gateway/static/root/assets/imports-page-BZQpXgjj.js +0 -1
  747. package/dist/gateway/static/root/assets/index-Cy16gQST.css +0 -1
  748. package/dist/gateway/static/root/assets/index-DRyGCING.js +0 -710
  749. package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-CYunR34k.js +0 -1
  750. package/dist/gateway/static/root/assets/languages-byq_L2Ae.js +0 -2
  751. package/dist/gateway/static/root/assets/local-app-workbench-page-B_Ac1lly.js +0 -1
  752. package/dist/gateway/static/root/assets/local-apps-page-w-J5bY02.js +0 -1
  753. package/dist/gateway/static/root/assets/local-apps-yys1VChX.js +0 -1
  754. package/dist/gateway/static/root/assets/local-session-drafts-iGX_6O0O.js +0 -1
  755. package/dist/gateway/static/root/assets/logs-page-Dnjvvx2i.js +0 -2
  756. package/dist/gateway/static/root/assets/management-settings-w1EDwgLW.js +0 -1
  757. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-DISkHmEC.js +0 -1
  758. package/dist/gateway/static/root/assets/note-detail-panel-CNkxMTFU.js +0 -5
  759. package/dist/gateway/static/root/assets/note-image-lightbox-D5GH2wuC.js +0 -1
  760. package/dist/gateway/static/root/assets/notes-page-DZgKqFBG.js +0 -8
  761. package/dist/gateway/static/root/assets/number-input-DDeqHK-G.js +0 -1
  762. package/dist/gateway/static/root/assets/page-context-capture-button-DusR2Itk.js +0 -1
  763. package/dist/gateway/static/root/assets/pdf-runtime-DU_sMPjG.js +0 -2
  764. package/dist/gateway/static/root/assets/personal-page-CR5JFkQ9.js +0 -1
  765. package/dist/gateway/static/root/assets/personal-proactivity-BJcZ3Yhi.js +0 -1
  766. package/dist/gateway/static/root/assets/personal-settings-panel-B7undvlr.js +0 -1
  767. package/dist/gateway/static/root/assets/phone-model-picker-fWDltRUJ.js +0 -1
  768. package/dist/gateway/static/root/assets/phone-settings-page-CsOirAiy.js +0 -1
  769. package/dist/gateway/static/root/assets/plugin-details-dialog-BOBVIB3j.js +0 -1
  770. package/dist/gateway/static/root/assets/popover-select-DGKUpVsz.js +0 -1
  771. package/dist/gateway/static/root/assets/preload-helper-zJ_50EbN.js +0 -1
  772. package/dist/gateway/static/root/assets/preview-open-alternatives-CMxjsKSw.js +0 -1
  773. package/dist/gateway/static/root/assets/product-delivery-BqNm-8S5.js +0 -1
  774. package/dist/gateway/static/root/assets/product-open-page-CrlyJx5M.js +0 -1
  775. package/dist/gateway/static/root/assets/product-preview-content-B-Jhzi7W.js +0 -1
  776. package/dist/gateway/static/root/assets/project-detail-page-DoYUbtcI.js +0 -7
  777. package/dist/gateway/static/root/assets/projects-page-xGQd9oAZ.js +0 -1
  778. package/dist/gateway/static/root/assets/remote-access-hub-Gs0Xkws9.js +0 -1
  779. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-Bwg7U7TR.js +0 -1
  780. package/dist/gateway/static/root/assets/schema-form-ByzTNR_C.js +0 -1
  781. package/dist/gateway/static/root/assets/schemas-CObaziC7.js +0 -64
  782. package/dist/gateway/static/root/assets/session-manager-B_h0jlLb.js +0 -16
  783. package/dist/gateway/static/root/assets/sessions-page-XzK1ftbR.js +0 -1
  784. package/dist/gateway/static/root/assets/settings-advanced-gate-D_8Mvnog.js +0 -1
  785. package/dist/gateway/static/root/assets/settings-form-section-Brgd8IOV.js +0 -1
  786. package/dist/gateway/static/root/assets/settings-page-B6Mv02eg.js +0 -1
  787. package/dist/gateway/static/root/assets/settings-page-header-BWyxJKOG.js +0 -1
  788. package/dist/gateway/static/root/assets/settings-page-layout-DLHcS-0T.js +0 -1
  789. package/dist/gateway/static/root/assets/setup-status-panel-DSCj5yis.js +0 -1
  790. package/dist/gateway/static/root/assets/share-preview-page-DF8Of0aZ.js +0 -2
  791. package/dist/gateway/static/root/assets/shares-settings-DXNPe4Tl.js +0 -1
  792. package/dist/gateway/static/root/assets/skill-api-CKCDCHLq.js +0 -1
  793. package/dist/gateway/static/root/assets/skill-reload-api-BH0WF6Br.js +0 -1
  794. package/dist/gateway/static/root/assets/skills-page-DFWMVRW4.js +0 -2
  795. package/dist/gateway/static/root/assets/specialists-4bkS5rZ4.js +0 -1
  796. package/dist/gateway/static/root/assets/system-settings-panel-DB-ttubV.js +0 -1
  797. package/dist/gateway/static/root/assets/task-detail-page-BJY7c8wb.js +0 -2
  798. package/dist/gateway/static/root/assets/task-result-evidence-B-vt1BgK.js +0 -1
  799. package/dist/gateway/static/root/assets/tasks-TVRjEggr.js +0 -1
  800. package/dist/gateway/static/root/assets/tracing-settings-page-Dt51Z_ws.js +0 -1
  801. package/dist/gateway/static/root/assets/tunnel-api-Dok3t7Qe.js +0 -1
  802. package/dist/gateway/static/root/assets/usage-page-lJym5G7F.js +0 -1
  803. package/dist/gateway/static/root/assets/use-autosave-D4EMIB-V.js +0 -1
  804. package/dist/gateway/static/root/assets/user-model-page-BXdNkITp.js +0 -2
  805. package/dist/gateway/static/root/assets/voice-api-key-field-CO3KuanA.js +0 -1
  806. package/dist/gateway/static/root/assets/work-discovery-overlay-BJRtgQM3.js +0 -1
  807. package/dist/gateway/static/root/assets/xopc-cloud-account-card-CS-_GxHV.js +0 -1
@@ -1,8 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i,t as a,u as o}from"./chunk-KS7C4IRE-BvcCCgTW.js";import{t as s}from"./check-DUBLcKHA.js";import{t as c}from"./chevron-down-ccbiQQz_.js";import{c as l,l as u,n as d,r as f,u as p}from"./popover-select-DGKUpVsz.js";import{t as m}from"./circle-check-C23XjkUj.js";import{t as h}from"./ellipsis-0k4rZLoy.js";import{t as g}from"./eye-CABVeTq0.js";import{t as _}from"./refresh-cw-BRlGaq2w.js";import{t as v}from"./messages-BYq0cPbn.js";import{t as y}from"./cn-0WouolD0.js";import{a as b,i as x,n as S}from"./locale-store-B7s2Hb35.js";import{i as C}from"./vendor-swr-BIWyz7Rc.js";import{t as w}from"./button-aIC072nz.js";import{t as T}from"./skeleton-BI5TyibZ.js";import{a as E,c as D,i as O,o as k,s as A}from"./dist-C3DSFZCi.js";import{$d as j,$l as M,Bc as N,Cl as P,El as F,Fd as ee,Ga as I,Gc as L,Kl as te,Md as ne,Ml as re,Nn as ie,Ra as ae,Sa as oe,Su as R,Uc as se,Vc as ce,Wc as le,Wl as z,Xc as B,Xu as ue,Zc as de,Zl as fe,c as V,ca as H,co as U,da as W,fc as G,gu as pe,ia as me,jd as he,la as ge,pa as _e,si as K,sl as ve,ua as ye,xd as be,xl as xe,yl as Se,zc as Ce}from"./index-DRyGCING.js";import{a as we,c as Te,i as Ee,l as De,n as Oe,o as q,r as ke,s as Ae,t as J}from"./automation-display-BFN7zWBg.js";import{i as je,n as Me,r as Ne,t as Pe}from"./browser-automation-inputs-D6AccXaA.js";var Fe=n(),Y=e(t(),1),X=r(),Ie=Array.from({length:24},(e,t)=>t);function Le(e){let t=/^(\d{2}):(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return n>23||r>59?null:{hour:n,minute:r}}function Re(){let e=new Date;return{hour:e.getHours(),minute:e.getMinutes()}}function ze(e,t){return`${String(e).padStart(2,`0`)}:${String(t).padStart(2,`0`)}`}function Be(e){let t=(0,Fe.c)(80),{value:n,onChange:r,disabled:i,allowEmpty:a,clearLabel:o,ariaLabel:c,ariaLabelledBy:d,className:f,triggerClassName:m,id:h,name:g,minuteStep:_}=e,v=a===void 0?!1:a,b=_===void 0?1:_,x=Le(n),S=x??Re(),[C,w]=(0,Y.useState)(!1),[T,E]=(0,Y.useState)(null),[O,k]=(0,Y.useState)(S.hour),[j,M]=(0,Y.useState)(S.minute),N=(0,Y.useRef)([]),P=(0,Y.useRef)([]),F=u(),ee=l(T),I=p(F,ee!==null),L=Math.max(1,Math.min(60,Math.round(b))),te=Array.from({length:Math.ceil(60/L)},(e,t)=>t*L).filter(He),ne;t[0]===r?ne=t[1]:(ne=(e,t,n)=>{let i=n===void 0?!1:n;k(e),M(t),r(ze(e,t)),i&&w(!1)},t[0]=r,t[1]=ne);let re=ne,ie=Ve,ae;t[2]===f?ae=t[3]:(ae=y(`relative min-w-0`,f),t[2]=f,t[3]=ae);let oe=D,R;t[4]===n?R=t[5]:(R=e=>{if(e){let e=Le(n)??Re();k(e.hour),M(e.minute)}w(e)},t[4]=n,t[5]=R);let se=v&&n&&`pr-9`,ce=i&&`cursor-not-allowed opacity-50 hover:border-edge`,le;t[6]!==se||t[7]!==ce||t[8]!==m?(le=y(`box-border flex h-10 w-full min-w-0 items-center gap-2 rounded-lg border border-edge bg-surface-panel px-3 text-left text-sm text-fg`,`transition-colors hover:border-edge-strong focus-visible:border-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/20`,se,ce,m),t[6]=se,t[7]=ce,t[8]=m,t[9]=le):le=t[9];let z;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,X.jsx)(be,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`}),t[10]=z):z=t[10];let B=!x&&`text-fg-subtle`,ue;t[11]===B?ue=t[12]:(ue=y(`tabular-nums`,B),t[11]=B,t[12]=ue);let fe=x?ze(x.hour,x.minute):`--:--`,V;t[13]!==ue||t[14]!==fe?(V=(0,X.jsx)(`span`,{className:ue,children:fe}),t[13]=ue,t[14]=fe,t[15]=V):V=t[15];let H;t[16]!==c||t[17]!==d||t[18]!==i||t[19]!==h||t[20]!==V||t[21]!==le?(H=(0,X.jsx)(A,{asChild:!0,children:(0,X.jsxs)(`button`,{ref:E,id:h,type:`button`,disabled:i,"aria-label":c,"aria-labelledby":d,"aria-haspopup":`listbox`,className:le,children:[z,V]})}),t[16]=c,t[17]=d,t[18]=i,t[19]=h,t[20]=V,t[21]=le,t[22]=H):H=t[22];let U=D,W=ee??void 0,G=D,pe=y(I,`w-[18rem] overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`),me=e=>{e.preventDefault(),requestAnimationFrame(()=>N.current[O]?.focus())},he;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,X.jsx)(be,{className:`size-3.5`,"aria-hidden":`true`}),t[23]=he):he=t[23];let ge=c??`HH:mm`,_e;t[24]===ge?_e=t[25]:(_e=(0,X.jsxs)(`span`,{className:`flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[he,ge]}),t[24]=ge,t[25]=_e);let K;t[26]!==O||t[27]!==j?(K=ze(O,j),t[26]=O,t[27]=j,t[28]=K):K=t[28];let ve;t[29]===K?ve=t[30]:(ve=(0,X.jsx)(`span`,{className:`font-mono text-base font-semibold tabular-nums text-fg`,children:K}),t[29]=K,t[30]=ve);let ye;t[31]!==_e||t[32]!==ve?(ye=(0,X.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle bg-surface-inset px-3 py-2.5`,children:[_e,ve]}),t[31]=_e,t[32]=ve,t[33]=ye):ye=t[33];let xe;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,X.jsx)(`div`,{className:`px-1 pb-1.5 text-[11px] font-semibold tracking-wider text-fg-subtle`,children:`HH`}),t[34]=xe):xe=t[34];let Se=`${c??`HH:mm`} HH`,Ce=Ie.map((e,t)=>(0,X.jsx)(`button`,{ref:e=>{N.current[t]=e},type:`button`,role:`option`,"aria-selected":O===e,tabIndex:O===e?0:-1,className:y(`relative flex h-8 items-center justify-center rounded-md text-xs tabular-nums text-fg-muted transition-colors`,`hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/30`,O===e&&`bg-accent-soft font-semibold text-accent-fg`),onClick:()=>re(e,j),onKeyDown:e=>ie(e,Ie,O,e=>re(e,j),N),children:String(e).padStart(2,`0`)},e)),we;t[35]!==Se||t[36]!==Ce?(we=(0,X.jsxs)(`div`,{className:`pr-2`,children:[xe,(0,X.jsx)(`div`,{role:`listbox`,"aria-label":Se,className:`grid max-h-56 grid-cols-3 gap-1 overflow-y-auto pr-1`,children:Ce})]}),t[35]=Se,t[36]=Ce,t[37]=we):we=t[37];let Te;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,X.jsx)(`div`,{className:`px-1 pb-1.5 text-[11px] font-semibold tracking-wider text-fg-subtle`,children:`MM`}),t[38]=Te):Te=t[38];let Ee=`${c??`HH:mm`} MM`,De=te.map((e,t)=>(0,X.jsxs)(`button`,{ref:e=>{P.current[t]=e},type:`button`,role:`option`,"aria-selected":j===e,tabIndex:j===e?0:-1,className:y(`relative flex h-8 items-center justify-center rounded-md text-xs tabular-nums text-fg-muted transition-colors`,`hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/30`,j===e&&`bg-accent-soft font-semibold text-accent-fg`),onClick:()=>re(O,e,!0),onKeyDown:e=>ie(e,te,j,e=>re(O,e),P),children:[(0,X.jsx)(s,{className:y(`absolute left-0.5 size-3`,j!==e&&`invisible`),"aria-hidden":`true`}),String(e).padStart(2,`0`)]},e)),Oe;t[39]!==Ee||t[40]!==De?(Oe=(0,X.jsx)(`div`,{role:`listbox`,"aria-label":Ee,className:`grid max-h-56 grid-cols-3 gap-1 overflow-y-auto pr-1`,children:De}),t[39]=Ee,t[40]=De,t[41]=Oe):Oe=t[41];let q;t[42]!==Te||t[43]!==Oe?(q=(0,X.jsxs)(`div`,{className:`pl-2`,children:[Te,Oe]}),t[42]=Te,t[43]=Oe,t[44]=q):q=t[44];let ke;t[45]!==we||t[46]!==q?(ke=(0,X.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-edge-subtle p-2`,children:[we,q]}),t[45]=we,t[46]=q,t[47]=ke):ke=t[47];let Ae;t[48]!==G.Content||t[49]!==pe||t[50]!==me||t[51]!==ye||t[52]!==ke?(Ae=(0,X.jsxs)(G.Content,{side:`bottom`,align:`start`,sideOffset:6,collisionPadding:12,className:pe,onOpenAutoFocus:me,children:[ye,ke]}),t[48]=G.Content,t[49]=pe,t[50]=me,t[51]=ye,t[52]=ke,t[53]=Ae):Ae=t[53];let J;t[54]!==U.Portal||t[55]!==W||t[56]!==Ae?(J=(0,X.jsx)(U.Portal,{container:W,children:Ae}),t[54]=U.Portal,t[55]=W,t[56]=Ae,t[57]=J):J=t[57];let je;t[58]!==C||t[59]!==H||t[60]!==J||t[61]!==oe.Root||t[62]!==R?(je=(0,X.jsxs)(oe.Root,{open:C,onOpenChange:R,children:[H,J]}),t[58]=C,t[59]=H,t[60]=J,t[61]=oe.Root,t[62]=R,t[63]=je):je=t[63];let Me;t[64]!==v||t[65]!==c||t[66]!==o||t[67]!==i||t[68]!==r||t[69]!==n?(Me=v&&n?(0,X.jsx)(`button`,{type:`button`,disabled:i,"aria-label":o??c,title:o,className:`absolute right-1.5 top-1/2 flex size-7 -translate-y-1/2 items-center justify-center rounded-md text-fg-subtle hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/30 disabled:pointer-events-none`,onClick:()=>r(``),children:(0,X.jsx)(de,{className:`size-3.5`,"aria-hidden":`true`})}):null,t[64]=v,t[65]=c,t[66]=o,t[67]=i,t[68]=r,t[69]=n,t[70]=Me):Me=t[70];let Ne;t[71]!==i||t[72]!==g||t[73]!==n?(Ne=g?(0,X.jsx)(`input`,{type:`hidden`,name:g,value:n,disabled:i}):null,t[71]=i,t[72]=g,t[73]=n,t[74]=Ne):Ne=t[74];let Pe;return t[75]!==ae||t[76]!==je||t[77]!==Me||t[78]!==Ne?(Pe=(0,X.jsxs)(`div`,{className:ae,children:[je,Me,Ne]}),t[75]=ae,t[76]=je,t[77]=Me,t[78]=Ne,t[79]=Pe):Pe=t[79],Pe}function Ve(e,t,n,r,i){let a=null,o=Math.max(0,t.indexOf(n));if((e.key===`ArrowDown`||e.key===`ArrowRight`)&&(a=(o+1)%t.length),(e.key===`ArrowUp`||e.key===`ArrowLeft`)&&(a=(o-1+t.length)%t.length),e.key===`Home`&&(a=0),e.key===`End`&&(a=t.length-1),a===null)return;e.preventDefault();let s=t[a];r(s),i.current?.[a]?.focus()}function He(e){return e<60}function Ue(e){if(!e.trim())return null;try{return JSON.parse(e)}catch{return null}}function We(e){return typeof e.message==`string`&&e.message.trim()?e.message:typeof e.error==`string`&&e.error.trim()?e.error:e.error&&typeof e.error==`object`&&typeof e.error.message==`string`?e.error.message:`AI suggestion failed`}function Ge(e,t={}){let n=Ue(e.split(`
2
- `).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trimStart()).join(`
3
- `));if(!n)return null;if(n.type===`text_delta`&&typeof n.delta==`string`)return t.onDelta?.(n.delta),null;if(n.type===`thinking_delta`&&typeof n.delta==`string`)return t.onThinkingDelta?.(n.delta),null;if(n.type===`done`&&typeof n.text==`string`)return n.text;if(n.type===`error`)throw Error(We(n));return null}async function Ke(e,t={}){let n=await b(x(`/api/ai/text-assist`),{method:`POST`,headers:{Accept:`text/event-stream`},body:JSON.stringify(e)});if(!n.ok){let e=await n.json().catch(()=>({})),t=typeof e.error==`string`?e.error:e.error?.message;throw Error(t||`AI suggestion failed (${n.status})`)}if(!n.body){let e=await n.json().catch(()=>null);if(e?.text)return e;throw Error(`AI suggestion stream is empty`)}let r=n.body.getReader(),i=new TextDecoder,a=``,o=``,s=``;for(;;){let{done:e,value:n}=await r.read();if(n){a+=i.decode(n,{stream:!e});let r=a.split(/\r?\n\r?\n/);a=r.pop()??``;for(let e of r){let n=Ge(e,{onDelta:e=>{o+=e,t.onDelta?.(e)},onThinkingDelta:e=>{s+=e,t.onThinkingDelta?.(e)}});n!==null&&(o=n)}}if(e)break}if(a.trim()){let e=Ge(a,{onDelta:e=>{o+=e,t.onDelta?.(e)},onThinkingDelta:e=>{s+=e,t.onThinkingDelta?.(e)}});e!==null&&(o=e)}let c=o.trim();if(!c)throw Error(`AI returned an empty suggestion`);return{text:c,thinking:s.trim()||void 0}}function Z(){let[e,t]=(0,Y.useState)(``),[n,r]=(0,Y.useState)(``),[i,a]=(0,Y.useState)(!1),[o,s]=(0,Y.useState)(null);return{suggestion:e,thinking:n,loading:i,error:o,generate:(0,Y.useCallback)(async e=>{a(!0),s(null),t(``),r(``);try{let n=await Ke(e,{onDelta:e=>{t(t=>t+e)},onThinkingDelta:e=>{r(t=>t+e)}});return t(n.text),r(n.thinking??``),n.text}catch(e){return s(e instanceof Error?e.message:`AI suggestion failed`),null}finally{a(!1)}},[]),reset:(0,Y.useCallback)(()=>{t(``),r(``),s(null),a(!1)},[])}}var qe=5;function Je(e){return e.startsWith(`zh`)?{title:`AI 优化文案`,buttonTitle:`优化文案`,current:`当前内容`,suggestion:`AI 建议`,editedSuggestion:`审核并编辑建议`,thinking:`模型思考`,thinkingLoading:`思考中`,edit:`编辑`,preview:`预览`,loading:`正在生成建议...`,empty:`暂无内容`,generate:`生成建议`,regenerate:`重新生成`,applyCurrent:`应用当前内容`,replace:`替换`,append:`追加`,cancel:`取消`,close:`关闭`}:{title:`AI text assist`,buttonTitle:`Improve text`,current:`Current`,suggestion:`Suggestion`,editedSuggestion:`Review and edit suggestion`,thinking:`Model thinking`,thinkingLoading:`Thinking`,edit:`Edit`,preview:`Preview`,loading:`Generating suggestion...`,empty:`No content`,generate:`Generate suggestion`,regenerate:`Regenerate`,applyCurrent:`Apply current`,replace:`Replace`,append:`Append`,cancel:`Cancel`,close:`Close`}}function Ye(e){let t=(0,Fe.c)(245),{value:n,onApply:r,fieldId:i,fieldLabel:a,scenario:o,format:s,intent:l,locale:u,context:d,disabled:f,className:p,showLabel:m}=e,h=o===void 0?`generic.text`:o,v=s===void 0?`plain`:s,b=l===void 0?`improve`:l,x=m===void 0?!0:m,[S,C]=(0,Y.useState)(!1),[T,E]=(0,Y.useState)(n),[D,O]=(0,Y.useState)(`preview`),[k,A]=(0,Y.useState)(``),[j,M]=(0,Y.useState)(`edit`),[P,F]=(0,Y.useState)(!0),[ee,te]=(0,Y.useState)(!1),[ne,re]=(0,Y.useState)(null),ie=(0,Y.useRef)(null),ae=(0,Y.useRef)(!0),{suggestion:oe,thinking:R,loading:z,error:B,generate:ue,reset:fe}=Z(),V;t[0]===u?V=t[1]:(V=Je(u),t[0]=u,t[1]=V);let H=V,U;t[2]!==z||t[3]!==R?(U=z&&R.trim().length>0,t[2]=z,t[3]=R,t[4]=U):U=t[4];let W=U,pe,me;t[5]!==S||t[6]!==n?(pe=()=>{S||E(n)},me=[S,n],t[5]=S,t[6]=n,t[7]=pe,t[8]=me):(pe=t[7],me=t[8]),(0,Y.useEffect)(pe,me);let he,ge;t[9]===oe?(he=t[10],ge=t[11]):(ge=()=>{A(oe)},he=[oe],t[9]=oe,t[10]=he,t[11]=ge),(0,Y.useEffect)(ge,he);let _e,K;t[12]===R?(_e=t[13],K=t[14]):(_e=()=>{R.trim()&&F(!0)},K=[R],t[12]=R,t[13]=_e,t[14]=K),(0,Y.useEffect)(_e,K);let ve;t[15]!==W||t[16]!==P?(ve=()=>{let e=ie.current;!e||!W||!P||ae.current&&(e.scrollTop=e.scrollHeight)},t[15]=W,t[16]=P,t[17]=ve):ve=t[17];let ye;t[18]!==W||t[19]!==R||t[20]!==P?(ye=[W,R,P],t[18]=W,t[19]=R,t[20]=P,t[21]=ye):ye=t[21],(0,Y.useLayoutEffect)(ve,ye);let be;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(be=()=>{let e=ie.current;e&&(ae.current=e.scrollHeight-e.scrollTop-e.clientHeight<=qe)},t[22]=be):be=t[22];let we=be,Te;t[23]!==d||t[24]!==i||t[25]!==a||t[26]!==v||t[27]!==ue||t[28]!==b||t[29]!==u||t[30]!==h?(Te=async e=>{M(`edit`),F(!0),ae.current=!0,await ue({intent:b,scenario:h,input:e,locale:u,field:{id:i,label:a,format:v},context:d})},t[23]=d,t[24]=i,t[25]=a,t[26]=v,t[27]=ue,t[28]=b,t[29]=u,t[30]=h,t[31]=Te):Te=t[31];let Ee=Te,De;t[32]!==fe||t[33]!==n?(De=e=>{te(!!e.currentTarget.closest(`[role="dialog"]`)),re(document.querySelector(`.app-main-surface`)),E(n),O(`preview`),A(``),M(`edit`),F(!0),fe(),C(!0)},t[32]=fe,t[33]=n,t[34]=De):De=t[34];let Oe=De,q;t[35]!==T||t[36]!==Ee?(q=async()=>{await Ee(T)},t[35]=T,t[36]=Ee,t[37]=q):q=t[37];let ke=q,Ae;t[38]!==fe||t[39]!==n?(Ae=()=>{C(!1),E(n),O(`preview`),A(``),M(`edit`),F(!0),fe()},t[38]=fe,t[39]=n,t[40]=Ae):Ae=t[40];let J=Ae,je;t[41]!==J||t[42]!==T||t[43]!==r?(je=()=>{r(T),J()},t[41]=J,t[42]=T,t[43]=r,t[44]=je):je=t[44];let Me=je,Ne;t[45]!==J||t[46]!==k||t[47]!==r?(Ne=()=>{k.trim()&&(r(k),J())},t[45]=J,t[46]=k,t[47]=r,t[48]=Ne):Ne=t[48];let Pe=Ne,Ie;t[49]!==J||t[50]!==T||t[51]!==k||t[52]!==r?(Ie=()=>{if(!k.trim())return;let e=T.trimEnd();r(e?`${e}\n\n${k}`:k),J()},t[49]=J,t[50]=T,t[51]=k,t[52]=r,t[53]=Ie):Ie=t[53];let Le=Ie,Re;t[54]!==k||t[55]!==B||t[56]!==z?(Re=!z&&!B&&k.trim().length>0,t[54]=k,t[55]=B,t[56]=z,t[57]=Re):Re=t[57];let ze=Re,Be=T!==n,Ve;t[58]!==k||t[59]!==B||t[60]!==R?(Ve=k.trim().length>0||R.trim().length>0||!!B,t[58]=k,t[59]=B,t[60]=R,t[61]=Ve):Ve=t[61];let He=Ve,Ue=!x&&`size-7 p-0`,We;t[62]!==p||t[63]!==Ue?(We=y(`h-7 gap-1 px-2 text-xs`,Ue,p),t[62]=p,t[63]=Ue,t[64]=We):We=t[64];let Ge=f||z,Ke;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=(0,X.jsx)(xe,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[65]=Ke):Ke=t[65];let Ye=x?H.buttonTitle:null,Qe;t[66]!==H.buttonTitle||t[67]!==Oe||t[68]!==We||t[69]!==Ge||t[70]!==Ye?(Qe=(0,X.jsxs)(w,{type:`button`,variant:`ghost`,className:We,title:H.buttonTitle,"aria-label":H.buttonTitle,disabled:Ge,onClick:Oe,children:[Ke,Ye]}),t[66]=H.buttonTitle,t[67]=Oe,t[68]=We,t[69]=Ge,t[70]=Ye,t[71]=Qe):Qe=t[71];let $e;t[72]===J?$e=t[73]:($e=e=>e?C(!0):J(),t[72]=J,t[73]=$e);let et=ne??void 0,tt=ee?`bg-transparent`:`bg-scrim`,nt;t[74]===tt?nt=t[75]:(nt=y(`xopc-dialog-overlay absolute inset-0 z-[80]`,tt),t[74]=tt,t[75]=nt);let rt;t[76]===nt?rt=t[77]:(rt=(0,X.jsx)(se,{className:nt}),t[76]=nt,t[77]=rt);let it;t[78]===H.title?it=t[79]:(it=(0,X.jsx)(L,{className:`text-base font-semibold text-fg`,children:H.title}),t[78]=H.title,t[79]=it);let at;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,X.jsx)(de,{className:`size-5`,strokeWidth:1.75}),t[80]=at):at=t[80];let ot;t[81]===H.close?ot=t[82]:(ot=(0,X.jsx)(N,{asChild:!0,children:(0,X.jsx)(w,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":H.close,children:at})}),t[81]=H.close,t[82]=ot);let st;t[83]!==it||t[84]!==ot?(st=(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[it,ot]}),t[83]=it,t[84]=ot,t[85]=st):st=t[85];let ct;t[86]===H.current?ct=t[87]:(ct=(0,X.jsx)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:H.current}),t[86]=H.current,t[87]=ct);let lt=H.current,ut=D===`edit`,dt=D===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,ft;t[88]===dt?ft=t[89]:(ft=y(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,dt),t[88]=dt,t[89]=ft);let pt,mt;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(pt=()=>O(`edit`),mt=(0,X.jsx)(Se,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[90]=pt,t[91]=mt):(pt=t[90],mt=t[91]);let ht;t[92]!==H.edit||t[93]!==ut||t[94]!==ft?(ht=(0,X.jsxs)(`button`,{"aria-pressed":ut,type:`button`,className:ft,onClick:pt,children:[mt,H.edit]}),t[92]=H.edit,t[93]=ut,t[94]=ft,t[95]=ht):ht=t[95];let gt=D===`preview`,_t=D===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,vt;t[96]===_t?vt=t[97]:(vt=y(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,_t),t[96]=_t,t[97]=vt);let yt,bt;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(yt=()=>O(`preview`),bt=(0,X.jsx)(g,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[98]=yt,t[99]=bt):(yt=t[98],bt=t[99]);let xt;t[100]!==H.preview||t[101]!==gt||t[102]!==vt?(xt=(0,X.jsxs)(`button`,{"aria-pressed":gt,type:`button`,className:vt,onClick:yt,children:[bt,H.preview]}),t[100]=H.preview,t[101]=gt,t[102]=vt,t[103]=xt):xt=t[103];let St;t[104]!==H.current||t[105]!==ht||t[106]!==xt?(St=(0,X.jsxs)(I,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-inset p-0.5`,role:`group`,"aria-label":lt,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[ht,xt]}),t[104]=H.current,t[105]=ht,t[106]=xt,t[107]=St):St=t[107];let Ct;t[108]!==ct||t[109]!==St?(Ct=(0,X.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[ct,St]}),t[108]=ct,t[109]=St,t[110]=Ct):Ct=t[110];let wt;t[111]!==T||t[112]!==D||t[113]!==v||t[114]!==H.current||t[115]!==H.empty?(wt=D===`preview`?(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg`,children:v===`markdown`?(0,X.jsx)(G,{content:T||H.empty,compact:!0,className:`text-sm`}):(0,X.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:T||H.empty})}):(0,X.jsx)(`textarea`,{className:`min-h-0 flex-1 resize-none overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/25`,value:T,onChange:e=>E(e.currentTarget.value),placeholder:H.empty,"aria-label":H.current}),t[111]=T,t[112]=D,t[113]=v,t[114]=H.current,t[115]=H.empty,t[116]=wt):wt=t[116];let Tt;t[117]!==Ct||t[118]!==wt?(Tt=(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[Ct,wt]}),t[117]=Ct,t[118]=wt,t[119]=Tt):Tt=t[119];let Et;t[120]===H.editedSuggestion?Et=t[121]:(Et=(0,X.jsx)(`span`,{children:H.editedSuggestion}),t[120]=H.editedSuggestion,t[121]=Et);let Dt;t[122]!==H.loading||t[123]!==z?(Dt=z?(0,X.jsx)(`span`,{className:`ml-2 font-normal`,children:H.loading}):null,t[122]=H.loading,t[123]=z,t[124]=Dt):Dt=t[124];let Ot;t[125]!==Et||t[126]!==Dt?(Ot=(0,X.jsxs)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:[Et,Dt]}),t[125]=Et,t[126]=Dt,t[127]=Ot):Ot=t[127];let kt=H.editedSuggestion,At=j===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,jt;t[128]===At?jt=t[129]:(jt=y(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,At),t[128]=At,t[129]=jt);let Mt=j===`edit`,Nt,Pt;t[130]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=()=>M(`edit`),Pt=(0,X.jsx)(Se,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[130]=Nt,t[131]=Pt):(Nt=t[130],Pt=t[131]);let Ft;t[132]!==H.edit||t[133]!==jt||t[134]!==Mt?(Ft=(0,X.jsxs)(`button`,{type:`button`,className:jt,"aria-pressed":Mt,onClick:Nt,children:[Pt,H.edit]}),t[132]=H.edit,t[133]=jt,t[134]=Mt,t[135]=Ft):Ft=t[135];let It=j===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,Lt;t[136]===It?Lt=t[137]:(Lt=y(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,It),t[136]=It,t[137]=Lt);let Rt=j===`preview`,zt,Bt;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(zt=()=>M(`preview`),Bt=(0,X.jsx)(g,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[138]=zt,t[139]=Bt):(zt=t[138],Bt=t[139]);let Vt;t[140]!==H.preview||t[141]!==Lt||t[142]!==Rt?(Vt=(0,X.jsxs)(`button`,{type:`button`,className:Lt,"aria-pressed":Rt,onClick:zt,children:[Bt,H.preview]}),t[140]=H.preview,t[141]=Lt,t[142]=Rt,t[143]=Vt):Vt=t[143];let Ht;t[144]!==H.editedSuggestion||t[145]!==Ft||t[146]!==Vt?(Ht=(0,X.jsxs)(I,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-inset p-0.5`,role:`group`,"aria-label":kt,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[Ft,Vt]}),t[144]=H.editedSuggestion,t[145]=Ft,t[146]=Vt,t[147]=Ht):Ht=t[147];let Ut;t[148]!==Ot||t[149]!==Ht?(Ut=(0,X.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[Ot,Ht]}),t[148]=Ot,t[149]=Ht,t[150]=Ut):Ut=t[150];let Wt=W?`opacity-100`:`pointer-events-none opacity-0`,Gt;t[151]===Wt?Gt=t[152]:(Gt=y(`absolute inset-0 min-h-0 transition-opacity duration-200 ease-out motion-reduce:transition-none`,Wt),t[151]=Wt,t[152]=Gt);let Kt=!W,qt;t[153]===Symbol.for(`react.memo_cache_sentinel`)?(qt=()=>F(Xe),t[153]=qt):qt=t[153];let Jt;t[154]!==H.thinkingLoading||t[155]!==z?(Jt=z?(0,X.jsxs)(`span`,{className:`ml-1 font-normal`,children:[`· `,H.thinkingLoading]}):null,t[154]=H.thinkingLoading,t[155]=z,t[156]=Jt):Jt=t[156];let Yt;t[157]!==H.thinking||t[158]!==Jt?(Yt=(0,X.jsxs)(`span`,{className:`min-w-0 truncate`,children:[H.thinking,Jt]}),t[157]=H.thinking,t[158]=Jt,t[159]=Yt):Yt=t[159];let Xt=P&&`rotate-180`,Zt;t[160]===Xt?Zt=t[161]:(Zt=y(`size-3.5 shrink-0 transition-transform`,Xt),t[160]=Xt,t[161]=Zt);let Qt;t[162]===Zt?Qt=t[163]:(Qt=(0,X.jsx)(c,{className:Zt,strokeWidth:1.75,"aria-hidden":!0}),t[162]=Zt,t[163]=Qt);let $t;t[164]!==Yt||t[165]!==Qt?($t=(0,X.jsxs)(`button`,{type:`button`,className:`flex shrink-0 items-center justify-between gap-2 px-2.5 py-2 text-left text-xs font-medium text-fg-muted hover:text-fg`,onClick:qt,children:[Yt,Qt]}),t[164]=Yt,t[165]=Qt,t[166]=$t):$t=t[166];let en;t[167]!==R||t[168]!==P?(en=P?(0,X.jsx)(`pre`,{ref:ie,className:`min-h-0 flex-1 overflow-auto border-t border-edge px-2.5 py-2 whitespace-pre-wrap text-xs leading-5 text-fg-muted`,onScroll:we,children:R}):null,t[167]=R,t[168]=P,t[169]=en):en=t[169];let tn;t[170]!==$t||t[171]!==en?(tn=(0,X.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col rounded-lg border border-edge bg-surface-inset/70`,children:[$t,en]}),t[170]=$t,t[171]=en,t[172]=tn):tn=t[172];let nn;t[173]!==Gt||t[174]!==Kt||t[175]!==tn?(nn=(0,X.jsx)(`div`,{className:Gt,"aria-hidden":Kt,children:tn}),t[173]=Gt,t[174]=Kt,t[175]=tn,t[176]=nn):nn=t[176];let rn=W?`pointer-events-none opacity-0`:`opacity-100`,an;t[177]===rn?an=t[178]:(an=y(`absolute inset-0 min-h-0 transition-opacity duration-200 ease-out motion-reduce:transition-none`,rn),t[177]=rn,t[178]=an);let on;t[179]!==k||t[180]!==B||t[181]!==v||t[182]!==H.empty||t[183]!==H.loading||t[184]!==H.suggestion||t[185]!==z||t[186]!==j?(on=B?(0,X.jsx)(`pre`,{className:`h-full min-h-0 overflow-auto whitespace-pre-wrap rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg-muted`,children:B}):j===`preview`?(0,X.jsx)(`div`,{className:`h-full min-h-0 overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg`,children:z&&!k.trim()?(0,X.jsx)(`p`,{className:`text-sm text-fg-muted`,children:H.loading}):v===`markdown`?(0,X.jsx)(G,{content:k||H.empty,compact:!0,className:`text-sm`}):(0,X.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:k||H.empty})}):(0,X.jsx)(`textarea`,{className:`h-full min-h-0 w-full resize-none overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/25 disabled:text-fg-muted`,value:k,onChange:e=>A(e.currentTarget.value),disabled:z,placeholder:z?H.loading:H.empty,"aria-label":H.suggestion}),t[179]=k,t[180]=B,t[181]=v,t[182]=H.empty,t[183]=H.loading,t[184]=H.suggestion,t[185]=z,t[186]=j,t[187]=on):on=t[187];let sn;t[188]!==an||t[189]!==on?(sn=(0,X.jsx)(`div`,{className:an,children:on}),t[188]=an,t[189]=on,t[190]=sn):sn=t[190];let cn;t[191]!==nn||t[192]!==sn?(cn=(0,X.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[nn,sn]}),t[191]=nn,t[192]=sn,t[193]=cn):cn=t[193];let ln;t[194]!==Ut||t[195]!==cn?(ln=(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[Ut,cn]}),t[194]=Ut,t[195]=cn,t[196]=ln):ln=t[196];let un;t[197]!==Tt||t[198]!==ln?(un=(0,X.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-3 overflow-hidden p-4 md:grid-cols-2`,children:[Tt,ln]}),t[197]=Tt,t[198]=ln,t[199]=un):un=t[199];let Q;t[200]!==J||t[201]!==H.cancel?(Q=(0,X.jsx)(w,{type:`button`,variant:`secondary`,onClick:J,children:H.cancel}),t[200]=J,t[201]=H.cancel,t[202]=Q):Q=t[202];let $=!Be,dn;t[203]!==Me||t[204]!==H.applyCurrent||t[205]!==$?(dn=(0,X.jsx)(w,{type:`button`,variant:`secondary`,disabled:$,onClick:Me,children:H.applyCurrent}),t[203]=Me,t[204]=H.applyCurrent,t[205]=$,t[206]=dn):dn=t[206];let fn;t[207]===ke?fn=t[208]:(fn=()=>void ke(),t[207]=ke,t[208]=fn);let pn;t[209]===He?pn=t[210]:(pn=He?(0,X.jsx)(_,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}):(0,X.jsx)(xe,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[209]=He,t[210]=pn);let mn=He?H.regenerate:H.generate,hn;t[211]!==z||t[212]!==pn||t[213]!==mn||t[214]!==fn?(hn=(0,X.jsxs)(w,{type:`button`,variant:`secondary`,disabled:z,onClick:fn,children:[pn,mn]}),t[211]=z,t[212]=pn,t[213]=mn,t[214]=fn,t[215]=hn):hn=t[215];let gn=!ze,_n;t[216]!==Le||t[217]!==H.append||t[218]!==gn?(_n=(0,X.jsx)(w,{type:`button`,variant:`secondary`,disabled:gn,onClick:Le,children:H.append}),t[216]=Le,t[217]=H.append,t[218]=gn,t[219]=_n):_n=t[219];let vn=!ze,yn;t[220]!==Pe||t[221]!==H.replace||t[222]!==vn?(yn=(0,X.jsx)(w,{type:`button`,variant:`primary`,disabled:vn,onClick:Pe,children:H.replace}),t[220]=Pe,t[221]=H.replace,t[222]=vn,t[223]=yn):yn=t[223];let bn;t[224]!==hn||t[225]!==_n||t[226]!==yn||t[227]!==Q||t[228]!==dn?(bn=(0,X.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-4 py-3`,children:[Q,dn,hn,_n,yn]}),t[224]=hn,t[225]=_n,t[226]=yn,t[227]=Q,t[228]=dn,t[229]=bn):bn=t[229];let xn;t[230]!==bn||t[231]!==st||t[232]!==un?(xn=(0,X.jsx)(`div`,{className:`absolute inset-0 z-[80] flex items-center justify-center p-4 pointer-events-none`,children:(0,X.jsxs)(ce,{className:`xopc-dialog-content-pane pointer-events-auto flex h-[min(78vh,38rem)] w-full max-w-4xl flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,onOpenAutoFocus:Ze,children:[st,un,bn]})}),t[230]=bn,t[231]=st,t[232]=un,t[233]=xn):xn=t[233];let Sn;t[234]!==xn||t[235]!==et||t[236]!==rt?(Sn=(0,X.jsxs)(le,{container:et,children:[rt,xn]}),t[234]=xn,t[235]=et,t[236]=rt,t[237]=Sn):Sn=t[237];let Cn;t[238]!==S||t[239]!==Sn||t[240]!==$e?(Cn=(0,X.jsx)(Ce,{open:S,onOpenChange:$e,children:Sn}),t[238]=S,t[239]=Sn,t[240]=$e,t[241]=Cn):Cn=t[241];let wn;return t[242]!==Cn||t[243]!==Qe?(wn=(0,X.jsxs)(X.Fragment,{children:[Qe,Cn]}),t[242]=Cn,t[243]=Qe,t[244]=wn):wn=t[244],wn}function Xe(e){return!e}function Ze(e){return e.preventDefault()}function Qe(e){return e.management!==void 0}var $e={name:``,description:``,projectId:``,triggerMode:`daily`,time:`09:00`,weekday:`1`,intervalValue:`1`,intervalUnit:`hour`,cronExpr:`0 9 * * *`,webhookSecretId:``,onceAt:``,eventType:``,eventSource:``,eventPayloadMatch:``,actionMode:`agent`,agentId:``,model:``,instruction:``,taskId:``,browserAutomationId:``,browserAutomationInputs:{},safetyMode:`suggest_only`,timeoutSeconds:`1800`,conversationMode:`new_session`,notificationPolicy:`attention`,resultWebhookEndpoint:``,resultWebhookSecretId:``,disableAfterFailures:`3`},et=[{value:`15`,unit:`minute`},{value:`30`,unit:`minute`},{value:`1`,unit:`hour`},{value:`6`,unit:`hour`},{value:`24`,unit:`hour`}];function tt(e){let[t,n]=e.time.split(`:`),r=Number.parseInt(t||`9`,10),i=Number.parseInt(n||`0`,10),a;if(e.triggerMode===`manual`)a={kind:`manual`};else if(e.triggerMode===`once`)a={kind:`schedule`,schedule:{kind:`once`,at:new Date(e.onceAt).toISOString()}};else if(e.triggerMode===`webhook`)a={kind:`webhook`,...e.webhookSecretId.trim()?{secretId:e.webhookSecretId.trim()}:{}};else if(e.triggerMode===`taskBlocked`)a={kind:`event`,eventType:`task.attention_required.v2`,source:`tasks`,payloadMatch:{reason:`blocked`}};else if(e.triggerMode===`noteCreated`)a={kind:`event`,eventType:`note.created`,source:`notes`};else if(e.triggerMode===`sessionUpdated`)a={kind:`event`,eventType:`session.transcript.updated`,source:`sessions`};else if(e.triggerMode===`event`){let t=e.eventPayloadMatch.trim()?JSON.parse(e.eventPayloadMatch):void 0;a={kind:`event`,eventType:e.eventType.trim(),...e.eventSource.trim()?{source:e.eventSource.trim()}:{},...t?{payloadMatch:t}:{}}}else a=e.triggerMode===`interval`?{kind:`schedule`,schedule:{kind:`interval`,everyMs:J(e.intervalValue,e.intervalUnit)}}:e.triggerMode===`weekly`?{kind:`schedule`,schedule:{kind:`cron`,expr:`${i} ${r} * * ${e.weekday}`}}:e.triggerMode===`cron`?{kind:`schedule`,schedule:{kind:`cron`,expr:e.cronExpr.trim()}}:{kind:`schedule`,schedule:{kind:`cron`,expr:`${i} ${r} * * *`}};let o=e.actionMode===`browser_automation`||e.actionMode===`task_command`?`auto_apply`:e.safetyMode,s;return s=e.actionMode===`browser_automation`?{kind:`browser_automation`,automationId:e.browserAutomationId.trim(),inputs:e.browserAutomationInputs}:e.actionMode===`task_command`?{kind:`task_command`,taskId:e.taskId.trim(),command:{type:`start`,executor:{kind:`agent`,agentId:e.agentId.trim()}}}:{kind:`agent`,instruction:e.instruction.trim(),...e.agentId.trim()?{agentId:e.agentId.trim()}:{},...e.model.trim()?{model:e.model.trim()}:{}},{name:e.name.trim(),...e.description.trim()?{description:e.description.trim()}:{},...e.projectId.trim()?{projectId:e.projectId.trim()}:{},trigger:a,action:s,safety:{mode:o},conversationMode:e.conversationMode,delivery:{notificationPolicy:e.notificationPolicy,destinations:[{key:`gateway_event`,kind:`gateway_event`},...e.resultWebhookEndpoint.trim()&&e.resultWebhookSecretId.trim()?[{key:`result_webhook`,kind:`webhook`,endpoint:e.resultWebhookEndpoint.trim(),secretId:e.resultWebhookSecretId.trim()}]:[]]},reliability:{executionTimeoutSeconds:Math.max(1,Number.parseInt(e.timeoutSeconds,10)||1800),disableAfterConsecutiveFailures:Math.max(1,Number.parseInt(e.disableAfterFailures,10)||3)}}}function nt(e){let t=e.match(/^(\d{1,2})\s+(\d{1,2})\s+\*\s+\*\s+\*$/);if(t)return{triggerMode:`daily`,time:`${t[2].padStart(2,`0`)}:${t[1].padStart(2,`0`)}`,weekday:`1`,cronExpr:e};let n=e.match(/^(\d{1,2})\s+(\d{1,2})\s+\*\s+\*\s+([0-6])$/);return n?{triggerMode:`weekly`,time:`${n[2].padStart(2,`0`)}:${n[1].padStart(2,`0`)}`,weekday:n[3],cronExpr:e}:{triggerMode:`cron`,time:$e.time,weekday:$e.weekday,cronExpr:e}}function rt(e){let t=[[`week`,10080*6e4],[`day`,1440*6e4],[`hour`,60*6e4],[`minute`,6e4]],[n,r]=t.find(([,t])=>e>=t&&e%t===0)??t.at(-1);return{intervalValue:String(e/r),intervalUnit:n}}function it(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=t.getTimezoneOffset()*6e4;return new Date(t.getTime()-n).toISOString().slice(0,16)}function at(e){let t=e.payloadMatch;return e.eventType===`task.attention_required.v2`&&e.source===`tasks`&&t?.reason===`blocked`?{triggerMode:`taskBlocked`}:e.eventType===`note.created`&&e.source===`notes`&&!t?{triggerMode:`noteCreated`}:e.eventType===`session.transcript.updated`&&e.source===`sessions`&&!t?{triggerMode:`sessionUpdated`}:{triggerMode:`event`,eventType:e.eventType,eventSource:e.source??``,eventPayloadMatch:t?JSON.stringify(t,null,2):``}}function ot(e){if(!e.trim())return!0;try{let t=JSON.parse(e);return!!t&&typeof t==`object`&&!Array.isArray(t)&&Object.values(t).every(e=>e===null||[`string`,`number`,`boolean`].includes(typeof e))}catch{return!1}}function st(e){let t={triggerMode:`manual`};if(e.trigger.kind===`webhook`)t={triggerMode:`webhook`,webhookSecretId:e.trigger.secretId??``};else if(e.trigger.kind===`event`)t=at(e.trigger);else if(e.trigger.kind===`schedule`){let n=e.trigger.schedule;n.kind===`cron`&&(t=nt(n.expr)),n.kind===`interval`&&(t={triggerMode:`interval`,...rt(n.everyMs)}),n.kind===`once`&&(t={triggerMode:`once`,onceAt:it(n.at)})}let n=e.action,r=e.reliability?.executionTimeoutSeconds??(`timeoutSeconds`in n?n.timeoutSeconds:void 0)??(n.kind===`browser_automation`?600:1800);return{...$e,...t,name:e.name,description:e.description??``,projectId:e.projectId??``,actionMode:n.kind===`system`?`agent`:n.kind,agentId:n.kind===`agent`?n.agentId??``:n.kind===`task_command`&&n.command.type===`start`&&n.command.executor.kind===`agent`?n.command.executor.agentId:``,model:n.kind===`agent`?n.model??``:``,instruction:n.kind===`agent`?n.instruction:``,taskId:n.kind===`task_command`?n.taskId:``,browserAutomationId:n.kind===`browser_automation`?n.automationId:``,browserAutomationInputs:n.kind===`browser_automation`?n.inputs??{}:{},safetyMode:e.safety?.mode??`auto_apply`,timeoutSeconds:String(r),conversationMode:e.conversationMode??`new_session`,notificationPolicy:e.delivery.notificationPolicy,resultWebhookEndpoint:e.delivery.destinations.find(e=>e.kind===`webhook`)?.endpoint??``,resultWebhookSecretId:e.delivery.destinations.find(e=>e.kind===`webhook`)?.secretId??``,disableAfterFailures:String(e.reliability?.disableAfterConsecutiveFailures??3)}}function ct(e,t){let n=tt(t),r=e.trigger.kind===`schedule`&&n.trigger.kind===`schedule`&&e.trigger.schedule.kind===n.trigger.schedule.kind?{...n.trigger,schedule:{...e.trigger.schedule,...n.trigger.schedule}}:n.trigger,i=n.action;e.action.kind===`agent`&&n.action.kind===`agent`?i={...e.action,...n.action,agentId:n.action.agentId,model:n.action.model}:e.action.kind===`browser_automation`&&n.action.kind===`browser_automation`?i={...e.action,...n.action}:e.action.kind===`task_command`&&n.action.kind===`task_command`&&(i=n.action);let a=e.delivery.destinations.filter(e=>e.kind===`gateway_event`),o=e.delivery.destinations.filter(e=>e.kind===`webhook`);return{...n,description:t.description.trim(),projectId:t.projectId.trim(),delivery:{notificationPolicy:t.notificationPolicy,destinations:[...a.length>0?a:[{key:`gateway_event`,kind:`gateway_event`}],...e.delivery.destinations.filter(e=>e.kind===`file`||e.kind===`card`),...o.slice(1),...t.resultWebhookEndpoint.trim()&&t.resultWebhookSecretId.trim()?[{key:o[0]?.key??`result_webhook`,kind:`webhook`,endpoint:t.resultWebhookEndpoint.trim(),secretId:t.resultWebhookSecretId.trim()}]:[]]},trigger:r,action:i,reliability:{...e.reliability,...n.reliability}}}function lt(e){return[`reminder`,`brief`,`review`,`followUp`].map(t=>{let n=e.scenarios[t];return{...n,requiresProject:t===`followUp`,form:{...$e,name:n.name,instruction:t===`reminder`?``:n.instruction,triggerMode:t===`reminder`?`once`:t===`review`?`weekly`:`daily`,time:t===`brief`?`08:30`:t===`review`?`17:00`:`09:00`,weekday:`5`,notificationPolicy:`all`}}})}var ut=`w-full rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg focus-visible:outline-2 focus-visible:outline-accent`;function dt(e){let t=(0,Fe.c)(99),{form:n,setForm:r,labels:i,projects:a,projectLocked:o,source:s,requiresProject:c}=e,l;t[0]===r?l=t[1]:(l=e=>r(t=>({...t,...e})),t[0]=r,t[1]=l);let u=l,p;t[2]!==i.experience.source||t[3]!==s?(p=(0,X.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[i.experience.source,`: `,s]}),t[2]=i.experience.source,t[3]=s,t[4]=p):p=t[4];let m;t[5]===u?m=t[6]:(m=e=>u({name:e.target.value}),t[5]=u,t[6]=m);let h;t[7]!==n.name||t[8]!==m?(h=(0,X.jsx)(`input`,{className:ut,value:n.name,onChange:m}),t[7]=n.name,t[8]=m,t[9]=h):h=t[9];let g;t[10]!==i.form.name||t[11]!==h?(g=(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.name,h]}),t[10]=i.form.name,t[11]=h,t[12]=g):g=t[12];let _;t[13]===u?_=t[14]:(_=e=>u({instruction:e.target.value}),t[13]=u,t[14]=_);let v;t[15]!==n.instruction||t[16]!==_?(v=(0,X.jsx)(`textarea`,{className:ut,rows:5,value:n.instruction,onChange:_}),t[15]=n.instruction,t[16]=_,t[17]=v):v=t[17];let y;t[18]!==i.info.task||t[19]!==v?(y=(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.info.task,v]}),t[18]=i.info.task,t[19]=v,t[20]=y):y=t[20];let b;t[21]!==n.projectId||t[22]!==i.form.noProject||t[23]!==i.form.project||t[24]!==o||t[25]!==a||t[26]!==u?(b=!o&&(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.project,(0,X.jsxs)(d,{className:ut,value:n.projectId,onChange:e=>u({projectId:e.target.value}),children:[(0,X.jsx)(f,{value:``,children:i.form.noProject}),a.map(ft)]})]}),t[21]=n.projectId,t[22]=i.form.noProject,t[23]=i.form.project,t[24]=o,t[25]=a,t[26]=u,t[27]=b):b=t[27];let x;t[28]!==n.projectId||t[29]!==i.experience.projectRequired||t[30]!==c?(x=c&&!n.projectId?(0,X.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:i.experience.projectRequired}):null,t[28]=n.projectId,t[29]=i.experience.projectRequired,t[30]=c,t[31]=x):x=t[31];let S;t[32]===u?S=t[33]:(S=e=>u({triggerMode:e.target.value}),t[32]=u,t[33]=S);let C;t[34]===i.trigger.once?C=t[35]:(C=(0,X.jsx)(f,{value:`once`,children:i.trigger.once}),t[34]=i.trigger.once,t[35]=C);let w;t[36]===i.trigger.daily?w=t[37]:(w=(0,X.jsx)(f,{value:`daily`,children:i.trigger.daily}),t[36]=i.trigger.daily,t[37]=w);let T;t[38]===i.trigger.weekly?T=t[39]:(T=(0,X.jsx)(f,{value:`weekly`,children:i.trigger.weekly}),t[38]=i.trigger.weekly,t[39]=T);let E;t[40]!==n.triggerMode||t[41]!==S||t[42]!==C||t[43]!==w||t[44]!==T?(E=(0,X.jsxs)(d,{className:ut,value:n.triggerMode,onChange:S,children:[C,w,T]}),t[40]=n.triggerMode,t[41]=S,t[42]=C,t[43]=w,t[44]=T,t[45]=E):E=t[45];let D;t[46]!==i.form.trigger||t[47]!==E?(D=(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.trigger,E]}),t[46]=i.form.trigger,t[47]=E,t[48]=D):D=t[48];let O;t[49]!==n.onceAt||t[50]!==n.time||t[51]!==n.triggerMode||t[52]!==i.form.onceAt||t[53]!==i.form.time||t[54]!==u?(O=n.triggerMode===`once`?(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.onceAt,(0,X.jsx)(`input`,{type:`datetime-local`,className:ut,value:n.onceAt,onChange:e=>u({onceAt:e.target.value})})]}):(0,X.jsxs)(`div`,{className:`grid gap-2 text-sm text-fg`,children:[(0,X.jsx)(`span`,{children:i.form.time}),(0,X.jsx)(Be,{value:n.time,onChange:e=>u({time:e}),ariaLabel:i.form.time})]}),t[49]=n.onceAt,t[50]=n.time,t[51]=n.triggerMode,t[52]=i.form.onceAt,t[53]=i.form.time,t[54]=u,t[55]=O):O=t[55];let k;t[56]!==n.triggerMode||t[57]!==n.weekday||t[58]!==i.form.day||t[59]!==i.weekdays||t[60]!==u?(k=n.triggerMode===`weekly`&&(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.day,(0,X.jsx)(d,{className:ut,value:n.weekday,onChange:e=>u({weekday:e.target.value}),children:[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`].map((e,t)=>(0,X.jsx)(f,{value:String(t),children:i.weekdays[e]},e))})]}),t[56]=n.triggerMode,t[57]=n.weekday,t[58]=i.form.day,t[59]=i.weekdays,t[60]=u,t[61]=k):k=t[61];let A;t[62]!==D||t[63]!==O||t[64]!==k?(A=(0,X.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[D,O,k]}),t[62]=D,t[63]=O,t[64]=k,t[65]=A):A=t[65];let j;t[66]!==n.onceAt||t[67]!==n.triggerMode||t[68]!==i.experience.futureTime?(j=n.triggerMode===`once`&&n.onceAt&&new Date(n.onceAt).getTime()<=Date.now()?(0,X.jsx)(`p`,{role:`status`,className:`text-sm text-red-700 dark:text-red-300`,children:i.experience.futureTime}):null,t[66]=n.onceAt,t[67]=n.triggerMode,t[68]=i.experience.futureTime,t[69]=j):j=t[69];let M;t[70]===i.experience.scheduleNote?M=t[71]:(M=(0,X.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i.experience.scheduleNote}),t[70]=i.experience.scheduleNote,t[71]=M);let N;t[72]===u?N=t[73]:(N=e=>u({notificationPolicy:e.target.value}),t[72]=u,t[73]=N);let P;t[74]===i.draft.notifyAll?P=t[75]:(P=(0,X.jsx)(f,{value:`all`,children:i.draft.notifyAll}),t[74]=i.draft.notifyAll,t[75]=P);let F;t[76]===i.draft.notifyAttention?F=t[77]:(F=(0,X.jsx)(f,{value:`attention`,children:i.draft.notifyAttention}),t[76]=i.draft.notifyAttention,t[77]=F);let ee;t[78]===i.draft.notifyNone?ee=t[79]:(ee=(0,X.jsx)(f,{value:`none`,children:i.draft.notifyNone}),t[78]=i.draft.notifyNone,t[79]=ee);let I;t[80]!==n.notificationPolicy||t[81]!==N||t[82]!==P||t[83]!==F||t[84]!==ee?(I=(0,X.jsxs)(d,{className:ut,value:n.notificationPolicy,onChange:N,children:[P,F,ee]}),t[80]=n.notificationPolicy,t[81]=N,t[82]=P,t[83]=F,t[84]=ee,t[85]=I):I=t[85];let L;t[86]!==i.draft.notifications||t[87]!==I?(L=(0,X.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.draft.notifications,I]}),t[86]=i.draft.notifications,t[87]=I,t[88]=L):L=t[88];let te;return t[89]!==x||t[90]!==A||t[91]!==p||t[92]!==j||t[93]!==M||t[94]!==L||t[95]!==g||t[96]!==y||t[97]!==b?(te=(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4`,children:[p,g,y,b,x,A,j,M,L]}),t[89]=x,t[90]=A,t[91]=p,t[92]=j,t[93]=M,t[94]=L,t[95]=g,t[96]=y,t[97]=b,t[98]=te):te=t[98],te}function ft(e){return(0,X.jsx)(f,{value:e.id,children:e.name},e.id)}function pt(e,t){let n=new URLSearchParams({draft:e.trim()}),r=t?.trim();return r?n.set(`projectId`,r):n.set(`projectScope`,`none`),`/chat/new?${n.toString()}`}function mt(e,t){return t.reduce((t,n)=>n.automationId===e&&(!t||n.createdAtMs>t.createdAtMs)?n:t,void 0)}function ht(e,t){let n=mt(e.id,t),r=!!(e.state.lastRunAtMs&&(!n||e.state.lastRunAtMs>n.createdAtMs)),i=r?e.state.lastRunStatus:n?.status??e.state.lastRunStatus;return i!==`failed`&&i!==`timeout`?null:`${i}:${(r?e.state.lastRunAtMs:n?.createdAtMs??e.state.lastRunAtMs)??`unknown`}`}function gt(e,t){return ht(e,t)!==null}var _t=`xopc.automations.dismissedExecutionIssues`;function vt(){if(typeof window>`u`)return{};try{let e=JSON.parse(window.localStorage.getItem(_t)??`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return{}}}function yt(e,t,n){return e?q(e,n):t.never}function bt(e,t){return e.kind===`system`?e.capability===`home.advisor.refresh`?`Home AI suggestions refresh`:e.capability===`memory.temporal_sweep`?`Memory temporal sweep`:e.capability===`memory.daily_reconciliation`?`Memory daily reconciliation`:`Memory weekly knowledge maintenance`:e.kind===`browser_automation`?`Browser automation: ${e.automationId}`:e.kind===`task_command`?t.action.taskWithId.replace(`{id}`,e.taskId):e.agentId?t.action.agentWithId.replace(`{id}`,e.agentId):t.action.agent}function xt(e,t){return e.kind===`system`?`System`:e.kind===`browser_automation`?t.sources.browser:e.kind===`task_command`?t.sources.task:t.sources.agent}function St(e,t){return e===`browser_automation`?t.sources.browser:e===`task_command`?t.action.runTask:t.action.runAgent}function Ct(e,t){return e===`cron`?t.trigger.customCron:e===`event`?t.trigger.customEvent:t.trigger[e]}function wt(e){let t=(0,Fe.c)(8),{kind:n,className:r}=e;if(n===`system`){let e;return t[0]===r?e=t[1]:(e=(0,X.jsx)(B,{className:r,"aria-hidden":!0}),t[0]=r,t[1]=e),e}if(n===`browser_automation`){let e;return t[2]===r?e=t[3]:(e=(0,X.jsx)(R,{className:r,"aria-hidden":!0}),t[2]=r,t[3]=e),e}if(n===`task_command`){let e;return t[4]===r?e=t[5]:(e=(0,X.jsx)(m,{className:r,"aria-hidden":!0}),t[4]=r,t[5]=e),e}let i;return t[6]===r?i=t[7]:(i=(0,X.jsx)(xe,{className:r,"aria-hidden":!0}),t[6]=r,t[7]=i),i}function Tt(e){return e.safety?.mode??`auto_apply`}function Et(e){return e===`succeeded`?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:e===`failed`||e===`timeout`?`bg-red-500/10 text-red-700 dark:text-red-300`:e===`running`||e===`queued`||e===`cancelling`?`bg-blue-500/10 text-blue-700 dark:text-blue-300`:`bg-surface-hover text-fg-muted`}function Dt(e,t){if(e==null)return t.never;if(e<1e3)return`${e}ms`;let n=Math.round(e/1e3);return n<60?`${n}s`:`${Math.floor(n/60)}m ${n%60}s`}function Ot(e){return e.status===`running`||e.status===`queued`||e.status===`cancelling`}function kt(e){return e.status===`failed`||e.status===`timeout`}function At(e,t){return e.action.kind===`system`?bt(e.action,t):e.action.kind===`agent`?e.action.instruction:(e.action.kind,bt(e.action,t))}function jt(e){return e.description?.trim()??``}function Mt(e){return Ot(e)?0:kt(e)?1:e.status===`succeeded`?2:3}function Nt(e){return[...e].sort((e,t)=>{let n=Mt(e)-Mt(t);return n===0?t.createdAtMs-e.createdAtMs:n})}function Pt(){let e=(0,Fe.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(`section`,{className:`grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-edge-subtle bg-edge-subtle xl:grid-cols-4`,children:Array.from({length:4}).map(It)}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,X.jsx)(T,{className:`h-4 w-36`}),(0,X.jsx)(T,{className:`h-3 w-56 max-w-full`})]}),(0,X.jsx)(T,{className:`h-7 w-20 rounded-full`})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsxs)(`section`,{className:`rounded-xl bg-surface-panel p-4 shadow-surface`,children:[n,(0,X.jsx)(`div`,{className:`mt-4 grid gap-2`,children:Array.from({length:6}).map(Ft)})]}),e[2]=r):r=e[2];let i,a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(T,{className:`h-4 w-32`}),a=(0,X.jsx)(T,{className:`mt-4 h-24 rounded-lg`}),e[3]=i,e[4]=a):(i=e[3],a=e[4]);let o;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsxs)(`div`,{className:`grid gap-4`,"aria-hidden":`true`,children:[t,(0,X.jsxs)(`div`,{className:`grid min-h-0 items-start gap-4 xl:grid-cols-[minmax(18rem,0.8fr)_minmax(0,1.5fr)]`,children:[r,(0,X.jsxs)(`section`,{className:`hidden rounded-xl bg-surface-panel p-4 shadow-surface xl:block`,children:[i,a,(0,X.jsxs)(`div`,{className:`mt-4 grid gap-2`,children:[(0,X.jsx)(T,{className:`h-12 rounded-lg`}),(0,X.jsx)(T,{className:`h-12 rounded-lg`}),(0,X.jsx)(T,{className:`h-12 rounded-lg`})]})]})]})]}),e[5]=o):o=e[5],o}function Ft(e,t){return(0,X.jsx)(`div`,{className:`rounded-lg bg-surface-base p-3`,children:(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(T,{className:`size-4 rounded-full`}),(0,X.jsx)(T,{className:`h-4 w-32`}),(0,X.jsx)(T,{className:`h-5 w-20 rounded-full`})]}),(0,X.jsx)(T,{className:`mt-3 h-4 w-full`}),(0,X.jsx)(T,{className:`mt-2 h-4 w-3/5`})]}),(0,X.jsx)(T,{className:`h-8 w-24 rounded-md`})]})},t)}function It(e,t){return(0,X.jsxs)(`div`,{className:`flex min-h-12 items-center gap-2.5 bg-surface-base px-3 py-2.5`,children:[(0,X.jsx)(T,{className:`size-4 rounded-full`}),(0,X.jsx)(T,{className:`h-3 w-14`}),(0,X.jsx)(T,{className:`ml-auto h-4 w-10`})]},t)}function Lt({projectId:e,embedded:t=!1,title:n,subtitle:r}){let a=S(e=>e.language),s=v(a),l=s.automations,u=s.productNavigation.sections[`automation-triggers`],p=s.cron,h=U(e=>e.setPageHeader),g=U(e=>e.clearPageHeader),b=o(),[x,T]=i(),D=!t&&x.get(`view`)===`activity`,M=x.get(`run`)?.trim()??``,F=x.get(`automation`)?.trim()??``,te=x.get(`draft`)?.trim()??``,ne=x.get(`action`)?.trim()??``,ie=x.get(`taskId`)?.trim()??``,ue=x.get(`projectId`)?.trim()??``,G=e?.trim()||ue,K=!!e?.trim(),ve=x.get(`autogenerate`)===`1`,be=(0,Y.useRef)(``),Se=x.get(`status`),we=Se===`active`||Se===`paused`||Se===`running`||Se===`attention`?Se:`all`,Te=x.get(`ownership`)===`system`?`system`:`user`,Oe=x.get(`source`),q=Oe===`agent`||Oe===`task_command`||Oe===`browser_automation`?Oe:`all`,ke=x.get(`q`)??``,Ae=e=>T(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`status`):n.set(`status`,e),n.delete(`automation`),n}),Ne=e=>T(t=>{let n=new URLSearchParams(t);return e===`user`?n.delete(`ownership`):n.set(`ownership`,e),n.delete(`automation`),n}),Pe=e=>T(t=>{let n=new URLSearchParams(t);return e?n.set(`q`,e):n.delete(`q`),n.delete(`automation`),n},{replace:!0}),Fe=e=>T(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`source`):n.set(`source`,e),n.delete(`automation`),n}),Ie=()=>T(e=>{let t=new URLSearchParams(e);return t.delete(`status`),t.delete(`source`),t.delete(`q`),t.delete(`automation`),t}),[Le,Re]=(0,Y.useState)(null),[ze,Be]=(0,Y.useState)(!1),[Ve,He]=(0,Y.useState)(`blank`),[Ue,We]=(0,Y.useState)(null),[Ge,Ke]=(0,Y.useState)(!1),[Z,qe]=(0,Y.useState)($e),[Je,Ye]=(0,Y.useState)(null),[Xe,Ze]=(0,Y.useState)(null),[et,nt]=(0,Y.useState)(!1),[rt,it]=(0,Y.useState)(null),[at,ut]=(0,Y.useState)(``),[ft,yt]=(0,Y.useState)(null),[bt,xt]=(0,Y.useState)(!1),[St,Ct]=(0,Y.useState)(!1),[wt,Tt]=(0,Y.useState)(G),[Et,Dt]=(0,Y.useState)(`new_session`),[kt,Mt]=(0,Y.useState)(`attention`),[Ft,It]=(0,Y.useState)(null),[Lt,Vt]=(0,Y.useState)(!1),[Ht,Ut]=(0,Y.useState)(!1),[qt,Jt]=(0,Y.useState)(!1),[Yt,Xt]=(0,Y.useState)(null),[$t,en]=(0,Y.useState)(vt),tn=C([`automations`,G],()=>V.list(G?{projectId:G}:void 0),{keepPreviousData:!0,refreshInterval:15e3}),nn=C([`automation-runs`,G],()=>V.runs(50,void 0,G?{projectId:G}:void 0),{keepPreviousData:!0,refreshInterval:1e4}),rn=C(G?`automations-global-system-source`:null,()=>V.list(),{keepPreviousData:!0,refreshInterval:15e3}),an=C(G?`automation-runs-global-system-source`:null,()=>V.runs(50),{keepPreviousData:!0,refreshInterval:1e4}),on=C(rt?[`automation-history`,rt,G]:null,()=>V.runs(50,rt,G?{projectId:G}:void 0),{refreshInterval:1e4}),ln=C(Xe?`automation-run-events:${Xe}`:null,()=>V.runEvents(Xe),{refreshInterval:5e3}),un=C(`automation-browser-automations`,()=>je.list()),$=C(`automation-chat-agents`,oe),dn=C(`automation-tasks`,V.tasks),fn=C(`automation-projects`,()=>ae({sortBy:`name`,sortOrder:`asc`,limit:200})),pn=tn.isLoading&&!tn.data||nn.isLoading&&!nn.data||!!G&&rn.isLoading&&!rn.data||!!G&&an.isLoading&&!an.data,mn=!pn&&(tn.isLoading||nn.isLoading||rn.isLoading||an.isLoading),hn=tn.data?.automations??[],gn=G?rn.data?.automations??[]:hn,_n=(0,Y.useMemo)(()=>Nt(nn.data?.runs??[]),[nn.data?.runs]),vn=(0,Y.useMemo)(()=>G?Nt(an.data?.runs??[]):_n,[an.data?.runs,G,_n]),yn=(0,Y.useMemo)(()=>hn.filter(e=>!Qe(e)),[hn]),bn=(0,Y.useMemo)(()=>gn.filter(Qe),[gn]),xn=(0,Y.useMemo)(()=>[...yn,...bn],[bn,yn]),Sn=(0,Y.useMemo)(()=>new Set(bn.map(e=>e.id)),[bn]),Cn=(0,Y.useMemo)(()=>_n.filter(e=>!Sn.has(e.automationId)),[_n,Sn]),wn=(0,Y.useMemo)(()=>vn.filter(e=>Sn.has(e.automationId)),[vn,Sn]),Tn=(0,Y.useMemo)(()=>G?[..._n,...wn]:_n,[G,_n,wn]),En=(0,Y.useMemo)(()=>Tn.find(e=>e.id===Xe)??on.data?.runs.find(e=>e.id===Xe)??null,[Tn,Xe,on.data]),Dn=(0,Y.useMemo)(()=>xn.find(e=>e.id===rt)??null,[xn,rt]),On=(0,Y.useMemo)(()=>xn.find(e=>e.id===Ue)??null,[xn,Ue]),kn=(0,Y.useMemo)(()=>[...on.data?.runs??Tn].filter(e=>e.automationId===rt).sort((e,t)=>t.createdAtMs-e.createdAtMs),[Tn,rt,on.data]),An=ln.data?.events??[],jn=(0,Y.useMemo)(()=>Cn.filter(e=>!Ot(e)&&e.readAtMs==null),[Cn]),Mn=ke.trim().toLocaleLowerCase(),Nn=Te===`system`?bn:yn,Pn=Te===`system`?wn:Cn,Fn=(0,Y.useMemo)(()=>new Set(Pn.filter(Ot).map(e=>e.automationId)),[Pn]),In=(0,Y.useMemo)(()=>Nn.filter(e=>we===`attention`&&!gt(e,Pn)||we===`running`&&!Fn.has(e.id)||we===`active`&&!e.enabled||we===`paused`&&e.enabled||q!==`all`&&e.action.kind!==q?!1:Mn?[e.name,jt(e),At(e,l),Ee(e.trigger,l,p,a)].some(e=>e.toLocaleLowerCase().includes(Mn)):!0),[p,we,l,a,Mn,Nn,Pn,Fn,q]),Ln=(0,Y.useMemo)(()=>(un.data?.automations??[]).filter(e=>e.enabled),[un.data]),Rn=$.data?.items??[],zn=(0,Y.useMemo)(()=>(dn.data?.items??[]).map(e=>e.task),[dn.data]),Bn=fn.data?.items??[],Vn=(0,Y.useMemo)(()=>Ln.find(e=>e.id===Z.browserAutomationId.trim())??null,[Ln,Z.browserAutomationId]),Hn=!!On?.management?.editable.includes(`trigger`),Un=[`daily`,`weekly`,`interval`,`cron`].includes(Z.triggerMode)&&(![`daily`,`weekly`].includes(Z.triggerMode)||/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(Z.time))&&(Z.triggerMode!==`interval`||J(Z.intervalValue,Z.intervalUnit)>=6e4)&&(Z.triggerMode!==`cron`||!!Z.cronExpr.trim()),Wn=Hn?Un:!!Z.name.trim()&&(Z.triggerMode!==`once`||Number.isFinite(new Date(Z.onceAt).getTime())&&(!!On||new Date(Z.onceAt).getTime()>Date.now()))&&(![`daily`,`weekly`].includes(Z.triggerMode)||/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(Z.time))&&(Z.triggerMode!==`event`||!!Z.eventType.trim()&&ot(Z.eventPayloadMatch))&&(Z.actionMode===`browser_automation`?Vn!==null&&Me(Vn,Z.browserAutomationInputs):Z.actionMode===`task_command`?!!(Z.taskId.trim()&&Z.agentId.trim()):!!Z.instruction.trim()),Gn=(0,Y.useMemo)(()=>lt(l),[l]),Kn=(0,Y.useMemo)(()=>yn.filter(e=>gt(e,Cn)),[yn,Cn]),qn=(0,Y.useMemo)(()=>Nn.filter(e=>gt(e,Pn)),[Nn,Pn]),Jn=Kn.some(e=>{let t=ht(e,Cn);return t!==null&&$t[e.id]!==t}),Yn=Pn.filter(Ot).length,Xn=Nn.filter(e=>e.enabled&&e.state.nextRunAtMs).sort((e,t)=>(e.state.nextRunAtMs??1/0)-(t.state.nextRunAtMs??1/0))[0],Zn=(0,Y.useMemo)(()=>({all:Nn.length,agent:Nn.filter(e=>e.action.kind===`agent`).length,task_command:Nn.filter(e=>e.action.kind===`task_command`).length,browser_automation:Nn.filter(e=>e.action.kind===`browser_automation`).length}),[Nn]),Qn=Number(we!==`all`)+Number(q!==`all`),$n=(0,Y.useCallback)(()=>{en(e=>{let t={...e};for(let e of Kn){let n=ht(e,Cn);n&&(t[e.id]=n)}try{window.localStorage.setItem(_t,JSON.stringify(t))}catch{}return t})},[Kn,Cn]);(0,Y.useEffect)(()=>{if(!mn){if(In.length===0){it(null);return}if(F&&In.some(e=>e.id===F)){it(F);return}rt&&In.some(e=>e.id===rt)||it(In[0].id)}},[F,In,mn,rt]);let er=(0,Y.useCallback)(async()=>{await Promise.all([tn.mutate(),nn.mutate(),rn.mutate(),an.mutate(),on.mutate(),ln.mutate()])},[tn.mutate,rn.mutate,an.mutate,ln.mutate,nn.mutate,on.mutate]),tr=(0,Y.useCallback)(e=>{if(K){it(null),Ze(null);return}T(t=>{let n=new URLSearchParams(t);return e?n.set(`projectId`,e):n.delete(`projectId`),n.delete(`automation`),n.delete(`run`),n}),it(null),Ze(null)},[K,T]);(0,Y.useEffect)(()=>{K&&(Tt(G),qe(e=>e.projectId===G?e:{...e,projectId:G}))},[G,K]);let nr=(0,Y.useCallback)(e=>{if(We(null),Ke(!1),Ye(null),He(e),Be(!0),e===`blank`){qe({...$e,projectId:G});return}ut(``),yt(null),Ct(!1),Tt(G),Dt(`new_session`),Mt(`attention`)},[G]),rr=(0,Y.useCallback)(()=>{b(pt(l.createWithAssistantPrompt,G))},[l.createWithAssistantPrompt,b,G]),ir=e=>{Re(e),qe({...e.form,projectId:G}),We(null),Ke(!1),Ye(null),He(`quick`),Be(!0)},ar=(0,Y.useCallback)(e=>{qe(st(e)),We(e.id),Ke(!1),it(null),He(`blank`),Be(!0)},[]),or=(0,Y.useCallback)(()=>{ft&&(qe({...st(ft.automation),projectId:wt,conversationMode:Et,notificationPolicy:kt}),We(null),Ke(!0),He(`blank`))},[ft,Et,kt,wt]),sr=(0,Y.useCallback)(async()=>{Jt(!0),Ye(null);try{await er()}catch(e){Ye(e instanceof Error?e.message:String(e))}finally{Jt(!1)}},[l.feedback.actionFailed,er]);(0,Y.useEffect)(()=>{let e=xn.find(e=>e.id===F);!e||!Qe(e)||Te===`system`||T(e=>{let t=new URLSearchParams(e);return t.set(`ownership`,`system`),t},{replace:!0})},[F,xn,Te,T]),(0,Y.useEffect)(()=>{ne===`create`&&(nr(`blank`),ie&&qe(e=>({...e,actionMode:`task_command`,taskId:ie,safetyMode:`auto_apply`})),T(e=>{let t=new URLSearchParams(e);return t.delete(`action`),t.delete(`taskId`),t},{replace:!0}))},[ne,nr,T,ie]),(0,Y.useEffect)(()=>{if(!te)return;let e=`${a}:${ve?`auto`:`seed`}:${te}`;be.current!==e&&(be.current=e,ut(te),yt(null),Ct(!1),Tt(G),He(`draft`),Be(!0),T(e=>{let t=new URLSearchParams(e);return t.delete(`draft`),t.delete(`autogenerate`),t},{replace:!0}),ve&&(Ye(null),xt(!0),V.draft({prompt:te,language:a}).then(e=>{yt(e.draft),Ct(!1)}).catch(e=>{Ye(e instanceof Error?e.message:String(e))}).finally(()=>{xt(!1)})))},[ve,te,a,G,T]);let cr=(0,Y.useCallback)(e=>{let t=_n.find(t=>t.id===e)??on.data?.runs.find(t=>t.id===e);if(!t||Ot(t)||t.readAtMs!=null)return;let n=Date.now();nn.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),on.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),V.markRunRead(e).catch(e=>{Ye(e instanceof Error?e.message:String(e)),nn.mutate(),on.mutate()})},[_n,nn.mutate,on.data,on.mutate]),lr=(0,Y.useCallback)(e=>{cr(e),Ze(e),nt(!0),T(t=>{let n=new URLSearchParams(t);return n.set(`run`,e),n},{replace:!0})},[cr,T]),ur=(0,Y.useCallback)(e=>{it(e);let t=mt(e,Tn);T(t=>{let n=new URLSearchParams(t);return n.set(`automation`,e),n},{replace:!0}),t&&t.readAtMs==null&&!Ot(t)&&cr(t.id)},[Tn,cr,T]),dr=(0,Y.useCallback)(()=>{if(!Xn)return;it(Xn.id);let e=mt(Xn.id,Tn);T(e=>{let t=new URLSearchParams(e);return t.delete(`status`),t.delete(`source`),t.delete(`q`),t.set(`automation`,Xn.id),t},{replace:!0}),e&&e.readAtMs==null&&!Ot(e)&&cr(e.id)},[Tn,cr,Xn,T]);(0,Y.useEffect)(()=>{M&&(cr(M),Ze(M),nt(!0))},[cr,M]),(0,Y.useEffect)(()=>{It(null),Ut(!1)},[Xe]);async function fr(){if(Ye(null),Z.triggerMode===`once`&&!On&&new Date(Z.onceAt).getTime()<=Date.now()){Ye(l.experience.futureTime);return}if(!(!Wn||Yt)&&!(Ve===`quick`&&Le?.requiresProject&&!Z.projectId)){if(Ge&&ft){Xt(`draft:edit`);try{let e=tt(Z),{simulation:t}=await V.simulate(e);yt({...ft,automation:e,simulation:t}),Tt(Z.projectId),Dt(Z.conversationMode),Mt(Z.notificationPolicy),Ct(!1),Ke(!1),He(`draft`)}catch(e){Ye(e instanceof Error?e.message:String(e))}finally{Xt(null)}return}if(On){let e=On.id;await pr(`automation:${e}:edit`,()=>V.update(e,Hn?{trigger:ct(On,{...Z,instruction:`managed`}).trigger}:ct(On,Z)))&&(Be(!1),We(null),it(e));return}Xt(`automation:create`);try{let e=tt(Z),{automation:t}=await V.create(e);qe($e),Be(!1),T(e=>{let n=new URLSearchParams(e);return n.delete(`status`),n.delete(`q`),n.delete(`run`),n.set(`automation`,t.id),K||(t.projectId?n.set(`projectId`,t.projectId):n.delete(`projectId`)),n}),await er(),it(t.id)}catch(e){Ye(e instanceof Error?e.message:String(e))}finally{Xt(null)}}}async function pr(e,t){Ye(null),Xt(e);try{return await t(),await er(),!0}catch(e){return Ye(e instanceof Error?e.message:String(e)),!1}finally{Xt(null)}}async function mr(){await pr(`runs:read-all`,()=>V.markAllRunsRead(G||void 0))}async function hr(){let e=at.trim();if(e){Ye(null),xt(!0);try{yt((await V.draft({prompt:e,language:a})).draft),Ct(!1)}catch(e){Ye(e instanceof Error?e.message:String(e))}finally{xt(!1)}}}async function gr(){if(!ft)return;let e=``,t=``;await pr(`draft:publish`,async()=>{let{automation:n}=await V.create({...ft.automation,...wt?{projectId:wt}:{projectId:void 0},conversationMode:Et,delivery:{...ft.automation.delivery,notificationPolicy:kt}});yt(null),ut(``),Ct(!1),Be(!1),Ae(`all`),Pe(``),e=n.id,t=n.projectId??``})&&e&&(tr(t),it(e))}async function _r(){if(!ft)return;let e=``,t=``,n=``;await pr(`draft:test`,async()=>{let{automation:r}=await V.create({...ft.automation,...wt?{projectId:wt}:{projectId:void 0},conversationMode:Et,delivery:{...ft.automation.delivery,notificationPolicy:kt},enabled:!1}),{run:i}=await V.runNow(r.id);e=r.id,t=r.projectId??``,n=i.id,yt(null),ut(``),Ct(!1),Be(!1),Ae(`all`),Pe(``)})&&e&&n&&(tr(t),it(e),lr(n))}async function vr(e){Ye(null),Vt(!0),It(null),Ut(!1);try{It((await V.repairDraft(e.id,{language:a})).repair)}catch(e){Ye(e instanceof Error?e.message:String(e))}finally{Vt(!1)}}async function yr(e){Ft&&await pr(`run:${e.id}:repair`,async()=>{await V.update(e.automationId,Ft.patch),It(null),Ut(!1)})}let br=(0,Y.useMemo)(()=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(me,{className:`size-9 shrink-0 p-0`,loading:qt,label:l.refresh,onClick:sr}),(0,X.jsxs)(`div`,{className:`inline-flex h-9 shrink-0`,role:`group`,"aria-label":l.createOptions,children:[(0,X.jsxs)(w,{variant:`primary`,className:`h-9 rounded-r-none pr-2.5`,onClick:rr,children:[(0,X.jsx)(z,{className:`size-4`,"aria-hidden":!0}),l.create]}),(0,X.jsxs)(W,{children:[(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(w,{variant:`primary`,className:`h-9 w-9 rounded-l-none border-l border-white/20 px-0`,"aria-label":l.createOptions,title:l.createOptions,children:(0,X.jsx)(c,{className:`size-4`,"aria-hidden":!0})})}),(0,X.jsx)(ye,{children:(0,X.jsxs)(H,{align:`end`,sideOffset:6,className:`z-70 min-w-52 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[(0,X.jsxs)(ge,{className:`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,onSelect:rr,children:[(0,X.jsx)(pe,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),l.createWithAssistant]}),(0,X.jsxs)(ge,{className:`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,onSelect:()=>nr(`blank`),children:[(0,X.jsx)(fe,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),l.setUpManually]})]})})]})]})]}),[l.create,l.createOptions,l.createWithAssistant,l.refresh,l.setUpManually,rr,nr,qt,sr]);return(0,Y.useLayoutEffect)(()=>{if(!t)return h({startExtra:null,main:(0,X.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:u}),end:br}),()=>g()},[g,t,br,u,h]),(0,X.jsxs)(`div`,{className:y(`flex min-h-0 min-w-0 flex-1 flex-col`,t?`bg-transparent`:`bg-surface-panel`),children:[(0,X.jsxs)(`div`,{className:y(`flex w-full flex-col gap-4`,t?`py-1`:`mx-auto max-w-[96rem] px-4 pb-7 pt-3 sm:px-6 lg:px-8 lg:pb-9 lg:pt-4`),children:[t?(0,X.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 rounded-xl border border-edge-subtle bg-surface-base px-4 py-3 shadow-surface`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(B,{className:`size-4 text-accent-fg`,"aria-hidden":!0}),(0,X.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n||l.title})]}),(0,X.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:r||l.subtitle})]}),br]}):null,Je||tn.error||nn.error||rn.error||an.error?(0,X.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-700 dark:text-red-300`,children:Je||l.feedback.actionFailed}):null,D?pn?(0,X.jsx)(Pt,{}):(0,X.jsx)(Gt,{runs:Pn,ownership:Te,labels:l,language:a,unreadCount:Te===`user`?jn.length:0,loading:mn||qt,onOwnershipChange:Ne,onRefresh:sr,onSelectRun:lr}):(0,X.jsxs)(X.Fragment,{children:[pn?null:(0,X.jsxs)(`section`,{"aria-labelledby":`automation-overview-title`,children:[(0,X.jsx)(`h2`,{id:`automation-overview-title`,className:`sr-only`,children:l.overview.title}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-edge-subtle bg-edge-subtle xl:grid-cols-4`,children:[(0,X.jsx)(Wt,{icon:(0,X.jsx)(B,{className:`size-4`,"aria-hidden":!0}),label:l.metrics.enabled,value:String(Nn.filter(e=>e.enabled).length),active:we===`active`,onClick:()=>Ae(`active`)}),(0,X.jsx)(Wt,{icon:(0,X.jsx)(j,{className:`size-4`,"aria-hidden":!0}),label:l.metrics.running,value:String(Yn),active:we===`running`,onClick:()=>Ae(`running`)}),(0,X.jsx)(Wt,{icon:(0,X.jsx)(he,{className:`size-4`,"aria-hidden":!0}),label:l.dashboard.needsAttention,value:String(qn.length),tone:qn.length>0?`danger`:`default`,active:we===`attention`,onClick:()=>Ae(`attention`)}),(0,X.jsx)(Wt,{icon:(0,X.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),label:l.metrics.next,value:Xn?De(Xn.state.nextRunAtMs,a):`—`,onClick:Xn?dr:void 0})]})]}),!pn&&Jn&&Te===`user`?(0,X.jsxs)(`div`,{className:`flex items-center rounded-lg border border-red-500/20 bg-red-500/5`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>Ae(`attention`),className:`flex min-w-0 flex-1 items-center gap-3 rounded-l-lg px-4 py-3 text-left focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,X.jsx)(he,{className:`size-4 shrink-0 text-red-700 dark:text-red-300`,"aria-hidden":!0}),(0,X.jsxs)(`span`,{className:`min-w-0 text-sm text-fg`,children:[(0,X.jsxs)(`span`,{className:`font-medium`,children:[l.experience.executionIssues,` · `,Kn.length]}),(0,X.jsx)(`span`,{className:`ml-2 text-fg-muted`,children:l.experience.issuesDescription})]})]}),(0,X.jsx)(`button`,{type:`button`,onClick:$n,className:`mr-2 rounded-md p-2 text-fg-muted hover:bg-red-500/10 hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":l.close,title:l.close,children:(0,X.jsx)(de,{className:`size-4`,"aria-hidden":!0})})]}):null,pn?(0,X.jsx)(Pt,{}):(0,X.jsxs)(`section`,{className:`grid min-h-0 items-start gap-4 xl:grid-cols-[minmax(18rem,0.8fr)_minmax(0,1.5fr)]`,"aria-busy":mn,children:[(0,X.jsxs)(`aside`,{className:`flex max-h-[42rem] flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface xl:sticky xl:top-20 xl:max-h-[calc(100vh-7rem)]`,children:[(0,X.jsxs)(`div`,{className:`shrink-0 border-b border-edge-subtle p-3`,children:[K?null:(0,X.jsxs)(d,{"aria-label":l.filters.project,className:Q,value:G,onChange:e=>tr(e.target.value),children:[(0,X.jsx)(f,{value:``,children:l.filters.allProjects}),Bn.map(e=>(0,X.jsx)(f,{value:e.id,children:e.name},e.id))]}),(0,X.jsxs)(`div`,{className:y(`flex items-center gap-2`,!K&&`mt-2`),children:[(0,X.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg-muted focus-within:border-accent`,children:[(0,X.jsx)(re,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`input`,{className:`min-w-0 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-subtle`,value:ke,onChange:e=>Pe(e.target.value),placeholder:l.filters.search,"aria-label":l.filters.search})]}),(0,X.jsxs)(k,{children:[(0,X.jsx)(A,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:y(`inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-edge bg-surface-panel px-3 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,Qn>0&&`border-accent/40 bg-accent/8 text-accent-fg`),"aria-label":l.filters.more,children:[(0,X.jsx)(P,{className:`size-4`,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:l.filters.more}),Qn>0?(0,X.jsx)(`span`,{className:`inline-flex min-w-5 items-center justify-center rounded-full bg-accent px-1.5 text-[11px] leading-5 text-on-accent`,children:Qn}):null]})}),(0,X.jsx)(E,{children:(0,X.jsxs)(O,{align:`end`,sideOffset:6,className:`z-[90] w-[min(22rem,calc(100vw-2rem))] rounded-xl border border-edge bg-surface-overlay p-3 shadow-popover outline-none`,children:[(0,X.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:l.filters.status}),(0,X.jsx)(I,{className:`mt-2 flex flex-wrap gap-1`,role:`group`,"aria-label":l.filters.status,indicatorClassName:`rounded-md bg-surface-active`,children:[{id:`all`,label:l.filters.all},{id:`active`,label:l.filters.active},{id:`running`,label:l.metrics.running},{id:`paused`,label:l.paused},{id:`attention`,label:l.experience.executionIssues}].map(e=>(0,X.jsx)(`button`,{type:`button`,className:y(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,we===e.id&&`bg-surface-active text-fg`),onClick:()=>Ae(e.id),"aria-pressed":we===e.id,children:e.label},e.id))}),(0,X.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,X.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:l.filters.executor}),(0,X.jsx)(I,{className:`mt-2 flex flex-wrap gap-1`,role:`group`,"aria-label":l.filters.executor,indicatorClassName:`rounded-md border border-edge bg-surface-active`,children:[{id:`all`,label:l.filters.allSources,icon:B},{id:`agent`,label:l.sources.agent,icon:xe},{id:`task_command`,label:l.sources.task,icon:m},{id:`browser_automation`,label:l.sources.browser,icon:R}].map(e=>(0,X.jsxs)(`button`,{type:`button`,className:y(`flex min-h-8 items-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg`,q===e.id&&`border-edge bg-surface-active text-fg`),onClick:()=>Fe(e.id),"aria-pressed":q===e.id,children:[(0,X.jsx)(e.icon,{className:`size-3.5`,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:e.label}),(0,X.jsx)(`span`,{className:`text-fg-subtle`,children:Zn[e.id]})]},e.id))})]}),Qn>0?(0,X.jsx)(`div`,{className:`mt-3 flex justify-end border-t border-edge-subtle pt-3`,children:(0,X.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-accent-fg hover:underline`,onClick:Ie,children:l.filters.clear})}):null]})})]})]}),(0,X.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3`,children:[(0,X.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:l.filters.ownership}),(0,X.jsxs)(I,{className:`flex rounded-lg bg-surface-panel p-0.5`,role:`group`,"aria-label":l.filters.ownership,indicatorClassName:`rounded-md bg-surface-base shadow-sm`,children:[(0,X.jsxs)(`button`,{type:`button`,className:y(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,Te===`user`&&`bg-surface-base text-fg shadow-sm`),onClick:()=>Ne(`user`),"aria-pressed":Te===`user`,children:[l.filters.userManaged,` · `,yn.length]}),(0,X.jsxs)(`button`,{type:`button`,className:y(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,Te===`system`&&`bg-surface-base text-fg shadow-sm`),onClick:()=>Ne(`system`),"aria-pressed":Te===`system`,children:[l.system.title,` · `,bn.length]})]})]}),jn.length>0&&Te===`user`?(0,X.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2 rounded-md bg-accent/8 px-2.5 py-1.5 text-xs text-accent-fg`,children:[(0,X.jsxs)(`span`,{children:[l.filters.unread,` · `,jn.length]}),(0,X.jsx)(`button`,{type:`button`,className:`font-medium hover:underline`,disabled:Yt===`runs:read-all`,onClick:()=>void mr(),children:l.filters.markAllRead})]}):null,(0,X.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3 text-xs text-fg-muted`,children:[(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[mn?(0,X.jsx)(_,{className:`size-3 animate-spin`,"aria-hidden":!0}):null,mn?l.loading:l.filters.results.replace(`{count}`,String(In.length))]}),we!==`all`||q!==`all`||Mn?(0,X.jsx)(`button`,{type:`button`,className:`font-medium text-accent-fg hover:underline`,onClick:Ie,children:l.filters.clear}):null]})]}),(0,X.jsx)(Kt,{automations:In,runs:Pn,labels:l,cronLabels:p,language:a,selectedAutomationId:rt,onOpenDetails:ur})]}),Dn?(0,X.jsx)(Qt,{automation:Dn,runs:kn,runsLoading:on.isLoading,runsError:on.error?l.feedback.actionFailed:void 0,labels:l,cronLabels:p,language:a,projects:Bn,busyAction:Yt,onEdit:ar,onSelectRun:lr,onAction:pr},Dn.id):(0,X.jsx)(`div`,{className:`min-h-[28rem] overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,children:Te===`user`&&Nn.length===0?(0,X.jsxs)(`div`,{className:`p-5`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:l.experience.starterTemplates}),(0,X.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:l.experience.starterTemplatesDescription}),(0,X.jsx)(Rt,{templates:Gn,labels:l,onSelect:ir}),(0,X.jsx)(w,{className:`mt-4`,variant:`ghost`,onClick:()=>nr(`draft`),children:l.experience.custom})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(sn,{className:`min-h-56 rounded-none border-0 shadow-none`,icon:(0,X.jsx)(B,{className:`size-5`}),title:Nn.length===0?l.empty.automations:l.empty.filtered}),Nn.length>0?(0,X.jsx)(`div`,{className:`flex justify-center border-t border-edge-subtle p-4`,children:(0,X.jsx)(w,{variant:`ghost`,onClick:Ie,children:l.filters.clear})}):null]})})]}),!pn&&yn.length>0?(0,X.jsx)(`div`,{children:(0,X.jsxs)(w,{variant:`ghost`,onClick:()=>nr(`draft`),children:[(0,X.jsx)(z,{className:`size-4`,"aria-hidden":!0}),l.experience.discover]})}):null]})]}),(0,X.jsx)(Ce,{open:ze,onOpenChange:e=>{Be(e),e||(We(null),Ke(!1))},children:(0,X.jsxs)(le,{children:[(0,X.jsx)(se,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,X.jsxs)(ce,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-66 flex h-[min(760px,calc(100vh-2rem))] w-[min(100%-2rem,48rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge px-5 py-4`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(L,{className:`text-base font-semibold text-fg`,children:Ve===`draft`?l.draft.title:On?l.editTitle:Ge?l.draft.editTitle:l.createTitle}),(0,X.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:Ve===`draft`?l.draft.subtitle:l.form.createFlowHint})]}),(0,X.jsx)(N,{asChild:!0,children:(0,X.jsx)(w,{variant:`ghost`,"aria-label":l.close,children:(0,X.jsx)(de,{className:`size-4`})})})]}),Je?(0,X.jsx)(`p`,{role:`alert`,className:`px-5 py-2 text-sm text-red-700 dark:text-red-300`,children:Je}):null,Ve===`draft`?(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,X.jsx)(Bt,{labels:l,prompt:at,draft:ft,loading:bt,approved:St,publishBusy:Yt===`draft:publish`,testBusy:Yt===`draft:test`,templates:Gn,projects:Bn,projectId:wt,conversationMode:Et,notificationPolicy:kt,onPromptChange:ut,onGenerate:hr,onEdit:or,onPublish:gr,onTest:_r,onProjectChange:Tt,onConversationModeChange:Dt,onNotificationPolicyChange:Mt,projectLocked:K,onApprovedChange:Ct,onDiscard:()=>{yt(null),Ct(!1)},onTemplateSelect:e=>{ir(e),qe({...e.form,projectId:wt})},onOpenAdvanced:()=>{qe({...$e,projectId:wt,conversationMode:Et,notificationPolicy:kt}),He(`blank`)}})}):(0,X.jsxs)(X.Fragment,{children:[Hn?(0,X.jsx)(zt,{form:Z,setForm:qe,labels:l}):Ve===`quick`&&Le?(0,X.jsx)(dt,{form:Z,setForm:qe,labels:l,projects:Bn,projectLocked:K,source:Le.source,requiresProject:Le.requiresProject}):(0,X.jsx)(cn,{form:Z,labels:l,setForm:qe,projects:Bn,browserAutomations:Ln,selectedBrowserAutomation:Vn,browserAutomationsLoading:un.isLoading,agentOptions:Rn,agentsLoading:$.isLoading,defaultAgentId:$.data?.defaultId??``,taskOptions:zn,tasksLoading:dn.isLoading,language:a,projectLocked:K}),(0,X.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2 border-t border-edge px-5 py-4`,children:[Ve===`quick`?(0,X.jsx)(w,{variant:`ghost`,onClick:()=>He(`blank`),children:l.draft.advancedCreate}):null,Ge?(0,X.jsx)(w,{variant:`ghost`,onClick:()=>{Ke(!1),He(`draft`)},children:l.cancel}):(0,X.jsx)(N,{asChild:!0,children:(0,X.jsx)(w,{variant:`ghost`,children:l.cancel})}),(0,X.jsx)(w,{variant:`primary`,onClick:fr,disabled:!Wn||!!Yt||Ve===`quick`&&!!Le?.requiresProject&&!Z.projectId,children:Yt===`automation:create`||Yt===`draft:edit`||On&&Yt===`automation:${On.id}:edit`?l.feedback.working:On||Ge?l.save:l.experience.createEnabled})]})]})]})]})}),(0,X.jsx)(Ce,{open:et&&!!En,onOpenChange:e=>{nt(e),!e&&T(e=>{let t=new URLSearchParams(e);return t.delete(`run`),t},{replace:!0})},children:(0,X.jsxs)(le,{children:[(0,X.jsx)(se,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,X.jsxs)(ce,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-66 flex h-[min(85vh,40rem)] w-[min(100%-2rem,32rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[(0,X.jsx)(L,{className:`truncate text-base font-semibold text-fg`,children:En?.automationName??l.dashboard.result}),(0,X.jsx)(N,{asChild:!0,children:(0,X.jsx)(w,{variant:`ghost`,"aria-label":l.close,children:(0,X.jsx)(de,{className:`size-4`})})})]}),(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,X.jsx)(Zt,{className:`rounded-none border-0`,run:En,events:An,labels:l,cronLabels:p,language:a,loading:ln.isLoading,repairDraft:Ft,repairLoading:Lt,repairApproved:Ht,busyAction:Yt,onRepairApprovedChange:Ut,onSuggestRepair:vr,onApplyRepair:yr})})]})]})})]})}function Rt(e){let t=(0,Fe.c)(9),{templates:n,labels:r,onSelect:i}=e,a;if(t[0]!==r||t[1]!==i||t[2]!==n){let e;t[4]!==r||t[5]!==i?(e=e=>(0,X.jsxs)(`button`,{type:`button`,onClick:()=>i(e),className:`rounded-lg border border-edge-subtle bg-surface-panel p-4 text-left hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,X.jsx)(ee,{className:`mb-3 size-4 text-accent-fg`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:e.name}),(0,X.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.description}),(0,X.jsxs)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:[r.experience.source,`: `,e.source]})]},e.name),t[4]=r,t[5]=i,t[6]=e):e=t[6],a=n.map(e),t[0]=r,t[1]=i,t[2]=n,t[3]=a}else a=t[3];let o;return t[7]===a?o=t[8]:(o=(0,X.jsx)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:a}),t[7]=a,t[8]=o),o}function zt(e){let t=(0,Fe.c)(48),{form:n,setForm:r,labels:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(t=>({...t,...e})),t[0]=r,t[1]=a);let o=a,s;t[2]!==i.form.trigger||t[3]!==i.form.triggerStepDescription?(s=(0,X.jsx)(dn,{step:`1`,title:i.form.trigger,description:i.form.triggerStepDescription}),t[2]=i.form.trigger,t[3]=i.form.triggerStepDescription,t[4]=s):s=t[4];let c;t[5]===o?c=t[6]:(c=e=>o({triggerMode:e.target.value}),t[5]=o,t[6]=c);let l;t[7]===i.trigger.daily?l=t[8]:(l=(0,X.jsx)(f,{value:`daily`,children:i.trigger.daily}),t[7]=i.trigger.daily,t[8]=l);let u;t[9]===i.trigger.weekly?u=t[10]:(u=(0,X.jsx)(f,{value:`weekly`,children:i.trigger.weekly}),t[9]=i.trigger.weekly,t[10]=u);let p;t[11]===i.trigger.interval?p=t[12]:(p=(0,X.jsx)(f,{value:`interval`,children:i.trigger.interval}),t[11]=i.trigger.interval,t[12]=p);let m;t[13]===i.trigger.customCron?m=t[14]:(m=(0,X.jsx)(f,{value:`cron`,children:i.trigger.customCron}),t[13]=i.trigger.customCron,t[14]=m);let h;t[15]!==n.triggerMode||t[16]!==c||t[17]!==l||t[18]!==u||t[19]!==p||t[20]!==m?(h=(0,X.jsxs)(d,{className:Q,value:n.triggerMode,onChange:c,children:[l,u,p,m]}),t[15]=n.triggerMode,t[16]=c,t[17]=l,t[18]=u,t[19]=p,t[20]=m,t[21]=h):h=t[21];let g;t[22]!==n.time||t[23]!==n.triggerMode||t[24]!==n.weekday||t[25]!==i.form.day||t[26]!==i.form.time||t[27]!==i.weekdays||t[28]!==o?(g=n.triggerMode===`daily`||n.triggerMode===`weekly`?(0,X.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,X.jsx)($,{label:i.form.time,children:(0,X.jsx)(Be,{value:n.time,onChange:e=>o({time:e}),ariaLabel:i.form.time})}),n.triggerMode===`weekly`?(0,X.jsx)($,{label:i.form.day,children:(0,X.jsxs)(d,{className:Q,value:n.weekday,onChange:e=>o({weekday:e.target.value}),children:[(0,X.jsx)(f,{value:`1`,children:i.weekdays.monday}),(0,X.jsx)(f,{value:`2`,children:i.weekdays.tuesday}),(0,X.jsx)(f,{value:`3`,children:i.weekdays.wednesday}),(0,X.jsx)(f,{value:`4`,children:i.weekdays.thursday}),(0,X.jsx)(f,{value:`5`,children:i.weekdays.friday}),(0,X.jsx)(f,{value:`6`,children:i.weekdays.saturday}),(0,X.jsx)(f,{value:`0`,children:i.weekdays.sunday})]})}):null]}):null,t[22]=n.time,t[23]=n.triggerMode,t[24]=n.weekday,t[25]=i.form.day,t[26]=i.form.time,t[27]=i.weekdays,t[28]=o,t[29]=g):g=t[29];let _;t[30]!==n.intervalUnit||t[31]!==n.intervalValue||t[32]!==n.triggerMode||t[33]!==i.form.intervalEvery||t[34]!==i.form.intervalUnits||t[35]!==o?(_=n.triggerMode===`interval`?(0,X.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,X.jsx)($,{label:i.form.intervalEvery,children:(0,X.jsx)(`input`,{className:Q,type:`number`,min:`1`,value:n.intervalValue,onChange:e=>o({intervalValue:e.target.value})})}),(0,X.jsx)($,{label:i.form.intervalUnits.minute,children:(0,X.jsxs)(d,{className:Q,value:n.intervalUnit,onChange:e=>o({intervalUnit:e.target.value}),children:[(0,X.jsx)(f,{value:`minute`,children:i.form.intervalUnits.minute}),(0,X.jsx)(f,{value:`hour`,children:i.form.intervalUnits.hour}),(0,X.jsx)(f,{value:`day`,children:i.form.intervalUnits.day}),(0,X.jsx)(f,{value:`week`,children:i.form.intervalUnits.week})]})})]}):null,t[30]=n.intervalUnit,t[31]=n.intervalValue,t[32]=n.triggerMode,t[33]=i.form.intervalEvery,t[34]=i.form.intervalUnits,t[35]=o,t[36]=_):_=t[36];let v;t[37]!==n.cronExpr||t[38]!==n.triggerMode||t[39]!==i.form.expression||t[40]!==o?(v=n.triggerMode===`cron`?(0,X.jsx)(`div`,{className:`mt-4`,children:(0,X.jsx)($,{label:i.form.expression,children:(0,X.jsx)(`input`,{className:Q,value:n.cronExpr,onChange:e=>o({cronExpr:e.target.value})})})}):null,t[37]=n.cronExpr,t[38]=n.triggerMode,t[39]=i.form.expression,t[40]=o,t[41]=v):v=t[41];let y;return t[42]!==_||t[43]!==v||t[44]!==s||t[45]!==h||t[46]!==g?(y=(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[s,h,g,_,v]}),t[42]=_,t[43]=v,t[44]=s,t[45]=h,t[46]=g,t[47]=y):y=t[47],y}function Bt(e){let t=(0,Fe.c)(110),{labels:n,prompt:r,draft:i,loading:a,approved:o,publishBusy:s,testBusy:c,templates:l,projects:u,projectId:p,conversationMode:m,notificationPolicy:h,onPromptChange:g,onGenerate:_,onEdit:v,onPublish:b,onTest:x,onProjectChange:S,onConversationModeChange:C,onNotificationPolicyChange:T,onApprovedChange:E,onDiscard:D,onTemplateSelect:O,onOpenAdvanced:k,projectLocked:A}=e,j=s===void 0?!1:s,M=c===void 0?!1:c,N=A===void 0?!1:A,P=!!(i&&i.simulation.requiredConfirmations.length>0),F;t[0]!==i||t[1]!==n.draft.advancedCreate||t[2]!==n.draft.suggestions||t[3]!==n.draft.suggestionsDescription||t[4]!==n.experience||t[5]!==k||t[6]!==O||t[7]!==l?(F=i?null:(0,X.jsxs)(`div`,{className:`mb-5 border-b border-edge-subtle pb-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.draft.suggestions}),(0,X.jsx)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:n.draft.suggestionsDescription})]}),(0,X.jsx)(w,{variant:`ghost`,onClick:k,children:n.draft.advancedCreate})]}),(0,X.jsx)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:l.map(e=>(0,X.jsxs)(`button`,{type:`button`,className:`focus-visible:ring-2 focus-visible:ring-accent rounded-lg border border-edge-subtle bg-surface-panel p-3 text-left hover:bg-surface-hover`,onClick:()=>O(e),children:[(0,X.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:e.name}),(0,X.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:e.description}),(0,X.jsxs)(`div`,{className:`mt-2 text-xs text-fg-muted`,children:[n.experience.source,`: `,e.source]})]},e.name))})]}),t[0]=i,t[1]=n.draft.advancedCreate,t[2]=n.draft.suggestions,t[3]=n.draft.suggestionsDescription,t[4]=n.experience,t[5]=k,t[6]=O,t[7]=l,t[8]=F):F=t[8];let ee;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,X.jsx)(xe,{className:`size-4 text-accent`}),t[9]=ee):ee=t[9];let I;t[10]===n.draft.title?I=t[11]:(I=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[ee,n.draft.title]}),t[10]=n.draft.title,t[11]=I);let L;t[12]===n.draft.subtitle?L=t[13]:(L=(0,X.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:n.draft.subtitle}),t[12]=n.draft.subtitle,t[13]=L);let ne;t[14]!==I||t[15]!==L?(ne=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[I,L]}),t[14]=I,t[15]=L,t[16]=ne):ne=t[16];let re;t[17]!==a||t[18]!==r?(re=a||!r.trim(),t[17]=a,t[18]=r,t[19]=re):re=t[19];let ie;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,X.jsx)(xe,{className:`size-4`}),t[20]=ie):ie=t[20];let ae=a?n.draft.generating:n.draft.generate,oe;t[21]!==_||t[22]!==ae||t[23]!==re?(oe=(0,X.jsxs)(w,{variant:`primary`,onClick:_,disabled:re,children:[ie,ae]}),t[21]=_,t[22]=ae,t[23]=re,t[24]=oe):oe=t[24];let R;t[25]!==oe||t[26]!==ne?(R=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[ne,oe]}),t[25]=oe,t[26]=ne,t[27]=R):R=t[27];let se;t[28]===g?se=t[29]:(se=e=>g(e.target.value),t[28]=g,t[29]=se);let ce;t[30]!==n.draft.placeholder||t[31]!==n.draft.title||t[32]!==r||t[33]!==se?(ce=(0,X.jsx)(`textarea`,{"aria-label":n.draft.title,className:`mt-4 min-h-20 w-full resize-y rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none focus:border-accent`,value:r,onChange:se,placeholder:n.draft.placeholder}),t[30]=n.draft.placeholder,t[31]=n.draft.title,t[32]=r,t[33]=se,t[34]=ce):ce=t[34];let le=N?`sm:grid-cols-2`:`sm:grid-cols-3`,z;t[35]===le?z=t[36]:(z=y(`mt-3 grid gap-3`,le),t[35]=le,t[36]=z);let B;t[37]!==n.draft.noProject||t[38]!==n.draft.project||t[39]!==S||t[40]!==p||t[41]!==N||t[42]!==u?(B=N?null:(0,X.jsx)($,{label:n.draft.project,children:(0,X.jsxs)(d,{className:Q,value:p,onChange:e=>S(e.target.value),children:[(0,X.jsx)(f,{value:``,children:n.draft.noProject}),u.map(Vt)]})}),t[37]=n.draft.noProject,t[38]=n.draft.project,t[39]=S,t[40]=p,t[41]=N,t[42]=u,t[43]=B):B=t[43];let ue;t[44]===C?ue=t[45]:(ue=e=>C(e.target.value),t[44]=C,t[45]=ue);let de;t[46]===n.draft.newConversation?de=t[47]:(de=(0,X.jsx)(f,{value:`new_session`,children:n.draft.newConversation}),t[46]=n.draft.newConversation,t[47]=de);let V;t[48]===n.draft.continuousConversation?V=t[49]:(V=(0,X.jsx)(f,{value:`continuous`,children:n.draft.continuousConversation}),t[48]=n.draft.continuousConversation,t[49]=V);let H;t[50]!==m||t[51]!==ue||t[52]!==de||t[53]!==V?(H=(0,X.jsxs)(d,{className:Q,value:m,onChange:ue,children:[de,V]}),t[50]=m,t[51]=ue,t[52]=de,t[53]=V,t[54]=H):H=t[54];let U;t[55]!==n.draft.conversation||t[56]!==H?(U=(0,X.jsx)($,{label:n.draft.conversation,children:H}),t[55]=n.draft.conversation,t[56]=H,t[57]=U):U=t[57];let W;t[58]===T?W=t[59]:(W=e=>T(e.target.value),t[58]=T,t[59]=W);let G;t[60]===n.draft.notifyAttention?G=t[61]:(G=(0,X.jsx)(f,{value:`attention`,children:n.draft.notifyAttention}),t[60]=n.draft.notifyAttention,t[61]=G);let pe;t[62]===n.draft.notifyAll?pe=t[63]:(pe=(0,X.jsx)(f,{value:`all`,children:n.draft.notifyAll}),t[62]=n.draft.notifyAll,t[63]=pe);let me;t[64]===n.draft.notifyNone?me=t[65]:(me=(0,X.jsx)(f,{value:`none`,children:n.draft.notifyNone}),t[64]=n.draft.notifyNone,t[65]=me);let he;t[66]!==h||t[67]!==W||t[68]!==G||t[69]!==pe||t[70]!==me?(he=(0,X.jsxs)(d,{className:Q,value:h,onChange:W,children:[G,pe,me]}),t[66]=h,t[67]=W,t[68]=G,t[69]=pe,t[70]=me,t[71]=he):he=t[71];let ge;t[72]!==n.draft.notifications||t[73]!==he?(ge=(0,X.jsx)($,{label:n.draft.notifications,children:he}),t[72]=n.draft.notifications,t[73]=he,t[74]=ge):ge=t[74];let _e;t[75]!==z||t[76]!==B||t[77]!==U||t[78]!==ge?(_e=(0,X.jsxs)(`div`,{className:z,children:[B,U,ge]}),t[75]=z,t[76]=B,t[77]=U,t[78]=ge,t[79]=_e):_e=t[79];let K;t[80]!==o||t[81]!==i||t[82]!==n.draft.approval||t[83]!==n.draft.assumptions||t[84]!==n.draft.discard||t[85]!==n.draft.edit||t[86]!==n.draft.publish||t[87]!==n.draft.review||t[88]!==n.draft.risks||t[89]!==n.draft.safety||t[90]!==n.draft.testOnce||t[91]!==n.draft.testing||t[92]!==n.feedback||t[93]!==n.info||t[94]!==n.none||t[95]!==E||t[96]!==D||t[97]!==v||t[98]!==b||t[99]!==x||t[100]!==j||t[101]!==P||t[102]!==M?(K=i?(0,X.jsxs)(`div`,{className:`mt-4 grid gap-3 rounded-lg bg-surface-base p-4 lg:grid-cols-[1fr_1fr]`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:i.automation.name}),i.automation.description?(0,X.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:i.automation.description}):null,(0,X.jsxs)(`div`,{className:`mt-3 grid gap-2 text-sm`,children:[(0,X.jsx)(on,{label:n.info.when,value:i.simulation.triggerSummary}),(0,X.jsx)(on,{label:n.info.run,value:i.simulation.actionSummary})]})]}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:n.draft.review}),(0,X.jsx)(Ht,{title:n.draft.safety,items:[...i.simulation.safetyNotes,...i.simulation.requiredConfirmations],empty:n.none}),(0,X.jsx)(Ht,{title:n.draft.assumptions,items:i.assumptions,empty:n.none}),(0,X.jsx)(Ht,{title:n.draft.risks,items:i.risks,empty:n.none}),P?(0,X.jsxs)(`label`,{className:`mt-4 flex items-start gap-2 text-sm text-fg`,children:[(0,X.jsx)(`input`,{className:`mt-1`,type:`checkbox`,checked:o,onChange:e=>E(e.target.checked)}),(0,X.jsx)(`span`,{children:n.draft.approval})]}):null,(0,X.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,X.jsx)(w,{variant:`ghost`,onClick:D,children:n.draft.discard}),(0,X.jsxs)(w,{variant:`secondary`,onClick:v,children:[(0,X.jsx)(fe,{className:`size-4`}),n.draft.edit]}),(0,X.jsxs)(w,{variant:`secondary`,onClick:x,disabled:M||j||P&&!o,children:[(0,X.jsx)(te,{className:`size-4`}),M?n.draft.testing:n.draft.testOnce]}),(0,X.jsx)(w,{variant:`primary`,onClick:b,disabled:j||P&&!o,children:j?n.feedback.working:n.draft.publish})]})]})]}):null,t[80]=o,t[81]=i,t[82]=n.draft.approval,t[83]=n.draft.assumptions,t[84]=n.draft.discard,t[85]=n.draft.edit,t[86]=n.draft.publish,t[87]=n.draft.review,t[88]=n.draft.risks,t[89]=n.draft.safety,t[90]=n.draft.testOnce,t[91]=n.draft.testing,t[92]=n.feedback,t[93]=n.info,t[94]=n.none,t[95]=E,t[96]=D,t[97]=v,t[98]=b,t[99]=x,t[100]=j,t[101]=P,t[102]=M,t[103]=K):K=t[103];let ve;return t[104]!==R||t[105]!==ce||t[106]!==_e||t[107]!==K||t[108]!==F?(ve=(0,X.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[F,R,ce,_e,K]}),t[104]=R,t[105]=ce,t[106]=_e,t[107]=K,t[108]=F,t[109]=ve):ve=t[109],ve}function Vt(e){return(0,X.jsx)(f,{value:e.id,children:e.name},e.id)}function Ht(e){let t=(0,Fe.c)(10),{title:n,items:r,empty:i}=e,a;t[0]===n?a=t[1]:(a=(0,X.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=a);let o;t[2]!==i||t[3]!==r?(o=r.length>0?r.map(Ut):(0,X.jsx)(`li`,{className:`text-fg-muted`,children:i}),t[2]=i,t[3]=r,t[4]=o):o=t[4];let s;t[5]===o?s=t[6]:(s=(0,X.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm text-fg`,children:o}),t[5]=o,t[6]=s);let c;return t[7]!==a||t[8]!==s?(c=(0,X.jsxs)(`div`,{className:`mt-3`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function Ut(e){return(0,X.jsxs)(`li`,{children:[`- `,e]},e)}function Wt(e){let t=(0,Fe.c)(25),{icon:n,label:r,value:i,tone:a,active:o,onClick:s}=e,c=a===void 0?`default`:a,l=c===`danger`?`text-red-600 dark:text-red-300`:`text-fg-subtle`,u;t[0]===l?u=t[1]:(u=y(`shrink-0`,l),t[0]=l,t[1]=u);let d;t[2]!==n||t[3]!==u?(d=(0,X.jsx)(`span`,{className:u,children:n}),t[2]=n,t[3]=u,t[4]=d):d=t[4];let f;t[5]===r?f=t[6]:(f=(0,X.jsx)(`span`,{className:`truncate text-xs font-medium text-fg-muted`,children:r}),t[5]=r,t[6]=f);let p=c===`danger`?`text-red-700 dark:text-red-300`:`text-fg`,m;t[7]===p?m=t[8]:(m=y(`ml-auto truncate text-sm font-semibold tabular-nums`,p),t[7]=p,t[8]=m);let h;t[9]!==m||t[10]!==i?(h=(0,X.jsx)(`span`,{className:m,children:i}),t[9]=m,t[10]=i,t[11]=h):h=t[11];let g;t[12]!==d||t[13]!==f||t[14]!==h?(g=(0,X.jsxs)(X.Fragment,{children:[d,f,h]}),t[12]=d,t[13]=f,t[14]=h,t[15]=g):g=t[15];let _=g,v=o&&`bg-accent/8`,b=s&&`cursor-pointer hover:bg-surface-hover focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,x;t[16]!==v||t[17]!==b?(x=y(`flex min-h-12 min-w-0 items-center gap-2.5 bg-surface-base px-3 py-2.5 text-left transition-colors`,v,b),t[16]=v,t[17]=b,t[18]=x):x=t[18];let S=x,C=`${r}: ${i}`,w;return t[19]!==C||t[20]!==o||t[21]!==S||t[22]!==_||t[23]!==s?(w=s?(0,X.jsx)(`button`,{type:`button`,className:S,onClick:s,"aria-label":C,"aria-pressed":o,children:_}):(0,X.jsx)(`div`,{className:S,"aria-label":C,children:_}),t[19]=C,t[20]=o,t[21]=S,t[22]=_,t[23]=s,t[24]=w):w=t[24],w}function Gt(e){let t=(0,Fe.c)(74),{runs:n,ownership:r,labels:i,language:a,unreadCount:o,loading:s,onOwnershipChange:c,onRefresh:l,onSelectRun:u}=e,d;t[0]===n?d=t[1]:(d=n.filter(Ot),t[0]=n,t[1]=d);let f=d.length,p;t[2]===n?p=t[3]:(p=n.filter(kt),t[2]=n,t[3]=p);let h=p.length,g;t[4]===i.dashboard.activity?g=t[5]:(g=(0,X.jsx)(`h2`,{id:`automation-activity-title`,className:`text-sm font-semibold text-fg`,children:i.dashboard.activity}),t[4]=i.dashboard.activity,t[5]=g);let _;t[6]===i.dashboard.activityDescription?_=t[7]:(_=(0,X.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:i.dashboard.activityDescription}),t[6]=i.dashboard.activityDescription,t[7]=_);let v;t[8]!==g||t[9]!==_?(v=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[g,_]}),t[8]=g,t[9]=_,t[10]=v):v=t[10];let b=i.filters.ownership,x=r===`user`&&`bg-surface-base text-fg shadow-sm`,S;t[11]===x?S=t[12]:(S=y(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,x),t[11]=x,t[12]=S);let C;t[13]===c?C=t[14]:(C=()=>c(`user`),t[13]=c,t[14]=C);let w=r===`user`,T;t[15]!==i.filters.userManaged||t[16]!==w||t[17]!==S||t[18]!==C?(T=(0,X.jsx)(`button`,{type:`button`,className:S,onClick:C,"aria-pressed":w,children:i.filters.userManaged}),t[15]=i.filters.userManaged,t[16]=w,t[17]=S,t[18]=C,t[19]=T):T=t[19];let E=r===`system`&&`bg-surface-base text-fg shadow-sm`,D;t[20]===E?D=t[21]:(D=y(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,E),t[20]=E,t[21]=D);let O;t[22]===c?O=t[23]:(O=()=>c(`system`),t[22]=c,t[23]=O);let k=r===`system`,A;t[24]!==i.system.title||t[25]!==D||t[26]!==O||t[27]!==k?(A=(0,X.jsx)(`button`,{type:`button`,className:D,onClick:O,"aria-pressed":k,children:i.system.title}),t[24]=i.system.title,t[25]=D,t[26]=O,t[27]=k,t[28]=A):A=t[28];let M;t[29]!==i.filters.ownership||t[30]!==T||t[31]!==A?(M=(0,X.jsxs)(I,{className:`flex rounded-lg bg-surface-panel p-0.5`,role:`group`,"aria-label":b,indicatorClassName:`rounded-md bg-surface-base shadow-sm`,children:[T,A]}),t[29]=i.filters.ownership,t[30]=T,t[31]=A,t[32]=M):M=t[32];let N;t[33]!==i.refresh||t[34]!==s||t[35]!==l?(N=(0,X.jsx)(me,{className:`size-9 shrink-0 p-0`,loading:s,label:i.refresh,onClick:l}),t[33]=i.refresh,t[34]=s,t[35]=l,t[36]=N):N=t[36];let P;t[37]!==M||t[38]!==N?(P=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[M,N]}),t[37]=M,t[38]=N,t[39]=P):P=t[39];let F;t[40]!==P||t[41]!==v?(F=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 border-b border-edge-subtle px-4 py-3 sm:px-5`,children:[v,P]}),t[40]=P,t[41]=v,t[42]=F):F=t[42];let ee;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,X.jsx)(j,{className:`size-4`,"aria-hidden":!0}),t[43]=ee):ee=t[43];let L=i.metrics.total,ne=String(n.length),re;t[44]!==i.metrics.total||t[45]!==ne?(re=(0,X.jsx)(Wt,{icon:ee,label:L,value:ne}),t[44]=i.metrics.total,t[45]=ne,t[46]=re):re=t[46];let ie;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,X.jsx)(te,{className:`size-4`,"aria-hidden":!0}),t[47]=ie):ie=t[47];let ae=i.metrics.running,oe=String(f),R;t[48]!==i.metrics.running||t[49]!==oe?(R=(0,X.jsx)(Wt,{icon:ie,label:ae,value:oe}),t[48]=i.metrics.running,t[49]=oe,t[50]=R):R=t[50];let se;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,X.jsx)(he,{className:`size-4`,"aria-hidden":!0}),t[51]=se):se=t[51];let ce=i.dashboard.needsAttention,le=String(h),z=h>0?`danger`:`default`,B;t[52]!==i.dashboard.needsAttention||t[53]!==le||t[54]!==z?(B=(0,X.jsx)(Wt,{icon:se,label:ce,value:le,tone:z}),t[52]=i.dashboard.needsAttention,t[53]=le,t[54]=z,t[55]=B):B=t[55];let ue;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,X.jsx)(m,{className:`size-4`,"aria-hidden":!0}),t[56]=ue):ue=t[56];let de=i.filters.unread,fe=String(o),V;t[57]!==i.filters.unread||t[58]!==fe?(V=(0,X.jsx)(Wt,{icon:ue,label:de,value:fe}),t[57]=i.filters.unread,t[58]=fe,t[59]=V):V=t[59];let H;t[60]!==re||t[61]!==R||t[62]!==B||t[63]!==V?(H=(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-px border-b border-edge-subtle bg-edge-subtle lg:grid-cols-4`,children:[re,R,B,V]}),t[60]=re,t[61]=R,t[62]=B,t[63]=V,t[64]=H):H=t[64];let U;t[65]!==i||t[66]!==a||t[67]!==u||t[68]!==n?(U=n.length===0?(0,X.jsx)(sn,{className:`min-h-64 rounded-none border-0 shadow-none`,icon:(0,X.jsx)(j,{className:`size-5`}),title:i.empty.runs}):(0,X.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:n.map(e=>(0,X.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-start gap-3 px-4 py-3 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent sm:px-5`,onClick:()=>u(e.id),children:[(0,X.jsx)(`span`,{className:y(`mt-1.5 size-2 shrink-0 rounded-full`,Ot(e)?`bg-blue-500`:kt(e)?`bg-red-500`:`bg-emerald-500`),"aria-hidden":!0}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.automationName}),e.readAtMs==null&&!Ot(e)?(0,X.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-blue-500`,children:(0,X.jsx)(`span`,{className:`sr-only`,children:i.filters.unread})}):null]}),(0,X.jsx)(`span`,{className:y(`mt-1 line-clamp-2 block text-sm text-fg-muted`,e.error&&`text-red-700 dark:text-red-300`),children:e.error||e.summary||i.status[e.status]}),(0,X.jsx)(`span`,{className:`mt-1 block text-xs text-fg-subtle`,children:yt(e.createdAtMs,i,a)})]}),(0,X.jsx)(`span`,{className:y(`shrink-0 rounded-full px-2 py-0.5 text-xs`,Et(e.status)),children:i.status[e.status]})]},e.id))}),t[65]=i,t[66]=a,t[67]=u,t[68]=n,t[69]=U):U=t[69];let W;return t[70]!==F||t[71]!==H||t[72]!==U?(W=(0,X.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,"aria-labelledby":`automation-activity-title`,children:[F,H,U]}),t[70]=F,t[71]=H,t[72]=U,t[73]=W):W=t[73],W}function Kt(e){let t=(0,Fe.c)(20),{automations:n,runs:r,labels:i,cronLabels:a,language:o,selectedAutomationId:s,onOpenDetails:c}=e;if(n.length===0){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(B,{className:`size-5`}),t[0]=e):e=t[0];let n;return t[1]===i.empty.filtered?n=t[2]:(n=(0,X.jsx)(sn,{className:`rounded-none border-0 shadow-none`,icon:e,title:i.empty.filtered}),t[1]=i.empty.filtered,t[2]=n),n}let l;if(t[3]!==n||t[4]!==a||t[5]!==i||t[6]!==o||t[7]!==c||t[8]!==r||t[9]!==s){let e;t[11]!==a||t[12]!==i||t[13]!==o||t[14]!==c||t[15]!==r||t[16]!==s?(e=e=>{let t=r.filter(t=>t.automationId===e.id).sort(qt),n=t.find(Ot),l=t[0];return(0,X.jsxs)(`button`,{type:`button`,className:y(`block w-full p-3 text-left outline-none hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,s===e.id&&`bg-surface-hover`),style:{contentVisibility:`auto`,containIntrinsicSize:`auto 130px`},"aria-current":s===e.id?`true`:void 0,onClick:()=>c(e.id),children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`span`,{className:y(`size-2 shrink-0 rounded-full`,n?`bg-blue-500`:gt(e,t)?`bg-red-500`:e.enabled?`bg-emerald-500`:`bg-fg-subtle`)}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-fg`,children:e.name}),(0,X.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:e.enabled?i.enabled:i.paused}),l&&l.readAtMs==null&&!Ot(l)?(0,X.jsx)(`span`,{className:`ml-auto size-2 shrink-0 rounded-full bg-blue-500`,children:(0,X.jsx)(`span`,{className:`sr-only`,children:i.filters.unread})}):null]}),(0,X.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap items-center gap-1.5 pl-4 text-xs`,children:[(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-edge-subtle bg-surface-panel px-1.5 py-0.5 text-fg-muted`,children:[(0,X.jsx)(wt,{kind:e.action.kind,className:`size-3`}),xt(e.action,i)]}),(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 rounded-md bg-surface-panel px-1.5 py-0.5 text-fg-muted`,children:[(0,X.jsx)(ee,{className:`size-3 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:Ee(e.trigger,i,a,o)})]})]}),(0,X.jsxs)(`div`,{className:`mt-2 flex min-w-0 items-center justify-between gap-2 pl-4 text-xs text-fg-subtle`,children:[(0,X.jsx)(`span`,{className:y(`line-clamp-2`,l?.error&&`text-red-700 dark:text-red-300`),children:l?l.error||l.summary||i.status[l.status]:e.state.lastError||(e.state.lastRunStatus?i.status[e.state.lastRunStatus]:i.experience.noRuns)}),l?.status?(0,X.jsx)(`span`,{className:y(`shrink-0 rounded-full px-1.5 py-0.5`,Et(l.status)),children:i.status[l.status]}):null]}),(0,X.jsxs)(`div`,{className:`mt-2 space-y-1 pl-4 text-xs text-fg-muted`,children:[l?(0,X.jsxs)(`div`,{children:[i.last,`: `,yt(l.createdAtMs,i,o)]}):null,(0,X.jsx)(`div`,{children:e.enabled?`${i.next}: ${ke(e,i,o)}`:i.paused})]})]},e.id)},t[11]=a,t[12]=i,t[13]=o,t[14]=c,t[15]=r,t[16]=s,t[17]=e):e=t[17],l=n.map(e),t[3]=n,t[4]=a,t[5]=i,t[6]=o,t[7]=c,t[8]=r,t[9]=s,t[10]=l}else l=t[10];let u;return t[18]===l?u=t[19]:(u=(0,X.jsx)(`div`,{className:`min-h-0 overflow-y-auto divide-y divide-edge-subtle`,children:l}),t[18]=l,t[19]=u),u}function qt(e,t){return t.createdAtMs-e.createdAtMs}function Jt(e,t){let n=t.events,r=e.data&&typeof e.data==`object`?e.data:{},i=typeof r.actionKind==`string`?r.actionKind:null,a=typeof r.status==`string`&&r.status in t.status?t.status[r.status]:null;switch(e.type){case`run.queued`:return e.message.toLowerCase().includes(`manual`)?n.manualQueued:e.message.toLowerCase().includes(`scheduled`)?n.scheduledQueued:n.eventQueued;case`run.started`:return n.runStarted;case`action.started`:return i?n.actionStarted.replace(`{kind}`,i):n.actionStartedFallback;case`action.completed`:return i?n.actionCompleted.replace(`{kind}`,i):n.actionCompletedFallback;case`action.failed`:return i?n.actionFailed.replace(`{kind}`,i):n.actionFailedFallback;case`run.completed`:return a?n.runCompleted.replace(`{status}`,a):n.runCompletedFallback;default:return e.message}}function Yt(e){let t=(0,Fe.c)(17),{value:n,labels:r,title:i,defaultExpanded:a}=e,[o,s]=(0,Y.useState)(a===void 0?!1:a),l;t[0]===n?l=t[1]:(l=JSON.stringify(n,null,2),t[0]=n,t[1]=l);let u=l,d;t[2]===u?d=t[3]:(d=u.split(`
4
- `),t[2]=u,t[3]=d);let f=d.length,p=u.length>720||f>18,m;t[4]!==p||t[5]!==u?(m=p?`${u.split(`
5
- `).slice(0,10).join(`
6
- `).trimEnd()}...`:u,t[4]=p,t[5]=u,t[6]=m):m=t[6];let h=m,g;t[7]!==o||t[8]!==p||t[9]!==r||t[10]!==i?(g=p?(0,X.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 px-2.5 py-2 text-left text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,onClick:()=>s(Xt),"aria-expanded":o,children:[(0,X.jsx)(`span`,{children:i}),(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-accent-fg`,children:[o?r.details.hideDetails:r.details.showDetails,(0,X.jsx)(c,{className:y(`size-3.5 transition-transform`,o&&`rotate-180`),"aria-hidden":!0})]})]}):(0,X.jsx)(`div`,{className:`px-2.5 py-2 text-xs font-medium text-fg-muted`,children:i}),t[7]=o,t[8]=p,t[9]=r,t[10]=i,t[11]=g):g=t[11];let _=o||!p?u:h,v;t[12]===_?v=t[13]:(v=(0,X.jsx)(`pre`,{className:`whitespace-pre-wrap break-all px-2.5 pb-2 text-xs leading-relaxed text-fg-muted`,children:_}),t[12]=_,t[13]=v);let b;return t[14]!==g||t[15]!==v?(b=(0,X.jsxs)(`div`,{className:`mt-2 rounded-md border border-edge/70 bg-surface-inset/35`,children:[g,v]}),t[14]=g,t[15]=v,t[16]=b):b=t[16],b}function Xt(e){return!e}function Zt(e){let t=(0,Fe.c)(148),{className:n,run:r,events:i,labels:o,cronLabels:s,language:l,loading:u,repairDraft:d,repairLoading:f,repairApproved:p,busyAction:h,onRepairApprovedChange:g,onSuggestRepair:_,onApplyRepair:v}=e;if(!r){let e;t[0]===n?e=t[1]:(e=y(`flex min-h-64 flex-col justify-center rounded-lg border border-edge-subtle bg-surface-base px-4 text-center text-sm text-fg-muted shadow-surface`,n),t[0]=n,t[1]=e);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(j,{className:`mx-auto size-5`}),t[2]=r):r=t[2];let i;t[3]===o.selectRun?i=t[4]:(i=(0,X.jsx)(`div`,{className:`mt-2`,children:o.selectRun}),t[3]=o.selectRun,t[4]=i);let a;return t[5]!==e||t[6]!==i?(a=(0,X.jsxs)(`aside`,{className:e,children:[r,i]}),t[5]=e,t[6]=i,t[7]=a):a=t[7],a}let b=r.error||r.summary,x=r.conversationId?`/chat/${encodeURIComponent(r.conversationId)}`:null,S=(r.conversationId,o.runDetail.openConversation),C=r.conversationId?pe:ue,E=Ot(r)?j:r.status===`succeeded`?m:he,D;t[8]===n?D=t[9]:(D=y(`rounded-lg border border-edge-subtle bg-surface-base shadow-surface`,n),t[8]=n,t[9]=D);let O;t[10]===r.automationName?O=t[11]:(O=(0,X.jsx)(`div`,{className:`truncate text-sm font-semibold text-fg`,children:r.automationName}),t[10]=r.automationName,t[11]=O);let k;t[12]===r.id?k=t[13]:(k=r.id.slice(0,8),t[12]=r.id,t[13]=k);let A;t[14]===k?A=t[15]:(A=(0,X.jsx)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:k}),t[14]=k,t[15]=A);let M;t[16]!==O||t[17]!==A?(M=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[O,A]}),t[16]=O,t[17]=A,t[18]=M):M=t[18];let N;t[19]===r.status?N=t[20]:(N=y(`shrink-0 rounded-full px-2 py-0.5 text-xs`,Et(r.status)),t[19]=r.status,t[20]=N);let P=o.status[r.status],F;t[21]!==N||t[22]!==P?(F=(0,X.jsx)(`span`,{className:N,children:P}),t[21]=N,t[22]=P,t[23]=F):F=t[23];let ee;t[24]!==M||t[25]!==F?(ee=(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[M,F]}),t[24]=M,t[25]=F,t[26]=ee):ee=t[26];let I;t[27]!==o||t[28]!==l||t[29]!==r.createdAtMs?(I=yt(r.createdAtMs,o,l),t[27]=o,t[28]=l,t[29]=r.createdAtMs,t[30]=I):I=t[30];let L;t[31]===I?L=t[32]:(L=(0,X.jsx)(`span`,{children:I}),t[31]=I,t[32]=L);let te;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,X.jsx)(`span`,{"aria-hidden":!0,children:`·`}),t[33]=te):te=t[33];let re=o.details.duration,ie;t[34]!==o||t[35]!==r.durationMs?(ie=Dt(r.durationMs,o),t[34]=o,t[35]=r.durationMs,t[36]=ie):ie=t[36];let ae;t[37]!==o.details.duration||t[38]!==ie?(ae=(0,X.jsxs)(`span`,{children:[re,` `,ie]}),t[37]=o.details.duration,t[38]=ie,t[39]=ae):ae=t[39];let oe;t[40]!==L||t[41]!==ae?(oe=(0,X.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-muted`,children:[L,te,ae]}),t[40]=L,t[41]=ae,t[42]=oe):oe=t[42];let se;t[43]!==o.repair||t[44]!==_||t[45]!==f||t[46]!==r?(se=r.status===`failed`||r.status===`timeout`||r.status===`cancelled`?(0,X.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,X.jsxs)(w,{variant:`secondary`,onClick:()=>_(r),disabled:f,children:[(0,X.jsx)(xe,{className:`size-4`}),f?o.repair.generating:o.repair.suggest]})}):null,t[43]=o.repair,t[44]=_,t[45]=f,t[46]=r,t[47]=se):se=t[47];let ce;t[48]!==oe||t[49]!==se||t[50]!==ee?(ce=(0,X.jsxs)(`div`,{className:`border-b border-edge px-4 py-3`,children:[ee,oe,se]}),t[48]=oe,t[49]=se,t[50]=ee,t[51]=ce):ce=t[51];let le;t[52]===r?le=t[53]:(le=Ot(r)?`text-blue-500`:kt(r)?`text-red-500`:r.status===`succeeded`?`text-emerald-500`:`text-fg-muted`,t[52]=r,t[53]=le);let z;t[54]===le?z=t[55]:(z=y(`size-4`,le),t[54]=le,t[55]=z);let B;t[56]!==E||t[57]!==z?(B=(0,X.jsx)(E,{className:z}),t[56]=E,t[57]=z,t[58]=B):B=t[58];let de;t[59]!==o.runDetail.resultTitle||t[60]!==B?(de=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[B,o.runDetail.resultTitle]}),t[59]=o.runDetail.resultTitle,t[60]=B,t[61]=de):de=t[61];let fe;t[62]!==C||t[63]!==S||t[64]!==x?(fe=x?(0,X.jsx)(w,{asChild:!0,variant:`secondary`,className:`h-8 rounded-md px-2.5 text-xs`,children:(0,X.jsxs)(a,{to:x,children:[(0,X.jsx)(C,{className:`size-3.5`}),S,(0,X.jsx)(ne,{className:`size-3.5`})]})}):null,t[62]=C,t[63]=S,t[64]=x,t[65]=fe):fe=t[65];let V;t[66]!==de||t[67]!==fe?(V=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[de,fe]}),t[66]=de,t[67]=fe,t[68]=V):V=t[68];let H=r.error&&`border-red-500/25 bg-red-500/5`,U;t[69]===H?U=t[70]:(U=y(`mt-3 max-h-80 overflow-y-auto rounded-lg border border-edge/70 bg-surface-inset/25 p-3`,H),t[69]=H,t[70]=U);let W;t[71]!==o.runDetail.noResult||t[72]!==o.runDetail.resultPending||t[73]!==b||t[74]!==r?(W=b?r.error?(0,X.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm leading-relaxed text-red-700 dark:text-red-300`,children:b}):(0,X.jsx)(G,{content:b,compact:!0,className:`text-sm`}):(0,X.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:Ot(r)?o.runDetail.resultPending:o.runDetail.noResult}),t[71]=o.runDetail.noResult,t[72]=o.runDetail.resultPending,t[73]=b,t[74]=r,t[75]=W):W=t[75];let me;t[76]!==U||t[77]!==W?(me=(0,X.jsx)(`div`,{className:U,children:W}),t[76]=U,t[77]=W,t[78]=me):me=t[78];let ge;t[79]!==V||t[80]!==me?(ge=(0,X.jsxs)(`section`,{className:`border-b border-edge p-4`,children:[V,me]}),t[79]=V,t[80]=me,t[81]=ge):ge=t[81];let _e;t[82]===o.runDetail.runInfo?_e=t[83]:(_e=(0,X.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:o.runDetail.runInfo}),t[82]=o.runDetail.runInfo,t[83]=_e);let K;t[84]!==s||t[85]!==o||t[86]!==l||t[87]!==r.manual||t[88]!==r.triggerSnapshot?(K=r.manual?o.trigger.manual:Ee(r.triggerSnapshot,o,s,l),t[84]=s,t[85]=o,t[86]=l,t[87]=r.manual,t[88]=r.triggerSnapshot,t[89]=K):K=t[89];let ve;t[90]!==o.explain.whyRan||t[91]!==K?(ve=(0,X.jsx)(rn,{label:o.explain.whyRan,value:K}),t[90]=o.explain.whyRan,t[91]=K,t[92]=ve):ve=t[92];let ye=o.details.started,be;t[93]!==o||t[94]!==l||t[95]!==r.startedAtMs?(be=yt(r.startedAtMs,o,l),t[93]=o,t[94]=l,t[95]=r.startedAtMs,t[96]=be):be=t[96];let Se;t[97]!==o.details.started||t[98]!==be?(Se=(0,X.jsx)(rn,{label:ye,value:be}),t[97]=o.details.started,t[98]=be,t[99]=Se):Se=t[99];let Ce;t[100]!==o.details.model||t[101]!==r.model?(Ce=r.model?(0,X.jsx)(rn,{label:o.details.model,value:r.model}):null,t[100]=o.details.model,t[101]=r.model,t[102]=Ce):Ce=t[102];let we;t[103]!==ve||t[104]!==Se||t[105]!==Ce?(we=(0,X.jsxs)(`div`,{className:`mt-3 grid gap-2 text-xs text-fg-muted`,children:[ve,Se,Ce]}),t[103]=ve,t[104]=Se,t[105]=Ce,t[106]=we):we=t[106];let Te;t[107]!==_e||t[108]!==we?(Te=(0,X.jsxs)(`section`,{className:`border-b border-edge p-4`,children:[_e,we]}),t[107]=_e,t[108]=we,t[109]=Te):Te=t[109];let De;t[110]!==h||t[111]!==o||t[112]!==v||t[113]!==g||t[114]!==p||t[115]!==d||t[116]!==r?(De=d?(0,X.jsxs)(`div`,{className:`border-b border-edge px-4 py-3`,children:[(0,X.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:o.repair.title}),(0,X.jsx)(`div`,{className:`mt-2 text-sm text-fg`,children:d.explanation}),d.expectedEffect?(0,X.jsx)(`div`,{className:`mt-2 text-sm text-fg-muted`,children:d.expectedEffect}):null,(0,X.jsx)(Ht,{title:o.repair.risks,items:d.risks,empty:o.none}),(0,X.jsx)(Yt,{value:d.patch,labels:o,title:o.details.repairPatch}),d.requiresApproval?(0,X.jsxs)(`label`,{className:`mt-3 flex items-start gap-2 text-sm text-fg`,children:[(0,X.jsx)(`input`,{className:`mt-1`,type:`checkbox`,checked:p,onChange:e=>g(e.target.checked)}),(0,X.jsx)(`span`,{children:o.repair.approval})]}):null,(0,X.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,X.jsx)(w,{variant:`primary`,onClick:()=>v(r),disabled:h===`run:${r.id}:repair`||d.requiresApproval&&!p,children:h===`run:${r.id}:repair`?o.feedback.working:o.repair.apply})})]}):null,t[110]=h,t[111]=o,t[112]=v,t[113]=g,t[114]=p,t[115]=d,t[116]=r,t[117]=De):De=t[117];let Oe;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,X.jsx)(R,{className:`size-4 shrink-0`}),t[118]=Oe):Oe=t[118];let q;t[119]===o.runDetail.technicalEvents?q=t[120]:(q=(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium text-fg-muted`,children:[Oe,o.runDetail.technicalEvents]}),t[119]=o.runDetail.technicalEvents,t[120]=q);let ke;t[121]!==i.length||t[122]!==o.runDetail.eventCount?(ke=o.runDetail.eventCount.replace(`{count}`,String(i.length)),t[121]=i.length,t[122]=o.runDetail.eventCount,t[123]=ke):ke=t[123];let Ae;t[124]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,X.jsx)(c,{className:`size-4 transition-transform group-open:rotate-180`}),t[124]=Ae):Ae=t[124];let J;t[125]===ke?J=t[126]:(J=(0,X.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs text-fg-muted`,children:[ke,Ae]}),t[125]=ke,t[126]=J);let je;t[127]!==q||t[128]!==J?(je=(0,X.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 rounded-md outline-none hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:[q,J]}),t[127]=q,t[128]=J,t[129]=je):je=t[129];let Me;t[130]===o.runDetail.technicalEventsDescription?Me=t[131]:(Me=(0,X.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:o.runDetail.technicalEventsDescription}),t[130]=o.runDetail.technicalEventsDescription,t[131]=Me);let Ne;t[132]!==i||t[133]!==o||t[134]!==l||t[135]!==u?(Ne=(0,X.jsx)(`div`,{className:`mt-4`,children:u?(0,X.jsxs)(`div`,{className:`space-y-3`,"aria-label":o.loading,children:[(0,X.jsx)(T,{className:`h-10 w-full`}),(0,X.jsx)(T,{className:`h-10 w-4/5`}),(0,X.jsx)(T,{className:`h-10 w-11/12`})]}):i.length===0?(0,X.jsx)(`div`,{className:`text-sm text-fg-muted`,children:o.empty.events}):(0,X.jsx)(`ol`,{className:`space-y-3`,children:i.map(e=>(0,X.jsxs)(`li`,{className:`grid grid-cols-[0.75rem_1fr] gap-3`,children:[(0,X.jsx)(`span`,{className:y(`mt-1 size-2 rounded-full`,an(e.type))}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`div`,{className:`text-sm text-fg`,children:Jt(e,o)}),(0,X.jsxs)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:[yt(e.createdAtMs,o,l),` · `,e.type]}),e.data&&typeof e.data==`object`?(0,X.jsxs)(`details`,{className:`group/event mt-2 rounded-md border border-edge/70 bg-surface-inset/35`,children:[(0,X.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-2 px-2.5 py-2 text-xs font-medium text-fg-muted outline-none hover:text-fg`,children:[o.details.eventData,(0,X.jsx)(c,{className:`size-3.5 transition-transform group-open/event:rotate-180`})]}),(0,X.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-all border-t border-edge/70 px-2.5 py-2 text-xs leading-relaxed text-fg-muted`,children:JSON.stringify(e.data,null,2)})]}):null]})]},e.id))})}),t[132]=i,t[133]=o,t[134]=l,t[135]=u,t[136]=Ne):Ne=t[136];let Pe;t[137]!==je||t[138]!==Me||t[139]!==Ne?(Pe=(0,X.jsxs)(`details`,{className:`group px-4 py-3`,children:[je,Me,Ne]}),t[137]=je,t[138]=Me,t[139]=Ne,t[140]=Pe):Pe=t[140];let Y;return t[141]!==D||t[142]!==ce||t[143]!==ge||t[144]!==Te||t[145]!==De||t[146]!==Pe?(Y=(0,X.jsxs)(`aside`,{className:D,children:[ce,ge,Te,De,Pe]}),t[141]=D,t[142]=ce,t[143]=ge,t[144]=Te,t[145]=De,t[146]=Pe,t[147]=Y):Y=t[147],Y}function Qt(e){let t=(0,Fe.c)(146),{automation:n,runs:r,runsLoading:i,runsError:a,labels:o,cronLabels:s,language:c,projects:l,busyAction:u,onEdit:d,onSelectRun:f,onAction:p}=e,g=u===`automation:${n.id}:run`,v=u===`automation:${n.id}:toggle`,b=u===`automation:${n.id}:delete`,x;t[0]===n.management?x=t[1]:(x=!n.management||n.management.editable.includes(`enabled`),t[0]=n.management,t[1]=x);let S=x,C=!n.management||n.management.runnable,E;t[2]===n.management?E=t[3]:(E=!n.management||n.management.editable.includes(`trigger`),t[2]=n.management,t[3]=E);let D=E,O=!n.management||n.management.deletable,k;t[4]===n.name?k=t[5]:(k=(0,X.jsx)(`h2`,{className:`truncate text-lg font-semibold text-fg`,children:n.name}),t[4]=n.name,t[5]=k);let A=n.enabled?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:`bg-surface-hover text-fg-muted`,N;t[6]===A?N=t[7]:(N=y(`shrink-0 rounded-full px-2 py-0.5 text-xs`,A),t[6]=A,t[7]=N);let P=n.enabled?o.enabled:o.paused,F;t[8]!==N||t[9]!==P?(F=(0,X.jsx)(`span`,{className:N,children:P}),t[8]=N,t[9]=P,t[10]=F):F=t[10];let I;t[11]!==k||t[12]!==F?(I=(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[k,F]}),t[11]=k,t[12]=F,t[13]=I):I=t[13];let L;t[14]===n?L=t[15]:(L=jt(n)?(0,X.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:jt(n)}):null,t[14]=n,t[15]=L);let ne;t[16]===n.action.kind?ne=t[17]:(ne=(0,X.jsx)(wt,{kind:n.action.kind,className:`size-3.5`}),t[16]=n.action.kind,t[17]=ne);let re;t[18]!==n.action||t[19]!==o?(re=xt(n.action,o),t[18]=n.action,t[19]=o,t[20]=re):re=t[20];let ie;t[21]!==ne||t[22]!==re?(ie=(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-md border border-edge-subtle bg-surface-base px-2 py-1`,children:[ne,re]}),t[21]=ne,t[22]=re,t[23]=ie):ie=t[23];let ae;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,X.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),t[24]=ae):ae=t[24];let oe;t[25]!==n.trigger||t[26]!==s||t[27]!==o||t[28]!==c?(oe=Ee(n.trigger,o,s,c),t[25]=n.trigger,t[26]=s,t[27]=o,t[28]=c,t[29]=oe):oe=t[29];let R;t[30]===oe?R=t[31]:(R=(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-md border border-edge-subtle bg-surface-base px-2 py-1`,children:[ae,oe]}),t[30]=oe,t[31]=R);let se;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,X.jsx)(ue,{className:`size-3.5`,"aria-hidden":!0}),t[32]=se):se=t[32];let ce;t[33]!==n.projectId||t[34]!==o.info||t[35]!==l?(ce=l.find(e=>e.id===n.projectId)?.name??o.info.noProject,t[33]=n.projectId,t[34]=o.info,t[35]=l,t[36]=ce):ce=t[36];let le;t[37]===ce?le=t[38]:(le=(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-md border border-edge-subtle bg-surface-base px-2 py-1`,children:[se,ce]}),t[37]=ce,t[38]=le);let z;t[39]!==ie||t[40]!==R||t[41]!==le?(z=(0,X.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[ie,R,le]}),t[39]=ie,t[40]=R,t[41]=le,t[42]=z):z=t[42];let B;t[43]!==z||t[44]!==I||t[45]!==L?(B=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[I,L,z]}),t[43]=z,t[44]=I,t[45]=L,t[46]=B):B=t[46];let de;t[47]!==n||t[48]!==u||t[49]!==O||t[50]!==D||t[51]!==C||t[52]!==S||t[53]!==b||t[54]!==o.dashboard.delete||t[55]!==o.dashboard.deleted||t[56]!==o.dashboard.pause||t[57]!==o.dashboard.resume||t[58]!==o.dashboard.resumed||t[59]!==o.dashboard.runNow||t[60]!==o.details||t[61]!==o.edit||t[62]!==o.experience.deleteConfirm||t[63]!==o.feedback||t[64]!==p||t[65]!==d||t[66]!==g||t[67]!==v?(de=S||C||D||O?(0,X.jsxs)(`div`,{className:`flex w-full flex-wrap items-center gap-2`,children:[S?(0,X.jsxs)(w,{variant:`secondary`,disabled:u!==null,onClick:()=>void p(`automation:${n.id}:toggle`,()=>n.enabled?V.pause(n.id):V.resume(n.id),n.enabled?o.feedback.paused:o.dashboard.resumed),children:[v?(0,X.jsx)(_,{className:`size-4 animate-spin`}):n.enabled?(0,X.jsx)(M,{className:`size-4`}):(0,X.jsx)(te,{className:`size-4`}),n.enabled?o.dashboard.pause:o.dashboard.resume]}):null,C?(0,X.jsxs)(w,{variant:`primary`,disabled:u!==null,onClick:()=>void p(`automation:${n.id}:run`,()=>V.runNow(n.id),o.feedback.rerunQueued),children:[g?(0,X.jsx)(_,{className:`size-4 animate-spin`}):(0,X.jsx)(te,{className:`size-4`}),o.dashboard.runNow]}):null,D||O?(0,X.jsxs)(W,{children:[(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(w,{variant:`ghost`,className:`size-9 p-0`,"aria-label":o.details.moreActions,children:(0,X.jsx)(h,{className:`size-4`})})}),(0,X.jsx)(ye,{children:(0,X.jsxs)(H,{align:`end`,className:`z-70 min-w-40 rounded-lg border border-edge bg-surface-overlay p-1 shadow-popover`,children:[D?(0,X.jsxs)(ge,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover`,onSelect:()=>d(n),children:[(0,X.jsx)(fe,{className:`size-4`}),o.edit]}):null,O?(0,X.jsxs)(ge,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-red-700 outline-none hover:bg-red-500/10 dark:text-red-300`,disabled:u!==null,onSelect:()=>{window.confirm(o.experience.deleteConfirm)&&p(`automation:${n.id}:delete`,()=>V.remove(n.id),o.dashboard.deleted)},children:[b?(0,X.jsx)(_,{className:`size-4 animate-spin`}):(0,X.jsx)(ve,{className:`size-4`}),o.dashboard.delete]}):null]})})]}):null]}):null,t[47]=n,t[48]=u,t[49]=O,t[50]=D,t[51]=C,t[52]=S,t[53]=b,t[54]=o.dashboard.delete,t[55]=o.dashboard.deleted,t[56]=o.dashboard.pause,t[57]=o.dashboard.resume,t[58]=o.dashboard.resumed,t[59]=o.dashboard.runNow,t[60]=o.details,t[61]=o.edit,t[62]=o.experience.deleteConfirm,t[63]=o.feedback,t[64]=p,t[65]=d,t[66]=g,t[67]=v,t[68]=de):de=t[68];let U;t[69]!==B||t[70]!==de?(U=(0,X.jsxs)(`header`,{className:`flex flex-col items-start gap-3 border-b border-edge px-5 py-4`,children:[B,de]}),t[69]=B,t[70]=de,t[71]=U):U=t[71];let pe;t[72]===o.dashboard.latestResult?pe=t[73]:(pe=(0,X.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:o.dashboard.latestResult}),t[72]=o.dashboard.latestResult,t[73]=pe);let me;t[74]!==o.experience.viewResult||t[75]!==f||t[76]!==r[0]?(me=r[0]?(0,X.jsx)(w,{variant:`secondary`,onClick:()=>f(r[0].id),children:o.experience.viewResult}):null,t[74]=o.experience.viewResult,t[75]=f,t[76]=r[0],t[77]=me):me=t[77];let he;t[78]!==pe||t[79]!==me?(he=(0,X.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[pe,me]}),t[78]=pe,t[79]=me,t[80]=he):he=t[80];let K;t[81]!==o||t[82]!==c||t[83]!==r[0]||t[84]!==a||t[85]!==i?(K=a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-red-700 dark:text-red-300`,children:a}):i?(0,X.jsx)(T,{className:`h-28 w-full`}):r[0]?(0,X.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-edge-subtle bg-surface-base p-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[(0,X.jsx)(`span`,{className:y(`rounded-full px-2 py-0.5`,Et(r[0].status)),children:o.status[r[0].status]}),yt(r[0].createdAtMs,o,c)]}),(0,X.jsx)(G,{content:r[0].error||r[0].summary||(Ot(r[0])?o.runDetail.resultPending:o.runDetail.noResult),compact:!0})]}):(0,X.jsx)(`p`,{className:`text-sm text-fg-muted`,children:o.experience.noRuns}),t[81]=o,t[82]=c,t[83]=r[0],t[84]=a,t[85]=i,t[86]=K):K=t[86];let be;t[87]!==n||t[88]!==o||t[89]!==c?(be=n.enabled?`${o.next}: ${ke(n,o,c)}`:o.paused,t[87]=n,t[88]=o,t[89]=c,t[90]=be):be=t[90];let xe;t[91]===be?xe=t[92]:(xe=(0,X.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:be}),t[91]=be,t[92]=xe);let Se;t[93]!==he||t[94]!==K||t[95]!==xe?(Se=(0,X.jsxs)(`section`,{children:[he,K,xe]}),t[93]=he,t[94]=K,t[95]=xe,t[96]=Se):Se=t[96];let Ce;t[97]===o.dashboard.runHistory?Ce=t[98]:(Ce=(0,X.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:o.dashboard.runHistory}),t[97]=o.dashboard.runHistory,t[98]=Ce);let we;t[99]===o.dashboard.runHistoryDescription?we=t[100]:(we=(0,X.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:o.dashboard.runHistoryDescription}),t[99]=o.dashboard.runHistoryDescription,t[100]=we);let Te;t[101]!==Ce||t[102]!==we?(Te=(0,X.jsxs)(`div`,{children:[Ce,we]}),t[101]=Ce,t[102]=we,t[103]=Te):Te=t[103];let De;t[104]===r.length?De=t[105]:(De=(0,X.jsx)(`span`,{className:`rounded-full bg-surface-base px-2.5 py-1 text-xs text-fg-muted`,children:r.length}),t[104]=r.length,t[105]=De);let Oe;t[106]!==Te||t[107]!==De?(Oe=(0,X.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[Te,De]}),t[106]=Te,t[107]=De,t[108]=Oe):Oe=t[108];let q;t[109]!==o||t[110]!==c||t[111]!==f||t[112]!==r||t[113]!==i?(q=i?(0,X.jsx)(T,{className:`h-24 w-full`}):r.length===0?(0,X.jsx)(sn,{className:`min-h-24 py-6`,icon:(0,X.jsx)(j,{className:`size-5`}),title:o.empty.runs}):(0,X.jsx)(`div`,{className:`divide-y divide-edge-subtle overflow-hidden rounded-xl border border-edge-subtle bg-surface-base`,children:r.slice(0,8).map(e=>(0,X.jsxs)(`button`,{type:`button`,className:`block w-full p-3 text-left hover:bg-surface-hover`,onClick:()=>f(e.id),children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[e.status===`succeeded`?(0,X.jsx)(m,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-300`}):(0,X.jsx)(j,{className:`size-4 shrink-0 text-fg-muted`}),(0,X.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:yt(e.createdAtMs,o,c)})]}),(0,X.jsx)(`span`,{className:y(`shrink-0 rounded-full px-2 py-0.5 text-xs`,Et(e.status)),children:o.status[e.status]})]}),(0,X.jsx)(`p`,{className:y(`mt-1 line-clamp-2 pl-6 text-sm text-fg-muted`,e.error&&`text-red-700 dark:text-red-300`),children:e.error||e.summary||bt(e.actionSnapshot,o)})]},e.id))}),t[109]=o,t[110]=c,t[111]=f,t[112]=r,t[113]=i,t[114]=q):q=t[114];let Ae;t[115]!==Oe||t[116]!==q?(Ae=(0,X.jsxs)(`section`,{className:`min-w-0`,children:[Oe,q]}),t[115]=Oe,t[116]=q,t[117]=Ae):Ae=t[117];let J;t[118]===o.experience.settings?J=t[119]:(J=(0,X.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:o.experience.settings}),t[118]=o.experience.settings,t[119]=J);let je;t[120]!==n||t[121]!==o?(je=At(n,o),t[120]=n,t[121]=o,t[122]=je):je=t[122];let Me;t[123]===je?Me=t[124]:(Me=(0,X.jsx)(G,{content:je,compact:!0}),t[123]=je,t[124]=Me);let Ne;t[125]!==n||t[126]!==s||t[127]!==o||t[128]!==c||t[129]!==l?(Ne=(0,X.jsx)(en,{automation:n,labels:o,cronLabels:s,language:c,projects:l}),t[125]=n,t[126]=s,t[127]=o,t[128]=c,t[129]=l,t[130]=Ne):Ne=t[130];let Pe;t[131]!==Me||t[132]!==Ne?(Pe=(0,X.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[Me,Ne]}),t[131]=Me,t[132]=Ne,t[133]=Pe):Pe=t[133];let Y;t[134]!==J||t[135]!==Pe?(Y=(0,X.jsxs)(`details`,{className:`rounded-lg border border-edge-subtle p-4`,children:[J,Pe]}),t[134]=J,t[135]=Pe,t[136]=Y):Y=t[136];let Ie;t[137]!==Ae||t[138]!==Y?(Ie=(0,X.jsxs)(`div`,{className:`grid gap-5`,children:[Ae,Y]}),t[137]=Ae,t[138]=Y,t[139]=Ie):Ie=t[139];let Le;t[140]!==Se||t[141]!==Ie?(Le=(0,X.jsxs)(`div`,{className:`grid gap-5 p-5`,children:[Se,Ie]}),t[140]=Se,t[141]=Ie,t[142]=Le):Le=t[142];let Re;return t[143]!==U||t[144]!==Le?(Re=(0,X.jsxs)(`article`,{className:`min-w-0 overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel shadow-surface`,children:[U,Le]}),t[143]=U,t[144]=Le,t[145]=Re):Re=t[145],Re}function $t(e,t){return e===`suggest_only`?t.safety.suggestOnlyDescription:e===`ask_before_apply`?t.safety.askBeforeApplyDescription:t.safety.autoApplyDescription}function en(e){let t=(0,Fe.c)(146),{automation:n,labels:r,cronLabels:i,language:a,projects:o}=e,s,l,u,d,f,p,h,g,_,v,y;if(t[0]!==n||t[1]!==i||t[2]!==r||t[3]!==a){let e=Tt(n),o;t[15]!==n||t[16]!==r||t[17]!==a?(o=ke(n,r,a),t[15]=n,t[16]=r,t[17]=a,t[18]=o):o=t[18];let c=o,b;t[19]!==n.state.nextRunAtMs||t[20]!==a?(b=n.state.nextRunAtMs?q(n.state.nextRunAtMs,a):void 0,t[19]=n.state.nextRunAtMs,t[20]=a,t[21]=b):b=t[21];let x=b;if(t[22]!==n.trigger.eventType||t[23]!==n.trigger.kind||t[24]!==n.trigger.schedule||t[25]!==n.trigger.secretId||t[26]!==n.trigger.source||t[27]!==r.info.anchor||t[28]!==r.info.calendarSchedule||t[29]!==r.info.eventSource||t[30]!==r.info.eventType||t[31]!==r.info.expression||t[32]!==r.info.fixedInterval||t[33]!==r.info.oneTimeSchedule||t[34]!==r.info.rawInterval||t[35]!==r.info.scheduleType||t[36]!==r.info.timezone||t[37]!==r.info.webhookSecret||t[38]!==a){if(y=[],n.trigger.kind===`schedule`){let e=n.trigger.schedule,i=e.kind===`interval`?r.info.fixedInterval:e.kind===`cron`?r.info.calendarSchedule:r.info.oneTimeSchedule,o;if(t[40]!==r.info.scheduleType||t[41]!==i?(o={label:r.info.scheduleType,value:i},t[40]=r.info.scheduleType,t[41]=i,t[42]=o):o=t[42],y.push(o),e.kind===`interval`){let n=`${e.everyMs} ms`,i;if(t[43]!==r.info.rawInterval||t[44]!==n?(i={label:r.info.rawInterval,value:n},t[43]=r.info.rawInterval,t[44]=n,t[45]=i):i=t[45],y.push(i),e.anchorMs){let n=r.info.anchor,i;t[46]!==a||t[47]!==e.anchorMs?(i=q(e.anchorMs,a),t[46]=a,t[47]=e.anchorMs,t[48]=i):i=t[48];let o;t[49]!==r.info.anchor||t[50]!==i?(o={label:n,value:i},t[49]=r.info.anchor,t[50]=i,t[51]=o):o=t[51],y.push(o)}}else if(e.kind===`cron`){let n;if(t[52]!==r.info.expression||t[53]!==e.expr?(n={label:r.info.expression,value:e.expr},t[52]=r.info.expression,t[53]=e.expr,t[54]=n):n=t[54],y.push(n),e.tz){let n;t[55]!==r.info.timezone||t[56]!==e.tz?(n={label:r.info.timezone,value:e.tz},t[55]=r.info.timezone,t[56]=e.tz,t[57]=n):n=t[57],y.push(n)}}else{let n;t[58]!==r.info.oneTimeSchedule||t[59]!==e.at?(n={label:r.info.oneTimeSchedule,value:e.at},t[58]=r.info.oneTimeSchedule,t[59]=e.at,t[60]=n):n=t[60],y.push(n)}}else if(n.trigger.kind===`event`){let e;if(t[61]!==n.trigger.eventType||t[62]!==r.info.eventType?(e={label:r.info.eventType,value:n.trigger.eventType},t[61]=n.trigger.eventType,t[62]=r.info.eventType,t[63]=e):e=t[63],y.push(e),n.trigger.source){let e;t[64]!==n.trigger.source||t[65]!==r.info.eventSource?(e={label:r.info.eventSource,value:n.trigger.source},t[64]=n.trigger.source,t[65]=r.info.eventSource,t[66]=e):e=t[66],y.push(e)}}else if(n.trigger.kind===`webhook`&&n.trigger.secretId){let e;t[67]!==n.trigger.secretId||t[68]!==r.info.webhookSecret?(e={label:r.info.webhookSecret,value:n.trigger.secretId},t[67]=n.trigger.secretId,t[68]=r.info.webhookSecret,t[69]=e):e=t[69],y.push(e)}t[22]=n.trigger.eventType,t[23]=n.trigger.kind,t[24]=n.trigger.schedule,t[25]=n.trigger.secretId,t[26]=n.trigger.source,t[27]=r.info.anchor,t[28]=r.info.calendarSchedule,t[29]=r.info.eventSource,t[30]=r.info.eventType,t[31]=r.info.expression,t[32]=r.info.fixedInterval,t[33]=r.info.oneTimeSchedule,t[34]=r.info.rawInterval,t[35]=r.info.scheduleType,t[36]=r.info.timezone,t[37]=r.info.webhookSecret,t[38]=a,t[39]=y}else y=t[39];_=`h-fit overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,t[70]===r.info.overview?v=t[71]:(v=(0,X.jsx)(`div`,{className:`border-b border-edge-subtle px-4 py-3`,children:(0,X.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:r.info.overview})}),t[70]=r.info.overview,t[71]=v),p=`grid gap-4 p-4`;let S;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,X.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),t[72]=S):S=t[72];let C=r.info.schedule,w;t[73]!==n.trigger||t[74]!==i||t[75]!==r||t[76]!==a?(w=Ee(n.trigger,r,i,a),t[73]=n.trigger,t[74]=i,t[75]=r,t[76]=a,t[77]=w):w=t[77];let T=n.enabled?`${r.info.nextRun}:${c}`:c;t[78]!==r.info.schedule||t[79]!==x||t[80]!==w||t[81]!==T?(h=(0,X.jsx)(nn,{icon:S,label:C,value:w,description:T,descriptionTitle:x}),t[78]=r.info.schedule,t[79]=x,t[80]=w,t[81]=T,t[82]=h):h=t[82];let E;t[83]===n.action.kind?E=t[84]:(E=n.action.kind===`browser_automation`?(0,X.jsx)(R,{className:`size-4`,"aria-hidden":!0}):n.action.kind===`task_command`?(0,X.jsx)(m,{className:`size-4`,"aria-hidden":!0}):(0,X.jsx)(B,{className:`size-4`,"aria-hidden":!0}),t[83]=n.action.kind,t[84]=E);let D=r.info.action,O;t[85]!==n.action||t[86]!==r?(O=bt(n.action,r),t[85]=n.action,t[86]=r,t[87]=O):O=t[87],t[88]!==r.info.action||t[89]!==E||t[90]!==O?(g=(0,X.jsx)(nn,{icon:E,label:D,value:O}),t[88]=r.info.action,t[89]=E,t[90]=O,t[91]=g):g=t[91],s=nn,t[92]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,X.jsx)(F,{className:`size-4`,"aria-hidden":!0}),t[92]=l):l=t[92],u=r.info.permission,d=r.safety[e],f=$t(e,r),t[0]=n,t[1]=i,t[2]=r,t[3]=a,t[4]=s,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=h,t[11]=g,t[12]=_,t[13]=v,t[14]=y}else s=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9],h=t[10],g=t[11],_=t[12],v=t[13],y=t[14];let b;t[93]!==s||t[94]!==l||t[95]!==u||t[96]!==d||t[97]!==f?(b=(0,X.jsx)(s,{icon:l,label:u,value:d,description:f}),t[93]=s,t[94]=l,t[95]=u,t[96]=d,t[97]=f,t[98]=b):b=t[98];let x;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,X.jsx)(ue,{className:`size-4`,"aria-hidden":!0}),t[99]=x):x=t[99];let S;t[100]!==n.projectId||t[101]!==r.info.noProject||t[102]!==o?(S=o.find(e=>e.id===n.projectId)?.name??r.info.noProject,t[100]=n.projectId,t[101]=r.info.noProject,t[102]=o,t[103]=S):S=t[103];let C;t[104]!==r.info.project||t[105]!==S?(C=(0,X.jsx)(nn,{icon:x,label:r.info.project,value:S}),t[104]=r.info.project,t[105]=S,t[106]=C):C=t[106];let w;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,X.jsx)(pe,{className:`size-4`,"aria-hidden":!0}),t[107]=w):w=t[107];let T=n.conversationMode===`continuous`?r.info.continuousConversation:r.info.newConversation,E;t[108]!==r.info.conversation||t[109]!==T?(E=(0,X.jsx)(nn,{icon:w,label:r.info.conversation,value:T}),t[108]=r.info.conversation,t[109]=T,t[110]=E):E=t[110];let D;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,X.jsx)(he,{className:`size-4`,"aria-hidden":!0}),t[111]=D):D=t[111];let O=n.delivery.notificationPolicy===`all`?r.info.notifyAll:n.delivery.notificationPolicy===`none`?r.info.notifyNone:r.info.notifyAttention,k;t[112]!==r.info.notifications||t[113]!==O?(k=(0,X.jsx)(nn,{icon:D,label:r.info.notifications,value:O}),t[112]=r.info.notifications,t[113]=O,t[114]=k):k=t[114];let A;t[115]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,X.jsx)(j,{className:`size-4`,"aria-hidden":!0}),t[115]=A):A=t[115];let M=r.info.lastRun,N;t[116]!==n||t[117]!==r||t[118]!==a?(N=Oe(n,r,a),t[116]=n,t[117]=r,t[118]=a,t[119]=N):N=t[119];let P=n.state.lastRunStatus===`failed`||n.state.lastRunStatus===`timeout`?`danger`:`default`,I;t[120]!==r.info.lastRun||t[121]!==N||t[122]!==P?(I=(0,X.jsx)(nn,{icon:A,label:M,value:N,valueTone:P}),t[120]=r.info.lastRun,t[121]=N,t[122]=P,t[123]=I):I=t[123];let L;t[124]!==n.state.consecutiveFailures||t[125]!==n.state.lastError||t[126]!==r.dashboard?(L=n.state.consecutiveFailures?(0,X.jsxs)(`div`,{className:`rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-700 dark:text-red-300`,children:[r.dashboard.failures,`:`,n.state.consecutiveFailures,n.state.lastError?(0,X.jsx)(`p`,{className:`mt-1 break-words text-xs`,children:n.state.lastError}):null]}):n.state.lastError?(0,X.jsx)(`p`,{className:`break-words text-sm text-red-700 dark:text-red-300`,children:n.state.lastError}):null,t[124]=n.state.consecutiveFailures,t[125]=n.state.lastError,t[126]=r.dashboard,t[127]=L):L=t[127];let te;t[128]!==r.info.technicalDetails||t[129]!==y?(te=y.length>0?(0,X.jsxs)(`details`,{className:`group border-t border-edge-subtle pt-3`,children:[(0,X.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-2 text-sm text-fg-muted outline-none hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,X.jsx)(`span`,{children:r.info.technicalDetails}),(0,X.jsx)(c,{className:`size-4 transition-transform group-open:rotate-180`,"aria-hidden":!0})]}),(0,X.jsx)(`div`,{className:`mt-3 grid gap-2`,children:y.map(tn)})]}):null,t[128]=r.info.technicalDetails,t[129]=y,t[130]=te):te=t[130];let ne;t[131]!==b||t[132]!==C||t[133]!==E||t[134]!==k||t[135]!==I||t[136]!==L||t[137]!==te||t[138]!==p||t[139]!==h||t[140]!==g?(ne=(0,X.jsxs)(`div`,{className:p,children:[h,g,b,C,E,k,I,L,te]}),t[131]=b,t[132]=C,t[133]=E,t[134]=k,t[135]=I,t[136]=L,t[137]=te,t[138]=p,t[139]=h,t[140]=g,t[141]=ne):ne=t[141];let re;return t[142]!==ne||t[143]!==_||t[144]!==v?(re=(0,X.jsxs)(`aside`,{className:_,children:[v,ne]}),t[142]=ne,t[143]=_,t[144]=v,t[145]=re):re=t[145],re}function tn(e){return(0,X.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,X.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:e.label}),(0,X.jsx)(`span`,{className:`break-all font-mono text-xs text-fg-muted`,children:e.value})]},`${e.label}:${e.value}`)}function nn(e){let t=(0,Fe.c)(19),{icon:n,label:r,value:i,description:a,descriptionTitle:o,valueTone:s}=e,c=s===void 0?`default`:s,l;t[0]===n?l=t[1]:(l=(0,X.jsx)(`span`,{className:`mt-0.5 text-fg-subtle`,children:n}),t[0]=n,t[1]=l);let u;t[2]===r?u=t[3]:(u=(0,X.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:r}),t[2]=r,t[3]=u);let d=c===`danger`?`text-red-700 dark:text-red-300`:`text-fg`,f;t[4]===d?f=t[5]:(f=y(`mt-1 text-sm font-medium leading-5`,d),t[4]=d,t[5]=f);let p;t[6]!==f||t[7]!==i?(p=(0,X.jsx)(`div`,{className:f,children:i}),t[6]=f,t[7]=i,t[8]=p):p=t[8];let m;t[9]!==a||t[10]!==o?(m=a?(0,X.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,title:o,children:a}):null,t[9]=a,t[10]=o,t[11]=m):m=t[11];let h;t[12]!==u||t[13]!==p||t[14]!==m?(h=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[u,p,m]}),t[12]=u,t[13]=p,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==l||t[17]!==h?(g=(0,X.jsxs)(`div`,{className:`grid grid-cols-[1.25rem_1fr] gap-2.5`,children:[l,h]}),t[16]=l,t[17]=h,t[18]=g):g=t[18],g}function rn(e){let t=(0,Fe.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,X.jsx)(`span`,{children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,X.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,X.jsxs)(`div`,{className:`grid grid-cols-[5rem_1fr] gap-2`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function an(e){return e.endsWith(`.failed`)?`bg-red-500`:e.endsWith(`.completed`)?`bg-emerald-500`:e.endsWith(`.started`)?`bg-blue-500`:`bg-fg-muted`}function on(e){let t=(0,Fe.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,X.jsx)(`div`,{className:`text-xs font-medium uppercase text-fg-muted`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,X.jsx)(`div`,{className:`mt-1 truncate text-sm text-fg`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function sn(e){let t=(0,Fe.c)(8),{className:n,icon:r,title:i}=e,a;t[0]===n?a=t[1]:(a=y(`flex min-h-48 flex-col items-center justify-center text-fg-muted`,n),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,X.jsx)(`div`,{className:`mt-2 text-sm`,children:i}),t[2]=i,t[3]=o);let s;return t[4]!==r||t[5]!==a||t[6]!==o?(s=(0,X.jsxs)(`div`,{className:a,children:[r,o]}),t[4]=r,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function cn(e){let t=(0,Fe.c)(326),{form:n,labels:r,setForm:i,projects:a,browserAutomations:o,selectedBrowserAutomation:s,browserAutomationsLoading:l,agentOptions:u,agentsLoading:p,defaultAgentId:m,taskOptions:h,tasksLoading:g,language:_,projectLocked:b}=e,x=b===void 0?!1:b,S=v(_).agentsSettings,C;t[0]===i?C=t[1]:(C=e=>i(t=>({...t,...e})),t[0]=i,t[1]=C);let w=C,T=J(n.intervalValue,n.intervalUnit),E=Date.now(),D;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(D=[1,2,3],t[2]=D):D=t[2];let O;t[3]!==T||t[4]!==E||t[5]!==_?(O=D.map(e=>De(E+T*e,_,E)),t[3]=T,t[4]=E,t[5]=_,t[6]=O):O=t[6];let k=O,A;if(t[7]!==n.projectId||t[8]!==n.taskId||t[9]!==h){let e;t[11]!==n.projectId||t[12]!==n.taskId?(e=e=>e.id===n.taskId||e.phase!==`closed`&&(!n.projectId||e.projectId===n.projectId),t[11]=n.projectId,t[12]=n.taskId,t[13]=e):e=t[13],A=h.filter(e),t[7]=n.projectId,t[8]=n.taskId,t[9]=h,t[10]=A}else A=t[10];let j=A,M,N;t[14]!==m||t[15]!==n.actionMode||t[16]!==n.agentId||t[17]!==i?(M=()=>{n.actionMode!==`task_command`||n.agentId.trim()||!m||i(e=>({...e,agentId:m}))},N=[m,n.actionMode,n.agentId,i],t[14]=m,t[15]=n.actionMode,t[16]=n.agentId,t[17]=i,t[18]=M,t[19]=N):(M=t[18],N=t[19]),(0,Y.useEffect)(M,N);let P,F;t[20]!==o||t[21]!==n.actionMode||t[22]!==n.browserAutomationId||t[23]!==i?(P=()=>{if(n.actionMode!==`browser_automation`||n.browserAutomationId.trim())return;let e=o[0];e&&i(t=>({...t,browserAutomationId:e.id,browserAutomationInputs:Ne(e)}))},F=[o,n.actionMode,n.browserAutomationId,i],t[20]=o,t[21]=n.actionMode,t[22]=n.browserAutomationId,t[23]=i,t[24]=P,t[25]=F):(P=t[24],F=t[25]),(0,Y.useEffect)(P,F);let ee;t[26]===w?ee=t[27]:(ee=e=>w({name:e.target.value}),t[26]=w,t[27]=ee);let I;t[28]!==n.name||t[29]!==ee?(I=(0,X.jsx)(`input`,{className:Q,value:n.name,onChange:ee}),t[28]=n.name,t[29]=ee,t[30]=I):I=t[30];let L;t[31]!==r.form.name||t[32]!==I?(L=(0,X.jsx)($,{label:r.form.name,children:I}),t[31]=r.form.name,t[32]=I,t[33]=L):L=t[33];let te;t[34]===w?te=t[35]:(te=e=>w({description:e.target.value}),t[34]=w,t[35]=te);let re;t[36]!==n.description||t[37]!==te?(re=(0,X.jsx)(`input`,{className:Q,value:n.description,onChange:te}),t[36]=n.description,t[37]=te,t[38]=re):re=t[38];let ae;t[39]!==r.form.description||t[40]!==re?(ae=(0,X.jsx)($,{label:r.form.description,children:re}),t[39]=r.form.description,t[40]=re,t[41]=ae):ae=t[41];let oe;t[42]!==n.projectId||t[43]!==r.form.noProject||t[44]!==r.form.project||t[45]!==x||t[46]!==a||t[47]!==w?(oe=x?null:(0,X.jsx)($,{label:r.form.project,children:(0,X.jsxs)(d,{className:Q,value:n.projectId,onChange:e=>w({projectId:e.target.value}),children:[(0,X.jsx)(f,{value:``,children:r.form.noProject}),a.map(un)]})}),t[42]=n.projectId,t[43]=r.form.noProject,t[44]=r.form.project,t[45]=x,t[46]=a,t[47]=w,t[48]=oe):oe=t[48];let R=r.form.rulePreview,se;t[49]===r.form.rulePreview?se=t[50]:(se=(0,X.jsx)(`div`,{className:`text-xs font-medium text-accent-fg`,children:r.form.rulePreview}),t[49]=r.form.rulePreview,t[50]=se);let ce;t[51]!==n.triggerMode||t[52]!==r?(ce=Ct(n.triggerMode,r),t[51]=n.triggerMode,t[52]=r,t[53]=ce):ce=t[53];let le;t[54]===ce?le=t[55]:(le=(0,X.jsx)(`span`,{children:ce}),t[54]=ce,t[55]=le);let z;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,X.jsx)(ne,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),t[56]=z):z=t[56];let B;t[57]!==n.actionMode||t[58]!==r?(B=St(n.actionMode,r),t[57]=n.actionMode,t[58]=r,t[59]=B):B=t[59];let ue;t[60]===B?ue=t[61]:(ue=(0,X.jsx)(`span`,{children:B}),t[60]=B,t[61]=ue);let de;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,X.jsx)(ne,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),t[62]=de):de=t[62];let fe;t[63]!==n.projectId||t[64]!==r.form.noProject||t[65]!==r.form.project||t[66]!==a?(fe=n.projectId?a.find(e=>e.id===n.projectId)?.name??r.form.project:r.form.noProject,t[63]=n.projectId,t[64]=r.form.noProject,t[65]=r.form.project,t[66]=a,t[67]=fe):fe=t[67];let V;t[68]===fe?V=t[69]:(V=(0,X.jsx)(`span`,{children:fe}),t[68]=fe,t[69]=V);let H;t[70]!==le||t[71]!==ue||t[72]!==V?(H=(0,X.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-sm text-fg`,children:[le,z,ue,de,V]}),t[70]=le,t[71]=ue,t[72]=V,t[73]=H):H=t[73];let U;t[74]!==r.form.rulePreview||t[75]!==se||t[76]!==H?(U=(0,X.jsxs)(`div`,{className:`rounded-xl border border-accent/20 bg-accent/5 px-4 py-3`,"aria-label":R,children:[se,H]}),t[74]=r.form.rulePreview,t[75]=se,t[76]=H,t[77]=U):U=t[77];let W;t[78]!==r.form.trigger||t[79]!==r.form.triggerStepDescription?(W=(0,X.jsx)(dn,{step:`1`,title:r.form.trigger,description:r.form.triggerStepDescription}),t[78]=r.form.trigger,t[79]=r.form.triggerStepDescription,t[80]=W):W=t[80];let G;t[81]===w?G=t[82]:(G=e=>w({triggerMode:e.target.value}),t[81]=w,t[82]=G);let pe;t[83]===r.trigger.manual?pe=t[84]:(pe=(0,X.jsx)(f,{value:`manual`,children:r.trigger.manual}),t[83]=r.trigger.manual,t[84]=pe);let me;t[85]===r.trigger.once?me=t[86]:(me=(0,X.jsx)(f,{value:`once`,children:r.trigger.once}),t[85]=r.trigger.once,t[86]=me);let he;t[87]===r.trigger.daily?he=t[88]:(he=(0,X.jsx)(f,{value:`daily`,children:r.trigger.daily}),t[87]=r.trigger.daily,t[88]=he);let ge;t[89]===r.trigger.weekly?ge=t[90]:(ge=(0,X.jsx)(f,{value:`weekly`,children:r.trigger.weekly}),t[89]=r.trigger.weekly,t[90]=ge);let _e;t[91]===r.trigger.interval?_e=t[92]:(_e=(0,X.jsx)(f,{value:`interval`,children:r.trigger.interval}),t[91]=r.trigger.interval,t[92]=_e);let ve;t[93]===r.trigger.customCron?ve=t[94]:(ve=(0,X.jsx)(f,{value:`cron`,children:r.trigger.customCron}),t[93]=r.trigger.customCron,t[94]=ve);let ye;t[95]===r.trigger.webhook?ye=t[96]:(ye=(0,X.jsx)(f,{value:`webhook`,children:r.trigger.webhook}),t[95]=r.trigger.webhook,t[96]=ye);let be;t[97]===r.trigger.taskBlocked?be=t[98]:(be=(0,X.jsx)(f,{value:`taskBlocked`,children:r.trigger.taskBlocked}),t[97]=r.trigger.taskBlocked,t[98]=be);let xe;t[99]===r.trigger.noteCreated?xe=t[100]:(xe=(0,X.jsx)(f,{value:`noteCreated`,children:r.trigger.noteCreated}),t[99]=r.trigger.noteCreated,t[100]=xe);let Se;t[101]===r.trigger.sessionUpdated?Se=t[102]:(Se=(0,X.jsx)(f,{value:`sessionUpdated`,children:r.trigger.sessionUpdated}),t[101]=r.trigger.sessionUpdated,t[102]=Se);let Ce;t[103]===r.trigger.customEvent?Ce=t[104]:(Ce=(0,X.jsx)(f,{value:`event`,children:r.trigger.customEvent}),t[103]=r.trigger.customEvent,t[104]=Ce);let Ee;t[105]!==n.triggerMode||t[106]!==G||t[107]!==pe||t[108]!==me||t[109]!==he||t[110]!==ge||t[111]!==_e||t[112]!==ve||t[113]!==ye||t[114]!==be||t[115]!==xe||t[116]!==Se||t[117]!==Ce?(Ee=(0,X.jsxs)(d,{className:Q,value:n.triggerMode,onChange:G,children:[pe,me,he,ge,_e,ve,ye,be,xe,Se,Ce]}),t[105]=n.triggerMode,t[106]=G,t[107]=pe,t[108]=me,t[109]=he,t[110]=ge,t[111]=_e,t[112]=ve,t[113]=ye,t[114]=be,t[115]=xe,t[116]=Se,t[117]=Ce,t[118]=Ee):Ee=t[118];let Oe;t[119]!==n.onceAt||t[120]!==n.triggerMode||t[121]!==r.form.onceAt||t[122]!==w?(Oe=n.triggerMode===`once`?(0,X.jsx)($,{label:r.form.onceAt,children:(0,X.jsx)(`input`,{className:Q,type:`datetime-local`,value:n.onceAt,onChange:e=>w({onceAt:e.target.value})})}):null,t[119]=n.onceAt,t[120]=n.triggerMode,t[121]=r.form.onceAt,t[122]=w,t[123]=Oe):Oe=t[123];let q;t[124]!==n.time||t[125]!==n.triggerMode||t[126]!==n.weekday||t[127]!==r.form.day||t[128]!==r.form.time||t[129]!==r.weekdays||t[130]!==w?(q=n.triggerMode===`daily`||n.triggerMode===`weekly`?(0,X.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,X.jsx)($,{label:r.form.time,children:(0,X.jsx)(Be,{value:n.time,onChange:e=>w({time:e}),ariaLabel:r.form.time})}),n.triggerMode===`weekly`?(0,X.jsx)($,{label:r.form.day,children:(0,X.jsxs)(d,{className:Q,value:n.weekday,onChange:e=>w({weekday:e.target.value}),children:[(0,X.jsx)(f,{value:`1`,children:r.weekdays.monday}),(0,X.jsx)(f,{value:`2`,children:r.weekdays.tuesday}),(0,X.jsx)(f,{value:`3`,children:r.weekdays.wednesday}),(0,X.jsx)(f,{value:`4`,children:r.weekdays.thursday}),(0,X.jsx)(f,{value:`5`,children:r.weekdays.friday}),(0,X.jsx)(f,{value:`6`,children:r.weekdays.saturday}),(0,X.jsx)(f,{value:`0`,children:r.weekdays.sunday})]})}):null]}):null,t[124]=n.time,t[125]=n.triggerMode,t[126]=n.weekday,t[127]=r.form.day,t[128]=r.form.time,t[129]=r.weekdays,t[130]=w,t[131]=q):q=t[131];let ke=n.triggerMode===`interval`?(0,X.jsxs)(`div`,{className:`grid gap-3 rounded-lg border border-edge-subtle bg-surface-base p-3`,children:[(0,X.jsx)($,{label:r.form.intervalEvery,children:(0,X.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,X.jsx)(`input`,{className:Q,type:`number`,min:6e4/J(1,n.intervalUnit),step:`any`,inputMode:`decimal`,value:n.intervalValue,onChange:e=>w({intervalValue:e.target.value})}),(0,X.jsxs)(d,{className:Q,value:n.intervalUnit,onChange:e=>{let t=e.target.value;w({intervalValue:we(n.intervalValue,n.intervalUnit,t),intervalUnit:t})},children:[(0,X.jsx)(f,{value:`minute`,children:r.form.intervalUnits.minute}),(0,X.jsx)(f,{value:`hour`,children:r.form.intervalUnits.hour}),(0,X.jsx)(f,{value:`day`,children:r.form.intervalUnits.day}),(0,X.jsx)(f,{value:`week`,children:r.form.intervalUnits.week})]})]})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:r.form.commonIntervals}),(0,X.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:et.map(e=>{let t=J(e.value,e.unit),n=t===T;return(0,X.jsx)(`button`,{type:`button`,"aria-pressed":n,className:y(`rounded-full border px-2.5 py-1 text-xs transition-colors`,n?`border-accent bg-accent/10 text-accent`:`border-edge-subtle text-fg-muted hover:border-edge hover:bg-surface-hover hover:text-fg`),onClick:()=>w({intervalValue:e.value,intervalUnit:e.unit}),children:Ae(t,_)},`${e.value}:${e.unit}`)})})]}),(0,X.jsxs)(`div`,{className:`rounded-lg bg-surface-panel px-3 py-2.5`,children:[(0,X.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:Te(T,_)}),(0,X.jsxs)(`div`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:[r.form.nextThreeRuns,`:`,k.join(_===`zh`?`、`:`, `)]}),(0,X.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:r.form.fixedIntervalHint})]})]}):null,je;t[132]!==n.cronExpr||t[133]!==n.triggerMode||t[134]!==r.form.expression||t[135]!==w?(je=n.triggerMode===`cron`?(0,X.jsx)($,{label:r.form.expression,children:(0,X.jsx)(`input`,{className:Q,value:n.cronExpr,onChange:e=>w({cronExpr:e.target.value})})}):null,t[132]=n.cronExpr,t[133]=n.triggerMode,t[134]=r.form.expression,t[135]=w,t[136]=je):je=t[136];let Me;t[137]!==n.triggerMode||t[138]!==n.webhookSecretId||t[139]!==r.form.secretId||t[140]!==w?(Me=n.triggerMode===`webhook`?(0,X.jsx)($,{label:r.form.secretId,children:(0,X.jsx)(`input`,{className:Q,value:n.webhookSecretId,onChange:e=>w({webhookSecretId:e.target.value})})}):null,t[137]=n.triggerMode,t[138]=n.webhookSecretId,t[139]=r.form.secretId,t[140]=w,t[141]=Me):Me=t[141];let Ie;t[142]!==n.eventPayloadMatch||t[143]!==n.eventSource||t[144]!==n.eventType||t[145]!==n.triggerMode||t[146]!==r.form.eventPayloadMatch||t[147]!==r.form.eventSource||t[148]!==r.form.eventType||t[149]!==r.form.invalidJsonObject||t[150]!==w?(Ie=n.triggerMode===`event`?(0,X.jsxs)(`div`,{className:`grid gap-3 rounded-lg border border-edge-subtle bg-surface-base p-3`,children:[(0,X.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,X.jsx)($,{label:r.form.eventType,children:(0,X.jsx)(`input`,{className:Q,value:n.eventType,onChange:e=>w({eventType:e.target.value})})}),(0,X.jsx)($,{label:r.form.eventSource,children:(0,X.jsx)(`input`,{className:Q,value:n.eventSource,onChange:e=>w({eventSource:e.target.value})})})]}),(0,X.jsxs)($,{label:r.form.eventPayloadMatch,children:[(0,X.jsx)(`textarea`,{className:y(Q,`min-h-24 resize-y font-mono text-xs`),value:n.eventPayloadMatch,onChange:e=>w({eventPayloadMatch:e.target.value}),placeholder:`{
7
- "status": "blocked"
8
- }`}),ot(n.eventPayloadMatch)?null:(0,X.jsx)(`span`,{className:`text-xs text-red-700 dark:text-red-300`,children:r.form.invalidJsonObject})]})]}):null,t[142]=n.eventPayloadMatch,t[143]=n.eventSource,t[144]=n.eventType,t[145]=n.triggerMode,t[146]=r.form.eventPayloadMatch,t[147]=r.form.eventSource,t[148]=r.form.eventType,t[149]=r.form.invalidJsonObject,t[150]=w,t[151]=Ie):Ie=t[151];let Le;t[152]!==r.form.action||t[153]!==r.form.actionStepDescription?(Le=(0,X.jsx)(dn,{step:`2`,title:r.form.action,description:r.form.actionStepDescription}),t[152]=r.form.action,t[153]=r.form.actionStepDescription,t[154]=Le):Le=t[154];let Re;t[155]!==n.timeoutSeconds||t[156]!==w?(Re=e=>{let t=e.target.value,r=Number.parseInt(n.timeoutSeconds,10);w({actionMode:t,...r===600||r===1800?{timeoutSeconds:t===`browser_automation`?`600`:`1800`}:{},...t===`browser_automation`||t===`task_command`?{safetyMode:`auto_apply`}:{}})},t[155]=n.timeoutSeconds,t[156]=w,t[157]=Re):Re=t[157];let ze;t[158]===r.action.runAgent?ze=t[159]:(ze=(0,X.jsx)(f,{value:`agent`,children:r.action.runAgent}),t[158]=r.action.runAgent,t[159]=ze);let Ve;t[160]===r.action.runTask?Ve=t[161]:(Ve=(0,X.jsx)(f,{value:`task_command`,children:r.action.runTask}),t[160]=r.action.runTask,t[161]=Ve);let He=_===`zh`?`浏览器自动化`:`Browser automation`,Ue;t[162]===He?Ue=t[163]:(Ue=(0,X.jsx)(f,{value:`browser_automation`,children:He}),t[162]=He,t[163]=Ue);let We;t[164]!==n.actionMode||t[165]!==Re||t[166]!==ze||t[167]!==Ve||t[168]!==Ue?(We=(0,X.jsxs)(d,{className:Q,value:n.actionMode,onChange:Re,children:[ze,Ve,Ue]}),t[164]=n.actionMode,t[165]=Re,t[166]=ze,t[167]=Ve,t[168]=Ue,t[169]=We):We=t[169];let Ge=n.actionMode===`browser_automation`?null:(0,X.jsx)($,{label:r.form.agent,children:(0,X.jsxs)(d,{className:Q,value:n.agentId,onChange:e=>w({agentId:e.target.value}),children:[(0,X.jsx)(f,{value:``,children:p?r.form.loadingAgents:r.form.defaultAgent}),u.map(e=>(0,X.jsx)(f,{value:e.id,children:ie(e,S)},e.id))]})}),Ke;t[170]!==j||t[171]!==o||t[172]!==l||t[173]!==n.actionMode||t[174]!==n.agentId||t[175]!==n.browserAutomationId||t[176]!==n.browserAutomationInputs||t[177]!==n.description||t[178]!==n.instruction||t[179]!==n.model||t[180]!==n.name||t[181]!==n.taskId||t[182]!==n.triggerMode||t[183]!==r.form.defaultModel||t[184]!==r.form.instruction||t[185]!==r.form.loadingTasks||t[186]!==r.form.model||t[187]!==r.form.modelHint||t[188]!==r.form.noModels||t[189]!==r.form.noTasks||t[190]!==r.form.searchModels||t[191]!==r.form.task||t[192]!==r.form.taskClosed||t[193]!==r.form.taskContextHint||t[194]!==_||t[195]!==s||t[196]!==g||t[197]!==w?(Ke=n.actionMode===`agent`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)($,{label:r.form.model,children:[(0,X.jsx)(K,{value:n.model,onChange:e=>w({model:e}),placeholder:r.form.defaultModel,emptyLabel:r.form.defaultModel,searchPlaceholder:r.form.searchModels,noMatches:r.form.noModels,allowEmpty:!0,showProviderSettingsFooter:!0,contentAlign:`start`,className:`w-full`,ariaLabel:r.form.model}),(0,X.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:r.form.modelHint})]}),(0,X.jsxs)($,{label:r.form.instruction,children:[(0,X.jsx)(`div`,{className:`flex justify-end`,children:(0,X.jsx)(Ye,{value:n.instruction,onApply:e=>w({instruction:e}),fieldId:`automation.instruction`,fieldLabel:r.form.instruction,scenario:`automation.instruction`,locale:_,context:{automationName:n.name,automationDescription:n.description,triggerMode:n.triggerMode,agentId:n.agentId,model:n.model},showLabel:!1})}),(0,X.jsx)(`textarea`,{className:y(Q,`min-h-32 resize-y`),value:n.instruction,onChange:e=>w({instruction:e.target.value})})]})]}):n.actionMode===`task_command`?(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)($,{label:r.form.task,children:[(0,X.jsxs)(d,{className:Q,value:n.taskId,onChange:e=>w({taskId:e.target.value}),disabled:g||j.length===0,children:[g?(0,X.jsx)(f,{value:``,children:r.form.loadingTasks}):null,!g&&j.length===0?(0,X.jsx)(f,{value:``,children:r.form.noTasks}):null,j.map(e=>(0,X.jsxs)(f,{value:e.id,disabled:e.phase===`closed`,children:[e.title,e.phase===`closed`?` · ${r.form.taskClosed}`:``]},e.id))]}),(0,X.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:r.form.taskContextHint})]})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{label:_===`zh`?`浏览器自动化`:`Browser automation`,children:(0,X.jsxs)(d,{className:Q,value:n.browserAutomationId,onChange:e=>{let t=o.find(t=>t.id===e.target.value);w({browserAutomationId:e.target.value,browserAutomationInputs:t?Ne(t):{}})},disabled:l||o.length===0,children:[o.length===0?(0,X.jsx)(f,{value:``,children:_===`zh`?`没有已启用的浏览器自动化`:`No enabled browser automations`}):null,o.map(ln)]})}),s&&Object.keys(s.inputs).length>0?(0,X.jsx)($,{label:_===`zh`?`运行时填写`:`Run inputs`,children:(0,X.jsx)(Pe,{automation:s,values:n.browserAutomationInputs,language:_,onChange:e=>w({browserAutomationInputs:e})})}):null]}),t[170]=j,t[171]=o,t[172]=l,t[173]=n.actionMode,t[174]=n.agentId,t[175]=n.browserAutomationId,t[176]=n.browserAutomationInputs,t[177]=n.description,t[178]=n.instruction,t[179]=n.model,t[180]=n.name,t[181]=n.taskId,t[182]=n.triggerMode,t[183]=r.form.defaultModel,t[184]=r.form.instruction,t[185]=r.form.loadingTasks,t[186]=r.form.model,t[187]=r.form.modelHint,t[188]=r.form.noModels,t[189]=r.form.noTasks,t[190]=r.form.searchModels,t[191]=r.form.task,t[192]=r.form.taskClosed,t[193]=r.form.taskContextHint,t[194]=_,t[195]=s,t[196]=g,t[197]=w,t[198]=Ke):Ke=t[198];let Z;t[199]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,X.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full bg-surface-hover text-xs text-fg-muted`,children:`3`}),t[199]=Z):Z=t[199];let qe;t[200]===r.form.advancedDescription?qe=t[201]:(qe=(0,X.jsx)(`span`,{className:`ml-2 text-xs font-normal text-fg-muted`,children:r.form.advancedDescription}),t[200]=r.form.advancedDescription,t[201]=qe);let Je;t[202]!==r.form.advanced||t[203]!==qe?(Je=(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[Z,(0,X.jsxs)(`span`,{children:[r.form.advanced,qe]})]}),t[202]=r.form.advanced,t[203]=qe,t[204]=Je):Je=t[204];let Xe;t[205]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,X.jsx)(c,{className:`size-4 transition-transform group-open:rotate-180`}),t[205]=Xe):Xe=t[205];let Ze;t[206]===Je?Ze=t[207]:(Ze=(0,X.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-semibold text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[Je,Xe]}),t[206]=Je,t[207]=Ze);let Qe;t[208]!==n.actionMode||t[209]!==n.safetyMode||t[210]!==r.form.safety||t[211]!==r.safety||t[212]!==w?(Qe=n.actionMode!==`browser_automation`&&n.actionMode!==`task_command`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(dn,{title:r.form.safety}),(0,X.jsxs)($,{label:r.form.safety,children:[(0,X.jsxs)(d,{className:Q,value:n.safetyMode,onChange:e=>{let t=e.target.value;w({safetyMode:t})},children:[(0,X.jsx)(f,{value:`suggest_only`,children:r.safety.suggest_only}),(0,X.jsx)(f,{value:`ask_before_apply`,children:r.safety.ask_before_apply}),(0,X.jsx)(f,{value:`auto_apply`,children:r.safety.auto_apply})]}),(0,X.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.safetyMode===`suggest_only`?r.safety.suggestOnlyDescription:n.safetyMode===`ask_before_apply`?r.safety.askBeforeApplyDescription:r.safety.autoApplyDescription})]})]}):null,t[208]=n.actionMode,t[209]=n.safetyMode,t[210]=r.form.safety,t[211]=r.safety,t[212]=w,t[213]=Qe):Qe=t[213];let $e;t[214]===r.form.results?$e=t[215]:($e=(0,X.jsx)(dn,{title:r.form.results}),t[214]=r.form.results,t[215]=$e);let tt;t[216]===w?tt=t[217]:(tt=e=>w({conversationMode:e.target.value}),t[216]=w,t[217]=tt);let nt;t[218]===r.form.newConversation?nt=t[219]:(nt=(0,X.jsx)(f,{value:`new_session`,children:r.form.newConversation}),t[218]=r.form.newConversation,t[219]=nt);let rt;t[220]===r.form.continuousConversation?rt=t[221]:(rt=(0,X.jsx)(f,{value:`continuous`,children:r.form.continuousConversation}),t[220]=r.form.continuousConversation,t[221]=rt);let it;t[222]!==n.conversationMode||t[223]!==tt||t[224]!==nt||t[225]!==rt?(it=(0,X.jsxs)(d,{className:Q,value:n.conversationMode,onChange:tt,children:[nt,rt]}),t[222]=n.conversationMode,t[223]=tt,t[224]=nt,t[225]=rt,t[226]=it):it=t[226];let at;t[227]!==r.form.conversation||t[228]!==it?(at=(0,X.jsx)($,{label:r.form.conversation,children:it}),t[227]=r.form.conversation,t[228]=it,t[229]=at):at=t[229];let st;t[230]===w?st=t[231]:(st=e=>w({notificationPolicy:e.target.value}),t[230]=w,t[231]=st);let ct;t[232]===r.form.notifyAttention?ct=t[233]:(ct=(0,X.jsx)(f,{value:`attention`,children:r.form.notifyAttention}),t[232]=r.form.notifyAttention,t[233]=ct);let lt;t[234]===r.form.notifyAll?lt=t[235]:(lt=(0,X.jsx)(f,{value:`all`,children:r.form.notifyAll}),t[234]=r.form.notifyAll,t[235]=lt);let ut;t[236]===r.form.notifyNone?ut=t[237]:(ut=(0,X.jsx)(f,{value:`none`,children:r.form.notifyNone}),t[236]=r.form.notifyNone,t[237]=ut);let dt;t[238]!==n.notificationPolicy||t[239]!==st||t[240]!==ct||t[241]!==lt||t[242]!==ut?(dt=(0,X.jsxs)(d,{className:Q,value:n.notificationPolicy,onChange:st,children:[ct,lt,ut]}),t[238]=n.notificationPolicy,t[239]=st,t[240]=ct,t[241]=lt,t[242]=ut,t[243]=dt):dt=t[243];let ft;t[244]!==r.form.notifications||t[245]!==dt?(ft=(0,X.jsx)($,{label:r.form.notifications,children:dt}),t[244]=r.form.notifications,t[245]=dt,t[246]=ft):ft=t[246];let pt;t[247]===w?pt=t[248]:(pt=e=>w({resultWebhookEndpoint:e.target.value}),t[247]=w,t[248]=pt);let mt;t[249]!==n.resultWebhookEndpoint||t[250]!==pt?(mt=(0,X.jsx)(`input`,{className:Q,value:n.resultWebhookEndpoint,onChange:pt}),t[249]=n.resultWebhookEndpoint,t[250]=pt,t[251]=mt):mt=t[251];let ht;t[252]===w?ht=t[253]:(ht=e=>w({resultWebhookSecretId:e.target.value}),t[252]=w,t[253]=ht);let gt;t[254]!==n.resultWebhookSecretId||t[255]!==r.form.resultWebhookSecretId||t[256]!==ht?(gt=(0,X.jsx)(`input`,{className:Q,value:n.resultWebhookSecretId,onChange:ht,placeholder:r.form.resultWebhookSecretId}),t[254]=n.resultWebhookSecretId,t[255]=r.form.resultWebhookSecretId,t[256]=ht,t[257]=gt):gt=t[257];let _t;t[258]!==mt||t[259]!==gt?(_t=(0,X.jsxs)(`div`,{className:`grid gap-2`,children:[mt,gt]}),t[258]=mt,t[259]=gt,t[260]=_t):_t=t[260];let vt;t[261]!==r.form.resultWebhookEndpoint||t[262]!==_t?(vt=(0,X.jsx)($,{label:r.form.resultWebhookEndpoint,children:_t}),t[261]=r.form.resultWebhookEndpoint,t[262]=_t,t[263]=vt):vt=t[263];let yt;t[264]===r.form.reliability?yt=t[265]:(yt=(0,X.jsx)(dn,{title:r.form.reliability}),t[264]=r.form.reliability,t[265]=yt);let bt;t[266]===w?bt=t[267]:(bt=e=>w({timeoutSeconds:e.target.value}),t[266]=w,t[267]=bt);let xt;t[268]!==n.timeoutSeconds||t[269]!==bt?(xt=(0,X.jsx)(`input`,{className:Q,inputMode:`numeric`,value:n.timeoutSeconds,onChange:bt}),t[268]=n.timeoutSeconds,t[269]=bt,t[270]=xt):xt=t[270];let wt;t[271]!==r.form.timeoutSeconds||t[272]!==xt?(wt=(0,X.jsx)($,{label:r.form.timeoutSeconds,children:xt}),t[271]=r.form.timeoutSeconds,t[272]=xt,t[273]=wt):wt=t[273];let Tt;t[274]===w?Tt=t[275]:(Tt=e=>w({disableAfterFailures:e.target.value}),t[274]=w,t[275]=Tt);let Et;t[276]!==n.disableAfterFailures||t[277]!==Tt?(Et=(0,X.jsx)(`input`,{className:Q,inputMode:`numeric`,value:n.disableAfterFailures,onChange:Tt}),t[276]=n.disableAfterFailures,t[277]=Tt,t[278]=Et):Et=t[278];let Dt;t[279]!==r.form.disableAfterFailures||t[280]!==Et?(Dt=(0,X.jsx)($,{label:r.form.disableAfterFailures,children:Et}),t[279]=r.form.disableAfterFailures,t[280]=Et,t[281]=Dt):Dt=t[281];let Ot;t[282]!==wt||t[283]!==Dt?(Ot=(0,X.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[wt,Dt]}),t[282]=wt,t[283]=Dt,t[284]=Ot):Ot=t[284];let kt;t[285]===r.form.effectivePolicy?kt=t[286]:(kt=(0,X.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:r.form.effectivePolicy}),t[285]=r.form.effectivePolicy,t[286]=kt);let At=n.timeoutSeconds||`—`,jt;t[287]!==r.form.executionDeadline||t[288]!==At?(jt=(0,X.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[r.form.executionDeadline,`: `,At,`s`]}),t[287]=r.form.executionDeadline,t[288]=At,t[289]=jt):jt=t[289];let Mt;t[290]===r.form.downstreamTimeoutHint?Mt=t[291]:(Mt=(0,X.jsx)(`p`,{className:`mt-0.5 text-xs leading-relaxed text-fg-subtle`,children:r.form.downstreamTimeoutHint}),t[290]=r.form.downstreamTimeoutHint,t[291]=Mt);let Nt;t[292]!==kt||t[293]!==jt||t[294]!==Mt?(Nt=(0,X.jsxs)(`div`,{className:`rounded-lg border border-edge bg-surface-inset/40 px-3 py-2.5`,children:[kt,jt,Mt]}),t[292]=kt,t[293]=jt,t[294]=Mt,t[295]=Nt):Nt=t[295];let Pt;t[296]!==Qe||t[297]!==$e||t[298]!==at||t[299]!==ft||t[300]!==vt||t[301]!==yt||t[302]!==Ot||t[303]!==Nt?(Pt=(0,X.jsxs)(`div`,{className:`grid gap-4 border-t border-edge-subtle p-4`,children:[Qe,$e,at,ft,vt,yt,Ot,Nt]}),t[296]=Qe,t[297]=$e,t[298]=at,t[299]=ft,t[300]=vt,t[301]=yt,t[302]=Ot,t[303]=Nt,t[304]=Pt):Pt=t[304];let Ft;t[305]!==Ze||t[306]!==Pt?(Ft=(0,X.jsxs)(`details`,{className:`group rounded-xl border border-edge-subtle bg-surface-base`,children:[Ze,Pt]}),t[305]=Ze,t[306]=Pt,t[307]=Ft):Ft=t[307];let It;return t[308]!==L||t[309]!==ae||t[310]!==oe||t[311]!==U||t[312]!==W||t[313]!==Ee||t[314]!==Oe||t[315]!==q||t[316]!==ke||t[317]!==je||t[318]!==Me||t[319]!==Ie||t[320]!==Le||t[321]!==We||t[322]!==Ge||t[323]!==Ke||t[324]!==Ft?(It=(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:(0,X.jsxs)(`div`,{className:`grid gap-4`,children:[L,ae,oe,U,W,Ee,Oe,q,ke,je,Me,Ie,Le,We,Ge,Ke,Ft]})}),t[308]=L,t[309]=ae,t[310]=oe,t[311]=U,t[312]=W,t[313]=Ee,t[314]=Oe,t[315]=q,t[316]=ke,t[317]=je,t[318]=Me,t[319]=Ie,t[320]=Le,t[321]=We,t[322]=Ge,t[323]=Ke,t[324]=Ft,t[325]=It):It=t[325],It}function ln(e){return(0,X.jsx)(f,{value:e.id,children:e.name},e.id)}function un(e){return(0,X.jsx)(f,{value:e.id,children:e.name},e.id)}var Q=`min-h-11 w-full rounded-lg border border-edge bg-surface-base px-3 py-2 text-base sm:min-h-0 sm:text-sm text-fg outline-none focus:border-accent`;function $(e){let t=(0,Fe.c)(5),{label:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,X.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,X.jsxs)(`div`,{className:`grid gap-1.5`,children:[i,r]}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function dn(e){let t=(0,Fe.c)(12),{title:n,step:r,description:i}=e,a;t[0]===r?a=t[1]:(a=r?(0,X.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent-fg`,children:r}):(0,X.jsx)(ue,{className:`mt-0.5 size-4 text-fg-muted`}),t[0]=r,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,X.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n}),t[2]=n,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,X.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-fg-muted`,children:i}):null,t[4]=i,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,X.jsxs)(`div`,{children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,X.jsxs)(`div`,{className:`flex items-start gap-2 pt-2`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}export{Lt as t};
@@ -1,3 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{u as r}from"./chunk-KS7C4IRE-BvcCCgTW.js";import{t as i}from"./popover-select-DGKUpVsz.js";import{t as a}from"./loader-circle-CifKLtgG.js";import{i as o,n as s,o as c}from"./locale-store-B7s2Hb35.js";import{t as l}from"./button-aIC072nz.js";import{t as u}from"./skeleton-BI5TyibZ.js";import{Bd as d,Dd as f,Ed as p,Kl as m,Vl as h,Zc as g,Zl as _,_ as v,_l as ee,co as y,dd as b,el as x,sl as S,xd as C,y as w}from"./index-DRyGCING.js";import{i as T,n as E,r as D,t as O}from"./browser-automation-inputs-D6AccXaA.js";var k=e(t(),1),A=n();function j({availability:e,endpointId:t,recordingBusy:n,onSelect:d,onRefresh:f,onStart:p,onClose:m}){let _=s(e=>e.language)===`zh`,ee=r(),[y,b]=(0,k.useState)(),[x,S]=(0,k.useState)(!0),[C,T]=(0,k.useState)(!1),[E,D]=(0,k.useState)(``),[O,j]=(0,k.useState)(!1),M=e.endpoints.length>0,N=e.state===`update_required`;(0,k.useEffect)(()=>{let e=!1;if(M){S(!1);return}return c(o(`/api/browser/extension-status`)).then(t=>{e||b(t)}).catch(t=>{e||D(t instanceof Error?t.message:String(t))}).finally(()=>{e||S(!1)}),()=>{e=!0}},[M]);let P=async()=>{T(!0),D(``);try{(N||!y?.artifacts?.installed||y.artifacts.needsRefresh)&&await v(N||!!y?.artifacts?.needsRefresh),await w(y?.artifacts?.installed?`chrome`:`both`),j(!0),await f()}catch(e){D(e instanceof Error?e.message:String(e))}finally{T(!1)}};return(0,A.jsxs)(`section`,{role:`status`,"aria-live":`polite`,className:`mb-4 shrink-0 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(h,{className:`mt-0.5 size-5 shrink-0 text-accent`}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:M?_?`浏览器已连接`:`Browser connected`:N?_?`更新扩展后即可录制`:`Update the extension to record`:_?`连接 Chrome,录制你的操作`:`Connect Chrome to record your actions`}),(0,A.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:M?_?`在 Chrome 中切换到要录制的网页,然后开始录制。`:`Switch to the website you want to record in Chrome, then start recording.`:N?_?`当前扩展还不支持录制。更新扩展文件后,在 Chrome 扩展页重新加载 xopc。`:`Your connected extension does not support recording yet. Update its files, then reload xopc in Chrome Extensions.`:_?`录制需要 xopc Chrome 扩展。已有扩展请打开 xopc 侧栏,它会自动连接本机服务。`:`Recording uses the xopc Chrome extension. If already installed, open its side panel to connect to your local Gateway.`})]}),(0,A.jsx)(`button`,{type:`button`,disabled:C||n,onClick:m,"aria-label":_?`收起连接引导`:`Close connection guide`,className:`rounded p-1 text-fg-muted hover:bg-surface-hover`,children:(0,A.jsx)(g,{className:`size-4`})})]}),O&&!M&&(0,A.jsx)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:y?.artifacts?.installed?_?`重新加载后打开 xopc 侧栏。连接状态会自动更新。`:`After reloading, open the xopc side panel. Connection status updates automatically.`:_?`在 Chrome 扩展页开启开发者模式,点击“加载已解压的扩展程序”,选择已打开的扩展目录,再打开 xopc 侧栏。连接状态会自动更新。`:`Enable Developer mode in Chrome Extensions, choose Load unpacked and select the opened extension folder, then open the xopc side panel. Connection status updates automatically.`}),M&&e.endpoints.length>1&&(0,A.jsx)(`div`,{className:`mt-3 max-w-sm`,children:(0,A.jsx)(i,{value:t??``,ariaLabel:_?`选择录制浏览器`:`Choose a browser to record`,placeholder:_?`选择浏览器`:`Choose a browser`,allowEmpty:!1,options:e.endpoints.map(e=>({value:e.endpointId,label:e.displayName})),onChange:d})}),(0,A.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[M?(0,A.jsx)(l,{onClick:p,disabled:n||!t&&e.endpoints.length>1,children:_?`开始录制`:`Start recording`}):x?(0,A.jsx)(u,{className:`h-9 w-32 rounded-lg`}):y?.artifacts?.extensionDir?(0,A.jsxs)(l,{onClick:()=>void P(),disabled:C,children:[C&&(0,A.jsx)(a,{className:`size-4 animate-spin`}),N?_?`更新并打开扩展页`:`Update and open extensions`:y.artifacts.installed?_?`打开 Chrome 扩展页`:`Open Chrome Extensions`:_?`安装 Chrome 扩展`:`Install Chrome extension`]}):(0,A.jsx)(l,{onClick:()=>ee(`/settings/agent-browser`),children:_?`设置浏览器连接`:`Set up browser connection`}),!M&&(0,A.jsx)(l,{variant:`secondary`,disabled:C,onClick:()=>void f().catch(e=>D(e instanceof Error?e.message:String(e))),children:_?`检查连接`:`Check connection`})]}),E&&(0,A.jsx)(`p`,{className:`mt-2 text-sm text-danger`,role:`alert`,children:E})]})}var M={en:{record:`Record my actions`,finishRecording:`Finish and save`,recording:`Recording`,syncing:`Saved locally, syncing…`,verified:`Result verified`,saved:`Saved draft`,unknown:`Check the business result before repeating`,title:`Browser automations`,subtitle:`Let your assistant repeat routine actions on the web.`,emptyTitle:`No browser automations yet`,emptyBody:`Tell your assistant what to do on the web. Once it works, save it and run it again whenever you need.`,create:`Create with assistant`,edit:`Edit with assistant`,run:`Run now`,stop:`Stop`,enable:`Enable`,pause:`Pause`,enabled:`Enabled`,paused:`Paused`,inputs:`Before running`,noInputs:`This automation is ready to run.`,history:`Recent activity`,delete:`Delete automation`,confirmDelete:`Delete this browser automation?`,required:`Please complete all required fields.`,queued:`Waiting to start`,running:`Running`,succeeded:`Completed`,failed:`Needs attention`,cancelled:`Stopped`,result:`Result`,read:`Reads information`,draft:`Edits the page locally`,external_effect:`Affects an external system`,destructive:`Destructive action`,sensitive:`Sensitive action`,createPrompt:`Help me create a reusable browser automation. Ask what I want the browser to do, perform it once with me, then save the successful steps. Keep all technical details hidden.`,editPrompt:`Help me update the browser automation "{name}" (id: {id}). Ask what should change, test the new browser steps, then save it.`},zh:{record:`录制我的操作`,finishRecording:`完成并保存`,recording:`正在录制`,syncing:`已保存到本机,正在同步…`,verified:`结果已验证`,saved:`已保存草稿`,unknown:`结果待检查,请先检查业务结果再重复运行`,title:`浏览器自动化`,subtitle:`让助手自动重复完成网页上的固定操作。`,emptyTitle:`还没有浏览器自动化`,emptyBody:`告诉助手你希望在网页上自动完成什么。成功执行一次后,即可保存并重复运行。`,create:`让助手帮我创建`,edit:`让助手帮我修改`,run:`立即运行`,stop:`停止`,enable:`启用`,pause:`暂停`,enabled:`已启用`,paused:`已暂停`,inputs:`运行前需要填写`,noInputs:`这个自动化可以直接运行。`,history:`最近运行`,delete:`删除自动化`,confirmDelete:`确定删除这个浏览器自动化吗?`,required:`请填写所有必填内容。`,queued:`等待开始`,running:`正在运行`,succeeded:`已完成`,failed:`需要处理`,cancelled:`已停止`,result:`运行结果`,read:`仅读取信息`,draft:`仅在页面内编辑`,external_effect:`会影响外部系统`,destructive:`破坏性操作`,sensitive:`包含敏感操作`,createPrompt:`请帮我创建一个可重复运行的浏览器自动化。先询问我希望浏览器完成什么,陪我实际执行成功一次,然后保存成功步骤。不要让我处理技术细节。`,editPrompt:`请帮我修改浏览器自动化“{name}”(id:{id})。先询问我要修改什么,实际测试新的浏览器步骤,然后保存。`}};function N(e){return e!==`queued`&&e!==`running`}function P(e){return e==null?`-`:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?e.map(e=>`• ${P(e)}`).join(`
2
- `):typeof e==`object`?Object.entries(e).map(([e,t])=>`${e}: ${P(t)}`).join(`
3
- `):String(e)}function F(){let e=s(e=>e.language),t=M[e],n=r(),i=y(e=>e.setPageHeader),a=y(e=>e.clearPageHeader),[o,c]=(0,k.useState)(null),[h,g]=(0,k.useState)(),[v,w]=(0,k.useState)({}),[F,I]=(0,k.useState)([]),[L,R]=(0,k.useState)(),[z,B]=(0,k.useState)(``),[V,H]=(0,k.useState)(!1),[U,te]=(0,k.useState)(),[W,G]=(0,k.useState)(),[K,q]=(0,k.useState)(),J=(0,k.useMemo)(()=>o?.find(e=>e.id===h),[h,o]),Y=(0,k.useCallback)(async()=>{let e=await T.list();c(e.automations),g(t=>t&&e.automations.some(e=>e.id===t)?t:e.automations[0]?.id)},[]);(0,k.useEffect)(()=>{Y().catch(e=>B(String(e)))},[Y]),(0,k.useEffect)(()=>{J&&(w(D(J)),R(void 0),B(``),T.listRuns(J.id).then(e=>I(e.runs)).catch(e=>B(String(e))))},[J?.id,J?.revision]),(0,k.useEffect)(()=>{if(!L||N(L.status))return;let e=window.setInterval(()=>{T.getRun(L.id).then(({run:e})=>{R(e),N(e.status)&&J&&(T.listRuns(J.id).then(e=>I(e.runs)),Y())}).catch(e=>B(String(e)))},700);return()=>window.clearInterval(e)},[L,J]);let X=(0,k.useCallback)(async()=>{H(!0),B(``);try{let e=U&&[`recording`,`paused`].includes(U.state),t=W;if(!e){let e=await T.recordingAvailability();if(e.endpoints.length===1?t=e.endpoints[0].endpointId:e.endpoints.some(e=>e.endpointId===t)||(t=void 0),G(t),!t){q(e);return}}let n=await T.recording(e?`finish`:`start`,t);te(n.value),G(n.endpointId),q(void 0)}catch(e){let t=e.body;t?.code&&[`connect_required`,`update_required`,`choose_browser`].includes(t.code)?q({state:t.code,endpoints:t.endpoints??[]}):B(e instanceof Error?e.message:String(e))}finally{H(!1)}},[U,W]),ne=(0,k.useCallback)(async()=>{let e=await T.recordingAvailability();q(e),G(t=>e.endpoints.length===1?e.endpoints[0].endpointId:e.endpoints.some(e=>e.endpointId===t)?t:void 0)},[]);(0,k.useEffect)(()=>{if(!K)return;let e=!1,t=window.setInterval(()=>{T.recordingAvailability().then(t=>{e||(q(t),G(e=>t.endpoints.length===1?t.endpoints[0].endpointId:t.endpoints.some(t=>t.endpointId===e)?e:void 0))}).catch(()=>void 0)},3e3);return()=>{e=!0,window.clearInterval(t)}},[!!K]),(0,k.useEffect)(()=>{if(!U||U.automationId)return;let e=!1,t=window.setInterval(()=>{T.recording(`status`,W).then(async t=>{let n=t.value.find(e=>e.id===U.id);!e&&n&&(te(n),n.automationId&&(await Y(),e||g(n.automationId)))}).catch(t=>{e||B(String(t))})},1500);return()=>{e=!0,window.clearInterval(t)}},[U,W,Y]);let Z=(0,k.useCallback)(e=>{n(`/chat/new?draft=${encodeURIComponent(e)}`)},[n]),Q=(0,k.useMemo)(()=>(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[z&&(0,A.jsx)(`span`,{role:`alert`,className:`max-w-64 truncate text-xs text-red-600`,title:z,children:z}),U?.state===`stopped`&&!U.automationId&&(0,A.jsx)(`span`,{role:`status`,className:`text-xs text-fg-muted`,children:U.error||t.syncing}),(0,A.jsxs)(l,{variant:`secondary`,disabled:V,onClick:()=>void X(),children:[(0,A.jsx)(x,{className:`size-4`}),U&&[`recording`,`paused`].includes(U.state)?t.finishRecording:t.record]}),(0,A.jsxs)(l,{onClick:()=>Z(t.createPrompt),children:[(0,A.jsx)(d,{className:`size-4`}),t.create]})]}),[Z,t,V,X,U,z]);(0,k.useLayoutEffect)(()=>(i({startExtra:null,main:(0,A.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t.title}),end:Q}),()=>a()),[a,Q,i,t.title]);let re=async()=>{if(J){H(!0);try{await T.setEnabled(J.id,!J.enabled),await Y()}catch(e){B(String(e))}finally{H(!1)}}},ie=async()=>{if(J){if(!E(J,v)){B(t.required);return}H(!0);try{let{run:e}=await T.run(J.id,v);R(e),B(``)}catch(e){B(String(e))}finally{H(!1)}}},ae=async()=>{if(!(!J||!window.confirm(t.confirmDelete))){H(!0);try{await T.remove(J.id),g(void 0),I([]),await Y()}catch(e){B(String(e))}finally{H(!1)}}},$=K&&(0,A.jsx)(j,{availability:K,endpointId:W,recordingBusy:V,onSelect:G,onRefresh:ne,onStart:()=>void X(),onClose:()=>q(void 0)});return o===null?(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel px-4 pb-4 pt-3 sm:px-6 sm:pb-6 lg:pt-4`,children:[$,(0,A.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,A.jsx)(u,{className:`h-[420px] rounded-xl`}),(0,A.jsx)(u,{className:`h-[420px] rounded-xl`})]})]}):o.length===0?(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel px-4 pb-4 pt-3 sm:px-6 sm:pb-6 lg:pt-4`,children:[$,(0,A.jsxs)(`div`,{className:`m-auto max-w-md py-12 text-center`,children:[(0,A.jsx)(d,{className:`mx-auto size-10 text-accent`}),(0,A.jsx)(`h2`,{className:`mt-4 text-lg font-semibold text-fg`,children:t.emptyTitle}),(0,A.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:t.emptyBody}),(0,A.jsxs)(l,{className:`mt-5`,onClick:()=>Z(t.createPrompt),children:[(0,A.jsx)(d,{className:`size-4`}),t.create]})]})]}):(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel px-4 pb-4 pt-3 sm:px-6 sm:pb-6 lg:pt-4`,children:[$,(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-4 lg:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,A.jsx)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge bg-surface-base p-2`,children:o.map(e=>(0,A.jsxs)(`button`,{onClick:()=>g(e.id),className:`mb-1 w-full rounded-lg p-3 text-left ${h===e.id?`bg-accent-soft text-accent-fg`:`hover:bg-surface-hover`}`,children:[(0,A.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,A.jsxs)(`span`,{className:`mt-1 flex items-center gap-1.5 text-xs text-fg-muted`,children:[e.enabled?(0,A.jsx)(p,{className:`size-3.5 text-emerald-600`}):(0,A.jsx)(f,{className:`size-3.5`}),e.enabled?t.enabled:t.paused]})]},e.id))}),J&&(0,A.jsxs)(`main`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge bg-surface-base p-5 sm:p-6`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:J.name}),J.description&&(0,A.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:J.description}),(0,A.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[(0,A.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:t[J.risk]}),(0,A.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:J.verified?t.verified:t.saved}),J.domains.map(e=>(0,A.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:[(0,A.jsx)(b,{className:`size-3`}),e]},e))]})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsxs)(l,{variant:`secondary`,disabled:V,onClick:()=>void re(),children:[J.enabled?(0,A.jsx)(f,{className:`size-4`}):(0,A.jsx)(p,{className:`size-4`}),J.enabled?t.pause:t.enable]}),(0,A.jsxs)(l,{variant:`secondary`,onClick:()=>Z(t.editPrompt.replace(`{name}`,J.name).replace(`{id}`,J.id)),children:[(0,A.jsx)(_,{className:`size-4`}),t.edit]})]})]}),(0,A.jsxs)(`section`,{className:`mt-7 max-w-xl`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.inputs}),Object.keys(J.inputs).length===0?(0,A.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:t.noInputs}):(0,A.jsx)(`div`,{className:`mt-3`,children:(0,A.jsx)(O,{automation:J,values:v,language:e,onChange:w})}),(0,A.jsxs)(`div`,{className:`mt-5 flex gap-2`,children:[(0,A.jsxs)(l,{variant:`primary`,disabled:!J.enabled||V||!!(L&&!N(L.status)),onClick:()=>void ie(),children:[(0,A.jsx)(m,{className:`size-4`}),t.run]}),L&&!N(L.status)&&(0,A.jsxs)(l,{variant:`secondary`,onClick:()=>void T.cancel(L.id),children:[(0,A.jsx)(ee,{className:`size-4`}),t.stop]})]}),z&&(0,A.jsx)(`p`,{className:`mt-3 text-sm text-red-700 dark:text-red-300`,children:z})]}),L&&(0,A.jsxs)(`section`,{className:`mt-7 rounded-xl border border-edge bg-surface-inset p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,A.jsx)(C,{className:`size-4`}),L.businessOutcome===`verified`?t.verified:t[L.status]]}),L.businessOutcome===`unknown`&&(0,A.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:t.unknown}),L.error&&(0,A.jsx)(`p`,{className:`mt-2 text-sm text-red-700 dark:text-red-300`,children:L.error}),L.status===`succeeded`&&L.result!==void 0&&(0,A.jsxs)(`div`,{className:`mt-3`,children:[(0,A.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:t.result}),(0,A.jsx)(`pre`,{className:`mt-2 max-h-64 overflow-auto whitespace-pre-wrap text-sm text-fg`,children:P(L.result)})]})]}),(0,A.jsxs)(`section`,{className:`mt-8`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.history}),(0,A.jsx)(`div`,{className:`mt-2 divide-y divide-edge`,children:F.slice(0,10).map(e=>(0,A.jsxs)(`button`,{className:`flex w-full items-center justify-between gap-3 py-3 text-left text-sm hover:text-accent`,onClick:()=>R(e),children:[(0,A.jsx)(`span`,{children:t[e.status]}),(0,A.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[new Date(e.createdAtMs).toLocaleString(),e.durationMs?` · ${Math.max(1,Math.round(e.durationMs/1e3))}s`:``]})]},e.id))})]}),(0,A.jsx)(`div`,{className:`mt-8 border-t border-edge pt-4`,children:(0,A.jsxs)(l,{variant:`ghost`,className:`text-red-700 dark:text-red-300`,disabled:V,onClick:()=>void ae(),children:[(0,A.jsx)(S,{className:`size-4`}),t.delete]})})]})]})]})}export{F as BrowserAutomationsPage};
@@ -1,3 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i,u as a}from"./chunk-KS7C4IRE-BvcCCgTW.js";import{t as o}from"./chevron-down-ccbiQQz_.js";import{t as s}from"./popover-select-DGKUpVsz.js";import{t as c}from"./circle-check-C23XjkUj.js";import{t as l}from"./download-Dk-ZjtO6.js";import{t as u}from"./external-link-DjqjBmc3.js";import{t as d}from"./eye-CABVeTq0.js";import{t as f}from"./folder-open-CyzJ19I9.js";import{t as p}from"./globe-DSSGFWFn.js";import{t as m}from"./loader-circle-CifKLtgG.js";import{t as h}from"./refresh-cw-BRlGaq2w.js";import{t as g}from"./messages-BYq0cPbn.js";import{i as _,l as v,n as y,o as b}from"./locale-store-B7s2Hb35.js";import{i as x}from"./vendor-swr-BIWyz7Rc.js";import{t as S}from"./button-aIC072nz.js";import{t as C}from"./skeleton-BI5TyibZ.js";import{n as w,r as T}from"./gateway-config-swr-fQKBHBi1.js";import{Cn as E,Ru as D,Zu as O,_ as ee,b as k,bu as te,g as A,ga as ne,h as re,ha as j,kl as M,ol as ie,pd as N,ql as ae,v as oe,x as P,y as F}from"./index-DRyGCING.js";import{t as se}from"./number-input-DDeqHK-G.js";import{n as I,t as ce}from"./settings-page-header-BWyxJKOG.js";import"./settings-page-layout-DLHcS-0T.js";import{n as L,t as R}from"./use-autosave-D4EMIB-V.js";var z=n(),B=e(t(),1),V=r();function H(e){let t=(0,z.c)(31),{name:n,title:r,summary:a,icon:s,inset:c,children:l}=e,u=c===void 0?!1:c,[d,f]=i(),p=(0,B.useId)(),m=`browser-${n}`,h;t[0]!==m||t[1]!==d?(h=d.get(m),t[0]=m,t[1]=d,t[2]=h):h=t[2];let g=h===`1`,_=u?`border-t border-edge-subtle`:`rounded-2xl border border-edge bg-surface-panel`,v;t[3]!==m||t[4]!==g||t[5]!==f?(v=()=>f(e=>{let t=new URLSearchParams(e);return t.set(m,g?`0`:`1`),t}),t[3]=m,t[4]=g,t[5]=f,t[6]=v):v=t[6];let y;t[7]===s?y=t[8]:(y=s&&(0,V.jsx)(`span`,{className:`shrink-0 text-fg-muted`,"aria-hidden":!0,children:s}),t[7]=s,t[8]=y);let b;t[9]===r?b=t[10]:(b=(0,V.jsx)(`span`,{className:`min-w-0 flex-1 text-sm font-semibold text-fg`,children:r}),t[9]=r,t[10]=b);let x;t[11]===a?x=t[12]:(x=a&&(0,V.jsx)(`span`,{className:`max-w-[40%] truncate text-xs font-normal text-fg-muted`,title:a,children:a}),t[11]=a,t[12]=x);let S=`size-4 shrink-0 text-fg-muted ${g?`rotate-180`:``}`,C;t[13]===S?C=t[14]:(C=(0,V.jsx)(o,{className:S,"aria-hidden":!0}),t[13]=S,t[14]=C);let w;t[15]!==p||t[16]!==g||t[17]!==v||t[18]!==y||t[19]!==b||t[20]!==x||t[21]!==C?(w=(0,V.jsx)(`h2`,{children:(0,V.jsxs)(`button`,{type:`button`,"aria-expanded":g,"aria-controls":p,className:`flex min-h-16 w-full items-center gap-3 rounded-2xl p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:p-5`,onClick:v,children:[y,b,x,C]})}),t[15]=p,t[16]=g,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=C,t[22]=w):w=t[22];let T=!g,E=g&&l,D;t[23]!==p||t[24]!==T||t[25]!==E?(D=(0,V.jsx)(`div`,{id:p,hidden:T,className:`space-y-4 border-t border-edge-subtle p-4 sm:p-5`,children:E}),t[23]=p,t[24]=T,t[25]=E,t[26]=D):D=t[26];let O;return t[27]!==w||t[28]!==D||t[29]!==_?(O=(0,V.jsxs)(`section`,{className:_,children:[w,D]}),t[27]=w,t[28]=D,t[29]=_,t[30]=O):O=t[30],O}function le(e){let[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(null),l=(0,B.useRef)(null);return{running:t,cancelling:r,progress:a,error:s,install:(0,B.useCallback)(async()=>{if(l.current)return;let t=new AbortController;l.current=t,n(!0),o(null),c(null);try{let n=await oe(o,t.signal);if(!n.ok){n.error!==`cancelled`&&c(n.message??n.error);return}e()}catch(e){t.signal.aborted||c(e instanceof Error?e.message:String(e))}finally{l.current===t&&(l.current=null),n(!1),i(!1)}},[e]),cancel:(0,B.useCallback)(async()=>{l.current&&(i(!0),await re().catch(()=>{}),l.current.abort())},[])}}var U={extension:`Chrome extension`,playwright:`Playwright Chromium`,cdp:`CDP`,remote:`Remote browser`};function ue(e){let{enabled:t,driverKind:n,autosaveStatus:r,zh:i}=e,o=a(),s=x(t?[`browser-control-status`,n]:null,A,{revalidateOnFocus:!0,refreshInterval:n===`extension`?3e3:0}),[l,u]=(0,B.useState)(null),[d,f]=(0,B.useState)(null),[p,g]=(0,B.useState)(null),_=r===`dirty`||r===`saving`;(0,B.useEffect)(()=>{r===`saved`&&s.mutate()},[r,s.mutate]);let v=(0,B.useCallback)(async(e,t,n)=>{u(e),f(null),g(null);try{await t(),g(n),await s.mutate()}catch(e){f(e instanceof Error?e.message:String(e))}finally{u(null)}},[s.mutate]),y=le((0,B.useCallback)(()=>{g(i?`Chromium 已安装,可以开始连接测试。`:`Chromium is installed and ready to test.`),s.mutate()},[s.mutate,i])),b=s.data?.payload,w=b?.driverKind===n,T=t?s.error?`needs_attention`:_||!w?`syncing`:b?.state:`disabled`;return(0,V.jsxs)(`section`,{className:`overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:[(0,V.jsxs)(`div`,{className:`p-4 sm:p-5`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(T===`ready`?c:T===`syncing`?m:ie,{"aria-hidden":!0,className:`size-4 shrink-0 ${T===`ready`?`text-success`:T===`syncing`?`animate-spin text-fg-muted`:T===`disabled`?`text-fg-subtle`:`text-warning`}`}),(0,V.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:i?`连接状态`:`Connection status`}),(0,V.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-xs ${T===`ready`?`bg-success-soft text-success`:T===`disabled`?`bg-surface-hover text-fg-muted`:`bg-warning-soft text-warning`}`,children:T===`ready`?i?`已就绪`:`Ready`:T===`disabled`?i?`未启用`:`Disabled`:T===`syncing`?i?`正在应用配置`:`Applying configuration`:i?`需要处理`:`Needs attention`})]}),(0,V.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:U[n]})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsxs)(S,{variant:`ghost`,className:`h-9`,onClick:()=>void s.mutate(),disabled:s.isValidating,children:[(0,V.jsx)(h,{"aria-hidden":!0,className:`size-3.5 ${s.isValidating?`animate-spin`:``}`}),i?`刷新`:`Refresh`]}),(0,V.jsxs)(S,{variant:`secondary`,className:`h-9`,disabled:!t||_||l!==null||y.running,onClick:()=>void v(`test`,k,i?`连接测试成功。`:`Connection test passed.`),children:[l===`test`?(0,V.jsx)(m,{className:`size-3.5 animate-spin`}):(0,V.jsx)(ae,{className:`size-3.5`}),i?`测试连接`:`Test connection`]})]})]}),t&&s.isLoading?(0,V.jsxs)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-3`,children:[(0,V.jsx)(C,{className:`h-12`}),(0,V.jsx)(C,{className:`h-12`}),(0,V.jsx)(C,{className:`h-12`})]}):null,t&&s.error?(0,V.jsx)(q,{tone:`error`,children:s.error instanceof Error?s.error.message:String(s.error)}):null,d||y.error?(0,V.jsx)(q,{tone:`error`,children:d??y.error}):null,p?(0,V.jsx)(q,{tone:`success`,children:p}):null]}),t&&(0,V.jsxs)(H,{name:`status`,title:i?`安装与连接详情`:`Installation & connection details`,inset:!0,children:[b?.detail&&w&&(0,V.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:b.detail}),t&&n===`extension`&&w?(0,V.jsx)(W,{status:b?.driverStatus,zh:i,busy:l,run:v,onConnectRemote:()=>o(`/settings/devices?startDevicePairing=browser`)}):null,t&&n===`playwright`&&w?(0,V.jsx)(G,{status:b?.driverStatus,zh:i,installer:y}):null,t&&n===`cdp`?(0,V.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-inset px-3 py-2 text-xs leading-5 text-fg-muted`,children:i?`连接测试会验证已保存的 CDP 地址,并复用浏览器中现有的标签页和登录状态。`:`The connection test verifies the saved CDP endpoint and reuses that browser’s existing tabs and signed-in state.`}):null,t&&n===`remote`?(0,V.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-inset px-3 py-2 text-xs leading-5 text-fg-muted`,children:i?`连接测试会在服务商侧创建一个临时浏览器会话,并在测试结束后立即关闭。`:`The connection test creates a temporary provider session and closes it immediately after the test.`}):null]})]})}function W(e){let t=(0,z.c)(70),{status:n,zh:r,busy:i,run:a,onConnectRemote:o}=e,s=n?.artifacts,c=r?`扩展文件`:`Extension files`,d=s?.installed===!0,p=s?.installed?r?`已安装`:`Installed`:r?`未安装或需更新`:`Install or update required`,h;t[0]!==c||t[1]!==d||t[2]!==p?(h=(0,V.jsx)(K,{label:c,ok:d,value:p}),t[0]=c,t[1]=d,t[2]=p,t[3]=h):h=t[3];let g=r?`本机自动发现`:`Local auto-discovery`,_=s?.nativeHost?.installed===!0,v=s?.nativeHost?.installed?r?`已就绪`:`Ready`:s?.nativeHost?.reason??(r?`需要修复`:`Repair required`),y;t[4]!==g||t[5]!==_||t[6]!==v?(y=(0,V.jsx)(K,{label:g,ok:_,value:v}),t[4]=g,t[5]=_,t[6]=v,t[7]=y):y=t[7];let b=r?`安全通道`:`Secure channel`,x=n?.transport===`gateway-realtime`,C=n?.transport===`gateway-realtime`?`Gateway Realtime`:r?`不可用`:`Unavailable`,w;t[8]!==C||t[9]!==b||t[10]!==x?(w=(0,V.jsx)(K,{label:b,ok:x,value:C}),t[8]=C,t[9]=b,t[10]=x,t[11]=w):w=t[11];let T=r?`Chrome 连接`:`Chrome connection`,E=n?.connected===!0,D=n?.connected?r?`已连接`:`Connected`:n?.socketConnected?r?`需要重新加载扩展`:`Reload extension`:r?`等待扩展连接`:`Waiting for extension`,O;t[12]!==T||t[13]!==E||t[14]!==D?(O=(0,V.jsx)(K,{label:T,ok:E,value:D}),t[12]=T,t[13]=E,t[14]=D,t[15]=O):O=t[15];let k;t[16]!==w||t[17]!==O||t[18]!==h||t[19]!==y?(k=(0,V.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[h,y,w,O]}),t[16]=w,t[17]=O,t[18]=h,t[19]=y,t[20]=k):k=t[20];let te=s?.extensionDir??`Gateway Realtime`,A;t[21]===te?A=t[22]:(A=(0,V.jsx)(`p`,{className:`mt-3 break-all text-xs text-fg-subtle`,children:te}),t[21]=te,t[22]=A);let ne=s?.installed?`secondary`:`primary`,re=i!==null,j;t[23]!==s?.installed||t[24]!==a||t[25]!==r?(j=()=>void a(`extension-install`,()=>ee(!!s?.installed),r?`扩展文件已准备好。`:`Extension files are ready.`),t[23]=s?.installed,t[24]=a,t[25]=r,t[26]=j):j=t[26];let M;t[27]===i?M=t[28]:(M=i===`extension-install`?(0,V.jsx)(m,{className:`size-3.5 animate-spin`}):(0,V.jsx)(l,{className:`size-3.5`}),t[27]=i,t[28]=M);let ie=s?.installed?r?`刷新扩展文件`:`Refresh files`:r?`安装扩展文件`:`Install extension`,N;t[29]!==ne||t[30]!==re||t[31]!==j||t[32]!==M||t[33]!==ie?(N=(0,V.jsxs)(S,{className:`h-9`,variant:ne,disabled:re,onClick:j,children:[M,ie]}),t[29]=ne,t[30]=re,t[31]=j,t[32]=M,t[33]=ie,t[34]=N):N=t[34];let oe=!s?.installed||i!==null,P;t[35]!==a||t[36]!==r?(P=()=>void a(`extension-open`,fe,r?`已打开 Chrome 扩展页。`:`Chrome extensions opened.`),t[35]=a,t[36]=r,t[37]=P):P=t[37];let F;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,V.jsx)(u,{className:`size-3.5`}),t[38]=F):F=t[38];let se=r?`打开扩展页`:`Open extensions`,I;t[39]!==oe||t[40]!==P||t[41]!==se?(I=(0,V.jsxs)(S,{className:`h-9`,variant:`secondary`,disabled:oe,onClick:P,children:[F,se]}),t[39]=oe,t[40]=P,t[41]=se,t[42]=I):I=t[42];let ce=!s?.installed||i!==null,L;t[43]!==a||t[44]!==r?(L=()=>void a(`extension-folder`,de,r?`已打开扩展目录。`:`Extension folder opened.`),t[43]=a,t[44]=r,t[45]=L):L=t[45];let R;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,V.jsx)(f,{className:`size-3.5`}),t[46]=R):R=t[46];let B=r?`打开扩展目录`:`Open folder`,H;t[47]!==ce||t[48]!==L||t[49]!==B?(H=(0,V.jsxs)(S,{className:`h-9`,variant:`ghost`,disabled:ce,onClick:L,children:[R,B]}),t[47]=ce,t[48]=L,t[49]=B,t[50]=H):H=t[50];let le=i!==null,U;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,V.jsx)(ae,{className:`size-3.5`}),t[51]=U):U=t[51];let ue=r?`连接远程 Chrome`:`Connect remote Chrome`,W;t[52]!==o||t[53]!==le||t[54]!==ue?(W=(0,V.jsxs)(S,{className:`h-9`,variant:`secondary`,disabled:le,onClick:o,children:[U,ue]}),t[52]=o,t[53]=le,t[54]=ue,t[55]=W):W=t[55];let G;t[56]!==N||t[57]!==I||t[58]!==H||t[59]!==W?(G=(0,V.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[N,I,H,W]}),t[56]=N,t[57]=I,t[58]=H,t[59]=W,t[60]=G):G=t[60];let q;t[61]!==n?.connected||t[62]!==n?.socketConnected||t[63]!==r?(q=n?.connected?null:(0,V.jsx)(`p`,{className:`mt-3 text-xs leading-5 text-fg-muted`,children:n?.socketConnected?r?`扩展仍在运行旧协议。请打开 Chrome 扩展页,找到 xopc 并点击“重新加载”,然后刷新状态。`:`The extension is still running an older protocol. Open Chrome Extensions, find xopc, click Reload, then refresh status.`:r?`打开 xopc Chrome 扩展后,它会自动发现并安全连接本机 Gateway;只有连接另一台电脑时才需要一次性邀请和手动确认。`:`Open the xopc Chrome extension to discover and securely connect to a local Gateway automatically. A one-time invitation and explicit approval are only required for Chrome on another computer.`}),t[61]=n?.connected,t[62]=n?.socketConnected,t[63]=r,t[64]=q):q=t[64];let J;return t[65]!==k||t[66]!==A||t[67]!==G||t[68]!==q?(J=(0,V.jsxs)(`div`,{className:`space-y-3`,children:[k,A,G,q]}),t[65]=k,t[66]=A,t[67]=G,t[68]=q,t[69]=J):J=t[69],J}function de(){return F(`folder`)}function fe(){return F(`chrome`)}function G(e){let t=(0,z.c)(28),{status:n,zh:r,installer:i}=e,a=n?.installed===!0,o=n?.installed?r?`已安装`:`Installed`:n?.reason??(r?`未安装`:`Not installed`),s;t[0]!==a||t[1]!==o?(s=(0,V.jsx)(K,{label:`Chromium`,ok:a,value:o}),t[0]=a,t[1]=o,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=n?.executablePath?(0,V.jsx)(`p`,{className:`mt-2 break-all text-xs text-fg-subtle`,children:n.executablePath}):null,t[3]=n,t[4]=c);let u;t[5]===i.progress?u=t[6]:(u=i.progress?(0,V.jsxs)(`div`,{className:`mt-3`,children:[(0,V.jsxs)(`div`,{className:`flex justify-between text-xs text-fg-muted`,children:[(0,V.jsx)(`span`,{children:i.progress.message??i.progress.phase}),(0,V.jsx)(`span`,{children:i.progress.percent==null?``:`${Math.round(i.progress.percent)}%`})]}),(0,V.jsx)(`div`,{className:`mt-1 h-1.5 overflow-hidden rounded-full bg-surface-hover`,children:(0,V.jsx)(`div`,{className:`h-full rounded-full bg-accent transition-[width]`,style:{width:`${i.progress.percent??8}%`}})})]}):null,t[5]=i.progress,t[6]=u);let d=n?.installed?`secondary`:`primary`,f;t[7]===i?f=t[8]:(f=()=>void i.install(),t[7]=i,t[8]=f);let p;t[9]===i.running?p=t[10]:(p=i.running?(0,V.jsx)(m,{className:`size-3.5 animate-spin`}):(0,V.jsx)(l,{className:`size-3.5`}),t[9]=i.running,t[10]=p);let h=n?.installed?r?`重新安装 Chromium`:`Reinstall Chromium`:r?`安装 Chromium`:`Install Chromium`,g;t[11]!==i.running||t[12]!==d||t[13]!==f||t[14]!==p||t[15]!==h?(g=(0,V.jsxs)(S,{variant:d,className:`h-9`,disabled:i.running,onClick:f,children:[p,h]}),t[11]=i.running,t[12]=d,t[13]=f,t[14]=p,t[15]=h,t[16]=g):g=t[16];let _;t[17]!==i||t[18]!==r?(_=i.running?(0,V.jsx)(S,{variant:`ghost`,className:`h-9`,disabled:i.cancelling,onClick:()=>void i.cancel(),children:i.cancelling?r?`正在取消…`:`Cancelling…`:r?`取消`:`Cancel`}):null,t[17]=i,t[18]=r,t[19]=_):_=t[19];let v;t[20]!==_||t[21]!==g?(v=(0,V.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[g,_]}),t[20]=_,t[21]=g,t[22]=v):v=t[22];let y;return t[23]!==v||t[24]!==s||t[25]!==c||t[26]!==u?(y=(0,V.jsxs)(`div`,{className:`space-y-3`,children:[s,c,u,v]}),t[23]=v,t[24]=s,t[25]=c,t[26]=u,t[27]=y):y=t[27],y}function K(e){let t=(0,z.c)(11),{label:n,ok:r,value:i}=e,a;t[0]===n?a=t[1]:(a=(0,V.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n}),t[0]=n,t[1]=a);let o=`mt-1 flex items-center gap-1.5 text-sm ${r?`text-success`:`text-fg-muted`}`,s=`size-1.5 rounded-full ${r?`bg-success`:`bg-warning`}`,c;t[2]===s?c=t[3]:(c=(0,V.jsx)(`span`,{className:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c||t[6]!==i?(l=(0,V.jsxs)(`p`,{className:o,children:[c,i]}),t[4]=o,t[5]=c,t[6]=i,t[7]=l):l=t[7];let u;return t[8]!==a||t[9]!==l?(u=(0,V.jsxs)(`div`,{className:`rounded-lg bg-surface-inset px-3 py-2`,children:[a,l]}),t[8]=a,t[9]=l,t[10]=u):u=t[10],u}function q(e){let t=(0,z.c)(4),{tone:n,children:r}=e,i=`mt-3 rounded-lg px-3 py-2 text-xs ${n===`success`?`bg-success-soft text-success`:`bg-danger-soft text-danger`}`,a=n===`error`?`alert`:`status`,o;return t[0]!==r||t[1]!==i||t[2]!==a?(o=(0,V.jsx)(`p`,{className:i,role:a,children:r}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):o=t[3],o}function J(e){let t=(0,z.c)(41),{sectionId:n,vm:r,children:i,aiSetup:a}=e,o=y(pe),s;t[0]===o?s=t[1]:(s=g(o),t[0]=o,t[1]=s);let c=s,l=c.agentSettings,u=c.settingsSections[n]??n,d=o===`zh`?`连接浏览器,让 AI 帮你完成网页任务。`:`Connect a browser and let AI help with web tasks.`,f;t[2]!==r.autosaveStatus||t[3]!==r.error||t[4]!==r.form||t[5]!==r.hasToken?(f=r.hasToken&&r.form?(0,V.jsx)(L,{className:`mt-2 max-w-full`,status:r.autosaveStatus,error:r.error}):void 0,t[2]=r.autosaveStatus,t[3]=r.error,t[4]=r.form,t[5]=r.hasToken,t[6]=f):f=t[6];let p;t[7]!==a||t[8]!==u||t[9]!==d||t[10]!==f?(p=(0,V.jsx)(ce,{title:u,aiSetup:a,subtitle:d,meta:f}),t[7]=a,t[8]=u,t[9]=d,t[10]=f,t[11]=p):p=t[11];let m=p;if(!r.hasToken){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(N,{className:`mt-0.5 size-5 shrink-0 text-fg-subtle`,strokeWidth:1.75}),t[12]=e):e=t[12];let n;t[13]===l.needToken?n=t[14]:(n=(0,V.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl bg-surface-base p-6`,children:[e,(0,V.jsx)(`div`,{children:(0,V.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:l.needToken})})]}),t[13]=l.needToken,t[14]=n);let r;return t[15]!==m||t[16]!==n?(r=(0,V.jsxs)(I,{className:`max-w-[48rem]`,gap:`gap-3`,padding:`px-3 py-10 sm:px-5 xl:px-6`,children:[m,n]}),t[15]=m,t[16]=n,t[17]=r):r=t[17],r}if(r.loading){let e;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(E,{sections:1}),t[18]=e):e=t[18];let n;return t[19]===m?n=t[20]:(n=(0,V.jsxs)(I,{className:`max-w-[48rem]`,gap:`gap-6`,padding:`px-3 py-8 sm:px-5 xl:px-6`,children:[m,e]}),t[19]=m,t[20]=n),n}if(!r.form){let e=r.error??r.fetchError??l.loadError,n;t[21]===e?n=t[22]:(n=(0,V.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e}),t[21]=e,t[22]=n);let i;t[23]===r?i=t[24]:(i=()=>void r.mutate(),t[23]=r,t[24]=i);let a;t[25]!==c.logs.refresh||t[26]!==i?(a=(0,V.jsx)(S,{type:`button`,variant:`secondary`,onClick:i,children:c.logs.refresh}),t[25]=c.logs.refresh,t[26]=i,t[27]=a):a=t[27];let o;return t[28]!==m||t[29]!==n||t[30]!==a?(o=(0,V.jsxs)(I,{className:`max-w-[48rem]`,gap:`gap-3`,padding:`px-3 py-10 sm:px-5 xl:px-6`,children:[m,n,a]}),t[28]=m,t[29]=n,t[30]=a,t[31]=o):o=t[31],o}let h;t[32]===r.error?h=t[33]:(h=r.error?(0,V.jsx)(`div`,{className:`rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/50 dark:text-red-400`,role:`alert`,children:r.error}):null,t[32]=r.error,t[33]=h);let _;t[34]===i?_=t[35]:(_=(0,V.jsx)(`div`,{className:`flex min-w-0 flex-col gap-5 pb-8`,children:i}),t[34]=i,t[35]=_);let v;return t[36]!==m||t[37]!==h||t[38]!==_||t[39]!==r.onBlurCapture?(v=(0,V.jsxs)(I,{className:`max-w-[48rem]`,gap:`gap-6`,onBlurCapture:r.onBlurCapture,children:[m,h,_]}),t[36]=m,t[37]=h,t[38]=_,t[39]=r.onBlurCapture,t[40]=v):v=t[40],v}function pe(e){return e.language}var Y={enabled:!0,driverKind:`extension`,headless:!1,executablePath:``,cdpEndpoint:`http://127.0.0.1:9222`,remoteProvider:`browserbase`,remoteApiKey:``,remoteProjectId:``,remoteRegion:``,maxNodes:180,maxCharacters:12e3,visualFallback:!0,actionTimeoutMs:3e4,sessionTimeoutMs:9e5,maxSequenceLength:5,allowedPrivateHosts:``,crossDomainNavigation:`allow`,uploads:`allow`,consequentialActions:`allow`};function me(e){let t=X(X(e).browser),n=X(t.driver),r=X(t.observation),i=X(t.limits),a=X(t.security),o=n.kind;return{...Y,enabled:t.enabled!==!1,driverKind:o===`playwright`||o===`cdp`||o===`remote`?o:`extension`,headless:n.headless===!0,executablePath:Z(n.executablePath,``),cdpEndpoint:Z(n.endpoint,Y.cdpEndpoint),remoteProvider:n.provider===`browser-use`?`browser-use`:`browserbase`,remoteApiKey:Z(n.apiKey,``),remoteProjectId:Z(n.projectId,``),remoteRegion:Z(n.region,``),maxNodes:Q(r.maxNodes,Y.maxNodes),maxCharacters:Q(r.maxCharacters,Y.maxCharacters),visualFallback:r.visualFallback!==!1,actionTimeoutMs:Q(i.actionTimeoutMs,Y.actionTimeoutMs),sessionTimeoutMs:Q(i.sessionTimeoutMs,Y.sessionTimeoutMs),maxSequenceLength:Q(i.maxSequenceLength,Y.maxSequenceLength),allowedPrivateHosts:Array.isArray(a.allowedPrivateHosts)?a.allowedPrivateHosts.filter(e=>typeof e==`string`).join(`
2
- `):``,crossDomainNavigation:ve(a.crossDomainNavigation),uploads:ve(a.uploads),consequentialActions:ve(a.consequentialActions)}}function he(e){let t=e.driverKind===`extension`?{kind:`extension`}:e.driverKind===`playwright`?{kind:`playwright`,headless:e.headless,...e.executablePath.trim()?{executablePath:e.executablePath.trim()}:{}}:e.driverKind===`cdp`?{kind:`cdp`,endpoint:e.cdpEndpoint.trim()}:{kind:`remote`,provider:e.remoteProvider,...e.remoteApiKey.trim()?{apiKey:e.remoteApiKey.trim()}:{},...e.remoteProjectId.trim()?{projectId:e.remoteProjectId.trim()}:{},...e.remoteRegion.trim()?{region:e.remoteRegion.trim()}:{}};return{enabled:e.enabled,driver:t,observation:{maxNodes:e.maxNodes,maxCharacters:e.maxCharacters,visualFallback:e.visualFallback},limits:{actionTimeoutMs:e.actionTimeoutMs,sessionTimeoutMs:e.sessionTimeoutMs,maxSequenceLength:e.maxSequenceLength},security:{privateNetworks:`deny`,allowedPrivateHosts:e.allowedPrivateHosts.split(`
3
- `).map(e=>e.trim()).filter(Boolean),crossDomainNavigation:e.crossDomainNavigation,uploads:e.uploads,consequentialActions:e.consequentialActions}}}function ge(e){if(e.driverKind===`cdp`)try{let t=new URL(e.cdpEndpoint);if(t.protocol!==`http:`&&t.protocol!==`https:`&&t.protocol!==`ws:`&&t.protocol!==`wss:`)return`CDP endpoint must use http, https, ws, or wss.`}catch{return`Enter a valid CDP endpoint URL.`}return!Number.isInteger(e.maxNodes)||e.maxNodes<20||e.maxNodes>500?`Max nodes must be between 20 and 500.`:!Number.isInteger(e.maxCharacters)||e.maxCharacters<1e3||e.maxCharacters>5e4?`Max characters must be between 1,000 and 50,000.`:!Number.isInteger(e.actionTimeoutMs)||e.actionTimeoutMs<1e3||e.actionTimeoutMs>12e4?`Action timeout must be between 1,000 and 120,000 ms.`:!Number.isInteger(e.sessionTimeoutMs)||e.sessionTimeoutMs<6e4||e.sessionTimeoutMs>36e5?`Session timeout must be between 60,000 and 3,600,000 ms.`:!Number.isInteger(e.maxSequenceLength)||e.maxSequenceLength<1||e.maxSequenceLength>10?`Sequence length must be between 1 and 10.`:null}async function _e(e){await b(_(`/api/config`),{method:`PATCH`,body:JSON.stringify({browser:he(e)})}),w()}function X(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function Z(e,t){return typeof e==`string`?e:t}function Q(e,t){return typeof e==`number`&&Number.isFinite(e)?e:t}function ve(e){return e===`deny`?`deny`:`allow`}var ye=j();function be(e){let t=!!v(e=>e.conversationId),[n,r]=(0,B.useReducer)(ye,{form:null,baseline:null}),i=n.form,a=n.baseline,o=(0,B.useRef)(!1),s=(0,B.useRef)(i);s.current=i;let c=(0,B.useRef)(null),{data:l,error:u,isLoading:d,mutate:f}=T(t);ne({enabled:t,parsed:(0,B.useMemo)(()=>l?.payload?.config===void 0?null:me(l.payload.config),[l]),dirty:o.current,trackedParsedRef:c,dispatch:r,onResetDirty:()=>{o.current=!1}});let p=!!(t&&d&&l===void 0&&!u),m=u instanceof Error?u.message:u?String(u):null,h=(0,B.useMemo)(()=>!i||!a?!1:JSON.stringify(i)!==JSON.stringify(a),[i,a]),g=(0,B.useCallback)(e=>{o.current=!0,r({type:`patch`,patch:e})},[]),_=R({value:i,dirty:h,onSave:(0,B.useCallback)(async t=>{try{await _e(t),r({type:`saved`,value:t}),o.current=!!(s.current&&JSON.stringify(s.current)!==JSON.stringify(t))}catch(t){throw Error(t instanceof Error?t.message:e.saveError)}},[e.saveError]),validate:ge});return{hasToken:t,loading:p,fetchError:m,form:i,update:g,autosaveStatus:_.status,error:_.error,onBlurCapture:_.onBlurCapture,mutate:f}}var xe=[`extension`,`playwright`,`cdp`,`remote`];function Se(){let e=(0,z.c)(30),t=y(Ce),n;e[0]===t?n=e[1]:(n=g(t),e[0]=t,e[1]=n);let r=be(n.agentSettings),a=r.form,o=t===`zh`,[c]=i(),l=(0,B.useRef)(!1),u;e[2]!==a||e[3]!==c||e[4]!==r?(u=()=>{if(!a||l.current)return;l.current=!0;let e=c.get(`driver`);xe.includes(e)&&e!==a.driverKind&&r.update({driverKind:e})},e[2]=a,e[3]=c,e[4]=r,e[5]=u):u=e[5];let f;e[6]!==a||e[7]!==c||e[8]!==r.update?(f=[a,c,r.update],e[6]=a,e[7]=c,e[8]=r.update,e[9]=f):f=e[9],(0,B.useEffect)(u,f);let m=o?`Chrome 扩展(推荐)`:`Chrome extension (recommended)`,h;e[10]===m?h=e[11]:(h={value:`extension`,label:m},e[10]=m,e[11]=h);let _;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(_={value:`playwright`,label:`Playwright Chromium`},e[12]=_):_=e[12];let v=o?`CDP 已有浏览器`:`Existing browser over CDP`,b;e[13]===v?b=e[14]:(b={value:`cdp`,label:v},e[13]=v,e[14]=b);let x=o?`远程浏览器`:`Remote browser`,S;e[15]===x?S=e[16]:(S={value:`remote`,label:x},e[15]=x,e[16]=S);let C;e[17]!==h||e[18]!==b||e[19]!==S?(C=[h,_,b,S],e[17]=h,e[18]=b,e[19]=S,e[20]=C):C=e[20];let w=C,T;e[21]!==w||e[22]!==a||e[23]!==c||e[24]!==r||e[25]!==o?(T=a?(0,V.jsxs)(V.Fragment,{children:[c.get(`browserSetup`)&&c.get(`conversationId`)&&(0,V.jsx)(P,{conversationId:c.get(`conversationId`),requested:!0}),(0,V.jsx)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`,"aria-label":o?`浏览器控制设置`:`Browser control settings`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl bg-surface-inset text-fg-muted`,children:(0,V.jsx)(p,{className:`size-6`,"aria-hidden":!0})}),(0,V.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,V.jsx)(Oe,{label:o?`启用浏览器控制`:`Enable browser control`,description:o?`让 AI 帮你操作浏览器。`:`Let AI work with your browser.`,checked:a.enabled,onChange:e=>r.update({enabled:e})})})]})}),(0,V.jsxs)(Te,{title:o?`连接方式`:`Browser connection`,children:[(0,V.jsx)(s,{ariaLabel:o?`浏览器连接`:`Browser connection`,value:a.driverKind,options:w,placeholder:o?`选择连接方式`:`Choose a connection`,allowEmpty:!1,onChange:e=>r.update({driverKind:e})}),(0,V.jsx)(H,{name:`connection-help`,title:o?`了解此连接方式`:`About this connection`,inset:!0,icon:(0,V.jsx)(D,{className:`size-4`}),children:(0,V.jsx)(we,{kind:a.driverKind,zh:o})}),a.driverKind===`playwright`?(0,V.jsxs)(H,{name:`playwright-options`,title:o?`运行选项`:`Launch options`,summary:a.headless?o?`后台运行`:`Headless`:o?`显示窗口`:`Visible window`,inset:!0,children:[(0,V.jsx)(Oe,{label:o?`无头模式`:`Headless mode`,description:o?`后台运行,不显示浏览器窗口。关闭后可观察智能体的操作过程。`:`Run in the background without a visible window. Turn off to watch the agent work.`,checked:a.headless,onChange:e=>r.update({headless:e})}),(0,V.jsx)($,{label:o?`Chromium 可执行文件(可选)`:`Chromium executable (optional)`,description:o?`留空时使用由 xopc 安装的 Chromium。`:`Leave empty to use Chromium installed by xopc.`,value:a.executablePath,onChange:e=>r.update({executablePath:e})})]}):null,a.driverKind===`cdp`?(0,V.jsx)(`div`,{className:`rounded-lg bg-surface-inset p-4`,children:(0,V.jsx)($,{label:`CDP endpoint`,description:o?`例如 http://127.0.0.1:9222。Chrome 需要开启 remote debugging。`:`For example http://127.0.0.1:9222. Chrome must be started with remote debugging enabled.`,value:a.cdpEndpoint,onChange:e=>r.update({cdpEndpoint:e})})}):null,a.driverKind===`remote`?(0,V.jsxs)(`div`,{className:`space-y-4 rounded-lg bg-surface-inset p-4`,children:[(0,V.jsx)(Ee,{label:o?`服务商`:`Provider`,children:(0,V.jsx)(s,{value:a.remoteProvider,options:[{value:`browserbase`,label:`Browserbase`},{value:`browser-use`,label:`Browser Use`}],placeholder:o?`选择服务商`:`Choose a provider`,allowEmpty:!1,onChange:e=>r.update({remoteProvider:e})})}),(0,V.jsx)($,{label:`API key`,type:`password`,autoComplete:`off`,value:a.remoteApiKey,onChange:e=>r.update({remoteApiKey:e})}),(0,V.jsx)($,{label:`Project ID`,value:a.remoteProjectId,onChange:e=>r.update({remoteProjectId:e})}),(0,V.jsx)(H,{name:`remote-options`,title:o?`服务商选项`:`Provider options`,inset:!0,children:(0,V.jsx)($,{label:`Region`,value:a.remoteRegion,onChange:e=>r.update({remoteRegion:e})})})]}):null]}),(0,V.jsx)(ue,{enabled:a.enabled,driverKind:a.driverKind,autosaveStatus:r.autosaveStatus,zh:o}),(0,V.jsx)(H,{name:`execution`,title:o?`页面理解与执行限制`:`Observation & execution`,summary:o?`高级`:`Advanced`,icon:(0,V.jsx)(M,{className:`size-5`}),children:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Te,{title:o?`页面理解`:`Page understanding`,icon:(0,V.jsx)(d,{className:`size-4`}),children:[(0,V.jsx)(Oe,{label:o?`需要时附加截图`:`Attach screenshots when needed`,checked:a.visualFallback,onChange:e=>r.update({visualFallback:e})}),(0,V.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,V.jsx)(De,{label:o?`语义节点上限`:`Semantic node limit`,description:`20–500`,min:20,max:500,value:a.maxNodes,onChange:e=>r.update({maxNodes:e})}),(0,V.jsx)(De,{label:o?`文本字符上限`:`Text character limit`,description:`1,000–50,000`,min:1e3,max:5e4,step:1e3,value:a.maxCharacters,onChange:e=>r.update({maxCharacters:e})})]})]}),(0,V.jsx)(Te,{title:o?`执行限制`:`Execution limits`,icon:(0,V.jsx)(O,{className:`size-4`}),children:(0,V.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,V.jsx)(De,{label:o?`操作超时(毫秒)`:`Action timeout (ms)`,min:1e3,max:12e4,step:1e3,value:a.actionTimeoutMs,onChange:e=>r.update({actionTimeoutMs:e})}),(0,V.jsx)(De,{label:o?`会话超时(毫秒)`:`Session timeout (ms)`,min:6e4,max:36e5,step:6e4,value:a.sessionTimeoutMs,onChange:e=>r.update({sessionTimeoutMs:e})}),(0,V.jsx)(De,{label:o?`批量步骤上限`:`Sequence step limit`,min:1,max:10,value:a.maxSequenceLength,onChange:e=>r.update({maxSequenceLength:e})})]})})]})}),(0,V.jsxs)(H,{name:`access`,title:o?`访问策略`:`Access policies`,summary:o?`权限与私网`:`Permissions`,icon:(0,V.jsx)(te,{className:`size-5`}),children:[(0,V.jsx)(H,{name:`private-hosts`,title:o?`私网访问例外`:`Private network exceptions`,inset:!0,summary:a.allowedPrivateHosts||(o?`未设置私网例外`:`No private network exceptions`),children:(0,V.jsx)($,{label:o?`允许访问的私网主机`:`Allowed private hosts`,description:o?`每行一个主机名或 IP,不支持通配符。`:`One hostname or IP per line. Wildcards are not supported.`,multiline:!0,value:a.allowedPrivateHosts,onChange:e=>r.update({allowedPrivateHosts:e})})}),(0,V.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,V.jsx)(ke,{zh:o,label:o?`跨域导航`:`Cross-domain navigation`,value:a.crossDomainNavigation,onChange:e=>r.update({crossDomainNavigation:e})}),(0,V.jsx)(ke,{zh:o,label:o?`高影响动作`:`Consequential actions`,value:a.consequentialActions,onChange:e=>r.update({consequentialActions:e})}),(0,V.jsx)(ke,{zh:o,label:o?`文件上传`:`File uploads`,value:a.uploads,onChange:e=>r.update({uploads:e})})]})]})]}):null,e[21]=w,e[22]=a,e[23]=c,e[24]=r,e[25]=o,e[26]=T):T=e[26];let E;return e[27]!==T||e[28]!==r?(E=(0,V.jsx)(J,{sectionId:`agent-browser`,aiSetup:`browser`,vm:r,children:T}),e[27]=T,e[28]=r,e[29]=E):E=e[29],E}function Ce(e){return e.language}function we(e){let t=(0,z.c)(7),{kind:n,zh:r}=e,i=r?`直接操作你正在使用的 Chrome,保留登录状态和现有标签页;最适合日常协作。`:`Operate your current Chrome with its signed-in state and existing tabs; best for daily collaboration.`,a=r?`由 xopc 启动独立 Chromium,环境隔离、自动化稳定,适合无人值守任务。`:`Let xopc launch an isolated Chromium; stable for unattended automation.`,o=r?`连接已开启远程调试的 Chrome 或 Chromium,适合自定义浏览器启动方式。`:`Connect to Chrome or Chromium already running with remote debugging.`,s=r?`使用 Browserbase 或 Browser Use 的云端浏览器,适合服务器环境和长任务。`:`Use a Browserbase or Browser Use cloud browser for servers and long-running tasks.`,c;t[0]!==i||t[1]!==a||t[2]!==o||t[3]!==s?(c={extension:i,playwright:a,cdp:o,remote:s},t[0]=i,t[1]=a,t[2]=o,t[3]=s,t[4]=c):c=t[4];let l=c[n],u;return t[5]===l?u=t[6]:(u=(0,V.jsx)(`p`,{className:`rounded-lg bg-surface-inset px-3 py-2 text-xs leading-5 text-fg-muted`,children:l}),t[5]=l,t[6]=u),u}function Te(e){let t=(0,z.c)(17),{title:n,description:r,icon:i,children:a}=e,o;t[0]===i?o=t[1]:(o=i&&(0,V.jsx)(`span`,{className:`mt-0.5 text-fg-subtle`,"aria-hidden":!0,children:i}),t[0]=i,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,V.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n}),t[2]=n,t[3]=s);let c;t[4]===r?c=t[5]:(c=r?(0,V.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:r}):null,t[4]=r,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,V.jsxs)(`div`,{children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==o||t[10]!==l?(u=(0,V.jsxs)(`div`,{className:`mb-4 flex items-start gap-2`,children:[o,l]}),t[9]=o,t[10]=l,t[11]=u):u=t[11];let d;t[12]===a?d=t[13]:(d=(0,V.jsx)(`div`,{className:`space-y-4`,children:a}),t[12]=a,t[13]=d);let f;return t[14]!==u||t[15]!==d?(f=(0,V.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`,children:[u,d]}),t[14]=u,t[15]=d,t[16]=f):f=t[16],f}function Ee(e){let t=(0,z.c)(8),{label:n,description:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,V.jsx)(`span`,{className:`mb-1.5 block font-medium`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r?(0,V.jsx)(`span`,{className:`mt-1.5 block text-xs leading-5 text-fg-subtle`,children:r}):null,t[2]=r,t[3]=o);let s;return t[4]!==i||t[5]!==a||t[6]!==o?(s=(0,V.jsxs)(`label`,{className:`block text-sm text-fg`,children:[a,i,o]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function $(e){let t=(0,z.c)(10),{label:n,description:r,value:i,onChange:a,type:o,multiline:s,autoComplete:c}=e,l=o===void 0?`text`:o,u=s===void 0?!1:s,d;t[0]!==c||t[1]!==u||t[2]!==a||t[3]!==l||t[4]!==i?(d=u?(0,V.jsx)(`textarea`,{rows:3,value:i,onChange:e=>a(e.target.value),className:`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}):(0,V.jsx)(`input`,{type:l,autoComplete:c,value:i,onChange:e=>a(e.target.value),className:`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}),t[0]=c,t[1]=u,t[2]=a,t[3]=l,t[4]=i,t[5]=d):d=t[5];let f;return t[6]!==r||t[7]!==n||t[8]!==d?(f=(0,V.jsx)(Ee,{label:n,description:r,children:d}),t[6]=r,t[7]=n,t[8]=d,t[9]=f):f=t[9],f}function De(e){let t=(0,z.c)(12),{label:n,description:r,value:i,onChange:a,min:o,max:s,step:c}=e,l=c===void 0?1:c,u;t[0]===a?u=t[1]:(u=e=>{let t=Number(e.target.value);Number.isFinite(t)&&a(t)},t[0]=a,t[1]=u);let d;t[2]!==s||t[3]!==o||t[4]!==l||t[5]!==u||t[6]!==i?(d=(0,V.jsx)(se,{type:`number`,min:o,max:s,step:l,value:i,onChange:u,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset px-3 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}),t[2]=s,t[3]=o,t[4]=l,t[5]=u,t[6]=i,t[7]=d):d=t[7];let f;return t[8]!==r||t[9]!==n||t[10]!==d?(f=(0,V.jsx)(Ee,{label:n,description:r,children:d}),t[8]=r,t[9]=n,t[10]=d,t[11]=f):f=t[11],f}function Oe(e){let t=(0,z.c)(23),{label:n,description:r,checked:i,onChange:a}=e,o;t[0]===n?o=t[1]:(o=(0,V.jsx)(`span`,{className:`block text-sm font-semibold text-fg`,children:n}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=r&&(0,V.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:r}),t[2]=r,t[3]=s);let c;t[4]!==o||t[5]!==s?(c=(0,V.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;t[7]!==i||t[8]!==a?(l=()=>a(!i),t[7]=i,t[8]=a,t[9]=l):l=t[9];let u=`flex h-6 w-11 items-center rounded-full p-0.5 transition-colors motion-reduce:transition-none ${i?`bg-accent`:`bg-fg-muted/30`}`,d=`size-5 rounded-full bg-white transition-transform motion-reduce:transition-none ${i?`translate-x-5`:`translate-x-0`}`,f;t[10]===d?f=t[11]:(f=(0,V.jsx)(`span`,{className:d}),t[10]=d,t[11]=f);let p;t[12]!==u||t[13]!==f?(p=(0,V.jsx)(`span`,{className:u,children:f}),t[12]=u,t[13]=f,t[14]=p):p=t[14];let m;t[15]!==i||t[16]!==n||t[17]!==l||t[18]!==p?(m=(0,V.jsx)(`button`,{type:`button`,role:`switch`,"aria-label":n,"aria-checked":i,onClick:l,className:`touch-target flex shrink-0 items-center rounded-lg px-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:p}),t[15]=i,t[16]=n,t[17]=l,t[18]=p,t[19]=m):m=t[19];let h;return t[20]!==c||t[21]!==m?(h=(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[c,m]}),t[20]=c,t[21]=m,t[22]=h):h=t[22],h}function ke(e){let t=(0,z.c)(17),{zh:n,label:r,value:i,onChange:a}=e,o=n?`允许`:`Allow`,c;t[0]===o?c=t[1]:(c={value:`allow`,label:o},t[0]=o,t[1]=c);let l=n?`拒绝`:`Deny`,u;t[2]===l?u=t[3]:(u={value:`deny`,label:l},t[2]=l,t[3]=u);let d;t[4]!==c||t[5]!==u?(d=[c,u],t[4]=c,t[5]=u,t[6]=d):d=t[6];let f=d,p=n?`选择策略`:`Choose a policy`,m;t[7]===a?m=t[8]:(m=e=>a(e),t[7]=a,t[8]=m);let h;t[9]!==f||t[10]!==p||t[11]!==m||t[12]!==i?(h=(0,V.jsx)(s,{value:i,options:f,placeholder:p,allowEmpty:!1,onChange:m}),t[9]=f,t[10]=p,t[11]=m,t[12]=i,t[13]=h):h=t[13];let g;return t[14]!==r||t[15]!==h?(g=(0,V.jsx)(Ee,{label:r,children:h}),t[14]=r,t[15]=h,t[16]=g):g=t[16],g}export{Se as AgentBrowserSettingsPage};
@@ -1 +0,0 @@
1
- import{a as e,c as t,d as n,f as r,g as i,h as a,i as o,l as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m,v as h}from"./schemas-CObaziC7.js";import{c as g,f as ee,g as te,l as ne,n as _,o as v,p as y,u as b,v as x}from"./tasks-TVRjEggr.js";import{i as S,n as C,t as re}from"./local-apps-yys1VChX.js";import{g as ie,h as ae}from"./local-session-drafts-iGX_6O0O.js";var oe=m({id:u(),kind:p([`task`,`connector_approval`]),title:u(),detail:u().optional(),reason:p([`needs_input`,`blocked`,`user_input`,`user_approval`,`dependency`,`external`,`scheduled`,`retry`,`paused`,`overdue`,`due_soon`,`decision_needed`,`approval_required`]),urgency:p([`now`,`soon`]),href:u(),projectId:u().optional(),projectName:u().optional(),dueAt:s().int().nonnegative().optional(),updatedAt:s(),response:e(`kind`,[m({kind:f(`connector_approval`),approvalId:u()}),m({kind:f(`task`),taskId:u(),canRetry:o()})]).optional()});m({id:u(),kind:p([`automation_run`]),runId:u(),title:u(),detail:u(),reason:p([`run_failed`,`run_timeout`]),href:u(),updatedAt:s(),conversationId:u().optional()});var w=e(`type`,[m({type:f(`task_review`),label:u(),taskId:u()}),m({type:f(`retry_task`),label:u(),taskId:u()}),m({type:f(`open`),label:u(),href:u()}),m({type:f(`connector_decision`),label:u(),approvalId:u(),decision:p([`approve`,`deny`])}),m({type:f(`retry_run`),label:u(),subjectKind:p([`automation_run`]),runId:u()}),m({type:f(`acknowledge_run`),label:u(),subjectKind:p([`automation_run`]),runId:u()})]),T=m({id:u(),kind:p([`decision`,`failure`,`running`,`scheduled`]),title:u(),summary:u(),recommendation:u().optional(),dueAt:s().int().nonnegative().optional(),statusLabel:u().optional(),updatedAt:s(),openAction:w.optional(),primaryAction:w.optional(),secondaryActions:d(w).max(2).default([])}),se=m({conversationId:u(),runId:u(),title:u().optional(),agentId:u().optional(),updatedAt:s()}),ce=r({id:u().trim().min(1).max(300),sourceType:p([`project`,`task`,`conversation`,`calendar`,`mail`,`communication`,`file`,`user_model`]),sourceRef:u().trim().min(1).max(1e3),revision:u().trim().min(1).max(300),observation:u().trim().min(1).max(1e3),observedAt:s().int().nonnegative(),freshUntil:s().int().nonnegative(),href:u().trim().min(1).max(2e3).optional()}),E=r({kind:p([`connector`,`skill`,`agent`]),capability:u().trim().min(1).max(200),resolvedId:u().trim().min(1).max(300).optional(),readiness:p([`ready`,`needs_setup`,`unavailable`]),required:o(),recoveryPath:u().trim().min(1).max(2e3).optional(),reason:u().trim().min(1).max(500).optional()}),D=r({kind:p([`connector`,`skill`,`agent`]),capability:u().trim().min(1).max(200),code:p([`not_installed`,`disabled`,`agent_not_allowed`,`scope_too_narrow`,`connection_missing`,`account_selection_required`,`reauthorization_required`,`requirements_unmet`,`model_invocation_disabled`,`tool_gated`,`agent_unavailable`]),message:u().trim().min(1).max(500),recoveryPath:u().trim().min(1).max(2e3)}),O=e(`state`,[r({state:f(`ready`)}),r({state:f(`needs_setup`),blockers:d(D).min(1).max(12),recoveryActions:d(r({capability:u().trim().min(1).max(200),href:u().trim().min(1).max(2e3)})).min(1).max(12),degradedAction:r({mode:f(`degraded_start`)}).optional()})]),k=r({id:u().trim().min(1).max(200),revision:s().int().positive(),kind:p([`project_next_step`,`delivery_risk`,`meeting_prep`,`commitment_follow_up`,`automation_candidate`]),projectId:u().trim().min(1).max(200).optional(),title:u().trim().min(1).max(160),outcome:u().trim().min(1).max(1e3),rationale:u().trim().min(1).max(1500),evidence:d(ce).min(1).max(8),confidence:p([`high`,`medium`,`low`]),urgency:p([`now`,`today`,`this_week`]),estimatedMinutes:s().int().min(1).max(480).optional(),risk:p([`analysis`,`external_read`,`file_write`,`external_write`]),proposedSteps:d(u().trim().min(1).max(500)).min(1).max(6),capabilities:d(E).max(12),verification:d(u().trim().min(1).max(500)).max(8),actionPrompt:u().trim().min(1).max(4e3),degradedActionPrompt:u().trim().min(1).max(4e3).optional(),continuation:e(`kind`,[r({kind:f(`automation`),reason:f(`repeated_success`),href:u().trim().min(1).max(4e3),successCount:s().int().min(2)})]).optional(),actions:r({canStart:o(),canDiscuss:o(),degradedStartAvailable:o()}),generatedAt:s().int().nonnegative(),expiresAt:s().int().nonnegative()}),A=r({id:u().trim().min(1).max(200),revision:s().int().positive(),question:u().trim().min(1).max(500),options:d(r({id:u().trim().min(1).max(100),label:u().trim().min(1).max(200)})).min(2).max(3),evidenceIds:d(u().trim().min(1).max(300)).min(1).max(8)}),j=e(`state`,[r({state:f(`disabled`)}),r({state:f(`quiet`),reason:p([`no_change`,`insufficient_value`,`model_unavailable`,`generation_failed`,`budget_exhausted`])}),r({state:f(`refreshing`),previous:k.optional(),requestedAt:s().int().nonnegative()}),r({state:f(`clarification`),question:A,generatedAt:s().int().nonnegative(),expiresAt:s().int().nonnegative()}),r({state:f(`ready`),primary:k,alternatives:d(k).max(2),placement:p([`primary`,`compact`]),generatedAt:s().int().nonnegative(),expiresAt:s().int().nonnegative(),stale:o()})]);r({idempotencyKey:u().trim().min(1).max(200),locale:u().trim().max(30).optional()}),r({idempotencyKey:u().trim().min(1).max(200),expectedRevision:s().int().positive(),kind:p([`already_done`,`irrelevant`,`too_early`,`source_incorrect`,`less_like_this`,`snoozed`]),reasonCode:u().trim().min(1).max(100).optional(),note:u().trim().min(1).max(1e3).optional(),snoozedUntil:s().int().nonnegative().optional()}),r({idempotencyKey:u().trim().min(1).max(200)});var M=r({items:d(r({opportunity:k,status:p([`available`,`started`,`discussing`,`completed`,`snoozed`,`dismissed`,`expired`,`superseded`]),feedbackKind:p([`started`,`discussed`,`already_done`,`irrelevant`,`too_early`,`source_incorrect`,`less_like_this`,`snoozed`]).optional(),updatedAt:s().int().nonnegative(),snoozedUntil:s().int().nonnegative().optional(),href:u().trim().min(1).max(2e3).optional()})).max(100)});r({idempotencyKey:u().trim().min(1).max(200),expectedRevision:s().int().positive(),mode:p([`start`,`degraded_start`,`discuss`])});var N=e(`outcome`,[r({outcome:f(`task`),taskId:u(),href:u()}),r({outcome:f(`chat_draft`),href:u()}),r({outcome:f(`needs_setup`),preflight:O})]),P=m({runningConversations:d(se).default([]),needsUser:d(T),background:d(T),backgroundCount:s().int().nonnegative(),decisions:d(oe),advisor:j,attentionPolicy:m({visibleDecisionCount:s().int().nonnegative(),suppressedDecisionCount:s().int().nonnegative(),visibleAttentionCount:s().int().nonnegative(),suppressedAttentionCount:s().int().nonnegative()}).default({visibleDecisionCount:0,suppressedDecisionCount:0,visibleAttentionCount:0,suppressedAttentionCount:0})});r({window:r({since:s().int().nonnegative(),until:s().int().nonnegative()}),currentStrategyVersion:u().trim().min(1).max(100),generations:r({total:s().int().nonnegative(),succeeded:s().int().nonnegative(),quiet:s().int().nonnegative(),failed:s().int().nonnegative(),estimatedCostUsd:s().nonnegative()}),outcomes:r({opportunities:s().int().nonnegative(),started:s().int().nonnegative(),discussed:s().int().nonnegative(),completed:s().int().nonnegative(),corrected:s().int().nonnegative(),expired:s().int().nonnegative()}),rates:r({start:s().min(0).max(1),completionFromStarted:s().min(0).max(1),correction:s().min(0).max(1)}),feedback:r({alreadyDone:s().int().nonnegative(),irrelevant:s().int().nonnegative(),tooEarly:s().int().nonnegative(),sourceIncorrect:s().int().nonnegative(),lessLikeThis:s().int().nonnegative()}),strategies:d(r({version:u().trim().min(1).max(100),generations:s().int().nonnegative(),opportunities:s().int().nonnegative(),started:s().int().nonnegative(),completed:s().int().nonnegative()}))});var F=m({northStar:m({weeklyTrustedProgress:s(),weeklyActiveUsers:s(),trustedProgressPerWeeklyActiveUser:s()}),tasks:m({total:s(),achieved:s(),partial:s(),notAchieved:s(),userCorrected:s(),achievementRate:s(),correctionRate:s(),trusted:s(),trustedRate:s()})});function I(e){return P.parse(e)}var L=e(`kind`,[m({kind:f(`once`),at:u()}),m({kind:f(`interval`),everyMs:s().positive(),anchorMs:s().optional()}),m({kind:f(`cron`),expr:u(),tz:u().optional()})]),R=e(`kind`,[m({kind:f(`manual`)}),m({kind:f(`schedule`),schedule:L}),m({kind:f(`webhook`),secretId:u().optional()}),m({kind:f(`event`),eventType:u(),source:u().optional(),payloadMatch:n(u(),a([u(),s(),o(),c()])).optional()})]),z=e(`kind`,[m({kind:f(`agent`),agentId:u().optional(),instruction:u(),workingDirectory:u().optional(),model:u().optional(),timeoutSeconds:s().positive().optional()}),m({kind:f(`browser_automation`),automationId:u(),inputs:n(u(),i()).optional(),timeoutSeconds:s().positive().optional()}),m({kind:f(`task_command`),taskId:u(),command:_}),m({kind:f(`system`),capability:p([`home.advisor.refresh`,`personal.proactivity.tick`,`memory.temporal_sweep`,`memory.daily_reconciliation`,`memory.weekly_knowledge`])})]),B=p([`queued`,`running`,`cancelling`,`succeeded`,`failed`,`cancelled`,`timeout`]),V=e(`kind`,[m({key:u(),kind:f(`gateway_event`)}),m({key:u(),kind:f(`webhook`),endpoint:u().url().startsWith(`https://`),secretId:u()}),m({key:u(),kind:f(`file`),targetId:u(),pathTemplate:u()}),m({key:u(),kind:f(`card`),channelId:u(),templateId:u()})]),H=m({id:u(),name:u(),description:u().optional(),projectId:u().optional(),enabled:o(),trigger:R,action:z,safety:m({mode:p([`suggest_only`,`ask_before_apply`,`auto_apply`])}).optional(),conversationMode:p([`new_session`,`continuous`]).optional(),delivery:m({notificationPolicy:p([`attention`,`all`,`none`]),destinations:d(V)}),reliability:m({executionTimeoutSeconds:s().positive().optional(),retryCount:s().int().nonnegative().optional(),maxConcurrentRuns:s().int().positive().optional(),disableAfterConsecutiveFailures:s().int().positive().optional()}).optional(),management:m({owner:u(),editable:d(p([`enabled`,`trigger`])),runnable:o(),deletable:o()}).optional(),state:m({nextRunAtMs:s().optional(),runningRunId:u().optional(),lastRunAtMs:s().optional(),lastRunStatus:B.optional(),lastError:u().optional(),consecutiveFailures:s().int().nonnegative().optional()}),createdAtMs:s(),updatedAtMs:s()}),U=m({id:u(),automationId:u(),automationName:u(),status:B,triggerSnapshot:R,actionSnapshot:z,manual:o(),createdAtMs:s(),startedAtMs:s().optional(),endedAtMs:s().optional(),durationMs:s().optional(),summary:u().optional(),error:u().optional(),conversationId:u().optional(),model:u().optional(),deadlineAtMs:s().optional(),currentPhase:p([`queued`,`action`,`cancelling`,`completed`]).optional(),cancelRequestedAtMs:s().optional(),cancelConfirmedAtMs:s().optional(),termination:m({reason:p([`completed`,`failed`,`user_cancelled`,`deadline_exceeded`]),component:p([`automation`,`agent_turn`,`tool`,`mcp`,`process`]).optional(),componentName:u().optional(),cancellationConfirmed:o()}).optional(),heartbeatAtMs:s().optional(),leaseOwner:u().optional(),leaseExpiresAtMs:s().optional(),attemptNumber:s().int().positive().optional(),rootRunId:u().optional()}),W=m({id:u(),runId:u(),automationId:u(),type:p([`run.queued`,`run.started`,`run.deadline_resolved`,`run.cancel_requested`,`run.cancel_confirmed`,`run.cancellation_unconfirmed`,`run.recovered`,`action.started`,`action.retry_scheduled`,`action.completed`,`action.failed`,`run.completed`]),message:u(),data:i().optional(),createdAtMs:s()}),G=m({totalAutomations:s().int().nonnegative(),enabledAutomations:s().int().nonnegative(),runningRuns:s().int().nonnegative(),failedLastHour:s().int().nonnegative(),nextRun:m({automationId:u(),name:u(),runAtMs:s()}).optional(),pendingEvents:s().int().nonnegative(),oldestPendingEventAgeMs:s().int().nonnegative(),projectionDeadLetters:s().int().nonnegative(),pendingRunDeliveries:s().int().nonnegative(),runDeliveryDeadLetters:s().int().nonnegative(),pendingResultDeliveries:s().int().nonnegative(),resultDeliveryDeadLetters:s().int().nonnegative(),activeExecutions:s().int().nonnegative(),activeDeliveryLeases:s().int().nonnegative()});p([`http`,`agent`,`cli`,`automation`,`mcp`,`extension`]);var le=a([p(`overview.imports.sessions.tracing.usage.logs.computer-use.phone-use.agent-browser.extensions/debug.connector-service.appearance.keyboard-shortcuts.system.desktop-pet.desktop-app.agent-defaults.gateway.runtimes.devices.remote-access.shares.capabilities/models.capabilities/image.capabilities/voice.capabilities/search`.split(`.`)),u().regex(/^ext\/[a-z0-9_-]+(?:\/[a-z0-9_-]+)?$/i).max(512)]);p([`INVALID_INPUT`,`FORBIDDEN`,`NOT_FOUND`,`REVISION_CONFLICT`,`CONTRACT_CHANGED`,`APPROVAL_REQUIRED`,`IN_PROGRESS`,`UNAVAILABLE`,`OUTCOME_UNKNOWN`,`CANCELLED`,`INTERNAL`]);var ue=r({majorVersion:s().int().positive(),descriptorDigest:u().regex(/^[a-f0-9]{64}$/),input:l(),idempotencyKey:u().min(1).max(200).optional()}),de=m({triggerSummary:u(),actionSummary:u(),safetyNotes:d(u()),requiredConfirmations:d(u()),canRunNow:o(),runNowBlockedReason:u().optional()});r({agentId:u().trim().min(1).max(64).optional(),language:p([`en`,`zh`]).default(`en`)}),m({draftId:u(),explanation:u(),assumptions:d(u()),risks:d(u()),automation:t({name:u(),trigger:l(),action:l()}),simulation:de,repairAttempts:s().int().nonnegative()}),m({draftId:u(),patch:n(u(),l()),explanation:u(),expectedEffect:u(),risks:d(u()),requiresApproval:o(),repairAttempts:s().int().nonnegative()});var fe=r({eventId:u().min(1),kind:p([`note`,`task`,`project`,`automation`,`local_app`]),id:u().min(1),revision:s().int().nonnegative(),operation:p([`created`,`updated`,`deleted`]),operationId:u().optional()}),K=r({id:u().trim().min(1).max(512)});K.extend({expectedVersion:s().int().positive(),reason:u().trim().min(1).max(4096).default(`TaskRun cancelled`)}),K.extend({rating:p([`helpful`,`not_helpful`]),reason:u().trim().max(4096).optional()}),m({ok:f(!0),feedback:m({id:u(),runId:u(),rating:p([`helpful`,`not_helpful`]),reason:u().optional(),createdAt:s()})}),m({ok:f(!0),run:y,receipt:b,model:v.pick({task:!0,operationalState:!0,attention:!0,allowedCommands:!0}),executionStopConfirmed:f(!1)}),K.extend({enabled:o(),expectedRevision:s().int().nonnegative()}),m({ok:f(!0),automation:H.loose()}).extend({run:U.loose()}),m({ok:f(!0),cancelled:o(),confirmed:o()}),m({ok:f(!0),marked:f(!0)}),r({projectId:u().trim().min(1).max(512).optional()}),m({ok:f(!0),count:s().int().nonnegative()}),K.extend({reason:u().trim().min(1).max(2e3)}),r({runId:u().trim().min(1).max(200),destinationKey:u().trim().min(1).max(100),reason:u().trim().min(1).max(2e3)}),m({ok:f(!0),accepted:f(!0)}),K.extend({expectedRevision:s().int().nonnegative().nullable()}),m({ok:f(!0),removed:o(),automation:H.loose().optional(),cancelRunId:u().optional()});var pe=r({status:p([`inbox`,`processed`,`archived`,`trashed`]).optional(),kind:p([`thought`,`todo`,`voice`,`media`,`bookmark`,`mixed`,`task`]).optional(),tag:u().max(512).optional(),projectId:u().min(1).max(512).optional(),unassigned:o().optional(),agentEdited:o().optional(),search:u().max(4096).optional(),pinned:o().optional(),limit:s().int().min(1).max(100).default(20),offset:s().int().min(0).default(0),sortBy:p([`createdAt`,`updatedAt`,`lastOpenedAt`]).optional(),sortOrder:p([`asc`,`desc`]).optional()}),q=t({id:u().min(1),markdown:u(),kind:p([`thought`,`todo`,`voice`,`media`,`bookmark`,`mixed`,`task`]),status:p([`inbox`,`processed`,`archived`,`trashed`]),createdAt:s(),updatedAt:s(),title:u().optional(),localVersion:s().optional()}),me=m({note:q});K.extend({expectedRevision:s().int().positive(),revokeShares:o().default(!0)}),m({deleted:f(!0),revokedShares:s().int().nonnegative()});var he=r({title:u().max(1e3).optional(),markdown:u().max(2e6).default(``),kind:q.shape.kind.optional(),tags:d(u().max(512)).max(100).optional(),capturedVia:r({channel:p([`app`,`web`,`electron`,`tui`,`telegram`,`wechat`,`feishu`]),platform:p([`ios`,`android`,`harmonyos`]).optional()}).default({channel:`web`}),pinned:o().default(!1),projectId:u().min(1).optional()});r({id:u().min(1),expectedRevision:s().int().positive(),trigger:p([`edit`,`ai_edit`,`sync`,`restore`]).optional(),patch:r({title:u().max(1e3).optional(),markdown:u().max(2e6).optional(),tags:d(u().max(512)).max(100).optional(),pinned:o().optional(),kind:q.shape.kind.optional(),status:q.shape.status.optional(),localVersion:s().int().positive().optional(),ai:n(u(),l()).optional(),aiDeep:t({processedAt:s()}).optional()})}),r({text:u().trim().min(1).max(2e6),capturedVia:he.shape.capturedVia}),r({id:u().min(1),expectedRevision:s().int().positive().optional(),content:u().trim().min(1).max(2e6),heading:u().trim().min(1).max(1e3).default(`AI 讨论沉淀`)}),r({id:u().min(1),timestamp:s().int().positive(),expectedRevision:s().int().positive()});var ge=t({items:d(t({id:u().min(1)})),total:s().int().nonnegative()}),_e=r({phase:te.optional(),priority:ne.optional(),projectId:u().min(1).max(512).optional(),search:u().max(4096).optional(),limit:s().int().min(1).max(200).default(50),offset:s().int().nonnegative().default(0)}),J=t({id:u().min(1),name:u(),slug:u(),status:p([`planned`,`active`,`paused`,`completed`,`cancelled`,`archived`]),executionMode:p([`local_checkout`,`managed_worktree`]),successCriteria:d(u()),scope:n(u(),i()),nonGoals:d(u()),health:p([`unknown`,`on_track`,`at_risk`,`off_track`]),version:s().int().positive(),createdAt:s(),updatedAt:s(),workspaceRoot:u().optional(),defaultAgentId:u().optional()}),Y=r({id:u().trim().min(1),expectedVersion:s().int().positive(),pinned:o()});m({ok:f(!0),project:J}),r({workspacePath:u().trim().min(1).max(4096),agentId:u().trim().min(1).max(512).optional(),defaultAgentId:u().trim().max(512).optional(),projectKind:p([`auto`,`coding`,`general`,`unknown`]).optional(),autoCreate:o().default(!1),conversationId:h().optional()}),m({ok:f(!0),project:J.nullable(),reason:p([`exact`,`contained`,`auto_created`]).optional(),created:o().optional()}),Y.omit({pinned:!0}),m({ok:f(!0),deleted:f(!0),executionStopConfirmed:f(!1)});var X={name:u().trim().min(1).max(1e3).optional(),description:u().max(2e4).optional(),defaultAgentId:u().trim().max(512).optional(),workspaceRoot:u().trim().min(1).max(4096).optional(),createWorkspaceRoot:o().optional(),executionMode:J.shape.executionMode.optional(),brief:u().max(2e4).optional(),instructions:u().max(1e5).optional(),outcome:u().max(2e4).optional(),successCriteria:d(u().max(4096)).max(100).optional(),scope:n(u(),l()).optional(),nonGoals:d(u().max(4096)).max(100).optional(),health:J.shape.health.optional(),ownerId:u().max(512).optional(),targetAt:s().finite().optional()};r({...X,projectKind:p([`auto`,`coding`,`general`,`unknown`]).optional(),autoUnderstand:o().default(!1)}).refine(e=>!!(e.name||e.workspaceRoot),`name or workspaceRoot is required`),r({id:u().trim().min(1),expectedVersion:s().int().positive(),patch:r({...X,status:J.shape.status.optional(),description:X.description.unwrap().nullable().optional(),defaultAgentId:X.defaultAgentId.unwrap().nullable().optional(),workspaceRoot:u().trim().max(4096).nullable().optional(),brief:X.brief.unwrap().nullable().optional(),instructions:X.instructions.unwrap().nullable().optional(),outcome:X.outcome.unwrap().nullable().optional(),ownerId:X.ownerId.unwrap().nullable().optional(),targetAt:X.targetAt.unwrap().nullable().optional()}).refine(e=>Object.values(e).some(e=>e!==void 0),`Empty project patch`)});var ve=r({status:J.shape.status.optional(),search:u().max(4096).optional(),sortBy:p([`updatedAt`,`createdAt`,`name`]).optional(),sortOrder:p([`asc`,`desc`]).optional(),limit:s().int().min(1).max(500).default(50),offset:s().int().nonnegative().default(0)}),Z=t({id:u(),projectId:u(),title:u(),status:p([`planned`,`active`,`completed`,`cancelled`]),sortOrder:s(),createdAt:s(),updatedAt:s()}),Q=t({id:u(),projectId:u(),summary:u(),health:J.shape.health,createdAt:s()}),$={title:u().trim().min(1).max(1e3),description:u().max(2e4).optional(),status:Z.shape.status.optional(),targetAt:s().int().nonnegative().optional(),sortOrder:s().int().optional()};r({projectId:u().trim().min(1),...$}),r({projectId:u().trim().min(1),id:u().trim().min(1),expectedRevision:s().int().nonnegative(),patch:r({...$,description:u().max(2e4).nullable().optional(),targetAt:s().int().nonnegative().nullable().optional()}).partial().refine(e=>Object.values(e).some(e=>e!==void 0),`Empty milestone patch`)}).omit({patch:!0}),m({ok:f(!0),milestone:Z,project:J}),m({ok:f(!0),deleted:f(!0)}),r({projectId:u().trim().min(1),expectedVersion:s().int().positive(),health:J.shape.health,summary:u().trim().min(1).max(2e4),progress:d(u().max(1e4)).max(100).default([]),risks:d(u().max(1e4)).max(100).default([]),nextSteps:d(u().max(1e4)).max(100).default([])}),m({ok:f(!0),update:Q,project:J});var ye={"xopc.context.resolve":{input:ae,output:ie},"xopc.notes.preview_edit":{input:K.extend({instruction:u().trim().min(1).max(16e3),markdown:u().max(2e6).optional(),context:t({type:p([`selection`,`section`,`block`,`note`]),range:r({start:s().int().nonnegative(),end:s().int().nonnegative()})}).optional()}),output:m({message:u(),patch:m({id:u(),summary:u(),operations:d(m({type:f(`replaceRange`),from:s().int().nonnegative(),to:s().int().nonnegative(),markdown:u()}))})})},"xopc.automations.get_run":{input:K,output:m({ok:f(!0),run:U.loose()})},"xopc.automations.run_events":{input:K,output:m({ok:f(!0),events:d(W.loose())})},"xopc.automations.metrics":{input:r({}),output:m({ok:f(!0),metrics:G})},"xopc.automations.events":{input:r({type:u().trim().min(1).max(512).optional(),source:u().trim().min(1).max(512).optional(),limit:s().int().min(1).max(200).default(50)}),output:m({ok:f(!0),items:d(m({event:m({id:u(),type:u(),schemaVersion:s().int(),source:u(),subject:m({kind:u(),id:u()}).optional(),payload:n(u(),i()),occurredAtMs:s(),ingestedAtMs:s(),correlationId:u(),causationId:u().optional(),rootEventId:u(),chainDepth:s().int(),dedupeKey:u().optional(),trust:p([`system`,`user`,`connector`,`untrusted_webhook`])}),projectionStatus:p([`pending`,`projecting`,`retrying`,`projected`,`dead_letter`]),projectionAttempts:s().int(),projectionError:u().optional(),deliveries:d(m({automationId:u(),status:p([`pending`,`retrying`,`queued`,`completed`,`failed`,`cancelled`,`skipped`,`dead_letter`]),runId:u().optional(),attempts:s().int(),lastError:u().optional()}))}))})},"xopc.automations.deliveries":{input:r({runId:u().trim().min(1).max(200).optional(),status:p([`pending`,`delivering`,`retrying`,`delivered`,`dead_letter`]).optional(),limit:s().int().min(1).max(200).default(50)}),output:m({ok:f(!0),items:d(m({runId:u(),destinationKey:u(),kind:u(),status:p([`pending`,`delivering`,`retrying`,`delivered`,`dead_letter`]),attempts:s().int(),nextAttemptAtMs:s(),lastError:u().optional(),createdAtMs:s(),updatedAtMs:s()}))})},"xopc.automations.product_events":{input:r({eventType:u().trim().min(1).max(512),source:u().trim().min(1).max(512).optional(),payloadKey:u().trim().min(1).max(512).optional(),payloadValue:u().max(4096).optional(),limit:s().int().min(1).max(100).default(10)}).refine(e=>e.payloadKey===void 0==(e.payloadValue===void 0),`payloadKey and payloadValue must be supplied together`),output:m({ok:f(!0),items:d(m({run:U.loose(),triggerEvent:W.loose()}))})},"xopc.automations.list":{input:r({projectId:u().trim().min(1).optional()}),output:m({ok:f(!0),items:d(H.loose()),projectId:u().optional()})},"xopc.automations.get":{input:K,output:m({ok:f(!0),automation:H.loose()})},"xopc.automations.history":{input:r({automationId:u().trim().min(1).optional(),projectId:u().trim().min(1).optional(),limit:s().int().min(1).max(200).default(50)}),output:m({ok:f(!0),items:d(U.loose()),projectId:u().optional()})},"xopc.settings.open":{input:r({section:u().trim().pipe(le).default(`overview`),title:u().trim().min(1).max(512).default(`Settings`),summary:u().trim().max(4096).optional()}),output:m({ok:f(!0),settings:m({section:u(),title:u(),summary:u().optional()})})},"xopc.local_apps.list":{input:r({}),output:m({apps:d(C)})},"xopc.local_apps.get":{input:K,output:m({app:re})},"xopc.local_apps.validate":{input:K,output:m({validation:S})},"xopc.projects.get":{input:K,output:m({ok:f(!0),project:J})},"xopc.projects.list":{input:ve,output:t({ok:f(!0),items:d(J),total:s().int().nonnegative()})},"xopc.projects.list_milestones":{input:K,output:m({ok:f(!0),projectId:u(),items:d(Z)})},"xopc.projects.list_updates":{input:K.extend({limit:s().int().min(1).max(500).default(20)}),output:m({ok:f(!0),projectId:u(),items:d(Q)})},"xopc.task_runs.get":{input:K,output:m({ok:f(!0),run:y,receipt:b.optional(),events:d(ee),activeWaits:d(x)})},"xopc.task_runs.list":{input:r({taskId:u().trim().min(1),limit:s().int().min(1).max(200).default(20)}),output:m({ok:f(!0),taskId:u(),items:d(y),receipts:d(b),activeWaits:d(x)})},"xopc.notes.project_summaries":{input:r({}),output:m({items:d(m({id:u(),name:u(),description:u().optional(),noteCount:s().int().nonnegative(),updatedAt:s().optional()}))})},"xopc.notes.history":{input:K,output:m({entries:d(m({timestamp:s().int().nonnegative(),trigger:p([`edit`,`ai_edit`,`sync`,`restore`]),snippet:u().optional()}))})},"xopc.notes.snapshot":{input:K.extend({timestamp:s().int().nonnegative()}),output:m({snapshot:m({noteId:u(),timestamp:s().int().nonnegative(),trigger:p([`edit`,`ai_edit`,`sync`,`restore`]),title:u().optional(),markdown:u(),tags:d(u()).optional(),kind:q.shape.kind,status:q.shape.status})})},"xopc.notes.get":{input:K,output:me},"xopc.notes.list":{input:pe,output:ge},"xopc.tasks.metrics":{input:r({}),output:m({ok:f(!0),metrics:F})},"xopc.tasks.get":{input:K,output:v},"xopc.tasks.list":{input:_e,output:g.extend({total:s().int().nonnegative()})}};export{M as a,N as i,ye as n,I as o,fe as r,ue as t};