@xopcai/xopc 0.0.110 → 0.0.112

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 (583) hide show
  1. package/README.md +46 -4
  2. package/README.zh-CN.md +46 -4
  3. package/dist/browser-ext/manifest.json +1 -1
  4. package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
  5. package/dist/extensions/feishu/src/workflow-progress.js +1 -1
  6. package/dist/extensions/telegram/src/adapters/streaming-adapter.js +1 -1
  7. package/dist/extensions/telegram/src/inbound-processor.js +1 -1
  8. package/dist/extensions/telegram/src/plugin.js +1 -1
  9. package/dist/extensions/telegram/src/routing-integration.js +2 -2
  10. package/dist/extensions/telegram/src/update-offset-store.js +1 -1
  11. package/dist/extensions/telegram/src/workflow-progress.js +1 -1
  12. package/dist/extensions/telegram/xopc.extension.json +1 -1
  13. package/dist/extensions/weixin/src/api/api.js +2 -2
  14. package/dist/extensions/weixin/src/auth/accounts.js +1 -1
  15. package/dist/extensions/weixin/src/cdn/upload.js +1 -1
  16. package/dist/extensions/weixin/src/media/data-url.js +1 -1
  17. package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
  18. package/dist/extensions/weixin/src/messaging/inbound.js +1 -1
  19. package/dist/extensions/weixin/src/messaging/process-message.js +1 -1
  20. package/dist/extensions/weixin/src/plugin.js +1 -1
  21. package/dist/extensions/weixin/src/storage/sync-buf.js +1 -1
  22. package/dist/extensions/weixin/src/workflow-progress.js +1 -1
  23. package/dist/gateway/static/root/apple-touch-icon.png +0 -0
  24. package/dist/gateway/static/root/assets/Combination-BzaXOLd9.js +41 -0
  25. package/dist/gateway/static/root/assets/agent-avatar-dicebear-EhRp-ZMa.js +1 -0
  26. package/dist/gateway/static/root/assets/agent-browser-settings-page-H4foVCiS.js +6 -0
  27. package/dist/gateway/static/root/assets/agent-defaults-tabbed-page-DDNw2oNU.js +1 -0
  28. package/dist/gateway/static/root/assets/agents-E_X2kzS1.js +71 -0
  29. package/dist/gateway/static/root/assets/app-management-settings-panel-BIy7KEsM.js +1 -0
  30. package/dist/gateway/static/root/assets/appearance-settings-DGQG8NwA.js +1 -0
  31. package/dist/gateway/static/root/assets/apps-page-BZLvInLr.js +1 -0
  32. package/dist/gateway/static/root/assets/archive-plugin-uuQPupqx.js +1 -0
  33. package/dist/gateway/static/root/assets/attachment-load-DBkv0cAv.js +2 -0
  34. package/dist/gateway/static/root/assets/{attachment-preview-renderer-CybMSIoS.js → attachment-preview-renderer-DonnL2dL.js} +1 -1
  35. package/dist/gateway/static/root/assets/binary-plugins-DxxN_VAR.js +2 -0
  36. package/dist/gateway/static/root/assets/block-editor-CwnUlRmO.js +180 -0
  37. package/dist/gateway/static/root/assets/channels-settings-BHvUKlzw.js +1 -0
  38. package/dist/gateway/static/root/assets/cn-JdwAhgNB.js +1 -0
  39. package/dist/gateway/static/root/assets/code-editor-dZTY2dRW.js +1 -0
  40. package/dist/gateway/static/root/assets/config-api-BD-NcD5d.js +3 -0
  41. package/dist/gateway/static/root/assets/config-reload-event-Bjh2zoKp.js +1 -0
  42. package/dist/gateway/static/root/assets/connectors-settings-VBzXcEXL.js +2 -0
  43. package/dist/gateway/static/root/assets/cron-api-C5DoipZA.js +1 -0
  44. package/dist/gateway/static/root/assets/cron-dreaming-jobs-nCMWCf0p.js +1 -0
  45. package/dist/gateway/static/root/assets/cron-page-BLTpdm34.js +3 -0
  46. package/dist/gateway/static/root/assets/dist-By6Rh2ee.js +1 -0
  47. package/dist/gateway/static/root/assets/dist-CkobR7mk.js +1 -0
  48. package/dist/gateway/static/root/assets/dist-DokQNVMQ.js +1 -0
  49. package/dist/gateway/static/root/assets/dreaming-scene-BHMRVEUS.js +4585 -0
  50. package/dist/gateway/static/root/assets/dreaming-settings-DSVhXTPq.js +1 -0
  51. package/dist/gateway/static/root/assets/extension-debug-page-BDHA9o_e.js +1 -0
  52. package/dist/gateway/static/root/assets/{extension-page-W1wiG38F.js → extension-page-DmDLVSPE.js} +1 -1
  53. package/dist/gateway/static/root/assets/extension-settings-page-1124aHw_.js +1 -0
  54. package/dist/gateway/static/root/assets/fetch-DOe56Wmy.js +1 -0
  55. package/dist/gateway/static/root/assets/format-cron-label-BsotZDO5.js +2 -0
  56. package/dist/gateway/static/root/assets/format-interval-label-tsMSvBSR.js +1 -0
  57. package/dist/gateway/static/root/assets/gateway-config-api-CsD4FC9D.js +1 -0
  58. package/dist/gateway/static/root/assets/gateway-settings-HQ8FBhY2.js +1 -0
  59. package/dist/gateway/static/root/assets/gateway-startup-retry-C1zg7pH3.js +1 -0
  60. package/dist/gateway/static/root/assets/goal-detail-page-BG3Onph0.js +1 -0
  61. package/dist/gateway/static/root/assets/goals-page-DgeKn8zL.js +2 -0
  62. package/dist/gateway/static/root/assets/goals-settings-B5nI6lgz.js +1 -0
  63. package/dist/gateway/static/root/assets/heartbeat-config-api-CIv42nJD.js +1 -0
  64. package/dist/gateway/static/root/assets/heartbeat-settings-DFcVuJ3M.js +1 -0
  65. package/dist/gateway/static/root/assets/html-workspace-editor-CQLWDiwE.js +1 -0
  66. package/dist/gateway/static/root/assets/index-5A_ZaABy.css +1 -0
  67. package/dist/gateway/static/root/assets/index-BTmbp2AU.js +121 -0
  68. package/dist/gateway/static/root/assets/interval-presets-DGP3S7OB.js +1 -0
  69. package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-fETaDYQP.js +1 -0
  70. package/dist/gateway/static/root/assets/locale-store-DjbfSsfA.js +1 -0
  71. package/dist/gateway/static/root/assets/logs-page-B1-b27lK.js +2 -0
  72. package/dist/gateway/static/root/assets/markdown-editor-AssmZFx4.js +2 -0
  73. package/dist/gateway/static/root/assets/markdown-split-CgeBJMOD.js +1 -0
  74. package/dist/gateway/static/root/assets/media-plugins-C30GzlV2.js +1 -0
  75. package/dist/gateway/static/root/assets/mermaid-render-BbqDc_LQ.js +134 -0
  76. package/dist/gateway/static/root/assets/messages-BUUfPaZ9.js +3 -0
  77. package/dist/gateway/static/root/assets/middleware-Pd0e8Igk.js +1 -0
  78. package/dist/gateway/static/root/assets/models-hub-panel-DPcTS1-u.js +2 -0
  79. package/dist/gateway/static/root/assets/note-detail-page-xeGb4owe.js +2 -0
  80. package/dist/gateway/static/root/assets/note-image-lightbox-t1g0qZYh.js +1 -0
  81. package/dist/gateway/static/root/assets/note-time-hm6JO_Wi.js +1 -0
  82. package/dist/gateway/static/root/assets/notes-page-C_TdnKBe.js +1 -0
  83. package/dist/gateway/static/root/assets/preview-open-alternatives-DeWp9x5g.js +1 -0
  84. package/dist/gateway/static/root/assets/remote-access-hub-BtkPmJIN.js +1 -0
  85. package/dist/gateway/static/root/assets/save-bar-controls-BOaAOJI3.js +1 -0
  86. package/dist/gateway/static/root/assets/schedule-field-BLWLKqgw.js +1 -0
  87. package/dist/gateway/static/root/assets/schema-form-plqRFYT8.js +1 -0
  88. package/dist/gateway/static/root/assets/sessions-page-DOUjxzJm.js +1 -0
  89. package/dist/gateway/static/root/assets/settings-advanced-gate-qK_bnTrw.js +1 -0
  90. package/dist/gateway/static/root/assets/settings-collapsible-section-BP5zRrDI.js +1 -0
  91. package/dist/gateway/static/root/assets/settings-form-section-Bv8MZplG.js +1 -0
  92. package/dist/gateway/static/root/assets/settings-page-DmDfE1ww.js +1 -0
  93. package/dist/gateway/static/root/assets/setup-status-panel-BEFwNcIZ.js +1 -0
  94. package/dist/gateway/static/root/assets/share-preview-page-4OX1YCgp.js +2 -0
  95. package/dist/gateway/static/root/assets/shares-settings-CbKmJZot.js +1 -0
  96. package/dist/gateway/static/root/assets/skill-reload-api-YdtnUHtK.js +1 -0
  97. package/dist/gateway/static/root/assets/skills-page-DwW1IzQ0.js +2 -0
  98. package/dist/gateway/static/root/assets/system-settings-panel-CGy4f_s2.js +1 -0
  99. package/dist/gateway/static/root/assets/theme-store-CD2wtgZV.js +1 -0
  100. package/dist/gateway/static/root/assets/use-agent-defaults-form-BMuMvzl_.js +1 -0
  101. package/dist/gateway/static/root/assets/use-blob-object-url-D4BFuzZB.js +1 -0
  102. package/dist/gateway/static/root/assets/use-channel-catalog-CjGHnDvN.js +1 -0
  103. package/dist/gateway/static/root/assets/use-settings-tab-guard-BMMFa0oA.js +1 -0
  104. package/dist/gateway/static/root/assets/vendor-codemirror-CNP1wPe7.js +45 -0
  105. package/dist/gateway/static/root/assets/voice-api-key-field-DnRbhMNq.js +1 -0
  106. package/dist/gateway/static/root/assets/voice-player-store-D5vzWwls.js +1 -0
  107. package/dist/gateway/static/root/assets/{workflow-page.utils-EYg_xBQS.js → workflow-page.utils-tjGpRVnw.js} +1 -1
  108. package/dist/gateway/static/root/assets/workflows-page-DqqHKGj2.js +18 -0
  109. package/dist/gateway/static/root/favicon-16x16.png +0 -0
  110. package/dist/gateway/static/root/favicon-32x32.png +0 -0
  111. package/dist/gateway/static/root/favicon.ico +0 -0
  112. package/dist/gateway/static/root/favicon.svg +14 -12
  113. package/dist/gateway/static/root/index.html +18 -15
  114. package/dist/package.js +1 -1
  115. package/dist/src/agent/agent-manager.d.ts +28 -2
  116. package/dist/src/agent/agent-manager.js +82 -11
  117. package/dist/src/agent/agent-manager.js.map +1 -1
  118. package/dist/src/agent/agent-scope.js +1 -1
  119. package/dist/src/agent/bootstrap/load-bootstrap-files.js +1 -1
  120. package/dist/src/agent/context/workspace-seed.js +2 -2
  121. package/dist/src/agent/context/workspace-state.js +1 -1
  122. package/dist/src/agent/context/workspace.js +1 -1
  123. package/dist/src/agent/goals/checklist-judge.d.ts +5 -0
  124. package/dist/src/agent/goals/checklist-judge.js +26 -2
  125. package/dist/src/agent/goals/checklist-judge.js.map +1 -1
  126. package/dist/src/agent/goals/evaluate-turn.d.ts +5 -1
  127. package/dist/src/agent/goals/evaluate-turn.js +29 -3
  128. package/dist/src/agent/goals/evaluate-turn.js.map +1 -1
  129. package/dist/src/agent/goals/goal-locale.d.ts +0 -2
  130. package/dist/src/agent/goals/goal-locale.js +3 -16
  131. package/dist/src/agent/goals/goal-locale.js.map +1 -1
  132. package/dist/src/agent/goals/persistent-goal-service.d.ts +9 -0
  133. package/dist/src/agent/goals/persistent-goal-service.js +3 -2
  134. package/dist/src/agent/goals/persistent-goal-service.js.map +1 -1
  135. package/dist/src/agent/goals/post-turn.d.ts +7 -0
  136. package/dist/src/agent/goals/post-turn.js +70 -25
  137. package/dist/src/agent/goals/post-turn.js.map +1 -1
  138. package/dist/src/agent/goals/state.d.ts +0 -5
  139. package/dist/src/agent/goals/state.js +1 -96
  140. package/dist/src/agent/goals/state.js.map +1 -1
  141. package/dist/src/agent/image/load-image-media.js +2 -2
  142. package/dist/src/agent/ipc/inbox.js +3 -3
  143. package/dist/src/agent/ipc/socket.js +1 -1
  144. package/dist/src/agent/mcp/bundle-mcp-materialize.js +1 -1
  145. package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
  146. package/dist/src/agent/mcp/mcp-transport-config.js +1 -1
  147. package/dist/src/agent/mcp/mcp-transport.js +1 -1
  148. package/dist/src/agent/memory/builtin-memory-store.js +1 -1
  149. package/dist/src/agent/memory/dreaming/deep-promotion.js +1 -1
  150. package/dist/src/agent/memory/dreaming/events.js +1 -1
  151. package/dist/src/agent/memory/dreaming/last-run.js +1 -1
  152. package/dist/src/agent/memory/dreaming/light-sweep.js +1 -1
  153. package/dist/src/agent/memory/dreaming/preview.js +1 -1
  154. package/dist/src/agent/memory/dreaming/rem-patterns.js +1 -1
  155. package/dist/src/agent/memory/dreaming/short-term-store.js +1 -1
  156. package/dist/src/agent/memory/dreaming/utils.js +1 -1
  157. package/dist/src/agent/memory/memory-flush.js +1 -1
  158. package/dist/src/agent/memory/plugin-discovery.js +1 -1
  159. package/dist/src/agent/messaging/command-handler.d.ts +7 -0
  160. package/dist/src/agent/messaging/command-handler.js +11 -2
  161. package/dist/src/agent/messaging/command-handler.js.map +1 -1
  162. package/dist/src/agent/models/manager.js +1 -1
  163. package/dist/src/agent/prompt/memory/index.js +1 -1
  164. package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
  165. package/dist/src/agent/reply/post-compaction-context.js +1 -1
  166. package/dist/src/agent/reply/workspace-boundary-read.js +1 -1
  167. package/dist/src/agent/sandbox/path-policy.js +2 -2
  168. package/dist/src/agent/service/direct-turn-helpers.d.ts +2 -0
  169. package/dist/src/agent/service/direct-turn-helpers.js +3 -2
  170. package/dist/src/agent/service/direct-turn-helpers.js.map +1 -1
  171. package/dist/src/agent/service/process-direct-streaming.js +10 -1
  172. package/dist/src/agent/service/process-direct-streaming.js.map +1 -1
  173. package/dist/src/agent/service/reconcile-dreaming-cron.js +8 -5
  174. package/dist/src/agent/service/reconcile-dreaming-cron.js.map +1 -1
  175. package/dist/src/agent/service.d.ts +2 -1
  176. package/dist/src/agent/service.js +30 -6
  177. package/dist/src/agent/service.js.map +1 -1
  178. package/dist/src/agent/service.types.d.ts +12 -0
  179. package/dist/src/agent/session/session-config-service.d.ts +8 -0
  180. package/dist/src/agent/session/session-config-service.js +20 -0
  181. package/dist/src/agent/session/session-config-service.js.map +1 -1
  182. package/dist/src/agent/session/session-inspector.js +1 -1
  183. package/dist/src/agent/skills/config.js +2 -2
  184. package/dist/src/agent/skills/filesystem-watcher.d.ts +19 -0
  185. package/dist/src/agent/skills/filesystem-watcher.js +182 -0
  186. package/dist/src/agent/skills/filesystem-watcher.js.map +1 -0
  187. package/dist/src/agent/skills/hub-hash.js +2 -2
  188. package/dist/src/agent/skills/hub-lock.js +1 -1
  189. package/dist/src/agent/skills/hub-pull.js +30 -36
  190. package/dist/src/agent/skills/hub-pull.js.map +1 -1
  191. package/dist/src/agent/skills/index.js +82 -38
  192. package/dist/src/agent/skills/index.js.map +1 -1
  193. package/dist/src/agent/skills/installer.js +2 -2
  194. package/dist/src/agent/skills/managed-store.d.ts +19 -0
  195. package/dist/src/agent/skills/managed-store.js +97 -38
  196. package/dist/src/agent/skills/managed-store.js.map +1 -1
  197. package/dist/src/agent/skills/skill-manage-ops.js +1 -1
  198. package/dist/src/agent/skills/skill-manager.d.ts +16 -6
  199. package/dist/src/agent/skills/skill-manager.js +79 -24
  200. package/dist/src/agent/skills/skill-manager.js.map +1 -1
  201. package/dist/src/agent/skills/skill-view-path.js +1 -1
  202. package/dist/src/agent/skills/test-framework.js +1 -1
  203. package/dist/src/agent/skills/types.d.ts +11 -0
  204. package/dist/src/agent/skills/watcher.js +1 -1
  205. package/dist/src/agent/starter-agents.js +1 -1
  206. package/dist/src/agent/tools/cronjob-tool.d.ts +8 -3
  207. package/dist/src/agent/tools/cronjob-tool.js +82 -24
  208. package/dist/src/agent/tools/cronjob-tool.js.map +1 -1
  209. package/dist/src/agent/tools/dreaming-tool.js +1 -1
  210. package/dist/src/agent/tools/edit.d.ts +2 -0
  211. package/dist/src/agent/tools/edit.js +10 -0
  212. package/dist/src/agent/tools/edit.js.map +1 -1
  213. package/dist/src/agent/tools/factory.js +17 -4
  214. package/dist/src/agent/tools/factory.js.map +1 -1
  215. package/dist/src/agent/tools/find.js +1 -1
  216. package/dist/src/agent/tools/goal-evidence-recorder.d.ts +6 -0
  217. package/dist/src/agent/tools/goal-evidence-recorder.js +34 -0
  218. package/dist/src/agent/tools/goal-evidence-recorder.js.map +1 -0
  219. package/dist/src/agent/tools/goal-tool.d.ts +19 -0
  220. package/dist/src/agent/tools/goal-tool.js +101 -0
  221. package/dist/src/agent/tools/goal-tool.js.map +1 -0
  222. package/dist/src/agent/tools/grep.js +1 -1
  223. package/dist/src/agent/tools/image-generate-tool.js +1 -1
  224. package/dist/src/agent/tools/index.d.ts +1 -0
  225. package/dist/src/agent/tools/index.js +2 -1
  226. package/dist/src/agent/tools/shell.d.ts +2 -0
  227. package/dist/src/agent/tools/shell.js +17 -2
  228. package/dist/src/agent/tools/shell.js.map +1 -1
  229. package/dist/src/agent/tools/skill-manage-tool.js +1 -1
  230. package/dist/src/agent/tools/workflow-tool.d.ts +1 -0
  231. package/dist/src/agent/tools/workflow-tool.js +11 -3
  232. package/dist/src/agent/tools/workflow-tool.js.map +1 -1
  233. package/dist/src/agent/tools/write.d.ts +2 -0
  234. package/dist/src/agent/tools/write.js +11 -0
  235. package/dist/src/agent/tools/write.js.map +1 -1
  236. package/dist/src/agent/workflow/catalog.js +1 -1
  237. package/dist/src/agent/workspace-runtime/registry.d.ts +5 -0
  238. package/dist/src/agent/workspace-runtime/registry.js +7 -0
  239. package/dist/src/agent/workspace-runtime/registry.js.map +1 -1
  240. package/dist/src/ai-assist/text-assist.d.ts +39 -0
  241. package/dist/src/ai-assist/text-assist.js +234 -0
  242. package/dist/src/ai-assist/text-assist.js.map +1 -0
  243. package/dist/src/auth/credentials.js +2 -2
  244. package/dist/src/auth/profiles/store.js +2 -2
  245. package/dist/src/auth/sync-provider-auth.js +1 -1
  246. package/dist/src/browser/cache-dir-policy.js +1 -1
  247. package/dist/src/browser/cdp-local-launcher.js +2 -2
  248. package/dist/src/browser/providers/browser-ext-install.js +4 -4
  249. package/dist/src/browser/providers/cloakbrowser.js +5 -5
  250. package/dist/src/browser/providers/playwright-doctor.js +1 -1
  251. package/dist/src/browser/stealth.js +1 -1
  252. package/dist/src/channels/attachments/inbound-persist.d.ts +7 -0
  253. package/dist/src/channels/attachments/inbound-persist.js +20 -2
  254. package/dist/src/channels/attachments/inbound-persist.js.map +1 -1
  255. package/dist/src/channels/outbound/persist-store.js +1 -1
  256. package/dist/src/channels/pairing/allow-from-file.js +1 -1
  257. package/dist/src/channels/pairing/pairing-store.js +2 -2
  258. package/dist/src/chat-commands/agent-edit.js +2 -2
  259. package/dist/src/chat-commands/builtins/config.js +3 -3
  260. package/dist/src/chat-commands/builtins/goal.d.ts +1 -1
  261. package/dist/src/chat-commands/builtins/goal.js +55 -97
  262. package/dist/src/chat-commands/builtins/goal.js.map +1 -1
  263. package/dist/src/chat-commands/builtins/subgoal.d.ts +1 -1
  264. package/dist/src/chat-commands/builtins/subgoal.js +49 -108
  265. package/dist/src/chat-commands/builtins/subgoal.js.map +1 -1
  266. package/dist/src/chat-commands/builtins/system.js +11 -4
  267. package/dist/src/chat-commands/builtins/system.js.map +1 -1
  268. package/dist/src/chat-commands/builtins/workflow.js +132 -8
  269. package/dist/src/chat-commands/builtins/workflow.js.map +1 -1
  270. package/dist/src/chat-commands/context.d.ts +6 -0
  271. package/dist/src/chat-commands/context.js +12 -0
  272. package/dist/src/chat-commands/context.js.map +1 -1
  273. package/dist/src/chat-commands/types.d.ts +7 -0
  274. package/dist/src/cli/command-catalog.js +43 -0
  275. package/dist/src/cli/command-catalog.js.map +1 -1
  276. package/dist/src/cli/command-loaders.js +1 -0
  277. package/dist/src/cli/command-loaders.js.map +1 -1
  278. package/dist/src/cli/command-manifest.js +4 -0
  279. package/dist/src/cli/command-manifest.js.map +1 -1
  280. package/dist/src/cli/commands/config.js +1 -1
  281. package/dist/src/cli/commands/cron.js +55 -16
  282. package/dist/src/cli/commands/cron.js.map +1 -1
  283. package/dist/src/cli/commands/doctor/checks/config-health.js +1 -1
  284. package/dist/src/cli/commands/doctor/checks/cron-health.js +2 -83
  285. package/dist/src/cli/commands/doctor/checks/cron-health.js.map +1 -1
  286. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  287. package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
  288. package/dist/src/cli/commands/doctor/checks/state-integrity.js +1 -1
  289. package/dist/src/cli/commands/doctor/checks/workspace-status.js +1 -1
  290. package/dist/src/cli/commands/extension-create.js +1 -1
  291. package/dist/src/cli/commands/extension-dev.js +2 -2
  292. package/dist/src/cli/commands/extension-marketplace.js +2 -2
  293. package/dist/src/cli/commands/extension-pack.js +2 -2
  294. package/dist/src/cli/commands/extension.js +3 -3
  295. package/dist/src/cli/commands/gateway/logs.js +1 -1
  296. package/dist/src/cli/commands/goal.d.ts +4 -0
  297. package/dist/src/cli/commands/goal.js +213 -0
  298. package/dist/src/cli/commands/goal.js.map +1 -0
  299. package/dist/src/cli/commands/image.js +1 -1
  300. package/dist/src/cli/commands/init.js +2 -2
  301. package/dist/src/cli/commands/models.js +1 -1
  302. package/dist/src/cli/commands/onboard.js +11 -5
  303. package/dist/src/cli/commands/onboard.js.map +1 -1
  304. package/dist/src/cli/commands/skills-test.js +1 -1
  305. package/dist/src/cli/templates.js +1 -1
  306. package/dist/src/cli/utils/gateway-client.js +1 -1
  307. package/dist/src/cli/utils/init-workspace-core.js +2 -2
  308. package/dist/src/config/agent-profile.js +1 -1
  309. package/dist/src/config/agent-typed-models.js +1 -1
  310. package/dist/src/config/gateway-bind.js +1 -1
  311. package/dist/src/config/index.js +8 -8
  312. package/dist/src/config/loader.js +4 -4
  313. package/dist/src/config/models-json.js +2 -2
  314. package/dist/src/config/paths-state.js +1 -1
  315. package/dist/src/config/paths.js +1 -1
  316. package/dist/src/config/profile.js +1 -1
  317. package/dist/src/config/reload.js +1 -1
  318. package/dist/src/config/schema.d.ts +115 -2
  319. package/dist/src/config/schema.js +63 -7
  320. package/dist/src/config/schema.js.map +1 -1
  321. package/dist/src/config/web-patch.d.ts +14 -1
  322. package/dist/src/config/web-patch.js +45 -8
  323. package/dist/src/config/web-patch.js.map +1 -1
  324. package/dist/src/config/workspace-path.js +1 -1
  325. package/dist/src/cron/executor.d.ts +2 -0
  326. package/dist/src/cron/executor.js +126 -70
  327. package/dist/src/cron/executor.js.map +1 -1
  328. package/dist/src/cron/index.d.ts +1 -1
  329. package/dist/src/cron/index.js +3 -3
  330. package/dist/src/cron/job-content.js +1 -0
  331. package/dist/src/cron/job-content.js.map +1 -1
  332. package/dist/src/cron/run-log-store.d.ts +1 -0
  333. package/dist/src/cron/run-log-store.js +4 -2
  334. package/dist/src/cron/run-log-store.js.map +1 -1
  335. package/dist/src/cron/schedule.d.ts +10 -0
  336. package/dist/src/cron/schedule.js +85 -0
  337. package/dist/src/cron/schedule.js.map +1 -0
  338. package/dist/src/cron/service.d.ts +34 -77
  339. package/dist/src/cron/service.js +327 -264
  340. package/dist/src/cron/service.js.map +1 -1
  341. package/dist/src/cron/types.d.ts +97 -49
  342. package/dist/src/cron/validation.d.ts +374 -86
  343. package/dist/src/cron/validation.js +156 -129
  344. package/dist/src/cron/validation.js.map +1 -1
  345. package/dist/src/cron/workflow-run-completion.js +1 -1
  346. package/dist/src/daemon/constants.js +1 -1
  347. package/dist/src/daemon/install-plan.js +2 -2
  348. package/dist/src/daemon/launchd.js +2 -2
  349. package/dist/src/daemon/schtasks.js +2 -2
  350. package/dist/src/daemon/systemd.js +2 -2
  351. package/dist/src/extensions/bundle-mcp.js +1 -1
  352. package/dist/src/extensions/discover-extensions.js +2 -2
  353. package/dist/src/extensions/health.js +1 -1
  354. package/dist/src/extensions/install.js +2 -2
  355. package/dist/src/extensions/loader.js +2 -2
  356. package/dist/src/extensions/lockfile.js +3 -3
  357. package/dist/src/extensions/security.js +1 -1
  358. package/dist/src/extensions/update.js +2 -2
  359. package/dist/src/gateway/agents-admin.js +2 -2
  360. package/dist/src/gateway/chat-stream/mapper.d.ts +1 -0
  361. package/dist/src/gateway/chat-stream/mapper.js +6 -2
  362. package/dist/src/gateway/chat-stream/mapper.js.map +1 -1
  363. package/dist/src/gateway/chat-stream/protocol.d.ts +2 -0
  364. package/dist/src/gateway/file-path-classifier.js +2 -2
  365. package/dist/src/gateway/hono/lib/config-payload.d.ts +14 -1
  366. package/dist/src/gateway/hono/lib/config-payload.js +1 -1
  367. package/dist/src/gateway/hono/lib/extension-store.js +2 -2
  368. package/dist/src/gateway/hono/lib/static-ui.js +2 -2
  369. package/dist/src/gateway/hono/oauth-async.js +1 -1
  370. package/dist/src/gateway/hono/routes/agents.js +1 -1
  371. package/dist/src/gateway/hono/routes/ai-assist.d.ts +3 -0
  372. package/dist/src/gateway/hono/routes/ai-assist.js +66 -0
  373. package/dist/src/gateway/hono/routes/ai-assist.js.map +1 -0
  374. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
  375. package/dist/src/gateway/hono/routes/commands-skills.js +7 -0
  376. package/dist/src/gateway/hono/routes/commands-skills.js.map +1 -1
  377. package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
  378. package/dist/src/gateway/hono/routes/cron.js +24 -5
  379. package/dist/src/gateway/hono/routes/cron.js.map +1 -1
  380. package/dist/src/gateway/hono/routes/dreaming.js +1 -1
  381. package/dist/src/gateway/hono/routes/goals.d.ts +1 -1
  382. package/dist/src/gateway/hono/routes/goals.js +670 -173
  383. package/dist/src/gateway/hono/routes/goals.js.map +1 -1
  384. package/dist/src/gateway/hono/routes/home.d.ts +5 -0
  385. package/dist/src/gateway/hono/routes/home.js +90 -3
  386. package/dist/src/gateway/hono/routes/home.js.map +1 -1
  387. package/dist/src/gateway/hono/routes/host-fs.js +2 -2
  388. package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
  389. package/dist/src/gateway/hono/routes/lazy-bundles.js.map +1 -1
  390. package/dist/src/gateway/hono/routes/models.js +1 -1
  391. package/dist/src/gateway/hono/routes/notes.js +20 -14
  392. package/dist/src/gateway/hono/routes/notes.js.map +1 -1
  393. package/dist/src/gateway/hono/routes/shares.js +1 -1
  394. package/dist/src/gateway/hono/routes/workflows.js +8 -4
  395. package/dist/src/gateway/hono/routes/workflows.js.map +1 -1
  396. package/dist/src/gateway/hono/routes/workspace.js +2 -2
  397. package/dist/src/gateway/hono/sse.js.map +1 -1
  398. package/dist/src/gateway/lock.js +3 -3
  399. package/dist/src/gateway/ports.js +1 -1
  400. package/dist/src/gateway/service/agent-runner.d.ts +2 -0
  401. package/dist/src/gateway/service/agent-runner.js +8 -4
  402. package/dist/src/gateway/service/agent-runner.js.map +1 -1
  403. package/dist/src/gateway/service/config-coordinator.js +1 -1
  404. package/dist/src/gateway/service/marketplace-service.d.ts +22 -10
  405. package/dist/src/gateway/service/marketplace-service.js +46 -5
  406. package/dist/src/gateway/service/marketplace-service.js.map +1 -1
  407. package/dist/src/gateway/service/run-gateway-agent.d.ts +3 -0
  408. package/dist/src/gateway/service/run-gateway-agent.js.map +1 -1
  409. package/dist/src/gateway/service.d.ts +8 -0
  410. package/dist/src/gateway/service.js +79 -6
  411. package/dist/src/gateway/service.js.map +1 -1
  412. package/dist/src/gateway/workspace-fs-file-list.js +1 -1
  413. package/dist/src/goals/goal-notifications.d.ts +29 -0
  414. package/dist/src/goals/goal-notifications.js +154 -0
  415. package/dist/src/goals/goal-notifications.js.map +1 -0
  416. package/dist/src/goals/goal-queue-store.d.ts +16 -0
  417. package/dist/src/goals/goal-queue-store.js +131 -0
  418. package/dist/src/goals/goal-queue-store.js.map +1 -0
  419. package/dist/src/goals/goal-queue-types.d.ts +31 -0
  420. package/dist/src/goals/goal-queue-types.js +1 -0
  421. package/dist/src/goals/goal-runner.d.ts +17 -0
  422. package/dist/src/goals/goal-runner.js +127 -0
  423. package/dist/src/goals/goal-runner.js.map +1 -0
  424. package/dist/src/goals/goal-service.d.ts +77 -0
  425. package/dist/src/goals/goal-service.js +261 -0
  426. package/dist/src/goals/goal-service.js.map +1 -0
  427. package/dist/src/goals/goal-store.d.ts +38 -0
  428. package/dist/src/goals/goal-store.js +404 -0
  429. package/dist/src/goals/goal-store.js.map +1 -0
  430. package/dist/src/goals/goal-workflow-judge.d.ts +13 -0
  431. package/dist/src/goals/goal-workflow-judge.js +147 -0
  432. package/dist/src/goals/goal-workflow-judge.js.map +1 -0
  433. package/dist/src/goals/index.d.ts +10 -0
  434. package/dist/src/goals/index.js +7 -0
  435. package/dist/src/goals/types.d.ts +119 -0
  436. package/dist/src/goals/types.js +1 -0
  437. package/dist/src/i18n/goals-bundle.js +1 -1
  438. package/dist/src/i18n/index.js +1 -1
  439. package/dist/src/i18n/share-tool-bundle.js +2 -2
  440. package/dist/src/infra/brew.js +1 -1
  441. package/dist/src/infra/package-json.js +1 -1
  442. package/dist/src/infra/package-update-steps.js +1 -1
  443. package/dist/src/infra/path-env.js +2 -2
  444. package/dist/src/infra/restart.js +1 -1
  445. package/dist/src/infra/stable-node-path.js +1 -1
  446. package/dist/src/infra/update-check.js +1 -1
  447. package/dist/src/infra/update-global.js +1 -1
  448. package/dist/src/infra/update-lock.js +2 -2
  449. package/dist/src/infra/update-restart.js +1 -1
  450. package/dist/src/infra/update-runner.js +1 -1
  451. package/dist/src/infra/update-startup.js +1 -1
  452. package/dist/src/infra/write-file-atomic.js +2 -2
  453. package/dist/src/media/store.js +1 -1
  454. package/dist/src/notes/agent-context.js +1 -1
  455. package/dist/src/notes/service.js +1 -1
  456. package/dist/src/notes/store.js +2 -2
  457. package/dist/src/project-trust/trust-store.js +2 -2
  458. package/dist/src/providers/auth-runtime/auth-profile-store.js +1 -1
  459. package/dist/src/providers/index.js +1 -1
  460. package/dist/src/providers/model-registry.js +4 -4
  461. package/dist/src/session/init-session-turn.js +2 -2
  462. package/dist/src/session/resolve-session.js +3 -3
  463. package/dist/src/session/session-title.js +2 -2
  464. package/dist/src/session/store.js +1 -1
  465. package/dist/src/share/share-auto.js +2 -2
  466. package/dist/src/share/share-store.js +3 -3
  467. package/dist/src/share/share-thumbnail.js +2 -2
  468. package/dist/src/share/share-zip.js +1 -1
  469. package/dist/src/share/site-share-store.js +3 -3
  470. package/dist/src/share/site-static-serve.js +1 -1
  471. package/dist/src/storage/sqlite/connection.js +1 -1
  472. package/dist/src/storage/sqlite/cron-job-repository.d.ts +6 -0
  473. package/dist/src/storage/sqlite/cron-job-repository.js +70 -0
  474. package/dist/src/storage/sqlite/cron-job-repository.js.map +1 -0
  475. package/dist/src/storage/sqlite/cron-run-repository.js +0 -1
  476. package/dist/src/storage/sqlite/cron-run-repository.js.map +1 -1
  477. package/dist/src/storage/sqlite/index.d.ts +1 -0
  478. package/dist/src/storage/sqlite/index.js +2 -1
  479. package/dist/src/storage/sqlite/memory-index-repository.js +2 -2
  480. package/dist/src/storage/sqlite/migrations/006_add_goals.sql +108 -0
  481. package/dist/src/storage/sqlite/migrations/007_goal_run_judge_schema.sql +4 -0
  482. package/dist/src/storage/sqlite/migrations/008_goal_queue_workflow_runs.sql +53 -0
  483. package/dist/src/storage/sqlite/migrations/009_cron_jobs.sql +24 -0
  484. package/dist/src/storage/sqlite/migrations/discover.js +1 -1
  485. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  486. package/dist/src/storage/sqlite/migrations/runner.js +4 -4
  487. package/dist/src/storage/sqlite/migrations/runner.js.map +1 -1
  488. package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
  489. package/dist/src/storage/sqlite/schema.js +2 -2
  490. package/dist/src/storage/sqlite/schema.sql +188 -0
  491. package/dist/src/tui/clipboard-image.js +3 -3
  492. package/dist/src/tui/extension-host/load-extensions.js +1 -1
  493. package/dist/src/tui/theme-manager.js +1 -1
  494. package/dist/src/tui/tui-command-formatters.js +4 -4
  495. package/dist/src/tui/tui-commands.js +2 -2
  496. package/dist/src/tui/tui-keybindings-file.js +1 -1
  497. package/dist/src/tui/tui-scoped-models.js +2 -2
  498. package/dist/src/tui/tui-settings.js +1 -1
  499. package/dist/src/tui/tui-startup-resources.js +1 -1
  500. package/dist/src/tui/tui.js +6 -6
  501. package/dist/src/tunnel/frpc-binary.js +4 -4
  502. package/dist/src/tunnel/frpc-config.js +1 -1
  503. package/dist/src/tunnel/frpc-extract.js +1 -1
  504. package/dist/src/tunnel/tunnel-state.js +1 -1
  505. package/dist/src/utils/logger/audit.js +1 -1
  506. package/dist/src/utils/logger/log-store.js +1 -1
  507. package/dist/src/utils/logger/rotation.js +1 -1
  508. package/dist/src/utils/logger/stats.d.ts +1 -1
  509. package/dist/src/utils/logger/streams.js +1 -1
  510. package/dist/src/voice/tts/audio.js +1 -1
  511. package/dist/src/voice/tts/providers/edge-speech.js +2 -2
  512. package/dist/src/workflows/domain/run.d.ts +1 -0
  513. package/dist/src/workflows/domain/run.js.map +1 -1
  514. package/dist/src/workflows/draft/workflow-draft-service.js +1 -1
  515. package/dist/src/workflows/engine/projector.js +23 -14
  516. package/dist/src/workflows/engine/projector.js.map +1 -1
  517. package/dist/src/workflows/engine/workflow-engine.d.ts +1 -0
  518. package/dist/src/workflows/engine/workflow-engine.js +36 -0
  519. package/dist/src/workflows/engine/workflow-engine.js.map +1 -1
  520. package/dist/src/workflows/index.js +1 -1
  521. package/dist/src/workflows/service/workflow-run-service.d.ts +1 -0
  522. package/dist/src/workflows/service/workflow-run-service.js +7 -3
  523. package/dist/src/workflows/service/workflow-run-service.js.map +1 -1
  524. package/dist/src/workflows/service/workflow-run-service.types.d.ts +1 -0
  525. package/dist/src/workflows/service/workflow-session-bridge.js +8 -1
  526. package/dist/src/workflows/service/workflow-session-bridge.js.map +1 -1
  527. package/dist/src/workflows/store/event-store.js +1 -1
  528. package/dist/src/workflows/store/run-index-store.d.ts +8 -0
  529. package/dist/src/workflows/store/run-index-store.js +58 -0
  530. package/dist/src/workflows/store/run-index-store.js.map +1 -0
  531. package/dist/src/workflows/store/run-store.d.ts +2 -0
  532. package/dist/src/workflows/store/run-store.js +15 -22
  533. package/dist/src/workflows/store/run-store.js.map +1 -1
  534. package/package.json +10 -5
  535. package/dist/gateway/static/root/assets/Combination-HAlzriaz.js +0 -41
  536. package/dist/gateway/static/root/assets/agents-CFFioJCI.js +0 -78
  537. package/dist/gateway/static/root/assets/apps-page-BYDmkbzG.js +0 -1
  538. package/dist/gateway/static/root/assets/channels-settings-CsbDaMvd.js +0 -1
  539. package/dist/gateway/static/root/assets/circle-check-C23XjkUj.js +0 -1
  540. package/dist/gateway/static/root/assets/copy-Dv6d4Dvw.js +0 -1
  541. package/dist/gateway/static/root/assets/cron-page-Apk-7p4p.js +0 -1
  542. package/dist/gateway/static/root/assets/dist-DmGDgpy2.js +0 -1
  543. package/dist/gateway/static/root/assets/extension-debug-page-pxFC-tUa.js +0 -1
  544. package/dist/gateway/static/root/assets/extension-settings-page-COXSv6xP.js +0 -1
  545. package/dist/gateway/static/root/assets/fetch-CFdKBnE6.js +0 -1
  546. package/dist/gateway/static/root/assets/gateway-startup-retry-DdngdObI.js +0 -1
  547. package/dist/gateway/static/root/assets/heartbeat-config-api-DcmAMYmN.js +0 -1
  548. package/dist/gateway/static/root/assets/index-C_2yKRJX.js +0 -4845
  549. package/dist/gateway/static/root/assets/index-DI5_GsZt.css +0 -1
  550. package/dist/gateway/static/root/assets/logs-page-DvTWUOzd.js +0 -2
  551. package/dist/gateway/static/root/assets/note-detail-page-CZbdugWZ.js +0 -180
  552. package/dist/gateway/static/root/assets/note-time-RdyBZxj3.js +0 -1
  553. package/dist/gateway/static/root/assets/notes-page-mEAwy3e1.js +0 -1
  554. package/dist/gateway/static/root/assets/schema-form-DEvdni_r.js +0 -1
  555. package/dist/gateway/static/root/assets/sessions-page-BsgffzV4.js +0 -1
  556. package/dist/gateway/static/root/assets/settings-advanced-gate-t6v8Dwb8.js +0 -2
  557. package/dist/gateway/static/root/assets/settings-form-section-BoYYZmJG.js +0 -1
  558. package/dist/gateway/static/root/assets/settings-page-ClIthYF8.js +0 -3
  559. package/dist/gateway/static/root/assets/share-preview-page-Dd9et7KD.js +0 -2
  560. package/dist/gateway/static/root/assets/skills-page-DEXtxyfQ.js +0 -2
  561. package/dist/gateway/static/root/assets/theme-store-BZozwAeK.js +0 -1
  562. package/dist/gateway/static/root/assets/url-DQRqHuL-.js +0 -3
  563. package/dist/gateway/static/root/assets/vendor-codemirror-DYoKfS8f.js +0 -45
  564. package/dist/gateway/static/root/assets/voice-api-key-field-CNrKzQrf.js +0 -1
  565. package/dist/gateway/static/root/assets/workflows-page-EMZkzJNN.js +0 -18
  566. package/dist/gateway/static/root/favicon-16.png +0 -0
  567. package/dist/gateway/static/root/favicon-32.png +0 -0
  568. package/dist/src/agent/goals/checklist-user.d.ts +0 -24
  569. package/dist/src/agent/goals/checklist-user.js +0 -92
  570. package/dist/src/agent/goals/checklist-user.js.map +0 -1
  571. package/dist/src/agent/goals/goal-run-store.d.ts +0 -19
  572. package/dist/src/agent/goals/goal-run-store.js +0 -138
  573. package/dist/src/agent/goals/goal-run-store.js.map +0 -1
  574. package/dist/src/agent/goals/goal-run-types.d.ts +0 -28
  575. package/dist/src/agent/goals/goal-run-types.js +0 -6
  576. package/dist/src/agent/goals/goal-run-types.js.map +0 -1
  577. package/dist/src/agent/goals/patch-from-user-action.d.ts +0 -20
  578. package/dist/src/agent/goals/patch-from-user-action.js +0 -103
  579. package/dist/src/agent/goals/patch-from-user-action.js.map +0 -1
  580. package/dist/src/cron/persistence.d.ts +0 -62
  581. package/dist/src/cron/persistence.js +0 -188
  582. package/dist/src/cron/persistence.js.map +0 -1
  583. /package/dist/gateway/static/root/assets/{note-detail-page-D4ZIVQbk.css → block-editor-D4ZIVQbk.css} +0 -0
