@xopcai/xopc 0.0.320 → 0.0.323

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 (323) hide show
  1. package/dist/browser-ext/dist/assets/{auth-DKo-NMUY.js → auth-DocRzRlS.js} +95 -21
  2. package/dist/browser-ext/dist/background.js +1 -1
  3. package/dist/browser-ext/dist/sidepanel.html +1 -1
  4. package/dist/browser-ext/dist/sidepanel.js +18 -2
  5. package/dist/browser-ext/manifest.json +1 -1
  6. package/dist/extensions/telegram/xopc.extension.json +1 -1
  7. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BXLU0HJa.js → agent-avatar-dicebear-DFzmThVi.js} +1 -1
  8. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CAFHadiy.js +1 -0
  9. package/dist/gateway/static/root/assets/agent-plugin-dialog-DYFYiuig.js +1 -0
  10. package/dist/gateway/static/root/assets/{agents-hrbGiOHn.js → agents-BqIlB5Co.js} +1 -1
  11. package/dist/gateway/static/root/assets/{app-link-nL8iPwEr.js → app-link-C6gA5Nck.js} +1 -1
  12. package/dist/gateway/static/root/assets/{app-management-settings-panel-C0jEvonH.js → app-management-settings-panel-BgvMRGWe.js} +1 -1
  13. package/dist/gateway/static/root/assets/{appearance-settings-ByVRv2Oe.js → appearance-settings-CliHU03A.js} +1 -1
  14. package/dist/gateway/static/root/assets/apps-page-Drt3Foi9.js +1 -0
  15. package/dist/gateway/static/root/assets/{archive-plugin-CMITc1PQ.js → archive-plugin-DnuPpm0u.js} +1 -1
  16. package/dist/gateway/static/root/assets/{attachment-load-B5Z1PKHm.js → attachment-load-BiwaK0ie.js} +1 -1
  17. package/dist/gateway/static/root/assets/{automations-page-BOcXqVar.js → automations-page-CJSISGQH.js} +1 -1
  18. package/dist/gateway/static/root/assets/automations-workspace-B-Eduqwz.js +7 -0
  19. package/dist/gateway/static/root/assets/{binary-plugins-BkRb9adx.js → binary-plugins-KDjduQZO.js} +1 -1
  20. package/dist/gateway/static/root/assets/{block-editor-DsmDlkC2.js → block-editor-bclvgove.js} +3 -3
  21. package/dist/gateway/static/root/assets/{browser-automation-inputs-BgBH3eFk.js → browser-automation-inputs-CfQ2T9t6.js} +1 -1
  22. package/dist/gateway/static/root/assets/{browser-automations-page-e3KpurLo.js → browser-automations-page-Cxq38Nnp.js} +2 -2
  23. package/dist/gateway/static/root/assets/browser-settings-page-Dwgir6mu.js +3 -0
  24. package/dist/gateway/static/root/assets/capabilities-settings-panel-H5L5vynP.js +8 -0
  25. package/dist/gateway/static/root/assets/capabilities-uFKh3Hd0.js +1 -0
  26. package/dist/gateway/static/root/assets/channels-settings-RFBRYe5S.js +1 -0
  27. package/dist/gateway/static/root/assets/{chat-terminal-dock-DUdkU1C5.js → chat-terminal-dock-DKQC62nQ.js} +2 -2
  28. package/dist/gateway/static/root/assets/{computer-settings-page-C6WR9Syy.js → computer-settings-page-D1whpIqL.js} +1 -1
  29. package/dist/gateway/static/root/assets/{connector-service-page-SVKcySx0.js → connector-service-page-BAuYTgf5.js} +1 -1
  30. package/dist/gateway/static/root/assets/connectors-page-Px-v3Q6Q.js +2 -0
  31. package/dist/gateway/static/root/assets/{date-picker-DBD5yedi.js → date-picker-CfCo3lqh.js} +1 -1
  32. package/dist/gateway/static/root/assets/{dependency-picker-HE41Co5W.js → dependency-picker-DOuVO2M1.js} +1 -1
  33. package/dist/gateway/static/root/assets/{desktop-pet-DH9EU9O3.js → desktop-pet-D9tu6Bhu.js} +1 -1
  34. package/dist/gateway/static/root/assets/{desktop-pet-settings-Br6Z1Vau.js → desktop-pet-settings-CQPXub2f.js} +1 -1
  35. package/dist/gateway/static/root/assets/device-pairing-wizard-DxkOYSut.js +1 -0
  36. package/dist/gateway/static/root/assets/{extension-debug-page-CFjVNb1m.js → extension-debug-page-CtWClPz-.js} +1 -1
  37. package/dist/gateway/static/root/assets/{extension-page-BQ3ldBhh.js → extension-page-BHh9HLCz.js} +1 -1
  38. package/dist/gateway/static/root/assets/{extension-settings-page-CaXnWbRI.js → extension-settings-page-BdT3v5Uh.js} +1 -1
  39. package/dist/gateway/static/root/assets/{gateway-config-swr-DgFmBSH9.js → gateway-config-swr-1eqyz9vZ.js} +1 -1
  40. package/dist/gateway/static/root/assets/gateway-settings-CZas_Ekx.js +1 -0
  41. package/dist/gateway/static/root/assets/{gateway-startup-retry-C7h3xef0.js → gateway-startup-retry-C4rsW6vJ.js} +1 -1
  42. package/dist/gateway/static/root/assets/home-page-w3_aWeNt.js +1 -0
  43. package/dist/gateway/static/root/assets/{image-generation-api-DJ1xaz2p.js → image-generation-api-B5DXMylk.js} +1 -1
  44. package/dist/gateway/static/root/assets/{imports-page-CaB54QIp.js → imports-page-B1JH0G5j.js} +1 -1
  45. package/dist/gateway/static/root/assets/index--3c0awkr.js +121 -0
  46. package/dist/gateway/static/root/assets/index-CNc4N4TX.css +1 -0
  47. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DnvHvKQJ.js → keyboard-shortcuts-settings-DGrLJ8Yh.js} +1 -1
  48. package/dist/gateway/static/root/assets/local-app-workbench-page-BYKrJpFF.js +1 -0
  49. package/dist/gateway/static/root/assets/local-apps-Bpja8nC6.js +1 -0
  50. package/dist/gateway/static/root/assets/local-apps-page-DqjStqbL.js +1 -0
  51. package/dist/gateway/static/root/assets/{locale-store-C4RjTd0C.js → locale-store-BIkcRr3t.js} +1 -1
  52. package/dist/gateway/static/root/assets/{logs-page-N0q5DxnI.js → logs-page-Dl4kM4Na.js} +2 -2
  53. package/dist/gateway/static/root/assets/management-settings-gCfH4cwH.js +1 -0
  54. package/dist/gateway/static/root/assets/{markdown-view-DkPzc50Z.js → markdown-view-Ck_5MADq.js} +1 -1
  55. package/dist/gateway/static/root/assets/{media-plugins-BzLYE9lj.js → media-plugins-DTsZqgo6.js} +1 -1
  56. package/dist/gateway/static/root/assets/messages-7VAhscYe.js +3 -0
  57. package/dist/gateway/static/root/assets/note-detail-panel-j6sioeL1.js +5 -0
  58. package/dist/gateway/static/root/assets/notes-page-CMvvHv0f.js +8 -0
  59. package/dist/gateway/static/root/assets/{page-context-capture-button-DVnGa7Lu.js → page-context-capture-button-DTI_g4tz.js} +1 -1
  60. package/dist/gateway/static/root/assets/{page-tabs-q6lpN9OD.js → page-tabs-CfW_Q-K5.js} +1 -1
  61. package/dist/gateway/static/root/assets/{preview-open-alternatives-Ck63fJaQ.js → preview-open-alternatives-CuPN-vAn.js} +1 -1
  62. package/dist/gateway/static/root/assets/product-delivery-bv3z8Xkh.js +1 -0
  63. package/dist/gateway/static/root/assets/product-open-page-BHjxRz1E.js +1 -0
  64. package/dist/gateway/static/root/assets/project-detail-page-C9K_e-EV.js +1 -0
  65. package/dist/gateway/static/root/assets/projects-page-Bk-es4i9.js +1 -0
  66. package/dist/gateway/static/root/assets/{registry-api-CRnytFLF.js → registry-api-BAAZUGnU.js} +1 -1
  67. package/dist/gateway/static/root/assets/remote-access-hub-CLGJNA42.js +1 -0
  68. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Bu3XyrDI.js → runtime-tools-settings-panel-CHJBJKL1.js} +2 -2
  69. package/dist/gateway/static/root/assets/{scenes-page-B_5HOUzl.js → scenes-page-ClLAD1pz.js} +2 -2
  70. package/dist/gateway/static/root/assets/{schema-form-CbOOKW1B.js → schema-form-FQAit5HL.js} +1 -1
  71. package/dist/gateway/static/root/assets/sessions-page-Xj8MkXN1.js +1 -0
  72. package/dist/gateway/static/root/assets/settings-advanced-gate-DwALV8mi.js +1 -0
  73. package/dist/gateway/static/root/assets/{settings-form-section-D3UN4rb4.js → settings-form-section-BDc6bw1q.js} +1 -1
  74. package/dist/gateway/static/root/assets/{settings-page-BHztZayW.js → settings-page-DnhxBJjV.js} +1 -1
  75. package/dist/gateway/static/root/assets/{settings-page-layout-nskqtzZs.js → settings-page-layout-D3KNSQ5g.js} +1 -1
  76. package/dist/gateway/static/root/assets/{setup-status-panel-BtukdJ-z.js → setup-status-panel-F0rCQ-2a.js} +1 -1
  77. package/dist/gateway/static/root/assets/{share-preview-page-DbYXEqur.js → share-preview-page-DVQCRxwK.js} +1 -1
  78. package/dist/gateway/static/root/assets/shares-settings-C7hf6Cov.js +1 -0
  79. package/dist/gateway/static/root/assets/skill-reload-api-xPrFejRE.js +1 -0
  80. package/dist/gateway/static/root/assets/{skills-page-CK9Jeaur.js → skills-page-RdDYu7Yj.js} +1 -1
  81. package/dist/gateway/static/root/assets/{skills-page.utils-B44aWbyL.js → skills-page.utils-mDwC9UJ-.js} +1 -1
  82. package/dist/gateway/static/root/assets/{system-settings-panel-BwqpUGv_.js → system-settings-panel-Bk7GrMij.js} +1 -1
  83. package/dist/gateway/static/root/assets/task-detail-page-2A966jFY.js +1 -0
  84. package/dist/gateway/static/root/assets/{tunnel-api-BKTZzQIT.js → tunnel-api-D3Aquraj.js} +1 -1
  85. package/dist/gateway/static/root/assets/{use-autosave-BB1JBOCz.js → use-autosave-C1xQ-sHn.js} +1 -1
  86. package/dist/gateway/static/root/assets/user-model-page-CnBxPBVe.js +2 -0
  87. package/dist/gateway/static/root/assets/{voice-api-key-field-C-HsgED9.js → voice-api-key-field-DCNECvcp.js} +1 -1
  88. package/dist/gateway/static/root/assets/{voice-config-api-DvJKYYA0.js → voice-config-api-B-_niUTU.js} +1 -1
  89. package/dist/gateway/static/root/assets/{work-discovery-overlay-K3e5ONUo.js → work-discovery-overlay-BrGx_JS_.js} +1 -1
  90. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-dXRTHBoE.js → workflow-run-setup-panel-CmmC2Pdr.js} +2 -2
  91. package/dist/gateway/static/root/assets/workflows-page-BZVpqw4T.js +6 -0
  92. package/dist/gateway/static/root/index.html +12 -11
  93. package/dist/package.js +1 -1
  94. package/dist/packages/gateway-contract/src/capabilities.js +4 -110
  95. package/dist/packages/gateway-contract/src/chat-previews.js +73 -0
  96. package/dist/packages/gateway-contract/src/index.js +6 -0
  97. package/dist/packages/gateway-contract/src/local-apps.js +215 -0
  98. package/dist/packages/gateway-contract/src/product-delivery.js +62 -17
  99. package/dist/packages/gateway-contract/src/user-turn-document.js +60 -0
  100. package/dist/src/agent/agent-manager.d.ts +1 -0
  101. package/dist/src/agent/agent-manager.js +5 -4
  102. package/dist/src/agent/background-review/run-background-review.js +1 -1
  103. package/dist/src/agent/embedded/model-runtime.js +1 -1
  104. package/dist/src/agent/embedded/run-for-session.js +1 -1
  105. package/dist/src/agent/embedded/transcript-runtime.d.ts +3 -0
  106. package/dist/src/agent/embedded/transcript-runtime.js +6 -0
  107. package/dist/src/agent/external-tools/cliProvider.js +4 -1
  108. package/dist/src/agent/external-tools/composio-provider.js +9 -3
  109. package/dist/src/agent/external-tools/gateway-tools.js +17 -10
  110. package/dist/src/agent/external-tools/mcp-provider.d.ts +3 -1
  111. package/dist/src/agent/external-tools/mcp-provider.js +91 -6
  112. package/dist/src/agent/external-tools/service.d.ts +2 -1
  113. package/dist/src/agent/external-tools/service.js +8 -3
  114. package/dist/src/agent/external-tools/types.d.ts +9 -0
  115. package/dist/src/agent/image/tool-model-config.js +1 -1
  116. package/dist/src/agent/mcp/bundle-mcp-config.js +37 -5
  117. package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +1 -0
  118. package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -0
  119. package/dist/src/agent/mcp/bundle-mcp-names.js +2 -1
  120. package/dist/src/agent/mcp/bundle-mcp-runtime.js +33 -1
  121. package/dist/src/agent/mcp/bundle-mcp-types.d.ts +4 -0
  122. package/dist/src/agent/mcp/index.js +1 -1
  123. package/dist/src/agent/mcp/mcp-stdio-transport.d.ts +1 -0
  124. package/dist/src/agent/mcp/mcp-stdio-transport.js +10 -0
  125. package/dist/src/agent/mcp/mcp-transport.js +12 -8
  126. package/dist/src/agent/mcp/oauth/index.js +1 -1
  127. package/dist/src/agent/mcp/oauth/mcp-oauth-manager.d.ts +6 -1
  128. package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +70 -14
  129. package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +1 -1
  130. package/dist/src/agent/mcp/oauth/mcp-oauth-session.d.ts +2 -0
  131. package/dist/src/agent/mcp/oauth/mcp-oauth-session.js +12 -0
  132. package/dist/src/agent/mcp/oauth/mcp-oauth-store.d.ts +3 -0
  133. package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +14 -2
  134. package/dist/src/agent/mcp/plugin-http-fetch.d.ts +2 -0
  135. package/dist/src/agent/mcp/plugin-http-fetch.js +56 -0
  136. package/dist/src/agent/service/process-direct-streaming.js +27 -12
  137. package/dist/src/agent/service.js +3 -2
  138. package/dist/src/agent/service.types.d.ts +2 -0
  139. package/dist/src/agent/session/session-inspector.js +1 -1
  140. package/dist/src/agent/skills/hub-lock.js +1 -1
  141. package/dist/src/agent/skills/hub-pull.js +1 -1
  142. package/dist/src/agent/skills/index.js +8 -1
  143. package/dist/src/agent/skills/skill-manager.d.ts +2 -0
  144. package/dist/src/agent/skills/skill-manager.js +8 -0
  145. package/dist/src/agent/skills/skill-sources.js +17 -0
  146. package/dist/src/agent/skills/types.d.ts +3 -1
  147. package/dist/src/agent/source-context/injector.js +10 -5
  148. package/dist/src/agent/source-context/types.d.ts +3 -0
  149. package/dist/src/agent/source-context/types.js +8 -2
  150. package/dist/src/agent/tasks/task-judge-service.js +3 -3
  151. package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
  152. package/dist/src/agent/tool-manuals/xopc-use.js +12 -2
  153. package/dist/src/agent/tools/automation-tool.js +1 -1
  154. package/dist/src/agent/tools/factory.d.ts +1 -0
  155. package/dist/src/agent/tools/factory.js +2 -1
  156. package/dist/src/agent/tools/search/registry.js +4 -1
  157. package/dist/src/agent/tools/workflow-tool.js +1 -1
  158. package/dist/src/agent/tools/write.js +1 -1
  159. package/dist/src/agent/tools/xopc-use-tool.d.ts +4 -2
  160. package/dist/src/agent/tools/xopc-use-tool.js +120 -12
  161. package/dist/src/ai-assist/text-assist.js +1 -1
  162. package/dist/src/auth/credentials.js +2 -2
  163. package/dist/src/auth/oauth/xopc-cloud.js +1 -1
  164. package/dist/src/auth/profiles/store.js +1 -1
  165. package/dist/src/auth/sync-provider-auth.js +2 -2
  166. package/dist/src/browser/providers/browser-ext-install.js +1 -1
  167. package/dist/src/chat-commands/agent-edit.js +1 -1
  168. package/dist/src/chat-previews/index.d.ts +2 -0
  169. package/dist/src/chat-previews/index.js +3 -0
  170. package/dist/src/chat-previews/service.d.ts +27 -0
  171. package/dist/src/chat-previews/service.js +106 -0
  172. package/dist/src/chat-previews/store.d.ts +28 -0
  173. package/dist/src/chat-previews/store.js +77 -0
  174. package/dist/src/cli/commands/agent.js +1 -1
  175. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  176. package/dist/src/cli/commands/doctor/checks/provider-auth.js +3 -3
  177. package/dist/src/cli/commands/extension-agent-plugin.d.ts +8 -0
  178. package/dist/src/cli/commands/extension-agent-plugin.js +82 -0
  179. package/dist/src/cli/commands/extension-marketplace.js +44 -4
  180. package/dist/src/cli/commands/extension.js +35 -3
  181. package/dist/src/cli/commands/models.js +1 -1
  182. package/dist/src/computer/runtime.js +1 -1
  183. package/dist/src/config/index.js +4 -4
  184. package/dist/src/config/loader.js +2 -2
  185. package/dist/src/config/models-json.js +2 -2
  186. package/dist/src/config/schema.js +2 -2
  187. package/dist/src/connectors/account-selection.js +1 -1
  188. package/dist/src/connectors/connection-candidates.d.ts +4 -1
  189. package/dist/src/connectors/connection-candidates.js +8 -2
  190. package/dist/src/connectors/connection-capabilities.d.ts +2 -2
  191. package/dist/src/connectors/connection-capabilities.js +3 -1
  192. package/dist/src/connectors/connection-recovery-service.d.ts +6 -1
  193. package/dist/src/connectors/connection-recovery-service.js +138 -26
  194. package/dist/src/connectors/plugin-mcp-recovery.d.ts +28 -0
  195. package/dist/src/connectors/plugin-mcp-recovery.js +90 -0
  196. package/dist/src/extensions/agent-plugins/auth.d.ts +39 -0
  197. package/dist/src/extensions/agent-plugins/auth.js +156 -0
  198. package/dist/src/extensions/agent-plugins/connection.d.ts +8 -0
  199. package/dist/src/extensions/agent-plugins/connection.js +41 -0
  200. package/dist/src/extensions/agent-plugins/health.d.ts +4 -0
  201. package/dist/src/extensions/agent-plugins/health.js +48 -0
  202. package/dist/src/extensions/agent-plugins/inventory.d.ts +53 -0
  203. package/dist/src/extensions/agent-plugins/inventory.js +34 -0
  204. package/dist/src/extensions/agent-plugins/mcp-adapter.d.ts +3 -0
  205. package/dist/src/extensions/agent-plugins/mcp-adapter.js +47 -0
  206. package/dist/src/extensions/agent-plugins/sources.d.ts +5 -0
  207. package/dist/src/extensions/agent-plugins/sources.js +72 -0
  208. package/dist/src/extensions/agent-plugins/store.d.ts +61 -0
  209. package/dist/src/extensions/agent-plugins/store.js +305 -0
  210. package/dist/src/extensions/agent-plugins/validation.d.ts +59 -0
  211. package/dist/src/extensions/agent-plugins/validation.js +211 -0
  212. package/dist/src/extensions/lockfile.js +1 -1
  213. package/dist/src/extensions/update.js +1 -1
  214. package/dist/src/gateway/agents-admin.js +1 -1
  215. package/dist/src/gateway/chat-stream/mapper.js +10 -3
  216. package/dist/src/gateway/file-path-classifier.js +1 -1
  217. package/dist/src/gateway/hono/lib/config-payload.js +1 -1
  218. package/dist/src/gateway/hono/routes/agent-plugins.d.ts +3 -0
  219. package/dist/src/gateway/hono/routes/agent-plugins.js +166 -0
  220. package/dist/src/gateway/hono/routes/agent-stream.js +14 -0
  221. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +4 -2
  222. package/dist/src/gateway/hono/routes/chat-previews.d.ts +3 -0
  223. package/dist/src/gateway/hono/routes/chat-previews.js +41 -0
  224. package/dist/src/gateway/hono/routes/connection-waits.js +4 -2
  225. package/dist/src/gateway/hono/routes/index.js +2 -0
  226. package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
  227. package/dist/src/gateway/hono/routes/local-apps.js +71 -39
  228. package/dist/src/gateway/hono/routes/mcp.js +48 -21
  229. package/dist/src/gateway/hono/routes/models.js +1 -1
  230. package/dist/src/gateway/hono/routes/session-input-handler.d.ts +4 -0
  231. package/dist/src/gateway/hono/routes/session-input-handler.js +22 -0
  232. package/dist/src/gateway/hono/routes/side-chats.js +11 -0
  233. package/dist/src/gateway/service/agent-runner.js +7 -1
  234. package/dist/src/gateway/service/config-coordinator.js +1 -1
  235. package/dist/src/gateway/service/marketplace-service.d.ts +1 -0
  236. package/dist/src/gateway/service/marketplace-service.js +15 -1
  237. package/dist/src/gateway/service/session-input-coordinator.js +3 -3
  238. package/dist/src/gateway/service.d.ts +5 -1
  239. package/dist/src/gateway/service.js +19 -5
  240. package/dist/src/gateway/side-chat/index.d.ts +3 -1
  241. package/dist/src/gateway/side-chat/index.js +2 -1
  242. package/dist/src/gateway/side-chat/manager.d.ts +16 -0
  243. package/dist/src/gateway/side-chat/manager.js +40 -6
  244. package/dist/src/gateway/side-chat/promotion-service.d.ts +19 -0
  245. package/dist/src/gateway/side-chat/promotion-service.js +111 -0
  246. package/dist/src/gateway/side-chat/run-service.js +1 -0
  247. package/dist/src/gateway/side-chat/types.d.ts +1 -1
  248. package/dist/src/local-apps/artifact-files.d.ts +3 -0
  249. package/dist/src/local-apps/artifact-files.js +45 -0
  250. package/dist/src/local-apps/capabilities/write.js +1 -1
  251. package/dist/src/local-apps/fix-guidance.d.ts +3 -0
  252. package/dist/src/local-apps/fix-guidance.js +75 -0
  253. package/dist/src/local-apps/index.d.ts +2 -1
  254. package/dist/src/local-apps/scaffold.d.ts +5 -0
  255. package/dist/src/local-apps/scaffold.js +18 -5
  256. package/dist/src/local-apps/service.d.ts +18 -3
  257. package/dist/src/local-apps/service.js +106 -64
  258. package/dist/src/local-apps/snapshot-store.d.ts +8 -0
  259. package/dist/src/local-apps/snapshot-store.js +68 -0
  260. package/dist/src/local-apps/types.d.ts +4 -87
  261. package/dist/src/notes/service.js +1 -1
  262. package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
  263. package/dist/src/providers/index.js +2 -2
  264. package/dist/src/providers/model-catalog-persistence.js +1 -1
  265. package/dist/src/providers/model-registry.js +1 -1
  266. package/dist/src/providers/register-runtime-providers.js +1 -1
  267. package/dist/src/session/client-history.d.ts +3 -1
  268. package/dist/src/session/client-history.js +10 -3
  269. package/dist/src/session/index.d.ts +1 -1
  270. package/dist/src/session/manager.d.ts +4 -0
  271. package/dist/src/session/manager.js +6 -0
  272. package/dist/src/session/session-context-for-llm.d.ts +12 -1
  273. package/dist/src/session/session-context-for-llm.js +16 -2
  274. package/dist/src/session/store.d.ts +14 -0
  275. package/dist/src/session/store.js +17 -0
  276. package/dist/src/session/stored-rows-to-file-entries.js +10 -1
  277. package/dist/src/session/transcript-outline.js +10 -3
  278. package/dist/src/storage/sqlite/connection-wait-repository.js +9 -3
  279. package/dist/src/storage/sqlite/migrations/202_chat_previews.sql +26 -0
  280. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  281. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  282. package/dist/src/storage/sqlite/row-mappers.js +6 -1
  283. package/dist/src/storage/sqlite/schema.js +1 -1
  284. package/dist/src/tui/backends/embedded-backend.js +1 -1
  285. package/dist/src/tui/tui-commands.js +1 -1
  286. package/dist/src/tui/tui-startup-resources.js +1 -1
  287. package/dist/src/tui/tui.js +2 -2
  288. package/dist/src/voice/tts/audio.js +1 -1
  289. package/dist/src/work-discovery/service.js +2 -2
  290. package/dist/src/workflows/service/workflow-run-service.js +1 -1
  291. package/package.json +4 -4
  292. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BGCqlTcR.js +0 -1
  293. package/dist/gateway/static/root/assets/api-DEneywgz.js +0 -1
  294. package/dist/gateway/static/root/assets/apps-page-vC87gAyb.js +0 -1
  295. package/dist/gateway/static/root/assets/automations-workspace-CzYmREol.js +0 -7
  296. package/dist/gateway/static/root/assets/browser-settings-page-BxaSzUIU.js +0 -3
  297. package/dist/gateway/static/root/assets/capabilities-D0S3DuAD.js +0 -1
  298. package/dist/gateway/static/root/assets/capabilities-settings-panel-CFCu-8da.js +0 -8
  299. package/dist/gateway/static/root/assets/channels-settings-CENp82yt.js +0 -1
  300. package/dist/gateway/static/root/assets/connectors-page-g_KTZWCb.js +0 -2
  301. package/dist/gateway/static/root/assets/device-pairing-wizard-DO7jp0ep.js +0 -1
  302. package/dist/gateway/static/root/assets/gateway-settings-BkeSEBxk.js +0 -1
  303. package/dist/gateway/static/root/assets/home-page-KoQXV4hp.js +0 -1
  304. package/dist/gateway/static/root/assets/index-ZxnWUdPv.css +0 -1
  305. package/dist/gateway/static/root/assets/index-u4709aCa.js +0 -89
  306. package/dist/gateway/static/root/assets/local-app-workbench-page-7QX0YFa7.js +0 -2
  307. package/dist/gateway/static/root/assets/local-apps-page-RSAl-NhO.js +0 -1
  308. package/dist/gateway/static/root/assets/management-settings-C_cb0Kue.js +0 -1
  309. package/dist/gateway/static/root/assets/messages-M5xl1fHE.js +0 -3
  310. package/dist/gateway/static/root/assets/note-detail-panel-CVWst-Er.js +0 -5
  311. package/dist/gateway/static/root/assets/notes-page-BFwCgIls.js +0 -8
  312. package/dist/gateway/static/root/assets/product-delivery-chCjIpvu.js +0 -1
  313. package/dist/gateway/static/root/assets/product-open-page-BIGvTs9n.js +0 -1
  314. package/dist/gateway/static/root/assets/project-detail-page-BFEtpkcf.js +0 -1
  315. package/dist/gateway/static/root/assets/projects-page-CHr-P2z4.js +0 -1
  316. package/dist/gateway/static/root/assets/remote-access-hub-PhEyHSOb.js +0 -1
  317. package/dist/gateway/static/root/assets/sessions-page-CmIhlHPS.js +0 -1
  318. package/dist/gateway/static/root/assets/settings-advanced-gate-CCOTu1jb.js +0 -1
  319. package/dist/gateway/static/root/assets/shares-settings-CG1sll8V.js +0 -1
  320. package/dist/gateway/static/root/assets/skill-reload-api-Byq23h9c.js +0 -1
  321. package/dist/gateway/static/root/assets/task-detail-page-D5q-wk_d.js +0 -1
  322. package/dist/gateway/static/root/assets/user-model-page-DE3ZeJL3.js +0 -2
  323. package/dist/gateway/static/root/assets/workflows-page-DGZaETmN.js +0 -6
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./messages-M5xl1fHE.js";import{t as a}from"./jszip.min-DT31yWkU.js";import{t as o}from"./preview-open-alternatives-Ck63fJaQ.js";var s=n(),c=e(a(),1),l=e(t(),1),u=r();function d(e){let t=(0,s.c)(17),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0];let[r,a]=(0,l.useState)(n),[d,m]=(0,l.useState)(null),h,g;if(t[1]===e.binaryBuffer?(h=t[2],g=t[3]):(h=()=>{if(!e.binaryBuffer)return;let t=!1;return c.default.loadAsync(e.binaryBuffer).then(e=>{t||a(Object.values(e.files).slice(0,500).map(p))}).catch(e=>{t||m(e instanceof Error?e.message:String(e))}),()=>{t=!0}},g=[e.binaryBuffer],t[1]=e.binaryBuffer,t[2]=h,t[3]=g),(0,l.useEffect)(h,g),d){let n;t[4]===e.language?n=t[5]:(n=i(e.language),t[4]=e.language,t[5]=n);let r=n,a;t[6]!==r.chat.attachmentPreviewDownloadFull||t[7]!==r.chat.attachmentPreviewOpenElsewhereHint||t[8]!==e.actions.onDownload?(a=(0,u.jsx)(o,{message:r.chat.attachmentPreviewOpenElsewhereHint,downloadLabel:r.chat.attachmentPreviewDownloadFull,onDownload:e.actions.onDownload}),t[6]=r.chat.attachmentPreviewDownloadFull,t[7]=r.chat.attachmentPreviewOpenElsewhereHint,t[8]=e.actions.onDownload,t[9]=a):a=t[9];let s;t[10]===d?s=t[11]:(s=(0,u.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:d}),t[10]=d,t[11]=s);let c;return t[12]!==a||t[13]!==s?(c=(0,u.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:[a,s]}),t[12]=a,t[13]=s,t[14]=c):c=t[14],c}let _;return t[15]===r?_=t[16]:(_=(0,u.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:(0,u.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-edge bg-surface-panel`,children:r.length===0?(0,u.jsx)(`p`,{className:`p-4 text-sm text-fg-muted`,children:`Loading archive...`}):(0,u.jsx)(`table`,{className:`w-full text-left text-xs`,children:(0,u.jsx)(`tbody`,{children:r.map(f)})})})}),t[15]=r,t[16]=_),_}function f(e){return(0,u.jsxs)(`tr`,{className:`border-b border-edge-subtle last:border-b-0 dark:border-edge`,children:[(0,u.jsx)(`td`,{className:`max-w-0 truncate px-3 py-2 font-mono text-fg`,title:e.name,children:e.dir?`${e.name}/`:e.name}),(0,u.jsx)(`td`,{className:`w-24 px-3 py-2 text-right text-fg-muted`,children:e.dir?``:m(e.size)})]},e.name)}function p(e){return{name:e.name,dir:e.dir,size:e.dir?0:e._data?.uncompressedSize??0}}function m(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}export{d as ArchivePreviewPluginView};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./messages-7VAhscYe.js";import{t as a}from"./jszip.min-DT31yWkU.js";import{t as o}from"./preview-open-alternatives-CuPN-vAn.js";var s=n(),c=e(a(),1),l=e(t(),1),u=r();function d(e){let t=(0,s.c)(17),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0];let[r,a]=(0,l.useState)(n),[d,m]=(0,l.useState)(null),h,g;if(t[1]===e.binaryBuffer?(h=t[2],g=t[3]):(h=()=>{if(!e.binaryBuffer)return;let t=!1;return c.default.loadAsync(e.binaryBuffer).then(e=>{t||a(Object.values(e.files).slice(0,500).map(p))}).catch(e=>{t||m(e instanceof Error?e.message:String(e))}),()=>{t=!0}},g=[e.binaryBuffer],t[1]=e.binaryBuffer,t[2]=h,t[3]=g),(0,l.useEffect)(h,g),d){let n;t[4]===e.language?n=t[5]:(n=i(e.language),t[4]=e.language,t[5]=n);let r=n,a;t[6]!==r.chat.attachmentPreviewDownloadFull||t[7]!==r.chat.attachmentPreviewOpenElsewhereHint||t[8]!==e.actions.onDownload?(a=(0,u.jsx)(o,{message:r.chat.attachmentPreviewOpenElsewhereHint,downloadLabel:r.chat.attachmentPreviewDownloadFull,onDownload:e.actions.onDownload}),t[6]=r.chat.attachmentPreviewDownloadFull,t[7]=r.chat.attachmentPreviewOpenElsewhereHint,t[8]=e.actions.onDownload,t[9]=a):a=t[9];let s;t[10]===d?s=t[11]:(s=(0,u.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:d}),t[10]=d,t[11]=s);let c;return t[12]!==a||t[13]!==s?(c=(0,u.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:[a,s]}),t[12]=a,t[13]=s,t[14]=c):c=t[14],c}let _;return t[15]===r?_=t[16]:(_=(0,u.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:(0,u.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-edge bg-surface-panel`,children:r.length===0?(0,u.jsx)(`p`,{className:`p-4 text-sm text-fg-muted`,children:`Loading archive...`}):(0,u.jsx)(`table`,{className:`w-full text-left text-xs`,children:(0,u.jsx)(`tbody`,{children:r.map(f)})})})}),t[15]=r,t[16]=_),_}function f(e){return(0,u.jsxs)(`tr`,{className:`border-b border-edge-subtle last:border-b-0 dark:border-edge`,children:[(0,u.jsx)(`td`,{className:`max-w-0 truncate px-3 py-2 font-mono text-fg`,title:e.name,children:e.dir?`${e.name}/`:e.name}),(0,u.jsx)(`td`,{className:`w-24 px-3 py-2 text-right text-fg-muted`,children:e.dir?``:m(e.size)})]},e.name)}function p(e){return{name:e.name,dir:e.dir,size:e.dir?0:e._data?.uncompressedSize??0}}function m(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}export{d as ArchivePreviewPluginView};
@@ -1 +1 @@
1
- import{ga as e,ha as t}from"./index-u4709aCa.js";async function n(n,r){let i,a=r||`unnamed`,o=`application/octet-stream`,s=0;if(typeof n==`string`){let e=await fetch(n);if(!e.ok)throw Error(`Failed to fetch file`);if(i=await e.arrayBuffer(),s=i.byteLength,o=e.headers.get(`content-type`)||o,!r){let e=n.split(`/`);a=e[e.length-1]||`document`}}else if(n instanceof File)i=await n.arrayBuffer(),s=n.size,o=n.type||o,a=r||n.name;else if(n instanceof Blob)i=await n.arrayBuffer(),s=n.size,o=n.type||o;else if(n instanceof ArrayBuffer)i=n,s=n.byteLength;else throw Error(`Invalid source type`);let c=new Uint8Array(i),l=``,u=32768;for(let e=0;e<c.length;e+=u){let t=c.slice(e,e+u);l+=String.fromCharCode(...t)}let d=btoa(l),f=`${a}_${Date.now()}_${Math.random()}`;if((o===`application/octet-stream`||/\.(csv|tsv)$/i.test(a))&&(o=t(a)??o),o?.startsWith(`image/`))return{id:f,type:`image`,name:a,mimeType:o,size:s,content:d,preview:d};if(o?.startsWith(`audio/`))return{id:f,type:`voice`,name:a,mimeType:o,size:s,content:d};if(e(a,o??``)){let e=new TextDecoder().decode(i);return{id:f,type:`document`,name:a,mimeType:o?.startsWith(`text/`)?o:`text/plain`,size:s,content:d,extractedText:e}}return{id:f,type:`document`,name:a,mimeType:o,size:s,content:d}}export{n as loadAttachment};
1
+ import{Oa as e,ka as t}from"./index--3c0awkr.js";async function n(n,r){let i,a=r||`unnamed`,o=`application/octet-stream`,s=0;if(typeof n==`string`){let e=await fetch(n);if(!e.ok)throw Error(`Failed to fetch file`);if(i=await e.arrayBuffer(),s=i.byteLength,o=e.headers.get(`content-type`)||o,!r){let e=n.split(`/`);a=e[e.length-1]||`document`}}else if(n instanceof File)i=await n.arrayBuffer(),s=n.size,o=n.type||o,a=r||n.name;else if(n instanceof Blob)i=await n.arrayBuffer(),s=n.size,o=n.type||o;else if(n instanceof ArrayBuffer)i=n,s=n.byteLength;else throw Error(`Invalid source type`);let c=new Uint8Array(i),l=``,u=32768;for(let e=0;e<c.length;e+=u){let t=c.slice(e,e+u);l+=String.fromCharCode(...t)}let d=btoa(l),f=`${a}_${Date.now()}_${Math.random()}`;if((o===`application/octet-stream`||/\.(csv|tsv)$/i.test(a))&&(o=e(a)??o),o?.startsWith(`image/`))return{id:f,type:`image`,name:a,mimeType:o,size:s,content:d,preview:d};if(o?.startsWith(`audio/`))return{id:f,type:`voice`,name:a,mimeType:o,size:s,content:d};if(t(a,o??``)){let e=new TextDecoder().decode(i);return{id:f,type:`document`,name:a,mimeType:o?.startsWith(`text/`)?o:`text/plain`,size:s,content:d,extractedText:e}}return{id:f,type:`document`,name:a,mimeType:o,size:s,content:d}}export{n as loadAttachment};
@@ -1 +1 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./automations-workspace-CzYmREol.js";var r=e(),i=t();function a(){let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{}),e[0]=t):t=e[0],t}export{a as AutomationsPage};
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./automations-workspace-B-Eduqwz.js";var r=e(),i=t();function a(){let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{}),e[0]=t):t=e[0],t}export{a as AutomationsPage};
@@ -0,0 +1,7 @@
1
+ import{i as e,t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,n as r,t as i}from"./vendor-react-BOUWij0V.js";import{g as a,t as o}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as s}from"./check-DUBLcKHA.js";import{m as c,n as l,p as u,r as d,s as f}from"./popover-select-B-GDnZO9.js";import{t as p}from"./circle-check-C23XjkUj.js";import{t as m}from"./markdown-view-Ck_5MADq.js";import{t as h}from"./plus-Q2yW6OE7.js";import{t as g}from"./x-B_N4OPjy.js";import{t as _}from"./cn-JdwAhgNB.js";import{n as v}from"./locale-store-BIkcRr3t.js";import{t as y}from"./messages-7VAhscYe.js";import{a as b,n as x,o as S,r as C,s as w,t as T}from"./dist-BGTk37IG.js";import{i as E}from"./vendor-swr-BIWyz7Rc.js";import{t as D}from"./button-CS04eWY9.js";import{t as O}from"./skeleton-BwbyijEw.js";import{n as k,r as A}from"./settings-shell-layer-context-BTQUDoJ2.js";import{Bc as ee,Bl as j,Cn as M,Ec as N,Fn as P,Gc as F,In as I,Io as L,Ln as te,Ma as ne,Nl as re,Pn as ie,Td as ae,Uu as R,Zc as z,ao as oe,gl as se,hc as ce,hu as le,id as ue,ju as de,l as B,ml as fe,nd as pe,nl as me,od as V,td as he,ul as ge,y as _e,ya as ve,zn as ye}from"./index--3c0awkr.js";import{a as H,i as be,n as U,r as W,t as xe}from"./workflow-run-setup-panel-CmmC2Pdr.js";import{i as Se,n as G,r as Ce,t as K}from"./browser-automation-inputs-CfQ2T9t6.js";var we=r(),q=e(n(),1),J=i(),Te=Array.from({length:24},(e,t)=>t);function Y(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 Ee(){let e=new Date;return{hour:e.getHours(),minute:e.getMinutes()}}function De(e,t){return`${String(e).padStart(2,`0`)}:${String(t).padStart(2,`0`)}`}function Oe(e){let t=(0,we.c)(80),{value:n,onChange:r,disabled:i,allowEmpty:a,clearLabel:o,ariaLabel:l,ariaLabelledBy:d,className:p,triggerClassName:m,id:h,name:v,minuteStep:y}=e,b=a===void 0?!1:a,x=y===void 0?1:y,S=Y(n),C=S??Ee(),[w,T]=(0,q.useState)(!1),[E,D]=(0,q.useState)(null),[O,ee]=(0,q.useState)(C.hour),[j,M]=(0,q.useState)(C.minute),N=(0,q.useRef)([]),P=(0,q.useRef)([]),F=A(),I=k(E),L=f(F,I!==null),te=Math.max(1,Math.min(60,Math.round(x))),ne=Array.from({length:Math.ceil(60/te)},(e,t)=>t*te).filter(Ae),re;t[0]===r?re=t[1]:(re=(e,t,n)=>{let i=n===void 0?!1:n;ee(e),M(t),r(De(e,t)),i&&T(!1)},t[0]=r,t[1]=re);let ie=re,ae=ke,z;t[2]===p?z=t[3]:(z=_(`relative min-w-0`,p),t[2]=p,t[3]=z);let oe=c,se;t[4]===n?se=t[5]:(se=e=>{if(e){let e=Y(n)??Ee();ee(e.hour),M(e.minute)}T(e)},t[4]=n,t[5]=se);let ce=b&&n&&`pr-9`,le=i&&`cursor-not-allowed opacity-50 hover:border-edge`,ue;t[6]!==ce||t[7]!==le||t[8]!==m?(ue=_(`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`,ce,le,m),t[6]=ce,t[7]=le,t[8]=m,t[9]=ue):ue=t[9];let de;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,J.jsx)(R,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`}),t[10]=de):de=t[10];let B=!S&&`text-fg-subtle`,fe;t[11]===B?fe=t[12]:(fe=_(`tabular-nums`,B),t[11]=B,t[12]=fe);let pe=S?De(S.hour,S.minute):`--:--`,me;t[13]!==fe||t[14]!==pe?(me=(0,J.jsx)(`span`,{className:fe,children:pe}),t[13]=fe,t[14]=pe,t[15]=me):me=t[15];let V;t[16]!==l||t[17]!==d||t[18]!==i||t[19]!==h||t[20]!==me||t[21]!==ue?(V=(0,J.jsx)(u,{asChild:!0,children:(0,J.jsxs)(`button`,{ref:D,id:h,type:`button`,disabled:i,"aria-label":l,"aria-labelledby":d,"aria-haspopup":`listbox`,className:ue,children:[de,me]})}),t[16]=l,t[17]=d,t[18]=i,t[19]=h,t[20]=me,t[21]=ue,t[22]=V):V=t[22];let he=c,ge=I??void 0,_e=c,ve=_(L,`w-[18rem] overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`),ye=e=>{e.preventDefault(),requestAnimationFrame(()=>N.current[O]?.focus())},H;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,J.jsx)(R,{className:`size-3.5`,"aria-hidden":`true`}),t[23]=H):H=t[23];let be=l??`HH:mm`,U;t[24]===be?U=t[25]:(U=(0,J.jsxs)(`span`,{className:`flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[H,be]}),t[24]=be,t[25]=U);let W;t[26]!==O||t[27]!==j?(W=De(O,j),t[26]=O,t[27]=j,t[28]=W):W=t[28];let xe;t[29]===W?xe=t[30]:(xe=(0,J.jsx)(`span`,{className:`font-mono text-base font-semibold tabular-nums text-fg`,children:W}),t[29]=W,t[30]=xe);let Se;t[31]!==U||t[32]!==xe?(Se=(0,J.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle bg-surface-inset px-3 py-2.5`,children:[U,xe]}),t[31]=U,t[32]=xe,t[33]=Se):Se=t[33];let G;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,J.jsx)(`div`,{className:`px-1 pb-1.5 text-[11px] font-semibold tracking-wider text-fg-subtle`,children:`HH`}),t[34]=G):G=t[34];let Ce=`${l??`HH:mm`} HH`,K=Te.map((e,t)=>(0,J.jsx)(`button`,{ref:e=>{N.current[t]=e},type:`button`,role:`option`,"aria-selected":O===e,tabIndex:O===e?0:-1,className:_(`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:()=>ie(e,j),onKeyDown:e=>ae(e,Te,O,e=>ie(e,j),N),children:String(e).padStart(2,`0`)},e)),Oe;t[35]!==Ce||t[36]!==K?(Oe=(0,J.jsxs)(`div`,{className:`pr-2`,children:[G,(0,J.jsx)(`div`,{role:`listbox`,"aria-label":Ce,className:`grid max-h-56 grid-cols-3 gap-1 overflow-y-auto pr-1`,children:K})]}),t[35]=Ce,t[36]=K,t[37]=Oe):Oe=t[37];let X;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,J.jsx)(`div`,{className:`px-1 pb-1.5 text-[11px] font-semibold tracking-wider text-fg-subtle`,children:`MM`}),t[38]=X):X=t[38];let je=`${l??`HH:mm`} MM`,Me=ne.map((e,t)=>(0,J.jsxs)(`button`,{ref:e=>{P.current[t]=e},type:`button`,role:`option`,"aria-selected":j===e,tabIndex:j===e?0:-1,className:_(`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:()=>ie(O,e,!0),onKeyDown:e=>ae(e,ne,j,e=>ie(O,e),P),children:[(0,J.jsx)(s,{className:_(`absolute left-0.5 size-3`,j!==e&&`invisible`),"aria-hidden":`true`}),String(e).padStart(2,`0`)]},e)),Ne;t[39]!==je||t[40]!==Me?(Ne=(0,J.jsx)(`div`,{role:`listbox`,"aria-label":je,className:`grid max-h-56 grid-cols-3 gap-1 overflow-y-auto pr-1`,children:Me}),t[39]=je,t[40]=Me,t[41]=Ne):Ne=t[41];let Pe;t[42]!==X||t[43]!==Ne?(Pe=(0,J.jsxs)(`div`,{className:`pl-2`,children:[X,Ne]}),t[42]=X,t[43]=Ne,t[44]=Pe):Pe=t[44];let Fe;t[45]!==Oe||t[46]!==Pe?(Fe=(0,J.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-edge-subtle p-2`,children:[Oe,Pe]}),t[45]=Oe,t[46]=Pe,t[47]=Fe):Fe=t[47];let Ie;t[48]!==_e.Content||t[49]!==ve||t[50]!==ye||t[51]!==Se||t[52]!==Fe?(Ie=(0,J.jsxs)(_e.Content,{side:`bottom`,align:`start`,sideOffset:6,collisionPadding:12,className:ve,onOpenAutoFocus:ye,children:[Se,Fe]}),t[48]=_e.Content,t[49]=ve,t[50]=ye,t[51]=Se,t[52]=Fe,t[53]=Ie):Ie=t[53];let Z;t[54]!==he.Portal||t[55]!==ge||t[56]!==Ie?(Z=(0,J.jsx)(he.Portal,{container:ge,children:Ie}),t[54]=he.Portal,t[55]=ge,t[56]=Ie,t[57]=Z):Z=t[57];let Q;t[58]!==w||t[59]!==V||t[60]!==Z||t[61]!==oe.Root||t[62]!==se?(Q=(0,J.jsxs)(oe.Root,{open:w,onOpenChange:se,children:[V,Z]}),t[58]=w,t[59]=V,t[60]=Z,t[61]=oe.Root,t[62]=se,t[63]=Q):Q=t[63];let Le;t[64]!==b||t[65]!==l||t[66]!==o||t[67]!==i||t[68]!==r||t[69]!==n?(Le=b&&n?(0,J.jsx)(`button`,{type:`button`,disabled:i,"aria-label":o??l,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,J.jsx)(g,{className:`size-3.5`,"aria-hidden":`true`})}):null,t[64]=b,t[65]=l,t[66]=o,t[67]=i,t[68]=r,t[69]=n,t[70]=Le):Le=t[70];let Re;t[71]!==i||t[72]!==v||t[73]!==n?(Re=v?(0,J.jsx)(`input`,{type:`hidden`,name:v,value:n,disabled:i}):null,t[71]=i,t[72]=v,t[73]=n,t[74]=Re):Re=t[74];let ze;return t[75]!==z||t[76]!==Q||t[77]!==Le||t[78]!==Re?(ze=(0,J.jsxs)(`div`,{className:z,children:[Q,Le,Re]}),t[75]=z,t[76]=Q,t[77]=Le,t[78]=Re,t[79]=ze):ze=t[79],ze}function ke(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 Ae(e){return e<60}var X=t((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),je=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronField=void 0,e.CronField=class e{#e=!1;#t=!1;#n=!1;#r=[];options={rawValue:``};static get min(){throw Error(`min must be overridden`)}static get max(){throw Error(`max must be overridden`)}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(t,n={rawValue:``}){if(!Array.isArray(t))throw Error(`${this.constructor.name} Validation error, values is not an array`);if(!(t.length>0))throw Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...n,rawValue:n.rawValue??``},this.#r=t.sort(e.sorter),this.#n=this.options.wildcard===void 0?this.#i():this.options.wildcard,this.#e=this.options.rawValue.includes(`L`)||t.includes(`L`),this.#t=this.options.rawValue.includes(`?`)||t.includes(`?`)}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#t}get isWildcard(){return this.#n}get values(){return this.#r}static sorter(e,t){let n=typeof e==`number`,r=typeof t==`number`;return n&&r?e-t:!n&&!r?e.localeCompare(t):n?-1:1}static findNearestValueInList(e,t,n=!1){if(n){for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n];return null}for(let n=0;n<e.length;n++)if(e[n]>t)return e[n];return null}findNearestValue(e,t=!1){return this.constructor.findNearestValueInList(this.values,e,t)}serialize(){return{wildcard:this.#n,values:this.#r}}validate(){let e,t=this.chars.length>0?` or chars ${this.chars.join(``)}`:``,n=e=>t=>RegExp(`^\\d{0,2}${t}$`).test(e);if(!this.#r.every(t=>(e=t,typeof t==`number`?t>=this.min&&t<=this.max:this.chars.some(n(t)))))throw Error(`${this.constructor.name} Validation error, got value ${e} expected range ${this.min}-${this.max}${t}`);let r=this.#r.find((e,t)=>this.#r.indexOf(e)!==t);if(r)throw Error(`${this.constructor.name} Validation error, duplicate values found: ${r}`)}#i(){return this.options.rawValue.length>0?[`*`,`?`].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(e,t)=>t+this.min).every(e=>this.#r.includes(e))}}})),Me=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfMonth=void 0;var t=je(),n=1,r=31,i=Object.freeze([`L`]);e.CronDayOfMonth=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),Ne=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfWeek=void 0;var t=je(),n=0,r=7,i=Object.freeze([`L`]);e.CronDayOfWeek=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}}})),Pe=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronHour=void 0;var t=je(),n=0,r=23,i=Object.freeze([]);e.CronHour=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),Fe=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMinute=void 0;var t=je(),n=0,r=59,i=Object.freeze([]);e.CronMinute=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),Ie=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{},n=class extends t{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},r=class extends t{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},i=class extends t{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},a=class extends t{},o=class extends t{constructor(e){super(`Invalid unit ${e}`)}},s=class extends t{},c=class extends t{constructor(){super(`Zone is an abstract class`)}},l=`numeric`,u=`short`,d=`long`,f={year:l,month:l,day:l},p={year:l,month:u,day:l},m={year:l,month:u,day:l,weekday:u},h={year:l,month:d,day:l},g={year:l,month:d,day:l,weekday:d},_={hour:l,minute:l},v={hour:l,minute:l,second:l},y={hour:l,minute:l,second:l,timeZoneName:u},b={hour:l,minute:l,second:l,timeZoneName:d},x={hour:l,minute:l,hourCycle:`h23`},S={hour:l,minute:l,second:l,hourCycle:`h23`},C={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:u},w={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:d},T={year:l,month:l,day:l,hour:l,minute:l},E={year:l,month:l,day:l,hour:l,minute:l,second:l},D={year:l,month:u,day:l,hour:l,minute:l},O={year:l,month:u,day:l,hour:l,minute:l,second:l},k={year:l,month:u,day:l,weekday:u,hour:l,minute:l},A={year:l,month:d,day:l,hour:l,minute:l,timeZoneName:u},ee={year:l,month:d,day:l,hour:l,minute:l,second:l,timeZoneName:u},j={year:l,month:d,day:l,weekday:d,hour:l,minute:l,timeZoneName:d},M={year:l,month:d,day:l,weekday:d,hour:l,minute:l,second:l,timeZoneName:d},N=class{get type(){throw new c}get name(){throw new c}get ianaName(){return this.name}get isUniversal(){throw new c}offsetName(e,t){throw new c}formatOffset(e,t){throw new c}offset(e){throw new c}equals(e){throw new c}get isValid(){throw new c}},P=null,F=class e extends N{static get instance(){return P===null&&(P=new e),P}get type(){return`system`}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return wt(e,t,n)}formatOffset(e,t){return Ot(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type===`system`}get isValid(){return!0}},I=new Map;function L(e){let t=I.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,era:`short`}),I.set(e,t)),t}var te={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ne(e,t){let n=e.format(t).replace(/\u200E/g,``),[,r,i,a,o,s,c,l]=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n);return[a,r,i,o,s,c,l]}function re(e,t){let n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){let{type:t,value:i}=n[e],a=te[t];t===`era`?r[a]=i:$(a)||(r[a]=parseInt(i,10))}return r}var ie=new Map,ae=class e extends N{static create(t){let n=ie.get(t);return n===void 0&&ie.set(t,n=new e(t)),n}static resetCache(){ie.clear(),I.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=e.isValidZone(t)}get type(){return`iana`}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return wt(e,t,n,this.name)}formatOffset(e,t){return Ot(this.offset(e),t)}offset(e){if(!this.valid)return NaN;let t=new Date(e);if(isNaN(t))return NaN;let n=L(this.name),[r,i,a,o,s,c,l]=n.formatToParts?re(n,t):ne(n,t);o===`BC`&&(r=-Math.abs(r)+1);let u=bt({year:r,month:i,day:a,hour:s===24?0:s,minute:c,second:l,millisecond:0}),d=+t,f=d%1e3;return d-=f>=0?f:1e3+f,(u-d)/(60*1e3)}equals(e){return e.type===`iana`&&e.name===this.name}get isValid(){return this.valid}},R={};function z(e,t={}){let n=JSON.stringify([e,t]),r=R[n];return r||(r=new Intl.ListFormat(e,t),R[n]=r),r}var oe=new Map;function se(e,t={}){let n=JSON.stringify([e,t]),r=oe.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),oe.set(n,r)),r}var ce=new Map;function le(e,t={}){let n=JSON.stringify([e,t]),r=ce.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),ce.set(n,r)),r}var ue=new Map;function de(e,t={}){let{base:n,...r}=t,i=JSON.stringify([e,r]),a=ue.get(i);return a===void 0&&(a=new Intl.RelativeTimeFormat(e,t),ue.set(i,a)),a}var B=null;function fe(){return B||(B=new Intl.DateTimeFormat().resolvedOptions().locale,B)}var pe=new Map;function me(e){let t=pe.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),pe.set(e,t)),t}var V=new Map;function he(e){let t=V.get(e);if(!t){let n=new Intl.Locale(e);t=`getWeekInfo`in n?n.getWeekInfo():n.weekInfo,`minimalDays`in t||(t={...Se,...t}),V.set(e,t)}return t}function ge(e){let t=e.indexOf(`-x-`);t!==-1&&(e=e.substring(0,t));let n=e.indexOf(`-u-`);if(n===-1)return[e];{let t,r;try{t=se(e).resolvedOptions(),r=e}catch{let i=e.substring(0,n);t=se(i).resolvedOptions(),r=i}let{numberingSystem:i,calendar:a}=t;return[r,i,a]}}function _e(e,t,n){return n||t?(e.includes(`-u-`)||(e+=`-u`),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}function ve(e){let t=[];for(let n=1;n<=12;n++){let r=gi.utc(2009,n,1);t.push(e(r))}return t}function ye(e){let t=[];for(let n=1;n<=7;n++){let r=gi.utc(2016,11,13+n);t.push(e(r))}return t}function H(e,t,n,r){let i=e.listingMode();return i===`error`?null:i===`en`?n(t):r(t)}function be(e){return e.numberingSystem&&e.numberingSystem!==`latn`?!1:e.numberingSystem===`latn`||!e.locale||e.locale.startsWith(`en`)||me(e.locale).numberingSystem===`latn`}var U=class{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:r,floor:i,...a}=n;if(!t||Object.keys(a).length>0){let t={useGrouping:!1,...n};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=le(e,t)}}format(e){if(this.inf){let t=this.floor?Math.floor(e):e;return this.inf.format(t)}else return ft(this.floor?Math.floor(e):gt(e,3),this.padTo)}},W=class{constructor(e,t,n){this.opts=n,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=e;else if(e.zone.type===`fixed`){let t=-1*(e.offset/60),n=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;e.offset!==0&&ae.create(n).valid?(r=n,this.dt=e):(r=`UTC`,this.dt=e.offset===0?e:e.setZone(`UTC`).plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type===`system`?this.dt=e:e.zone.type===`iana`?(this.dt=e,r=e.zone.name):(r=`UTC`,this.dt=e.setZone(`UTC`).plus({minutes:e.offset}),this.originalZone=e.zone);let i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=se(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(``):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if(e.type===`timeZoneName`){let t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}else return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},xe=class{constructor(e,t,n){this.opts={style:`long`,...n},!t&&rt()&&(this.rtf=de(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):qt(t,e,this.opts.numeric,this.opts.style!==`long`)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}},Se={firstDay:1,minimalDays:4,weekend:[6,7]},G=class e{static fromOpts(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,i,a=!1){let o=t||Z.defaultLocale;return new e(o||(a?`en-US`:fe()),n||Z.defaultNumberingSystem,r||Z.defaultOutputCalendar,lt(i)||Z.defaultWeekSettings,o)}static resetCache(){B=null,oe.clear(),ce.clear(),ue.clear(),pe.clear(),V.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return e.create(t,n,r,i)}constructor(e,t,n,r,i){let[a,o,s]=ge(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=n||s||null,this.weekSettings=r,this.intl=_e(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached??=be(this),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem===`latn`)&&(this.outputCalendar===null||this.outputCalendar===`gregory`);return e&&t?`en`:`intl`}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,lt(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return H(this,e,Nt,()=>{let n=this.intl===`ja`||this.intl.startsWith(`ja-`);t&=!n;let r=t?{month:e,day:`numeric`}:{month:e},i=t?`format`:`standalone`;if(!this.monthsCache[i][e]){let t=n?e=>this.dtFormatter(e,r).format():e=>this.extract(e,r,`month`);this.monthsCache[i][e]=ve(t)}return this.monthsCache[i][e]})}weekdays(e,t=!1){return H(this,e,Lt,()=>{let n=t?{weekday:e,year:`numeric`,month:`long`,day:`numeric`}:{weekday:e},r=t?`format`:`standalone`;return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=ye(e=>this.extract(e,n,`weekday`))),this.weekdaysCache[r][e]})}meridiems(){return H(this,void 0,()=>Rt,()=>{if(!this.meridiemCache){let e={hour:`numeric`,hourCycle:`h12`};this.meridiemCache=[gi.utc(2016,11,13,9),gi.utc(2016,11,13,19)].map(t=>this.extract(t,e,`dayperiod`))}return this.meridiemCache})}eras(e){return H(this,e,Ht,()=>{let t={era:e};return this.eraCache[e]||(this.eraCache[e]=[gi.utc(-40,1,1),gi.utc(2017,1,1)].map(e=>this.extract(e,t,`era`))),this.eraCache[e]})}extract(e,t,n){let r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===n);return r?r.value:null}numberFormatter(e={}){return new U(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new W(e,this.intl,t)}relFormatter(e={}){return new xe(this.intl,this.isEnglish(),e)}listFormatter(e={}){return z(this.intl,e)}isEnglish(){return this.locale===`en`||this.locale.toLowerCase()===`en-us`||me(this.intl).locale.startsWith(`en-us`)}getWeekSettings(){return this.weekSettings?this.weekSettings:it()?he(this.locale):Se}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},Ce=null,K=class e extends N{static get utcInstance(){return Ce===null&&(Ce=new e(0)),Ce}static instance(t){return t===0?e.utcInstance:new e(t)}static parseSpecifier(t){if(t){let n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new e(Tt(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return`fixed`}get name(){return this.fixed===0?`UTC`:`UTC${Ot(this.fixed,`narrow`)}`}get ianaName(){return this.fixed===0?`Etc/UTC`:`Etc/GMT${Ot(-this.fixed,`narrow`)}`}offsetName(){return this.name}formatOffset(e,t){return Ot(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type===`fixed`&&e.fixed===this.fixed}get isValid(){return!0}},we=class extends N{constructor(e){super(),this.zoneName=e}get type(){return`invalid`}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return``}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function q(e,t){if($(e)||e===null)return t;if(e instanceof N)return e;if(tt(e)){let n=e.toLowerCase();return n==="default"?t:n===`local`||n===`system`?F.instance:n===`utc`||n===`gmt`?K.utcInstance:K.parseSpecifier(n)||ae.create(e)}else if($e(e))return K.instance(e);else if(typeof e==`object`&&`offset`in e&&typeof e.offset==`function`)return e;else return new we(e)}var J={arab:`[٠-٩]`,arabext:`[۰-۹]`,bali:`[᭐-᭙]`,beng:`[০-৯]`,deva:`[०-९]`,fullwide:`[0-9]`,gujr:`[૦-૯]`,hanidec:`[〇|一|二|三|四|五|六|七|八|九]`,khmr:`[០-៩]`,knda:`[೦-೯]`,laoo:`[໐-໙]`,limb:`[᥆-᥏]`,mlym:`[൦-൯]`,mong:`[᠐-᠙]`,mymr:`[၀-၉]`,orya:`[୦-୯]`,tamldec:`[௦-௯]`,telu:`[౦-౯]`,thai:`[๐-๙]`,tibt:`[༠-༩]`,latn:`\\d`},Te={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Y=J.hanidec.replace(/[\[|\]]/g,``).split(``);function Ee(e){let t=parseInt(e,10);if(isNaN(t)){t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(e[n].search(J.hanidec)!==-1)t+=Y.indexOf(e[n]);else for(let e in Te){let[n,i]=Te[e];r>=n&&r<=i&&(t+=r-n)}}return parseInt(t,10)}else return t}var De=new Map;function Oe(){De.clear()}function ke({numberingSystem:e},t=``){let n=e||`latn`,r=De.get(n);r===void 0&&(r=new Map,De.set(n,r));let i=r.get(t);return i===void 0&&(i=RegExp(`${J[n]}${t}`),r.set(t,i)),i}var Ae=()=>Date.now(),X=`system`,je=null,Me=null,Ne=null,Pe=60,Fe,Ie=null,Z=class{static get now(){return Ae}static set now(e){Ae=e}static set defaultZone(e){X=e}static get defaultZone(){return q(X,F.instance)}static get defaultLocale(){return je}static set defaultLocale(e){je=e}static get defaultNumberingSystem(){return Me}static set defaultNumberingSystem(e){Me=e}static get defaultOutputCalendar(){return Ne}static set defaultOutputCalendar(e){Ne=e}static get defaultWeekSettings(){return Ie}static set defaultWeekSettings(e){Ie=lt(e)}static get twoDigitCutoffYear(){return Pe}static set twoDigitCutoffYear(e){Pe=e%100}static get throwOnInvalid(){return Fe}static set throwOnInvalid(e){Fe=e}static resetCaches(){G.resetCache(),ae.resetCache(),gi.resetCache(),Oe()}},Q=class{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},Le=[0,31,59,90,120,151,181,212,243,273,304,334],Re=[0,31,60,91,121,152,182,213,244,274,305,335];function ze(e,t){return new Q(`unit out of range`,`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Be(e,t,n){let r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);let i=r.getUTCDay();return i===0?7:i}function Ve(e,t,n){return n+(_t(e)?Re:Le)[t-1]}function He(e,t){let n=_t(e)?Re:Le,r=n.findIndex(e=>e<t),i=t-n[r];return{month:r+1,day:i}}function Ue(e,t){return(e-t+7)%7+1}function We(e,t=4,n=1){let{year:r,month:i,day:a}=e,o=Ve(r,i,a),s=Ue(Be(r,i,a),n),c=Math.floor((o-s+14-t)/7),l;return c<1?(l=r-1,c=St(l,t,n)):c>St(r,t,n)?(l=r+1,c=1):l=r,{weekYear:l,weekNumber:c,weekday:s,...kt(e)}}function Ge(e,t=4,n=1){let{weekYear:r,weekNumber:i,weekday:a}=e,o=Ue(Be(r,1,t),n),s=vt(r),c=i*7+a-o-7+t,l;c<1?(l=r-1,c+=vt(l)):c>s?(l=r+1,c-=vt(r)):l=r;let{month:u,day:d}=He(l,c);return{year:l,month:u,day:d,...kt(e)}}function Ke(e){let{year:t,month:n,day:r}=e;return{year:t,ordinal:Ve(t,n,r),...kt(e)}}function qe(e){let{year:t,ordinal:n}=e,{month:r,day:i}=He(t,n);return{year:t,month:r,day:i,...kt(e)}}function Je(e,t){if(!$(e.localWeekday)||!$(e.localWeekNumber)||!$(e.localWeekYear)){if(!$(e.weekday)||!$(e.weekNumber)||!$(e.weekYear))throw new a(`Cannot mix locale-based week fields with ISO-based week fields`);return $(e.localWeekday)||(e.weekday=e.localWeekday),$(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),$(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Ye(e,t=4,n=1){let r=et(e.weekYear),i=ut(e.weekNumber,1,St(e.weekYear,t,n)),a=ut(e.weekday,1,7);return r?i?a?!1:ze(`weekday`,e.weekday):ze(`week`,e.weekNumber):ze(`weekYear`,e.weekYear)}function Xe(e){let t=et(e.year),n=ut(e.ordinal,1,vt(e.year));return t?n?!1:ze(`ordinal`,e.ordinal):ze(`year`,e.year)}function Ze(e){let t=et(e.year),n=ut(e.month,1,12),r=ut(e.day,1,yt(e.year,e.month));return t?n?r?!1:ze(`day`,e.day):ze(`month`,e.month):ze(`year`,e.year)}function Qe(e){let{hour:t,minute:n,second:r,millisecond:i}=e,a=ut(t,0,23)||t===24&&n===0&&r===0&&i===0,o=ut(n,0,59),s=ut(r,0,59),c=ut(i,0,999);return a?o?s?c?!1:ze(`millisecond`,i):ze(`second`,r):ze(`minute`,n):ze(`hour`,t)}function $(e){return e===void 0}function $e(e){return typeof e==`number`}function et(e){return typeof e==`number`&&e%1==0}function tt(e){return typeof e==`string`}function nt(e){return Object.prototype.toString.call(e)===`[object Date]`}function rt(){try{return typeof Intl<`u`&&!!Intl.RelativeTimeFormat}catch{return!1}}function it(){try{return typeof Intl<`u`&&!!Intl.Locale&&(`weekInfo`in Intl.Locale.prototype||`getWeekInfo`in Intl.Locale.prototype)}catch{return!1}}function at(e){return Array.isArray(e)?e:[e]}function ot(e,t,n){if(e.length!==0)return e.reduce((e,r)=>{let i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i},null)[1]}function st(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}function ct(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function lt(e){if(e==null)return null;if(typeof e!=`object`)throw new s(`Week settings must be an object`);if(!ut(e.firstDay,1,7)||!ut(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!ut(e,1,7)))throw new s(`Invalid week settings`);return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ut(e,t,n){return et(e)&&e>=t&&e<=n}function dt(e,t){return e-t*Math.floor(e/t)}function ft(e,t=2){let n=e<0,r;return r=n?`-`+(``+-e).padStart(t,`0`):(``+e).padStart(t,`0`),r}function pt(e){if(!($(e)||e===null||e===``))return parseInt(e,10)}function mt(e){if(!($(e)||e===null||e===``))return parseFloat(e)}function ht(e){if(!($(e)||e===null||e===``)){let t=parseFloat(`0.`+e)*1e3;return Math.floor(t)}}function gt(e,t,n=`round`){let r=10**t;switch(n){case`expand`:return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case`trunc`:return Math.trunc(e*r)/r;case`round`:return Math.round(e*r)/r;case`floor`:return Math.floor(e*r)/r;case`ceil`:return Math.ceil(e*r)/r;default:throw RangeError(`Value rounding ${n} is out of range`)}}function _t(e){return e%4==0&&(e%100!=0||e%400==0)}function vt(e){return _t(e)?366:365}function yt(e,t){let n=dt(t-1,12)+1,r=e+(t-n)/12;return n===2?_t(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function bt(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function xt(e,t,n){return-Ue(Be(e,1,t),n)+t-1}function St(e,t=4,n=1){let r=xt(e,t,n),i=xt(e+1,t,n);return(vt(e)-r+i)/7}function Ct(e){return e>99?e:e>Z.twoDigitCutoffYear?1900+e:2e3+e}function wt(e,t,n,r=null){let i=new Date(e),a={hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`};r&&(a.timeZone=r);let o={timeZoneName:t,...a},s=new Intl.DateTimeFormat(n,o).formatToParts(i).find(e=>e.type.toLowerCase()===`timezonename`);return s?s.value:null}function Tt(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);let r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function Et(e){let t=Number(e);if(typeof e==`boolean`||e===``||!Number.isFinite(t))throw new s(`Invalid unit value ${e}`);return t}function Dt(e,t){let n={};for(let r in e)if(ct(e,r)){let i=e[r];if(i==null)continue;n[t(r)]=Et(i)}return n}function Ot(e,t){let n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?`+`:`-`;switch(t){case`short`:return`${i}${ft(n,2)}:${ft(r,2)}`;case`narrow`:return`${i}${n}${r>0?`:${r}`:``}`;case`techie`:return`${i}${ft(n,2)}${ft(r,2)}`;default:throw RangeError(`Value format ${t} is out of range for property format`)}}function kt(e){return st(e,[`hour`,`minute`,`second`,`millisecond`])}var At=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],jt=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Mt=[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`];function Nt(e){switch(e){case`narrow`:return[...Mt];case`short`:return[...jt];case`long`:return[...At];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`10`,`11`,`12`];case`2-digit`:return[`01`,`02`,`03`,`04`,`05`,`06`,`07`,`08`,`09`,`10`,`11`,`12`];default:return null}}var Pt=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],Ft=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],It=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function Lt(e){switch(e){case`narrow`:return[...It];case`short`:return[...Ft];case`long`:return[...Pt];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`];default:return null}}var Rt=[`AM`,`PM`],zt=[`Before Christ`,`Anno Domini`],Bt=[`BC`,`AD`],Vt=[`B`,`A`];function Ht(e){switch(e){case`narrow`:return[...Vt];case`short`:return[...Bt];case`long`:return[...zt];default:return null}}function Ut(e){return Rt[e.hour<12?0:1]}function Wt(e,t){return Lt(t)[e.weekday-1]}function Gt(e,t){return Nt(t)[e.month-1]}function Kt(e,t){return Ht(t)[e.year<0?0:1]}function qt(e,t,n=`always`,r=!1){let i={years:[`year`,`yr.`],quarters:[`quarter`,`qtr.`],months:[`month`,`mo.`],weeks:[`week`,`wk.`],days:[`day`,`day`,`days`],hours:[`hour`,`hr.`],minutes:[`minute`,`min.`],seconds:[`second`,`sec.`]},a=[`hours`,`minutes`,`seconds`].indexOf(e)===-1;if(n===`auto`&&a){let n=e===`days`;switch(t){case 1:return n?`tomorrow`:`next ${i[e][0]}`;case-1:return n?`yesterday`:`last ${i[e][0]}`;case 0:return n?`today`:`this ${i[e][0]}`}}let o=Object.is(t,-0)||t<0,s=Math.abs(t),c=s===1,l=i[e],u=r?c?l[1]:l[2]||l[1]:c?i[e][0]:e;return o?`${s} ${u} ago`:`in ${s} ${u}`}function Jt(e,t){let n=``;for(let r of e)r.literal?n+=r.val:n+=t(r.val);return n}var Yt={D:f,DD:p,DDD:h,DDDD:g,t:_,tt:v,ttt:y,tttt:b,T:x,TT:S,TTT:C,TTTT:w,f:T,ff:D,fff:A,ffff:j,F:E,FF:O,FFF:ee,FFFF:M},Xt=class e{static create(t,n={}){return new e(t,n)}static parseFormat(e){let t=null,n=``,r=!1,i=[];for(let a=0;a<e.length;a++){let o=e.charAt(a);o===`'`?((n.length>0||r)&&i.push({literal:r||/^\s+$/.test(n),val:n===``?`'`:n}),t=null,n=``,r=!r):r||o===t?n+=o:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=o,t=o)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return Yt[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,n=void 0){if(this.opts.forceSimple)return ft(e,t);let r={...this.opts};return t>0&&(r.padTo=t),n&&(r.signDisplay=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(t,n){let r=this.loc.listingMode()===`en`,i=this.loc.outputCalendar&&this.loc.outputCalendar!==`gregory`,a=(e,n)=>this.loc.extract(t,e,n),o=e=>t.isOffsetFixed&&t.offset===0&&e.allowZ?`Z`:t.isValid?t.zone.formatOffset(t.ts,e.format):``,s=()=>r?Ut(t):a({hour:`numeric`,hourCycle:`h12`},`dayperiod`),c=(e,n)=>r?Gt(t,e):a(n?{month:e}:{month:e,day:`numeric`},`month`),l=(e,n)=>r?Wt(t,e):a(n?{weekday:e}:{weekday:e,month:`long`,day:`numeric`},`weekday`),u=n=>{let r=e.macroTokenToFormatOpts(n);return r?this.formatWithSystemDefault(t,r):n},d=e=>r?Kt(t,e):a({era:e},`era`);return Jt(e.parseFormat(n),e=>{switch(e){case`S`:return this.num(t.millisecond);case`u`:case`SSS`:return this.num(t.millisecond,3);case`s`:return this.num(t.second);case`ss`:return this.num(t.second,2);case`uu`:return this.num(Math.floor(t.millisecond/10),2);case`uuu`:return this.num(Math.floor(t.millisecond/100));case`m`:return this.num(t.minute);case`mm`:return this.num(t.minute,2);case`h`:return this.num(t.hour%12==0?12:t.hour%12);case`hh`:return this.num(t.hour%12==0?12:t.hour%12,2);case`H`:return this.num(t.hour);case`HH`:return this.num(t.hour,2);case`Z`:return o({format:`narrow`,allowZ:this.opts.allowZ});case`ZZ`:return o({format:`short`,allowZ:this.opts.allowZ});case`ZZZ`:return o({format:`techie`,allowZ:this.opts.allowZ});case`ZZZZ`:return t.zone.offsetName(t.ts,{format:`short`,locale:this.loc.locale});case`ZZZZZ`:return t.zone.offsetName(t.ts,{format:`long`,locale:this.loc.locale});case`z`:return t.zoneName;case`a`:return s();case`d`:return i?a({day:`numeric`},`day`):this.num(t.day);case`dd`:return i?a({day:`2-digit`},`day`):this.num(t.day,2);case`c`:return this.num(t.weekday);case`ccc`:return l(`short`,!0);case`cccc`:return l(`long`,!0);case`ccccc`:return l(`narrow`,!0);case`E`:return this.num(t.weekday);case`EEE`:return l(`short`,!1);case`EEEE`:return l(`long`,!1);case`EEEEE`:return l(`narrow`,!1);case`L`:return i?a({month:`numeric`,day:`numeric`},`month`):this.num(t.month);case`LL`:return i?a({month:`2-digit`,day:`numeric`},`month`):this.num(t.month,2);case`LLL`:return c(`short`,!0);case`LLLL`:return c(`long`,!0);case`LLLLL`:return c(`narrow`,!0);case`M`:return i?a({month:`numeric`},`month`):this.num(t.month);case`MM`:return i?a({month:`2-digit`},`month`):this.num(t.month,2);case`MMM`:return c(`short`,!1);case`MMMM`:return c(`long`,!1);case`MMMMM`:return c(`narrow`,!1);case`y`:return i?a({year:`numeric`},`year`):this.num(t.year);case`yy`:return i?a({year:`2-digit`},`year`):this.num(t.year.toString().slice(-2),2);case`yyyy`:return i?a({year:`numeric`},`year`):this.num(t.year,4);case`yyyyyy`:return i?a({year:`numeric`},`year`):this.num(t.year,6);case`G`:return d(`short`);case`GG`:return d(`long`);case`GGGGG`:return d(`narrow`);case`kk`:return this.num(t.weekYear.toString().slice(-2),2);case`kkkk`:return this.num(t.weekYear,4);case`W`:return this.num(t.weekNumber);case`WW`:return this.num(t.weekNumber,2);case`n`:return this.num(t.localWeekNumber);case`nn`:return this.num(t.localWeekNumber,2);case`ii`:return this.num(t.localWeekYear.toString().slice(-2),2);case`iiii`:return this.num(t.localWeekYear,4);case`o`:return this.num(t.ordinal);case`ooo`:return this.num(t.ordinal,3);case`q`:return this.num(t.quarter);case`qq`:return this.num(t.quarter,2);case`X`:return this.num(Math.floor(t.ts/1e3));case`x`:return this.num(t.ts);default:return u(e)}})}formatDurationFromString(t,n){let r=this.opts.signMode===`negativeLargestOnly`?-1:1,i=e=>{switch(e[0]){case`S`:return`milliseconds`;case`s`:return`seconds`;case`m`:return`minutes`;case`h`:return`hours`;case`d`:return`days`;case`w`:return`weeks`;case`M`:return`months`;case`y`:return`years`;default:return null}},a=(e,t)=>n=>{let a=i(n);if(a){let i=t.isNegativeDuration&&a!==t.largestUnit?r:1,o;return o=this.opts.signMode===`negativeLargestOnly`&&a!==t.largestUnit?`never`:this.opts.signMode===`all`?`always`:`auto`,this.num(e.get(a)*i,n.length,o)}else return n},o=e.parseFormat(n),s=o.reduce((e,{literal:t,val:n})=>t?e:e.concat(n),[]),c=t.shiftTo(...s.map(i).filter(e=>e));return Jt(o,a(c,{isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]}))}},Zt=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Qt(...e){let t=e.reduce((e,t)=>e+t.source,``);return RegExp(`^${t}$`)}function $t(...e){return t=>e.reduce(([e,n,r],i)=>{let[a,o,s]=i(t,r);return[{...e,...a},o||n,s]},[{},null,1]).slice(0,2)}function en(e,...t){if(e==null)return[null,null];for(let[n,r]of t){let t=n.exec(e);if(t)return r(t)}return[null,null]}function tn(...e){return(t,n)=>{let r={},i;for(i=0;i<e.length;i++)r[e[i]]=pt(t[n+i]);return[r,null,n+i]}}var nn=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,rn=`(?:${nn.source}?(?:\\[(${Zt.source})\\])?)?`,an=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,on=RegExp(`${an.source}${rn}`),sn=RegExp(`(?:[Tt]${on.source})?`),cn=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ln=/(\d{4})-?W(\d\d)(?:-?(\d))?/,un=/(\d{4})-?(\d{3})/,dn=tn(`weekYear`,`weekNumber`,`weekDay`),fn=tn(`year`,`ordinal`),pn=/(\d{4})-(\d\d)-(\d\d)/,mn=RegExp(`${an.source} ?(?:${nn.source}|(${Zt.source}))?`),hn=RegExp(`(?: ${mn.source})?`);function gn(e,t,n){let r=e[t];return $(r)?n:pt(r)}function _n(e,t){return[{year:gn(e,t),month:gn(e,t+1,1),day:gn(e,t+2,1)},null,t+3]}function vn(e,t){return[{hours:gn(e,t,0),minutes:gn(e,t+1,0),seconds:gn(e,t+2,0),milliseconds:ht(e[t+3])},null,t+4]}function yn(e,t){let n=!e[t]&&!e[t+1],r=Tt(e[t+1],e[t+2]);return[{},n?null:K.instance(r),t+3]}function bn(e,t){return[{},e[t]?ae.create(e[t]):null,t+1]}var xn=RegExp(`^T?${an.source}$`),Sn=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Cn(e){let[t,n,r,i,a,o,s,c,l]=e,u=t[0]===`-`,d=c&&c[0]===`-`,f=(e,t=!1)=>e!==void 0&&(t||e&&u)?-e:e;return[{years:f(mt(n)),months:f(mt(r)),weeks:f(mt(i)),days:f(mt(a)),hours:f(mt(o)),minutes:f(mt(s)),seconds:f(mt(c),c===`-0`),milliseconds:f(ht(l),d)}]}var wn={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Tn(e,t,n,r,i,a,o){let s={year:t.length===2?Ct(pt(t)):pt(t),month:jt.indexOf(n)+1,day:pt(r),hour:pt(i),minute:pt(a)};return o&&(s.second=pt(o)),e&&(s.weekday=e.length>3?Pt.indexOf(e)+1:Ft.indexOf(e)+1),s}var En=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Dn(e){let[,t,n,r,i,a,o,s,c,l,u,d]=e,f=Tn(t,i,r,n,a,o,s),p;return p=c?wn[c]:l?0:Tt(u,d),[f,new K(p)]}function On(e){return e.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).trim()}var kn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,An=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,jn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Mn(e){let[,t,n,r,i,a,o,s]=e;return[Tn(t,i,r,n,a,o,s),K.utcInstance]}function Nn(e){let[,t,n,r,i,a,o,s]=e;return[Tn(t,s,n,r,i,a,o),K.utcInstance]}var Pn=Qt(cn,sn),Fn=Qt(ln,sn),In=Qt(un,sn),Ln=Qt(on),Rn=$t(_n,vn,yn,bn),zn=$t(dn,vn,yn,bn),Bn=$t(fn,vn,yn,bn),Vn=$t(vn,yn,bn);function Hn(e){return en(e,[Pn,Rn],[Fn,zn],[In,Bn],[Ln,Vn])}function Un(e){return en(On(e),[En,Dn])}function Wn(e){return en(e,[kn,Mn],[An,Mn],[jn,Nn])}function Gn(e){return en(e,[Sn,Cn])}var Kn=$t(vn);function qn(e){return en(e,[xn,Kn])}var Jn=Qt(pn,hn),Yn=Qt(mn),Xn=$t(vn,yn,bn);function Zn(e){return en(e,[Jn,Rn],[Yn,Xn])}var Qn=`Invalid Duration`,$n={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},er={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...$n},tr=146097/400,nr=146097/4800,rr={years:{quarters:4,months:12,weeks:tr/7,days:tr,hours:tr*24,minutes:tr*24*60,seconds:tr*24*60*60,milliseconds:tr*24*60*60*1e3},quarters:{months:3,weeks:tr/28,days:tr/4,hours:tr*24/4,minutes:tr*24*60/4,seconds:tr*24*60*60/4,milliseconds:tr*24*60*60*1e3/4},months:{weeks:nr/7,days:nr,hours:nr*24,minutes:nr*24*60,seconds:nr*24*60*60,milliseconds:nr*24*60*60*1e3},...$n},ir=[`years`,`quarters`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`],ar=ir.slice(0).reverse();function or(e,t,n=!1){return new ur({values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix})}function sr(e,t){let n=t.milliseconds??0;for(let r of ar.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function cr(e,t){let n=sr(e,t)<0?-1:1;ir.reduceRight((r,i)=>{if($(t[i]))return r;if(r){let a=t[r]*n,o=e[i][r],s=Math.floor(a/o);t[i]+=s*n,t[r]-=s*o*n}return i},null),ir.reduce((n,r)=>{if($(t[r]))return n;if(n){let i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r},null)}function lr(e){let t={};for(let[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}var ur=class e{constructor(e){let t=e.conversionAccuracy===`longterm`||!1,n=t?rr:er;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||G.create(),this.conversionAccuracy=t?`longterm`:`casual`,this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,n){return e.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(typeof t!=`object`||!t)throw new s(`Duration.fromObject: argument expected to be an object, got ${t===null?`null`:typeof t}`);return new e({values:Dt(t,e.normalizeUnit),loc:G.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if($e(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t==`object`)return e.fromObject(t);throw new s(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){let[r]=Gn(t);return r?e.fromObject(r,n):e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){let[r]=qn(t);return r?e.fromObject(r,n):e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new s(`need to specify a reason the Duration is invalid`);let r=t instanceof Q?t:new Q(t,n);if(Z.throwOnInvalid)throw new i(r);return new e({invalid:r})}static normalizeUnit(e){let t={year:`years`,years:`years`,quarter:`quarters`,quarters:`quarters`,month:`months`,months:`months`,week:`weeks`,weeks:`weeks`,day:`days`,days:`days`,hour:`hours`,hours:`hours`,minute:`minutes`,minutes:`minutes`,second:`seconds`,seconds:`seconds`,millisecond:`milliseconds`,milliseconds:`milliseconds`}[e&&e.toLowerCase()];if(!t)throw new o(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){let n={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?Xt.create(this.loc,n).formatDurationFromString(this,e):Qn}toHuman(e={}){if(!this.isValid)return Qn;let t=e.showZeros!==!1,n=ir.map(n=>{let r=this.values[n];return $(r)||r===0&&!t?null:this.loc.numberFormatter({style:`unit`,unitDisplay:`long`,...e,unit:n.slice(0,-1)}).format(r)}).filter(e=>e);return this.loc.listFormatter({type:`conjunction`,style:e.listStyle||`narrow`,...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e=`P`;return this.years!==0&&(e+=this.years+`Y`),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+`M`),this.weeks!==0&&(e+=this.weeks+`W`),this.days!==0&&(e+=this.days+`D`),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+=`T`),this.hours!==0&&(e+=this.hours+`H`),this.minutes!==0&&(e+=this.minutes+`M`),(this.seconds!==0||this.milliseconds!==0)&&(e+=gt(this.seconds+this.milliseconds/1e3,3)+`S`),e===`P`&&(e+=`T0S`),e}toISOTime(e={}){if(!this.isValid)return null;let t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:`extended`,...e,includeOffset:!1},gi.fromMillis(t,{zone:`UTC`}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?sr(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let n=e.fromDurationLike(t),r={};for(let e of ir)(ct(n.values,e)||ct(this.values,e))&&(r[e]=n.get(e)+this.get(e));return or(this,{values:r},!0)}minus(t){if(!this.isValid)return this;let n=e.fromDurationLike(t);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let t={};for(let n of Object.keys(this.values))t[n]=Et(e(this.values[n],n));return or(this,{values:t},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let n={...this.values,...Dt(t,e.normalizeUnit)};return or(this,{values:n})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){let i={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n};return or(this,i)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return cr(this.matrix,e),or(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=lr(this.normalize().shiftToAll().toObject());return or(this,{values:e},!0)}shiftTo(...t){if(!this.isValid||t.length===0)return this;t=t.map(t=>e.normalizeUnit(t));let n={},r={},i=this.toObject(),a;for(let e of ir)if(t.indexOf(e)>=0){a=e;let t=0;for(let n in r)t+=this.matrix[n][e]*r[n],r[n]=0;$e(i[e])&&(t+=i[e]);let o=Math.trunc(t);n[e]=o,r[e]=(t*1e3-o*1e3)/1e3}else $e(i[e])&&(r[e]=i[e]);for(let e in r)r[e]!==0&&(n[a]+=e===a?r[e]:r[e]/this.matrix[a][e]);return cr(this.matrix,n),or(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo(`years`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`):this}negate(){if(!this.isValid)return this;let e={};for(let t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return or(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=lr(this.values);return or(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(e,t){return e===void 0||e===0?t===void 0||t===0:e===t}for(let n of ir)if(!t(this.values[n],e.values[n]))return!1;return!0}},dr=`Invalid Interval`;function fr(e,t){return!e||!e.isValid?pr.invalid(`missing or invalid start`):!t||!t.isValid?pr.invalid(`missing or invalid end`):t<e?pr.invalid(`end before start`,`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}var pr=class e{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new s(`need to specify a reason the Interval is invalid`);let i=t instanceof Q?t:new Q(t,n);if(Z.throwOnInvalid)throw new r(i);return new e({invalid:i})}static fromDateTimes(t,n){let r=_i(t),i=_i(n);return fr(r,i)??new e({start:r,end:i})}static after(t,n){let r=ur.fromDurationLike(n),i=_i(t);return e.fromDateTimes(i,i.plus(r))}static before(t,n){let r=ur.fromDurationLike(n),i=_i(t);return e.fromDateTimes(i.minus(r),i)}static fromISO(t,n){let[r,i]=(t||``).split(`/`,2);if(r&&i){let t,a;try{t=gi.fromISO(r,n),a=t.isValid}catch{a=!1}let o,s;try{o=gi.fromISO(i,n),s=o.isValid}catch{s=!1}if(a&&s)return e.fromDateTimes(t,o);if(a){let r=ur.fromISO(i,n);if(r.isValid)return e.after(t,r)}else if(s){let t=ur.fromISO(r,n);if(t.isValid)return e.before(o,t)}}return e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e=`milliseconds`){return this.isValid?this.toDuration(e).get(e):NaN}count(e=`milliseconds`,t){if(!this.isValid)return NaN;let n=this.start.startOf(e,t),r;return r=t!=null&&t.useLocaleWeeks?this.end.reconfigure({locale:n.locale}):this.end,r=r.startOf(e,t),Math.floor(r.diff(n,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:t,end:n}={}){return this.isValid?e.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];let n=t.map(_i).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[],{s:i}=this,a=0;for(;i<this.e;){let t=n[a]||this.e,o=+t>+this.e?this.e:t;r.push(e.fromDateTimes(i,o)),i=o,a+=1}return r}splitBy(t){let n=ur.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as(`milliseconds`)===0)return[];let{s:r}=this,i=1,a,o=[];for(;r<this.e;){let t=this.start.plus(n.mapUnits(e=>e*i));a=+t>+this.e?this.e:t,o.push(e.fromDateTimes(r,a)),r=a,i+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(t){if(!this.isValid)return this;let n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:e.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;let n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return e.fromDateTimes(n,r)}static merge(e){let[t,n]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n],[[],null]);return n&&t.push(n),t}static xor(t){let n=null,r=0,i=[],a=t.map(e=>[{time:e.s,type:`s`},{time:e.e,type:`e`}]),o=Array.prototype.concat(...a).sort((e,t)=>e.time-t.time);for(let t of o)r+=t.type===`s`?1:-1,r===1?n=t.time:(n&&+n!=+t.time&&i.push(e.fromDateTimes(n,t.time)),n=null);return e.merge(i)}difference(...t){return e.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:dr}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=f,t={}){return this.isValid?Xt.create(this.s.loc.clone(t),e).formatInterval(this):dr}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:dr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:dr}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:dr}toFormat(e,{separator:t=` – `}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:dr}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ur.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}},mr=class{static hasDST(e=Z.defaultZone){let t=gi.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ae.isValidZone(e)}static normalizeZone(e){return q(e,Z.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||G.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||G.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||G.create(e)).getWeekendDays().slice()}static months(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||G.create(t,n,i)).months(e)}static monthsFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||G.create(t,n,i)).months(e,!0)}static weekdays(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||G.create(t,n,null)).weekdays(e)}static weekdaysFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||G.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return G.create(e).meridiems()}static eras(e=`short`,{locale:t=null}={}){return G.create(t,null,`gregory`).eras(e)}static features(){return{relative:rt(),localeWeek:it()}}};function hr(e,t){let n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf(`day`).valueOf(),r=n(t)-n(e);return Math.floor(ur.fromMillis(r).as(`days`))}function gr(e,t,n){let r=[[`years`,(e,t)=>t.year-e.year],[`quarters`,(e,t)=>t.quarter-e.quarter+(t.year-e.year)*4],[`months`,(e,t)=>t.month-e.month+(t.year-e.year)*12],[`weeks`,(e,t)=>{let n=hr(e,t);return(n-n%7)/7}],[`days`,hr]],i={},a=e,o,s;for(let[c,l]of r)n.indexOf(c)>=0&&(o=c,i[c]=l(e,t),s=a.plus(i),s>t?(i[c]--,e=a.plus(i),e>t&&(s=e,i[c]--,e=a.plus(i))):e=s);return[e,i,s,o]}function _r(e,t,n,r){let[i,a,o,s]=gr(e,t,n),c=t-i,l=n.filter(e=>[`hours`,`minutes`,`seconds`,`milliseconds`].indexOf(e)>=0);l.length===0&&(o<t&&(o=i.plus({[s]:1})),o!==i&&(a[s]=(a[s]||0)+c/(o-i)));let u=ur.fromObject(a,r);return l.length>0?ur.fromMillis(c,r).shiftTo(...l).plus(u):u}var vr=`missing Intl.DateTimeFormat.formatToParts support`;function yr(e,t=e=>e){return{regex:e,deser:([e])=>t(Ee(e))}}var br=`[ \xA0]`,xr=new RegExp(br,`g`);function Sr(e){return e.replace(/\./g,`\\.?`).replace(xr,br)}function Cr(e){return e.replace(/\./g,``).replace(xr,` `).toLowerCase()}function wr(e,t){return e===null?null:{regex:RegExp(e.map(Sr).join(`|`)),deser:([n])=>e.findIndex(e=>Cr(n)===Cr(e))+t}}function Tr(e,t){return{regex:e,deser:([,e,t])=>Tt(e,t),groups:t}}function Er(e){return{regex:e,deser:([e])=>e}}function Dr(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,`\\$&`)}function Or(e,t){let n=ke(t),r=ke(t,`{2}`),i=ke(t,`{3}`),a=ke(t,`{4}`),o=ke(t,`{6}`),s=ke(t,`{1,2}`),c=ke(t,`{1,3}`),l=ke(t,`{1,6}`),u=ke(t,`{1,9}`),d=ke(t,`{2,4}`),f=ke(t,`{4,6}`),p=e=>({regex:RegExp(Dr(e.val)),deser:([e])=>e,literal:!0}),m=(m=>{if(e.literal)return p(m);switch(m.val){case`G`:return wr(t.eras(`short`),0);case`GG`:return wr(t.eras(`long`),0);case`y`:return yr(l);case`yy`:return yr(d,Ct);case`yyyy`:return yr(a);case`yyyyy`:return yr(f);case`yyyyyy`:return yr(o);case`M`:return yr(s);case`MM`:return yr(r);case`MMM`:return wr(t.months(`short`,!0),1);case`MMMM`:return wr(t.months(`long`,!0),1);case`L`:return yr(s);case`LL`:return yr(r);case`LLL`:return wr(t.months(`short`,!1),1);case`LLLL`:return wr(t.months(`long`,!1),1);case`d`:return yr(s);case`dd`:return yr(r);case`o`:return yr(c);case`ooo`:return yr(i);case`HH`:return yr(r);case`H`:return yr(s);case`hh`:return yr(r);case`h`:return yr(s);case`mm`:return yr(r);case`m`:return yr(s);case`q`:return yr(s);case`qq`:return yr(r);case`s`:return yr(s);case`ss`:return yr(r);case`S`:return yr(c);case`SSS`:return yr(i);case`u`:return Er(u);case`uu`:return Er(s);case`uuu`:return yr(n);case`a`:return wr(t.meridiems(),0);case`kkkk`:return yr(a);case`kk`:return yr(d,Ct);case`W`:return yr(s);case`WW`:return yr(r);case`E`:case`c`:return yr(n);case`EEE`:return wr(t.weekdays(`short`,!1),1);case`EEEE`:return wr(t.weekdays(`long`,!1),1);case`ccc`:return wr(t.weekdays(`short`,!0),1);case`cccc`:return wr(t.weekdays(`long`,!0),1);case`Z`:case`ZZ`:return Tr(RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case`ZZZ`:return Tr(RegExp(`([+-]${s.source})(${r.source})?`),2);case`z`:return Er(/[a-z_+-/]{1,256}?/i);case` `:return Er(/[^\S\n\r]/);default:return p(m)}})(e)||{invalidReason:vr};return m.token=e,m}var kr={year:{"2-digit":`yy`,numeric:`yyyyy`},month:{numeric:`M`,"2-digit":`MM`,short:`MMM`,long:`MMMM`},day:{numeric:`d`,"2-digit":`dd`},weekday:{short:`EEE`,long:`EEEE`},dayperiod:`a`,dayPeriod:`a`,hour12:{numeric:`h`,"2-digit":`hh`},hour24:{numeric:`H`,"2-digit":`HH`},minute:{numeric:`m`,"2-digit":`mm`},second:{numeric:`s`,"2-digit":`ss`},timeZoneName:{long:`ZZZZZ`,short:`ZZZ`}};function Ar(e,t,n){let{type:r,value:i}=e;if(r===`literal`){let e=/^\s+$/.test(i);return{literal:!e,val:e?` `:i}}let a=t[r],o=r;r===`hour`&&(o=t.hour12==null?t.hourCycle==null?n.hour12?`hour12`:`hour24`:t.hourCycle===`h11`||t.hourCycle===`h12`?`hour12`:`hour24`:t.hour12?`hour12`:`hour24`);let s=kr[o];if(typeof s==`object`&&(s=s[a]),s)return{literal:!1,val:s}}function jr(e){return[`^${e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,``)}$`,e]}function Mr(e,t,n){let r=e.match(t);if(r){let e={},t=1;for(let i in n)if(ct(n,i)){let a=n[i],o=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(r.slice(t,t+o))),t+=o}return[r,e]}else return[r,{}]}function Nr(e){let t=e=>{switch(e){case`S`:return`millisecond`;case`s`:return`second`;case`m`:return`minute`;case`h`:case`H`:return`hour`;case`d`:return`day`;case`o`:return`ordinal`;case`L`:case`M`:return`month`;case`y`:return`year`;case`E`:case`c`:return`weekday`;case`W`:return`weekNumber`;case`k`:return`weekYear`;case`q`:return`quarter`;default:return null}},n=null,r;return $(e.z)||(n=ae.create(e.z)),$(e.Z)||(n||=new K(e.Z),r=e.Z),$(e.q)||(e.M=(e.q-1)*3+1),$(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),$(e.u)||(e.S=ht(e.u)),[Object.keys(e).reduce((n,r)=>{let i=t(r);return i&&(n[i]=e[r]),n},{}),n,r]}var Pr=null;function Fr(){return Pr||=gi.fromMillis(1555555555555),Pr}function Ir(e,t){if(e.literal)return e;let n=Vr(Xt.macroTokenToFormatOpts(e.val),t);return n==null||n.includes(void 0)?e:n}function Lr(e,t){return Array.prototype.concat(...e.map(e=>Ir(e,t)))}var Rr=class{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Lr(Xt.parseFormat(t),e),this.units=this.tokens.map(t=>Or(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){let[e,t]=jr(this.units);this.regex=RegExp(e,`i`),this.handlers=t}}explainFromTokens(e){if(this.isValid){let[t,n]=Mr(e,this.regex,this.handlers),[r,i,o]=n?Nr(n):[null,null,void 0];if(ct(n,`a`)&&ct(n,`H`))throw new a(`Can't include meridiem when specifying 24-hour format`);return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:r,zone:i,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function zr(e,t,n){return new Rr(e,n).explainFromTokens(t)}function Br(e,t,n){let{result:r,zone:i,specificOffset:a,invalidReason:o}=zr(e,t,n);return[r,i,a,o]}function Vr(e,t){if(!e)return null;let n=Xt.create(t,e).dtFormatter(Fr()),r=n.formatToParts(),i=n.resolvedOptions();return r.map(t=>Ar(t,e,i))}var Hr=`Invalid DateTime`,Ur=864e13;function Wr(e){return new Q(`unsupported zone`,`the zone "${e.name}" is not supported`)}function Gr(e){return e.weekData===null&&(e.weekData=We(e.c)),e.weekData}function Kr(e){return e.localWeekData===null&&(e.localWeekData=We(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function qr(e,t){let n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new gi({...n,...t,old:n})}function Jr(e,t,n){let r=e-t*60*1e3,i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;let a=n.offset(r);return i===a?[r,i]:[e-Math.min(i,a)*60*1e3,Math.max(i,a)]}function Yr(e,t){e+=t*60*1e3;let n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Xr(e,t,n){return Jr(bt(e),t,n)}function Zr(e,t){let n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,a={...e.c,year:r,month:i,day:Math.min(e.c.day,yt(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=ur.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as(`milliseconds`),[s,c]=Jr(bt(a),n,e.zone);return o!==0&&(s+=o,c=e.zone.offset(s)),{ts:s,o:c}}function Qr(e,t,n,r,i,a){let{setZone:o,zone:s}=n;if(e&&Object.keys(e).length!==0||t){let r=t||s,i=gi.fromObject(e,{...n,zone:r,specificOffset:a});return o?i:i.setZone(s)}else return gi.invalid(new Q(`unparsable`,`the input "${i}" can't be parsed as ${r}`))}function $r(e,t,n=!0){return e.isValid?Xt.create(G.create(`en-US`),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function ei(e,t,n){let r=e.c.year>9999||e.c.year<0,i=``;if(r&&e.c.year>=0&&(i+=`+`),i+=ft(e.c.year,r?6:4),n===`year`)return i;if(t){if(i+=`-`,i+=ft(e.c.month),n===`month`)return i;i+=`-`}else if(i+=ft(e.c.month),n===`month`)return i;return i+=ft(e.c.day),i}function ti(e,t,n,r,i,a,o){let s=!n||e.c.millisecond!==0||e.c.second!==0,c=``;switch(o){case`day`:case`month`:case`year`:break;default:if(c+=ft(e.c.hour),o===`hour`)break;if(t){if(c+=`:`,c+=ft(e.c.minute),o===`minute`)break;s&&(c+=`:`,c+=ft(e.c.second))}else{if(c+=ft(e.c.minute),o===`minute`)break;s&&(c+=ft(e.c.second))}if(o===`second`)break;s&&(!r||e.c.millisecond!==0)&&(c+=`.`,c+=ft(e.c.millisecond,3))}return i&&(e.isOffsetFixed&&e.offset===0&&!a?c+=`Z`:e.o<0?(c+=`-`,c+=ft(Math.trunc(-e.o/60)),c+=`:`,c+=ft(Math.trunc(-e.o%60))):(c+=`+`,c+=ft(Math.trunc(e.o/60)),c+=`:`,c+=ft(Math.trunc(e.o%60)))),a&&(c+=`[`+e.zone.ianaName+`]`),c}var ni={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ri={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ii={ordinal:1,hour:0,minute:0,second:0,millisecond:0},ai=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],oi=[`weekYear`,`weekNumber`,`weekday`,`hour`,`minute`,`second`,`millisecond`],si=[`year`,`ordinal`,`hour`,`minute`,`second`,`millisecond`];function ci(e){let t={year:`year`,years:`year`,month:`month`,months:`month`,day:`day`,days:`day`,hour:`hour`,hours:`hour`,minute:`minute`,minutes:`minute`,quarter:`quarter`,quarters:`quarter`,second:`second`,seconds:`second`,millisecond:`millisecond`,milliseconds:`millisecond`,weekday:`weekday`,weekdays:`weekday`,weeknumber:`weekNumber`,weeksnumber:`weekNumber`,weeknumbers:`weekNumber`,weekyear:`weekYear`,weekyears:`weekYear`,ordinal:`ordinal`}[e.toLowerCase()];if(!t)throw new o(e);return t}function li(e){switch(e.toLowerCase()){case`localweekday`:case`localweekdays`:return`localWeekday`;case`localweeknumber`:case`localweeknumbers`:return`localWeekNumber`;case`localweekyear`:case`localweekyears`:return`localWeekYear`;default:return ci(e)}}function ui(e){if(mi===void 0&&(mi=Z.now()),e.type!==`iana`)return e.offset(mi);let t=e.name,n=hi.get(t);return n===void 0&&(n=e.offset(mi),hi.set(t,n)),n}function di(e,t){let n=q(t.zone,Z.defaultZone);if(!n.isValid)return gi.invalid(Wr(n));let r=G.fromObject(t),i,a;if($(e.year))i=Z.now();else{for(let t of ai)$(e[t])&&(e[t]=ni[t]);let t=Ze(e)||Qe(e);if(t)return gi.invalid(t);let r=ui(n);[i,a]=Xr(e,r,n)}return new gi({ts:i,zone:n,loc:r,o:a})}function fi(e,t,n){let r=$(n.round)?!0:n.round,i=$(n.rounding)?`trunc`:n.rounding,a=(e,a)=>(e=gt(e,r||n.calendary?0:2,n.calendary?`round`:i),t.loc.clone(n).relFormatter(n).format(e,a)),o=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return a(o(n.unit),n.unit);for(let e of n.units){let t=o(e);if(Math.abs(t)>=1)return a(t,e)}return a(e>t?-0:0,n.units[n.units.length-1])}function pi(e){let t={},n;return e.length>0&&typeof e[e.length-1]==`object`?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}var mi,hi=new Map,gi=class e{constructor(e){let t=e.zone||Z.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new Q(`invalid input`):null)||(t.isValid?null:Wr(t));this.ts=$(e.ts)?Z.now():e.ts;let r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{let a=$e(e.o)&&!e.old?e.o:t.offset(this.ts);r=Yr(this.ts,a),n=Number.isNaN(r.year)?new Q(`invalid input`):null,r=n?null:r,i=n?null:a}this._zone=t,this.loc=e.loc||G.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[e,t]=pi(arguments),[n,r,i,a,o,s,c]=t;return di({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static utc(){let[e,t]=pi(arguments),[n,r,i,a,o,s,c]=t;return e.zone=K.utcInstance,di({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static fromJSDate(t,n={}){let r=nt(t)?t.valueOf():NaN;if(Number.isNaN(r))return e.invalid(`invalid input`);let i=q(n.zone,Z.defaultZone);return i.isValid?new e({ts:r,zone:i,loc:G.fromObject(n)}):e.invalid(Wr(i))}static fromMillis(t,n={}){if(!$e(t))throw new s(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`);return t<-864e13||t>Ur?e.invalid(`Timestamp out of range`):new e({ts:t,zone:q(n.zone,Z.defaultZone),loc:G.fromObject(n)})}static fromSeconds(t,n={}){if($e(t))return new e({ts:t*1e3,zone:q(n.zone,Z.defaultZone),loc:G.fromObject(n)});throw new s(`fromSeconds requires a numerical input`)}static fromObject(t,n={}){t||={};let r=q(n.zone,Z.defaultZone);if(!r.isValid)return e.invalid(Wr(r));let i=G.fromObject(n),o=Dt(t,li),{minDaysInFirstWeek:s,startOfWeek:c}=Je(o,i),l=Z.now(),u=$(n.specificOffset)?r.offset(l):n.specificOffset,d=!$(o.ordinal),f=!$(o.year),p=!$(o.month)||!$(o.day),m=f||p,h=o.weekYear||o.weekNumber;if((m||d)&&h)throw new a(`Can't mix weekYear/weekNumber units with year/month/day or ordinals`);if(p&&d)throw new a(`Can't mix ordinal dates with month/day`);let g=h||o.weekday&&!m,_,v,y=Yr(l,u);g?(_=oi,v=ri,y=We(y,s,c)):d?(_=si,v=ii,y=Ke(y)):(_=ai,v=ni);let b=!1;for(let e of _){let t=o[e];$(t)?b?o[e]=v[e]:o[e]=y[e]:b=!0}let x=(g?Ye(o,s,c):d?Xe(o):Ze(o))||Qe(o);if(x)return e.invalid(x);let[S,C]=Xr(g?Ge(o,s,c):d?qe(o):o,u,r),w=new e({ts:S,zone:r,o:C,loc:i});return o.weekday&&m&&t.weekday!==w.weekday?e.invalid(`mismatched weekday`,`you can't specify both a weekday of ${o.weekday} and a date of ${w.toISO()}`):w.isValid?w:e.invalid(w.invalid)}static fromISO(e,t={}){let[n,r]=Hn(e);return Qr(n,r,t,`ISO 8601`,e)}static fromRFC2822(e,t={}){let[n,r]=Un(e);return Qr(n,r,t,`RFC 2822`,e)}static fromHTTP(e,t={}){let[n,r]=Wn(e);return Qr(n,r,t,`HTTP`,t)}static fromFormat(t,n,r={}){if($(t)||$(n))throw new s(`fromFormat requires an input string and a format`);let{locale:i=null,numberingSystem:a=null}=r,[o,c,l,u]=Br(G.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),t,n);return u?e.invalid(u):Qr(o,c,r,`format ${n}`,t,l)}static fromString(t,n,r={}){return e.fromFormat(t,n,r)}static fromSQL(e,t={}){let[n,r]=Zn(e);return Qr(n,r,t,`SQL`,e)}static invalid(t,r=null){if(!t)throw new s(`need to specify a reason the DateTime is invalid`);let i=t instanceof Q?t:new Q(t,r);if(Z.throwOnInvalid)throw new n(i);return new e({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){let n=Vr(e,G.fromObject(t));return n?n.map(e=>e?e.val:null).join(``):null}static expandFormat(e,t={}){return Lr(Xt.parseFormat(e),G.fromObject(t)).map(e=>e.val).join(``)}static resetCache(){mi=void 0,hi.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Gr(this).weekYear:NaN}get weekNumber(){return this.isValid?Gr(this).weekNumber:NaN}get weekday(){return this.isValid?Gr(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Kr(this).weekday:NaN}get localWeekNumber(){return this.isValid?Kr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Kr(this).weekYear:NaN}get ordinal(){return this.isValid?Ke(this.c).ordinal:NaN}get monthShort(){return this.isValid?mr.months(`short`,{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?mr.months(`long`,{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?mr.weekdays(`short`,{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?mr.weekdays(`long`,{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:`short`,locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:`long`,locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,t=6e4,n=bt(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),a=this.zone.offset(n-r*t),o=this.zone.offset(n-i*t);if(a===o)return[this];let s=n-a*t,c=n-o*t,l=Yr(s,a),u=Yr(c,o);return l.hour===u.hour&&l.minute===u.minute&&l.second===u.second&&l.millisecond===u.millisecond?[qr(this,{ts:s}),qr(this,{ts:c})]:[this]}get isInLeapYear(){return _t(this.year)}get daysInMonth(){return yt(this.year,this.month)}get daysInYear(){return this.isValid?vt(this.year):NaN}get weeksInWeekYear(){return this.isValid?St(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?St(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:t,numberingSystem:n,calendar:r}=Xt.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(K.instance(e),t)}toLocal(){return this.setZone(Z.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=q(t,Z.defaultZone),t.equals(this.zone))return this;if(t.isValid){let e=this.ts;if(n||r){let n=t.offset(this.ts),r=this.toObject();[e]=Xr(r,n,t)}return qr(this,{ts:e,zone:t})}else return e.invalid(Wr(t))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){let r=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return qr(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let t=Dt(e,li),{minDaysInFirstWeek:n,startOfWeek:r}=Je(t,this.loc),i=!$(t.weekYear)||!$(t.weekNumber)||!$(t.weekday),o=!$(t.ordinal),s=!$(t.year),c=!$(t.month)||!$(t.day),l=s||c,u=t.weekYear||t.weekNumber;if((l||o)&&u)throw new a(`Can't mix weekYear/weekNumber units with year/month/day or ordinals`);if(c&&o)throw new a(`Can't mix ordinal dates with month/day`);let d;i?d=Ge({...We(this.c,n,r),...t},n,r):$(t.ordinal)?(d={...this.toObject(),...t},$(t.day)&&(d.day=Math.min(yt(d.year,d.month),d.day))):d=qe({...Ke(this.c),...t});let[f,p]=Xr(d,this.o,this.zone);return qr(this,{ts:f,o:p})}plus(e){if(!this.isValid)return this;let t=ur.fromDurationLike(e);return qr(this,Zr(this,t))}minus(e){if(!this.isValid)return this;let t=ur.fromDurationLike(e).negate();return qr(this,Zr(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;let n={},r=ur.normalizeUnit(e);switch(r){case`years`:n.month=1;case`quarters`:case`months`:n.day=1;case`weeks`:case`days`:n.hour=0;case`hours`:n.minute=0;case`minutes`:n.second=0;case`seconds`:n.millisecond=0;break}if(r===`weeks`)if(t){let e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(n.weekNumber=this.weekNumber-1),n.weekday=e}else n.weekday=1;return r===`quarters`&&(n.month=(Math.ceil(this.month/3)-1)*3+1),this.set(n)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?Xt.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Hr}toLocaleString(e=f,t={}){return this.isValid?Xt.create(this.loc.clone(t),e).formatDateTime(this):Hr}toLocaleParts(e={}){return this.isValid?Xt.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e=`extended`,suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:i=!1,precision:a=`milliseconds`}={}){if(!this.isValid)return null;a=ci(a);let o=e===`extended`,s=ei(this,o,a);return ai.indexOf(a)>=3&&(s+=`T`),s+=ti(this,o,t,n,r,i,a),s}toISODate({format:e=`extended`,precision:t=`day`}={}){return this.isValid?ei(this,e===`extended`,ci(t)):null}toISOWeekDate(){return $r(this,`kkkk-'W'WW-c`)}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:i=!1,format:a=`extended`,precision:o=`milliseconds`}={}){return this.isValid?(o=ci(o),(r&&ai.indexOf(o)>=3?`T`:``)+ti(this,a===`extended`,t,e,n,i,o)):null}toRFC2822(){return $r(this,`EEE, dd LLL yyyy HH:mm:ss ZZZ`,!1)}toHTTP(){return $r(this.toUTC(),`EEE, dd LLL yyyy HH:mm:ss 'GMT'`)}toSQLDate(){return this.isValid?ei(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r=`HH:mm:ss.SSS`;return(t||e)&&(n&&(r+=` `),t?r+=`z`:e&&(r+=`ZZ`)),$r(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Hr}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t=`milliseconds`,n={}){if(!this.isValid||!e.isValid)return ur.invalid(`created by diffing an invalid DateTime`);let r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=at(t).map(ur.normalizeUnit),a=e.valueOf()>this.valueOf(),o=_r(a?this:e,a?e:this,i,r);return a?o.negate():o}diffNow(t=`milliseconds`,n={}){return this.diff(e.now(),t,n)}until(e){return this.isValid?pr.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;let r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(t={}){if(!this.isValid)return null;let n=t.base||e.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0,i=[`years`,`months`,`days`,`hours`,`minutes`,`seconds`],a=t.unit;return Array.isArray(t.unit)&&(i=t.unit,a=void 0),fi(n,this.plus(r),{...t,numeric:`always`,units:i,unit:a})}toRelativeCalendar(t={}){return this.isValid?fi(t.base||e.fromObject({},{zone:this.zone}),this,{...t,numeric:`auto`,units:[`years`,`months`,`days`],calendary:!0}):null}static min(...t){if(!t.every(e.isDateTime))throw new s(`min requires all arguments be DateTimes`);return ot(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new s(`max requires all arguments be DateTimes`);return ot(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){let{locale:r=null,numberingSystem:i=null}=n;return zr(G.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),e,t)}static fromStringExplain(t,n,r={}){return e.fromFormatExplain(t,n,r)}static buildFormatParser(e,t={}){let{locale:n=null,numberingSystem:r=null}=t;return new Rr(G.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),e)}static fromFormatParser(t,n,r={}){if($(t)||$(n))throw new s(`fromFormatParser requires an input string and a format parser`);let{locale:i=null,numberingSystem:a=null}=r,o=G.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});if(!o.equals(n.locale))throw new s(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);let{result:c,zone:l,specificOffset:u,invalidReason:d}=n.explainFromTokens(t);return d?e.invalid(d):Qr(c,l,r,`format ${n.format}`,t,u)}static get DATE_SHORT(){return f}static get DATE_MED(){return p}static get DATE_MED_WITH_WEEKDAY(){return m}static get DATE_FULL(){return h}static get DATE_HUGE(){return g}static get TIME_SIMPLE(){return _}static get TIME_WITH_SECONDS(){return v}static get TIME_WITH_SHORT_OFFSET(){return y}static get TIME_WITH_LONG_OFFSET(){return b}static get TIME_24_SIMPLE(){return x}static get TIME_24_WITH_SECONDS(){return S}static get TIME_24_WITH_SHORT_OFFSET(){return C}static get TIME_24_WITH_LONG_OFFSET(){return w}static get DATETIME_SHORT(){return T}static get DATETIME_SHORT_WITH_SECONDS(){return E}static get DATETIME_MED(){return D}static get DATETIME_MED_WITH_SECONDS(){return O}static get DATETIME_MED_WITH_WEEKDAY(){return k}static get DATETIME_FULL(){return A}static get DATETIME_FULL_WITH_SECONDS(){return ee}static get DATETIME_HUGE(){return j}static get DATETIME_HUGE_WITH_SECONDS(){return M}};function _i(e){if(gi.isDateTime(e))return e;if(e&&e.valueOf&&$e(e.valueOf()))return gi.fromJSDate(e);if(e&&typeof e==`object`)return gi.fromObject(e);throw new s(`Unknown datetime argument: ${e}, of type ${typeof e}`)}e.DateTime=gi,e.Duration=ur,e.FixedOffsetZone=K,e.IANAZone=ae,e.Info=mr,e.Interval=pr,e.InvalidZone=we,e.Settings=Z,e.SystemZone=F,e.VERSION=`3.7.2`,e.Zone=N})),Z=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;var t=Ie(),n;(function(e){e.Second=`Second`,e.Minute=`Minute`,e.Hour=`Hour`,e.Day=`Day`,e.Month=`Month`,e.Year=`Year`})(n||(e.TimeUnit=n={}));var r;(function(e){e.Add=`Add`,e.Subtract=`Subtract`})(r||(e.DateMathOp=r={})),e.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);var i=class i{#e;#t=null;#n=null;#r={add:{[n.Year]:this.addYear.bind(this),[n.Month]:this.addMonth.bind(this),[n.Day]:this.addDay.bind(this),[n.Hour]:this.addHour.bind(this),[n.Minute]:this.addMinute.bind(this),[n.Second]:this.addSecond.bind(this)},subtract:{[n.Year]:this.subtractYear.bind(this),[n.Month]:this.subtractMonth.bind(this),[n.Day]:this.subtractDay.bind(this),[n.Hour]:this.subtractHour.bind(this),[n.Minute]:this.subtractMinute.bind(this),[n.Second]:this.subtractSecond.bind(this)}};constructor(e,n){let r={zone:n};if(e?e instanceof i?(this.#e=e.#e,this.#t=e.#t,this.#n=e.#n):e instanceof Date?this.#e=t.DateTime.fromJSDate(e,r):typeof e==`number`?this.#e=t.DateTime.fromMillis(e,r):(this.#e=t.DateTime.fromISO(e,r),this.#e.isValid||(this.#e=t.DateTime.fromRFC2822(e,r)),this.#e.isValid||(this.#e=t.DateTime.fromSQL(e,r)),this.#e.isValid||(this.#e=t.DateTime.fromFormat(e,`EEE, d MMM yyyy HH:mm:ss`,r))):this.#e=t.DateTime.local(),!this.#e.isValid)throw Error(`CronDate: unhandled timestamp: ${e}`);n&&n!==this.#e.zoneName&&(this.#e=this.#e.setZone(n))}static#i(e){return e%4==0&&e%100!=0||e%400==0}get dstStart(){return this.#t}set dstStart(e){this.#t=e}get dstEnd(){return this.#n}set dstEnd(e){this.#n=e}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf(`month`)}addDay(){this.#e=this.#e.plus({days:1}).startOf(`day`)}addHour(){this.#e=this.#e.plus({hours:1}).startOf(`hour`)}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf(`minute`)}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf(`month`).startOf(`second`)}subtractDay(){this.#e=this.#e.minus({days:1}).endOf(`day`).startOf(`second`)}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf(`hour`).startOf(`second`)}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf(`minute`).startOf(`second`)}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(e){this.#r.add[e]()}subtractUnit(e){this.#r.subtract[e]()}invokeDateOperation(e,t){if(e===r.Add){this.addUnit(t);return}if(e===r.Subtract){this.subtractUnit(t);return}throw Error(`Invalid verb: ${e}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){let e=this.#e.weekday;return e===7?0:e}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf(`day`)}setEndOfDay(){this.#e=this.#e.endOf(`day`)}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#a().day}getUTCFullYear(){return this.#a().year}getUTCDay(){let e=this.#a().weekday;return e===7?0:e}getUTCMonth(){return this.#a().month-1}getUTCHours(){return this.#a().hour}getUTCMinutes(){return this.#a().minute}getUTCSeconds(){return this.#a().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(e){this.#e=this.#e.set({day:e})}setFullYear(e){this.#e=this.#e.set({year:e})}setDay(e){this.#e=this.#e.set({weekday:e})}setMonth(e){this.#e=this.#e.set({month:e+1})}setHours(e){this.#e=this.#e.set({hour:e})}setMinutes(e){this.#e=this.#e.set({minute:e})}setSeconds(e){this.#e=this.#e.set({second:e})}setMilliseconds(e){this.#e=this.#e.set({millisecond:e})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){let{day:t,month:n}=this.#e;if(n===2){let r=i.#i(this.#e.year);return t===e.DAYS_IN_MONTH[n-1]-+!r}return t===e.DAYS_IN_MONTH[n-1]}isLastWeekdayOfMonth(){let{day:t,month:n}=this.#e,r;return r=n===2?e.DAYS_IN_MONTH[n-1]-+!i.#i(this.#e.year):e.DAYS_IN_MONTH[n-1],t>r-7}applyDateOperation(e,t,r){if(t===n.Month||t===n.Day){this.invokeDateOperation(e,t);return}let i=this.getHours();this.invokeDateOperation(e,t);let a=this.getHours(),o=a-i;o===2?r!==24&&(this.dstStart=a):o===0&&this.getMinutes()===0&&this.getSeconds()===0&&r!==24&&(this.dstEnd=a)}#a(){return this.#e.toUTC()}};e.CronDate=i,e.default=i})),Q=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMonth=void 0;var t=Z(),n=je(),r=1,i=12,a=Object.freeze([]);e.CronMonth=class extends n.CronField{static get min(){return r}static get max(){return i}static get chars(){return a}static get daysInMonth(){return t.DAYS_IN_MONTH}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),Le=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronSecond=void 0;var t=je(),n=0,r=59,i=Object.freeze([]);e.CronSecond=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),Re=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(X(),e),n(Me(),e),n(Ne(),e),n(je(),e),n(Pe(),e),n(Fe(),e),n(Q(),e),n(Le(),e)})),ze=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronFieldCollection=void 0;var t=Re();e.CronFieldCollection=class e{#e;#t;#n;#r;#i;#a;static from(n,r){return new e({second:this.resolveField(t.CronSecond,n.second,r.second),minute:this.resolveField(t.CronMinute,n.minute,r.minute),hour:this.resolveField(t.CronHour,n.hour,r.hour),dayOfMonth:this.resolveField(t.CronDayOfMonth,n.dayOfMonth,r.dayOfMonth),month:this.resolveField(t.CronMonth,n.month,r.month),dayOfWeek:this.resolveField(t.CronDayOfWeek,n.dayOfWeek,r.dayOfWeek)})}static resolveField(e,n,r){return r?r instanceof t.CronField?r:new e(r):n}constructor({second:e,minute:n,hour:r,dayOfMonth:i,month:a,dayOfWeek:o}){if(!e)throw Error(`Validation error, Field second is missing`);if(!n)throw Error(`Validation error, Field minute is missing`);if(!r)throw Error(`Validation error, Field hour is missing`);if(!i)throw Error(`Validation error, Field dayOfMonth is missing`);if(!a)throw Error(`Validation error, Field month is missing`);if(!o)throw Error(`Validation error, Field dayOfWeek is missing`);if(a.values.length===1&&!i.hasLastChar&&!(parseInt(i.values[0],10)<=t.CronMonth.daysInMonth[a.values[0]-1]))throw Error(`Invalid explicit day of month definition`);this.#e=e,this.#t=n,this.#n=r,this.#i=a,this.#a=o,this.#r=i}get second(){return this.#e}get minute(){return this.#t}get hour(){return this.#n}get dayOfMonth(){return this.#r}get month(){return this.#i}get dayOfWeek(){return this.#a}static compactField(e){if(e.length===0)return[];let t=[],n;return e.forEach((e,r,i)=>{if(n===void 0){n={start:e,count:1};return}let a=i[r-1]||n.start,o=i[r+1];if(e===`L`||e===`W`){t.push(n),t.push({start:e,count:1}),n=void 0;return}if(n.step===void 0&&o!==void 0){let t=e-a;if(t<=o-e){n={...n,count:2,end:e,step:t};return}n.step=1}e-(n.end??0)===n.step?(n.count++,n.end=e):(n.count===1?t.push({start:n.start,count:1}):n.count===2?(t.push({start:n.start,count:1}),t.push({start:n.end??a,count:1})):t.push(n),n={start:e,count:1})}),n&&t.push(n),t}static#o(e,t,n){let r=t.step;return r?r===1&&t.start===e.min&&t.end&&t.end>=n?e.hasQuestionMarkChar?`?`:`*`:r!==1&&t.start===e.min&&t.end&&t.end>=n-r+1?`*/${r}`:null:null}static#s(e,t){let n=e.step;if(n===1)return`${e.start}-${e.end}`;let r=e.start===0?e.count-1:e.count;if(!n)throw Error(`Unexpected range step`);if(!e.end)throw Error(`Unexpected range end`);if(n*r>e.end){let t=(t,r)=>{if(typeof e.start!=`number`)throw Error(`Unexpected range start`);return r%n===0?e.start+r:null};if(typeof e.start!=`number`)throw Error(`Unexpected range start`);let r={length:e.end-e.start+1};return Array.from(r,t).filter(e=>e!==null).join(`,`)}return e.end===t-n+1?`${e.start}/${n}`:`${e.start}-${e.end}/${n}`}stringifyField(n){let r=n.max,i=n.values;if(n instanceof t.CronDayOfWeek){r=6;let e=this.#a.values;i=e[e.length-1]===7?e.slice(0,-1):e}n instanceof t.CronDayOfMonth&&(r=this.#i.values.length===1?t.CronMonth.daysInMonth[this.#i.values[0]-1]:n.max);let a=e.compactField(i);if(a.length===1){let t=e.#o(n,a[0],r);if(t)return t}return a.map(i=>{let a=i.count===1?i.start.toString():e.#s(i,r);return n instanceof t.CronDayOfWeek&&n.nthDay>0?`${a}#${n.nthDay}`:a}).join(`,`)}stringify(e=!1){let t=[];return e&&t.push(this.stringifyField(this.#e)),t.push(this.stringifyField(this.#t),this.stringifyField(this.#n),this.stringifyField(this.#r),this.stringifyField(this.#i),this.stringifyField(this.#a)),t.join(` `)}serialize(){return{second:this.#e.serialize(),minute:this.#t.serialize(),hour:this.#n.serialize(),dayOfMonth:this.#r.serialize(),month:this.#i.serialize(),dayOfWeek:this.#a.serialize()}}}})),Be=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpression=e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;var t=Z();e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=`Out of the time span range`,e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=`Invalid expression, loop limit exceeded`;var n=1e4,r=class r{#e;#t;#n;#r;#i;#a;#o=null;#s=!1;constructor(e,n){this.#e=n,this.#t=n.tz,this.#r=n.startDate?new t.CronDate(n.startDate,this.#t):null,this.#i=n.endDate?new t.CronDate(n.endDate,this.#t):null;let r=n.currentDate??n.startDate;if(r){let e=new t.CronDate(r,this.#t);this.#r&&e.getTime()<this.#r.getTime()?r=this.#r:this.#i&&e.getTime()>this.#i.getTime()&&(r=this.#i)}this.#n=new t.CronDate(r,this.#t),this.#a=e}get fields(){return this.#a}static fieldsToExpression(e,t){return new r(e,t||{})}static#c(e,t){return t.some(t=>t===e)}#l(e,t){return e[t?e.length-1:0]}#u(e){let n=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`;if(this.#o===n)return this.#s;let r=new t.CronDate(e);r.setStartOfDay();let i=new t.CronDate(e);return i.setEndOfDay(),this.#o=n,this.#s=r.getUTCOffset()!==i.getUTCOffset(),this.#s}#d(e,n,r){let i=this.#a.second.values,a=e.getSeconds(),o=this.#a.second.findNearestValue(a,r);if(o!==null){e.setSeconds(o);return}e.applyDateOperation(n,t.TimeUnit.Minute,this.#a.hour.values.length),e.setSeconds(this.#l(i,r))}#f(e,n,r){let i=this.#a.minute.values,a=this.#a.second.values,o=e.getMinutes(),s=this.#a.minute.findNearestValue(o,r);if(s!==null){e.setMinutes(s),e.setSeconds(this.#l(a,r));return}e.applyDateOperation(n,t.TimeUnit.Hour,this.#a.hour.values.length),e.setMinutes(this.#l(i,r)),e.setSeconds(this.#l(a,r))}static#p(e,t){let n=t.isLastWeekdayOfMonth();return e.some(e=>{let r=parseInt(e.toString().charAt(0),10)%7;if(Number.isNaN(r))throw Error(`Invalid last weekday of the month expression: ${e}`);return t.getDay()===r&&n})}next(){return this.#_()}prev(){return this.#_(!0)}hasNext(){let e=this.#n;try{return this.#_(),!0}catch{return!1}finally{this.#n=e}}hasPrev(){let e=this.#n;try{return this.#_(!0),!0}catch{return!1}finally{this.#n=e}}take(e){let t=[];if(e>=0)for(let n=0;n<e;n++)try{t.push(this.next())}catch{return t}else for(let n=0;n>e;n--)try{t.push(this.prev())}catch{return t}return t}reset(e){this.#n=new t.CronDate(e||this.#e.currentDate)}stringify(e=!1){return this.#a.stringify(e)}includesDate(e){let{second:n,minute:r,hour:i,month:a}=this.#a,o=new t.CronDate(e,this.#t);return!(!n.values.includes(o.getSeconds())||!r.values.includes(o.getMinutes())||!i.values.includes(o.getHours())||!a.values.includes(o.getMonth()+1)||!this.#m(o)||this.#a.dayOfWeek.nthDay>0&&Math.ceil(o.getDate()/7)!==this.#a.dayOfWeek.nthDay)}toString(){return this.#e.expression||this.stringify(!0)}#m(e){let t=this.#a.dayOfMonth.isWildcard,n=!t,i=this.#a.dayOfWeek.isWildcard,a=!i,o=r.#c(e.getDate(),this.#a.dayOfMonth.values)||this.#a.dayOfMonth.hasLastChar&&e.isLastDayOfMonth(),s=r.#c(e.getDay(),this.#a.dayOfWeek.values)||this.#a.dayOfWeek.hasLastChar&&r.#p(this.#a.dayOfWeek.values,e);return!!(n&&a&&(o||s)||o&&!a||t&&!i&&s)}#h(e,n,i){let a=this.#a.hour.values,o=a,s=e.getHours(),c=r.#c(s,a),l=e.dstStart===s,u=e.dstEnd===s;if(l)return r.#c(s-1,a)?!0:(e.invokeDateOperation(n,t.TimeUnit.Hour),!1);if(u&&!i)return e.dstEnd=null,e.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Hour,o.length),!1;if(c)return!0;e.dstStart=null;let d=this.#a.hour.findNearestValue(s,i);if(d===null)return e.applyDateOperation(n,t.TimeUnit.Day,o.length),!1;if(this.#u(e)){let r=i?s-d:d-s;for(let i=0;i<r;i++)e.applyDateOperation(n,t.TimeUnit.Hour,o.length)}else e.setHours(d);return e.setMinutes(this.#l(this.#a.minute.values,i)),e.setSeconds(this.#l(this.#a.second.values,i)),!1}#g(t){if(!this.#r&&!this.#i)return;let n=t.getTime();if(this.#r&&n<this.#r.getTime()||this.#i&&n>this.#i.getTime())throw Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#_(i=!1){let a=i?t.DateMathOp.Subtract:t.DateMathOp.Add,o=new t.CronDate(this.#n),s=o.getTime(),c=0;for(;++c<n;){if(this.#g(o),!this.#m(o)){o.applyDateOperation(a,t.TimeUnit.Day,this.#a.hour.values.length);continue}if(!(this.#a.dayOfWeek.nthDay<=0||Math.ceil(o.getDate()/7)===this.#a.dayOfWeek.nthDay)){o.applyDateOperation(a,t.TimeUnit.Day,this.#a.hour.values.length);continue}if(!r.#c(o.getMonth()+1,this.#a.month.values)){o.applyDateOperation(a,t.TimeUnit.Month,this.#a.hour.values.length);continue}if(this.#h(o,a,i)){if(!r.#c(o.getMinutes(),this.#a.minute.values)){this.#f(o,a,i);continue}if(!r.#c(o.getSeconds(),this.#a.second.values)){this.#d(o,a,i);continue}if(s===o.getTime()){(a===`Add`||o.getMilliseconds()===0)&&o.applyDateOperation(a,t.TimeUnit.Second,this.#a.hour.values.length);continue}break}}if(c>n)throw Error(e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return o.getMilliseconds()!==0&&o.setMilliseconds(0),this.#n=o,o}[Symbol.iterator](){return{next:()=>({value:this.#_(),done:!this.hasNext()})}}};e.CronExpression=r,e.default=r})),Ve=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.seededRandom=r;function t(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return()=>t>>>0}function n(e){return()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function r(e){return n(e?t(e)():Math.floor(Math.random()*1e10))}})),He=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpressionParser=e.DayOfWeek=e.Months=e.CronUnit=e.PredefinedExpressions=void 0;var t=ze(),n=Be(),r=Ve(),i=Re(),a;(function(e){e[`@yearly`]=`0 0 0 1 1 *`,e[`@annually`]=`0 0 0 1 1 *`,e[`@monthly`]=`0 0 0 1 * *`,e[`@weekly`]=`0 0 0 * * 0`,e[`@daily`]=`0 0 0 * * *`,e[`@hourly`]=`0 0 * * * *`,e[`@minutely`]=`0 * * * * *`,e[`@secondly`]=`* * * * * *`,e[`@weekdays`]=`0 0 0 * * 1-5`,e[`@weekends`]=`0 0 0 * * 0,6`})(a||(e.PredefinedExpressions=a={}));var o;(function(e){e.Second=`Second`,e.Minute=`Minute`,e.Hour=`Hour`,e.DayOfMonth=`DayOfMonth`,e.Month=`Month`,e.DayOfWeek=`DayOfWeek`})(o||(e.CronUnit=o={}));var s;(function(e){e[e.jan=1]=`jan`,e[e.feb=2]=`feb`,e[e.mar=3]=`mar`,e[e.apr=4]=`apr`,e[e.may=5]=`may`,e[e.jun=6]=`jun`,e[e.jul=7]=`jul`,e[e.aug=8]=`aug`,e[e.sep=9]=`sep`,e[e.oct=10]=`oct`,e[e.nov=11]=`nov`,e[e.dec=12]=`dec`})(s||(e.Months=s={}));var c;(function(e){e[e.sun=0]=`sun`,e[e.mon=1]=`mon`,e[e.tue=2]=`tue`,e[e.wed=3]=`wed`,e[e.thu=4]=`thu`,e[e.fri=5]=`fri`,e[e.sat=6]=`sat`})(c||(e.DayOfWeek=c={})),e.CronExpressionParser=class e{static parse(s,c={}){let{strict:l=!1,hashSeed:u}=c,d=(0,r.seededRandom)(u);s=a[s]||s;let f=e.#e(s,l);if(!(f.dayOfMonth===`*`||f.dayOfWeek===`*`||!l))throw Error(`Cannot use both dayOfMonth and dayOfWeek together in strict mode!`);let p=e.#t(o.Second,f.second,i.CronSecond.constraints,d),m=e.#t(o.Minute,f.minute,i.CronMinute.constraints,d),h=e.#t(o.Hour,f.hour,i.CronHour.constraints,d),g=e.#t(o.Month,f.month,i.CronMonth.constraints,d),_=e.#t(o.DayOfMonth,f.dayOfMonth,i.CronDayOfMonth.constraints,d),{dayOfWeek:v,nthDayOfWeek:y}=e.#u(f.dayOfWeek),b=e.#t(o.DayOfWeek,v,i.CronDayOfWeek.constraints,d),x=new t.CronFieldCollection({second:new i.CronSecond(p,{rawValue:f.second}),minute:new i.CronMinute(m,{rawValue:f.minute}),hour:new i.CronHour(h,{rawValue:f.hour}),dayOfMonth:new i.CronDayOfMonth(_,{rawValue:f.dayOfMonth}),month:new i.CronMonth(g,{rawValue:f.month}),dayOfWeek:new i.CronDayOfWeek(b,{rawValue:f.dayOfWeek,nthDayOfWeek:y})});return new n.CronExpression(x,{...c,expression:s})}static#e(e,t){if(t&&!e.length)throw Error(`Invalid cron expression`);e||=`0 * * * * *`;let n=e.trim().split(/\s+/);if(t&&n.length<6)throw Error(`Invalid cron expression, expected 6 fields`);if(n.length>6)throw Error(`Invalid cron expression, too many fields`);let r=[`*`,`*`,`*`,`*`,`*`,`0`];n.length<r.length&&n.unshift(...r.slice(n.length));let[i,a,o,s,c,l]=n;return{second:i,minute:a,hour:o,dayOfMonth:s,month:c,dayOfWeek:l}}static#t(e,t,n,r){if((e===o.Month||e===o.DayOfWeek)&&(t=t.replace(/[a-z]{3}/gi,e=>{e=e.toLowerCase();let t=s[e]||c[e];if(t===void 0)throw Error(`Validation error, cannot resolve alias "${e}"`);return t.toString()})),!n.validChars.test(t))throw Error(`Invalid characters, got value: ${t}`);return t=this.#n(t,n),t=this.#r(t,n,r),this.#i(e,t,n)}static#n(e,t){return e.replace(/[*?]/g,t.min+`-`+t.max)}static#r(e,t,n){let r=n();return e.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(e,n,i,a)=>{if(n&&i&&a){let e=parseInt(n,10),o=parseInt(i,10),s=parseInt(a,10);if(e>o)throw Error(`Invalid range: ${e}-${o}, min > max`);if(s<=0)throw Error(`Invalid step: ${s}, must be positive`);let c=Math.max(e,t.min),l=Math.floor(r*s),u=[];for(let e=Math.floor(c/s)*s+l;e<=o;e+=s)e>=c&&u.push(e);return u.join(`,`)}else if(n&&i){let e=parseInt(n,10),t=parseInt(i,10);if(e>t)throw Error(`Invalid range: ${e}-${t}, min > max`);return String(Math.floor(r*(t-e+1))+e)}else if(a){let e=parseInt(a,10);if(e<=0)throw Error(`Invalid step: ${e}, must be positive`);let n=Math.floor(r*e),i=[];for(let r=Math.floor(t.min/e)*e+n;r<=t.max;r+=e)r>=t.min&&i.push(r);return i.join(`,`)}else return String(Math.floor(r*(t.max-t.min+1)+t.min))})}static#i(t,n,r){let i=[];function a(n,r){if(Array.isArray(n))i.push(...n);else if(e.#d(r,n))i.push(n);else{let e=parseInt(n.toString(),10);if(!(e>=r.min&&e<=r.max))throw Error(`Constraint error, got value ${n} expected range ${r.min}-${r.max}`);i.push(t===o.DayOfWeek?e%7:n)}}return n.split(`,`).forEach(n=>{if(!(n.length>0))throw Error(`Invalid list value format`);a(e.#a(t,n,r),r)}),i}static#a(t,n,r){let i=n.split(`/`);if(i.length>2)throw Error(`Invalid repeat: ${n}`);return i.length===2?(isNaN(parseInt(i[0],10))||(i[0]=`${i[0]}-${r.max}`),e.#l(t,i[0],parseInt(i[1],10),r)):e.#l(t,n,1,r)}static#o(e,t,n){if(!(!isNaN(e)&&!isNaN(t)&&e>=n.min&&t<=n.max))throw Error(`Constraint error, got range ${e}-${t} expected range ${n.min}-${n.max}`);if(e>t)throw Error(`Invalid range: ${e}-${t}, min(${e}) > max(${t})`)}static#s(e){if(!(!isNaN(e)&&e>0))throw Error(`Constraint error, cannot repeat at every ${e} time.`)}static#c(e,t,n,r){let i=[];e===o.DayOfWeek&&n%7==0&&i.push(0);for(let e=t;e<=n;e+=r)i.indexOf(e)===-1&&i.push(e);return i}static#l(e,t,n,r){let i=t.split(`-`);if(i.length<=1)return isNaN(+t)?t:+t;let[a,o]=i.map(e=>parseInt(e,10));return this.#o(a,o,r),this.#s(n),this.#c(e,a,o,n)}static#u(e){let t=e.split(`#`);if(t.length<=1)return{dayOfWeek:t[0]};let n=+t[t.length-1],r=e.match(/([,-/])/);if(r!==null)throw Error(`Constraint error, invalid dayOfWeek \`#\` and \`${r?.[0]}\` special characters are incompatible`);if(!(t.length<=2&&!isNaN(n)&&n>=1&&n<=5))throw Error(`Constraint error, invalid dayOfWeek occurrence number (#)`);return{dayOfWeek:t[0],nthDayOfWeek:n}}static#d(e,t){return e.chars.some(e=>t.toString().includes(e))}}})),Ue=t(((e,t)=>{t.exports={}})),We=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})();Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=void 0;var i=He();e.CronFileParser=class e{static async parseFile(t){let{readFile:n}=await Promise.resolve().then(()=>r(Ue())),i=await n(t,`utf8`);return e.#e(i)}static parseFileSync(t){let{readFileSync:n}=Ue(),r=n(t,`utf8`);return e.#e(r)}static#e(t){let n=t.split(`
2
+ `),r={variables:{},expressions:[],errors:{}};for(let t of n){let n=t.trim();if(n.length===0||n.startsWith(`#`))continue;let i=n.match(/^(.*)=(.*)$/);if(i){let[,e,t]=i;r.variables[e]=t.replace(/["']/g,``);continue}try{let t=e.#t(n);r.expressions.push(t.interval)}catch(e){r.errors[n]=e}}return r}static#t(e){let t=e.split(` `);return{interval:i.CronExpressionParser.parse(t.slice(0,5).join(` `)),command:t.slice(5,t.length)}}}})),Ge=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;var r=He(),i=Z();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return i.CronDate}});var a=ze();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return a.CronFieldCollection}});var o=Be();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return o.CronExpression}});var s=He();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return s.CronExpressionParser}});var c=We();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return c.CronFileParser}}),n(Re(),e),e.default=r.CronExpressionParser}))();function Ke(e){return Array.isArray(e)?e.filter(e=>typeof e==`number`).sort((e,t)=>e-t):[]}function qe(e){if(e.length<2)return null;let t=e[1]-e[0];if(t<=0)return null;for(let n=2;n<e.length;n++)if(e[n]-e[n-1]!==t)return null;return t}function Je(e,t,n){let r=new Date;return r.setHours(e,t,0,0),r.toLocaleTimeString(n,{hour:`numeric`,minute:`2-digit`})}function Ye(e,t){let n=e===7?0:e;return new Date(Date.UTC(2023,0,1)+n*864e5).toLocaleDateString(t,{weekday:`short`,timeZone:`UTC`})}function Xe(e,t){return e.length<=1?e[0]??``:t.startsWith(`zh`)?e.join(`、`):e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(`, `)}, and ${e.at(-1)}`}function Ze(e){return e.length===5&&e.every((e,t)=>e===t+1)}function Qe(e){if(e.length!==2)return!1;let t=[...e].toSorted((e,t)=>e-t);return t[0]===0&&t[1]===6}function $(e,t,n,r){try{let i=Ge.CronExpressionParser.parse(e,{...r?.timezone?{tz:r.timezone}:{}}).fields,a=Ke(i.minute.values),o=Ke(i.hour.values),s=Ke(i.dayOfWeek.values),c=Ke(i.dayOfMonth.values);if(a.length===60&&i.hour.isWildcard&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard)return n.everyMinute;if(!i.minute.isWildcard&&i.hour.isWildcard&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard&&a.length>1){let e=qe(a);if(e!=null&&e>0)return n.everyNMinutes.replace(`{{n}}`,String(e))}if(!i.minute.isWildcard&&a.length===1&&!i.hour.isWildcard&&o.length>1&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard){let e=qe(o);if(e!=null&&e>0)return n.everyNHours.replace(`{{n}}`,String(e))}if(!i.minute.isWildcard&&a.length===1&&i.hour.isWildcard&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard&&o.length===24)return n.hourly;let l=!i.minute.isWildcard&&a.length===1&&!i.hour.isWildcard&&o.length===1?Je(o[0],a[0],t):``;if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&i.dayOfWeek.isWildcard)return n.dailyAt.replace(`{{time}}`,l);if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&Ze(s))return n.weekdaysAt.replace(`{{time}}`,l);if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&Qe(s))return n.weekendsAt.replace(`{{time}}`,l);if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&s.length===1){let e=Ye(s[0],t);return n.weeklyOn.replace(`{{day}}`,e).replace(`{{time}}`,l)}if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&s.length>1){let e=Xe(s.map(e=>Ye(e,t)),t);return n.daysAt.replace(`{{days}}`,e).replace(`{{time}}`,l)}return l&&!i.dayOfMonth.isWildcard&&c.length===1&&i.month.isWildcard&&i.dayOfWeek.isWildcard?n.monthlyAt.replace(`{{day}}`,String(c[0])).replace(`{{time}}`,l):n.customSchedule}catch{return null}}function $e(e,t,n,r){let i=e.trim();return i?$(i,t,n,r)||et(r?.nextRun,t)||n.customSchedule:et(r?.nextRun,t)||`—`}function et(e,t){if(!e)return``;let n=new Date(e);return Number.isNaN(n.getTime())?``:n.toLocaleString(t,{weekday:`short`,hour:`numeric`,minute:`2-digit`})}var tt=1e3,nt=60*tt,rt=60*nt,it=24*rt,at=7*it,ot=new Intl.ListFormat(`en-US`,{type:`conjunction`}),st=Object.fromEntries([`second`,`minute`,`hour`,`day`,`week`].map(e=>[e,new Intl.NumberFormat(`en-US`,{style:`unit`,unit:e,unitDisplay:`long`})])),ct={en:new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),zh:new Intl.DateTimeFormat(`zh-CN`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})},lt={en:new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`}),zh:new Intl.DateTimeFormat(`zh-CN`,{hour:`2-digit`,minute:`2-digit`})},ut={minute:nt,hour:rt,day:it,week:at};function dt(e){return e===`zh`?`zh-CN`:`en-US`}function ft(e,t,n){return n===`zh`?`${e} ${t===`week`?`周`:t===`day`?`天`:t===`hour`?`小时`:t===`minute`?`分钟`:`秒`}`:st[String(t)].format(e)}function pt(e,t){return t===`zh`?e.join(` `):ot.format(e)}function mt(e,t){let n=typeof e==`number`?e:Number.parseFloat(e);return Math.max(nt,Math.round((Number.isFinite(n)&&n>0?n:1)*ut[t]))}function ht(e,t,n){let r=typeof e==`number`?e:Number.parseFloat(e),i=Number.isFinite(r)&&r>0?r:1;return String(Number.parseFloat((i*ut[t]/ut[n]).toFixed(6)))}function gt(e,t){let n=Math.max(tt,Math.round(e)),r=n===it?[{unit:`hour`,ms:rt}]:n>=at&&n%at===0?[{unit:`week`,ms:at}]:n>=it?[{unit:`day`,ms:it},{unit:`hour`,ms:rt},{unit:`minute`,ms:nt},{unit:`second`,ms:tt}]:n>=rt?[{unit:`hour`,ms:rt},{unit:`minute`,ms:nt},{unit:`second`,ms:tt}]:n>=nt?[{unit:`minute`,ms:nt},{unit:`second`,ms:tt}]:[{unit:`second`,ms:tt}],i=n,a=[];for(let{unit:e,ms:n}of r){let r=Math.floor(i/n);r<=0||(a.push(ft(r,e,t)),i%=n)}return pt(a,t)}function _t(e,t){let n=gt(e,t);return t===`zh`?`每 ${n}运行一次`:`Runs every ${n}`}function vt(e,t){return ct[t].format(new Date(e))}function yt(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())}function bt(e,t,n=Date.now()){let r=new Date(e),i=Math.round((yt(r)-yt(new Date(n)))/it),a=lt[t].format(r);return i===0?t===`zh`?`今天 ${a}`:`today at ${a}`:i===1?t===`zh`?`明天 ${a}`:`tomorrow at ${a}`:i===-1?t===`zh`?`昨天 ${a}`:`yesterday at ${a}`:vt(e,t)}function xt(e,t){return e.eventType===`task.attention_required.v2`&&e.payloadMatch?.reason===`blocked`?t.trigger.taskBlockedWhen:e.eventType===`note.created`?t.trigger.noteCreatedWhen:e.eventType===`workflow.run.completed`&&e.payloadMatch?.status===`failed`?t.trigger.workflowFailedWhen:e.eventType===`session.transcript.updated`?t.trigger.sessionUpdatedWhen:t.trigger.eventWithType.replace(`{type}`,e.eventType)}function St(e,t,n,r){if(e.kind===`manual`)return t.trigger.manualWhen;if(e.kind===`webhook`)return t.trigger.webhookWhen;if(e.kind===`event`)return xt(e,t);let i=e.schedule;return i.kind===`once`?t.trigger.onceAt.replace(`{time}`,bt(Date.parse(i.at),r)):i.kind===`interval`?_t(i.everyMs,r):$e(i.expr,dt(r),n.scheduleBadge,{timezone:i.tz})}function Ct(e,t,n,r=Date.now()){return e.enabled?e.state.nextRunAtMs?bt(e.state.nextRunAtMs,n,r):e.trigger.kind===`manual`?t.info.noAutomaticTrigger:e.trigger.kind===`event`||e.trigger.kind===`webhook`?t.info.waitingForTrigger:t.info.noUpcomingRun:t.info.pausedNoAutomaticRuns}function wt(e,t,n,r=Date.now()){if(!e.state.lastRunAtMs)return t.info.notRunYet;let i=bt(e.state.lastRunAtMs,n,r),a=e.state.lastRunStatus;return a?`${i} · ${t.status[a]}`:i}var Tt={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:``,instruction:``,workflowId:``,workflowGoal:``,workflowInput:{goal:``,argValues:{},schemaInput:{},concurrency:``,maxSubagents:``},workflowInputValid:!0,browserAutomationId:``,browserAutomationInputs:{},safetyMode:`suggest_only`,timeoutSeconds:`1800`,conversationMode:`new_session`,notificationPolicy:`attention`,completionWebhookUrl:``,disableAfterFailures:`3`},Et=[{value:`15`,unit:`minute`},{value:`30`,unit:`minute`},{value:`1`,unit:`hour`},{value:`6`,unit:`hour`},{value:`24`,unit:`hour`}];function Dt(e,t){let[n,r]=e.time.split(`:`),i=Number.parseInt(n||`9`,10),a=Number.parseInt(r||`0`,10),o;if(e.triggerMode===`manual`)o={kind:`manual`};else if(e.triggerMode===`once`)o={kind:`schedule`,schedule:{kind:`once`,at:new Date(e.onceAt).toISOString()}};else if(e.triggerMode===`webhook`)o={kind:`webhook`,...e.webhookSecretId.trim()?{secretId:e.webhookSecretId.trim()}:{}};else if(e.triggerMode===`taskBlocked`)o={kind:`event`,eventType:`task.attention_required.v2`,source:`tasks`,payloadMatch:{reason:`blocked`}};else if(e.triggerMode===`noteCreated`)o={kind:`event`,eventType:`note.created`,source:`notes`};else if(e.triggerMode===`workflowFailed`)o={kind:`event`,eventType:`workflow.run.completed`,source:`workflows`,payloadMatch:{status:`failed`}};else if(e.triggerMode===`sessionUpdated`)o={kind:`event`,eventType:`session.transcript.updated`,source:`sessions`};else if(e.triggerMode===`event`){let t=e.eventPayloadMatch.trim()?JSON.parse(e.eventPayloadMatch):void 0;o={kind:`event`,eventType:e.eventType.trim(),...e.eventSource.trim()?{source:e.eventSource.trim()}:{},...t?{payloadMatch:t}:{}}}else o=e.triggerMode===`interval`?{kind:`schedule`,schedule:{kind:`interval`,everyMs:mt(e.intervalValue,e.intervalUnit)}}:e.triggerMode===`weekly`?{kind:`schedule`,schedule:{kind:`cron`,expr:`${a} ${i} * * ${e.weekday}`}}:e.triggerMode===`cron`?{kind:`schedule`,schedule:{kind:`cron`,expr:e.cronExpr.trim()}}:{kind:`schedule`,schedule:{kind:`cron`,expr:`${a} ${i} * * *`}};let s=W(t,e.workflowInput),c=e.workflowInput.goal.trim()||e.workflowGoal.trim(),l=e.actionMode===`browser_automation`?`auto_apply`:e.safetyMode,u;return u=e.actionMode===`workflow`?{kind:`workflow`,workflowId:e.workflowId.trim(),...e.agentId.trim()?{agentId:e.agentId.trim()}:{},...s===void 0?{}:{input:s},...c?{goal:c}:{},...e.workflowInput.concurrency.trim()?{concurrency:Math.max(1,Number.parseInt(e.workflowInput.concurrency,10)||1)}:{},...e.workflowInput.maxSubagents.trim()?{maxSubagents:Math.max(1,Number.parseInt(e.workflowInput.maxSubagents,10)||1)}:{}}:e.actionMode===`browser_automation`?{kind:`browser_automation`,automationId:e.browserAutomationId.trim(),inputs:e.browserAutomationInputs}:{kind:`agent`,instruction:e.instruction.trim(),...e.agentId.trim()?{agentId:e.agentId.trim()}:{}},{name:e.name.trim(),...e.description.trim()?{description:e.description.trim()}:{},...e.projectId.trim()?{projectId:e.projectId.trim()}:{},trigger:o,action:u,safety:{mode:l},conversationMode:e.conversationMode,notificationPolicy:e.notificationPolicy,...l===`auto_apply`&&e.completionWebhookUrl.trim()?{completionWebhookUrl:e.completionWebhookUrl.trim()}:{},reliability:{executionTimeoutSeconds:Math.max(1,Number.parseInt(e.timeoutSeconds,10)||1800),disableAfterConsecutiveFailures:Math.max(1,Number.parseInt(e.disableAfterFailures,10)||3)}}}function Ot(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:Tt.time,weekday:Tt.weekday,cronExpr:e}}function kt(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 At(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 jt(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===`workflow.run.completed`&&e.source===`workflows`&&t?.status===`failed`?{triggerMode:`workflowFailed`}: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 Mt(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function Nt(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 Pt(e,t=[]){let n={triggerMode:`manual`};if(e.trigger.kind===`webhook`)n={triggerMode:`webhook`,webhookSecretId:e.trigger.secretId??``};else if(e.trigger.kind===`event`)n=jt(e.trigger);else if(e.trigger.kind===`schedule`){let t=e.trigger.schedule;t.kind===`cron`&&(n=Ot(t.expr)),t.kind===`interval`&&(n={triggerMode:`interval`,...kt(t.everyMs)}),t.kind===`once`&&(n={triggerMode:`once`,onceAt:At(t.at)})}let r=e.action,i=r.kind===`workflow`?t.find(e=>e.id===r.workflowId)??null:null,a=r.kind===`workflow`?Mt(r.input):{},o=e.reliability?.executionTimeoutSeconds??r.timeoutSeconds??e.reliability?.timeoutSeconds??(r.kind===`browser_automation`?600:1800);return{...Tt,...n,name:e.name,description:e.description??``,projectId:e.projectId??``,actionMode:r.kind,agentId:r.kind===`browser_automation`?``:r.agentId??``,instruction:r.kind===`agent`?r.instruction:``,workflowId:r.kind===`workflow`?r.workflowId:``,workflowGoal:r.kind===`workflow`?r.goal??``:``,browserAutomationId:r.kind===`browser_automation`?r.automationId:``,browserAutomationInputs:r.kind===`browser_automation`?r.inputs??{}:{},workflowInput:{goal:r.kind===`workflow`?r.goal??``:``,argValues:i?U(i.name,a):{},schemaInput:a,concurrency:r.kind===`workflow`&&r.concurrency?String(r.concurrency):``,maxSubagents:r.kind===`workflow`&&r.maxSubagents?String(r.maxSubagents):``},workflowInputValid:!0,safetyMode:e.safety?.mode??`auto_apply`,timeoutSeconds:String(o),conversationMode:e.conversationMode??`new_session`,notificationPolicy:e.notificationPolicy??`attention`,completionWebhookUrl:e.completionWebhookUrl??``,disableAfterFailures:String(e.reliability?.disableAfterConsecutiveFailures??3)}}function Ft(e,t,n){let r=Dt(t,n),i=e.trigger.kind===`schedule`&&r.trigger.kind===`schedule`&&e.trigger.schedule.kind===r.trigger.schedule.kind?{...r.trigger,schedule:{...e.trigger.schedule,...r.trigger.schedule}}:r.trigger,a=r.action;return e.action.kind===`agent`&&r.action.kind===`agent`?a={...e.action,...r.action,agentId:r.action.agentId}:e.action.kind===`workflow`&&r.action.kind===`workflow`?a={...e.action,...r.action,agentId:r.action.agentId,input:r.action.input,goal:r.action.goal,concurrency:r.action.concurrency,maxSubagents:r.action.maxSubagents}:e.action.kind===`browser_automation`&&r.action.kind===`browser_automation`&&(a={...e.action,...r.action}),{...r,description:t.description.trim(),projectId:t.projectId.trim(),completionWebhookUrl:t.completionWebhookUrl.trim(),trigger:i,action:a,reliability:{...e.reliability,...r.reliability}}}function It(e){return[`reminder`,`brief`,`review`,`followUp`].map(t=>{let n=e.scenarios[t];return{...n,requiresProject:t===`followUp`,form:{...Tt,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 Lt=`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 Rt(e){let t=(0,we.c)(99),{form:n,setForm:r,labels:i,projects:a,projectLocked:o,source:s,requiresProject:c}=e,u;t[0]===r?u=t[1]:(u=e=>r(t=>({...t,...e})),t[0]=r,t[1]=u);let f=u,p;t[2]!==i.experience.source||t[3]!==s?(p=(0,J.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]===f?m=t[6]:(m=e=>f({name:e.target.value}),t[5]=f,t[6]=m);let h;t[7]!==n.name||t[8]!==m?(h=(0,J.jsx)(`input`,{className:Lt,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,J.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]===f?_=t[14]:(_=e=>f({instruction:e.target.value}),t[13]=f,t[14]=_);let v;t[15]!==n.instruction||t[16]!==_?(v=(0,J.jsx)(`textarea`,{className:Lt,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,J.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]!==f?(b=!o&&(0,J.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.project,(0,J.jsxs)(l,{className:Lt,value:n.projectId,onChange:e=>f({projectId:e.target.value}),children:[(0,J.jsx)(d,{value:``,children:i.form.noProject}),a.map(zt)]})]}),t[21]=n.projectId,t[22]=i.form.noProject,t[23]=i.form.project,t[24]=o,t[25]=a,t[26]=f,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,J.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]===f?S=t[33]:(S=e=>f({triggerMode:e.target.value}),t[32]=f,t[33]=S);let C;t[34]===i.trigger.once?C=t[35]:(C=(0,J.jsx)(d,{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,J.jsx)(d,{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,J.jsx)(d,{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,J.jsxs)(l,{className:Lt,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,J.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]!==f?(O=n.triggerMode===`once`?(0,J.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.onceAt,(0,J.jsx)(`input`,{type:`datetime-local`,className:Lt,value:n.onceAt,onChange:e=>f({onceAt:e.target.value})})]}):(0,J.jsxs)(`div`,{className:`grid gap-2 text-sm text-fg`,children:[(0,J.jsx)(`span`,{children:i.form.time}),(0,J.jsx)(Oe,{value:n.time,onChange:e=>f({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]=f,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]!==f?(k=n.triggerMode===`weekly`&&(0,J.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.day,(0,J.jsx)(l,{className:Lt,value:n.weekday,onChange:e=>f({weekday:e.target.value}),children:[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`].map((e,t)=>(0,J.jsx)(d,{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]=f,t[61]=k):k=t[61];let A;t[62]!==D||t[63]!==O||t[64]!==k?(A=(0,J.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 ee;t[66]!==n.onceAt||t[67]!==n.triggerMode||t[68]!==i.experience.futureTime?(ee=n.triggerMode===`once`&&n.onceAt&&new Date(n.onceAt).getTime()<=Date.now()?(0,J.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]=ee):ee=t[69];let j;t[70]===i.experience.scheduleNote?j=t[71]:(j=(0,J.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i.experience.scheduleNote}),t[70]=i.experience.scheduleNote,t[71]=j);let M;t[72]===f?M=t[73]:(M=e=>f({notificationPolicy:e.target.value}),t[72]=f,t[73]=M);let N;t[74]===i.draft.notifyAll?N=t[75]:(N=(0,J.jsx)(d,{value:`all`,children:i.draft.notifyAll}),t[74]=i.draft.notifyAll,t[75]=N);let P;t[76]===i.draft.notifyAttention?P=t[77]:(P=(0,J.jsx)(d,{value:`attention`,children:i.draft.notifyAttention}),t[76]=i.draft.notifyAttention,t[77]=P);let F;t[78]===i.draft.notifyNone?F=t[79]:(F=(0,J.jsx)(d,{value:`none`,children:i.draft.notifyNone}),t[78]=i.draft.notifyNone,t[79]=F);let I;t[80]!==n.notificationPolicy||t[81]!==M||t[82]!==N||t[83]!==P||t[84]!==F?(I=(0,J.jsxs)(l,{className:Lt,value:n.notificationPolicy,onChange:M,children:[N,P,F]}),t[80]=n.notificationPolicy,t[81]=M,t[82]=N,t[83]=P,t[84]=F,t[85]=I):I=t[85];let L;t[86]!==i.draft.notifications||t[87]!==I?(L=(0,J.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]!==ee||t[93]!==j||t[94]!==L||t[95]!==g||t[96]!==y||t[97]!==b?(te=(0,J.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,ee,j,L]}),t[89]=x,t[90]=A,t[91]=p,t[92]=ee,t[93]=j,t[94]=L,t[95]=g,t[96]=y,t[97]=b,t[98]=te):te=t[98],te}function zt(e){return(0,J.jsx)(d,{value:e.id,children:e.name},e.id)}function Bt(e,t){return t.reduce((t,n)=>n.automationId===e&&(!t||n.createdAtMs>t.createdAtMs)?n:t,void 0)}function Vt(e,t){let n=Bt(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 Ht(e,t){return Vt(e,t)!==null}var Ut=`xopc.automations.dismissedExecutionIssues`;function Wt(){if(typeof window>`u`)return{};try{let e=JSON.parse(window.localStorage.getItem(Ut)??`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return{}}}function Gt(e,t,n){return e?vt(e,n):t.never}function Kt(e,t){return e.kind===`workflow`?t.action.workflowWithId.replace(`{id}`,e.workflowId):e.kind===`browser_automation`?`Browser automation: ${e.automationId}`:e.agentId?t.action.agentWithId.replace(`{id}`,e.agentId):t.action.agent}function qt(e){return e.safety?.mode??`auto_apply`}function Jt(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 Yt(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 Xt(e){return e.status===`running`||e.status===`queued`||e.status===`cancelling`}function Zt(e){return e.status===`failed`||e.status===`timeout`}function Qt(e,t){return e.action.kind===`agent`?e.action.instruction:e.action.kind===`workflow`&&e.action.goal?.trim()||Kt(e.action,t)}function $t(e){return(e.description?.match(/\[managed-by=([^\]]+)\]/))?.[1]?.trim()||null}function en(e){return!!$t(e)}function tn(e){return e.description?.replace(/\s*\[managed-by=[^\]]+\]\s*/g,` `).trim()??``}function nn(e){return Xt(e)?0:Zt(e)?1:e.status===`succeeded`?2:3}function rn(e){return[...e].sort((e,t)=>{let n=nn(e)-nn(t);return n===0?t.createdAtMs-e.createdAtMs:n})}function an(){let e=(0,we.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,J.jsx)(O,{className:`h-4 w-36`}),(0,J.jsx)(O,{className:`h-3 w-56 max-w-full`})]}),(0,J.jsx)(O,{className:`h-7 w-20 rounded-full`})]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,J.jsxs)(`section`,{className:`rounded-xl bg-surface-panel p-4 shadow-surface`,children:[t,(0,J.jsx)(`div`,{className:`mt-4 grid gap-2`,children:Array.from({length:6}).map(on)})]}),e[1]=n):n=e[1];let r,i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(O,{className:`h-4 w-32`}),i=(0,J.jsx)(O,{className:`mt-4 h-24 rounded-lg`}),e[2]=r,e[3]=i):(r=e[2],i=e[3]);let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(`div`,{className:`grid gap-4`,"aria-hidden":`true`,children:(0,J.jsxs)(`div`,{className:`grid gap-3 xl:grid-cols-[minmax(0,1fr)_26rem]`,children:[n,(0,J.jsxs)(`section`,{className:`hidden rounded-xl bg-surface-panel p-4 shadow-surface xl:block`,children:[r,i,(0,J.jsxs)(`div`,{className:`mt-4 grid gap-2`,children:[(0,J.jsx)(O,{className:`h-12 rounded-lg`}),(0,J.jsx)(O,{className:`h-12 rounded-lg`}),(0,J.jsx)(O,{className:`h-12 rounded-lg`})]})]})]})}),e[4]=a):a=e[4],a}function on(e,t){return(0,J.jsx)(`div`,{className:`rounded-lg bg-surface-base p-3`,children:(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(O,{className:`size-4 rounded-full`}),(0,J.jsx)(O,{className:`h-4 w-32`}),(0,J.jsx)(O,{className:`h-5 w-20 rounded-full`})]}),(0,J.jsx)(O,{className:`mt-3 h-4 w-full`}),(0,J.jsx)(O,{className:`mt-2 h-4 w-3/5`})]}),(0,J.jsx)(O,{className:`h-8 w-24 rounded-md`})]})},t)}function sn({projectId:e,embedded:t=!1,title:n,subtitle:r}){let i=v(e=>e.language),o=y(i),s=o.automations,c=o.cron,u=L(e=>e.setPageHeader),f=L(e=>e.clearPageHeader),[p,m]=a(),O=p.get(`run`)?.trim()??``,k=p.get(`automation`)?.trim()??``,A=p.get(`draft`)?.trim()??``,ee=p.get(`action`)?.trim()??``,j=p.get(`projectId`)?.trim()??``,M=e?.trim()||j,N=!!e?.trim(),F=p.get(`autogenerate`)===`1`,re=(0,q.useRef)(``),ae=p.get(`status`),R=ae===`active`||ae===`paused`||ae===`system`||ae===`attention`?ae:`all`,se=p.get(`q`)??``,le=e=>m(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`status`):n.set(`status`,e),n.delete(`automation`),n}),ue=e=>m(t=>{let n=new URLSearchParams(t);return e?n.set(`q`,e):n.delete(`q`),n.delete(`automation`),n},{replace:!0}),[fe,pe]=(0,q.useState)(null),[me,V]=(0,q.useState)(!1),[ge,H]=(0,q.useState)(`blank`),[U,W]=(0,q.useState)(null),[xe,Ce]=(0,q.useState)(!1),[K,we]=(0,q.useState)(Tt),[Te,Y]=(0,q.useState)(null),[Ee,De]=(0,q.useState)(null),[Oe,ke]=(0,q.useState)(!1),[Ae,X]=(0,q.useState)(null),[je,Me]=(0,q.useState)(``),[Ne,Pe]=(0,q.useState)(null),[Fe,Ie]=(0,q.useState)(!1),[Z,Q]=(0,q.useState)(!1),[Le,Re]=(0,q.useState)(M),[ze,Be]=(0,q.useState)(`new_session`),[Ve,He]=(0,q.useState)(`attention`),[Ue,We]=(0,q.useState)(null),[Ge,Ke]=(0,q.useState)(!1),[qe,Je]=(0,q.useState)(!1),[Ye,Xe]=(0,q.useState)(!1),[Ze,Qe]=(0,q.useState)(null),[$,$e]=(0,q.useState)(Wt),et=E([`automations`,M],()=>B.list(M?{projectId:M}:void 0),{refreshInterval:15e3}),tt=E([`automation-runs`,M],()=>B.runs(50,void 0,M?{projectId:M}:void 0),{refreshInterval:1e4}),nt=E(Ae?[`automation-history`,Ae,M]:null,()=>B.runs(50,Ae,M?{projectId:M}:void 0),{refreshInterval:1e4}),rt=E(Ee?`automation-run-events:${Ee}`:null,()=>B.runEvents(Ee),{refreshInterval:5e3}),it=E(`automation-workflow-definitions`,_e),at=E(`automation-browser-automations`,()=>Se.list()),ot=E(`automation-chat-agents`,ne),st=E(`automation-projects`,()=>oe({sortBy:`name`,sortOrder:`asc`,limit:200})),ct=et.isLoading&&!et.data||tt.isLoading&&!tt.data,lt=et.data?.automations??[],ut=(0,q.useMemo)(()=>rn(tt.data?.runs??[]),[tt.data?.runs]),dt=(0,q.useMemo)(()=>lt.filter(e=>!en(e)),[lt]),ft=(0,q.useMemo)(()=>lt.filter(en),[lt]),pt=(0,q.useMemo)(()=>new Set(ft.map(e=>e.id)),[ft]),mt=(0,q.useMemo)(()=>ut.filter(e=>!pt.has(e.automationId)),[ut,pt]),ht=(0,q.useMemo)(()=>ut.find(e=>e.id===Ee)??nt.data?.runs.find(e=>e.id===Ee)??null,[ut,Ee,nt.data]),gt=(0,q.useMemo)(()=>lt.find(e=>e.id===Ae)??null,[lt,Ae]),_t=(0,q.useMemo)(()=>lt.find(e=>e.id===U)??null,[lt,U]),vt=(0,q.useMemo)(()=>[...nt.data?.runs??ut].filter(e=>e.automationId===Ae).sort((e,t)=>t.createdAtMs-e.createdAtMs),[ut,Ae,nt.data]),yt=rt.data?.events??[],bt=(0,q.useMemo)(()=>mt.filter(e=>!Xt(e)&&e.readAtMs==null),[mt]),xt=se.trim().toLocaleLowerCase(),Ct=(0,q.useMemo)(()=>(R===`system`?ft:dt).filter(e=>R===`attention`&&!Ht(e,mt)||R===`active`&&!e.enabled||R===`paused`&&e.enabled?!1:xt?[e.name,tn(e),Qt(e,s),St(e.trigger,s,c,i)].some(e=>e.toLocaleLowerCase().includes(xt)):!0),[c,R,s,i,xt,ft,dt,mt]),wt=(0,q.useMemo)(()=>it.data??[],[it.data]),Et=(0,q.useMemo)(()=>(at.data?.automations??[]).filter(e=>e.enabled),[at.data]),Ot=ot.data?.items??[],kt=st.data?.items??[],At=(0,q.useMemo)(()=>wt.find(e=>e.id===K.workflowId.trim())??null,[K.workflowId,wt]),jt=(0,q.useMemo)(()=>Et.find(e=>e.id===K.browserAutomationId.trim())??null,[Et,K.browserAutomationId]),Mt=K.actionMode===`workflow`&&(!K.workflowId.trim()||wt.length>0&&!wt.some(e=>e.id===K.workflowId)),Lt=K.actionMode===`workflow`&&At?!be(At,K.workflowInput,K.workflowInputValid).valid:!1,zt=!!K.name.trim()&&(K.triggerMode!==`once`||Number.isFinite(new Date(K.onceAt).getTime())&&(!!_t||new Date(K.onceAt).getTime()>Date.now()))&&(![`daily`,`weekly`].includes(K.triggerMode)||/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(K.time))&&(K.triggerMode!==`event`||!!K.eventType.trim()&&Nt(K.eventPayloadMatch))&&(K.actionMode===`workflow`?!Mt&&!Lt:K.actionMode===`browser_automation`?jt!==null&&G(jt,K.browserAutomationInputs):!!K.instruction.trim()),Gt=(0,q.useMemo)(()=>It(s),[s]),Kt=(0,q.useMemo)(()=>dt.filter(e=>Ht(e,mt)),[dt,mt]),qt=Kt.some(e=>{let t=Vt(e,mt);return t!==null&&$[e.id]!==t}),Jt=(0,q.useCallback)(()=>{$e(e=>{let t={...e};for(let e of Kt){let n=Vt(e,mt);n&&(t[e.id]=n)}try{window.localStorage.setItem(Ut,JSON.stringify(t))}catch{}return t})},[Kt,mt]);(0,q.useEffect)(()=>{if(Ct.length===0){X(null);return}if(k&&Ct.some(e=>e.id===k)){X(k);return}Ae&&Ct.some(e=>e.id===Ae)||X(Ct[0].id)},[k,Ct,Ae]);let Yt=(0,q.useCallback)(async()=>{await Promise.all([et.mutate(),tt.mutate(),nt.mutate(),rt.mutate()])},[et.mutate,rt.mutate,tt.mutate,nt.mutate]),Zt=(0,q.useCallback)(e=>{if(N){X(null),De(null);return}m(t=>{let n=new URLSearchParams(t);return e?n.set(`projectId`,e):n.delete(`projectId`),n.delete(`automation`),n.delete(`run`),n}),X(null),De(null)},[N,m]);(0,q.useEffect)(()=>{N&&(Re(M),we(e=>e.projectId===M?e:{...e,projectId:M}))},[M,N]);let $t=(0,q.useCallback)(e=>{if(W(null),Ce(!1),Y(null),H(e),V(!0),e===`blank`){we({...Tt,projectId:M});return}Me(``),Pe(null),Q(!1),Re(M),Be(`new_session`),He(`attention`)},[M]),nn=e=>{pe(e),we({...e.form,projectId:M}),W(null),Ce(!1),Y(null),H(`quick`),V(!0)},on=(0,q.useCallback)(e=>{we(Pt(e,wt)),W(e.id),Ce(!1),X(null),H(`blank`),V(!0)},[wt]),sn=(0,q.useCallback)(()=>{Ne&&(we({...Pt(Ne.automation,wt),projectId:Le,conversationMode:ze,notificationPolicy:Ve}),W(null),Ce(!0),H(`blank`))},[Ne,ze,Ve,Le,wt]),un=(0,q.useCallback)(async()=>{Xe(!0),Y(null);try{await Yt()}catch(e){Y(e instanceof Error?e.message:String(e))}finally{Xe(!1)}},[s.feedback.actionFailed,Yt]);(0,q.useEffect)(()=>{let e=lt.find(e=>e.id===k);!e||!en(e)||R===`system`||m(e=>{let t=new URLSearchParams(e);return t.set(`status`,`system`),t},{replace:!0})},[k,lt,R,m]),(0,q.useEffect)(()=>{ee===`create`&&($t(`blank`),m(e=>{let t=new URLSearchParams(e);return t.delete(`action`),t},{replace:!0}))},[ee,$t,m]),(0,q.useEffect)(()=>{if(!A)return;let e=`${i}:${F?`auto`:`seed`}:${A}`;re.current!==e&&(re.current=e,Me(A),Pe(null),Q(!1),Re(M),H(`draft`),V(!0),m(e=>{let t=new URLSearchParams(e);return t.delete(`draft`),t.delete(`autogenerate`),t},{replace:!0}),F&&(Y(null),Ie(!0),B.draft({prompt:A,language:i}).then(e=>{Pe(e.draft),Q(!1)}).catch(e=>{Y(e instanceof Error?e.message:String(e))}).finally(()=>{Ie(!1)})))},[F,A,i,M,m]);let dn=(0,q.useCallback)(e=>{let t=ut.find(t=>t.id===e)??nt.data?.runs.find(t=>t.id===e);if(!t||Xt(t)||t.readAtMs!=null)return;let n=Date.now();tt.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),nt.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),B.markRunRead(e).catch(e=>{Y(e instanceof Error?e.message:String(e)),tt.mutate(),nt.mutate()})},[ut,tt.mutate,nt.data,nt.mutate]),fn=(0,q.useCallback)(e=>{dn(e),De(e),ke(!0),m(t=>{let n=new URLSearchParams(t);return n.set(`run`,e),n},{replace:!0})},[dn,m]),mn=(0,q.useCallback)(e=>{X(e);let t=Bt(e,ut);m(t=>{let n=new URLSearchParams(t);return n.set(`automation`,e),n},{replace:!0}),t&&t.readAtMs==null&&!Xt(t)&&dn(t.id)},[dn,ut,m]);(0,q.useEffect)(()=>{O&&(dn(O),De(O),ke(!0))},[dn,O]),(0,q.useEffect)(()=>{We(null),Je(!1)},[Ee]);async function hn(){if(Y(null),K.triggerMode===`once`&&!_t&&new Date(K.onceAt).getTime()<=Date.now()){Y(s.experience.futureTime);return}if(!(!zt||Ze)&&!(ge===`quick`&&fe?.requiresProject&&!K.projectId)){if(xe&&Ne){Qe(`draft:edit`);try{let e=Dt(K,At),{simulation:t}=await B.simulate(e);Pe({...Ne,automation:e,simulation:t}),Re(K.projectId),Be(K.conversationMode),He(K.notificationPolicy),Q(!1),Ce(!1),H(`draft`)}catch(e){Y(e instanceof Error?e.message:String(e))}finally{Qe(null)}return}if(_t){let e=_t.id;await gn(`automation:${e}:edit`,()=>B.update(e,Ft(_t,K,At)))&&(V(!1),W(null),X(e));return}Qe(`automation:create`);try{let e=Dt(K,At),{automation:t}=await B.create(e);we(Tt),V(!1),m(e=>{let n=new URLSearchParams(e);return n.delete(`status`),n.delete(`q`),n.delete(`run`),n.set(`automation`,t.id),N||(t.projectId?n.set(`projectId`,t.projectId):n.delete(`projectId`)),n}),await Yt(),X(t.id)}catch(e){Y(e instanceof Error?e.message:String(e))}finally{Qe(null)}}}async function gn(e,t){Y(null),Qe(e);try{return await t(),await Yt(),!0}catch(e){return Y(e instanceof Error?e.message:String(e)),!1}finally{Qe(null)}}async function _n(){await gn(`runs:read-all`,()=>B.markAllRunsRead(M||void 0))}async function bn(){let e=je.trim();if(e){Y(null),Ie(!0);try{Pe((await B.draft({prompt:e,language:i})).draft),Q(!1)}catch(e){Y(e instanceof Error?e.message:String(e))}finally{Ie(!1)}}}async function xn(){if(!Ne)return;let e=``,t=``;await gn(`draft:publish`,async()=>{let{automation:n}=await B.create({...Ne.automation,...Le?{projectId:Le}:{projectId:void 0},conversationMode:ze,notificationPolicy:Ve});Pe(null),Me(``),Q(!1),V(!1),le(`all`),ue(``),e=n.id,t=n.projectId??``})&&e&&(Zt(t),X(e))}async function Sn(){if(!Ne)return;let e=``,t=``,n=``;await gn(`draft:test`,async()=>{let{automation:r}=await B.create({...Ne.automation,...Le?{projectId:Le}:{projectId:void 0},conversationMode:ze,notificationPolicy:Ve,enabled:!1}),{run:i}=await B.runNow(r.id);e=r.id,t=r.projectId??``,n=i.id,Pe(null),Me(``),Q(!1),V(!1),le(`all`),ue(``)})&&e&&n&&(Zt(t),X(e),fn(n))}async function Cn(e){Y(null),Ke(!0),We(null),Je(!1);try{We((await B.repairDraft(e.id,{language:i})).repair)}catch(e){Y(e instanceof Error?e.message:String(e))}finally{Ke(!1)}}async function wn(e){Ue&&await gn(`run:${e.id}:repair`,async()=>{await B.update(e.automationId,Ue.patch),We(null),Je(!1)})}let Tn=(0,q.useMemo)(()=>(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(ve,{className:`size-9 shrink-0 p-0`,loading:Ye,label:s.refresh,onClick:un}),(0,J.jsxs)(D,{variant:`primary`,onClick:()=>$t(`draft`),children:[(0,J.jsx)(h,{className:`size-4`}),s.new]})]}),[s.new,s.refresh,$t,Ye,un]);return(0,q.useLayoutEffect)(()=>{if(!t)return u({startExtra:null,main:(0,J.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:s.title}),end:Tn}),()=>f()},[f,t,Tn,s.title,u]),(0,J.jsxs)(`div`,{className:_(`flex min-h-0 min-w-0 flex-1 flex-col`,t?`bg-transparent`:`bg-surface-panel`),children:[(0,J.jsxs)(`div`,{className:_(`flex w-full flex-col gap-4`,t?`py-1`:`mx-auto max-w-[96rem] px-4 py-7 sm:px-6 lg:px-8 lg:py-9`),children:[t?(0,J.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,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(ce,{className:`size-4 text-accent-fg`,"aria-hidden":!0}),(0,J.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n||s.title})]}),(0,J.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:r||s.subtitle})]}),Tn]}):null,Te||et.error||tt.error?(0,J.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:Te||s.feedback.actionFailed}):null,!ct&&!et.error&&dt.length===0&&R!==`system`?(0,J.jsxs)(`section`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-6`,children:[(0,J.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:s.experience.scenes}),(0,J.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:s.experience.scenesDescription}),(0,J.jsx)(cn,{templates:Gt,labels:s,onSelect:nn}),(0,J.jsx)(D,{className:`mt-4`,variant:`ghost`,onClick:()=>$t(`draft`),children:s.experience.custom})]}):null,!ct&&qt&&R!==`system`?(0,J.jsxs)(`div`,{className:`flex items-center rounded-lg border border-red-500/20 bg-red-500/5`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>le(`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,J.jsx)(he,{className:`size-4 shrink-0 text-red-700 dark:text-red-300`,"aria-hidden":!0}),(0,J.jsxs)(`span`,{className:`min-w-0 text-sm text-fg`,children:[(0,J.jsxs)(`span`,{className:`font-medium`,children:[s.experience.executionIssues,` · `,Kt.length]}),(0,J.jsx)(`span`,{className:`ml-2 text-fg-muted`,children:s.experience.issuesDescription})]})]}),(0,J.jsx)(`button`,{type:`button`,onClick:Jt,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":s.close,title:s.close,children:(0,J.jsx)(g,{className:`size-4`,"aria-hidden":!0})})]}):null,ct?(0,J.jsx)(an,{}):dt.length>0||R===`system`?(0,J.jsxs)(`section`,{className:`grid min-h-0 items-start gap-4 xl:grid-cols-[minmax(18rem,0.8fr)_minmax(0,1.5fr)]`,children:[(0,J.jsxs)(`aside`,{className:`overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,children:[(0,J.jsxs)(`div`,{className:`border-b border-edge-subtle p-3`,children:[N?null:(0,J.jsxs)(l,{"aria-label":s.filters.project,className:Mn,value:M,onChange:e=>Zt(e.target.value),children:[(0,J.jsx)(d,{value:``,children:s.filters.allProjects}),kt.map(e=>(0,J.jsx)(d,{value:e.id,children:e.name},e.id))]}),(0,J.jsxs)(`label`,{className:_(`flex 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`,!N&&`mt-2`),children:[(0,J.jsx)(z,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,J.jsx)(`input`,{className:`min-w-0 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-subtle`,value:se,onChange:e=>ue(e.target.value),placeholder:s.filters.search,"aria-label":s.filters.search})]}),(0,J.jsxs)(`nav`,{className:`mt-3 flex flex-wrap items-center gap-1`,"aria-label":s.filters.status,children:[[{id:`all`,label:s.filters.all},{id:`active`,label:s.filters.active},{id:`paused`,label:s.paused},{id:`attention`,label:s.experience.executionIssues}].map(e=>(0,J.jsx)(`button`,{type:`button`,className:_(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,R===e.id&&`bg-surface-hover text-fg`),onClick:()=>le(e.id),"aria-pressed":R===e.id,children:e.label},e.id)),(0,J.jsxs)(te,{children:[(0,J.jsx)(ye,{asChild:!0,children:(0,J.jsx)(`button`,{type:`button`,className:_(`ml-auto rounded-md p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,R===`system`&&`bg-surface-hover text-fg`),"aria-label":s.system.title,children:(0,J.jsx)(de,{className:`size-4`})})}),(0,J.jsx)(I,{children:(0,J.jsx)(ie,{align:`end`,className:`z-70 min-w-40 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:(0,J.jsxs)(P,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover`,onSelect:()=>le(`system`),children:[s.system.title,` `,ft.length]})})})]})]}),bt.length>0&&R!==`system`?(0,J.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,J.jsxs)(`span`,{children:[s.filters.unread,` · `,bt.length]}),(0,J.jsx)(`button`,{type:`button`,className:`font-medium hover:underline`,disabled:Ze===`runs:read-all`,onClick:()=>void _n(),children:s.filters.markAllRead})]}):null]}),(0,J.jsx)(pn,{automations:Ct,runs:R===`system`?ut:mt,labels:s,cronLabels:c,language:i,selectedAutomationId:Ae,onOpenDetails:mn})]}),gt?(0,J.jsx)(yn,{automation:gt,runs:vt,runsLoading:nt.isLoading,runsError:nt.error?s.feedback.actionFailed:void 0,labels:s,cronLabels:c,language:i,projects:kt,busyAction:Ze,onEdit:on,onSelectRun:fn,onAction:gn},gt.id):(0,J.jsx)(Dn,{icon:(0,J.jsx)(ce,{className:`size-5`}),title:s.empty.filtered})]}):null,!ct&&dt.length>0?(0,J.jsx)(`div`,{children:(0,J.jsxs)(D,{variant:`ghost`,onClick:()=>$t(`draft`),children:[(0,J.jsx)(h,{className:`size-4`,"aria-hidden":!0}),s.experience.discover]})}):null]}),(0,J.jsx)(T,{open:me,onOpenChange:e=>{V(e),e||(W(null),Ce(!1))},children:(0,J.jsxs)(S,{children:[(0,J.jsx)(b,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,J.jsxs)(C,{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,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge px-5 py-4`,children:[(0,J.jsx)(w,{className:`text-base font-semibold text-fg`,children:ge===`draft`?s.draft.title:_t?s.editTitle:xe?s.draft.editTitle:s.createTitle}),(0,J.jsx)(x,{asChild:!0,children:(0,J.jsx)(D,{variant:`ghost`,"aria-label":s.close,children:(0,J.jsx)(g,{className:`size-4`})})})]}),Te?(0,J.jsx)(`p`,{role:`alert`,className:`px-5 py-2 text-sm text-red-700 dark:text-red-300`,children:Te}):null,ge===`draft`?(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,J.jsx)(ln,{labels:s,prompt:je,draft:Ne,loading:Fe,approved:Z,publishBusy:Ze===`draft:publish`,testBusy:Ze===`draft:test`,templates:Gt,projects:kt,projectId:Le,conversationMode:ze,notificationPolicy:Ve,onPromptChange:Me,onGenerate:bn,onEdit:sn,onPublish:xn,onTest:Sn,onProjectChange:Re,onConversationModeChange:Be,onNotificationPolicyChange:He,projectLocked:N,onApprovedChange:Q,onDiscard:()=>{Pe(null),Q(!1)},onTemplateSelect:e=>{nn(e),we({...e.form,projectId:Le})},onOpenAdvanced:()=>{we({...Tt,projectId:Le,conversationMode:ze,notificationPolicy:Ve}),H(`blank`)}})}):(0,J.jsxs)(J.Fragment,{children:[ge===`quick`&&fe?(0,J.jsx)(Rt,{form:K,setForm:we,labels:s,projects:kt,projectLocked:N,source:fe.source,requiresProject:fe.requiresProject}):(0,J.jsx)(On,{form:K,labels:s,setForm:we,projects:kt,workflowDefinitions:wt,selectedWorkflow:At,workflowsLoading:it.isLoading,browserAutomations:Et,selectedBrowserAutomation:jt,browserAutomationsLoading:at.isLoading,agentOptions:Ot,agentsLoading:ot.isLoading,language:i,projectLocked:N}),(0,J.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2 border-t border-edge px-5 py-4`,children:[ge===`quick`?(0,J.jsx)(D,{variant:`ghost`,onClick:()=>H(`blank`),children:s.draft.advancedCreate}):null,xe?(0,J.jsx)(D,{variant:`ghost`,onClick:()=>{Ce(!1),H(`draft`)},children:s.cancel}):(0,J.jsx)(x,{asChild:!0,children:(0,J.jsx)(D,{variant:`ghost`,children:s.cancel})}),(0,J.jsx)(D,{variant:`primary`,onClick:hn,disabled:!zt||!!Ze||ge===`quick`&&!!fe?.requiresProject&&!K.projectId,children:Ze===`automation:create`||Ze===`draft:edit`||_t&&Ze===`automation:${_t.id}:edit`?s.feedback.working:_t||xe?s.save:s.experience.createEnabled})]})]})]})]})}),(0,J.jsx)(T,{open:Oe&&!!ht,onOpenChange:e=>{ke(e),!e&&m(e=>{let t=new URLSearchParams(e);return t.delete(`run`),t},{replace:!0})},children:(0,J.jsxs)(S,{children:[(0,J.jsx)(b,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,J.jsxs)(C,{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,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[(0,J.jsx)(w,{className:`truncate text-base font-semibold text-fg`,children:ht?.automationName??s.dashboard.result}),(0,J.jsx)(x,{asChild:!0,children:(0,J.jsx)(D,{variant:`ghost`,"aria-label":s.close,children:(0,J.jsx)(g,{className:`size-4`})})})]}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,J.jsx)(vn,{className:`rounded-none border-0`,run:ht,events:yt,labels:s,cronLabels:c,language:i,loading:rt.isLoading,repairDraft:Ue,repairLoading:Ge,repairApproved:qe,busyAction:Ze,onRepairApprovedChange:Je,onSuggestRepair:Cn,onApplyRepair:wn})})]})]})})]})}function cn(e){let t=(0,we.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,J.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,J.jsx)(V,{className:`mb-3 size-4 text-accent-fg`,"aria-hidden":!0}),(0,J.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:e.name}),(0,J.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.description}),(0,J.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,J.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 ln(e){let t=(0,we.c)(110),{labels:n,prompt:r,draft:i,loading:a,approved:o,publishBusy:s,testBusy:c,templates:u,projects:f,projectId:p,conversationMode:m,notificationPolicy:h,onPromptChange:g,onGenerate:v,onEdit:y,onPublish:b,onTest:x,onProjectChange:S,onConversationModeChange:C,onNotificationPolicyChange:w,onApprovedChange:T,onDiscard:E,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]!==u?(F=i?null:(0,J.jsxs)(`div`,{className:`mb-5 border-b border-edge-subtle pb-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.draft.suggestions}),(0,J.jsx)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:n.draft.suggestionsDescription})]}),(0,J.jsx)(D,{variant:`ghost`,onClick:k,children:n.draft.advancedCreate})]}),(0,J.jsx)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:u.map(e=>(0,J.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,J.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:e.name}),(0,J.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:e.description}),(0,J.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]=u,t[8]=F):F=t[8];let I;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,J.jsx)(ee,{className:`size-4 text-accent`}),t[9]=I):I=t[9];let L;t[10]===n.draft.title?L=t[11]:(L=(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[I,n.draft.title]}),t[10]=n.draft.title,t[11]=L);let te;t[12]===n.draft.subtitle?te=t[13]:(te=(0,J.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:n.draft.subtitle}),t[12]=n.draft.subtitle,t[13]=te);let ne;t[14]!==L||t[15]!==te?(ne=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[L,te]}),t[14]=L,t[15]=te,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,J.jsx)(ee,{className:`size-4`}),t[20]=ie):ie=t[20];let ae=a?n.draft.generating:n.draft.generate,R;t[21]!==v||t[22]!==ae||t[23]!==re?(R=(0,J.jsxs)(D,{variant:`primary`,onClick:v,disabled:re,children:[ie,ae]}),t[21]=v,t[22]=ae,t[23]=re,t[24]=R):R=t[24];let z;t[25]!==R||t[26]!==ne?(z=(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[ne,R]}),t[25]=R,t[26]=ne,t[27]=z):z=t[27];let oe;t[28]===g?oe=t[29]:(oe=e=>g(e.target.value),t[28]=g,t[29]=oe);let se;t[30]!==n.draft.placeholder||t[31]!==n.draft.title||t[32]!==r||t[33]!==oe?(se=(0,J.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:oe,placeholder:n.draft.placeholder}),t[30]=n.draft.placeholder,t[31]=n.draft.title,t[32]=r,t[33]=oe,t[34]=se):se=t[34];let ce=N?`sm:grid-cols-2`:`sm:grid-cols-3`,le;t[35]===ce?le=t[36]:(le=_(`mt-3 grid gap-3`,ce),t[35]=ce,t[36]=le);let ue;t[37]!==n.draft.noProject||t[38]!==n.draft.project||t[39]!==S||t[40]!==p||t[41]!==N||t[42]!==f?(ue=N?null:(0,J.jsx)(Nn,{label:n.draft.project,children:(0,J.jsxs)(l,{className:Mn,value:p,onChange:e=>S(e.target.value),children:[(0,J.jsx)(d,{value:``,children:n.draft.noProject}),f.map(un)]})}),t[37]=n.draft.noProject,t[38]=n.draft.project,t[39]=S,t[40]=p,t[41]=N,t[42]=f,t[43]=ue):ue=t[43];let de;t[44]===C?de=t[45]:(de=e=>C(e.target.value),t[44]=C,t[45]=de);let B;t[46]===n.draft.newConversation?B=t[47]:(B=(0,J.jsx)(d,{value:`new_session`,children:n.draft.newConversation}),t[46]=n.draft.newConversation,t[47]=B);let pe;t[48]===n.draft.continuousConversation?pe=t[49]:(pe=(0,J.jsx)(d,{value:`continuous`,children:n.draft.continuousConversation}),t[48]=n.draft.continuousConversation,t[49]=pe);let me;t[50]!==m||t[51]!==de||t[52]!==B||t[53]!==pe?(me=(0,J.jsxs)(l,{className:Mn,value:m,onChange:de,children:[B,pe]}),t[50]=m,t[51]=de,t[52]=B,t[53]=pe,t[54]=me):me=t[54];let V;t[55]!==n.draft.conversation||t[56]!==me?(V=(0,J.jsx)(Nn,{label:n.draft.conversation,children:me}),t[55]=n.draft.conversation,t[56]=me,t[57]=V):V=t[57];let he;t[58]===w?he=t[59]:(he=e=>w(e.target.value),t[58]=w,t[59]=he);let _e;t[60]===n.draft.notifyAttention?_e=t[61]:(_e=(0,J.jsx)(d,{value:`attention`,children:n.draft.notifyAttention}),t[60]=n.draft.notifyAttention,t[61]=_e);let ve;t[62]===n.draft.notifyAll?ve=t[63]:(ve=(0,J.jsx)(d,{value:`all`,children:n.draft.notifyAll}),t[62]=n.draft.notifyAll,t[63]=ve);let ye;t[64]===n.draft.notifyNone?ye=t[65]:(ye=(0,J.jsx)(d,{value:`none`,children:n.draft.notifyNone}),t[64]=n.draft.notifyNone,t[65]=ye);let H;t[66]!==h||t[67]!==he||t[68]!==_e||t[69]!==ve||t[70]!==ye?(H=(0,J.jsxs)(l,{className:Mn,value:h,onChange:he,children:[_e,ve,ye]}),t[66]=h,t[67]=he,t[68]=_e,t[69]=ve,t[70]=ye,t[71]=H):H=t[71];let be;t[72]!==n.draft.notifications||t[73]!==H?(be=(0,J.jsx)(Nn,{label:n.draft.notifications,children:H}),t[72]=n.draft.notifications,t[73]=H,t[74]=be):be=t[74];let U;t[75]!==le||t[76]!==ue||t[77]!==V||t[78]!==be?(U=(0,J.jsxs)(`div`,{className:le,children:[ue,V,be]}),t[75]=le,t[76]=ue,t[77]=V,t[78]=be,t[79]=U):U=t[79];let W;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]!==T||t[96]!==E||t[97]!==y||t[98]!==b||t[99]!==x||t[100]!==j||t[101]!==P||t[102]!==M?(W=i?(0,J.jsxs)(`div`,{className:`mt-4 grid gap-3 rounded-lg bg-surface-base p-4 lg:grid-cols-[1fr_1fr]`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:i.automation.name}),i.automation.description?(0,J.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:i.automation.description}):null,(0,J.jsxs)(`div`,{className:`mt-3 grid gap-2 text-sm`,children:[(0,J.jsx)(En,{label:n.info.when,value:i.simulation.triggerSummary}),(0,J.jsx)(En,{label:n.info.run,value:i.simulation.actionSummary})]})]}),(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:n.draft.review}),(0,J.jsx)(dn,{title:n.draft.safety,items:[...i.simulation.safetyNotes,...i.simulation.requiredConfirmations],empty:n.none}),(0,J.jsx)(dn,{title:n.draft.assumptions,items:i.assumptions,empty:n.none}),(0,J.jsx)(dn,{title:n.draft.risks,items:i.risks,empty:n.none}),P?(0,J.jsxs)(`label`,{className:`mt-4 flex items-start gap-2 text-sm text-fg`,children:[(0,J.jsx)(`input`,{className:`mt-1`,type:`checkbox`,checked:o,onChange:e=>T(e.target.checked)}),(0,J.jsx)(`span`,{children:n.draft.approval})]}):null,(0,J.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,J.jsx)(D,{variant:`ghost`,onClick:E,children:n.draft.discard}),(0,J.jsxs)(D,{variant:`secondary`,onClick:y,children:[(0,J.jsx)(fe,{className:`size-4`}),n.draft.edit]}),(0,J.jsxs)(D,{variant:`secondary`,onClick:x,disabled:M||j||P&&!o,children:[(0,J.jsx)(ge,{className:`size-4`}),M?n.draft.testing:n.draft.testOnce]}),(0,J.jsx)(D,{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]=T,t[96]=E,t[97]=y,t[98]=b,t[99]=x,t[100]=j,t[101]=P,t[102]=M,t[103]=W):W=t[103];let xe;return t[104]!==z||t[105]!==se||t[106]!==U||t[107]!==W||t[108]!==F?(xe=(0,J.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[F,z,se,U,W]}),t[104]=z,t[105]=se,t[106]=U,t[107]=W,t[108]=F,t[109]=xe):xe=t[109],xe}function un(e){return(0,J.jsx)(d,{value:e.id,children:e.name},e.id)}function dn(e){let t=(0,we.c)(10),{title:n,items:r,empty:i}=e,a;t[0]===n?a=t[1]:(a=(0,J.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(fn):(0,J.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,J.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,J.jsxs)(`div`,{className:`mt-3`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function fn(e){return(0,J.jsxs)(`li`,{children:[`- `,e]},e)}function pn(e){let t=(0,we.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,J.jsx)(ce,{className:`size-5`}),t[0]=e):e=t[0];let n;return t[1]===i.empty.filtered?n=t[2]:(n=(0,J.jsx)(Dn,{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(mn),n=t.find(Xt),l=t[0];return(0,J.jsxs)(`button`,{type:`button`,className:_(`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,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`span`,{className:_(`size-2 shrink-0 rounded-full`,n?`bg-blue-500`:Ht(e,t)?`bg-red-500`:e.enabled?`bg-emerald-500`:`bg-fg-subtle`)}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-fg`,children:e.name}),(0,J.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:e.enabled?i.enabled:i.paused}),l&&l.readAtMs==null&&!Xt(l)?(0,J.jsx)(`span`,{className:`ml-auto size-2 shrink-0 rounded-full bg-blue-500`,children:(0,J.jsx)(`span`,{className:`sr-only`,children:i.filters.unread})}):null]}),(0,J.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center justify-between gap-2 pl-4 text-xs text-fg-subtle`,children:[(0,J.jsx)(`span`,{className:_(`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,J.jsx)(`span`,{className:_(`shrink-0 rounded-full px-1.5 py-0.5`,Jt(l.status)),children:i.status[l.status]}):null]}),(0,J.jsxs)(`div`,{className:`mt-2 space-y-1 pl-4 text-xs text-fg-muted`,children:[l?(0,J.jsxs)(`div`,{children:[i.last,`: `,Gt(l.createdAtMs,i,o)]}):null,(0,J.jsx)(`div`,{children:e.enabled?`${i.next}: ${Ct(e,i,o)}`:i.paused}),(0,J.jsx)(`div`,{children:St(e.trigger,i,a,o)})]})]},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,J.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:l}),t[18]=l,t[19]=u),u}function mn(e,t){return t.createdAtMs-e.createdAtMs}function hn(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`completion_hook.started`:return n.completionHookStarted;case`completion_hook.completed`:return n.completionHookCompleted;case`completion_hook.failed`:return n.completionHookFailed;case`run.completed`:return a?n.runCompleted.replace(`{status}`,a):n.runCompletedFallback;default:return e.message}}function gn(e){let t=(0,we.c)(17),{value:n,labels:r,title:i,defaultExpanded:a}=e,[o,s]=(0,q.useState)(a===void 0?!1:a),c;t[0]===n?c=t[1]:(c=JSON.stringify(n,null,2),t[0]=n,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=l.split(`
3
+ `),t[2]=l,t[3]=u);let d=u.length,f=l.length>720||d>18,p;t[4]!==f||t[5]!==l?(p=f?`${l.split(`
4
+ `).slice(0,10).join(`
5
+ `).trimEnd()}...`:l,t[4]=f,t[5]=l,t[6]=p):p=t[6];let m=p,h;t[7]!==o||t[8]!==f||t[9]!==r||t[10]!==i?(h=f?(0,J.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(_n),"aria-expanded":o,children:[(0,J.jsx)(`span`,{children:i}),(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-accent-fg`,children:[o?r.details.hideDetails:r.details.showDetails,(0,J.jsx)(ue,{className:_(`size-3.5 transition-transform`,o&&`rotate-180`),"aria-hidden":!0})]})]}):(0,J.jsx)(`div`,{className:`px-2.5 py-2 text-xs font-medium text-fg-muted`,children:i}),t[7]=o,t[8]=f,t[9]=r,t[10]=i,t[11]=h):h=t[11];let g=o||!f?l:m,v;t[12]===g?v=t[13]:(v=(0,J.jsx)(`pre`,{className:`whitespace-pre-wrap break-all px-2.5 pb-2 text-xs leading-relaxed text-fg-muted`,children:g}),t[12]=g,t[13]=v);let y;return t[14]!==h||t[15]!==v?(y=(0,J.jsxs)(`div`,{className:`mt-2 rounded-md border border-edge/70 bg-surface-inset/35`,children:[h,v]}),t[14]=h,t[15]=v,t[16]=y):y=t[16],y}function _n(e){return!e}function vn(e){let t=(0,we.c)(148),{className:n,run:r,events:i,labels:a,cronLabels:s,language:c,loading:l,repairDraft:u,repairLoading:d,repairApproved:f,busyAction:h,onRepairApprovedChange:g,onSuggestRepair:v,onApplyRepair:y}=e;if(!r){let e;t[0]===n?e=t[1]:(e=_(`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,J.jsx)(ae,{className:`mx-auto size-5`}),t[2]=r):r=t[2];let i;t[3]===a.selectRun?i=t[4]:(i=(0,J.jsx)(`div`,{className:`mt-2`,children:a.selectRun}),t[3]=a.selectRun,t[4]=i);let o;return t[5]!==e||t[6]!==i?(o=(0,J.jsxs)(`aside`,{className:e,children:[r,i]}),t[5]=e,t[6]=i,t[7]=o):o=t[7],o}let b=r.error||r.summary,x=r.conversationId?`/chat/${encodeURIComponent(r.conversationId)}`:r.workflowRunId?`/workflows?run=${encodeURIComponent(r.workflowRunId)}`:null,S=r.conversationId?a.runDetail.openConversation:a.runDetail.openWorkflow,C=r.conversationId?re:le,w=Xt(r)?ae:r.status===`succeeded`?p:he,T;t[8]===n?T=t[9]:(T=_(`rounded-lg border border-edge-subtle bg-surface-base shadow-surface`,n),t[8]=n,t[9]=T);let E;t[10]===r.automationName?E=t[11]:(E=(0,J.jsx)(`div`,{className:`truncate text-sm font-semibold text-fg`,children:r.automationName}),t[10]=r.automationName,t[11]=E);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,J.jsx)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:k}),t[14]=k,t[15]=A);let M;t[16]!==E||t[17]!==A?(M=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[E,A]}),t[16]=E,t[17]=A,t[18]=M):M=t[18];let N;t[19]===r.status?N=t[20]:(N=_(`shrink-0 rounded-full px-2 py-0.5 text-xs`,Jt(r.status)),t[19]=r.status,t[20]=N);let P=a.status[r.status],F;t[21]!==N||t[22]!==P?(F=(0,J.jsx)(`span`,{className:N,children:P}),t[21]=N,t[22]=P,t[23]=F):F=t[23];let I;t[24]!==M||t[25]!==F?(I=(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[M,F]}),t[24]=M,t[25]=F,t[26]=I):I=t[26];let L;t[27]!==a||t[28]!==c||t[29]!==r.createdAtMs?(L=Gt(r.createdAtMs,a,c),t[27]=a,t[28]=c,t[29]=r.createdAtMs,t[30]=L):L=t[30];let te;t[31]===L?te=t[32]:(te=(0,J.jsx)(`span`,{children:L}),t[31]=L,t[32]=te);let ne;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,J.jsx)(`span`,{"aria-hidden":!0,children:`·`}),t[33]=ne):ne=t[33];let ie=a.details.duration,R;t[34]!==a||t[35]!==r.durationMs?(R=Yt(r.durationMs,a),t[34]=a,t[35]=r.durationMs,t[36]=R):R=t[36];let z;t[37]!==a.details.duration||t[38]!==R?(z=(0,J.jsxs)(`span`,{children:[ie,` `,R]}),t[37]=a.details.duration,t[38]=R,t[39]=z):z=t[39];let oe;t[40]!==te||t[41]!==z?(oe=(0,J.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-muted`,children:[te,ne,z]}),t[40]=te,t[41]=z,t[42]=oe):oe=t[42];let se;t[43]!==a.repair||t[44]!==v||t[45]!==d||t[46]!==r?(se=r.status===`failed`||r.status===`timeout`||r.status===`cancelled`?(0,J.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,J.jsxs)(D,{variant:`secondary`,onClick:()=>v(r),disabled:d,children:[(0,J.jsx)(ee,{className:`size-4`}),d?a.repair.generating:a.repair.suggest]})}):null,t[43]=a.repair,t[44]=v,t[45]=d,t[46]=r,t[47]=se):se=t[47];let ce;t[48]!==oe||t[49]!==se||t[50]!==I?(ce=(0,J.jsxs)(`div`,{className:`border-b border-edge px-4 py-3`,children:[I,oe,se]}),t[48]=oe,t[49]=se,t[50]=I,t[51]=ce):ce=t[51];let de;t[52]===r?de=t[53]:(de=Xt(r)?`text-blue-500`:Zt(r)?`text-red-500`:r.status===`succeeded`?`text-emerald-500`:`text-fg-muted`,t[52]=r,t[53]=de);let B;t[54]===de?B=t[55]:(B=_(`size-4`,de),t[54]=de,t[55]=B);let fe;t[56]!==w||t[57]!==B?(fe=(0,J.jsx)(w,{className:B}),t[56]=w,t[57]=B,t[58]=fe):fe=t[58];let me;t[59]!==a.runDetail.resultTitle||t[60]!==fe?(me=(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[fe,a.runDetail.resultTitle]}),t[59]=a.runDetail.resultTitle,t[60]=fe,t[61]=me):me=t[61];let V;t[62]!==C||t[63]!==S||t[64]!==x?(V=x?(0,J.jsx)(D,{asChild:!0,variant:`secondary`,className:`h-8 rounded-md px-2.5 text-xs`,children:(0,J.jsxs)(o,{to:x,children:[(0,J.jsx)(C,{className:`size-3.5`}),S,(0,J.jsx)(pe,{className:`size-3.5`})]})}):null,t[62]=C,t[63]=S,t[64]=x,t[65]=V):V=t[65];let ge;t[66]!==me||t[67]!==V?(ge=(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[me,V]}),t[66]=me,t[67]=V,t[68]=ge):ge=t[68];let _e=r.error&&`border-red-500/25 bg-red-500/5`,ve;t[69]===_e?ve=t[70]:(ve=_(`mt-3 max-h-80 overflow-y-auto rounded-lg border border-edge/70 bg-surface-inset/25 p-3`,_e),t[69]=_e,t[70]=ve);let ye;t[71]!==a.runDetail.noResult||t[72]!==a.runDetail.resultPending||t[73]!==b||t[74]!==r?(ye=b?r.error?(0,J.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm leading-relaxed text-red-700 dark:text-red-300`,children:b}):(0,J.jsx)(m,{content:b,compact:!0,className:`text-sm`}):(0,J.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:Xt(r)?a.runDetail.resultPending:a.runDetail.noResult}),t[71]=a.runDetail.noResult,t[72]=a.runDetail.resultPending,t[73]=b,t[74]=r,t[75]=ye):ye=t[75];let H;t[76]!==ve||t[77]!==ye?(H=(0,J.jsx)(`div`,{className:ve,children:ye}),t[76]=ve,t[77]=ye,t[78]=H):H=t[78];let be;t[79]!==ge||t[80]!==H?(be=(0,J.jsxs)(`section`,{className:`border-b border-edge p-4`,children:[ge,H]}),t[79]=ge,t[80]=H,t[81]=be):be=t[81];let U;t[82]===a.runDetail.runInfo?U=t[83]:(U=(0,J.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:a.runDetail.runInfo}),t[82]=a.runDetail.runInfo,t[83]=U);let W;t[84]!==s||t[85]!==a||t[86]!==c||t[87]!==r.manual||t[88]!==r.triggerSnapshot?(W=r.manual?a.trigger.manual:St(r.triggerSnapshot,a,s,c),t[84]=s,t[85]=a,t[86]=c,t[87]=r.manual,t[88]=r.triggerSnapshot,t[89]=W):W=t[89];let xe;t[90]!==a.explain.whyRan||t[91]!==W?(xe=(0,J.jsx)(wn,{label:a.explain.whyRan,value:W}),t[90]=a.explain.whyRan,t[91]=W,t[92]=xe):xe=t[92];let Se=a.details.started,G;t[93]!==a||t[94]!==c||t[95]!==r.startedAtMs?(G=Gt(r.startedAtMs,a,c),t[93]=a,t[94]=c,t[95]=r.startedAtMs,t[96]=G):G=t[96];let Ce;t[97]!==a.details.started||t[98]!==G?(Ce=(0,J.jsx)(wn,{label:Se,value:G}),t[97]=a.details.started,t[98]=G,t[99]=Ce):Ce=t[99];let K;t[100]!==a.details.model||t[101]!==r.model?(K=r.model?(0,J.jsx)(wn,{label:a.details.model,value:r.model}):null,t[100]=a.details.model,t[101]=r.model,t[102]=K):K=t[102];let q;t[103]!==xe||t[104]!==Ce||t[105]!==K?(q=(0,J.jsxs)(`div`,{className:`mt-3 grid gap-2 text-xs text-fg-muted`,children:[xe,Ce,K]}),t[103]=xe,t[104]=Ce,t[105]=K,t[106]=q):q=t[106];let Te;t[107]!==U||t[108]!==q?(Te=(0,J.jsxs)(`section`,{className:`border-b border-edge p-4`,children:[U,q]}),t[107]=U,t[108]=q,t[109]=Te):Te=t[109];let Y;t[110]!==h||t[111]!==a||t[112]!==y||t[113]!==g||t[114]!==f||t[115]!==u||t[116]!==r?(Y=u?(0,J.jsxs)(`div`,{className:`border-b border-edge px-4 py-3`,children:[(0,J.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:a.repair.title}),(0,J.jsx)(`div`,{className:`mt-2 text-sm text-fg`,children:u.explanation}),u.expectedEffect?(0,J.jsx)(`div`,{className:`mt-2 text-sm text-fg-muted`,children:u.expectedEffect}):null,(0,J.jsx)(dn,{title:a.repair.risks,items:u.risks,empty:a.none}),(0,J.jsx)(gn,{value:u.patch,labels:a,title:a.details.repairPatch}),u.requiresApproval?(0,J.jsxs)(`label`,{className:`mt-3 flex items-start gap-2 text-sm text-fg`,children:[(0,J.jsx)(`input`,{className:`mt-1`,type:`checkbox`,checked:f,onChange:e=>g(e.target.checked)}),(0,J.jsx)(`span`,{children:a.repair.approval})]}):null,(0,J.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,J.jsx)(D,{variant:`primary`,onClick:()=>y(r),disabled:h===`run:${r.id}:repair`||u.requiresApproval&&!f,children:h===`run:${r.id}:repair`?a.feedback.working:a.repair.apply})})]}):null,t[110]=h,t[111]=a,t[112]=y,t[113]=g,t[114]=f,t[115]=u,t[116]=r,t[117]=Y):Y=t[117];let Ee;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,J.jsx)(j,{className:`size-4 shrink-0`}),t[118]=Ee):Ee=t[118];let De;t[119]===a.runDetail.technicalEvents?De=t[120]:(De=(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium text-fg-muted`,children:[Ee,a.runDetail.technicalEvents]}),t[119]=a.runDetail.technicalEvents,t[120]=De);let Oe;t[121]!==i.length||t[122]!==a.runDetail.eventCount?(Oe=a.runDetail.eventCount.replace(`{count}`,String(i.length)),t[121]=i.length,t[122]=a.runDetail.eventCount,t[123]=Oe):Oe=t[123];let ke;t[124]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,J.jsx)(ue,{className:`size-4 transition-transform group-open:rotate-180`}),t[124]=ke):ke=t[124];let Ae;t[125]===Oe?Ae=t[126]:(Ae=(0,J.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs text-fg-muted`,children:[Oe,ke]}),t[125]=Oe,t[126]=Ae);let X;t[127]!==De||t[128]!==Ae?(X=(0,J.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:[De,Ae]}),t[127]=De,t[128]=Ae,t[129]=X):X=t[129];let je;t[130]===a.runDetail.technicalEventsDescription?je=t[131]:(je=(0,J.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:a.runDetail.technicalEventsDescription}),t[130]=a.runDetail.technicalEventsDescription,t[131]=je);let Me;t[132]!==i||t[133]!==a||t[134]!==c||t[135]!==l?(Me=(0,J.jsx)(`div`,{className:`mt-4`,children:l?(0,J.jsxs)(`div`,{className:`space-y-3`,"aria-label":a.loading,children:[(0,J.jsx)(O,{className:`h-10 w-full`}),(0,J.jsx)(O,{className:`h-10 w-4/5`}),(0,J.jsx)(O,{className:`h-10 w-11/12`})]}):i.length===0?(0,J.jsx)(`div`,{className:`text-sm text-fg-muted`,children:a.empty.events}):(0,J.jsx)(`ol`,{className:`space-y-3`,children:i.map(e=>(0,J.jsxs)(`li`,{className:`grid grid-cols-[0.75rem_1fr] gap-3`,children:[(0,J.jsx)(`span`,{className:_(`mt-1 size-2 rounded-full`,Tn(e.type))}),(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`div`,{className:`text-sm text-fg`,children:hn(e,a)}),(0,J.jsxs)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:[Gt(e.createdAtMs,a,c),` · `,e.type]}),e.data&&typeof e.data==`object`?(0,J.jsxs)(`details`,{className:`group/event mt-2 rounded-md border border-edge/70 bg-surface-inset/35`,children:[(0,J.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:[a.details.eventData,(0,J.jsx)(ue,{className:`size-3.5 transition-transform group-open/event:rotate-180`})]}),(0,J.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]=a,t[134]=c,t[135]=l,t[136]=Me):Me=t[136];let Ne;t[137]!==X||t[138]!==je||t[139]!==Me?(Ne=(0,J.jsxs)(`details`,{className:`group px-4 py-3`,children:[X,je,Me]}),t[137]=X,t[138]=je,t[139]=Me,t[140]=Ne):Ne=t[140];let Pe;return t[141]!==T||t[142]!==ce||t[143]!==be||t[144]!==Te||t[145]!==Y||t[146]!==Ne?(Pe=(0,J.jsxs)(`aside`,{className:T,children:[ce,be,Te,Y,Ne]}),t[141]=T,t[142]=ce,t[143]=be,t[144]=Te,t[145]=Y,t[146]=Ne,t[147]=Pe):Pe=t[147],Pe}function yn(e){let t=(0,we.c)(113),{automation:n,runs:r,runsLoading:i,runsError:a,labels:o,cronLabels:s,language:c,projects:l,busyAction:u,onEdit:d,onSelectRun:f,onAction:h}=e,g=u===`automation:${n.id}:run`,v=u===`automation:${n.id}:toggle`,y=u===`automation:${n.id}:delete`,b;t[0]===n?b=t[1]:(b=en(n),t[0]=n,t[1]=b);let x=b,S;t[2]===n.name?S=t[3]:(S=(0,J.jsx)(`h2`,{className:`truncate text-lg font-semibold text-fg`,children:n.name}),t[2]=n.name,t[3]=S);let C=n.enabled?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:`bg-surface-hover text-fg-muted`,w;t[4]===C?w=t[5]:(w=_(`shrink-0 rounded-full px-2 py-0.5 text-xs`,C),t[4]=C,t[5]=w);let T=n.enabled?o.enabled:o.paused,E;t[6]!==w||t[7]!==T?(E=(0,J.jsx)(`span`,{className:w,children:T}),t[6]=w,t[7]=T,t[8]=E):E=t[8];let k;t[9]!==S||t[10]!==E?(k=(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[S,E]}),t[9]=S,t[10]=E,t[11]=k):k=t[11];let A;t[12]===n?A=t[13]:(A=tn(n)?(0,J.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:tn(n)}):null,t[12]=n,t[13]=A);let ee;t[14]!==k||t[15]!==A?(ee=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[k,A]}),t[14]=k,t[15]=A,t[16]=ee):ee=t[16];let j;t[17]!==n||t[18]!==u||t[19]!==y||t[20]!==o.dashboard.delete||t[21]!==o.dashboard.deleted||t[22]!==o.dashboard.pause||t[23]!==o.dashboard.resume||t[24]!==o.dashboard.resumed||t[25]!==o.dashboard.runNow||t[26]!==o.details||t[27]!==o.edit||t[28]!==o.experience.deleteConfirm||t[29]!==o.feedback||t[30]!==h||t[31]!==d||t[32]!==x||t[33]!==g||t[34]!==v?(j=x?null:(0,J.jsxs)(`div`,{className:`flex w-full flex-wrap items-center gap-2`,children:[(0,J.jsxs)(D,{variant:`secondary`,disabled:u!==null,onClick:()=>void h(`automation:${n.id}:toggle`,()=>n.enabled?B.pause(n.id):B.resume(n.id),n.enabled?o.feedback.paused:o.dashboard.resumed),children:[v?(0,J.jsx)(me,{className:`size-4 animate-spin`}):n.enabled?(0,J.jsx)(se,{className:`size-4`}):(0,J.jsx)(ge,{className:`size-4`}),n.enabled?o.dashboard.pause:o.dashboard.resume]}),(0,J.jsxs)(D,{variant:`primary`,disabled:u!==null,onClick:()=>void h(`automation:${n.id}:run`,()=>B.runNow(n.id),o.feedback.rerunQueued),children:[g?(0,J.jsx)(me,{className:`size-4 animate-spin`}):(0,J.jsx)(ge,{className:`size-4`}),o.dashboard.runNow]}),(0,J.jsxs)(te,{children:[(0,J.jsx)(ye,{asChild:!0,children:(0,J.jsx)(D,{variant:`ghost`,className:`size-9 p-0`,"aria-label":o.details.moreActions,children:(0,J.jsx)(de,{className:`size-4`})})}),(0,J.jsx)(I,{children:(0,J.jsxs)(ie,{align:`end`,className:`z-70 min-w-40 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:[(0,J.jsxs)(P,{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,J.jsx)(fe,{className:`size-4`}),o.edit]}),(0,J.jsxs)(P,{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)&&h(`automation:${n.id}:delete`,()=>B.remove(n.id),o.dashboard.deleted)},children:[y?(0,J.jsx)(me,{className:`size-4 animate-spin`}):(0,J.jsx)(N,{className:`size-4`}),o.dashboard.delete]})]})})]})]}),t[17]=n,t[18]=u,t[19]=y,t[20]=o.dashboard.delete,t[21]=o.dashboard.deleted,t[22]=o.dashboard.pause,t[23]=o.dashboard.resume,t[24]=o.dashboard.resumed,t[25]=o.dashboard.runNow,t[26]=o.details,t[27]=o.edit,t[28]=o.experience.deleteConfirm,t[29]=o.feedback,t[30]=h,t[31]=d,t[32]=x,t[33]=g,t[34]=v,t[35]=j):j=t[35];let M;t[36]!==j||t[37]!==ee?(M=(0,J.jsxs)(`header`,{className:`flex flex-col items-start gap-3 border-b border-edge px-5 py-4`,children:[ee,j]}),t[36]=j,t[37]=ee,t[38]=M):M=t[38];let F;t[39]===o.dashboard.latestResult?F=t[40]:(F=(0,J.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:o.dashboard.latestResult}),t[39]=o.dashboard.latestResult,t[40]=F);let L;t[41]!==o.experience.viewResult||t[42]!==f||t[43]!==r[0]?(L=r[0]?(0,J.jsx)(D,{variant:`secondary`,onClick:()=>f(r[0].id),children:o.experience.viewResult}):null,t[41]=o.experience.viewResult,t[42]=f,t[43]=r[0],t[44]=L):L=t[44];let ne;t[45]!==F||t[46]!==L?(ne=(0,J.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[F,L]}),t[45]=F,t[46]=L,t[47]=ne):ne=t[47];let re;t[48]!==o||t[49]!==c||t[50]!==r[0]||t[51]!==a||t[52]!==i?(re=a?(0,J.jsx)(`p`,{role:`alert`,className:`text-sm text-red-700 dark:text-red-300`,children:a}):i?(0,J.jsx)(O,{className:`h-28 w-full`}):r[0]?(0,J.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-edge-subtle bg-surface-base p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[(0,J.jsx)(`span`,{className:_(`rounded-full px-2 py-0.5`,Jt(r[0].status)),children:o.status[r[0].status]}),Gt(r[0].createdAtMs,o,c)]}),(0,J.jsx)(m,{content:r[0].error||r[0].summary||(Xt(r[0])?o.runDetail.resultPending:o.runDetail.noResult),compact:!0})]}):(0,J.jsx)(`p`,{className:`text-sm text-fg-muted`,children:o.experience.noRuns}),t[48]=o,t[49]=c,t[50]=r[0],t[51]=a,t[52]=i,t[53]=re):re=t[53];let R;t[54]!==n||t[55]!==o||t[56]!==c?(R=n.enabled?`${o.next}: ${Ct(n,o,c)}`:o.paused,t[54]=n,t[55]=o,t[56]=c,t[57]=R):R=t[57];let z;t[58]===R?z=t[59]:(z=(0,J.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:R}),t[58]=R,t[59]=z);let oe;t[60]!==ne||t[61]!==re||t[62]!==z?(oe=(0,J.jsxs)(`section`,{children:[ne,re,z]}),t[60]=ne,t[61]=re,t[62]=z,t[63]=oe):oe=t[63];let ce;t[64]===o.dashboard.runHistory?ce=t[65]:(ce=(0,J.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:o.dashboard.runHistory}),t[64]=o.dashboard.runHistory,t[65]=ce);let le;t[66]===o.dashboard.runHistoryDescription?le=t[67]:(le=(0,J.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:o.dashboard.runHistoryDescription}),t[66]=o.dashboard.runHistoryDescription,t[67]=le);let ue;t[68]!==ce||t[69]!==le?(ue=(0,J.jsxs)(`div`,{children:[ce,le]}),t[68]=ce,t[69]=le,t[70]=ue):ue=t[70];let pe;t[71]===r.length?pe=t[72]:(pe=(0,J.jsx)(`span`,{className:`rounded-full bg-surface-base px-2.5 py-1 text-xs text-fg-muted`,children:r.length}),t[71]=r.length,t[72]=pe);let V;t[73]!==ue||t[74]!==pe?(V=(0,J.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[ue,pe]}),t[73]=ue,t[74]=pe,t[75]=V):V=t[75];let he;t[76]!==o||t[77]!==c||t[78]!==f||t[79]!==r||t[80]!==i?(he=i?(0,J.jsx)(O,{className:`h-24 w-full`}):r.length===0?(0,J.jsx)(Dn,{className:`min-h-24 py-6`,icon:(0,J.jsx)(ae,{className:`size-5`}),title:o.empty.runs}):(0,J.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,J.jsxs)(`button`,{type:`button`,className:`block w-full p-3 text-left hover:bg-surface-hover`,onClick:()=>f(e.id),children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[e.status===`succeeded`?(0,J.jsx)(p,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-300`}):(0,J.jsx)(ae,{className:`size-4 shrink-0 text-fg-muted`}),(0,J.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:Gt(e.createdAtMs,o,c)})]}),(0,J.jsx)(`span`,{className:_(`shrink-0 rounded-full px-2 py-0.5 text-xs`,Jt(e.status)),children:o.status[e.status]})]}),(0,J.jsx)(`p`,{className:_(`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||Kt(e.actionSnapshot,o)})]},e.id))}),t[76]=o,t[77]=c,t[78]=f,t[79]=r,t[80]=i,t[81]=he):he=t[81];let _e;t[82]!==V||t[83]!==he?(_e=(0,J.jsxs)(`section`,{className:`min-w-0`,children:[V,he]}),t[82]=V,t[83]=he,t[84]=_e):_e=t[84];let ve;t[85]===o.experience.settings?ve=t[86]:(ve=(0,J.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:o.experience.settings}),t[85]=o.experience.settings,t[86]=ve);let H;t[87]!==n||t[88]!==o?(H=Qt(n,o),t[87]=n,t[88]=o,t[89]=H):H=t[89];let be;t[90]===H?be=t[91]:(be=(0,J.jsx)(m,{content:H,compact:!0}),t[90]=H,t[91]=be);let U;t[92]!==n||t[93]!==s||t[94]!==o||t[95]!==c||t[96]!==l?(U=(0,J.jsx)(xn,{automation:n,labels:o,cronLabels:s,language:c,projects:l}),t[92]=n,t[93]=s,t[94]=o,t[95]=c,t[96]=l,t[97]=U):U=t[97];let W;t[98]!==be||t[99]!==U?(W=(0,J.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[be,U]}),t[98]=be,t[99]=U,t[100]=W):W=t[100];let xe;t[101]!==ve||t[102]!==W?(xe=(0,J.jsxs)(`details`,{className:`rounded-lg border border-edge-subtle p-4`,children:[ve,W]}),t[101]=ve,t[102]=W,t[103]=xe):xe=t[103];let Se;t[104]!==_e||t[105]!==xe?(Se=(0,J.jsxs)(`div`,{className:`grid gap-5`,children:[_e,xe]}),t[104]=_e,t[105]=xe,t[106]=Se):Se=t[106];let G;t[107]!==oe||t[108]!==Se?(G=(0,J.jsxs)(`div`,{className:`grid gap-5 p-5`,children:[oe,Se]}),t[107]=oe,t[108]=Se,t[109]=G):G=t[109];let Ce;return t[110]!==M||t[111]!==G?(Ce=(0,J.jsxs)(`article`,{className:`min-w-0 overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel shadow-surface`,children:[M,G]}),t[110]=M,t[111]=G,t[112]=Ce):Ce=t[112],Ce}function bn(e,t){return e===`suggest_only`?t.safety.suggestOnlyDescription:e===`ask_before_apply`?t.safety.askBeforeApplyDescription:t.safety.autoApplyDescription}function xn(e){let t=(0,we.c)(146),{automation:n,labels:r,cronLabels:i,language:a,projects:o}=e,s,c,l,u,d,f,p,m,h,g,_;if(t[0]!==n||t[1]!==i||t[2]!==r||t[3]!==a){let e=qt(n),o;t[15]!==n||t[16]!==r||t[17]!==a?(o=Ct(n,r,a),t[15]=n,t[16]=r,t[17]=a,t[18]=o):o=t[18];let v=o,y;t[19]!==n.state.nextRunAtMs||t[20]!==a?(y=n.state.nextRunAtMs?vt(n.state.nextRunAtMs,a):void 0,t[19]=n.state.nextRunAtMs,t[20]=a,t[21]=y):y=t[21];let b=y;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(_=[],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],_.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],_.push(i),e.anchorMs){let n=r.info.anchor,i;t[46]!==a||t[47]!==e.anchorMs?(i=vt(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],_.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],_.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],_.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],_.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],_.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],_.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],_.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]=_}else _=t[39];h=`h-fit overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,t[70]===r.info.overview?g=t[71]:(g=(0,J.jsx)(`div`,{className:`border-b border-edge-subtle px-4 py-3`,children:(0,J.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:r.info.overview})}),t[70]=r.info.overview,t[71]=g),f=`grid gap-4 p-4`;let x;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,J.jsx)(V,{className:`size-4`,"aria-hidden":!0}),t[72]=x):x=t[72];let S=r.info.schedule,C;t[73]!==n.trigger||t[74]!==i||t[75]!==r||t[76]!==a?(C=St(n.trigger,r,i,a),t[73]=n.trigger,t[74]=i,t[75]=r,t[76]=a,t[77]=C):C=t[77];let w=n.enabled?`${r.info.nextRun}:${v}`:v;t[78]!==r.info.schedule||t[79]!==b||t[80]!==C||t[81]!==w?(p=(0,J.jsx)(Cn,{icon:x,label:S,value:C,description:w,descriptionTitle:b}),t[78]=r.info.schedule,t[79]=b,t[80]=C,t[81]=w,t[82]=p):p=t[82];let T;t[83]===n.action.kind?T=t[84]:(T=n.action.kind===`workflow`?(0,J.jsx)(le,{className:`size-4`,"aria-hidden":!0}):n.action.kind===`browser_automation`?(0,J.jsx)(j,{className:`size-4`,"aria-hidden":!0}):(0,J.jsx)(ce,{className:`size-4`,"aria-hidden":!0}),t[83]=n.action.kind,t[84]=T);let E=r.info.action,D;t[85]!==n.action||t[86]!==r?(D=Kt(n.action,r),t[85]=n.action,t[86]=r,t[87]=D):D=t[87],t[88]!==r.info.action||t[89]!==T||t[90]!==D?(m=(0,J.jsx)(Cn,{icon:T,label:E,value:D}),t[88]=r.info.action,t[89]=T,t[90]=D,t[91]=m):m=t[91],s=Cn,t[92]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,J.jsx)(F,{className:`size-4`,"aria-hidden":!0}),t[92]=c):c=t[92],l=r.info.permission,u=r.safety[e],d=bn(e,r),t[0]=n,t[1]=i,t[2]=r,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_}else s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14];let v;t[93]!==s||t[94]!==c||t[95]!==l||t[96]!==u||t[97]!==d?(v=(0,J.jsx)(s,{icon:c,label:l,value:u,description:d}),t[93]=s,t[94]=c,t[95]=l,t[96]=u,t[97]=d,t[98]=v):v=t[98];let y;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,J.jsx)(le,{className:`size-4`,"aria-hidden":!0}),t[99]=y):y=t[99];let b;t[100]!==n.projectId||t[101]!==r.info.noProject||t[102]!==o?(b=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]=b):b=t[103];let x;t[104]!==r.info.project||t[105]!==b?(x=(0,J.jsx)(Cn,{icon:y,label:r.info.project,value:b}),t[104]=r.info.project,t[105]=b,t[106]=x):x=t[106];let S;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,J.jsx)(re,{className:`size-4`,"aria-hidden":!0}),t[107]=S):S=t[107];let C=n.conversationMode===`continuous`?r.info.continuousConversation:r.info.newConversation,w;t[108]!==r.info.conversation||t[109]!==C?(w=(0,J.jsx)(Cn,{icon:S,label:r.info.conversation,value:C}),t[108]=r.info.conversation,t[109]=C,t[110]=w):w=t[110];let T;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,J.jsx)(he,{className:`size-4`,"aria-hidden":!0}),t[111]=T):T=t[111];let E=n.notificationPolicy===`all`?r.info.notifyAll:n.notificationPolicy===`none`?r.info.notifyNone:r.info.notifyAttention,D;t[112]!==r.info.notifications||t[113]!==E?(D=(0,J.jsx)(Cn,{icon:T,label:r.info.notifications,value:E}),t[112]=r.info.notifications,t[113]=E,t[114]=D):D=t[114];let O;t[115]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,J.jsx)(ae,{className:`size-4`,"aria-hidden":!0}),t[115]=O):O=t[115];let k=r.info.lastRun,A;t[116]!==n||t[117]!==r||t[118]!==a?(A=wt(n,r,a),t[116]=n,t[117]=r,t[118]=a,t[119]=A):A=t[119];let ee=n.state.lastRunStatus===`failed`||n.state.lastRunStatus===`timeout`?`danger`:`default`,M;t[120]!==r.info.lastRun||t[121]!==A||t[122]!==ee?(M=(0,J.jsx)(Cn,{icon:O,label:k,value:A,valueTone:ee}),t[120]=r.info.lastRun,t[121]=A,t[122]=ee,t[123]=M):M=t[123];let N;t[124]!==n.state.consecutiveFailures||t[125]!==n.state.lastError||t[126]!==r.dashboard?(N=n.state.consecutiveFailures?(0,J.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,J.jsx)(`p`,{className:`mt-1 break-words text-xs`,children:n.state.lastError}):null]}):n.state.lastError?(0,J.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]=N):N=t[127];let P;t[128]!==r.info.technicalDetails||t[129]!==_?(P=_.length>0?(0,J.jsxs)(`details`,{className:`group border-t border-edge-subtle pt-3`,children:[(0,J.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,J.jsx)(`span`,{children:r.info.technicalDetails}),(0,J.jsx)(ue,{className:`size-4 transition-transform group-open:rotate-180`,"aria-hidden":!0})]}),(0,J.jsx)(`div`,{className:`mt-3 grid gap-2`,children:_.map(Sn)})]}):null,t[128]=r.info.technicalDetails,t[129]=_,t[130]=P):P=t[130];let I;t[131]!==v||t[132]!==x||t[133]!==w||t[134]!==D||t[135]!==M||t[136]!==N||t[137]!==P||t[138]!==f||t[139]!==p||t[140]!==m?(I=(0,J.jsxs)(`div`,{className:f,children:[p,m,v,x,w,D,M,N,P]}),t[131]=v,t[132]=x,t[133]=w,t[134]=D,t[135]=M,t[136]=N,t[137]=P,t[138]=f,t[139]=p,t[140]=m,t[141]=I):I=t[141];let L;return t[142]!==I||t[143]!==h||t[144]!==g?(L=(0,J.jsxs)(`aside`,{className:h,children:[g,I]}),t[142]=I,t[143]=h,t[144]=g,t[145]=L):L=t[145],L}function Sn(e){return(0,J.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,J.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:e.label}),(0,J.jsx)(`span`,{className:`break-all font-mono text-xs text-fg-muted`,children:e.value})]},`${e.label}:${e.value}`)}function Cn(e){let t=(0,we.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,J.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,J.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=_(`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,J.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,J.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,J.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,J.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 wn(e){let t=(0,we.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,J.jsx)(`span`,{children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,J.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,J.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 Tn(e){return e.endsWith(`.failed`)?`bg-red-500`:e.endsWith(`.completed`)?`bg-emerald-500`:e.endsWith(`.started`)?`bg-blue-500`:`bg-fg-muted`}function En(e){let t=(0,we.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,J.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,J.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,J.jsxs)(`div`,{className:`min-w-0`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Dn(e){let t=(0,we.c)(8),{className:n,icon:r,title:i}=e,a;t[0]===n?a=t[1]:(a=_(`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,J.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,J.jsxs)(`div`,{className:a,children:[r,o]}),t[4]=r,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function On(e){let t=(0,we.c)(274),{form:n,labels:r,setForm:i,projects:a,workflowDefinitions:o,selectedWorkflow:s,workflowsLoading:c,browserAutomations:u,selectedBrowserAutomation:f,browserAutomationsLoading:p,agentOptions:m,agentsLoading:h,language:g,projectLocked:v}=e,b=v===void 0?!1:v,x=y(g).agentsSettings,S;t[0]===i?S=t[1]:(S=e=>i(t=>({...t,...e})),t[0]=i,t[1]=S);let C=S,w=mt(n.intervalValue,n.intervalUnit),T=Date.now(),E;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(E=[1,2,3],t[2]=E):E=t[2];let D;t[3]!==w||t[4]!==T||t[5]!==g?(D=E.map(e=>bt(T+w*e,g,T)),t[3]=w,t[4]=T,t[5]=g,t[6]=D):D=t[6];let O=D,k,A;t[7]!==n.actionMode||t[8]!==n.workflowId||t[9]!==i||t[10]!==o?(k=()=>{if(n.actionMode!==`workflow`||n.workflowId.trim())return;let e=o[0]?.id;e&&i(t=>({...t,workflowId:e,workflowGoal:``,workflowInput:{goal:``,argValues:{},schemaInput:{},concurrency:``,maxSubagents:``},workflowInputValid:!0}))},A=[n.actionMode,n.workflowId,i,o],t[7]=n.actionMode,t[8]=n.workflowId,t[9]=i,t[10]=o,t[11]=k,t[12]=A):(k=t[11],A=t[12]),(0,q.useEffect)(k,A);let ee,j;t[13]!==u||t[14]!==n.actionMode||t[15]!==n.browserAutomationId||t[16]!==i?(ee=()=>{if(n.actionMode!==`browser_automation`||n.browserAutomationId.trim())return;let e=u[0];e&&i(t=>({...t,browserAutomationId:e.id,browserAutomationInputs:Ce(e)}))},j=[u,n.actionMode,n.browserAutomationId,i],t[13]=u,t[14]=n.actionMode,t[15]=n.browserAutomationId,t[16]=i,t[17]=ee,t[18]=j):(ee=t[17],j=t[18]),(0,q.useEffect)(ee,j);let N;t[19]===C?N=t[20]:(N=e=>C({name:e.target.value}),t[19]=C,t[20]=N);let P;t[21]!==n.name||t[22]!==N?(P=(0,J.jsx)(`input`,{className:Mn,value:n.name,onChange:N}),t[21]=n.name,t[22]=N,t[23]=P):P=t[23];let F;t[24]!==r.form.name||t[25]!==P?(F=(0,J.jsx)(Nn,{label:r.form.name,children:P}),t[24]=r.form.name,t[25]=P,t[26]=F):F=t[26];let I;t[27]===C?I=t[28]:(I=e=>C({description:e.target.value}),t[27]=C,t[28]=I);let L;t[29]!==n.description||t[30]!==I?(L=(0,J.jsx)(`input`,{className:Mn,value:n.description,onChange:I}),t[29]=n.description,t[30]=I,t[31]=L):L=t[31];let te;t[32]!==r.form.description||t[33]!==L?(te=(0,J.jsx)(Nn,{label:r.form.description,children:L}),t[32]=r.form.description,t[33]=L,t[34]=te):te=t[34];let ne;t[35]!==n.projectId||t[36]!==r.form.noProject||t[37]!==r.form.project||t[38]!==b||t[39]!==a||t[40]!==C?(ne=b?null:(0,J.jsx)(Nn,{label:r.form.project,children:(0,J.jsxs)(l,{className:Mn,value:n.projectId,onChange:e=>C({projectId:e.target.value}),children:[(0,J.jsx)(d,{value:``,children:r.form.noProject}),a.map(jn)]})}),t[35]=n.projectId,t[36]=r.form.noProject,t[37]=r.form.project,t[38]=b,t[39]=a,t[40]=C,t[41]=ne):ne=t[41];let re;t[42]===r.form.trigger?re=t[43]:(re=(0,J.jsx)(Pn,{title:r.form.trigger}),t[42]=r.form.trigger,t[43]=re);let ie;t[44]===C?ie=t[45]:(ie=e=>C({triggerMode:e.target.value}),t[44]=C,t[45]=ie);let ae;t[46]===r.trigger.manual?ae=t[47]:(ae=(0,J.jsx)(d,{value:`manual`,children:r.trigger.manual}),t[46]=r.trigger.manual,t[47]=ae);let R;t[48]===r.trigger.once?R=t[49]:(R=(0,J.jsx)(d,{value:`once`,children:r.trigger.once}),t[48]=r.trigger.once,t[49]=R);let z;t[50]===r.trigger.daily?z=t[51]:(z=(0,J.jsx)(d,{value:`daily`,children:r.trigger.daily}),t[50]=r.trigger.daily,t[51]=z);let oe;t[52]===r.trigger.weekly?oe=t[53]:(oe=(0,J.jsx)(d,{value:`weekly`,children:r.trigger.weekly}),t[52]=r.trigger.weekly,t[53]=oe);let se;t[54]===r.trigger.interval?se=t[55]:(se=(0,J.jsx)(d,{value:`interval`,children:r.trigger.interval}),t[54]=r.trigger.interval,t[55]=se);let ce;t[56]===r.trigger.customCron?ce=t[57]:(ce=(0,J.jsx)(d,{value:`cron`,children:r.trigger.customCron}),t[56]=r.trigger.customCron,t[57]=ce);let le;t[58]===r.trigger.webhook?le=t[59]:(le=(0,J.jsx)(d,{value:`webhook`,children:r.trigger.webhook}),t[58]=r.trigger.webhook,t[59]=le);let de;t[60]===r.trigger.taskBlocked?de=t[61]:(de=(0,J.jsx)(d,{value:`taskBlocked`,children:r.trigger.taskBlocked}),t[60]=r.trigger.taskBlocked,t[61]=de);let B;t[62]===r.trigger.noteCreated?B=t[63]:(B=(0,J.jsx)(d,{value:`noteCreated`,children:r.trigger.noteCreated}),t[62]=r.trigger.noteCreated,t[63]=B);let fe;t[64]===r.trigger.workflowFailed?fe=t[65]:(fe=(0,J.jsx)(d,{value:`workflowFailed`,children:r.trigger.workflowFailed}),t[64]=r.trigger.workflowFailed,t[65]=fe);let pe;t[66]===r.trigger.sessionUpdated?pe=t[67]:(pe=(0,J.jsx)(d,{value:`sessionUpdated`,children:r.trigger.sessionUpdated}),t[66]=r.trigger.sessionUpdated,t[67]=pe);let me;t[68]===r.trigger.customEvent?me=t[69]:(me=(0,J.jsx)(d,{value:`event`,children:r.trigger.customEvent}),t[68]=r.trigger.customEvent,t[69]=me);let V;t[70]!==n.triggerMode||t[71]!==ie||t[72]!==ae||t[73]!==R||t[74]!==z||t[75]!==oe||t[76]!==se||t[77]!==ce||t[78]!==le||t[79]!==de||t[80]!==B||t[81]!==fe||t[82]!==pe||t[83]!==me?(V=(0,J.jsxs)(l,{className:Mn,value:n.triggerMode,onChange:ie,children:[ae,R,z,oe,se,ce,le,de,B,fe,pe,me]}),t[70]=n.triggerMode,t[71]=ie,t[72]=ae,t[73]=R,t[74]=z,t[75]=oe,t[76]=se,t[77]=ce,t[78]=le,t[79]=de,t[80]=B,t[81]=fe,t[82]=pe,t[83]=me,t[84]=V):V=t[84];let he;t[85]!==n.onceAt||t[86]!==n.triggerMode||t[87]!==r.form.onceAt||t[88]!==C?(he=n.triggerMode===`once`?(0,J.jsx)(Nn,{label:r.form.onceAt,children:(0,J.jsx)(`input`,{className:Mn,type:`datetime-local`,value:n.onceAt,onChange:e=>C({onceAt:e.target.value})})}):null,t[85]=n.onceAt,t[86]=n.triggerMode,t[87]=r.form.onceAt,t[88]=C,t[89]=he):he=t[89];let ge;t[90]!==n.time||t[91]!==n.triggerMode||t[92]!==n.weekday||t[93]!==r.form.day||t[94]!==r.form.time||t[95]!==r.weekdays||t[96]!==C?(ge=n.triggerMode===`daily`||n.triggerMode===`weekly`?(0,J.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,J.jsx)(Nn,{label:r.form.time,children:(0,J.jsx)(Oe,{value:n.time,onChange:e=>C({time:e}),ariaLabel:r.form.time})}),n.triggerMode===`weekly`?(0,J.jsx)(Nn,{label:r.form.day,children:(0,J.jsxs)(l,{className:Mn,value:n.weekday,onChange:e=>C({weekday:e.target.value}),children:[(0,J.jsx)(d,{value:`1`,children:r.weekdays.monday}),(0,J.jsx)(d,{value:`2`,children:r.weekdays.tuesday}),(0,J.jsx)(d,{value:`3`,children:r.weekdays.wednesday}),(0,J.jsx)(d,{value:`4`,children:r.weekdays.thursday}),(0,J.jsx)(d,{value:`5`,children:r.weekdays.friday}),(0,J.jsx)(d,{value:`6`,children:r.weekdays.saturday}),(0,J.jsx)(d,{value:`0`,children:r.weekdays.sunday})]})}):null]}):null,t[90]=n.time,t[91]=n.triggerMode,t[92]=n.weekday,t[93]=r.form.day,t[94]=r.form.time,t[95]=r.weekdays,t[96]=C,t[97]=ge):ge=t[97];let _e=n.triggerMode===`interval`?(0,J.jsxs)(`div`,{className:`grid gap-3 rounded-lg border border-edge-subtle bg-surface-base p-3`,children:[(0,J.jsx)(Nn,{label:r.form.intervalEvery,children:(0,J.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,J.jsx)(`input`,{className:Mn,type:`number`,min:6e4/mt(1,n.intervalUnit),step:`any`,inputMode:`decimal`,value:n.intervalValue,onChange:e=>C({intervalValue:e.target.value})}),(0,J.jsxs)(l,{className:Mn,value:n.intervalUnit,onChange:e=>{let t=e.target.value;C({intervalValue:ht(n.intervalValue,n.intervalUnit,t),intervalUnit:t})},children:[(0,J.jsx)(d,{value:`minute`,children:r.form.intervalUnits.minute}),(0,J.jsx)(d,{value:`hour`,children:r.form.intervalUnits.hour}),(0,J.jsx)(d,{value:`day`,children:r.form.intervalUnits.day}),(0,J.jsx)(d,{value:`week`,children:r.form.intervalUnits.week})]})]})}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:r.form.commonIntervals}),(0,J.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:Et.map(e=>{let t=mt(e.value,e.unit),n=t===w;return(0,J.jsx)(`button`,{type:`button`,"aria-pressed":n,className:_(`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:()=>C({intervalValue:e.value,intervalUnit:e.unit}),children:gt(t,g)},`${e.value}:${e.unit}`)})})]}),(0,J.jsxs)(`div`,{className:`rounded-lg bg-surface-panel px-3 py-2.5`,children:[(0,J.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:_t(w,g)}),(0,J.jsxs)(`div`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:[r.form.nextThreeRuns,`:`,O.join(g===`zh`?`、`:`, `)]}),(0,J.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:r.form.fixedIntervalHint})]})]}):null,ve;t[98]!==n.cronExpr||t[99]!==n.triggerMode||t[100]!==r.form.expression||t[101]!==C?(ve=n.triggerMode===`cron`?(0,J.jsx)(Nn,{label:r.form.expression,children:(0,J.jsx)(`input`,{className:Mn,value:n.cronExpr,onChange:e=>C({cronExpr:e.target.value})})}):null,t[98]=n.cronExpr,t[99]=n.triggerMode,t[100]=r.form.expression,t[101]=C,t[102]=ve):ve=t[102];let ye;t[103]!==n.triggerMode||t[104]!==n.webhookSecretId||t[105]!==r.form.secretId||t[106]!==C?(ye=n.triggerMode===`webhook`?(0,J.jsx)(Nn,{label:r.form.secretId,children:(0,J.jsx)(`input`,{className:Mn,value:n.webhookSecretId,onChange:e=>C({webhookSecretId:e.target.value})})}):null,t[103]=n.triggerMode,t[104]=n.webhookSecretId,t[105]=r.form.secretId,t[106]=C,t[107]=ye):ye=t[107];let be;t[108]!==n.eventPayloadMatch||t[109]!==n.eventSource||t[110]!==n.eventType||t[111]!==n.triggerMode||t[112]!==r.form.eventPayloadMatch||t[113]!==r.form.eventSource||t[114]!==r.form.eventType||t[115]!==r.form.invalidJsonObject||t[116]!==C?(be=n.triggerMode===`event`?(0,J.jsxs)(`div`,{className:`grid gap-3 rounded-lg border border-edge-subtle bg-surface-base p-3`,children:[(0,J.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,J.jsx)(Nn,{label:r.form.eventType,children:(0,J.jsx)(`input`,{className:Mn,value:n.eventType,onChange:e=>C({eventType:e.target.value})})}),(0,J.jsx)(Nn,{label:r.form.eventSource,children:(0,J.jsx)(`input`,{className:Mn,value:n.eventSource,onChange:e=>C({eventSource:e.target.value})})})]}),(0,J.jsxs)(Nn,{label:r.form.eventPayloadMatch,children:[(0,J.jsx)(`textarea`,{className:_(Mn,`min-h-24 resize-y font-mono text-xs`),value:n.eventPayloadMatch,onChange:e=>C({eventPayloadMatch:e.target.value}),placeholder:`{
6
+ "status": "blocked"
7
+ }`}),Nt(n.eventPayloadMatch)?null:(0,J.jsx)(`span`,{className:`text-xs text-red-700 dark:text-red-300`,children:r.form.invalidJsonObject})]})]}):null,t[108]=n.eventPayloadMatch,t[109]=n.eventSource,t[110]=n.eventType,t[111]=n.triggerMode,t[112]=r.form.eventPayloadMatch,t[113]=r.form.eventSource,t[114]=r.form.eventType,t[115]=r.form.invalidJsonObject,t[116]=C,t[117]=be):be=t[117];let U;t[118]===r.form.action?U=t[119]:(U=(0,J.jsx)(Pn,{title:r.form.action}),t[118]=r.form.action,t[119]=U);let W;t[120]!==n.timeoutSeconds||t[121]!==n.workflowId||t[122]!==C||t[123]!==o?(W=e=>{let t=e.target.value,r=Number.parseInt(n.timeoutSeconds,10);C({actionMode:t,...r===600||r===1800?{timeoutSeconds:t===`browser_automation`?`600`:`1800`}:{},...t===`browser_automation`?{safetyMode:`auto_apply`}:{},...t===`workflow`&&!n.workflowId.trim()&&o[0]?{workflowId:o[0].id,workflowGoal:``,workflowInput:{goal:``,argValues:{},schemaInput:{},concurrency:``,maxSubagents:``},workflowInputValid:!0}:{}})},t[120]=n.timeoutSeconds,t[121]=n.workflowId,t[122]=C,t[123]=o,t[124]=W):W=t[124];let Se;t[125]===r.action.runAgent?Se=t[126]:(Se=(0,J.jsx)(d,{value:`agent`,children:r.action.runAgent}),t[125]=r.action.runAgent,t[126]=Se);let G;t[127]===r.action.runWorkflow?G=t[128]:(G=(0,J.jsx)(d,{value:`workflow`,children:r.action.runWorkflow}),t[127]=r.action.runWorkflow,t[128]=G);let Te=g===`zh`?`浏览器自动化`:`Browser automation`,Y;t[129]===Te?Y=t[130]:(Y=(0,J.jsx)(d,{value:`browser_automation`,children:Te}),t[129]=Te,t[130]=Y);let Ee;t[131]!==n.actionMode||t[132]!==W||t[133]!==Se||t[134]!==G||t[135]!==Y?(Ee=(0,J.jsxs)(l,{className:Mn,value:n.actionMode,onChange:W,children:[Se,G,Y]}),t[131]=n.actionMode,t[132]=W,t[133]=Se,t[134]=G,t[135]=Y,t[136]=Ee):Ee=t[136];let De=n.actionMode===`browser_automation`?null:(0,J.jsx)(Nn,{label:r.form.agent,children:(0,J.jsxs)(l,{className:Mn,value:n.agentId,onChange:e=>C({agentId:e.target.value}),children:[(0,J.jsx)(d,{value:``,children:h?r.form.loadingAgents:r.form.defaultAgent}),m.map(e=>(0,J.jsx)(d,{value:e.id,children:M(e,x)},e.id))]})}),ke;t[137]!==u||t[138]!==p||t[139]!==n.actionMode||t[140]!==n.agentId||t[141]!==n.browserAutomationId||t[142]!==n.browserAutomationInputs||t[143]!==n.description||t[144]!==n.instruction||t[145]!==n.name||t[146]!==n.triggerMode||t[147]!==n.workflowId||t[148]!==n.workflowInput||t[149]!==r.form.instruction||t[150]!==r.form.loadingWorkflows||t[151]!==r.form.noWorkflows||t[152]!==r.form.triggeredRun||t[153]!==r.form.workflow||t[154]!==g||t[155]!==f||t[156]!==s||t[157]!==C||t[158]!==o||t[159]!==c?(ke=n.actionMode===`agent`?(0,J.jsxs)(Nn,{label:r.form.instruction,children:[(0,J.jsx)(`div`,{className:`flex justify-end`,children:(0,J.jsx)(H,{value:n.instruction,onApply:e=>C({instruction:e}),fieldId:`automation.instruction`,fieldLabel:r.form.instruction,scenario:`automation.instruction`,locale:g,context:{automationName:n.name,automationDescription:n.description,triggerMode:n.triggerMode,agentId:n.agentId},showLabel:!1})}),(0,J.jsx)(`textarea`,{className:_(Mn,`min-h-32 resize-y`),value:n.instruction,onChange:e=>C({instruction:e.target.value})})]}):n.actionMode===`workflow`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Nn,{label:r.form.workflow,children:(0,J.jsxs)(l,{className:Mn,value:n.workflowId,onChange:e=>C({workflowId:e.target.value,workflowGoal:``,workflowInput:{goal:``,argValues:{},schemaInput:{},concurrency:``,maxSubagents:``},workflowInputValid:!0}),disabled:c||o.length===0,children:[c?(0,J.jsx)(d,{value:``,children:r.form.loadingWorkflows}):null,!c&&o.length===0?(0,J.jsx)(d,{value:``,children:r.form.noWorkflows}):null,o.map(An)]})}),s?(0,J.jsx)(xe,{definition:s,language:g,value:n.workflowInput,onChange:e=>C({workflowInput:e,workflowGoal:e.goal,workflowInputValid:!0}),mode:`automation`,badgeLabel:r.form.triggeredRun,onValidityChange:e=>C({workflowInputValid:e.valid}),aiAssist:{inputScenario:`automation.workflowInput`,goalScenario:`automation.workflowGoal`,context:{automationName:n.name,automationDescription:n.description,triggerMode:n.triggerMode,workflowId:s.id,workflowTitle:s.title,workflowDescription:s.description}},inputClassName:`rounded-lg`}):null]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Nn,{label:g===`zh`?`浏览器自动化`:`Browser automation`,children:(0,J.jsxs)(l,{className:Mn,value:n.browserAutomationId,onChange:e=>{let t=u.find(t=>t.id===e.target.value);C({browserAutomationId:e.target.value,browserAutomationInputs:t?Ce(t):{}})},disabled:p||u.length===0,children:[u.length===0?(0,J.jsx)(d,{value:``,children:g===`zh`?`没有已启用的浏览器自动化`:`No enabled browser automations`}):null,u.map(kn)]})}),f&&Object.keys(f.inputs).length>0?(0,J.jsx)(Nn,{label:g===`zh`?`运行时填写`:`Run inputs`,children:(0,J.jsx)(K,{automation:f,values:n.browserAutomationInputs,language:g,onChange:e=>C({browserAutomationInputs:e})})}):null]}),t[137]=u,t[138]=p,t[139]=n.actionMode,t[140]=n.agentId,t[141]=n.browserAutomationId,t[142]=n.browserAutomationInputs,t[143]=n.description,t[144]=n.instruction,t[145]=n.name,t[146]=n.triggerMode,t[147]=n.workflowId,t[148]=n.workflowInput,t[149]=r.form.instruction,t[150]=r.form.loadingWorkflows,t[151]=r.form.noWorkflows,t[152]=r.form.triggeredRun,t[153]=r.form.workflow,t[154]=g,t[155]=f,t[156]=s,t[157]=C,t[158]=o,t[159]=c,t[160]=ke):ke=t[160];let Ae;t[161]===r.form.advancedDescription?Ae=t[162]:(Ae=(0,J.jsx)(`span`,{className:`ml-2 text-xs font-normal text-fg-muted`,children:r.form.advancedDescription}),t[161]=r.form.advancedDescription,t[162]=Ae);let X;t[163]!==r.form.advanced||t[164]!==Ae?(X=(0,J.jsxs)(`span`,{children:[r.form.advanced,Ae]}),t[163]=r.form.advanced,t[164]=Ae,t[165]=X):X=t[165];let je;t[166]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,J.jsx)(ue,{className:`size-4 transition-transform group-open:rotate-180`}),t[166]=je):je=t[166];let Me;t[167]===X?Me=t[168]:(Me=(0,J.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:[X,je]}),t[167]=X,t[168]=Me);let Ne;t[169]!==n.actionMode||t[170]!==n.safetyMode||t[171]!==r.form.safety||t[172]!==r.safety||t[173]!==C?(Ne=n.actionMode===`browser_automation`?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Pn,{title:r.form.safety}),(0,J.jsxs)(Nn,{label:r.form.safety,children:[(0,J.jsxs)(l,{className:Mn,value:n.safetyMode,onChange:e=>{let t=e.target.value;C({safetyMode:t})},children:[(0,J.jsx)(d,{value:`suggest_only`,children:r.safety.suggest_only}),(0,J.jsx)(d,{value:`ask_before_apply`,children:r.safety.ask_before_apply}),(0,J.jsx)(d,{value:`auto_apply`,children:r.safety.auto_apply})]}),(0,J.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})]})]}),t[169]=n.actionMode,t[170]=n.safetyMode,t[171]=r.form.safety,t[172]=r.safety,t[173]=C,t[174]=Ne):Ne=t[174];let Pe;t[175]===r.form.results?Pe=t[176]:(Pe=(0,J.jsx)(Pn,{title:r.form.results}),t[175]=r.form.results,t[176]=Pe);let Fe;t[177]===C?Fe=t[178]:(Fe=e=>C({conversationMode:e.target.value}),t[177]=C,t[178]=Fe);let Ie;t[179]===r.form.newConversation?Ie=t[180]:(Ie=(0,J.jsx)(d,{value:`new_session`,children:r.form.newConversation}),t[179]=r.form.newConversation,t[180]=Ie);let Z;t[181]===r.form.continuousConversation?Z=t[182]:(Z=(0,J.jsx)(d,{value:`continuous`,children:r.form.continuousConversation}),t[181]=r.form.continuousConversation,t[182]=Z);let Q;t[183]!==n.conversationMode||t[184]!==Fe||t[185]!==Ie||t[186]!==Z?(Q=(0,J.jsxs)(l,{className:Mn,value:n.conversationMode,onChange:Fe,children:[Ie,Z]}),t[183]=n.conversationMode,t[184]=Fe,t[185]=Ie,t[186]=Z,t[187]=Q):Q=t[187];let Le;t[188]!==r.form.conversation||t[189]!==Q?(Le=(0,J.jsx)(Nn,{label:r.form.conversation,children:Q}),t[188]=r.form.conversation,t[189]=Q,t[190]=Le):Le=t[190];let Re;t[191]===C?Re=t[192]:(Re=e=>C({notificationPolicy:e.target.value}),t[191]=C,t[192]=Re);let ze;t[193]===r.form.notifyAttention?ze=t[194]:(ze=(0,J.jsx)(d,{value:`attention`,children:r.form.notifyAttention}),t[193]=r.form.notifyAttention,t[194]=ze);let Be;t[195]===r.form.notifyAll?Be=t[196]:(Be=(0,J.jsx)(d,{value:`all`,children:r.form.notifyAll}),t[195]=r.form.notifyAll,t[196]=Be);let Ve;t[197]===r.form.notifyNone?Ve=t[198]:(Ve=(0,J.jsx)(d,{value:`none`,children:r.form.notifyNone}),t[197]=r.form.notifyNone,t[198]=Ve);let He;t[199]!==n.notificationPolicy||t[200]!==Re||t[201]!==ze||t[202]!==Be||t[203]!==Ve?(He=(0,J.jsxs)(l,{className:Mn,value:n.notificationPolicy,onChange:Re,children:[ze,Be,Ve]}),t[199]=n.notificationPolicy,t[200]=Re,t[201]=ze,t[202]=Be,t[203]=Ve,t[204]=He):He=t[204];let Ue;t[205]!==r.form.notifications||t[206]!==He?(Ue=(0,J.jsx)(Nn,{label:r.form.notifications,children:He}),t[205]=r.form.notifications,t[206]=He,t[207]=Ue):Ue=t[207];let We;t[208]!==n.completionWebhookUrl||t[209]!==n.safetyMode||t[210]!==r.form.completionWebhook||t[211]!==C?(We=n.safetyMode===`auto_apply`?(0,J.jsx)(Nn,{label:r.form.completionWebhook,children:(0,J.jsx)(`input`,{className:Mn,value:n.completionWebhookUrl,onChange:e=>C({completionWebhookUrl:e.target.value})})}):null,t[208]=n.completionWebhookUrl,t[209]=n.safetyMode,t[210]=r.form.completionWebhook,t[211]=C,t[212]=We):We=t[212];let Ge;t[213]===r.form.reliability?Ge=t[214]:(Ge=(0,J.jsx)(Pn,{title:r.form.reliability}),t[213]=r.form.reliability,t[214]=Ge);let Ke;t[215]===C?Ke=t[216]:(Ke=e=>C({timeoutSeconds:e.target.value}),t[215]=C,t[216]=Ke);let qe;t[217]!==n.timeoutSeconds||t[218]!==Ke?(qe=(0,J.jsx)(`input`,{className:Mn,inputMode:`numeric`,value:n.timeoutSeconds,onChange:Ke}),t[217]=n.timeoutSeconds,t[218]=Ke,t[219]=qe):qe=t[219];let Je;t[220]!==r.form.timeoutSeconds||t[221]!==qe?(Je=(0,J.jsx)(Nn,{label:r.form.timeoutSeconds,children:qe}),t[220]=r.form.timeoutSeconds,t[221]=qe,t[222]=Je):Je=t[222];let Ye;t[223]===C?Ye=t[224]:(Ye=e=>C({disableAfterFailures:e.target.value}),t[223]=C,t[224]=Ye);let Xe;t[225]!==n.disableAfterFailures||t[226]!==Ye?(Xe=(0,J.jsx)(`input`,{className:Mn,inputMode:`numeric`,value:n.disableAfterFailures,onChange:Ye}),t[225]=n.disableAfterFailures,t[226]=Ye,t[227]=Xe):Xe=t[227];let Ze;t[228]!==r.form.disableAfterFailures||t[229]!==Xe?(Ze=(0,J.jsx)(Nn,{label:r.form.disableAfterFailures,children:Xe}),t[228]=r.form.disableAfterFailures,t[229]=Xe,t[230]=Ze):Ze=t[230];let Qe;t[231]!==Je||t[232]!==Ze?(Qe=(0,J.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Je,Ze]}),t[231]=Je,t[232]=Ze,t[233]=Qe):Qe=t[233];let $;t[234]===r.form.effectivePolicy?$=t[235]:($=(0,J.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:r.form.effectivePolicy}),t[234]=r.form.effectivePolicy,t[235]=$);let $e=n.timeoutSeconds||`—`,et;t[236]!==r.form.executionDeadline||t[237]!==$e?(et=(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[r.form.executionDeadline,`: `,$e,`s`]}),t[236]=r.form.executionDeadline,t[237]=$e,t[238]=et):et=t[238];let tt;t[239]===r.form.downstreamTimeoutHint?tt=t[240]:(tt=(0,J.jsx)(`p`,{className:`mt-0.5 text-xs leading-relaxed text-fg-subtle`,children:r.form.downstreamTimeoutHint}),t[239]=r.form.downstreamTimeoutHint,t[240]=tt);let nt;t[241]!==$||t[242]!==et||t[243]!==tt?(nt=(0,J.jsxs)(`div`,{className:`rounded-lg border border-edge bg-surface-inset/40 px-3 py-2.5`,children:[$,et,tt]}),t[241]=$,t[242]=et,t[243]=tt,t[244]=nt):nt=t[244];let rt;t[245]!==Ne||t[246]!==Pe||t[247]!==Le||t[248]!==Ue||t[249]!==We||t[250]!==Ge||t[251]!==Qe||t[252]!==nt?(rt=(0,J.jsxs)(`div`,{className:`grid gap-4 border-t border-edge-subtle p-4`,children:[Ne,Pe,Le,Ue,We,Ge,Qe,nt]}),t[245]=Ne,t[246]=Pe,t[247]=Le,t[248]=Ue,t[249]=We,t[250]=Ge,t[251]=Qe,t[252]=nt,t[253]=rt):rt=t[253];let it;t[254]!==Me||t[255]!==rt?(it=(0,J.jsxs)(`details`,{className:`group rounded-xl border border-edge-subtle bg-surface-base`,children:[Me,rt]}),t[254]=Me,t[255]=rt,t[256]=it):it=t[256];let at;return t[257]!==F||t[258]!==te||t[259]!==ne||t[260]!==re||t[261]!==V||t[262]!==he||t[263]!==ge||t[264]!==_e||t[265]!==ve||t[266]!==ye||t[267]!==be||t[268]!==U||t[269]!==Ee||t[270]!==De||t[271]!==ke||t[272]!==it?(at=(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:(0,J.jsxs)(`div`,{className:`grid gap-4`,children:[F,te,ne,re,V,he,ge,_e,ve,ye,be,U,Ee,De,ke,it]})}),t[257]=F,t[258]=te,t[259]=ne,t[260]=re,t[261]=V,t[262]=he,t[263]=ge,t[264]=_e,t[265]=ve,t[266]=ye,t[267]=be,t[268]=U,t[269]=Ee,t[270]=De,t[271]=ke,t[272]=it,t[273]=at):at=t[273],at}function kn(e){return(0,J.jsx)(d,{value:e.id,children:e.name},e.id)}function An(e){return(0,J.jsx)(d,{value:e.id,children:e.title||e.name},e.id)}function jn(e){return(0,J.jsx)(d,{value:e.id,children:e.name},e.id)}var Mn=`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 Nn(e){let t=(0,we.c)(5),{label:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,J.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,J.jsxs)(`div`,{className:`grid gap-1.5`,children:[i,r]}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function Pn(e){let t=(0,we.c)(3),{title:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(le,{className:`size-4 text-fg-muted`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,J.jsxs)(`div`,{className:`flex items-center gap-2 pt-2 text-sm font-semibold text-fg`,children:[r,n]}),t[1]=n,t[2]=i),i}export{sn as t};