@@ -1 +0,0 @@
1
- import{a as e}from"./url-DQRqHuL-.js";import{Dt as t,Et as n}from"./index-C_2yKRJX.js";var r={noteId:null,attachmentId:null,playing:!1,currentTime:0,duration:0,loading:!1},i=null,a=null,o=null,s=null;function c(){return i||(i=new Audio,i.addEventListener(`timeupdate`,()=>{u.setState({currentTime:i.currentTime})}),i.addEventListener(`loadedmetadata`,()=>{let e=i.duration;Number.isFinite(e)&&u.setState({duration:e})}),i.addEventListener(`ended`,()=>{u.setState({playing:!1,currentTime:0}),i.currentTime=0}),i.addEventListener(`pause`,()=>{u.setState({playing:!1})}),i.addEventListener(`play`,()=>{u.setState({playing:!0})})),i}function l(){o&&s&&t(o,s),a=null,o=null,s=null}var u=e()((e,t)=>({...r,play:async(r,i,u)=>{let d=c(),f=t();if(f.noteId===r&&f.attachmentId===i&&a){d.play();return}d.pause(),l(),e({noteId:r,attachmentId:i,playing:!1,currentTime:0,duration:u??0,loading:!0});try{let t=await n(r,i);a=t,o=r,s=i,d.src=t,await d.play(),e({loading:!1})}catch{e({loading:!1,playing:!1}),l()}},pause:()=>{c().pause()},toggle:(e,n,r)=>{let i=t();i.noteId===e&&i.attachmentId===n&&i.playing?t().pause():t().play(e,n,r)},seek:t=>{let n=c();n.currentTime=t,e({currentTime:t})},reset:()=>{c().pause(),c().src=``,l(),e(r)}})),d=6e4,f=36e5,p=864e5;function m(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function h(e,t,n){let r=t-e;if(r<d)return n.justNow;if(r<f){let e=Math.floor(r/d);return n.minutesAgo.replace(`{{n}}`,String(e))}let i=m(t);if(e>=i)return n.today+` `+new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`});if(e>=i-p)return n.yesterday+` `+new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`});if(r<7*p){let e=Math.floor(r/p);return n.daysAgo.replace(`{{n}}`,String(e))}return new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function g(e,t,n){let r=m(t);if(e>=r)return n.today;if(e>=r-p)return n.yesterday;let i=new Date(e),a=new Date(t);return i.getFullYear()===a.getFullYear()?i.toLocaleDateString(void 0,{month:`long`,day:`numeric`}):i.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}function _(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}export{u as i,g as n,h as r,_ as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{i,o as a}from"./url-DQRqHuL-.js";import{i as o}from"./vendor-swr-BIWyz7Rc.js";import{a as s}from"./fetch-CFdKBnE6.js";import{r as c}from"./toast-z0toXu32.js";import{Bi as l,Bo as u,Ei as d,Fi as f,Ja as p,R as m,Ra as h,Ri as g,St as _,Ta as v,Tt as y,Vr as b,Wr as x,Xa as S,Xi as C,Zi as w,_a as T,_t as E,ct as D,es as O,fa as k,gt as A,ha as j,ja as M,kt as N,ma as P,mt as F,pi as I,po as L,qo as R,vt as z}from"./index-C_2yKRJX.js";import{i as B,n as V,r as ee,t as te}from"./note-time-RdyBZxj3.js";import{a as ne,i as re,n as H,o as ie,r as ae,t as oe}from"./dist-DmGDgpy2.js";var se=n(),U=e(t(),1),W=r();function ce(e){let t=(0,se.c)(15),{noteId:n,attachmentId:r,className:i}=e,[a,o]=(0,U.useState)(!1),s;t[0]!==r||t[1]!==n?(s=N(n,r),t[0]=r,t[1]=n,t[2]=s):s=t[2];let c=s;if(a){let e;t[3]===i?e=t[4]:(e=I(`flex size-12 shrink-0 items-center justify-center rounded-lg border border-edge-subtle bg-surface-hover text-fg-muted`,i),t[3]=i,t[4]=e);let n;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,W.jsx)(S,{className:`h-4 w-4`}),t[5]=n):n=t[5];let r;return t[6]===e?r=t[7]:(r=(0,W.jsx)(`div`,{className:e,"aria-hidden":!0,children:n}),t[6]=e,t[7]=r),r}let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>o(!0),t[8]=l):l=t[8];let u;t[9]===i?u=t[10]:(u=I(`size-12 shrink-0 rounded-lg border border-edge-subtle bg-surface-hover object-cover`,i),t[9]=i,t[10]=u);let d;return t[11]!==n||t[12]!==c||t[13]!==u?(d=(0,W.jsx)(y,{src:c,expectedNoteId:n,alt:``,loading:`lazy`,draggable:!1,onLoadFailed:l,className:u}),t[11]=n,t[12]=c,t[13]=u,t[14]=d):d=t[14],d}function G(e){if(!Number.isFinite(e)||e<0)return`0:00`;let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${String(n).padStart(2,`0`)}`}function le(e){let t=(0,se.c)(38),{noteId:n,attachmentId:r,durationSec:i,className:a}=e,{playing:o,loading:s,currentTime:c,duration:l,noteId:u,attachmentId:d}=B(),f=B(q),p=u===n&&d===r,m=p&&o,h=p&&s,g=p?c:0,_=p&&l>0?l:i??0,v=_>0?Math.min(g/_*100,100):0,y;t[0]!==r||t[1]!==i||t[2]!==n||t[3]!==f?(y=e=>{e.stopPropagation(),f(n,r,i)},t[0]=r,t[1]=i,t[2]=n,t[3]=f,t[4]=y):y=t[4];let b=y,x;t[5]!==r||t[6]!==i||t[7]!==n||t[8]!==f?(x=e=>{(e.key===`Enter`||e.key===` `)&&(e.stopPropagation(),e.preventDefault(),f(n,r,i))},t[5]=r,t[6]=i,t[7]=n,t[8]=f,t[9]=x):x=t[9];let S=x,C;t[10]===a?C=t[11]:(C=I(`flex items-center gap-2`,a),t[10]=a,t[11]=C);let w=m?`bg-accent text-white`:`bg-accent/10 text-accent hover:bg-accent/20`,E;t[12]===w?E=t[13]:(E=I(`flex h-7 w-7 shrink-0 items-center justify-center rounded-full transition-colors`,w),t[12]=w,t[13]=E);let D=m?`Pause`:`Play`,O;t[14]!==h||t[15]!==m?(O=h?(0,W.jsx)(M,{className:`h-3.5 w-3.5 animate-spin`}):m?(0,W.jsx)(T,{className:`h-3.5 w-3.5`}):(0,W.jsx)(k,{className:`h-3.5 w-3.5 ml-0.5`}),t[14]=h,t[15]=m,t[16]=O):O=t[16];let A;t[17]!==b||t[18]!==S||t[19]!==E||t[20]!==D||t[21]!==O?(A=(0,W.jsx)(`button`,{type:`button`,onClick:b,onKeyDown:S,className:E,"aria-label":D,children:O}),t[17]=b,t[18]=S,t[19]=E,t[20]=D,t[21]=O,t[22]=A):A=t[22];let j=`${v}%`,N;t[23]===j?N=t[24]:(N=(0,W.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-accent/10`,children:(0,W.jsx)(`div`,{className:`h-full rounded-full bg-accent transition-[width] duration-200 ease-linear`,style:{width:j}})}),t[23]=j,t[24]=N);let P;t[25]!==_||t[26]!==p||t[27]!==g?(P=G(p&&g>0?g:_),t[25]=_,t[26]=p,t[27]=g,t[28]=P):P=t[28];let F;t[29]===P?F=t[30]:(F=(0,W.jsx)(`span`,{className:`text-[10px] tabular-nums text-fg-muted`,children:P}),t[29]=P,t[30]=F);let L;t[31]!==N||t[32]!==F?(L=(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[N,F]}),t[31]=N,t[32]=F,t[33]=L):L=t[33];let R;return t[34]!==L||t[35]!==C||t[36]!==A?(R=(0,W.jsxs)(`div`,{className:C,onClick:K,children:[A,L]}),t[34]=L,t[35]=C,t[36]=A,t[37]=R):R=t[37],R}function K(e){return e.stopPropagation()}function q(e){return e.toggle}var ue={thought:h,todo:l,voice:v,media:p,bookmark:u,mixed:h,task:l};function de(e,t){return e.snippet?.trim()?e.snippet:e.coverAttachmentId?t.imageNote:t.noText}function J(e){let t=(0,se.c)(78),{note:n,onPress:r,onPin:i,onArchive:a,onDelete:o,labels:s,timeLabels:c}=e,l=ue[n.kind]||h,u;t[0]!==s||t[1]!==n?(u=de(n,s),t[0]=s,t[1]=n,t[2]=u):u=t[2];let f=u,p=!n.snippet?.trim(),[m]=(0,U.useState)(Y),g;t[3]!==n.createdAt||t[4]!==m||t[5]!==c?(g=ee(n.createdAt,m,c),t[3]=n.createdAt,t[4]=m,t[5]=c,t[6]=g):g=t[6];let _=g,v,y;t[7]!==n.id||t[8]!==r?(v=()=>r(n.id),y=e=>{(e.key===`Enter`||e.key===` `)&&r(n.id)},t[7]=n.id,t[8]=r,t[9]=v,t[10]=y):(v=t[9],y=t[10]);let b;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=I(`group relative flex cursor-pointer flex-col gap-2 rounded-xl border border-edge-subtle bg-surface-base p-4`,`transition-colors duration-150 ease-out hover:bg-surface-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`),t[11]=b):b=t[11];let x;t[12]!==l||t[13]!==n.coverAttachmentId||t[14]!==n.id||t[15]!==n.kind||t[16]!==n.voiceAttachmentId||t[17]!==n.voiceDurationSec?(x=n.coverAttachmentId?(0,W.jsx)(ce,{noteId:n.id,attachmentId:n.coverAttachmentId}):n.kind===`voice`&&n.voiceAttachmentId?(0,W.jsx)(le,{noteId:n.id,attachmentId:n.voiceAttachmentId,durationSec:n.voiceDurationSec,className:`mt-0.5 w-32 shrink-0`}):(0,W.jsx)(l,{className:`mt-0.5 h-4 w-4 shrink-0 text-fg-muted`}),t[12]=l,t[13]=n.coverAttachmentId,t[14]=n.id,t[15]=n.kind,t[16]=n.voiceAttachmentId,t[17]=n.voiceDurationSec,t[18]=x):x=t[18];let S;t[19]===n.title?S=t[20]:(S=n.title&&(0,W.jsx)(`h3`,{className:`mb-0.5 truncate text-sm font-semibold text-fg`,children:n.title}),t[19]=n.title,t[20]=S);let C=n.title?`text-fg-muted`:p?`italic text-fg-muted`:`text-fg`,w;t[21]===C?w=t[22]:(w=I(`text-sm line-clamp-3`,C),t[21]=C,t[22]=w);let T;t[23]!==f||t[24]!==w?(T=(0,W.jsx)(`p`,{className:w,children:f}),t[23]=f,t[24]=w,t[25]=T):T=t[25];let E;t[26]!==T||t[27]!==S?(E=(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[S,T]}),t[26]=T,t[27]=S,t[28]=E):E=t[28];let D;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,W.jsx)(ie,{asChild:!0,children:(0,W.jsx)(`button`,{type:`button`,onClick:me,className:`shrink-0 rounded-md p-1 text-fg-muted opacity-0 transition-opacity group-hover:opacity-100 hover:bg-surface-hover focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":`Actions`,children:(0,W.jsx)(L,{className:`h-4 w-4`})})}),t[29]=D):D=t[29];let O;t[30]!==n.id||t[31]!==n.pinned||t[32]!==i?(O=()=>i(n.id,!n.pinned),t[30]=n.id,t[31]=n.pinned,t[32]=i,t[33]=O):O=t[33];let k;t[34]===n.pinned?k=t[35]:(k=n.pinned?(0,W.jsx)(P,{className:`h-4 w-4`}):(0,W.jsx)(j,{className:`h-4 w-4`}),t[34]=n.pinned,t[35]=k);let A=n.pinned?s.unpin:s.pin,M;t[36]!==O||t[37]!==k||t[38]!==A?(M=(0,W.jsxs)(H,{className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:O,children:[k,A]}),t[36]=O,t[37]=k,t[38]=A,t[39]=M):M=t[39];let N;t[40]!==n.id||t[41]!==a?(N=()=>a(n.id),t[40]=n.id,t[41]=a,t[42]=N):N=t[42];let F;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,W.jsx)(R,{className:`h-4 w-4`}),t[43]=F):F=t[43];let z;t[44]!==s.archive||t[45]!==N?(z=(0,W.jsxs)(H,{className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:N,children:[F,s.archive]}),t[44]=s.archive,t[45]=N,t[46]=z):z=t[46];let B;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,W.jsx)(ne,{className:`my-1 h-px bg-edge-subtle`}),t[47]=B):B=t[47];let V;t[48]!==n.id||t[49]!==o?(V=()=>o(n.id),t[48]=n.id,t[49]=o,t[50]=V):V=t[50];let te;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,W.jsx)(d,{className:`h-4 w-4`}),t[51]=te):te=t[51];let G;t[52]!==s.delete||t[53]!==V?(G=(0,W.jsxs)(H,{className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-red-500 outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:V,children:[te,s.delete]}),t[52]=s.delete,t[53]=V,t[54]=G):G=t[54];let K;t[55]!==M||t[56]!==z||t[57]!==G?(K=(0,W.jsxs)(re,{children:[D,(0,W.jsx)(ae,{children:(0,W.jsxs)(oe,{className:`z-50 min-w-[140px] rounded-xl border border-edge bg-surface-panel p-1 shadow-lg`,sideOffset:4,align:`end`,onClick:pe,children:[M,z,B,G]})})]}),t[55]=M,t[56]=z,t[57]=G,t[58]=K):K=t[58];let q;t[59]!==E||t[60]!==K||t[61]!==x?(q=(0,W.jsxs)(`div`,{className:`flex items-start gap-3`,children:[x,E,K]}),t[59]=E,t[60]=K,t[61]=x,t[62]=q):q=t[62];let J;t[63]===n.pinned?J=t[64]:(J=n.pinned&&(0,W.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-accent/10 px-1.5 py-0.5 text-xs font-medium text-accent`,children:(0,W.jsx)(j,{className:`h-3 w-3`})}),t[63]=n.pinned,t[64]=J);let X;t[65]===n.tags?X=t[66]:(X=n.tags?.map(fe),t[65]=n.tags,t[66]=X);let Z;t[67]===_?Z=t[68]:(Z=(0,W.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:_}),t[67]=_,t[68]=Z);let Q;t[69]!==J||t[70]!==X||t[71]!==Z?(Q=(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[J,X,Z]}),t[69]=J,t[70]=X,t[71]=Z,t[72]=Q):Q=t[72];let he;return t[73]!==q||t[74]!==Q||t[75]!==v||t[76]!==y?(he=(0,W.jsxs)(`article`,{role:`button`,tabIndex:0,onClick:v,onKeyDown:y,className:b,children:[q,Q]}),t[73]=q,t[74]=Q,t[75]=v,t[76]=y,t[77]=he):he=t[77],he}function fe(e){return(0,W.jsx)(`span`,{className:`rounded-md bg-surface-hover px-1.5 py-0.5 text-xs text-fg-muted`,children:e},e)}function pe(e){return e.stopPropagation()}function me(e){return e.stopPropagation()}function Y(){return Date.now()}var X=3e4;function Z(){if(!(typeof MediaRecorder>`u`))return[`audio/webm;codecs=opus`,`audio/webm`,`audio/mp4`,`audio/ogg;codecs=opus`].find(e=>MediaRecorder.isTypeSupported(e))}function Q({placeholder:e,sendLabel:t,onCapture:n,onImagePick:r,onVoiceCapture:i,recordingLabel:a=`Recording…`,imageDisabled:o=!1,voiceDisabled:s=!1}){let[c,l]=(0,U.useState)(``),[u,d]=(0,U.useState)(!1),[f,m]=(0,U.useState)(!1),[h,_]=(0,U.useState)(0),[y,b]=(0,U.useState)(!1),x=(0,U.useRef)(null),S=(0,U.useRef)(null),w=(0,U.useRef)(null),T=(0,U.useRef)([]),E=(0,U.useRef)(0),D=(0,U.useRef)(null),O=(0,U.useRef)(null),k=(0,U.useCallback)(()=>{D.current&&=(clearInterval(D.current),null),O.current&&=(clearTimeout(O.current),null),w.current?.getTracks().forEach(e=>e.stop()),w.current=null,S.current=null,T.current=[],m(!1),_(0)},[]);(0,U.useEffect)(()=>()=>k(),[k]);let A=(0,U.useCallback)(async()=>{let e=S.current;if(!e||e.state!==`recording`)return;b(!0),await new Promise(t=>{e.addEventListener(`stop`,()=>t(),{once:!0}),e.stop()});let t=Math.max(1,Math.round((Date.now()-E.current)/1e3)),n=e.mimeType||Z()||`audio/webm`,r=new Blob(T.current,{type:n});if(k(),r.size>0&&i){let e=n.includes(`mp4`)?`m4a`:n.includes(`ogg`)?`ogg`:`webm`,a=new File([r],`voice-${Date.now()}.${e}`,{type:n});try{await i(a,t)}finally{b(!1)}return}b(!1)},[k,i]),j=(0,U.useCallback)(async()=>{if(!(!i||y||f)&&!(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>`u`))try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=Z(),n=t?new MediaRecorder(e,{mimeType:t}):new MediaRecorder(e);w.current=e,S.current=n,T.current=[],E.current=Date.now(),n.ondataavailable=e=>{e.data.size>0&&T.current.push(e.data)},n.start(),m(!0),_(0),D.current=setInterval(()=>{_(Math.round((Date.now()-E.current)/1e3))},250),O.current=setTimeout(()=>{A()},X)}catch{k()}},[k,i,f,A,y]),M=(0,U.useCallback)(()=>{if(f){A();return}j()},[f,j,A]),N=(0,U.useCallback)(async e=>{let t=c.trim();if(!(!t||u)){d(!0),l(``);try{await n(t,e)}catch{l(t)}finally{d(!1),x.current?.focus()}}},[c,u,n]),P=(0,U.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),N()),e.key===`Enter`&&e.shiftKey&&(e.preventDefault(),N({navigate:!1}))},[N]),F=u||y;return(0,W.jsxs)(`div`,{className:I(`flex items-center gap-1.5 rounded-2xl border border-edge bg-surface-panel px-2 py-2 shadow-float dark:shadow-elevated`,`focus-within:border-accent focus-within:ring-1 focus-within:ring-accent`,f&&`border-danger ring-1 ring-danger/40`),children:[r&&(0,W.jsx)(`button`,{type:`button`,onClick:r,disabled:F||o||f,className:`shrink-0 rounded-lg p-2 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Image`,children:(0,W.jsx)(p,{className:`h-4 w-4`})}),i&&(0,W.jsx)(`button`,{type:`button`,onClick:M,disabled:F||s||u,className:I(`shrink-0 rounded-lg p-2 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,f?`bg-danger-soft text-danger hover:bg-danger-soft`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),"aria-label":f?`Stop recording`:`Voice`,"aria-pressed":f,children:f?(0,W.jsx)(g,{className:`h-4 w-4 fill-current`}):(0,W.jsx)(v,{className:`h-4 w-4`})}),f?(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate py-1.5 text-sm text-danger`,children:a.replace(`{{seconds}}`,String(h))}):(0,W.jsx)(`textarea`,{ref:x,value:c,onChange:e=>l(e.target.value),onKeyDown:P,placeholder:e,rows:1,disabled:F,className:`min-h-8 flex-1 resize-none bg-transparent py-1.5 text-sm leading-5 text-fg placeholder:text-fg-muted focus:outline-none disabled:opacity-60`,style:{fieldSizing:`content`}}),(0,W.jsx)(`button`,{type:`button`,disabled:!c.trim()||F||f,onClick:e=>void N({navigate:!e.shiftKey}),"aria-label":t,className:I(`shrink-0 rounded-lg p-2 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,c.trim()&&!F&&!f?`text-accent hover:bg-accent-soft`:`text-fg-disabled`),children:(0,W.jsx)(C,{className:`h-4 w-4`})})]})}var he={statusFilter:`all`,kindFilter:`all`,search:``};function $(){let e=(0,se.c)(107),t=a(i(xe)).notes,n=!!s(be),[r,l]=(0,U.useReducer)(m,he),[u]=(0,U.useState)(ye),d=O(),p;e[0]!==n||e[1]!==r.kindFilter||e[2]!==r.search||e[3]!==r.statusFilter?(p=n?[`notes-list`,r.statusFilter,r.kindFilter,r.search]:null,e[0]=n,e[1]=r.kindFilter,e[2]=r.search,e[3]=r.statusFilter,e[4]=p):p=e[4];let h=p,g;e[5]!==r.kindFilter||e[6]!==r.search||e[7]!==r.statusFilter?(g=()=>F({status:r.statusFilter===`all`?void 0:r.statusFilter,kind:r.kindFilter===`all`?void 0:r.kindFilter,search:r.search||void 0,limit:100,sortBy:`createdAt`,sortOrder:`desc`}),e[5]=r.kindFilter,e[6]=r.search,e[7]=r.statusFilter,e[8]=g):g=e[8];let v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(v={keepPreviousData:!0},e[9]=v):v=e[9];let{data:y,mutate:S,isLoading:C}=o(h,g,v),T=C&&!y,k;e[10]===y?.items?k=e[11]:(k=y?.items??[],e[10]=y?.items,e[11]=k);let j=k,M=y?.total??0,N=b(ve),P=b(_e),L=M>0?t.noteCount.replace(`{{count}}`,String(M)):null,R,B;e[12]!==P||e[13]!==n||e[14]!==t.title||e[15]!==L||e[16]!==N?(R=()=>n?(N({startExtra:null,main:(0,W.jsxs)(`div`,{className:I(`flex min-w-0 items-center gap-2 px-3 sm:px-5 xl:px-6`,x),children:[(0,W.jsx)(`h1`,{className:`min-w-0 truncate text-base font-semibold tracking-tight text-fg`,children:t.title}),L?(0,W.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:L}):null]}),end:null}),()=>P()):(P(),()=>P()),B=[P,n,t.title,L,N],e[12]=P,e[13]=n,e[14]=t.title,e[15]=L,e[16]=N,e[17]=R,e[18]=B):(R=e[17],B=e[18]),(0,U.useLayoutEffect)(R,B);let ee;e[19]!==t.daysAgo||e[20]!==t.justNow||e[21]!==t.minutesAgo||e[22]!==t.today||e[23]!==t.yesterday?(ee={justNow:t.justNow,minutesAgo:t.minutesAgo,today:t.today,yesterday:t.yesterday,daysAgo:t.daysAgo},e[19]=t.daysAgo,e[20]=t.justNow,e[21]=t.minutesAgo,e[22]=t.today,e[23]=t.yesterday,e[24]=ee):ee=e[24];let ne=ee,re;e[25]!==S||e[26]!==d?(re=async(e,t)=>{let n=await A(e,`web`);await S(),t?.navigate!==!1&&d(`/notes/${n.id}`)},e[25]=S,e[26]=d,e[27]=re):re=e[27];let H=re,ie;e[28]!==S||e[29]!==t.imageUploadFailed||e[30]!==t.imageUploadFailedHint?(ie=()=>{let e=document.createElement(`input`);e.type=`file`,e.accept=`image/*`,e.onchange=async()=>{let n=e.files?.[0];if(n)try{await E(n,`web`),await S()}catch(e){let n=e;c({type:`error`,title:t.imageUploadFailed,message:n instanceof Error?n.message:t.imageUploadFailedHint})}},e.click()},e[28]=S,e[29]=t.imageUploadFailed,e[30]=t.imageUploadFailedHint,e[31]=ie):ie=e[31];let ae=ie,oe;e[32]!==S||e[33]!==t.voiceUploadFailed||e[34]!==t.voiceUploadFailedHint?(oe=async(e,n)=>{try{await z(e,n,`web`),await S()}catch(e){let n=e;c({type:`error`,title:t.voiceUploadFailed,message:n instanceof Error?n.message:t.voiceUploadFailedHint})}},e[32]=S,e[33]=t.voiceUploadFailed,e[34]=t.voiceUploadFailedHint,e[35]=oe):oe=e[35];let ce=oe,G;e[36]===S?G=e[37]:(G=async(e,t)=>{await _(e,{pinned:t}),await S()},e[36]=S,e[37]=G);let le=G,K;e[38]===S?K=e[39]:(K=async e=>{await _(e,{status:`archived`}),await S()},e[38]=S,e[39]=K);let q=K,ue;e[40]===S?ue=e[41]:(ue=async e=>{await D(e),await S()},e[40]=S,e[41]=ue);let de=ue,fe;e[42]===d?fe=e[43]:(fe=e=>{d(`/notes/${e}`)},e[42]=d,e[43]=fe);let pe=fe;if(!n){let n;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,W.jsx)(f,{className:`h-10 w-10 text-fg-muted`}),e[44]=n):n=e[44];let r;return e[45]===t.needToken?r=e[46]:(r=(0,W.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:[n,(0,W.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.needToken})]}),e[45]=t.needToken,e[46]=r),r}let me;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,W.jsx)(w,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-fg-muted`,"aria-hidden":!0}),e[47]=me):me=e[47];let Y;e[48]===l?Y=e[49]:(Y=e=>l({type:`patch`,patch:{search:e.target.value}}),e[48]=l,e[49]=Y);let X;e[50]!==t.searchPlaceholder||e[51]!==Y||e[52]!==r.search?(X=(0,W.jsxs)(`div`,{className:`relative`,children:[me,(0,W.jsx)(`input`,{type:`search`,value:r.search,onChange:Y,placeholder:t.searchPlaceholder,className:`w-full rounded-xl border border-edge bg-surface-panel py-2 pl-9 pr-3 text-sm text-fg placeholder:text-fg-muted focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent`})]}),e[50]=t.searchPlaceholder,e[51]=Y,e[52]=r.search,e[53]=X):X=e[53];let Z;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(Z=[`all`,`inbox`,`processed`,`archived`],e[54]=Z):Z=e[54];let $;e[55]!==l||e[56]!==t.filterAll||e[57]!==t.filterArchived||e[58]!==t.filterInbox||e[59]!==t.filterProcessed||e[60]!==r.statusFilter?($=Z.map(e=>{let n=e===`all`?t.filterAll:e===`inbox`?t.filterInbox:e===`processed`?t.filterProcessed:t.filterArchived;return(0,W.jsx)(`button`,{type:`button`,onClick:()=>l({type:`patch`,patch:{statusFilter:e}}),className:I(`rounded-lg px-3 py-1.5 text-xs font-medium transition-colors`,r.statusFilter===e?`bg-accent text-white`:`bg-surface-hover text-fg-muted hover:text-fg`),children:n},e)}),e[55]=l,e[56]=t.filterAll,e[57]=t.filterArchived,e[58]=t.filterInbox,e[59]=t.filterProcessed,e[60]=r.statusFilter,e[61]=$):$=e[61];let Se,Ce;e[62]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,W.jsx)(`div`,{className:`mx-1 h-4 w-px bg-edge-subtle`}),Ce=[`all`,`thought`,`todo`,`voice`,`media`,`bookmark`],e[62]=Se,e[63]=Ce):(Se=e[62],Ce=e[63]);let we;e[64]!==l||e[65]!==t.kindAll||e[66]!==t.kindBookmark||e[67]!==t.kindMedia||e[68]!==t.kindThought||e[69]!==t.kindTodo||e[70]!==t.kindVoice||e[71]!==r.kindFilter?(we=Ce.map(e=>{let n=e===`all`?t.kindAll:e===`thought`?t.kindThought:e===`todo`?t.kindTodo:e===`voice`?t.kindVoice:e===`media`?t.kindMedia:t.kindBookmark;return(0,W.jsx)(`button`,{type:`button`,onClick:()=>l({type:`patch`,patch:{kindFilter:e}}),className:I(`rounded-lg px-3 py-1.5 text-xs font-medium transition-colors`,r.kindFilter===e?`bg-accent text-white`:`bg-surface-hover text-fg-muted hover:text-fg`),children:n},e)}),e[64]=l,e[65]=t.kindAll,e[66]=t.kindBookmark,e[67]=t.kindMedia,e[68]=t.kindThought,e[69]=t.kindTodo,e[70]=t.kindVoice,e[71]=r.kindFilter,e[72]=we):we=e[72];let Te;e[73]!==$||e[74]!==we?(Te=(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[$,Se,we]}),e[73]=$,e[74]=we,e[75]=Te):Te=e[75];let Ee;e[76]!==X||e[77]!==Te?(Ee=(0,W.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-4 p-4 pb-2`,children:[X,Te]}),e[76]=X,e[77]=Te,e[78]=Ee):Ee=e[78];let De;e[79]!==q||e[80]!==de||e[81]!==pe||e[82]!==le||e[83]!==t.archive||e[84]!==t.delete||e[85]!==t.imageNote||e[86]!==t.noNotes||e[87]!==t.noNotesDescription||e[88]!==t.noText||e[89]!==t.pin||e[90]!==t.unpin||e[91]!==j||e[92]!==u||e[93]!==T||e[94]!==ne?(De=(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pt-3 pb-24 [scrollbar-gutter:stable]`,children:T?(0,W.jsx)(`div`,{className:`flex flex-col gap-3`,children:[1,2,3].map(ge)}):j.length===0?(0,W.jsxs)(`div`,{className:`flex min-h-[min(40vh,20rem)] flex-col items-center justify-center gap-2 py-16 text-center`,children:[(0,W.jsx)(f,{className:`h-8 w-8 text-fg-muted`}),(0,W.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,children:t.noNotes}),(0,W.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.noNotesDescription})]}):(0,W.jsx)(`div`,{className:`flex flex-col gap-3`,children:j.map((e,n)=>{let r=n>0?te(j[n-1].createdAt):null;return(0,W.jsxs)(`div`,{children:[te(e.createdAt)!==r&&(0,W.jsx)(`div`,{className:I(`pb-2 text-xs font-medium text-fg-muted`,n>0&&`pt-2`),children:V(e.createdAt,u,ne)}),(0,W.jsx)(J,{note:e,onPress:pe,onPin:le,onArchive:q,onDelete:de,timeLabels:ne,labels:{pin:t.pin,unpin:t.unpin,archive:t.archive,delete:t.delete,imageNote:t.imageNote,noText:t.noText}})]},e.id)})})}),e[79]=q,e[80]=de,e[81]=pe,e[82]=le,e[83]=t.archive,e[84]=t.delete,e[85]=t.imageNote,e[86]=t.noNotes,e[87]=t.noNotesDescription,e[88]=t.noText,e[89]=t.pin,e[90]=t.unpin,e[91]=j,e[92]=u,e[93]=T,e[94]=ne,e[95]=De):De=e[95];let Oe;e[96]!==H||e[97]!==ae||e[98]!==ce||e[99]!==t.quickCapturePlaceholder||e[100]!==t.recording||e[101]!==t.send?(Oe=(0,W.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 z-10 bg-gradient-to-t from-surface-panel from-60% via-surface-panel/90 to-transparent px-4 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-6`,children:(0,W.jsx)(`div`,{className:`pointer-events-auto`,children:(0,W.jsx)(Q,{placeholder:t.quickCapturePlaceholder,sendLabel:t.send,onCapture:H,onImagePick:ae,onVoiceCapture:ce,recordingLabel:t.recording})})}),e[96]=H,e[97]=ae,e[98]=ce,e[99]=t.quickCapturePlaceholder,e[100]=t.recording,e[101]=t.send,e[102]=Oe):Oe=e[102];let ke;return e[103]!==Ee||e[104]!==De||e[105]!==Oe?(ke=(0,W.jsxs)(`div`,{className:`relative mx-auto flex h-full min-h-0 w-full max-w-3xl flex-1 flex-col overflow-hidden`,children:[Ee,De,Oe]}),e[103]=Ee,e[104]=De,e[105]=Oe,e[106]=ke):ke=e[106],ke}function ge(e){return(0,W.jsx)(`div`,{className:`h-24 animate-pulse rounded-xl bg-surface-hover`},e)}function _e(e){return e.clearPageHeader}function ve(e){return e.setPageHeader}function ye(){return Date.now()}function be(e){return e.token}function xe(e){return e.language}export{$ as NotesPage};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{$r as r,Xr as i,pi as a}from"./index-C_2yKRJX.js";var o=t();e();var s=n();function c(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function l(e){let t=e[`x-order`];return typeof t==`number`&&!Number.isNaN(t)?t:999}function u(e){let t=e[`x-group`];return typeof t==`string`&&t.length>0?t:``}function d(e){return e[`x-hidden`]===!0}function f(e){let t=e.properties;if(!c(t))return[];let n=[];for(let[e,r]of Object.entries(t))c(r)&&(d(r)||n.push({key:e,sub:r,order:l(r),group:u(r),hidden:!1}));return n.sort((e,t)=>e.order-t.order||e.key.localeCompare(t.key)),n}function p(e){let t=new Map;for(let n of e){let e=n.group;t.has(e)||t.set(e,[]),t.get(e).push(n)}return t}function m(e){let t=(0,o.c)(38),{name:n,s:a,value:c,onChange:l,disabled:u}=e,d=typeof a.description==`string`?a.description:void 0,f=(typeof a[`x-placeholder`]==`string`?a[`x-placeholder`]:null)||d,p=a.format;if(Array.isArray(a.enum)&&a.enum.every(g)){let e;t[0]===d?e=t[1]:(e=d?(0,s.jsx)(`label`,{className:`text-xs text-fg-muted`,children:d}):null,t[0]=d,t[1]=e);let r;t[2]===l?r=t[3]:(r=e=>l(e.target.value),t[2]=l,t[3]=r);let i;t[4]===a.enum?i=t[5]:(i=a.enum.map(h),t[4]=a.enum,t[5]=i);let o;t[6]!==u||t[7]!==n||t[8]!==r||t[9]!==i||t[10]!==c?(o=(0,s.jsx)(`select`,{name:n,className:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2 text-sm text-fg`,value:c,disabled:u,onChange:r,children:i}),t[6]=u,t[7]=n,t[8]=r,t[9]=i,t[10]=c,t[11]=o):o=t[11];let f;return t[12]!==e||t[13]!==o?(f=(0,s.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e,o]}),t[12]=e,t[13]=o,t[14]=f):f=t[14],f}if(p===`password`){let e;t[15]===d?e=t[16]:(e=d?(0,s.jsx)(`label`,{className:`text-xs text-fg-muted`,children:d}):null,t[15]=d,t[16]=e);let n;t[17]!==u||t[18]!==l||t[19]!==f||t[20]!==c?(n=(0,s.jsx)(r,{value:c,onChange:l,placeholder:f,labels:i,disabled:u,inputClassName:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2.5 text-sm text-fg placeholder:text-fg-muted/70`}),t[17]=u,t[18]=l,t[19]=f,t[20]=c,t[21]=n):n=t[21];let a;return t[22]!==e||t[23]!==n?(a=(0,s.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e,n]}),t[22]=e,t[23]=n,t[24]=a):a=t[24],a}let m;t[25]===d?m=t[26]:(m=d?(0,s.jsx)(`label`,{className:`text-xs text-fg-muted`,children:d}):null,t[25]=d,t[26]=m);let _;t[27]===l?_=t[28]:(_=e=>l(e.target.value),t[27]=l,t[28]=_);let v;t[29]!==u||t[30]!==n||t[31]!==f||t[32]!==_||t[33]!==c?(v=(0,s.jsx)(`input`,{name:n,type:`text`,className:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2.5 text-sm text-fg placeholder:text-fg-muted/70`,value:c,placeholder:f,disabled:u,onChange:_}),t[29]=u,t[30]=n,t[31]=f,t[32]=_,t[33]=c,t[34]=v):v=t[34];let y;return t[35]!==m||t[36]!==v?(y=(0,s.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[m,v]}),t[35]=m,t[36]=v,t[37]=y):y=t[37],y}function h(e){return(0,s.jsx)(`option`,{value:e,children:e},e)}function g(e){return typeof e==`string`}function _(e){let t=(0,o.c)(11),{s:n,value:r,onChange:i,disabled:a}=e,c=typeof n.description==`string`?n.description:void 0,l;t[0]===c?l=t[1]:(l=c?(0,s.jsx)(`label`,{className:`text-xs text-fg-muted`,children:c}):null,t[0]=c,t[1]=l);let u=Number.isFinite(r)?r:0,d;t[2]===i?d=t[3]:(d=e=>i(Number(e.target.value)),t[2]=i,t[3]=d);let f;t[4]!==a||t[5]!==u||t[6]!==d?(f=(0,s.jsx)(`input`,{type:`number`,className:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2.5 text-sm text-fg`,value:u,disabled:a,onChange:d}),t[4]=a,t[5]=u,t[6]=d,t[7]=f):f=t[7];let p;return t[8]!==l||t[9]!==f?(p=(0,s.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[l,f]}),t[8]=l,t[9]=f,t[10]=p):p=t[10],p}function v(e){let t=(0,o.c)(11),{s:n,value:r,onChange:i,disabled:a,labels:c}=e,l=(typeof n.description==`string`?n.description:void 0)??(typeof n.title==`string`&&n.title.length>0?n.title:c?.defaultBooleanLabel??`Enable`),u;t[0]===i?u=t[1]:(u=e=>i(e.target.checked),t[0]=i,t[1]=u);let d;t[2]!==a||t[3]!==u||t[4]!==r?(d=(0,s.jsx)(`input`,{type:`checkbox`,className:`size-4 rounded border border-edge`,checked:r,disabled:a,onChange:u}),t[2]=a,t[3]=u,t[4]=r,t[5]=d):d=t[5];let f;t[6]===l?f=t[7]:(f=(0,s.jsx)(`span`,{children:l}),t[6]=l,t[7]=f);let p;return t[8]!==d||t[9]!==f?(p=(0,s.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-fg`,children:[d,f]}),t[8]=d,t[9]=f,t[10]=p):p=t[10],p}function y(e){let t=(0,o.c)(27),{s:n,value:r,onChange:i,disabled:a,labels:l}=e,u=typeof n.description==`string`?n.description:void 0,d=n.items,f=c(d)?d.type:void 0;if(!(f===`string`||Array.isArray(f)&&f.includes(`string`))){let e=l?.unsupportedArrayType??`Unsupported array type`,n;return t[0]===e?n=t[1]:(n=(0,s.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e}),t[0]=e,t[1]=n),n}let p,m,h,g,_;if(t[2]!==u||t[3]!==a||t[4]!==i||t[5]!==r){let e=r.map(String);p=t=>{let n=t.trim();!n||e.includes(n)||i([...e,n])},g=`flex flex-col gap-1.5`,t[11]===u?_=t[12]:(_=u?(0,s.jsx)(`label`,{className:`text-xs text-fg-muted`,children:u}):null,t[11]=u,t[12]=_),m=`flex flex-wrap gap-1`,h=e.map(t=>(0,s.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-edge bg-surface-panel px-2 py-0.5 text-sm`,children:[t,(0,s.jsx)(`button`,{type:`button`,className:`text-fg-muted hover:text-fg`,disabled:a,onClick:()=>i(e.filter(e=>e!==t)),children:`×`})]},t)),t[2]=u,t[3]=a,t[4]=i,t[5]=r,t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=_}else p=t[6],m=t[7],h=t[8],g=t[9],_=t[10];let v;t[13]!==m||t[14]!==h?(v=(0,s.jsx)(`div`,{className:m,children:h}),t[13]=m,t[14]=h,t[15]=v):v=t[15];let y=l?.arrayAddPlaceholder??`Add and press Enter`,b;t[16]===p?b=t[17]:(b=e=>{e.key===`Enter`&&(e.preventDefault(),p(e.target.value),e.target.value=``)},t[16]=p,t[17]=b);let x;t[18]!==a||t[19]!==y||t[20]!==b?(x=(0,s.jsx)(`input`,{className:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2.5 text-sm`,disabled:a,placeholder:y,onKeyDown:b}),t[18]=a,t[19]=y,t[20]=b,t[21]=x):x=t[21];let S;return t[22]!==g||t[23]!==_||t[24]!==v||t[25]!==x?(S=(0,s.jsxs)(`div`,{className:g,children:[_,v,x]}),t[22]=g,t[23]=_,t[24]=v,t[25]=x,t[26]=S):S=t[26],S}function b(e){let t=(0,o.c)(66),{k:n,sub:r,value:i,onValue:a,disabled:l,labels:u}=e,d=r.type,f=(typeof r.title==`string`&&r.title.length>0?r.title:null)??n;if(d===`boolean`){let e;t[0]===f?e=t[1]:(e=(0,s.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:f}),t[0]=f,t[1]=e);let n=i===!0,o;t[2]===a?o=t[3]:(o=e=>a(e),t[2]=a,t[3]=o);let c;t[4]!==l||t[5]!==u||t[6]!==r||t[7]!==n||t[8]!==o?(c=(0,s.jsx)(v,{s:r,value:n,disabled:l,onChange:o,labels:u}),t[4]=l,t[5]=u,t[6]=r,t[7]=n,t[8]=o,t[9]=c):c=t[9];let d;return t[10]!==e||t[11]!==c?(d=(0,s.jsxs)(`div`,{className:`space-y-1.5`,children:[e,c]}),t[10]=e,t[11]=c,t[12]=d):d=t[12],d}if(d===`number`||d===`integer`){let e;t[13]===f?e=t[14]:(e=(0,s.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:f}),t[13]=f,t[14]=e);let n=typeof i==`number`?i:0,o;t[15]!==l||t[16]!==a||t[17]!==r||t[18]!==n?(o=(0,s.jsx)(_,{s:r,value:n,disabled:l,onChange:a}),t[15]=l,t[16]=a,t[17]=r,t[18]=n,t[19]=o):o=t[19];let c;return t[20]!==e||t[21]!==o?(c=(0,s.jsxs)(`div`,{className:`space-y-1.5`,children:[e,o]}),t[20]=e,t[21]=o,t[22]=c):c=t[22],c}if(d===`string`){let e;t[23]===f?e=t[24]:(e=(0,s.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:f}),t[23]=f,t[24]=e);let o=typeof i==`string`?i:``,c;t[25]!==l||t[26]!==n||t[27]!==a||t[28]!==r||t[29]!==o?(c=(0,s.jsx)(m,{name:n,s:r,value:o,disabled:l,onChange:a}),t[25]=l,t[26]=n,t[27]=a,t[28]=r,t[29]=o,t[30]=c):c=t[30];let u;return t[31]!==e||t[32]!==c?(u=(0,s.jsxs)(`div`,{className:`space-y-1.5`,children:[e,c]}),t[31]=e,t[32]=c,t[33]=u):u=t[33],u}if(d===`array`){let e=r.items,n=c(e)?e.type:void 0;if(n===`string`||Array.isArray(n)&&n.includes(`string`)){let e;t[34]===f?e=t[35]:(e=(0,s.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:f}),t[34]=f,t[35]=e);let n;t[36]===i?n=t[37]:(n=Array.isArray(i)&&i.every(x)?i.map(String):[],t[36]=i,t[37]=n);let o;t[38]!==l||t[39]!==u||t[40]!==a||t[41]!==r||t[42]!==n?(o=(0,s.jsx)(y,{s:r,value:n,disabled:l,onChange:a,labels:u}),t[38]=l,t[39]=u,t[40]=a,t[41]=r,t[42]=n,t[43]=o):o=t[43];let c;return t[44]!==e||t[45]!==o?(c=(0,s.jsxs)(`div`,{className:`space-y-1.5`,children:[e,o]}),t[44]=e,t[45]=o,t[46]=c):c=t[46],c}}if(d===`object`){let e;t[47]===i?e=t[48]:(e=c(i)?i:{},t[47]=i,t[48]=e);let n=e,o;t[49]===f?o=t[50]:(o=(0,s.jsx)(`summary`,{className:`cursor-pointer select-none px-3 py-2 text-sm font-medium text-fg group-open:rounded-b-none`,children:f}),t[49]=f,t[50]=o);let d;t[51]!==l||t[52]!==u||t[53]!==n||t[54]!==a||t[55]!==r?(d=(0,s.jsx)(`div`,{className:`border-t border-edge p-3`,children:(0,s.jsx)(S,{schema:r,values:n,onChange:a,disabled:l,labels:u})}),t[51]=l,t[52]=u,t[53]=n,t[54]=a,t[55]=r,t[56]=d):d=t[56];let p;return t[57]!==o||t[58]!==d?(p=(0,s.jsxs)(`details`,{className:`group rounded-lg border border-edge bg-surface-panel/40 open:bg-surface-base`,open:!0,children:[o,d]}),t[57]=o,t[58]=d,t[59]=p):p=t[59],p}let p;t[60]!==u||t[61]!==d||t[62]!==f?(p=u?.unsupportedFieldType?.(f,typeof d==`string`?d:void 0)??`${f}: unsupported field type${typeof d==`string`?` (${d})`:``}`,t[60]=u,t[61]=d,t[62]=f,t[63]=p):p=t[63];let h;return t[64]===p?h=t[65]:(h=(0,s.jsx)(`p`,{className:`text-xs text-fg-muted`,children:p}),t[64]=p,t[65]=h),h}function x(e){return typeof e==`string`||typeof e==`number`}function S(e){let t=(0,o.c)(28),{schema:n,values:r,onChange:i,disabled:l,className:u,labels:d}=e,m=l===void 0?!1:l,h;bb0:{if(n.type!==`object`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0],h=e;break bb0}let e;t[1]===n?e=t[2]:(e=f(n),t[1]=n,t[2]=e),h=e}let g=h,_;bb1:{if(g.length===0){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=new Map,t[3]=e):e=t[3],_=e;break bb1}let e;t[4]===g?e=t[5]:(e=p(g),t[4]=g,t[5]=e),_=e}let v=_,y;t[6]!==i||t[7]!==r?(y=(e,t)=>{i({...r,[e]:t})},t[6]=i,t[7]=r,t[8]=y):y=t[8];let x=y;if(n.type!==`object`||!c(n.properties)||g.length===0)return null;let S,w;if(t[9]!==u||t[10]!==m||t[11]!==v||t[12]!==d||t[13]!==x||t[14]!==r){let e=Array.from(v.keys()).sort(C);t[17]===u?S=t[18]:(S=a(`flex flex-col gap-4`,u),t[17]=u,t[18]=S);let n;t[19]!==m||t[20]!==v||t[21]!==d||t[22]!==x||t[23]!==r?(n=e=>{let t=(v.get(e)??[]).map(e=>(0,s.jsx)(b,{k:e.key,sub:e.sub,value:r[e.key],onValue:t=>x(e.key,t),disabled:m,labels:d},e.key));return e===``?(0,s.jsx)(`div`,{children:t},`default`):(0,s.jsxs)(`details`,{className:`group rounded-lg border border-edge bg-surface-panel/40 open:bg-surface-base`,open:!0,children:[(0,s.jsx)(`summary`,{className:`cursor-pointer select-none px-3 py-2 text-sm font-medium text-fg group-open:rounded-b-none`,children:e}),(0,s.jsx)(`div`,{className:`space-y-4 border-t border-edge p-3`,children:t})]},e)},t[19]=m,t[20]=v,t[21]=d,t[22]=x,t[23]=r,t[24]=n):n=t[24],w=e.map(n),t[9]=u,t[10]=m,t[11]=v,t[12]=d,t[13]=x,t[14]=r,t[15]=S,t[16]=w}else S=t[15],w=t[16];let T;return t[25]!==S||t[26]!==w?(T=(0,s.jsx)(`div`,{className:S,children:w}),t[25]=S,t[26]=w,t[27]=T):T=t[27],T}function C(e,t){return e===``?-1:t===``?1:e.localeCompare(t)}export{S as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{i,o as a,t as o}from"./url-DQRqHuL-.js";import{i as s}from"./vendor-swr-BIWyz7Rc.js";import{a as c,n as l}from"./fetch-CFdKBnE6.js";import{i as u,r as d}from"./gateway-startup-retry-DdngdObI.js";import{Ar as f,Ea as p,Ei as m,Er as ee,Gn as h,Ha as g,I as _,Jo as v,Kn as te,L as y,Or as ne,R as b,Tn as x,Tr as S,Ua as C,Va as w,Wn as T,Zi as E,_r as D,ar as O,cr as k,di as A,dr as j,fi as M,fr as N,gr as P,ha as F,hi as I,ho as L,ii as R,ir as z,ja as B,jr as V,kr as H,lr as U,ma as W,mi as re,mo as ie,ns as ae,or as G,pi as K,pr as oe,qi as q,qo as se,ri as J,so as ce,sr as le,ur as ue,wn as de,wo as fe}from"./index-C_2yKRJX.js";import{n as pe,t as Y}from"./settings-form-section-BoYYZmJG.js";var X=e(t(),1),Z=n(),Q=r();function me(e){let t=new Date(e),n=Math.floor((new Date().getTime()-t.getTime())/(1e3*60*60*24));return n===0?t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):n===1?`Yesterday`:n<7?t.toLocaleDateString([],{weekday:`short`}):t.toLocaleDateString([],{month:`short`,day:`numeric`})}function he(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function ge(e){let t=(0,Z.c)(105),{session:n,variant:r,labels:i,sessionAgentId:a,sessionAgentAvatar:o,onOpen:s,onAction:c}=e,l;t[0]!==i.unnamedSession||t[1]!==n.name?(l=n.name?.trim()||i.unnamedSession,t[0]=i.unnamedSession,t[1]=n.name,t[2]=l):l=t[2];let u=l,d;t[3]===n.name?d=t[4]:(d=n.name?.trim(),t[3]=n.name,t[4]=d);let f=!!d,ee=n.status===`archived`,h=n.status===`pinned`,g=r===`list`&&`sm:flex-row sm:items-center sm:gap-4`,_;t[5]===g?_=t[6]:(_=K(`group flex min-w-0 w-full max-w-full cursor-pointer flex-col rounded-xl bg-surface-base text-left transition-colors duration-150 ease-out`,`hover:bg-surface-hover active:scale-[0.99]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,g),t[5]=g,t[6]=_);let y;t[7]===s?y=t[8]:(y=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s())},t[7]=s,t[8]=y);let ne=r===`list`&&`sm:py-3`,b;t[9]===ne?b=t[10]:(b=K(`flex min-w-0 items-start justify-between gap-2 bg-surface-hover/35 px-3 py-2 dark:bg-surface-hover/25`,ne),t[9]=ne,t[10]=b);let x;t[11]===n.sourceChannel?x=t[12]:(x=(0,Q.jsx)(`div`,{className:`flex min-w-0 items-center gap-2`,children:(0,Q.jsx)(`span`,{className:`truncate text-[11px] font-medium uppercase tracking-wide text-fg-subtle`,children:n.sourceChannel})}),t[11]=n.sourceChannel,t[12]=x);let S;t[13]===h?S=t[14]:(S=h?(0,Q.jsx)(F,{className:`size-3.5 text-accent-fg`,strokeWidth:1.75,"aria-hidden":!0}):null,t[13]=h,t[14]=S);let C;t[15]===n.updatedAt?C=t[16]:(C=me(n.updatedAt),t[15]=n.updatedAt,t[16]=C);let w;t[17]===C?w=t[18]:(w=(0,Q.jsx)(`span`,{children:C}),t[17]=C,t[18]=w);let T;t[19]!==w||t[20]!==S?(T=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-fg-muted`,children:[S,w]}),t[19]=w,t[20]=S,t[21]=T):T=t[21];let E;t[22]!==T||t[23]!==b||t[24]!==x?(E=(0,Q.jsxs)(`div`,{className:b,children:[x,T]}),t[22]=T,t[23]=b,t[24]=x,t[25]=E):E=t[25];let D=r===`list`&&`sm:py-3`,O;t[26]===D?O=t[27]:(O=K(`min-w-0 flex-1 px-3 py-2`,D),t[26]=D,t[27]=O);let k=r===`list`&&`sm:items-start`,A;t[28]===k?A=t[29]:(A=K(`flex gap-3`,k),t[28]=k,t[29]=A);let j;t[30]!==o||t[31]!==a?(j=(0,Q.jsx)(te,{agentId:a,avatar:o,size:40,className:`size-10 shrink-0 ring-1 ring-edge/60 dark:ring-edge`}),t[30]=o,t[31]=a,t[32]=j):j=t[32];let M;t[33]===u?M=t[34]:(M=(0,Q.jsx)(`div`,{className:`min-w-0 max-w-full truncate text-sm font-semibold text-fg`,title:u,children:u}),t[33]=u,t[34]=M);let N;t[35]!==n.key||t[36]!==f?(N=f?(0,Q.jsx)(`div`,{className:`mt-0.5 min-w-0 max-w-full truncate font-mono text-[11px] text-fg-subtle`,title:n.key,children:n.key}):null,t[35]=n.key,t[36]=f,t[37]=N):N=t[37];let P;t[38]!==M||t[39]!==N?(P=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[M,N]}),t[38]=M,t[39]=N,t[40]=P):P=t[40];let I;t[41]!==A||t[42]!==j||t[43]!==P?(I=(0,Q.jsxs)(`div`,{className:A,children:[j,P]}),t[41]=A,t[42]=j,t[43]=P,t[44]=I):I=t[44];let L;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(p,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[45]=L):L=t[45];let R;t[46]===n.messageCount?R=t[47]:(R=(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[L,n.messageCount]}),t[46]=n.messageCount,t[47]=R);let z;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(re,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[48]=z):z=t[48];let B;t[49]===n.estimatedTokens?B=t[50]:(B=he(n.estimatedTokens),t[49]=n.estimatedTokens,t[50]=B);let V;t[51]===B?V=t[52]:(V=(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[z,B]}),t[51]=B,t[52]=V);let H;t[53]!==R||t[54]!==V?(H=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-xs text-fg-muted`,children:[R,V]}),t[53]=R,t[54]=V,t[55]=H):H=t[55];let U;t[56]===n.tags?U=t[57]:(U=n.tags.length>0?(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[n.tags.slice(0,3).map(ye),n.tags.length>3?(0,Q.jsxs)(`span`,{className:`text-[11px] text-fg-disabled`,children:[`+`,n.tags.length-3]}):null]}):null,t[56]=n.tags,t[57]=U);let ae;t[58]!==O||t[59]!==I||t[60]!==H||t[61]!==U?(ae=(0,Q.jsxs)(`div`,{className:O,children:[I,H,U]}),t[58]=O,t[59]=I,t[60]=H,t[61]=U,t[62]=ae):ae=t[62];let G;t[63]===c?G=t[64]:(G=()=>c(`continue`),t[63]=c,t[64]=G);let oe;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Q.jsx)(p,{className:`size-4`,strokeWidth:1.75}),t[65]=oe):oe=t[65];let q;t[66]!==i.continueChat||t[67]!==G?(q=(0,Q.jsx)(`button`,{type:`button`,className:J,title:i.continueChat,"aria-label":i.continueChat,onClick:G,children:oe}),t[66]=i.continueChat,t[67]=G,t[68]=q):q=t[68];let ce;t[69]!==ee||t[70]!==i.archive||t[71]!==i.unarchive||t[72]!==c?(ce=ee?(0,Q.jsx)(`button`,{type:`button`,className:J,title:i.unarchive,"aria-label":i.unarchive,onClick:()=>c(`unarchive`),children:(0,Q.jsx)(v,{className:`size-4`,strokeWidth:1.75})}):(0,Q.jsx)(`button`,{type:`button`,className:J,title:i.archive,"aria-label":i.archive,onClick:()=>c(`archive`),children:(0,Q.jsx)(se,{className:`size-4`,strokeWidth:1.75})}),t[69]=ee,t[70]=i.archive,t[71]=i.unarchive,t[72]=c,t[73]=ce):ce=t[73];let le;t[74]!==h||t[75]!==i.pin||t[76]!==i.unpin||t[77]!==c?(le=h?(0,Q.jsx)(`button`,{type:`button`,className:J,title:i.unpin,"aria-label":i.unpin,onClick:()=>c(`unpin`),children:(0,Q.jsx)(W,{className:`size-4`,strokeWidth:1.75})}):(0,Q.jsx)(`button`,{type:`button`,className:J,title:i.pin,"aria-label":i.pin,onClick:()=>c(`pin`),children:(0,Q.jsx)(F,{className:`size-4`,strokeWidth:1.75})}),t[74]=h,t[75]=i.pin,t[76]=i.unpin,t[77]=c,t[78]=le):le=t[78];let ue;t[79]===c?ue=t[80]:(ue=()=>c(`export`),t[79]=c,t[80]=ue);let de;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Q.jsx)(ie,{className:`size-4`,strokeWidth:1.75}),t[81]=de):de=t[81];let fe;t[82]!==i.export||t[83]!==ue?(fe=(0,Q.jsx)(`button`,{type:`button`,className:J,title:i.export,"aria-label":i.export,onClick:ue,children:de}),t[82]=i.export,t[83]=ue,t[84]=fe):fe=t[84];let pe;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(pe=K(J,`text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40`),t[85]=pe):pe=t[85];let Y;t[86]===c?Y=t[87]:(Y=()=>c(`delete`),t[86]=c,t[87]=Y);let X;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,Q.jsx)(m,{className:`size-4`,strokeWidth:1.75}),t[88]=X):X=t[88];let ge;t[89]!==i.delete||t[90]!==Y?(ge=(0,Q.jsx)(`button`,{type:`button`,className:pe,title:i.delete,"aria-label":i.delete,onClick:Y,children:X}),t[89]=i.delete,t[90]=Y,t[91]=ge):ge=t[91];let $;t[92]!==q||t[93]!==ce||t[94]!==le||t[95]!==fe||t[96]!==ge?($=(0,Q.jsxs)(`div`,{role:`group`,className:`flex flex-wrap items-center gap-0.5 border-t border-edge-subtle/80 bg-surface-hover/25 p-2 dark:border-edge-subtle`,onClick:ve,onKeyDown:_e,children:[q,ce,le,fe,ge]}),t[92]=q,t[93]=ce,t[94]=le,t[95]=fe,t[96]=ge,t[97]=$):$=t[97];let be;return t[98]!==s||t[99]!==E||t[100]!==ae||t[101]!==_||t[102]!==$||t[103]!==y?(be=(0,Q.jsxs)(`div`,{role:`button`,tabIndex:0,className:_,onClick:s,onKeyDown:y,children:[E,ae,$]}),t[98]=s,t[99]=E,t[100]=ae,t[101]=_,t[102]=$,t[103]=y,t[104]=be):be=t[104],be}function _e(e){return e.stopPropagation()}function ve(e){return e.stopPropagation()}function ye(e){return(0,Q.jsx)(`span`,{className:`max-w-full break-words rounded-md bg-surface-hover px-1.5 py-0.5 text-[11px] text-fg-muted`,children:e},e)}function $(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function be(e){return e===`main`||e===`per-peer`||e===`per-channel-peer`||e===`per-account-channel-peer`?e:`main`}function xe(e){let t=$(e)?e:{},n=$(t.session)?t.session:{},r=$(n.storage)?n.storage:{},i=typeof r.pruneAfterDays==`number`&&Number.isFinite(r.pruneAfterDays)?Math.max(0,Math.floor(r.pruneAfterDays)):typeof r.pruneAfterMs==`number`&&Number.isFinite(r.pruneAfterMs)?Math.max(0,Math.round(r.pruneAfterMs/864e5)):null,a=typeof r.maxEntries==`number`&&Number.isFinite(r.maxEntries)?Math.max(1,Math.floor(r.maxEntries)):null;return{dmScope:be(n.dmScope),pruneAfterDays:i,maxEntries:a}}async function Se(e){await l(o(`/api/config`),{method:`PATCH`,body:JSON.stringify({session:{dmScope:e.dmScope,storage:{pruneAfterMs:e.pruneAfterDays===null?null:e.pruneAfterDays*864e5,maxEntries:e.maxEntries}}})}),d()}function Ce(){return K(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,A,`dark:border-edge`)}var we=_();function Te({hasToken:e}){let t=a(i(e=>e.language)).sessions.config,{data:n,isLoading:r}=u(e),o=(0,X.useMemo)(()=>n?.payload?.config===void 0?null:xe(n.payload.config),[n]),[s,c]=(0,X.useReducer)(we,{form:null,baseline:null}),l=s.form,d=s.baseline,[f,p]=(0,X.useState)(!1),[m,ee]=(0,X.useState)(null),h=(0,X.useRef)(!1),g=(0,X.useRef)(null);y({enabled:e,parsed:o,dirty:h.current,trackedParsedRef:g,dispatch:c,onResetDirty:()=>{h.current=!1}});let _=l&&d&&JSON.stringify(l)!==JSON.stringify(d),v=(0,X.useCallback)(e=>{h.current=!0,c({type:`patch`,patch:e})},[]);return!e||!l?r?(0,Q.jsx)(Y,{children:(0,Q.jsx)(B,{className:`size-4 animate-spin text-fg-muted`})}):null:(0,Q.jsxs)(Y,{children:[(0,Q.jsx)(pe,{icon:L,title:t.title,subtitle:t.hint}),(0,Q.jsxs)(`div`,{className:`mb-4 flex justify-end gap-2`,children:[(0,Q.jsx)(M,{type:`button`,variant:`secondary`,disabled:!_||f,onClick:()=>c({type:`discard`}),children:t.discard}),(0,Q.jsx)(M,{type:`button`,variant:`primary`,disabled:!_||f,onClick:()=>{(async()=>{p(!0),ee(null);try{await Se(l),h.current=!1,c({type:`saved`,value:l})}catch(e){ee(e instanceof Error?e.message:t.saveError)}finally{p(!1)}})()},children:f?t.saving:t.save})]}),m?(0,Q.jsx)(`p`,{className:`mb-3 text-sm text-red-600 dark:text-red-400`,children:m}):null,(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.dmScope}),(0,Q.jsxs)(`select`,{className:Ce(),value:l.dmScope,onChange:e=>v({dmScope:e.target.value}),children:[(0,Q.jsx)(`option`,{value:`main`,children:t.dmScopeMain}),(0,Q.jsx)(`option`,{value:`per-peer`,children:t.dmScopePerPeer}),(0,Q.jsx)(`option`,{value:`per-channel-peer`,children:t.dmScopePerChannelPeer}),(0,Q.jsx)(`option`,{value:`per-account-channel-peer`,children:t.dmScopePerAccountChannelPeer})]}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.dmScopeHint})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.pruneAfterDays}),(0,Q.jsx)(`input`,{type:`number`,min:0,className:Ce(),value:l.pruneAfterDays??``,placeholder:t.unsetPlaceholder,onChange:e=>{let t=e.target.value.trim();v({pruneAfterDays:t===``?null:Math.max(0,Math.floor(Number(t)||0))})}})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-fg`,children:t.maxEntries}),(0,Q.jsx)(`input`,{type:`number`,min:1,className:Ce(),value:l.maxEntries??``,placeholder:t.unsetPlaceholder,onChange:e=>{let t=e.target.value.trim();v({maxEntries:t===``?null:Math.max(1,Math.floor(Number(t)||1))})}})]})]})]})}function Ee(e){if(typeof e==`string`)return e.length>2e3?`${e.slice(0,2e3)}…`:e;try{let t=JSON.stringify(e,null,2);return t.length>2e3?`${t.slice(0,2e3)}…`:t}catch{return String(e)}}function De(e){let t=(0,Z.c)(60),{open:n,loading:r,session:i,sessionAgentId:a,sessionAgentAvatar:o,labels:s,onClose:c,onArchive:l,onUnarchive:u,onPin:d,onUnpin:p,onExport:m,onDelete:h}=e,g=i?.status===`archived`,_=i?.status===`pinned`,v;t[0]===c?v=t[1]:(v=e=>!e&&c(),t[0]=c,t[1]=v);let y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(ne,{className:K(`xopc-dialog-overlay fixed inset-0 bg-scrim`,x)}),t[2]=y):y=t[2];let b;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(b=K(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-panel shadow-popover outline-none`,de,`dark:border-edge`),t[3]=b):b=t[3];let C;t[4]!==i||t[5]!==o||t[6]!==a?(C=i&&a?(0,Q.jsx)(te,{agentId:a,avatar:o,size:40,className:`size-10 shrink-0 ring-1 ring-edge/60 dark:ring-edge`}):null,t[4]=i,t[5]=o,t[6]=a,t[7]=C):C=t[7];let w;t[8]!==s.unnamedSession||t[9]!==i?.name?(w=i?.name?.trim()||s.unnamedSession,t[8]=s.unnamedSession,t[9]=i?.name,t[10]=w):w=t[10];let T;t[11]===w?T=t[12]:(T=(0,Q.jsx)(V,{className:`min-w-0 flex-1 truncate text-base font-semibold tracking-tight text-fg`,children:w}),t[11]=w,t[12]=T);let E;t[13]!==C||t[14]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[C,T]}),t[13]=C,t[14]=T,t[15]=E):E=t[15];let D;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(I,{className:`size-5`,strokeWidth:1.75}),t[16]=D):D=t[16];let O;t[17]===s.close?O=t[18]:(O=(0,Q.jsx)(S,{asChild:!0,children:(0,Q.jsx)(M,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":s.close,children:D})}),t[17]=s.close,t[18]=O);let k;t[19]!==E||t[20]!==O?(k=(0,Q.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[E,O]}),t[19]=E,t[20]=O,t[21]=k):k=t[21];let A;t[22]!==s.detailLoading||t[23]!==s.detailMessages||t[24]!==r||t[25]!==i?(A=r?(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:s.detailLoading}):i?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`dl`,{className:`mb-4 grid gap-2 text-xs text-fg-muted`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-fg-disabled`,children:`Key`}),(0,Q.jsx)(`dd`,{className:`mt-0.5 break-all font-mono text-fg`,children:i.key})]}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-4`,children:(0,Q.jsxs)(`span`,{children:[i.messageCount,` msgs · `,i.estimatedTokens,` tok`]})})]}),(0,Q.jsx)(`h3`,{className:`mb-2 text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:s.detailMessages}),(0,Q.jsx)(`ul`,{className:`space-y-3`,children:i.messages.map(Oe)})]}):null,t[22]=s.detailLoading,t[23]=s.detailMessages,t[24]=r,t[25]=i,t[26]=A):A=t[26];let j;t[27]===A?j=t[28]:(j=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:A}),t[27]=A,t[28]=j);let N;t[29]!==s.detailExport||t[30]!==m?(N=(0,Q.jsx)(M,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:m,children:s.detailExport}),t[29]=s.detailExport,t[30]=m,t[31]=N):N=t[31];let P;t[32]!==g||t[33]!==s.archive||t[34]!==s.unarchive||t[35]!==l||t[36]!==u?(P=g?(0,Q.jsx)(M,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:u,children:s.unarchive}):(0,Q.jsx)(M,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:l,children:s.archive}),t[32]=g,t[33]=s.archive,t[34]=s.unarchive,t[35]=l,t[36]=u,t[37]=P):P=t[37];let F;t[38]!==_||t[39]!==s.pin||t[40]!==s.unpin||t[41]!==d||t[42]!==p?(F=_?(0,Q.jsx)(M,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:p,children:s.unpin}):(0,Q.jsx)(M,{type:`button`,variant:`secondary`,className:`text-sm`,onClick:d,children:s.pin}),t[38]=_,t[39]=s.pin,t[40]=s.unpin,t[41]=d,t[42]=p,t[43]=F):F=t[43];let L;t[44]!==s.delete||t[45]!==h?(L=(0,Q.jsx)(M,{type:`button`,variant:`secondary`,className:`text-sm text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40`,onClick:h,children:s.delete}),t[44]=s.delete,t[45]=h,t[46]=L):L=t[46];let R;t[47]!==N||t[48]!==P||t[49]!==F||t[50]!==L?(R=(0,Q.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3 dark:border-edge`,children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[N,P,F,L]})}),t[47]=N,t[48]=P,t[49]=F,t[50]=L,t[51]=R):R=t[51];let z;t[52]!==k||t[53]!==j||t[54]!==R?(z=(0,Q.jsxs)(H,{children:[y,(0,Q.jsxs)(ee,{className:b,"aria-describedby":void 0,children:[k,j,R]})]}),t[52]=k,t[53]=j,t[54]=R,t[55]=z):z=t[55];let B;return t[56]!==n||t[57]!==v||t[58]!==z?(B=(0,Q.jsx)(f,{open:n,onOpenChange:v,children:z}),t[56]=n,t[57]=v,t[58]=z,t[59]=B):B=t[59],B}function Oe(e){return(0,Q.jsxs)(`li`,{className:`rounded-lg border border-edge-subtle bg-surface-hover/50 p-2 dark:border-edge`,children:[(0,Q.jsx)(`div`,{className:`mb-1 text-[10px] font-medium uppercase text-fg-subtle`,children:e.role}),(0,Q.jsx)(`pre`,{className:`max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed text-fg-muted`,children:Ee(e.content)})]},`${e.timestamp??``}-${e.role}-${Ee(e.content).slice(0,24)}`)}var ke=20;function Ae(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}var je=new Set([`all`,`active`,`pinned`,`archived`]),Me=new Set([`grid`,`list`]),Ne=[`sessions`,`settings`];function Pe(e){return e&&Ne.includes(e)?e:`sessions`}function Fe(e,t){return t===`sessions`?e.tabsSessions:e.tabsSettings}function Ie(e,t){return t===`sessions`?e.tabsSessionsHint:e.tabsSettingsHint}function Le(e){let t=(0,Z.c)(11),{s:n,activeTab:r,onChange:i}=e,a=n.tabsAriaLabel,o;t[0]!==r||t[1]!==i?(o=e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault();let t=Ne.indexOf(r);t<0||i(Ne[(t+(e.key===`ArrowRight`?1:-1)+Ne.length)%Ne.length])},t[0]=r,t[1]=i,t[2]=o):o=t[2];let s;t[3]!==r||t[4]!==i||t[5]!==n?(s=Ne.map(e=>{let t=e===`sessions`?C:q,a=e===r;return(0,Q.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":a,"aria-controls":`sessions-panel-${e}`,id:`sessions-tab-${e}`,className:K(`inline-flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,R.press,a?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),onClick:()=>i(e),children:[(0,Q.jsx)(t,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:Fe(n,e)})]},e)}),t[3]=r,t[4]=i,t[5]=n,t[6]=s):s=t[6];let c;return t[7]!==n.tabsAriaLabel||t[8]!==o||t[9]!==s?(c=(0,Q.jsx)(`nav`,{"aria-label":a,className:`-mx-1 flex gap-1 overflow-x-auto px-1 pb-1`,role:`tablist`,onKeyDown:o,children:s}),t[7]=n.tabsAriaLabel,t[8]=o,t[9]=s,t[10]=c):c=t[10],c}function Re(e){let t=(0,Z.c)(10),{s:n,id:r,activeTab:i,plain:a,children:o}=e,s=a===void 0?!1:a;if(i!==r)return null;let c=`sessions-panel-${r}`,l=`sessions-tab-${r}`,u=s?`contents`:`rounded-2xl border border-edge bg-surface-base px-4 py-5 sm:px-5`,d;t[0]!==o||t[1]!==r||t[2]!==s||t[3]!==n?(d=s?o:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`mb-5`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:Fe(n,r)}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:Ie(n,r)})]}),(0,Q.jsx)(`div`,{className:`space-y-4`,children:o})]}),t[0]=o,t[1]=r,t[2]=s,t[3]=n,t[4]=d):d=t[4];let f;return t[5]!==c||t[6]!==l||t[7]!==u||t[8]!==d?(f=(0,Q.jsx)(`section`,{id:c,role:`tabpanel`,"aria-labelledby":l,className:u,children:d}),t[5]=c,t[6]=l,t[7]=u,t[8]=d,t[9]=f):f=t[9],f}function ze(e){let t=e.get(`status`),n=e.get(`view`);return{searchInput:e.get(`q`)??``,debouncedSearch:(e.get(`q`)??``).trim(),statusFilter:je.has(t)?t:`all`,viewMode:Me.has(n)?n:`grid`,channelFilter:(e.get(`channel`)??``).trim(),sessions:[],loading:!1,error:null,hasMore:!1,stats:null,detailOpen:!1,detailLoading:!1,detailSession:null,confirmOpen:!1,confirmKey:null}}function Be(){let e=a(i(e=>e.language)),t=e.sessions,n=c(e=>e.token),r=!!n,{data:o,mutate:l}=s(r?[`gateway-chat-agents`,n]:null,oe,{revalidateOnFocus:!1}),u=o?.defaultId??`main`,d=o?.items??[],[p,m]=ae(),_=Pe(p.get(`tab`)),v=(0,X.useCallback)(e=>{let t=new URLSearchParams(p);e===`sessions`?t.delete(`tab`):t.set(`tab`,e),m(t,{replace:!0})},[p,m]),[te,y]=(0,X.useReducer)(b,p,ze),{searchInput:S,debouncedSearch:A,statusFilter:I,viewMode:L,channelFilter:B,sessions:W,loading:re,error:ie,hasMore:q,stats:J,detailOpen:pe,detailLoading:Y,detailSession:Z,confirmOpen:me,confirmKey:he}=te;(0,X.useEffect)(()=>{let e=setTimeout(()=>{let e=S.trim();A!==e&&y({type:`patch`,patch:{debouncedSearch:e}})},300);return()=>clearTimeout(e)},[S,A]);let _e=p.toString(),ve=(0,X.useRef)(_e);if(ve.current!==_e){ve.current=_e;let e=p.get(`q`)??``,t=p.get(`status`),n=p.get(`view`),r=(p.get(`channel`)??``).trim(),i=je.has(t)?t:`all`,a=Me.has(n)?n:`grid`,o=e.trim();y({type:`patch`,patch:{...S===e?{}:{searchInput:e},...A===o?{}:{debouncedSearch:o},...I===i?{}:{statusFilter:i},...L===a?{}:{viewMode:a},...B===r?{}:{channelFilter:r}}})}(0,X.useEffect)(()=>{let e=new URLSearchParams(p),t=A.trim();t?e.set(`q`,t):e.delete(`q`),I===`all`?e.delete(`status`):e.set(`status`,I),L===`grid`?e.delete(`view`):e.set(`view`,L),B?e.set(`channel`,B):e.delete(`channel`),e.toString()!==p.toString()&&m(e,{replace:!0})},[A,p,m,I,L,B]),(0,X.useEffect)(()=>{if(!r||_!==`sessions`)return;let e=!1;return(async()=>{y({type:`patch`,patch:{loading:!0,error:null}});try{let t=await U({limit:ke,offset:0,...A?{search:A}:{},...I===`all`?{}:{status:I},...B?{channel:B}:{}});if(e)return;y({type:`patch`,patch:{sessions:t.items,hasMore:t.hasMore}})}catch(n){e||y({type:`patch`,patch:{error:n instanceof Error?n.message:t.loadError}})}finally{e||y({type:`patch`,patch:{loading:!1}})}})(),()=>{e=!0}},[r,_,A,I,B,t.loadError]),(0,X.useEffect)(()=>{!r||_!==`sessions`||k().then(e=>y({type:`patch`,patch:{stats:e}})).catch(()=>{})},[r,_]),(0,X.useEffect)(()=>{if(!r||_!==`sessions`)return;let e=()=>void l();return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},[r,_,l]),(0,X.useEffect)(()=>{if(!r||_!==`sessions`)return;let e=e=>{let t=e.detail;!t?.key||t.name===void 0||y({type:`patch`,patch:{sessions:W.map(e=>e.key===t.key?{...e,name:t.name}:e),detailSession:Z&&Z.key===t.key?{...Z,name:t.name}:Z}})};return window.addEventListener(`session-updated`,e),()=>{window.removeEventListener(`session-updated`,e)}},[r,_,W,Z]);let ye=(0,X.useCallback)(async()=>{if(!(!r||re||!q)){y({type:`patch`,patch:{loading:!0,error:null}});try{let e=await U({limit:ke,offset:W.length,...A?{search:A}:{},...I===`all`?{}:{status:I},...B?{channel:B}:{}});y({type:`patch`,patch:{sessions:[...W,...e.items],hasMore:e.hasMore}})}catch(e){y({type:`patch`,patch:{error:e instanceof Error?e.message:t.loadError}})}finally{y({type:`patch`,patch:{loading:!1}})}}},[r,re,q,W.length,A,I,B,t.loadError]),$=(0,X.useCallback)((e,t)=>{y({type:`patch`,patch:{sessions:W.map(n=>n.key===e?{...n,status:t}:n),detailSession:Z&&Z.key===e?{...Z,status:t}:Z}})},[W,Z]),be=(0,X.useCallback)(async e=>{y({type:`patch`,patch:{detailOpen:!0,detailLoading:!0,detailSession:null}});try{y({type:`patch`,patch:{detailSession:await le(e)}})}catch{y({type:`patch`,patch:{detailOpen:!1}})}finally{y({type:`patch`,patch:{detailLoading:!1}})}},[]),xe=e=>{be(e)},Se=async(e,t)=>{if(t===`continue`){window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{sessionKey:e},bubbles:!0}));return}if(t===`delete`){y({type:`patch`,patch:{confirmKey:e,confirmOpen:!0}});return}try{switch(t){case`archive`:await z(e),$(e,`archived`);break;case`unarchive`:await j(e),$(e,`active`);break;case`pin`:await ue(e),$(e,`pinned`);break;case`unpin`:await N(e),$(e,`active`);break;case`export`:{let t=await G(e),n=new Blob([t],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`session-${e.replace(/[^a-z0-9]/gi,`_`)}.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r);break}default:break}k().then(e=>y({type:`patch`,patch:{stats:e}})).catch(()=>{})}catch{}},Ce=async e=>{try{await O(e),y({type:`patch`,patch:{sessions:W.filter(t=>t.key!==e),detailSession:Z?.key===e?null:Z,...Z?.key===e?{detailOpen:!1}:{}}}),k().then(e=>y({type:`patch`,patch:{stats:e}})).catch(()=>{})}catch{}},we={continueChat:t.continueChat,archive:t.archive,unarchive:t.unarchive,pin:t.pin,unpin:t.unpin,export:t.export,delete:t.delete,unnamedSession:e.chat.newSession},Ee={close:t.close,detailLoading:t.detailLoading,detailMessages:t.detailMessages,detailExport:t.detailExport,archive:t.archive,unarchive:t.unarchive,pin:t.pin,unpin:t.unpin,delete:t.delete,unnamedSession:e.chat.newSession},Oe=[{key:`all`,label:t.filterAll,icon:C},{key:`active`,label:t.filterActive,icon:fe},{key:`pinned`,label:t.filterPinned,icon:F},{key:`archived`,label:t.filterArchived,icon:se}],Ne=(()=>{let e=Object.entries(J?.byChannel??{}).sort((e,t)=>t[1]-e[1]).slice(0,6).map(([e])=>e),t=new Set(e);for(let n of[`telegram`,`weixin`,`feishu`])t.has(n)||(e.push(n),t.add(n));return e.slice(0,8)})();return r?(0,Q.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-surface-panel`,children:[(0,Q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-app-main flex-col gap-6 px-4 py-6`,children:[(0,Q.jsx)(`header`,{className:`flex flex-col gap-2`,children:(0,Q.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight text-fg`,children:t.title})}),(0,Q.jsx)(Le,{s:t,activeTab:_,onChange:v}),(0,Q.jsx)(Re,{s:t,id:`settings`,activeTab:_,plain:!0,children:(0,Q.jsx)(Te,{hasToken:r})}),(0,Q.jsxs)(Re,{s:t,id:`sessions`,activeTab:_,plain:!0,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Oe.map(({key:e,label:t,icon:n})=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":I===e,onClick:()=>y({type:`patch`,patch:{statusFilter:e}}),className:K(`inline-flex items-center gap-1.5 rounded-xl px-3 py-2 text-sm font-medium`,R.transition,R.focusRingPanel,I===e?`bg-accent-soft text-accent-fg`:`bg-surface-base text-fg-muted hover:bg-surface-hover hover:text-fg dark:bg-surface-hover/35`),children:[(0,Q.jsx)(n,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t]},e))}),(0,Q.jsxs)(`div`,{className:`flex w-full min-w-0 items-center gap-2 rounded-xl bg-surface-base px-3 py-2 transition-colors lg:max-w-md dark:bg-surface-hover/40`,children:[(0,Q.jsx)(E,{className:`size-4 shrink-0 text-fg-disabled`,strokeWidth:1.75,"aria-hidden":!0}),(0,Q.jsx)(`input`,{type:`search`,value:S,onChange:e=>y({type:`patch`,patch:{searchInput:e.target.value}}),placeholder:t.searchPlaceholder,"data-debounced-query":A||void 0,className:`min-w-0 flex-1 border-0 bg-transparent text-sm text-fg placeholder:text-fg-disabled focus:outline-none focus:ring-0`})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg-subtle`,children:t.filterChannelLabel}),(0,Q.jsx)(`button`,{type:`button`,"aria-pressed":!B,onClick:()=>y({type:`patch`,patch:{channelFilter:``}}),className:K(`inline-flex items-center rounded-xl px-3 py-2 text-sm font-medium`,R.transition,R.focusRingPanel,B?`bg-surface-base text-fg-muted hover:bg-surface-hover hover:text-fg dark:bg-surface-hover/35`:`bg-accent-soft text-accent-fg`),children:t.filterChannelAll}),Ne.map(e=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":B===e,onClick:()=>y({type:`patch`,patch:{channelFilter:e}}),className:K(`inline-flex items-center rounded-xl px-3 py-2 text-sm font-medium`,R.transition,R.focusRingPanel,B===e?`bg-accent-soft text-accent-fg`:`bg-surface-base text-fg-muted hover:bg-surface-hover hover:text-fg dark:bg-surface-hover/35`),children:[e,J?.byChannel?.[e]==null?null:(0,Q.jsx)(`span`,{className:`ml-2 rounded-full bg-surface-hover px-2 py-0.5 text-[11px] text-fg-subtle`,children:J.byChannel[e]})]},e))]}),J?(0,Q.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[[J.totalSessions,t.totalSessions],[J.activeSessions,t.activeSessions],[J.pinnedSessions,t.pinnedSessions],[J.archivedSessions,t.archivedSessions]].map(([e,t])=>(0,Q.jsxs)(`div`,{className:`rounded-xl bg-surface-base p-3 dark:bg-surface-hover/30`,children:[(0,Q.jsx)(`div`,{className:`text-lg font-semibold tabular-nums text-fg`,children:e}),(0,Q.jsx)(`div`,{className:`text-xs text-fg-muted`,children:t})]},t))}):null,ie?(0,Q.jsx)(`div`,{className:`rounded-lg border border-edge bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-edge dark:bg-red-950/40 dark:text-red-300`,children:ie}):null,(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:Ae(t.sessionCount,{count:W.length})}),(0,Q.jsxs)(`div`,{className:D,role:`group`,"aria-label":t.layoutToggleGroup,children:[(0,Q.jsx)(M,{type:`button`,variant:`segmented`,title:t.gridView,"aria-pressed":L===`grid`,onClick:()=>y({type:`patch`,patch:{viewMode:`grid`}}),className:K(P,`size-7 p-0`,L===`grid`&&`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,L===`grid`&&`text-accent-fg`),children:(0,Q.jsx)(g,{className:`size-3.5`,strokeWidth:1.5})}),(0,Q.jsx)(M,{type:`button`,variant:`segmented`,title:t.listView,"aria-pressed":L===`list`,onClick:()=>y({type:`patch`,patch:{viewMode:`list`}}),className:K(P,`size-9 p-0`,L===`list`&&`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,L===`list`&&`text-accent-fg`),children:(0,Q.jsx)(w,{className:`size-3.5`,strokeWidth:1.5})})]})]}),re&&W.length===0?(0,Q.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:Array.from({length:6}).map((e,t)=>(0,Q.jsx)(`div`,{className:`h-40 animate-pulse rounded-xl bg-surface-hover/60 dark:bg-surface-hover/40`},t))}):W.length===0?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-2xl bg-surface-base py-16 text-center dark:bg-surface-hover/25`,children:[(0,Q.jsx)(ce,{className:`mb-3 size-12 text-fg-disabled`,strokeWidth:1.25,"aria-hidden":!0}),(0,Q.jsx)(`p`,{className:`text-base font-semibold text-fg`,children:t.noSessions}),(0,Q.jsx)(`p`,{className:`mt-1 max-w-sm text-sm text-fg-muted`,children:t.noSessionsDescription}),(0,Q.jsx)(M,{variant:`primary`,className:`mt-6`,onClick:()=>{window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{sessionKey:``},bubbles:!0}))},children:t.startNewChat})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:K(`grid min-w-0 gap-3`,L===`grid`?`sm:grid-cols-2 lg:grid-cols-3`:`grid-cols-1`),"data-debounced-query":A||void 0,children:W.map(e=>{let t=h(e,u);return(0,Q.jsx)(ge,{session:e,variant:L,labels:we,sessionAgentId:t,sessionAgentAvatar:T(t,d),onOpen:()=>xe(e.key),onAction:t=>void Se(e.key,t)},e.key)})}),q?(0,Q.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,Q.jsx)(M,{type:`button`,variant:`secondary`,disabled:re,onClick:()=>void ye(),children:t.loadMore})}):null]})]})]}),(0,Q.jsx)(De,{open:pe,loading:Y,session:Z,sessionAgentId:Z?h(Z,u):void 0,sessionAgentAvatar:Z?T(h(Z,u),d):void 0,labels:Ee,onClose:()=>{y({type:`patch`,patch:{detailOpen:!1,detailSession:null}})},onArchive:()=>Z&&void Se(Z.key,`archive`),onUnarchive:()=>Z&&void Se(Z.key,`unarchive`),onPin:()=>Z&&void Se(Z.key,`pin`),onUnpin:()=>Z&&void Se(Z.key,`unpin`),onExport:()=>Z&&void Se(Z.key,`export`),onDelete:()=>Z&&y({type:`patch`,patch:{confirmKey:Z.key,confirmOpen:!0}})}),(0,Q.jsx)(f,{open:me,onOpenChange:e=>y({type:`patch`,patch:{confirmOpen:e}}),children:(0,Q.jsxs)(H,{children:[(0,Q.jsx)(ne,{className:K(`xopc-dialog-overlay fixed inset-0 bg-scrim`,x)}),(0,Q.jsxs)(ee,{className:K(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-edge bg-surface-panel p-4 shadow-popover dark:border-edge`,de),children:[(0,Q.jsx)(V,{className:`text-base font-semibold text-fg`,children:t.deleteSessionTitle}),(0,Q.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:he?Ae(t.deleteSessionMessage,{name:W.find(e=>e.key===he)?.name?.trim()||e.chat.newSession}):``}),(0,Q.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,Q.jsx)(M,{type:`button`,variant:`secondary`,onClick:()=>y({type:`patch`,patch:{confirmOpen:!1}}),children:t.cancel}),(0,Q.jsx)(M,{type:`button`,variant:`primary`,className:`bg-red-600 hover:bg-red-700`,onClick:()=>{he&&Ce(he),y({type:`patch`,patch:{confirmOpen:!1,confirmKey:null}})},children:t.delete})]})]})]})})]}):(0,Q.jsx)(`div`,{className:`mx-auto w-full max-w-2xl px-4 py-16 text-center text-sm text-fg-muted sm:px-8 lg:max-w-app-main`,children:t.needToken})}export{Be as SessionsPage};
@@ -1,2 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./url-DQRqHuL-.js";import{t as n}from"./fetch-CFdKBnE6.js";import{an as r,at as i}from"./index-C_2yKRJX.js";var a=e((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),o=e((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))}}})),s=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfMonth=void 0;var t=o(),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}}})),c=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfWeek=void 0;var t=o(),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}}})),l=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronHour=void 0;var t=o(),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}}})),u=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMinute=void 0;var t=o(),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}}})),d=e((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`},ee={hour:l,minute:l,second:l,hourCycle:`h23`},te={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:u},S={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:d},C={year:l,month:l,day:l,hour:l,minute:l},ne={year:l,month:l,day:l,hour:l,minute:l,second:l},re={year:l,month:u,day:l,hour:l,minute:l},ie={year:l,month:u,day:l,hour:l,minute:l,second:l},ae={year:l,month:u,day:l,weekday:u,hour:l,minute:l},oe={year:l,month:d,day:l,hour:l,minute:l,timeZoneName:u},se={year:l,month:d,day:l,hour:l,minute:l,second:l,timeZoneName:u},ce={year:l,month:d,day:l,weekday:d,hour:l,minute:l,timeZoneName:d},le={year:l,month:d,day:l,weekday:d,hour:l,minute:l,second:l,timeZoneName:d},w=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}},ue=null,de=class e extends w{static get instance(){return ue===null&&(ue=new e),ue}get type(){return`system`}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return It(e,t,n)}formatOffset(e,t){return Bt(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type===`system`}get isValid(){return!0}},fe=new Map;function pe(e){let t=fe.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`}),fe.set(e,t)),t}var me={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function he(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 ge(e,t){let n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){let{type:t,value:i}=n[e],a=me[t];t===`era`?r[a]=i:P(a)||(r[a]=parseInt(i,10))}return r}var _e=new Map,T=class e extends w{static create(t){let n=_e.get(t);return n===void 0&&_e.set(t,n=new e(t)),n}static resetCache(){_e.clear(),fe.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 It(e,t,n,this.name)}formatOffset(e,t){return Bt(this.offset(e),t)}offset(e){if(!this.valid)return NaN;let t=new Date(e);if(isNaN(t))return NaN;let n=pe(this.name),[r,i,a,o,s,c,l]=n.formatToParts?ge(n,t):he(n,t);o===`BC`&&(r=-Math.abs(r)+1);let u=Mt({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}},ve={};function ye(e,t={}){let n=JSON.stringify([e,t]),r=ve[n];return r||(r=new Intl.ListFormat(e,t),ve[n]=r),r}var be=new Map;function xe(e,t={}){let n=JSON.stringify([e,t]),r=be.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),be.set(n,r)),r}var Se=new Map;function E(e,t={}){let n=JSON.stringify([e,t]),r=Se.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),Se.set(n,r)),r}var Ce=new Map;function we(e,t={}){let{base:n,...r}=t,i=JSON.stringify([e,r]),a=Ce.get(i);return a===void 0&&(a=new Intl.RelativeTimeFormat(e,t),Ce.set(i,a)),a}var Te=null;function Ee(){return Te||(Te=new Intl.DateTimeFormat().resolvedOptions().locale,Te)}var De=new Map;function Oe(e){let t=De.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),De.set(e,t)),t}var ke=new Map;function Ae(e){let t=ke.get(e);if(!t){let n=new Intl.Locale(e);t=`getWeekInfo`in n?n.getWeekInfo():n.weekInfo,`minimalDays`in t||(t={...Be,...t}),ke.set(e,t)}return t}function je(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=xe(e).resolvedOptions(),r=e}catch{let i=e.substring(0,n);t=xe(i).resolvedOptions(),r=i}let{numberingSystem:i,calendar:a}=t;return[r,i,a]}}function Me(e,t,n){return n||t?(e.includes(`-u-`)||(e+=`-u`),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}function Ne(e){let t=[];for(let n=1;n<=12;n++){let r=$.utc(2009,n,1);t.push(e(r))}return t}function Pe(e){let t=[];for(let n=1;n<=7;n++){let r=$.utc(2016,11,13+n);t.push(e(r))}return t}function Fe(e,t,n,r){let i=e.listingMode();return i===`error`?null:i===`en`?n(t):r(t)}function Ie(e){return e.numberingSystem&&e.numberingSystem!==`latn`?!1:e.numberingSystem===`latn`||!e.locale||e.locale.startsWith(`en`)||Oe(e.locale).numberingSystem===`latn`}var Le=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=E(e,t)}}format(e){if(this.inf){let t=this.floor?Math.floor(e):e;return this.inf.format(t)}else return R(this.floor?Math.floor(e):kt(e,3),this.padTo)}},Re=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&&T.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=xe(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()}},ze=class{constructor(e,t,n){this.opts={style:`long`,...n},!t&&xt()&&(this.rtf=we(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):on(t,e,this.opts.numeric,this.opts.style!==`long`)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}},Be={firstDay:1,minimalDays:4,weekend:[6,7]},D=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||j.defaultLocale;return new e(o||(a?`en-US`:Ee()),n||j.defaultNumberingSystem,r||j.defaultOutputCalendar,Et(i)||j.defaultWeekSettings,o)}static resetCache(){Te=null,be.clear(),Se.clear(),Ce.clear(),De.clear(),ke.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]=je(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=n||s||null,this.weekSettings=r,this.intl=Me(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??=Ie(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,Et(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 Fe(this,e,Gt,()=>{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]=Ne(t)}return this.monthsCache[i][e]})}weekdays(e,t=!1){return Fe(this,e,Yt,()=>{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]=Pe(e=>this.extract(e,n,`weekday`))),this.weekdaysCache[r][e]})}meridiems(){return Fe(this,void 0,()=>Xt,()=>{if(!this.meridiemCache){let e={hour:`numeric`,hourCycle:`h12`};this.meridiemCache=[$.utc(2016,11,13,9),$.utc(2016,11,13,19)].map(t=>this.extract(t,e,`dayperiod`))}return this.meridiemCache})}eras(e){return Fe(this,e,en,()=>{let t={era:e};return this.eraCache[e]||(this.eraCache[e]=[$.utc(-40,1,1),$.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 Le(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Re(e,this.intl,t)}relFormatter(e={}){return new ze(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ye(this.intl,e)}isEnglish(){return this.locale===`en`||this.locale.toLowerCase()===`en-us`||Oe(this.intl).locale.startsWith(`en-us`)}getWeekSettings(){return this.weekSettings?this.weekSettings:St()?Ae(this.locale):Be}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})`}},Ve=null,O=class e extends w{static get utcInstance(){return Ve===null&&(Ve=new e(0)),Ve}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(Lt(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return`fixed`}get name(){return this.fixed===0?`UTC`:`UTC${Bt(this.fixed,`narrow`)}`}get ianaName(){return this.fixed===0?`Etc/UTC`:`Etc/GMT${Bt(-this.fixed,`narrow`)}`}offsetName(){return this.name}formatOffset(e,t){return Bt(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}},He=class extends w{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 k(e,t){if(P(e)||e===null)return t;if(e instanceof w)return e;if(yt(e)){let n=e.toLowerCase();return n==="default"?t:n===`local`||n===`system`?de.instance:n===`utc`||n===`gmt`?O.utcInstance:O.parseSpecifier(n)||T.create(e)}else if(F(e))return O.instance(e);else if(typeof e==`object`&&`offset`in e&&typeof e.offset==`function`)return e;else return new He(e)}var Ue={arab:`[٠-٩]`,arabext:`[۰-۹]`,bali:`[᭐-᭙]`,beng:`[০-৯]`,deva:`[०-९]`,fullwide:`[0-9]`,gujr:`[૦-૯]`,hanidec:`[〇|一|二|三|四|五|六|七|八|九]`,khmr:`[០-៩]`,knda:`[೦-೯]`,laoo:`[໐-໙]`,limb:`[᥆-᥏]`,mlym:`[൦-൯]`,mong:`[᠐-᠙]`,mymr:`[၀-၉]`,orya:`[୦-୯]`,tamldec:`[௦-௯]`,telu:`[౦-౯]`,thai:`[๐-๙]`,tibt:`[༠-༩]`,latn:`\\d`},We={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]},Ge=Ue.hanidec.replace(/[\[|\]]/g,``).split(``);function Ke(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(Ue.hanidec)!==-1)t+=Ge.indexOf(e[n]);else for(let e in We){let[n,i]=We[e];r>=n&&r<=i&&(t+=r-n)}}return parseInt(t,10)}else return t}var qe=new Map;function Je(){qe.clear()}function A({numberingSystem:e},t=``){let n=e||`latn`,r=qe.get(n);r===void 0&&(r=new Map,qe.set(n,r));let i=r.get(t);return i===void 0&&(i=RegExp(`${Ue[n]}${t}`),r.set(t,i)),i}var Ye=()=>Date.now(),Xe=`system`,Ze=null,Qe=null,$e=null,et=60,tt,nt=null,j=class{static get now(){return Ye}static set now(e){Ye=e}static set defaultZone(e){Xe=e}static get defaultZone(){return k(Xe,de.instance)}static get defaultLocale(){return Ze}static set defaultLocale(e){Ze=e}static get defaultNumberingSystem(){return Qe}static set defaultNumberingSystem(e){Qe=e}static get defaultOutputCalendar(){return $e}static set defaultOutputCalendar(e){$e=e}static get defaultWeekSettings(){return nt}static set defaultWeekSettings(e){nt=Et(e)}static get twoDigitCutoffYear(){return et}static set twoDigitCutoffYear(e){et=e%100}static get throwOnInvalid(){return tt}static set throwOnInvalid(e){tt=e}static resetCaches(){D.resetCache(),T.resetCache(),$.resetCache(),Je()}},M=class{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},rt=[0,31,59,90,120,151,181,212,243,273,304,334],it=[0,31,60,91,121,152,182,213,244,274,305,335];function N(e,t){return new M(`unit out of range`,`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function at(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 ot(e,t,n){return n+(At(e)?it:rt)[t-1]}function st(e,t){let n=At(e)?it:rt,r=n.findIndex(e=>e<t),i=t-n[r];return{month:r+1,day:i}}function ct(e,t){return(e-t+7)%7+1}function lt(e,t=4,n=1){let{year:r,month:i,day:a}=e,o=ot(r,i,a),s=ct(at(r,i,a),n),c=Math.floor((o-s+14-t)/7),l;return c<1?(l=r-1,c=Pt(l,t,n)):c>Pt(r,t,n)?(l=r+1,c=1):l=r,{weekYear:l,weekNumber:c,weekday:s,...Vt(e)}}function ut(e,t=4,n=1){let{weekYear:r,weekNumber:i,weekday:a}=e,o=ct(at(r,1,t),n),s=V(r),c=i*7+a-o-7+t,l;c<1?(l=r-1,c+=V(l)):c>s?(l=r+1,c-=V(r)):l=r;let{month:u,day:d}=st(l,c);return{year:l,month:u,day:d,...Vt(e)}}function dt(e){let{year:t,month:n,day:r}=e;return{year:t,ordinal:ot(t,n,r),...Vt(e)}}function ft(e){let{year:t,ordinal:n}=e,{month:r,day:i}=st(t,n);return{year:t,month:r,day:i,...Vt(e)}}function pt(e,t){if(!P(e.localWeekday)||!P(e.localWeekNumber)||!P(e.localWeekYear)){if(!P(e.weekday)||!P(e.weekNumber)||!P(e.weekYear))throw new a(`Cannot mix locale-based week fields with ISO-based week fields`);return P(e.localWeekday)||(e.weekday=e.localWeekday),P(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),P(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 mt(e,t=4,n=1){let r=vt(e.weekYear),i=L(e.weekNumber,1,Pt(e.weekYear,t,n)),a=L(e.weekday,1,7);return r?i?a?!1:N(`weekday`,e.weekday):N(`week`,e.weekNumber):N(`weekYear`,e.weekYear)}function ht(e){let t=vt(e.year),n=L(e.ordinal,1,V(e.year));return t?n?!1:N(`ordinal`,e.ordinal):N(`year`,e.year)}function gt(e){let t=vt(e.year),n=L(e.month,1,12),r=L(e.day,1,jt(e.year,e.month));return t?n?r?!1:N(`day`,e.day):N(`month`,e.month):N(`year`,e.year)}function _t(e){let{hour:t,minute:n,second:r,millisecond:i}=e,a=L(t,0,23)||t===24&&n===0&&r===0&&i===0,o=L(n,0,59),s=L(r,0,59),c=L(i,0,999);return a?o?s?c?!1:N(`millisecond`,i):N(`second`,r):N(`minute`,n):N(`hour`,t)}function P(e){return e===void 0}function F(e){return typeof e==`number`}function vt(e){return typeof e==`number`&&e%1==0}function yt(e){return typeof e==`string`}function bt(e){return Object.prototype.toString.call(e)===`[object Date]`}function xt(){try{return typeof Intl<`u`&&!!Intl.RelativeTimeFormat}catch{return!1}}function St(){try{return typeof Intl<`u`&&!!Intl.Locale&&(`weekInfo`in Intl.Locale.prototype||`getWeekInfo`in Intl.Locale.prototype)}catch{return!1}}function Ct(e){return Array.isArray(e)?e:[e]}function wt(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 Tt(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Et(e){if(e==null)return null;if(typeof e!=`object`)throw new s(`Week settings must be an object`);if(!L(e.firstDay,1,7)||!L(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!L(e,1,7)))throw new s(`Invalid week settings`);return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function L(e,t,n){return vt(e)&&e>=t&&e<=n}function Dt(e,t){return e-t*Math.floor(e/t)}function R(e,t=2){let n=e<0,r;return r=n?`-`+(``+-e).padStart(t,`0`):(``+e).padStart(t,`0`),r}function z(e){if(!(P(e)||e===null||e===``))return parseInt(e,10)}function B(e){if(!(P(e)||e===null||e===``))return parseFloat(e)}function Ot(e){if(!(P(e)||e===null||e===``)){let t=parseFloat(`0.`+e)*1e3;return Math.floor(t)}}function kt(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 At(e){return e%4==0&&(e%100!=0||e%400==0)}function V(e){return At(e)?366:365}function jt(e,t){let n=Dt(t-1,12)+1,r=e+(t-n)/12;return n===2?At(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Mt(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 Nt(e,t,n){return-ct(at(e,1,t),n)+t-1}function Pt(e,t=4,n=1){let r=Nt(e,t,n),i=Nt(e+1,t,n);return(V(e)-r+i)/7}function Ft(e){return e>99?e:e>j.twoDigitCutoffYear?1900+e:2e3+e}function It(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 Lt(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 Rt(e){let t=Number(e);if(typeof e==`boolean`||e===``||!Number.isFinite(t))throw new s(`Invalid unit value ${e}`);return t}function zt(e,t){let n={};for(let r in e)if(I(e,r)){let i=e[r];if(i==null)continue;n[t(r)]=Rt(i)}return n}function Bt(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}${R(n,2)}:${R(r,2)}`;case`narrow`:return`${i}${n}${r>0?`:${r}`:``}`;case`techie`:return`${i}${R(n,2)}${R(r,2)}`;default:throw RangeError(`Value format ${t} is out of range for property format`)}}function Vt(e){return Tt(e,[`hour`,`minute`,`second`,`millisecond`])}var Ht=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Ut=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Wt=[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`];function Gt(e){switch(e){case`narrow`:return[...Wt];case`short`:return[...Ut];case`long`:return[...Ht];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 Kt=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],qt=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],Jt=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function Yt(e){switch(e){case`narrow`:return[...Jt];case`short`:return[...qt];case`long`:return[...Kt];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`];default:return null}}var Xt=[`AM`,`PM`],Zt=[`Before Christ`,`Anno Domini`],Qt=[`BC`,`AD`],$t=[`B`,`A`];function en(e){switch(e){case`narrow`:return[...$t];case`short`:return[...Qt];case`long`:return[...Zt];default:return null}}function tn(e){return Xt[e.hour<12?0:1]}function nn(e,t){return Yt(t)[e.weekday-1]}function rn(e,t){return Gt(t)[e.month-1]}function an(e,t){return en(t)[e.year<0?0:1]}function on(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 sn(e,t){let n=``;for(let r of e)r.literal?n+=r.val:n+=t(r.val);return n}var cn={D:f,DD:p,DDD:h,DDDD:g,t:_,tt:v,ttt:y,tttt:b,T:x,TT:ee,TTT:te,TTTT:S,f:C,ff:re,fff:oe,ffff:ce,F:ne,FF:ie,FFF:se,FFFF:le},H=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 cn[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 R(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?tn(t):a({hour:`numeric`,hourCycle:`h12`},`dayperiod`),c=(e,n)=>r?rn(t,e):a(n?{month:e}:{month:e,day:`numeric`},`month`),l=(e,n)=>r?nn(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?an(t,e):a({era:e},`era`);return sn(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 sn(o,a(c,{isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]}))}},ln=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function U(...e){let t=e.reduce((e,t)=>e+t.source,``);return RegExp(`^${t}$`)}function W(...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 un(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 dn(...e){return(t,n)=>{let r={},i;for(i=0;i<e.length;i++)r[e[i]]=z(t[n+i]);return[r,null,n+i]}}var fn=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,pn=`(?:${fn.source}?(?:\\[(${ln.source})\\])?)?`,mn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,hn=RegExp(`${mn.source}${pn}`),gn=RegExp(`(?:[Tt]${hn.source})?`),_n=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,vn=/(\d{4})-?W(\d\d)(?:-?(\d))?/,yn=/(\d{4})-?(\d{3})/,bn=dn(`weekYear`,`weekNumber`,`weekDay`),xn=dn(`year`,`ordinal`),Sn=/(\d{4})-(\d\d)-(\d\d)/,Cn=RegExp(`${mn.source} ?(?:${fn.source}|(${ln.source}))?`),wn=RegExp(`(?: ${Cn.source})?`);function Tn(e,t,n){let r=e[t];return P(r)?n:z(r)}function En(e,t){return[{year:Tn(e,t),month:Tn(e,t+1,1),day:Tn(e,t+2,1)},null,t+3]}function Dn(e,t){return[{hours:Tn(e,t,0),minutes:Tn(e,t+1,0),seconds:Tn(e,t+2,0),milliseconds:Ot(e[t+3])},null,t+4]}function On(e,t){let n=!e[t]&&!e[t+1],r=Lt(e[t+1],e[t+2]);return[{},n?null:O.instance(r),t+3]}function kn(e,t){return[{},e[t]?T.create(e[t]):null,t+1]}var An=RegExp(`^T?${mn.source}$`),jn=/^-?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 Mn(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(B(n)),months:f(B(r)),weeks:f(B(i)),days:f(B(a)),hours:f(B(o)),minutes:f(B(s)),seconds:f(B(c),c===`-0`),milliseconds:f(Ot(l),d)}]}var Nn={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Pn(e,t,n,r,i,a,o){let s={year:t.length===2?Ft(z(t)):z(t),month:Ut.indexOf(n)+1,day:z(r),hour:z(i),minute:z(a)};return o&&(s.second=z(o)),e&&(s.weekday=e.length>3?Kt.indexOf(e)+1:qt.indexOf(e)+1),s}var Fn=/^(?:(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 In(e){let[,t,n,r,i,a,o,s,c,l,u,d]=e,f=Pn(t,i,r,n,a,o,s),p;return p=c?Nn[c]:l?0:Lt(u,d),[f,new O(p)]}function Ln(e){return e.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).trim()}var Rn=/^(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$/,zn=/^(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$/,Bn=/^(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 Vn(e){let[,t,n,r,i,a,o,s]=e;return[Pn(t,i,r,n,a,o,s),O.utcInstance]}function Hn(e){let[,t,n,r,i,a,o,s]=e;return[Pn(t,s,n,r,i,a,o),O.utcInstance]}var Un=U(_n,gn),Wn=U(vn,gn),Gn=U(yn,gn),Kn=U(hn),qn=W(En,Dn,On,kn),Jn=W(bn,Dn,On,kn),Yn=W(xn,Dn,On,kn),Xn=W(Dn,On,kn);function Zn(e){return un(e,[Un,qn],[Wn,Jn],[Gn,Yn],[Kn,Xn])}function Qn(e){return un(Ln(e),[Fn,In])}function $n(e){return un(e,[Rn,Vn],[zn,Vn],[Bn,Hn])}function er(e){return un(e,[jn,Mn])}var tr=W(Dn);function nr(e){return un(e,[An,tr])}var rr=U(Sn,wn),ir=U(Cn),ar=W(Dn,On,kn);function or(e){return un(e,[rr,qn],[ir,ar])}var sr=`Invalid Duration`,cr={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}},lr={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},...cr},G=146097/400,ur=146097/4800,dr={years:{quarters:4,months:12,weeks:G/7,days:G,hours:G*24,minutes:G*24*60,seconds:G*24*60*60,milliseconds:G*24*60*60*1e3},quarters:{months:3,weeks:G/28,days:G/4,hours:G*24/4,minutes:G*24*60/4,seconds:G*24*60*60/4,milliseconds:G*24*60*60*1e3/4},months:{weeks:ur/7,days:ur,hours:ur*24,minutes:ur*24*60,seconds:ur*24*60*60,milliseconds:ur*24*60*60*1e3},...cr},K=[`years`,`quarters`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`],fr=K.slice(0).reverse();function q(e,t,n=!1){return new J({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 pr(e,t){let n=t.milliseconds??0;for(let r of fr.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function mr(e,t){let n=pr(e,t)<0?-1:1;K.reduceRight((r,i)=>{if(P(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),K.reduce((n,r)=>{if(P(t[r]))return n;if(n){let i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r},null)}function hr(e){let t={};for(let[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}var J=class e{constructor(e){let t=e.conversionAccuracy===`longterm`||!1,n=t?dr:lr;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||D.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:zt(t,e.normalizeUnit),loc:D.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(F(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]=er(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]=nr(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 M?t:new M(t,n);if(j.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?H.create(this.loc,n).formatDurationFromString(this,e):sr}toHuman(e={}){if(!this.isValid)return sr;let t=e.showZeros!==!1,n=K.map(n=>{let r=this.values[n];return P(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+=kt(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},$.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?pr(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 K)(I(n.values,e)||I(this.values,e))&&(r[e]=n.get(e)+this.get(e));return q(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]=Rt(e(this.values[n],n));return q(this,{values:t},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let n={...this.values,...zt(t,e.normalizeUnit)};return q(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 q(this,i)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return mr(this.matrix,e),q(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=hr(this.normalize().shiftToAll().toObject());return q(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 K)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;F(i[e])&&(t+=i[e]);let o=Math.trunc(t);n[e]=o,r[e]=(t*1e3-o*1e3)/1e3}else F(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 mr(this.matrix,n),q(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 q(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=hr(this.values);return q(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 K)if(!t(this.values[n],e.values[n]))return!1;return!0}},gr=`Invalid Interval`;function _r(e,t){return!e||!e.isValid?vr.invalid(`missing or invalid start`):!t||!t.isValid?vr.invalid(`missing or invalid end`):t<e?vr.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 vr=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 M?t:new M(t,n);if(j.throwOnInvalid)throw new r(i);return new e({invalid:i})}static fromDateTimes(t,n){let r=_i(t),i=_i(n);return _r(r,i)??new e({start:r,end:i})}static after(t,n){let r=J.fromDurationLike(n),i=_i(t);return e.fromDateTimes(i,i.plus(r))}static before(t,n){let r=J.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=$.fromISO(r,n),a=t.isValid}catch{a=!1}let o,s;try{o=$.fromISO(i,n),s=o.isValid}catch{s=!1}if(a&&s)return e.fromDateTimes(t,o);if(a){let r=J.fromISO(i,n);if(r.isValid)return e.after(t,r)}else if(s){let t=J.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=J.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()})`:gr}[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?H.create(this.s.loc.clone(t),e).formatInterval(this):gr}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:gr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:gr}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:gr}toFormat(e,{separator:t=` – `}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:gr}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):J.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}},yr=class{static hasDST(e=j.defaultZone){let t=$.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return T.isValidZone(e)}static normalizeZone(e){return k(e,j.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||D.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||D.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||D.create(e)).getWeekendDays().slice()}static months(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||D.create(t,n,i)).months(e)}static monthsFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||D.create(t,n,i)).months(e,!0)}static weekdays(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||D.create(t,n,null)).weekdays(e)}static weekdaysFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||D.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return D.create(e).meridiems()}static eras(e=`short`,{locale:t=null}={}){return D.create(t,null,`gregory`).eras(e)}static features(){return{relative:xt(),localeWeek:St()}}};function br(e,t){let n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf(`day`).valueOf(),r=n(t)-n(e);return Math.floor(J.fromMillis(r).as(`days`))}function xr(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=br(e,t);return(n-n%7)/7}],[`days`,br]],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 Sr(e,t,n,r){let[i,a,o,s]=xr(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=J.fromObject(a,r);return l.length>0?J.fromMillis(c,r).shiftTo(...l).plus(u):u}var Cr=`missing Intl.DateTimeFormat.formatToParts support`;function Y(e,t=e=>e){return{regex:e,deser:([e])=>t(Ke(e))}}var wr=`[ \xA0]`,Tr=new RegExp(wr,`g`);function Er(e){return e.replace(/\./g,`\\.?`).replace(Tr,wr)}function Dr(e){return e.replace(/\./g,``).replace(Tr,` `).toLowerCase()}function X(e,t){return e===null?null:{regex:RegExp(e.map(Er).join(`|`)),deser:([n])=>e.findIndex(e=>Dr(n)===Dr(e))+t}}function Or(e,t){return{regex:e,deser:([,e,t])=>Lt(e,t),groups:t}}function kr(e){return{regex:e,deser:([e])=>e}}function Ar(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,`\\$&`)}function jr(e,t){let n=A(t),r=A(t,`{2}`),i=A(t,`{3}`),a=A(t,`{4}`),o=A(t,`{6}`),s=A(t,`{1,2}`),c=A(t,`{1,3}`),l=A(t,`{1,6}`),u=A(t,`{1,9}`),d=A(t,`{2,4}`),f=A(t,`{4,6}`),p=e=>({regex:RegExp(Ar(e.val)),deser:([e])=>e,literal:!0}),m=(m=>{if(e.literal)return p(m);switch(m.val){case`G`:return X(t.eras(`short`),0);case`GG`:return X(t.eras(`long`),0);case`y`:return Y(l);case`yy`:return Y(d,Ft);case`yyyy`:return Y(a);case`yyyyy`:return Y(f);case`yyyyyy`:return Y(o);case`M`:return Y(s);case`MM`:return Y(r);case`MMM`:return X(t.months(`short`,!0),1);case`MMMM`:return X(t.months(`long`,!0),1);case`L`:return Y(s);case`LL`:return Y(r);case`LLL`:return X(t.months(`short`,!1),1);case`LLLL`:return X(t.months(`long`,!1),1);case`d`:return Y(s);case`dd`:return Y(r);case`o`:return Y(c);case`ooo`:return Y(i);case`HH`:return Y(r);case`H`:return Y(s);case`hh`:return Y(r);case`h`:return Y(s);case`mm`:return Y(r);case`m`:return Y(s);case`q`:return Y(s);case`qq`:return Y(r);case`s`:return Y(s);case`ss`:return Y(r);case`S`:return Y(c);case`SSS`:return Y(i);case`u`:return kr(u);case`uu`:return kr(s);case`uuu`:return Y(n);case`a`:return X(t.meridiems(),0);case`kkkk`:return Y(a);case`kk`:return Y(d,Ft);case`W`:return Y(s);case`WW`:return Y(r);case`E`:case`c`:return Y(n);case`EEE`:return X(t.weekdays(`short`,!1),1);case`EEEE`:return X(t.weekdays(`long`,!1),1);case`ccc`:return X(t.weekdays(`short`,!0),1);case`cccc`:return X(t.weekdays(`long`,!0),1);case`Z`:case`ZZ`:return Or(RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case`ZZZ`:return Or(RegExp(`([+-]${s.source})(${r.source})?`),2);case`z`:return kr(/[a-z_+-/]{1,256}?/i);case` `:return kr(/[^\S\n\r]/);default:return p(m)}})(e)||{invalidReason:Cr};return m.token=e,m}var Mr={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 Nr(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=Mr[o];if(typeof s==`object`&&(s=s[a]),s)return{literal:!1,val:s}}function Pr(e){return[`^${e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,``)}$`,e]}function Fr(e,t,n){let r=e.match(t);if(r){let e={},t=1;for(let i in n)if(I(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 Ir(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 P(e.z)||(n=T.create(e.z)),P(e.Z)||(n||=new O(e.Z),r=e.Z),P(e.q)||(e.M=(e.q-1)*3+1),P(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),P(e.u)||(e.S=Ot(e.u)),[Object.keys(e).reduce((n,r)=>{let i=t(r);return i&&(n[i]=e[r]),n},{}),n,r]}var Lr=null;function Rr(){return Lr||=$.fromMillis(1555555555555),Lr}function zr(e,t){if(e.literal)return e;let n=Wr(H.macroTokenToFormatOpts(e.val),t);return n==null||n.includes(void 0)?e:n}function Br(e,t){return Array.prototype.concat(...e.map(e=>zr(e,t)))}var Vr=class{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Br(H.parseFormat(t),e),this.units=this.tokens.map(t=>jr(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){let[e,t]=Pr(this.units);this.regex=RegExp(e,`i`),this.handlers=t}}explainFromTokens(e){if(this.isValid){let[t,n]=Fr(e,this.regex,this.handlers),[r,i,o]=n?Ir(n):[null,null,void 0];if(I(n,`a`)&&I(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 Hr(e,t,n){return new Vr(e,n).explainFromTokens(t)}function Ur(e,t,n){let{result:r,zone:i,specificOffset:a,invalidReason:o}=Hr(e,t,n);return[r,i,a,o]}function Wr(e,t){if(!e)return null;let n=H.create(t,e).dtFormatter(Rr()),r=n.formatToParts(),i=n.resolvedOptions();return r.map(t=>Nr(t,e,i))}var Gr=`Invalid DateTime`,Kr=864e13;function qr(e){return new M(`unsupported zone`,`the zone "${e.name}" is not supported`)}function Jr(e){return e.weekData===null&&(e.weekData=lt(e.c)),e.weekData}function Yr(e){return e.localWeekData===null&&(e.localWeekData=lt(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Z(e,t){let n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new $({...n,...t,old:n})}function Xr(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 Zr(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 Qr(e,t,n){return Xr(Mt(e),t,n)}function $r(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,jt(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=J.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]=Xr(Mt(a),n,e.zone);return o!==0&&(s+=o,c=e.zone.offset(s)),{ts:s,o:c}}function Q(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=$.fromObject(e,{...n,zone:r,specificOffset:a});return o?i:i.setZone(s)}else return $.invalid(new M(`unparsable`,`the input "${i}" can't be parsed as ${r}`))}function ei(e,t,n=!0){return e.isValid?H.create(D.create(`en-US`),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function ti(e,t,n){let r=e.c.year>9999||e.c.year<0,i=``;if(r&&e.c.year>=0&&(i+=`+`),i+=R(e.c.year,r?6:4),n===`year`)return i;if(t){if(i+=`-`,i+=R(e.c.month),n===`month`)return i;i+=`-`}else if(i+=R(e.c.month),n===`month`)return i;return i+=R(e.c.day),i}function ni(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+=R(e.c.hour),o===`hour`)break;if(t){if(c+=`:`,c+=R(e.c.minute),o===`minute`)break;s&&(c+=`:`,c+=R(e.c.second))}else{if(c+=R(e.c.minute),o===`minute`)break;s&&(c+=R(e.c.second))}if(o===`second`)break;s&&(!r||e.c.millisecond!==0)&&(c+=`.`,c+=R(e.c.millisecond,3))}return i&&(e.isOffsetFixed&&e.offset===0&&!a?c+=`Z`:e.o<0?(c+=`-`,c+=R(Math.trunc(-e.o/60)),c+=`:`,c+=R(Math.trunc(-e.o%60))):(c+=`+`,c+=R(Math.trunc(e.o/60)),c+=`:`,c+=R(Math.trunc(e.o%60)))),a&&(c+=`[`+e.zone.ianaName+`]`),c}var ri={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ii={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ai={ordinal:1,hour:0,minute:0,second:0,millisecond:0},oi=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],si=[`weekYear`,`weekNumber`,`weekday`,`hour`,`minute`,`second`,`millisecond`],ci=[`year`,`ordinal`,`hour`,`minute`,`second`,`millisecond`];function li(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 ui(e){switch(e.toLowerCase()){case`localweekday`:case`localweekdays`:return`localWeekday`;case`localweeknumber`:case`localweeknumbers`:return`localWeekNumber`;case`localweekyear`:case`localweekyears`:return`localWeekYear`;default:return li(e)}}function di(e){if(hi===void 0&&(hi=j.now()),e.type!==`iana`)return e.offset(hi);let t=e.name,n=gi.get(t);return n===void 0&&(n=e.offset(hi),gi.set(t,n)),n}function fi(e,t){let n=k(t.zone,j.defaultZone);if(!n.isValid)return $.invalid(qr(n));let r=D.fromObject(t),i,a;if(P(e.year))i=j.now();else{for(let t of oi)P(e[t])&&(e[t]=ri[t]);let t=gt(e)||_t(e);if(t)return $.invalid(t);let r=di(n);[i,a]=Qr(e,r,n)}return new $({ts:i,zone:n,loc:r,o:a})}function pi(e,t,n){let r=P(n.round)?!0:n.round,i=P(n.rounding)?`trunc`:n.rounding,a=(e,a)=>(e=kt(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 mi(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 hi,gi=new Map,$=class e{constructor(e){let t=e.zone||j.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new M(`invalid input`):null)||(t.isValid?null:qr(t));this.ts=P(e.ts)?j.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=F(e.o)&&!e.old?e.o:t.offset(this.ts);r=Zr(this.ts,a),n=Number.isNaN(r.year)?new M(`invalid input`):null,r=n?null:r,i=n?null:a}this._zone=t,this.loc=e.loc||D.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]=mi(arguments),[n,r,i,a,o,s,c]=t;return fi({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static utc(){let[e,t]=mi(arguments),[n,r,i,a,o,s,c]=t;return e.zone=O.utcInstance,fi({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static fromJSDate(t,n={}){let r=bt(t)?t.valueOf():NaN;if(Number.isNaN(r))return e.invalid(`invalid input`);let i=k(n.zone,j.defaultZone);return i.isValid?new e({ts:r,zone:i,loc:D.fromObject(n)}):e.invalid(qr(i))}static fromMillis(t,n={}){if(!F(t))throw new s(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`);return t<-864e13||t>Kr?e.invalid(`Timestamp out of range`):new e({ts:t,zone:k(n.zone,j.defaultZone),loc:D.fromObject(n)})}static fromSeconds(t,n={}){if(F(t))return new e({ts:t*1e3,zone:k(n.zone,j.defaultZone),loc:D.fromObject(n)});throw new s(`fromSeconds requires a numerical input`)}static fromObject(t,n={}){t||={};let r=k(n.zone,j.defaultZone);if(!r.isValid)return e.invalid(qr(r));let i=D.fromObject(n),o=zt(t,ui),{minDaysInFirstWeek:s,startOfWeek:c}=pt(o,i),l=j.now(),u=P(n.specificOffset)?r.offset(l):n.specificOffset,d=!P(o.ordinal),f=!P(o.year),p=!P(o.month)||!P(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=Zr(l,u);g?(_=si,v=ii,y=lt(y,s,c)):d?(_=ci,v=ai,y=dt(y)):(_=oi,v=ri);let b=!1;for(let e of _){let t=o[e];P(t)?b?o[e]=v[e]:o[e]=y[e]:b=!0}let x=(g?mt(o,s,c):d?ht(o):gt(o))||_t(o);if(x)return e.invalid(x);let[ee,te]=Qr(g?ut(o,s,c):d?ft(o):o,u,r),S=new e({ts:ee,zone:r,o:te,loc:i});return o.weekday&&m&&t.weekday!==S.weekday?e.invalid(`mismatched weekday`,`you can't specify both a weekday of ${o.weekday} and a date of ${S.toISO()}`):S.isValid?S:e.invalid(S.invalid)}static fromISO(e,t={}){let[n,r]=Zn(e);return Q(n,r,t,`ISO 8601`,e)}static fromRFC2822(e,t={}){let[n,r]=Qn(e);return Q(n,r,t,`RFC 2822`,e)}static fromHTTP(e,t={}){let[n,r]=$n(e);return Q(n,r,t,`HTTP`,t)}static fromFormat(t,n,r={}){if(P(t)||P(n))throw new s(`fromFormat requires an input string and a format`);let{locale:i=null,numberingSystem:a=null}=r,[o,c,l,u]=Ur(D.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),t,n);return u?e.invalid(u):Q(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]=or(e);return Q(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 M?t:new M(t,r);if(j.throwOnInvalid)throw new n(i);return new e({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){let n=Wr(e,D.fromObject(t));return n?n.map(e=>e?e.val:null).join(``):null}static expandFormat(e,t={}){return Br(H.parseFormat(e),D.fromObject(t)).map(e=>e.val).join(``)}static resetCache(){hi=void 0,gi.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?Jr(this).weekYear:NaN}get weekNumber(){return this.isValid?Jr(this).weekNumber:NaN}get weekday(){return this.isValid?Jr(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Yr(this).weekday:NaN}get localWeekNumber(){return this.isValid?Yr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Yr(this).weekYear:NaN}get ordinal(){return this.isValid?dt(this.c).ordinal:NaN}get monthShort(){return this.isValid?yr.months(`short`,{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?yr.months(`long`,{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?yr.weekdays(`short`,{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?yr.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=Mt(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=Zr(s,a),u=Zr(c,o);return l.hour===u.hour&&l.minute===u.minute&&l.second===u.second&&l.millisecond===u.millisecond?[Z(this,{ts:s}),Z(this,{ts:c})]:[this]}get isInLeapYear(){return At(this.year)}get daysInMonth(){return jt(this.year,this.month)}get daysInYear(){return this.isValid?V(this.year):NaN}get weeksInWeekYear(){return this.isValid?Pt(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Pt(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:t,numberingSystem:n,calendar:r}=H.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(O.instance(e),t)}toLocal(){return this.setZone(j.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=k(t,j.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]=Qr(r,n,t)}return Z(this,{ts:e,zone:t})}else return e.invalid(qr(t))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){let r=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return Z(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let t=zt(e,ui),{minDaysInFirstWeek:n,startOfWeek:r}=pt(t,this.loc),i=!P(t.weekYear)||!P(t.weekNumber)||!P(t.weekday),o=!P(t.ordinal),s=!P(t.year),c=!P(t.month)||!P(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=ut({...lt(this.c,n,r),...t},n,r):P(t.ordinal)?(d={...this.toObject(),...t},P(t.day)&&(d.day=Math.min(jt(d.year,d.month),d.day))):d=ft({...dt(this.c),...t});let[f,p]=Qr(d,this.o,this.zone);return Z(this,{ts:f,o:p})}plus(e){if(!this.isValid)return this;let t=J.fromDurationLike(e);return Z(this,$r(this,t))}minus(e){if(!this.isValid)return this;let t=J.fromDurationLike(e).negate();return Z(this,$r(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;let n={},r=J.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?H.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Gr}toLocaleString(e=f,t={}){return this.isValid?H.create(this.loc.clone(t),e).formatDateTime(this):Gr}toLocaleParts(e={}){return this.isValid?H.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=li(a);let o=e===`extended`,s=ti(this,o,a);return oi.indexOf(a)>=3&&(s+=`T`),s+=ni(this,o,t,n,r,i,a),s}toISODate({format:e=`extended`,precision:t=`day`}={}){return this.isValid?ti(this,e===`extended`,li(t)):null}toISOWeekDate(){return ei(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=li(o),(r&&oi.indexOf(o)>=3?`T`:``)+ni(this,a===`extended`,t,e,n,i,o)):null}toRFC2822(){return ei(this,`EEE, dd LLL yyyy HH:mm:ss ZZZ`,!1)}toHTTP(){return ei(this.toUTC(),`EEE, dd LLL yyyy HH:mm:ss 'GMT'`)}toSQLDate(){return this.isValid?ti(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`)),ei(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Gr}[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 J.invalid(`created by diffing an invalid DateTime`);let r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=Ct(t).map(J.normalizeUnit),a=e.valueOf()>this.valueOf(),o=Sr(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?vr.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),pi(n,this.plus(r),{...t,numeric:`always`,units:i,unit:a})}toRelativeCalendar(t={}){return this.isValid?pi(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 wt(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new s(`max requires all arguments be DateTimes`);return wt(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){let{locale:r=null,numberingSystem:i=null}=n;return Hr(D.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 Vr(D.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),e)}static fromFormatParser(t,n,r={}){if(P(t)||P(n))throw new s(`fromFormatParser requires an input string and a format parser`);let{locale:i=null,numberingSystem:a=null}=r,o=D.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):Q(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 ee}static get TIME_24_WITH_SHORT_OFFSET(){return te}static get TIME_24_WITH_LONG_OFFSET(){return S}static get DATETIME_SHORT(){return C}static get DATETIME_SHORT_WITH_SECONDS(){return ne}static get DATETIME_MED(){return re}static get DATETIME_MED_WITH_SECONDS(){return ie}static get DATETIME_MED_WITH_WEEKDAY(){return ae}static get DATETIME_FULL(){return oe}static get DATETIME_FULL_WITH_SECONDS(){return se}static get DATETIME_HUGE(){return ce}static get DATETIME_HUGE_WITH_SECONDS(){return le}};function _i(e){if($.isDateTime(e))return e;if(e&&e.valueOf&&F(e.valueOf()))return $.fromJSDate(e);if(e&&typeof e==`object`)return $.fromObject(e);throw new s(`Unknown datetime argument: ${e}, of type ${typeof e}`)}e.DateTime=$,e.Duration=J,e.FixedOffsetZone=O,e.IANAZone=T,e.Info=yr,e.Interval=vr,e.InvalidZone=He,e.Settings=j,e.SystemZone=de,e.VERSION=`3.7.2`,e.Zone=w})),f=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;var t=d(),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})),p=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMonth=void 0;var t=f(),n=o(),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}}})),m=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronSecond=void 0;var t=o(),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}}})),h=e((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(a(),e),n(s(),e),n(c(),e),n(o(),e),n(l(),e),n(u(),e),n(p(),e),n(m(),e)})),g=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronFieldCollection=void 0;var t=h();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()}}}})),_=e((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=f();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})),v=e((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))}})),y=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpressionParser=e.DayOfWeek=e.Months=e.CronUnit=e.PredefinedExpressions=void 0;var t=g(),n=_(),r=v(),i=h(),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))}}})),b=e(((e,t)=>{t.exports={}})),x=e((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=y();e.CronFileParser=class e{static async parseFile(t){let{readFile:n}=await Promise.resolve().then(()=>r(b())),i=await n(t,`utf8`);return e.#e(i)}static parseFileSync(t){let{readFileSync:n}=b(),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)}}}})),ee=e((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=y(),i=f();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return i.CronDate}});var a=g();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return a.CronFieldCollection}});var o=_();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return o.CronExpression}});var s=y();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return s.CronExpressionParser}});var c=x();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return c.CronFileParser}}),n(h(),e),e.default=r.CronExpressionParser}))();function te(){let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function S(e){return Array.isArray(e)?e.filter(e=>typeof e==`number`).sort((e,t)=>e-t):[]}function C(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 ne(e){let t=[];for(let n=0;n<7;n++)e[n]&&t.push(n===6?0:n+1);return t.length===0?`1`:t.sort((e,t)=>e-t).join(`,`)}function re(e){let t=[!1,!1,!1,!1,!1,!1,!1];for(let n of e){let e=n===0||n===7?6:n-1;e>=0&&e<=6&&(t[e]=!0)}return t}function ie(e){let t=e.trim(),n={mode:`custom`,intervalKind:`minutes`,onceDate:te(),intervalMinutes:5,intervalHours:2,minute:0,hour:9,weekDays:[!0,!0,!0,!0,!0,!1,!1],dayOfMonth:1,rawCron:t};if(!t)return{...n,mode:`interval`,rawCron:`*/5 * * * *`};try{let e=ee.CronExpressionParser.parse(t).fields,r=S(e.minute.values),i=S(e.hour.values),a=S(e.dayOfMonth.values),o=S(e.month.values),s=S(e.dayOfWeek.values);if(r.length===60&&e.hour.isWildcard&&e.dayOfMonth.isWildcard&&e.month.isWildcard&&e.dayOfWeek.isWildcard)return{...n,mode:`interval`,intervalKind:`minutes`,intervalMinutes:1,rawCron:t};if(!e.minute.isWildcard&&e.hour.isWildcard&&e.dayOfMonth.isWildcard&&e.month.isWildcard&&e.dayOfWeek.isWildcard&&r.length>1){let e=C(r);if(e!=null&&e>0)return{...n,mode:`interval`,intervalKind:`minutes`,intervalMinutes:e,rawCron:t}}if(!e.minute.isWildcard&&r.length===1&&!e.hour.isWildcard&&i.length>1&&e.dayOfMonth.isWildcard&&e.month.isWildcard&&e.dayOfWeek.isWildcard){let e=C(i);if(e!=null&&e>0)return{...n,mode:`interval`,intervalKind:`hours`,intervalHours:e,minute:r[0],rawCron:t}}if(!e.minute.isWildcard&&r.length===1&&e.hour.isWildcard&&e.dayOfMonth.isWildcard&&e.month.isWildcard&&e.dayOfWeek.isWildcard&&i.length===24)return{...n,mode:`hourly`,minute:r[0],rawCron:t};if(r.length===1&&i.length===1&&a.length===1&&o.length===1&&!e.dayOfMonth.isWildcard&&!e.month.isWildcard&&e.dayOfWeek.isWildcard){let e=new Date().getFullYear(),s=o[0],c=a[0],l=`${e}-${String(s).padStart(2,`0`)}-${String(c).padStart(2,`0`)}`;return{...n,mode:`no_repeat`,minute:r[0],hour:i[0],onceDate:l,rawCron:t}}if(r.length===1&&i.length===1&&e.dayOfMonth.isWildcard&&e.month.isWildcard&&e.dayOfWeek.isWildcard)return{...n,mode:`daily`,minute:r[0],hour:i[0],rawCron:t};if(r.length===1&&i.length===1&&e.dayOfMonth.isWildcard&&e.month.isWildcard&&!e.dayOfWeek.isWildcard&&s.length>0)return{...n,mode:`weekly`,minute:r[0],hour:i[0],weekDays:re(s),rawCron:t};if(r.length===1&&i.length===1&&!e.dayOfMonth.isWildcard&&a.length===1&&e.month.isWildcard&&e.dayOfWeek.isWildcard)return{...n,mode:`monthly`,minute:r[0],hour:i[0],dayOfMonth:a[0],rawCron:t}}catch{}return n}function ae(e){let t=(e,t,n)=>Math.min(n,Math.max(t,e));switch(e.mode){case`custom`:return e.rawCron.trim()||`*/5 * * * *`;case`no_repeat`:{let n=e.onceDate.split(`-`);if(n.length===3){let r=t(parseInt(n[2],10),1,31),i=t(parseInt(n[1],10),1,12);return`${t(e.minute,0,59)} ${t(e.hour,0,23)} ${r} ${i} *`}return`0 9 1 1 *`}case`interval`:if(e.intervalKind===`hours`){let n=t(Math.round(e.intervalHours)||1,1,23);return`${t(e.minute,0,59)} */${n} * * *`}return`*/${t(Math.round(e.intervalMinutes)||5,1,59)} * * * *`;case`hourly`:return`${t(e.minute,0,59)} * * * *`;case`daily`:return`${t(e.minute,0,59)} ${t(e.hour,0,23)} * * *`;case`weekly`:return`${t(e.minute,0,59)} ${t(e.hour,0,23)} * * ${ne(e.weekDays)}`;case`monthly`:return`${t(e.minute,0,59)} ${t(e.hour,0,23)} ${t(Math.round(e.dayOfMonth)||1,1,31)} * *`;default:return`*/5 * * * *`}}function oe(e,t,n){let r=new Date;return r.setHours(e,t,0,0),r.toLocaleTimeString(n,{hour:`numeric`,minute:`2-digit`})}function se(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 ce(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 le(e){return e.length===5&&e.every((e,t)=>e===t+1)}function w(e){if(e.length!==2)return!1;let t=[...e].toSorted((e,t)=>e-t);return t[0]===0&&t[1]===6}function ue(e,t,n,r){try{let i=ee.CronExpressionParser.parse(e,{...r?.timezone?{tz:r.timezone}:{}}).fields,a=S(i.minute.values),o=S(i.hour.values),s=S(i.dayOfWeek.values),c=S(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=C(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=C(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?oe(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&&le(s))return n.weekdaysAt.replace(`{{time}}`,l);if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&w(s))return n.weekendsAt.replace(`{{time}}`,l);if(l&&i.dayOfMonth.isWildcard&&i.month.isWildcard&&!i.dayOfWeek.isWildcard&&s.length===1){let e=se(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=ce(s.map(e=>se(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 de(e,t,n,r){let i=e.trim();return i?ue(i,t,n,r)||fe(r?.nextRun,t)||n.customSchedule:fe(r?.nextRun,t)||`—`}function fe(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`})}function pe(e,t){let n=e?.trim()||``;return n?n.length<=t?n:`${n.slice(0,t-1)}…`:`—`}function me(e){return e==null||!Number.isFinite(e)?`—`:e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`}function he(e){return new Date(e).toLocaleString()}function ge(e,t){let n=typeof e==`string`?new Date(e):e,r=new Date,i=n.getTime()-r.getTime();if(i<0)return t.overdue;if(i<6e4)return t.lessThanMinute;if(i<36e5){let e=Math.floor(i/6e4);return t.minutes.replace(`{{count}}`,String(e))}if(i<864e5){let e=Math.floor(i/36e5);return t.hours.replace(`{{count}}`,String(e))}return n.toLocaleString()}function _e(e,t){let n=new Date(e),r=new Date().getTime()-n.getTime();if(r<0||r<6e4)return t.justNow;if(r<36e5){let e=Math.floor(r/6e4);return t.minutesAgo.replace(`{{count}}`,String(e))}if(r<864e5){let e=Math.floor(r/36e5);return t.hoursAgo.replace(`{{count}}`,String(e))}if(r<6048e5){let e=Math.floor(r/864e5);return t.daysAgo.replace(`{{count}}`,String(e))}return n.toLocaleDateString()}function T(e,t){let n=_e(e.lastActive,t);return e.channel===`telegram`&&e.peerId?`${e.accountId??`default`} · ${e.peerKind??``} · ${e.peerId} · ${n}`:`${e.channel}: ${e.chatId} · ${n}`}function ve(e,t){if(e.delivery?.channel===`local`)return t;let n=e.delivery?.to??``,r=n.split(`:`);return r.length===3&&(r[1]===`dm`||r[1]===`group`)?`${r[0]} · ${r[1]} · ${r[2]}`:n}function ye(e,t){switch(e){case`running`:return t.running;case`success`:return t.success;case`failed`:return t.failed;case`cancelled`:return t.cancelled;default:return e}}function be(e,t,n){return de(e.schedule||``,t,n,{timezone:e.timezone,nextRun:e.next_run})}function xe(e){let t=e.payload;return t.kind===`systemEvent`?t.text:t.kind===`agentTurn`?t.message:t.goal||t.definitionId}function Se(e){if(!e||typeof e!=`object`)return``;let t=e.agents?.defaults?.models?.chat;if(t==null)return``;if(typeof t==`string`)return t.trim();if(typeof t==`object`&&t&&`primary`in t){let e=t.primary;return typeof e==`string`?e.trim():``}return``}async function E(e,t){let r=await n(e,t),i=await r.json().catch(()=>({}));if(!r.ok){let e=typeof i.error==`string`?i.error:`HTTP ${r.status}`;throw Error(e)}return i}async function Ce(){return(await E(t(`/api/cron`))).jobs||[]}async function we(e){let r=await n(t(`/api/cron/${encodeURIComponent(e)}`));if(r.status===404)return null;let i=await r.json().catch(()=>({}));if(!r.ok)throw Error(typeof i.error==`string`?i.error:`HTTP ${r.status}`);return i.job??null}async function Te(e,n){return E(t(`/api/cron`),{method:`POST`,body:JSON.stringify({schedule:e,...n})})}async function Ee(e,n){return(await E(t(`/api/cron/${encodeURIComponent(e)}`),{method:`PATCH`,body:JSON.stringify(n)})).updated}async function De(e){return(await E(t(`/api/cron/${encodeURIComponent(e)}`),{method:`DELETE`})).removed}async function Oe(e,n){return(await E(t(`/api/cron/${encodeURIComponent(e)}/toggle`),{method:`POST`,body:JSON.stringify({enabled:n})})).toggled}async function ke(e){await E(t(`/api/cron/${encodeURIComponent(e)}/run`),{method:`POST`})}async function Ae(e,n=10){return(await E(t(`/api/cron/${encodeURIComponent(e)}/history?limit=${n}`))).history||[]}async function je(e=40){return(await E(t(`/api/cron/runs/history?limit=${e}`))).runs||[]}async function Me(){return(await E(t(`/api/channels/status`))).payload?.channels||[]}async function Ne(){return(await i()).map(e=>({id:e.id,name:e.name,provider:e.provider}))}async function Pe(){let e=(await E(t(`/api/config`))).payload?.config;return{model:Se(e)}}async function Fe(e){return(await E(t(`/api/sessions/chat-ids${e?`?channel=${encodeURIComponent(e)}`:``}`))).payload?.chatIds||[]}var Ie=[3e4,6e4,3e5,6e5,9e5,18e5,36e5,72e5],Le=new Set(Ie);function Re(e,t){switch(e){case 3e4:return t.every30s;case 6e4:return t.every1min;case 3e5:return t.every5min;case 6e5:return t.every10min;case 9e5:return t.every15min;case 18e5:return t.every30min;case 36e5:return t.every1h;case 72e5:return t.every2h;default:return null}}var ze={second:new Intl.NumberFormat(`en-US`,{style:`unit`,unit:`second`,unitDisplay:`long`}),minute:new Intl.NumberFormat(`en-US`,{style:`unit`,unit:`minute`,unitDisplay:`long`}),hour:new Intl.NumberFormat(`en-US`,{style:`unit`,unit:`hour`,unitDisplay:`long`})},Be={second:new Intl.NumberFormat(`zh-CN`,{style:`unit`,unit:`second`,unitDisplay:`long`}),minute:new Intl.NumberFormat(`zh-CN`,{style:`unit`,unit:`minute`,unitDisplay:`long`}),hour:new Intl.NumberFormat(`zh-CN`,{style:`unit`,unit:`hour`,unitDisplay:`long`})};function D(e,t){return e.startsWith(`zh`)?Be[t]:ze[t]}function Ve(e,t,n){let r=Math.max(1e3,Math.round(e));if(n&&Le.has(r)){let e=Re(r,n);if(e)return e}let i=Math.max(1,Math.round(r/1e3));if(i<120)return D(t,`second`).format(i);let a=Math.round(i/60);if(a<120)return D(t,`minute`).format(a);let o=Math.round(a/60);return D(t,`hour`).format(o)}var O=new Set([`__xopc_memory_dreaming_light_sweep__`,`__xopc_memory_dreaming_sweep__`,`__xopc_memory_dreaming_rem_sweep__`]);function He(e){let t=e.payload;if(t?.kind!==`agentTurn`)return!1;let n=t.message;return typeof n==`string`&&O.has(n)}function k(e){let{children:t,fallback:n}=e,i=n===void 0?null:n;return r()?t:i}export{T as C,de as D,pe as E,ae as O,ge as S,he as T,Oe as _,Te as a,ve as b,Me as c,we as d,Ne as f,ke as g,De as h,Ie as i,ie as k,Pe as l,Ce as m,He as n,xe as o,Fe as p,Ve as r,je as s,k as t,Ae as u,Ee as v,be as w,me as x,ye as y};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{ga as n,ii as r,pi as i}from"./index-C_2yKRJX.js";var a=e();function o(){return`rounded-2xl bg-surface-base px-4 py-5 sm:px-5`}var s=t();function c(e){let t=(0,a.c)(5),{children:n,className:r}=e,c;t[0]===r?c=t[1]:(c=i(o(),r),t[0]=r,t[1]=c);let l;return t[2]!==n||t[3]!==c?(l=(0,s.jsx)(`section`,{className:c,children:n}),t[2]=n,t[3]=c,t[4]=l):l=t[4],l}var l=`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-hover/90 text-fg-muted transition-colors dark:bg-surface-hover/70`;function u(e){let t=(0,a.c)(26),{icon:o,title:c,subtitle:u,trailing:d,className:f,iconInteractive:p,iconLeading:m}=e,h;t[0]===o?h=t[1]:(h=(0,s.jsx)(o,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[0]=o,t[1]=h);let g=m??h,_;t[2]===m?_=t[3]:(_=m?i(`flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-surface-panel p-0 ring-1 ring-inset ring-edge-subtle transition-[box-shadow] hover:ring-accent/40 dark:ring-edge-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`,r.press):i(l,`hover:text-fg`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`,r.press),t[2]=m,t[3]=_);let v=_,y=!!(p&&m),b;t[4]===f?b=t[5]:(b=i(`mb-5 flex items-start gap-3`,f),t[4]=f,t[5]=b);let x;t[6]!==p||t[7]!==m||t[8]!==g||t[9]!==v||t[10]!==y?(x=p?y?(0,s.jsxs)(`span`,{className:`relative shrink-0`,children:[(0,s.jsx)(`button`,{type:`button`,id:p.id,onClick:p.onClick,"aria-label":p.ariaLabel,className:v,children:g}),(0,s.jsx)(`span`,{className:`pointer-events-none absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-md border border-edge bg-surface-panel text-fg-muted shadow-sm dark:border-edge dark:bg-surface-base`,"aria-hidden":!0,children:(0,s.jsx)(n,{className:`size-2.5`,strokeWidth:2.25})})]}):(0,s.jsx)(`button`,{type:`button`,id:p.id,onClick:p.onClick,"aria-label":p.ariaLabel,className:v,children:g}):(0,s.jsx)(`div`,{className:i(m?`flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-surface-panel ring-1 ring-inset ring-edge-subtle dark:ring-edge-subtle`:l),"aria-hidden":!m,children:g}),t[6]=p,t[7]=m,t[8]=g,t[9]=v,t[10]=y,t[11]=x):x=t[11];let S;t[12]===c?S=t[13]:(S=(0,s.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:c}),t[12]=c,t[13]=S);let C;t[14]===u?C=t[15]:(C=u?(0,s.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:u}):null,t[14]=u,t[15]=C);let w;t[16]!==S||t[17]!==C?(w=(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[S,C]}),t[16]=S,t[17]=C,t[18]=w):w=t[18];let T;t[19]===d?T=t[20]:(T=d?(0,s.jsx)(`div`,{className:`shrink-0`,children:d}):null,t[19]=d,t[20]=T);let E;return t[21]!==b||t[22]!==x||t[23]!==w||t[24]!==T?(E=(0,s.jsxs)(`div`,{className:b,children:[x,w,T]}),t[21]=b,t[22]=x,t[23]=w,t[24]=T,t[25]=E):E=t[25],E}export{u as n,o as r,c as t};