@xopcai/xopc 0.0.8 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions/telegram/src/plugin.js +1 -1
- package/dist/extensions/telegram/src/routing-integration.js +2 -2
- package/dist/extensions/weixin/src/plugin.js +1 -1
- package/dist/gateway/static/root/assets/{agents-BSNzJWbQ.js → agents-BdC4Y-HX.js} +2 -2
- package/dist/gateway/static/root/assets/agents-BdC4Y-HX.js.map +1 -0
- package/dist/gateway/static/root/assets/{apps-page-BKk9SB4D.js → apps-page-C-oaSHkm.js} +2 -2
- package/dist/gateway/static/root/assets/{apps-page-BKk9SB4D.js.map → apps-page-C-oaSHkm.js.map} +1 -1
- package/dist/gateway/static/root/assets/attachment-load-BDDlItdE.js +1 -0
- package/dist/gateway/static/root/assets/{channels-settings-_J6cQN6G.js → channels-settings-BqEUppPO.js} +2 -2
- package/dist/gateway/static/root/assets/{channels-settings-_J6cQN6G.js.map → channels-settings-BqEUppPO.js.map} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-DPb_0O8M.js → chat-agents-api-BhqjQ7iL.js} +2 -2
- package/dist/gateway/static/root/assets/{chat-agents-api-DPb_0O8M.js.map → chat-agents-api-BhqjQ7iL.js.map} +1 -1
- package/dist/gateway/static/root/assets/{cron-page-BUJOuuKX.js → cron-page-Cli49RKR.js} +2 -2
- package/dist/gateway/static/root/assets/{cron-page-BUJOuuKX.js.map → cron-page-Cli49RKR.js.map} +1 -1
- package/dist/gateway/static/root/assets/{cron-utils-Cn0YVg8x.js → cron-utils-Dkj-Ldpf.js} +2 -2
- package/dist/gateway/static/root/assets/{cron-utils-Cn0YVg8x.js.map → cron-utils-Dkj-Ldpf.js.map} +1 -1
- package/dist/gateway/static/root/assets/{electron-env-D9bm1FIu.js → electron-env-BDtJw9AY.js} +2 -2
- package/dist/gateway/static/root/assets/{electron-env-D9bm1FIu.js.map → electron-env-BDtJw9AY.js.map} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DTz4O5Ua.js → extension-debug-page-BMcZlaxF.js} +2 -2
- package/dist/gateway/static/root/assets/{extension-debug-page-DTz4O5Ua.js.map → extension-debug-page-BMcZlaxF.js.map} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-Cs1Kde9o.js → extension-iframe-host-D5HEF0KR.js} +2 -2
- package/dist/gateway/static/root/assets/{extension-iframe-host-Cs1Kde9o.js.map → extension-iframe-host-D5HEF0KR.js.map} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-G52iX0Bo.js → extension-page-CXdCSSPl.js} +2 -2
- package/dist/gateway/static/root/assets/{extension-page-G52iX0Bo.js.map → extension-page-CXdCSSPl.js.map} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-CO2jxBA9.js → extension-provider-DZCZgQE2.js} +2 -2
- package/dist/gateway/static/root/assets/{extension-provider-CO2jxBA9.js.map → extension-provider-DZCZgQE2.js.map} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-D9Ul8uSt.js → extension-settings-page-CX6STpx3.js} +2 -2
- package/dist/gateway/static/root/assets/{extension-settings-page-D9Ul8uSt.js.map → extension-settings-page-CX6STpx3.js.map} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-Bc8SVD15.js → gateway-config-swr-Cph02QZn.js} +2 -2
- package/dist/gateway/static/root/assets/{gateway-config-swr-Bc8SVD15.js.map → gateway-config-swr-Cph02QZn.js.map} +1 -1
- package/dist/gateway/static/root/assets/index-Bty3m0mS.css +2 -0
- package/dist/gateway/static/root/assets/{index-BXUJbteW.js → index-iTUyfzNr.js} +10 -10
- package/dist/gateway/static/root/assets/index-iTUyfzNr.js.map +1 -0
- package/dist/gateway/static/root/assets/{logs-page-5V25JkQY.js → logs-page-B9O5l3I8.js} +2 -2
- package/dist/gateway/static/root/assets/{logs-page-5V25JkQY.js.map → logs-page-B9O5l3I8.js.map} +1 -1
- package/dist/gateway/static/root/assets/{model-selector-he3aQfme.js → model-selector-BLiY_O25.js} +2 -2
- package/dist/gateway/static/root/assets/{model-selector-he3aQfme.js.map → model-selector-BLiY_O25.js.map} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-BFpnFTed.js +2 -0
- package/dist/gateway/static/root/assets/{page-header-store-DJHD9Ean.js.map → page-header-store-BFpnFTed.js.map} +1 -1
- package/dist/gateway/static/root/assets/{session-api-n-4O5d9U.js → session-api-DEhQXWJg.js} +2 -2
- package/dist/gateway/static/root/assets/{session-api-n-4O5d9U.js.map → session-api-DEhQXWJg.js.map} +1 -1
- package/dist/gateway/static/root/assets/{session-working-directory-control-B6dHLvbr.js → session-working-directory-control-DKOtWs3-.js} +2 -2
- package/dist/gateway/static/root/assets/{session-working-directory-control-B6dHLvbr.js.map → session-working-directory-control-DKOtWs3-.js.map} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-rBUfTdm3.js → sessions-page-BYlWP1ep.js} +2 -2
- package/dist/gateway/static/root/assets/{sessions-page-rBUfTdm3.js.map → sessions-page-BYlWP1ep.js.map} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-B3QrJm-E.js → settings-page-oCnIavdg.js} +2 -2
- package/dist/gateway/static/root/assets/settings-page-oCnIavdg.js.map +1 -0
- package/dist/gateway/static/root/assets/{skill-api-vxtE8kI6.js → skill-api-DWrn8Az0.js} +2 -2
- package/dist/gateway/static/root/assets/{skill-api-vxtE8kI6.js.map → skill-api-DWrn8Az0.js.map} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-D36_O2Ub.js → skills-page-C59WQpM1.js} +2 -2
- package/dist/gateway/static/root/assets/{skills-page-D36_O2Ub.js.map → skills-page-C59WQpM1.js.map} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-CmiSsYBd.js → theme-store-CywXkKml.js} +2 -2
- package/dist/gateway/static/root/assets/{theme-store-CmiSsYBd.js.map → theme-store-CywXkKml.js.map} +1 -1
- package/dist/gateway/static/root/assets/url-D7yWllI8.js +2 -0
- package/dist/gateway/static/root/assets/url-D7yWllI8.js.map +1 -0
- package/dist/gateway/static/root/assets/{useTranslation-DYORQ7x6.js → useTranslation-CACj0DBJ.js} +2 -2
- package/dist/gateway/static/root/assets/{useTranslation-DYORQ7x6.js.map → useTranslation-CACj0DBJ.js.map} +1 -1
- package/dist/gateway/static/root/index.html +15 -15
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +20 -12
- package/dist/src/agent/agent-manager.js.map +1 -1
- package/dist/src/agent/background-review/run-background-review.js +2 -0
- package/dist/src/agent/background-review/run-background-review.js.map +1 -1
- package/dist/src/agent/child-agent-factory.js +2 -0
- package/dist/src/agent/child-agent-factory.js.map +1 -1
- package/dist/src/agent/context/expand-at-file-mentions.d.ts +4 -0
- package/dist/src/agent/context/expand-at-file-mentions.js +69 -0
- package/dist/src/agent/context/expand-at-file-mentions.js.map +1 -0
- package/dist/src/agent/context/workspace-seed.js +1 -1
- package/dist/src/agent/image/understanding/pi-ai-provider.js.map +1 -1
- package/dist/src/agent/ipc/bus.js +1 -1
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/ipc/socket.js +1 -1
- package/dist/src/agent/memory/compaction.d.ts +1 -1
- package/dist/src/agent/memory/compaction.js +38 -11
- package/dist/src/agent/memory/compaction.js.map +1 -1
- package/dist/src/agent/messaging/command-handler.d.ts +13 -0
- package/dist/src/agent/messaging/command-handler.js +14 -2
- package/dist/src/agent/messaging/command-handler.js.map +1 -1
- package/dist/src/agent/models/manager.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +6 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js.map +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +1 -1
- package/dist/src/agent/service.d.ts +16 -1
- package/dist/src/agent/service.js +178 -20
- package/dist/src/agent/service.js.map +1 -1
- package/dist/src/agent/skills/format-skills-prompt.js.map +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/scanner.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js.map +1 -1
- package/dist/src/agent/skills/skill-manager.js +1 -1
- package/dist/src/agent/tools/browser/tools.js.map +1 -1
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/image-tool.js.map +1 -1
- package/dist/src/agent/tools/send-media.js +1 -1
- package/dist/src/agent/tools/skill-manage-tool.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/channels/attachments/inbound-persist.js +1 -1
- package/dist/src/channels/attachments/outbound-tts-persist.js +1 -1
- package/dist/src/channels/index.d.ts +1 -1
- package/dist/src/channels/index.js +2 -2
- package/dist/src/channels/pipeline.d.ts +8 -1
- package/dist/src/channels/pipeline.js +49 -4
- package/dist/src/channels/pipeline.js.map +1 -1
- package/dist/src/chat-commands/builtins/config.d.ts +4 -0
- package/dist/src/chat-commands/builtins/config.js +197 -0
- package/dist/src/chat-commands/builtins/config.js.map +1 -0
- package/dist/src/chat-commands/builtins/context.d.ts +4 -0
- package/dist/src/chat-commands/builtins/context.js +44 -0
- package/dist/src/chat-commands/builtins/context.js.map +1 -0
- package/dist/src/chat-commands/builtins/session.js +111 -0
- package/dist/src/chat-commands/builtins/session.js.map +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +49 -21
- package/dist/src/chat-commands/builtins/thinking.js.map +1 -1
- package/dist/src/chat-commands/config-paths.d.ts +10 -0
- package/dist/src/chat-commands/config-paths.js +45 -0
- package/dist/src/chat-commands/config-paths.js.map +1 -0
- package/dist/src/chat-commands/config-value.d.ts +12 -0
- package/dist/src/chat-commands/config-value.js +53 -0
- package/dist/src/chat-commands/config-value.js.map +1 -0
- package/dist/src/chat-commands/context.d.ts +24 -1
- package/dist/src/chat-commands/context.js +41 -0
- package/dist/src/chat-commands/context.js.map +1 -1
- package/dist/src/chat-commands/index.d.ts +2 -0
- package/dist/src/chat-commands/index.js +5 -1
- package/dist/src/chat-commands/index.js.map +1 -1
- package/dist/src/chat-commands/types.d.ts +33 -1
- package/dist/src/cli/commands/agent/interactive.js +1 -1
- package/dist/src/cli/commands/agent/interactive.js.map +1 -1
- package/dist/src/cli/commands/agent.js +22 -10
- package/dist/src/cli/commands/agent.js.map +1 -1
- package/dist/src/cli/commands/auth.js.map +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/extension.js +10 -0
- package/dist/src/cli/commands/extension.js.map +1 -1
- package/dist/src/cli/commands/init.js +3 -4
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/session/utils.js.map +1 -1
- package/dist/src/cli/commands/update.d.ts +1 -0
- package/dist/src/cli/commands/update.js +171 -0
- package/dist/src/cli/commands/update.js.map +1 -0
- package/dist/src/cli/index.d.ts +1 -1
- package/dist/src/cli/index.js +3 -1
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/config/index.d.ts +1 -0
- package/dist/src/config/index.js +5 -4
- package/dist/src/config/index.js.map +1 -1
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/paths.js.map +1 -1
- package/dist/src/config/profile.js +2 -2
- package/dist/src/config/runtime-overrides.d.ts +8 -0
- package/dist/src/config/runtime-overrides.js +40 -0
- package/dist/src/config/runtime-overrides.js.map +1 -0
- package/dist/src/config/schema.d.ts +35 -0
- package/dist/src/config/schema.js +19 -3
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/cron/executor.js +2 -2
- package/dist/src/cron/persistence.js +1 -1
- package/dist/src/cron/run-log-store.js +1 -1
- package/dist/src/extensions/health.js +1 -1
- package/dist/src/extensions/loader.d.ts +1 -1
- package/dist/src/extensions/loader.js +6 -9
- package/dist/src/extensions/loader.js.map +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +6 -1
- package/dist/src/extensions/sdk/index.js.map +1 -0
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/agents-admin.js.map +1 -1
- package/dist/src/gateway/hono/oauth.js +1 -1
- package/dist/src/gateway/hono/routes/config.js +1 -1
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/gateway/hono/routes/index.js.map +1 -1
- package/dist/src/gateway/hono/routes/models.js +64 -11
- package/dist/src/gateway/hono/routes/models.js.map +1 -1
- package/dist/src/gateway/hono/routes/public-gateway.js +10 -0
- package/dist/src/gateway/hono/routes/public-gateway.js.map +1 -1
- package/dist/src/gateway/hono/routes/update.d.ts +3 -0
- package/dist/src/gateway/hono/routes/update.js +141 -0
- package/dist/src/gateway/hono/routes/update.js.map +1 -0
- package/dist/src/gateway/hono/routes/workspace.js +84 -4
- package/dist/src/gateway/hono/routes/workspace.js.map +1 -1
- package/dist/src/gateway/hono/sse.js +2 -2
- package/dist/src/gateway/service.d.ts +1 -0
- package/dist/src/gateway/service.js +16 -4
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/gateway/workspace-fs-file-list.d.ts +5 -0
- package/dist/src/gateway/workspace-fs-file-list.js +56 -0
- package/dist/src/gateway/workspace-fs-file-list.js.map +1 -0
- package/dist/src/gateway/workspace-heartbeat-path.js +1 -1
- package/dist/src/gateway/workspace-ripgrep.d.ts +5 -0
- package/dist/src/gateway/workspace-ripgrep.js +88 -4
- package/dist/src/gateway/workspace-ripgrep.js.map +1 -1
- package/dist/src/infra/update-channels.d.ts +14 -0
- package/dist/src/infra/update-channels.js +30 -0
- package/dist/src/infra/update-channels.js.map +1 -0
- package/dist/src/infra/update-check.d.ts +53 -0
- package/dist/src/infra/update-check.js +155 -0
- package/dist/src/infra/update-check.js.map +1 -0
- package/dist/src/infra/update-runner.d.ts +18 -0
- package/dist/src/infra/update-runner.js +112 -0
- package/dist/src/infra/update-runner.js.map +1 -0
- package/dist/src/infra/update-startup.d.ts +20 -0
- package/dist/src/infra/update-startup.js +246 -0
- package/dist/src/infra/update-startup.js.map +1 -0
- package/dist/src/providers/extension-stream-bridge.d.ts +3 -0
- package/dist/src/providers/extension-stream-bridge.js +239 -0
- package/dist/src/providers/extension-stream-bridge.js.map +1 -0
- package/dist/src/providers/index.d.ts +7 -2
- package/dist/src/providers/index.js +77 -14
- package/dist/src/providers/index.js.map +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/plugin-registry.js +92 -87
- package/dist/src/providers/plugin-registry.js.map +1 -1
- package/dist/src/session/chat-export.d.ts +5 -0
- package/dist/src/session/chat-export.js +35 -0
- package/dist/src/session/chat-export.js.map +1 -0
- package/dist/src/session/config-store.js +1 -1
- package/dist/src/session/manager.d.ts +1 -1
- package/dist/src/session/manager.js +2 -2
- package/dist/src/session/manager.js.map +1 -1
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.d.ts +1 -1
- package/dist/src/session/store.js +5 -5
- package/dist/src/session/store.js.map +1 -1
- package/dist/src/utils/logger/audit.js +1 -1
- package/dist/src/utils/logger/log-store.js +1 -1
- package/dist/src/utils/logger/rotation.js +1 -1
- package/dist/src/voice/tts/audio.js +1 -1
- package/package.json +2 -1
- package/dist/gateway/static/root/assets/agents-BSNzJWbQ.js.map +0 -1
- package/dist/gateway/static/root/assets/attachment-load-DXcJLSWT.js +0 -1
- package/dist/gateway/static/root/assets/index-BXUJbteW.js.map +0 -1
- package/dist/gateway/static/root/assets/index-CQLMxWSA.css +0 -2
- package/dist/gateway/static/root/assets/page-header-store-DJHD9Ean.js +0 -2
- package/dist/gateway/static/root/assets/settings-page-B3QrJm-E.js.map +0 -1
- package/dist/gateway/static/root/assets/url-CtSqjF9J.js +0 -2
- package/dist/gateway/static/root/assets/url-CtSqjF9J.js.map +0 -1
package/dist/gateway/static/root/assets/{chat-agents-api-DPb_0O8M.js → chat-agents-api-BhqjQ7iL.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,t}from"./url-
|
|
2
|
-
//# sourceMappingURL=chat-agents-api-
|
|
1
|
+
import{n as e,t}from"./url-D7yWllI8.js";import{t as n}from"./gateway-config-swr-Cph02QZn.js";async function r(){let r=await e(t(`/api/agents`));if(r.ok){let e=await r.json();if(e.ok&&e.payload?.defaultId&&Array.isArray(e.payload.agents)){let t=e.payload.defaultId.trim().toLowerCase(),n=e.payload.agents.filter(e=>!!(e&&typeof e.id==`string`&&e.id.trim())).map(e=>({id:e.id.trim().toLowerCase(),name:typeof e.name==`string`&&e.name.trim()?e.name.trim():void 0,description:typeof e.description==`string`&&e.description.trim()?e.description.trim():void 0}));if(n.length>0)return{defaultId:t,items:n}}}let i=(await n()).payload?.config?.agents,a=(i?.defaultId??`main`).trim().toLowerCase(),o=(Array.isArray(i?.list)?i.list:[]).filter(e=>!!(e&&typeof e.id==`string`&&e.id.trim())).map(e=>({id:e.id.trim().toLowerCase(),name:typeof e.name==`string`&&e.name.trim()?e.name.trim():void 0,description:typeof e.description==`string`&&e.description.trim()?e.description.trim():void 0}));return o.length===0?{defaultId:a,items:[{id:a}]}:{defaultId:a,items:o}}export{r as t};
|
|
2
|
+
//# sourceMappingURL=chat-agents-api-BhqjQ7iL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-agents-api-
|
|
1
|
+
{"version":3,"file":"chat-agents-api-BhqjQ7iL.js","names":[],"sources":["../../../../../web/src/features/chat/chat-agents-api.ts"],"sourcesContent":["import { fetchGatewayConfigSwrResponse } from '@/features/gateway/gateway-config-swr';\nimport { apiFetch } from '@/lib/fetch';\nimport { apiUrl } from '@/lib/url';\n\nexport type ChatAgentOption = { id: string; name?: string; description?: string };\n\nexport type ChatAgentsPayload = {\n defaultId: string;\n items: ChatAgentOption[];\n};\n\nexport async function fetchChatAgents(): Promise<ChatAgentsPayload> {\n const agentsRes = await apiFetch(apiUrl('/api/agents'));\n if (agentsRes.ok) {\n const data = (await agentsRes.json()) as {\n ok?: boolean;\n payload?: {\n defaultId?: string;\n agents?: Array<{ id?: string; name?: string; description?: string }>;\n };\n };\n if (data.ok && data.payload?.defaultId && Array.isArray(data.payload.agents)) {\n const defaultId = data.payload.defaultId.trim().toLowerCase();\n const items: ChatAgentOption[] = data.payload.agents\n .filter((a): a is { id: string; name?: string; description?: string } =>\n Boolean(a && typeof a.id === 'string' && a.id.trim()),\n )\n .map((a) => ({\n id: a.id.trim().toLowerCase(),\n name: typeof a.name === 'string' && a.name.trim() ? a.name.trim() : undefined,\n description:\n typeof a.description === 'string' && a.description.trim() ? a.description.trim() : undefined,\n }));\n if (items.length > 0) {\n return { defaultId, items };\n }\n }\n }\n\n const data = (await fetchGatewayConfigSwrResponse()) as {\n payload?: {\n config?: {\n agents?: { defaultId?: string; list?: Array<{ id?: string; name?: string }> };\n };\n };\n };\n const agents = data.payload?.config?.agents;\n const defaultId = (agents?.defaultId ?? 'main').trim().toLowerCase();\n const raw = Array.isArray(agents?.list) ? agents.list : [];\n const items: ChatAgentOption[] = raw\n .filter((e): e is { id: string; name?: string; description?: string } =>\n Boolean(e && typeof e.id === 'string' && e.id.trim()),\n )\n .map((e) => ({\n id: e.id.trim().toLowerCase(),\n name: typeof e.name === 'string' && e.name.trim() ? e.name.trim() : undefined,\n description:\n typeof e.description === 'string' && e.description.trim() ? e.description.trim() : undefined,\n }));\n if (items.length === 0) {\n return { defaultId, items: [{ id: defaultId }] };\n }\n return { defaultId, items };\n}\n"],"mappings":"6FAWA,eAAsB,GAA8C,CAClE,IAAM,EAAY,MAAM,EAAS,EAAO,cAAc,CAAC,CACvD,GAAI,EAAU,GAAI,CAChB,IAAM,EAAQ,MAAM,EAAU,MAAM,CAOpC,GAAI,EAAK,IAAM,EAAK,SAAS,WAAa,MAAM,QAAQ,EAAK,QAAQ,OAAO,CAAE,CAC5E,IAAM,EAAY,EAAK,QAAQ,UAAU,MAAM,CAAC,aAAa,CACvD,EAA2B,EAAK,QAAQ,OAC3C,OAAQ,GACP,GAAQ,GAAK,OAAO,EAAE,IAAO,UAAY,EAAE,GAAG,MAAM,EACrD,CACA,IAAK,IAAO,CACX,GAAI,EAAE,GAAG,MAAM,CAAC,aAAa,CAC7B,KAAM,OAAO,EAAE,MAAS,UAAY,EAAE,KAAK,MAAM,CAAG,EAAE,KAAK,MAAM,CAAG,IAAA,GACpE,YACE,OAAO,EAAE,aAAgB,UAAY,EAAE,YAAY,MAAM,CAAG,EAAE,YAAY,MAAM,CAAG,IAAA,GACtF,EAAE,CACL,GAAI,EAAM,OAAS,EACjB,MAAO,CAAE,YAAW,QAAO,EAYjC,IAAM,GAPQ,MAAM,GAA+B,EAO/B,SAAS,QAAQ,OAC/B,GAAa,GAAQ,WAAa,QAAQ,MAAM,CAAC,aAAa,CAE9D,GADM,MAAM,QAAQ,GAAQ,KAAK,CAAG,EAAO,KAAO,EAAE,EAEvD,OAAQ,GACP,GAAQ,GAAK,OAAO,EAAE,IAAO,UAAY,EAAE,GAAG,MAAM,EACrD,CACA,IAAK,IAAO,CACX,GAAI,EAAE,GAAG,MAAM,CAAC,aAAa,CAC7B,KAAM,OAAO,EAAE,MAAS,UAAY,EAAE,KAAK,MAAM,CAAG,EAAE,KAAK,MAAM,CAAG,IAAA,GACpE,YACE,OAAO,EAAE,aAAgB,UAAY,EAAE,YAAY,MAAM,CAAG,EAAE,YAAY,MAAM,CAAG,IAAA,GACtF,EAAE,CAIL,OAHI,EAAM,SAAW,EACZ,CAAE,YAAW,MAAO,CAAC,CAAE,GAAI,EAAW,CAAC,CAAE,CAE3C,CAAE,YAAW,QAAO"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{i as t,t as n}from"./vendor-react-QAsRxa6t.js";import{l as r,o as i,s as a}from"./url-CtSqjF9J.js";import{c as o}from"./chunk-QFMPRPBF-DOYp8d2p.js";import{n as s,t as c}from"./cn-DPF56z7S.js";import{c as ee,n as te,r as ne,s as re}from"./session-working-directory-control-B6dHLvbr.js";import{c as ie,n as ae,t as oe,u as l}from"./model-selector-he3aQfme.js";import{t as se}from"./ellipsis-vertical-BJP8MSr5.js";import{i as ce}from"./gateway-config-swr-Bc8SVD15.js";import{t as le}from"./info-Ccltk00r.js";import{t as u}from"./loader-circle-B2bCE4iI.js";import{t as ue}from"./plus-CBODkzSX.js";import{t as d}from"./refresh-cw-D7hzzeQ5.js";import{a as f,i as p,n as m,o as h,s as g,t as _}from"./dist-Db1dcLr9.js";import{t as v}from"./button-CRQ9eQGX.js";import{i as y,o as b,r as x}from"./form-field-width-BlpNwrfn.js";import{i as de}from"./theme-store-CmiSsYBd.js";import{t as fe}from"./page-header-store-DJHD9Ean.js";import{n as pe,r as me}from"./segmented-styles-DEG4J-_P.js";import{t as he}from"./markdown-view-BpEqr7_J.js";import{n as ge}from"./interaction-C4gx-xSs.js";import{t as _e}from"./chat-agents-api-DPb_0O8M.js";import{C as ve,S as ye,_ as be,a as xe,b as Se,c as Ce,d as we,f as Te,g as Ee,h as De,i as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as Ie,u as Le,v as Re,x as ze,y as Be}from"./cron-utils-Cn0YVg8x.js";import{a as Ve,i as He,n as Ue,r as We,t as Ge}from"./dist-1vucfpMU.js";var S=e(t(),1);function Ke(e,t){let n=e.templates;if(!n||typeof n!=`object`)return;let r=n[t];if(!r||typeof r!=`object`)return;let i=r.title?.trim(),a=r.prompt?.trim();if(!(!i||!a))return{title:i,description:(r.description??``).trim(),prompt:a}}var C=[`daily`,`monitoring`,`reports`,`automation`],qe=[{templateId:`morning_briefing`,category:`daily`,defaultSchedule:`0 7 * * 1-5`,defaultSessionTarget:`isolated`},{templateId:`standup_prep`,category:`daily`,defaultSchedule:`0 8 * * 1-5`,defaultSessionTarget:`isolated`},{templateId:`end_of_day_wrap_up`,category:`daily`,defaultSchedule:`0 18 * * 1-5`,defaultSessionTarget:`isolated`},{templateId:`inbox_triage`,category:`daily`,defaultSchedule:`30 8 * * 1-5`,defaultSessionTarget:`isolated`},{templateId:`competitor_watch`,category:`monitoring`,defaultSchedule:`0 9 * * 1`,defaultSessionTarget:`isolated`},{templateId:`trending_topics_monitor`,category:`monitoring`,defaultSchedule:`0 10 * * 1-5`,defaultSessionTarget:`isolated`},{templateId:`tech_radar_stack`,category:`monitoring`,defaultSchedule:`0 11 * * 3`,defaultSessionTarget:`isolated`},{templateId:`dependency_check_audit`,category:`monitoring`,defaultSchedule:`0 9 * * 0`,defaultSessionTarget:`isolated`},{templateId:`weekly_review`,category:`reports`,defaultSchedule:`0 17 * * 5`,defaultSessionTarget:`isolated`},{templateId:`code_quality_report`,category:`reports`,defaultSchedule:`0 14 * * 1`,defaultSessionTarget:`isolated`},{templateId:`git_activity_summary`,category:`reports`,defaultSchedule:`0 9 * * 1`,defaultSessionTarget:`isolated`},{templateId:`user_feedback_digest`,category:`reports`,defaultSchedule:`0 16 * * 5`,defaultSessionTarget:`isolated`},{templateId:`stale_todo_or_issue_sweep`,category:`automation`,defaultSchedule:`0 10 * * 2`,defaultSessionTarget:`isolated`},{templateId:`release_notes_or_changelog_draft`,category:`automation`,defaultSchedule:`0 10 * * 4`,defaultSessionTarget:`isolated`},{templateId:`workspace_cleanup_suggestions`,category:`automation`,defaultSchedule:`30 18 * * 5`,defaultSessionTarget:`isolated`},{templateId:`smoke_or_ci_health_reminder`,category:`automation`,defaultSchedule:`0 8 * * 1`,defaultSessionTarget:`isolated`}];function Je(e){return qe.find(t=>t.templateId===e)}var w=n();function Ye(e){let{cron:t,localeTag:n,scheduleBadgeLabels:r,categoryFilter:i,onCategoryFilterChange:a,onSelectTemplate:o}=e,s=i===`all`?[...qe]:qe.filter(e=>e.category===i);return(0,w.jsxs)(`div`,{className:`flex w-full flex-col gap-4`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-2`,role:`group`,"aria-label":t.fromTemplate,children:[(0,w.jsx)(v,{type:`button`,variant:i===`all`?`secondary`:`ghost`,className:`h-8 rounded-full px-3 py-1.5 text-xs`,onClick:()=>a(`all`),children:t.templateFilterAll}),C.map(e=>(0,w.jsx)(v,{type:`button`,variant:i===e?`secondary`:`ghost`,className:`h-8 rounded-full px-3 py-1.5 text-xs`,onClick:()=>a(e),children:t.templateCategories[e]},e))]}),s.length===0?(0,w.jsx)(`p`,{className:`text-center text-sm text-fg-muted`,children:t.templatesEmptyHint}):(0,w.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:s.map(e=>{let i=Ke(t,e.templateId);if(!i)return null;let a=Me({schedule:e.defaultSchedule,timezone:void 0,next_run:void 0},n,r);return(0,w.jsxs)(`button`,{type:`button`,className:c(`flex flex-col gap-1.5 rounded-xl border border-edge-subtle bg-surface-base p-4 text-left transition-colors`,`hover:border-accent/40 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`),onClick:()=>o(e.templateId),"aria-label":`${t.templateCategories[e.category]} — ${i.title}`,children:[(0,w.jsx)(`span`,{className:`font-semibold text-fg`,children:i.title}),(0,w.jsx)(`span`,{className:`line-clamp-2 text-sm text-fg-muted`,children:i.description}),(0,w.jsx)(`span`,{className:`mt-1 flex items-center gap-1 text-xs text-fg-muted`,children:(0,w.jsx)(`span`,{className:`tabular-nums`,children:a})})]},e.templateId)})})]})}var T=ke(),E=c(b,`min-w-0 shrink text-xs sm:min-w-[7rem] sm:max-w-[11rem]`),D=c(`h-9 min-w-[6.5rem] shrink-0 rounded-lg border border-edge-subtle bg-surface-panel px-2 py-1.5 text-sm text-fg`,x,`dark:bg-surface-panel`),Xe=c(`h-9 min-w-[9.5rem] shrink-0 rounded-lg border border-edge-subtle bg-surface-panel px-2 py-1.5 text-sm text-fg`,x),O=c(`h-9 w-14 shrink-0 rounded-lg border border-edge-subtle bg-surface-panel px-2 py-1.5 text-center text-sm tabular-nums text-fg`,x),Ze=c(`min-h-[2.5rem] w-full rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 font-mono text-xs text-fg`,x);function Qe(){let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function k(e){return Array.isArray(e)?e.filter(e=>typeof e==`number`).sort((e,t)=>e-t):[]}function A(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 $e(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 j(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 et(e){let t=e.trim(),n={mode:`custom`,intervalKind:`minutes`,onceDate:Qe(),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=T.CronExpressionParser.parse(t).fields,r=k(e.minute.values),i=k(e.hour.values),a=k(e.dayOfMonth.values),o=k(e.month.values),s=k(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=A(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=A(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],ee=`${e}-${String(s).padStart(2,`0`)}-${String(c).padStart(2,`0`)}`;return{...n,mode:`no_repeat`,minute:r[0],hour:i[0],onceDate:ee,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:j(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 tt(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)} * * ${$e(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 nt({value:e,onChange:t,labels:n,disabled:r}){let i=(0,S.useMemo)(()=>et(e),[e]),[a,o]=(0,S.useState)(i.mode),[s,ee]=(0,S.useState)(i.intervalKind),[te,ne]=(0,S.useState)(i.onceDate),[re,ie]=(0,S.useState)(i.intervalMinutes),[ae,oe]=(0,S.useState)(i.intervalHours),[l,se]=(0,S.useState)(i.minute),[ce,le]=(0,S.useState)(i.hour),[u,ue]=(0,S.useState)(i.weekDays),[d,f]=(0,S.useState)(i.dayOfMonth),[p,m]=(0,S.useState)(i.rawCron),[h,g]=(0,S.useState)(null),[_,v]=(0,S.useState)(null);(0,S.useEffect)(()=>{let t=et(e);o(t.mode),ee(t.intervalKind),ne(t.onceDate),ie(t.intervalMinutes),oe(t.intervalHours),se(t.minute),le(t.hour),ue(t.weekDays),f(t.dayOfMonth),m(t.rawCron),g(null),v(null)},[e]);let y=(0,S.useCallback)(e=>{t(tt({mode:a,intervalKind:s,onceDate:te,intervalMinutes:re,intervalHours:ae,minute:l,hour:ce,weekDays:u,dayOfMonth:d,rawCron:p,...e}))},[a,s,te,re,ae,l,ce,u,d,p,t]),b=`${String(ce).padStart(2,`0`)}:${String(l).padStart(2,`0`)}`,x=e=>{let t=e.target.value;if(!t)return;let[n,r]=t.split(`:`).map(e=>parseInt(e,10));Number.isNaN(n)||Number.isNaN(r)||y({minute:r,hour:n})},de=(0,w.jsxs)(`div`,{className:`flex min-w-0 flex-nowrap items-center gap-2 overflow-x-auto pb-0.5`,children:[(0,w.jsxs)(`select`,{className:E,disabled:r,value:a,onChange:e=>{let t=e.target.value;o(t),y({mode:t})},"aria-label":n.scheduleTimeLabel,children:[(0,w.jsx)(`option`,{value:`no_repeat`,children:n.modeNoRepeat}),(0,w.jsx)(`option`,{value:`interval`,children:n.modeInterval}),(0,w.jsx)(`option`,{value:`hourly`,children:n.modeHourly}),(0,w.jsx)(`option`,{value:`daily`,children:n.modeDaily}),(0,w.jsx)(`option`,{value:`weekly`,children:n.modeWeekly}),(0,w.jsx)(`option`,{value:`monthly`,children:n.modeMonthly}),(0,w.jsx)(`option`,{value:`custom`,children:n.modeCustom})]}),a===`no_repeat`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`input`,{type:`date`,disabled:r,className:Xe,value:te,onChange:e=>{let t=e.target.value;ne(t),y({onceDate:t})},"aria-label":n.modeNoRepeat}),(0,w.jsx)(`input`,{type:`time`,step:60,disabled:r,className:D,value:b,onChange:x,"aria-label":n.scheduleTimeLabel})]}),a===`interval`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`select`,{className:c(E,`w-auto min-w-[5rem]`),disabled:r,value:s,onChange:e=>{let t=e.target.value;ee(t),g(null),v(null),y({intervalKind:t})},"aria-label":n.modeInterval,children:[(0,w.jsx)(`option`,{value:`minutes`,children:n.intervalKindMinutes}),(0,w.jsx)(`option`,{value:`hours`,children:n.intervalKindHours})]}),s===`minutes`?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`input`,{type:`number`,min:1,max:59,disabled:r,className:O,value:h??String(re),onChange:e=>{let t=e.target.value;g(t);let n=parseInt(t,10);Number.isFinite(n)&&n>=1&&n<=59&&(ie(n),y({intervalMinutes:n}))},onBlur:()=>{if(h===null)return;let e=parseInt(h,10),t=!Number.isFinite(e)||e<1?5:Math.min(59,Math.max(1,Math.round(e)));ie(t),y({intervalMinutes:t}),g(null)},"aria-label":n.intervalMinutes}),(0,w.jsx)(`span`,{className:`shrink-0 text-sm text-fg-muted`,children:n.minuteUnit})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`input`,{type:`number`,min:1,max:23,disabled:r,className:O,value:_??String(ae),onChange:e=>{let t=e.target.value;v(t);let n=parseInt(t,10);Number.isFinite(n)&&n>=1&&n<=23&&(oe(n),y({intervalHours:n}))},onBlur:()=>{if(_===null)return;let e=parseInt(_,10),t=!Number.isFinite(e)||e<1?2:Math.min(23,Math.max(1,Math.round(e)));oe(t),y({intervalHours:t}),v(null)},"aria-label":n.intervalHours}),(0,w.jsx)(`span`,{className:`shrink-0 text-sm text-fg-muted`,children:n.hourUnit}),(0,w.jsx)(`select`,{className:c(E,`w-auto min-w-[4rem]`),disabled:r,value:l,onChange:e=>{let t=parseInt(e.target.value,10);se(t),y({minute:t})},"aria-label":n.minuteAtHour,children:Array.from({length:60},(e,t)=>(0,w.jsx)(`option`,{value:t,children:String(t).padStart(2,`0`)},t))}),(0,w.jsx)(`span`,{className:`shrink-0 text-sm text-fg-muted`,children:n.minuteUnit})]})]}),a===`daily`&&(0,w.jsx)(`input`,{type:`time`,step:60,disabled:r,className:D,value:b,onChange:x,"aria-label":n.scheduleTimeLabel}),a===`weekly`&&(0,w.jsx)(`input`,{type:`time`,step:60,disabled:r,className:D,value:b,onChange:x,"aria-label":n.scheduleTimeLabel}),a===`monthly`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`select`,{className:c(E,`w-auto min-w-[4.5rem]`),disabled:r,value:d,onChange:e=>{let t=parseInt(e.target.value,10);f(t),y({dayOfMonth:t})},"aria-label":n.dayOfMonth,children:Array.from({length:31},(e,t)=>t+1).map(e=>(0,w.jsx)(`option`,{value:e,children:e},e))}),(0,w.jsx)(`input`,{type:`time`,step:60,disabled:r,className:D,value:b,onChange:x,"aria-label":n.scheduleTimeLabel})]}),a===`hourly`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`select`,{className:c(E,`w-auto min-w-[4rem]`),disabled:r,value:l,onChange:e=>{let t=parseInt(e.target.value,10);se(t),y({minute:t})},"aria-label":n.minuteAtHour,children:Array.from({length:60},(e,t)=>(0,w.jsx)(`option`,{value:t,children:String(t).padStart(2,`0`)},t))}),(0,w.jsx)(`span`,{className:`shrink-0 text-sm text-fg-muted`,children:n.minuteUnit})]})]}),fe=a===`weekly`?(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1.5 pt-1`,role:`group`,"aria-label":n.modeWeekly,children:n.weekdays.map((e,t)=>{let n=u[t];return(0,w.jsx)(`button`,{type:`button`,disabled:r,className:c(`flex size-9 select-none items-center justify-center rounded-full border text-xs font-medium transition-colors`,n?`border-fg bg-fg text-surface-panel`:`border-edge-subtle bg-surface-panel text-fg hover:border-edge`),"aria-pressed":n,onClick:()=>{let e=[...u];e[t]=!e[t],ue(e),y({weekDays:e})},children:e},e)})}):null,pe=a===`custom`?(0,w.jsxs)(`div`,{className:`pt-1`,children:[(0,w.jsx)(`textarea`,{disabled:r,className:Ze,rows:2,spellCheck:!1,value:p,placeholder:`*/5 * * * *`,onChange:e=>{let n=e.target.value;m(n),t(n.trim()||`*/5 * * * *`)},"aria-label":n.modeCustom}),(0,w.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.customCronHint})]}):null;return(0,w.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.scheduleTimeLabel}),de,fe,pe]})}var rt=400;function it(e){let t=new Date(e);return t.setHours(0,0,0,0),t}function at(e){let t=it(e),n=t.getDay(),r=n===0?-6:1-n;return t.setDate(t.getDate()+r),t}function ot(e){return new Date(e.getFullYear(),e.getMonth(),1,0,0,0,0)}var st=`*/5 * * * *`,ct=`xopc.recentWorkspaceDirs.v1`,M=10;function lt(e){let t=e?.trim();t&&window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{sessionKey:t},bubbles:!0}))}function ut(e){let t=e.trim();if(t)try{let e=localStorage.getItem(ct),n=e?JSON.parse(e):[],r=[t,...(Array.isArray(n)?n.filter(e=>typeof e==`string`&&e.trim().length>0):[]).filter(e=>e!==t)].slice(0,M);localStorage.setItem(ct,JSON.stringify(r))}catch{}}function dt(e){return c(`w-full rounded-md border border-edge bg-surface-base px-3 py-2 text-sm text-fg placeholder:text-fg-disabled`,x,e&&`cursor-not-allowed opacity-60`)}function ft(){return c(b,y)}var pt=c(b,`w-full text-xs sm:w-auto sm:min-w-[11rem] sm:max-w-[17rem] sm:shrink-0`),mt=c(b,`w-auto min-w-[9rem] max-w-[14rem] shrink-0 text-xs`);function ht(){let e=a(e=>e.language),t=r(e),n=t.cron,y=t.chat,b=!!i(e=>e.token),x=de(e=>e.resolved)===`dark`,ke=e===`zh`?`zh-CN`:`en-US`,[C,qe]=(0,S.useState)([]),[T,E]=(0,S.useState)(`tasks`),[D,Xe]=(0,S.useState)(`created_desc`),[O,Ze]=(0,S.useState)(`day`),[Qe,k]=(0,S.useState)(``),[A,$e]=(0,S.useState)(``),[j,et]=(0,S.useState)(!1),tt=(0,S.useRef)(null),ct=(0,S.useRef)(j),M=typeof navigator<`u`&&`wakeLock`in navigator,[ht,gt]=(0,S.useState)([]),[_t,vt]=(0,S.useState)([]),[yt,bt]=(0,S.useState)(``),[xt,St]=(0,S.useState)([]),[Ct,wt]=(0,S.useState)([]),[Tt,Et]=(0,S.useState)(!1),[Dt,N]=(0,S.useState)(null),[Ot,kt]=(0,S.useState)([]),[P,At]=(0,S.useState)(!1),[F,jt]=(0,S.useState)(!1),[I,Mt]=(0,S.useState)(`add`),[Nt,Pt]=(0,S.useState)(null),[Ft,It]=(0,S.useState)(``),[Lt,Rt]=(0,S.useState)(st),[L,R]=(0,S.useState)(`local`),[zt,z]=(0,S.useState)(``),[B,V]=(0,S.useState)(``),[Bt,Vt]=(0,S.useState)(`edit`),[Ht,Ut]=(0,S.useState)(0),[H,Wt]=(0,S.useState)(`main`),[Gt,U]=(0,S.useState)(``),[Kt,W]=(0,S.useState)(!1),[G,K]=(0,S.useState)(``),[qt,Jt]=(0,S.useState)(!1),[Yt,q]=(0,S.useState)(``),[J,Xt]=(0,S.useState)(!1),Zt=(0,S.useRef)(!1),[Qt,$t]=(0,S.useState)(!1),[Y,en]=(0,S.useState)(null),[tn,nn]=(0,S.useState)([]),[rn,an]=(0,S.useState)(!1),[on,sn]=(0,S.useState)(!1),[cn,ln]=(0,S.useState)(null),[un,dn]=(0,S.useState)(null),[fn,pn]=(0,S.useState)(!1),[mn,hn]=(0,S.useState)(`all`),X=(0,S.useRef)(null),gn=(0,S.useCallback)(e=>{X.current=e,window.setTimeout(()=>{X.current===e&&(X.current=null)},400)},[]),Z=(0,S.useCallback)(()=>yt||(_t.length>0?_t[0].id:``),[yt,_t]),_n=typeof window<`u`&&!!window.electronAPI?.file?.openDirectory,vn=(0,S.useCallback)(async()=>{let e=typeof window<`u`?window.electronAPI?.file?.openDirectory:void 0;return e?e():null},[]),yn=(0,S.useCallback)(async e=>{let t=e.trim();t&&(ut(t),K(t))},[]),bn=(0,S.useMemo)(()=>{let e=new Set(Ct.map(e=>e.id)),t=[...Ct],n=Gt.trim().toLowerCase();return n&&!e.has(n)&&t.push({id:n}),t},[Ct,Gt]),xn=L!==`local`&&(H===`main`||H===`isolated`&&!Kt),Sn=H===`main`||H===`isolated`&&!Kt,Cn=!!Ft.trim()&&!!Lt.trim()&&!!B.trim()&&(!xn||!!zt.trim()),wn=(0,S.useCallback)(async()=>{At(!0);try{kt(await Te(rt))}catch{}finally{At(!1)}},[]),Q=(0,S.useCallback)(async()=>{Et(!0),N(null);try{qe(await Be())}catch(e){N(e instanceof Error?e.message:n.failedToLoadJobs)}finally{Et(!1)}},[n.failedToLoadJobs]),$=(0,S.useCallback)(async()=>{try{let[e,t,n,r]=await Promise.all([Ne(),be(),Ae(),_e().catch(()=>null)]);gt(e),vt(t),bt(n.model||``),r&&wt(r.items)}catch{}},[]);(0,S.useEffect)(()=>{b&&(Q(),$())},[b,Q,$]),(0,S.useEffect)(()=>{!b||T!==`history`||wn()},[b,T,wn]);let Tn=(0,S.useCallback)(async()=>{try{await tt.current?.release()}catch{}tt.current=null},[]),En=(0,S.useCallback)(async()=>{if(M)try{let e=await navigator.wakeLock.request(`screen`);tt.current=e,e.addEventListener(`release`,()=>{tt.current=null})}catch{N(n.wakeLockUnavailable),et(!1)}},[n.wakeLockUnavailable,M]);ct.current=j,(0,S.useEffect)(()=>{if(!j){Tn();return}En();let e=()=>{document.visibilityState===`visible`&&ct.current&&En()};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e),Tn()}},[j,En,Tn]),(0,S.useEffect)(()=>{if(!F||I!==`add`||Zt.current)return;let e=Z();e&&q(e)},[F,I,Z]),(0,S.useEffect)(()=>{!F||I!==`add`||new Set([`local`,...ht.map(e=>e.name)]).has(L)||R(`local`)},[ht,L,I,F]),(0,S.useEffect)(()=>{if(L===`local`){St([]);return}let e=!1;return Re(L).then(t=>{e||St(t)}),()=>{e=!0}},[L,F]);let Dn=(0,S.useCallback)(e=>{if(Zt.current=!1,jt(!0),Mt(e?`edit`:`add`),Pt(e?.id??null),e){It(e.name||``),Rt(e.schedule&&String(e.schedule).trim()||st);let t=we(e);V(t??``),Wt(e.sessionTarget||`main`),U((e.sessionTarget||`main`)===`isolated`&&e.agentId?.trim()?e.agentId.trim().toLowerCase():``),K((e.sessionTarget||`main`)===`isolated`&&e.workingDirectory?.trim()?e.workingDirectory.trim():``);let n=e.payload?.kind===`agentTurn`&&e.payload.model?.trim()?e.payload.model.trim():``;q(e.model?.trim()||n||Z());let r=e.delivery?.channel===`local`,i=(e.sessionTarget||`main`)===`isolated`&&!r&&(!e.delivery?.to||e.delivery.mode===`none`);if(W(i),r)R(`local`),z(``);else if(e.delivery&&e.delivery.mode!==`none`&&e.delivery.to)R(e.delivery.channel||`telegram`),z(e.delivery.to||``);else if(i)R(`telegram`),z(``);else{let e=t.split(`:`);e.length>=3&&[`telegram`,`cli`,`gateway`,`local`].includes(e[0])?(R(e[0]),z(e[1]),V(e.slice(2).join(`:`))):(R(`telegram`),z(``))}}else It(``),Rt(st),R(`local`),z(``),V(``),Wt(`main`),U(``),K(``),W(!1),q(Z());Vt(`edit`),Ut(e=>e+1)},[Z]),On=(0,S.useCallback)(e=>{Vt(e),e===`edit`&&Ut(e=>e+1)},[]),kn=(0,S.useCallback)(e=>{let n=Je(e),r=n?Ke(t.cron,e):void 0;!n||!r||(Zt.current=!1,Mt(`add`),Pt(null),It(r.title),Rt(n.defaultSchedule),V(r.prompt),Wt(n.defaultSessionTarget),R(`local`),z(``),W(!1),U(``),K(``),q(Z()),Vt(`edit`),Ut(e=>e+1),pn(!1),jt(!0))},[Z,t.cron]),An=(0,S.useCallback)(()=>{jt(!1),Mt(`add`),Pt(null),It(``),Rt(st),R(`local`),z(``),V(``),Wt(`main`),U(``),K(``),Jt(!1),W(!1),q(``),Vt(`edit`),Zt.current=!1},[]),jn=async()=>{if(!Ft.trim()){N(n.nameRequired);return}if(!Lt.trim()||!B.trim()){N(n.scheduleRequired);return}if(xn&&!zt.trim()){N(n.chatIdRequired);return}Xt(!0),N(null);try{let e=B.trim(),t;t=H===`isolated`&&Kt?{mode:`none`}:L===`local`?{mode:`direct`,channel:`local`}:{mode:`direct`,channel:L,to:zt.trim()};let n=H===`isolated`?{kind:`agentTurn`,message:e,...Yt.trim()?{model:Yt.trim()}:{}}:{kind:`systemEvent`,text:e},r=Yt.trim(),i=Gt.trim().toLowerCase(),a=H===`main`?null:i||null,o=G.trim(),s={name:Ft.trim(),schedule:Lt.trim(),sessionTarget:H,model:H===`isolated`&&r?r:void 0,delivery:t,payload:n,...I===`edit`?{agentId:a,workingDirectory:H===`isolated`&&o||null}:{...H===`isolated`&&i?{agentId:i}:{},...H===`isolated`&&o?{workingDirectory:o}:{}}};if(I===`edit`&&Nt)await ve(Nt,s);else{let{schedule:e,agentId:t,workingDirectory:n,...r}=s;await Le(e,{...r,...t==null?{}:{agentId:t},...n?{workingDirectory:n}:{}})}An(),await Q(),await $()}catch(e){N(e instanceof Error?e.message:I===`edit`?n.failedToUpdateJob:n.failedToCreateJob)}finally{Xt(!1)}},Mn=async e=>{$t(!0),en(e),an(!0),nn([]);try{let t=await Ee(e.id);t&&(en(t),nn(await De(e.id,20)))}catch{}finally{an(!1)}},Nn=async(e,t)=>{try{await ye(e.id,t),await Q(),await $()}catch(e){N(e instanceof Error?e.message:n.failedToToggleJob)}},Pn=async()=>{if(!un||!cn)return;let e=un,t=cn;sn(!1),dn(null),ln(null);try{t===`run`?await ze(e):(await Se(e),Y?.id===e&&($t(!1),en(null))),await Q(),await $(),await wn()}catch(e){N(e instanceof Error?e.message:n.actionFailed)}};(0,S.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(F?An():Qt&&($t(!1),en(null)))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[F,Qt,An]);let Fn={running:n.execStatusRunning,success:n.execStatusSuccess,failed:n.execStatusFailed,cancelled:n.execStatusCancelled},In=(0,S.useMemo)(()=>{let e=[...C];return e.sort((e,t)=>{let n=new Date(e.created_at).getTime(),r=new Date(t.created_at).getTime();return D===`created_desc`?r-n:n-r}),e},[C,D]),Ln=(0,S.useMemo)(()=>{let e=new Date,t=O===`day`?it(e):O===`week`?at(e):ot(e);return Ot.filter(e=>!(new Date(e.startedAt)<t||Qe&&e.jobId!==Qe||A&&e.status!==A))},[Ot,O,Qe,A]),Rn=n.scheduleBadge,zn=(0,S.useCallback)(()=>{Q(),$(),wn()},[Q,$,wn]),Bn=fe(e=>e.setPageHeader),Vn=fe(e=>e.clearPageHeader),{pathname:Hn}=o(),Un=Hn.startsWith(`/settings/`),Wn=(0,S.useMemo)(()=>(0,w.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center justify-end gap-2`,children:[(0,w.jsx)(v,{type:`button`,variant:`ghost`,className:`h-9 w-9 shrink-0 p-0`,disabled:Tt||P,title:n.refresh,"aria-label":n.refresh,onClick:()=>void zn(),children:(0,w.jsx)(d,{className:c(`size-4`,(Tt||P)&&`animate-spin`),strokeWidth:1.75})}),(0,w.jsxs)(v,{type:`button`,variant:`secondary`,className:`gap-2`,onClick:()=>{hn(`all`),pn(!0)},children:[(0,w.jsx)(re,{className:`size-4`,strokeWidth:1.75}),n.fromTemplate]}),(0,w.jsxs)(v,{type:`button`,variant:`primary`,className:`gap-2`,onClick:()=>Dn(),children:[(0,w.jsx)(ue,{className:`size-4`,strokeWidth:1.75}),n.addJob]})]}),[n.addJob,n.fromTemplate,n.refresh,Tt,Dn,zn,P]);return(0,S.useLayoutEffect)(()=>!b||Un?(Vn(),()=>Vn()):(Bn({startExtra:null,main:null,end:Wn}),()=>Vn()),[Vn,Wn,b,Un,Bn]),b?(0,w.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto bg-surface-panel`,children:[(0,w.jsxs)(`div`,{className:`mx-auto flex w-full max-w-app-main flex-col gap-6 px-4 py-6 sm:px-8`,children:[Dt?(0,w.jsx)(`div`,{className:`rounded-xl border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200`,role:`alert`,children:Dt}):null,(0,w.jsx)(`header`,{className:`flex flex-col gap-4`,children:(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-fg`,children:n.title}),(0,w.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm text-fg-muted`,children:n.subtitle})]})}),Un?(0,w.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 border-b border-edge-subtle pb-3 dark:border-edge-subtle`,children:Wn}):null,(0,w.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-edge-subtle pb-3 sm:flex-row sm:items-center sm:justify-between dark:border-edge-subtle`,children:[(0,w.jsxs)(`div`,{className:`flex gap-1`,role:`tablist`,"aria-label":n.title,children:[(0,w.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":T===`tasks`,className:c(`rounded-md px-3 py-2 text-sm font-medium transition-colors`,T===`tasks`?`text-fg`:`text-fg-muted hover:text-fg`),onClick:()=>E(`tasks`),children:n.tabMyTasks}),(0,w.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":T===`history`,className:c(`rounded-md px-3 py-2 text-sm font-medium transition-colors`,T===`history`?`text-fg`:`text-fg-muted hover:text-fg`),onClick:()=>E(`history`),children:n.tabRunHistory})]}),(0,w.jsx)(`div`,{className:c(`flex min-w-0 items-center gap-2`,T===`history`?`flex-nowrap overflow-x-auto pb-0.5 sm:justify-end`:`flex-wrap sm:justify-end`),children:T===`tasks`?(0,w.jsxs)(`select`,{className:mt,value:D,onChange:e=>Xe(e.target.value),"aria-label":n.sortCreatedDesc,children:[(0,w.jsx)(`option`,{value:`created_desc`,children:n.sortCreatedDesc}),(0,w.jsx)(`option`,{value:`created_asc`,children:n.sortCreatedAsc})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`div`,{className:c(me,`shrink-0`),role:`group`,"aria-label":n.runHistoryTitle,children:[`day`,`week`,`month`].map(e=>(0,w.jsx)(`button`,{type:`button`,className:c(pe,`px-2.5 py-1`,O===e&&`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,O===e&&`text-fg`),onClick:()=>Ze(e),children:e===`day`?n.historyRangeDay:e===`week`?n.historyRangeWeek:n.historyRangeMonth},e))}),(0,w.jsxs)(`select`,{className:mt,value:Qe,onChange:e=>k(e.target.value),"aria-label":n.filterAllTasks,children:[(0,w.jsx)(`option`,{value:``,children:n.filterAllTasks}),C.map(e=>(0,w.jsx)(`option`,{value:e.id,children:e.name||e.id},e.id))]}),(0,w.jsxs)(`select`,{className:mt,value:A,onChange:e=>$e(e.target.value),"aria-label":n.filterAllStatuses,children:[(0,w.jsx)(`option`,{value:``,children:n.filterAllStatuses}),(0,w.jsx)(`option`,{value:`success`,children:n.execStatusSuccess}),(0,w.jsx)(`option`,{value:`failed`,children:n.execStatusFailed}),(0,w.jsx)(`option`,{value:`cancelled`,children:n.execStatusCancelled}),(0,w.jsx)(`option`,{value:`running`,children:n.execStatusRunning})]})]})})]}),T===`tasks`?(0,w.jsxs)(`section`,{"aria-labelledby":`cron-tasks-panel`,className:`flex flex-col gap-4`,children:[(0,w.jsx)(`h2`,{id:`cron-tasks-panel`,className:`sr-only`,children:n.tabMyTasks}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl border border-accent/25 bg-accent/5 px-4 py-3 dark:border-accent/30 dark:bg-accent/10 sm:flex-row sm:items-center sm:justify-between`,children:[(0,w.jsxs)(`div`,{className:`flex gap-3 text-sm text-fg`,children:[(0,w.jsx)(le,{className:`mt-0.5 size-4 shrink-0 text-accent`,strokeWidth:1.75,"aria-hidden":!0}),(0,w.jsx)(`p`,{className:`text-pretty text-fg-muted`,children:n.wakeBanner})]}),(0,w.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 sm:pl-4`,children:[(0,w.jsx)(`span`,{className:`text-sm text-fg`,children:n.keepAwake}),(0,w.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":j,disabled:!M,title:M?void 0:n.wakeLockUnavailable,className:c(`inline-flex h-6 w-10 shrink-0 items-center rounded-full border border-edge p-0.5 transition-colors`,j?`justify-end bg-accent`:`justify-start bg-surface-hover`,!M&&`cursor-not-allowed opacity-50`),onClick:()=>{M?et(e=>!e):N(n.wakeLockUnavailable)},children:(0,w.jsx)(`span`,{className:`size-4 rounded-full bg-surface-panel shadow-surface ring-1 ring-edge/40 dark:ring-edge/55`})})]})]}),Tt&&C.length===0?(0,w.jsx)(`div`,{className:`flex justify-center py-16`,"aria-busy":`true`,children:(0,w.jsx)(u,{className:`size-8 animate-spin text-accent`,strokeWidth:1.75})}):C.length===0?(0,w.jsxs)(`div`,{className:`flex flex-col gap-6 rounded-2xl bg-surface-base px-4 py-8 dark:bg-surface-hover/25 sm:px-6 sm:py-10`,children:[(0,w.jsx)(`div`,{className:`w-full max-w-3xl`,children:(0,w.jsx)(Ye,{cron:n,localeTag:ke,scheduleBadgeLabels:Rn,categoryFilter:mn,onCategoryFilterChange:hn,onSelectTemplate:kn})}),(0,w.jsx)(`div`,{className:`flex justify-center`,children:(0,w.jsx)(v,{type:`button`,variant:`primary`,onClick:()=>Dn(),children:n.emptyStateCta})})]}):(0,w.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:In.map(e=>(0,w.jsxs)(`article`,{role:`button`,tabIndex:0,className:c(`flex cursor-pointer flex-col rounded-xl border border-edge-subtle bg-surface-base text-left transition-colors duration-150 ease-out dark:border-edge-subtle`,`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`),onClick:()=>{if(X.current===e.id){X.current=null;return}Mn(e)},onKeyDown:t=>{if(t.key===`Enter`||t.key===` `){if(t.preventDefault(),X.current===e.id){X.current=null;return}Mn(e)}},children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-2 px-4 pt-3`,children:[(0,w.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e.enabled,className:c(`inline-flex h-6 w-10 shrink-0 items-center rounded-full border border-edge p-0.5 transition-colors`,e.enabled?`justify-end bg-accent`:`justify-start bg-surface-hover`),onClick:t=>{t.stopPropagation(),Nn(e,!e.enabled)},children:(0,w.jsx)(`span`,{className:`size-4 rounded-full bg-surface-panel shadow-surface ring-1 ring-edge/40 dark:ring-edge/55`})}),(0,w.jsxs)(He,{children:[(0,w.jsx)(Ve,{asChild:!0,children:(0,w.jsx)(v,{type:`button`,variant:`ghost`,className:`h-8 w-8 shrink-0 p-0`,"aria-label":n.jobCardMenuAria,onClick:e=>e.stopPropagation(),children:(0,w.jsx)(se,{className:`size-4`,strokeWidth:1.75})})}),(0,w.jsx)(We,{children:(0,w.jsxs)(Ge,{className:`z-50 min-w-[10rem] rounded-xl border border-edge-subtle bg-surface-panel p-1 shadow-elevated dark:border-edge-subtle`,sideOffset:4,align:`end`,onCloseAutoFocus:e=>e.preventDefault(),children:[(0,w.jsx)(Ue,{className:`cursor-pointer select-none rounded-lg px-2 py-1.5 text-sm text-fg outline-none data-highlighted:bg-surface-hover`,onSelect:()=>{gn(e.id),Dn(e)},children:n.edit}),(0,w.jsx)(Ue,{className:`cursor-pointer select-none rounded-lg px-2 py-1.5 text-sm text-fg outline-none data-highlighted:bg-surface-hover`,onSelect:()=>{gn(e.id),ln(`run`),dn(e.id),sn(!0)},children:n.runNow}),(0,w.jsx)(Ue,{className:`cursor-pointer select-none rounded-lg px-2 py-1.5 text-sm text-red-600 outline-none data-highlighted:bg-red-500/10 dark:text-red-400`,onSelect:()=>{gn(e.id),ln(`delete`),dn(e.id),sn(!0)},children:n.delete})]})})]})]}),(0,w.jsxs)(`div`,{className:`flex flex-1 flex-col gap-2 px-4 pb-3 pt-2`,children:[(0,w.jsx)(`h3`,{className:`line-clamp-2 font-semibold text-fg`,children:e.name||e.id}),(0,w.jsx)(`div`,{className:`max-h-[4.5rem] overflow-hidden text-sm text-fg-muted [&_.markdown-body]:text-sm [&_.markdown-body]:leading-snug`,title:we(e),children:(0,w.jsx)(he,{content:we(e),compact:!0})})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-1.5 border-t border-edge-subtle/90 px-4 py-2.5 text-xs text-fg-muted dark:border-edge-subtle`,children:[(0,w.jsx)(l,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),(0,w.jsx)(`span`,{className:`min-w-0 truncate`,children:Me(e,ke,Rn)})]})]},e.id))})]}):(0,w.jsxs)(`section`,{"aria-labelledby":`cron-history-panel`,className:`flex flex-col gap-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h2`,{id:`cron-history-panel`,className:`sr-only`,children:n.tabRunHistory}),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.runHistoryHint})]}),(0,w.jsx)(v,{type:`button`,variant:`ghost`,className:`h-9 w-9 shrink-0 p-0`,disabled:P,title:n.refresh,"aria-label":n.refresh,onClick:()=>void wn(),children:(0,w.jsx)(d,{className:c(`size-4`,P&&`animate-spin`),strokeWidth:1.75})})]}),P&&Ot.length===0?(0,w.jsx)(`div`,{className:`flex justify-center py-16`,children:(0,w.jsx)(u,{className:`size-8 animate-spin text-accent`,strokeWidth:1.75})}):Ln.length===0?(0,w.jsxs)(`div`,{className:`flex flex-col items-center rounded-2xl border border-dashed border-edge-subtle px-6 py-16 text-center dark:border-edge-subtle`,children:[(0,w.jsx)(l,{className:`mb-4 size-14 text-fg-disabled`,strokeWidth:1.1,"aria-hidden":!0}),(0,w.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:Ot.length===0?n.emptyHistoryTitle:n.noRunsYet}),(0,w.jsx)(`p`,{className:`mt-2 max-w-sm text-sm text-fg-muted`,children:Ot.length===0?n.emptyHistoryHint:n.runHistoryHint})]}):(0,w.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-edge-subtle bg-surface-base dark:border-edge-subtle`,children:(0,w.jsxs)(`table`,{className:`w-full min-w-[700px] border-collapse text-left text-sm`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-edge text-xs font-medium text-fg-muted`,children:[(0,w.jsx)(`th`,{className:`px-3 py-2.5 font-medium`,children:n.colStarted}),(0,w.jsx)(`th`,{className:`px-3 py-2.5 font-medium`,children:n.colJob}),(0,w.jsx)(`th`,{className:`px-3 py-2.5 font-medium`,children:n.status}),(0,w.jsx)(`th`,{className:`px-3 py-2.5 font-medium`,children:n.colDuration}),(0,w.jsx)(`th`,{className:`px-3 py-2.5 font-medium`,children:n.colDetail}),(0,w.jsx)(`th`,{className:`px-3 py-2.5 font-medium`,children:n.colChat})]})}),(0,w.jsx)(`tbody`,{children:Ln.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-edge/60 last:border-0`,children:[(0,w.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2.5 text-fg`,children:(0,w.jsx)(`time`,{dateTime:e.startedAt,children:Fe(e.startedAt)})}),(0,w.jsx)(`td`,{className:`max-w-[10rem] truncate px-3 py-2.5`,children:C.some(t=>t.id===e.jobId)?(0,w.jsx)(`button`,{type:`button`,className:`text-left text-accent hover:underline`,onClick:()=>{let t=C.find(t=>t.id===e.jobId);t&&Mn(t)},children:e.jobName||e.jobId}):(0,w.jsx)(`span`,{className:`text-fg-muted`,children:e.jobName||e.jobId})}),(0,w.jsx)(`td`,{className:`px-3 py-2.5`,children:(0,w.jsx)(`span`,{className:c(`inline-flex rounded-md px-2 py-0.5 text-xs font-medium`,e.status===`success`&&`bg-emerald-500/15 text-emerald-800 dark:text-emerald-300`,e.status===`failed`&&`bg-red-500/15 text-red-800 dark:text-red-300`,e.status===`running`&&`bg-accent/15 text-accent`,e.status===`cancelled`&&`bg-surface-hover text-fg-muted`),children:Ie(e.status,Fn)})}),(0,w.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2.5 text-fg-muted`,children:Pe(e.duration)}),(0,w.jsx)(`td`,{className:`max-w-xs truncate px-3 py-2.5 text-fg-muted`,title:e.summary||e.error||``,children:Ce(e.summary||e.error,96)}),(0,w.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2.5`,children:e.sessionKey?.trim()?(0,w.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-accent hover:underline`,title:n.openChatTitle,"aria-label":n.openChatTitle,onClick:()=>lt(e.sessionKey),children:n.openChat}):(0,w.jsx)(`span`,{className:`text-fg-disabled`,children:`—`})})]},e.id))})]})})]})]}),(0,w.jsx)(h,{open:F,onOpenChange:e=>!e&&An(),children:(0,w.jsxs)(f,{children:[(0,w.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),(0,w.jsx)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center p-4 pointer-events-none`,children:(0,w.jsxs)(m,{className:`xopc-dialog-content-pane pointer-events-auto relative flex max-h-[min(90vh,800px)] w-full max-w-md flex-col rounded-xl border border-edge bg-surface-panel shadow-popover outline-none sm:max-w-lg lg:max-w-xl dark:border-edge`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,w.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[(0,w.jsx)(g,{className:`text-base font-semibold text-fg`,children:I===`edit`?n.editJob:n.addJob}),(0,w.jsx)(_,{asChild:!0,children:(0,w.jsx)(v,{type:`button`,variant:`ghost`,className:`h-9 w-9 shrink-0 p-0`,"aria-label":n.close,children:(0,w.jsx)(s,{className:`size-5`,strokeWidth:1.75})})})]}),(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,w.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.name}),(0,w.jsx)(`input`,{type:`text`,className:dt(),value:Ft,onChange:e=>It(e.target.value),placeholder:n.namePlaceholder})]}),(0,w.jsx)(nt,{value:Lt,onChange:Rt,disabled:J,labels:n.schedulePicker}),(0,w.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.mode}),(0,w.jsxs)(`select`,{className:ft(),value:H,onChange:e=>{let t=e.target.value;Wt(t),t===`main`?(W(!1),U(``),K(``)):t===`isolated`&&!Yt.trim()&&q(Z())},children:[(0,w.jsx)(`option`,{value:`main`,children:n.modeDirectOption}),(0,w.jsx)(`option`,{value:`isolated`,children:n.modeAgentOption})]}),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:H===`main`?n.modeDirect:n.modeAgent})]}),H===`isolated`?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.model}),(0,w.jsx)(oe,{value:Yt,placeholder:y.modelPlaceholder,searchPlaceholder:y.modelSearchPlaceholder,noMatches:y.modelNoMatches,className:`w-full max-w-none min-w-0`,popoverContentClassName:`z-[70]`,onChange:e=>{Zt.current=!0,q(e)}})]}),(0,w.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.agentProfile}),(0,w.jsxs)(`select`,{className:ft(),value:Gt,disabled:J,onChange:e=>U(e.target.value),children:[(0,w.jsx)(`option`,{value:``,children:n.agentProfileDefault}),bn.map(e=>(0,w.jsx)(`option`,{value:e.id,children:e.name?`${e.id} — ${e.name}`:e.id},e.id))]}),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.agentProfileHint})]}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.workingDirectoryLabel}),(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsxs)(`button`,{type:`button`,disabled:J,className:c(`inline-flex min-h-8 max-w-[min(16rem,48vw)] min-w-0 shrink-0 items-center gap-1 rounded-lg px-2 py-1 text-xs`,`border border-edge-subtle/80 bg-surface-hover/40 dark:border-edge-subtle`,ge.transition,ge.focusRingPanel,`cursor-pointer hover:bg-surface-hover/70 dark:hover:bg-surface-hover/50`,J&&`cursor-not-allowed opacity-60`),title:G.trim()?`${G.trim()}\n${y.workingDirectory.chooseFolder}`:`${n.workingDirectoryHint}\n${y.workingDirectory.selectWorkingDirectory}`,onClick:e=>{e.stopPropagation(),!J&&(_n?(async()=>{let e=await vn();e&&yn(e)})():Jt(!0))},children:[(0,w.jsx)(ee,{className:`size-3.5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,w.jsx)(`span`,{className:`min-w-0 truncate text-left font-medium text-fg`,children:G.trim()?te(G.trim()):y.workingDirectory.notSet})]}),G.trim()?(0,w.jsx)(`button`,{type:`button`,disabled:J,className:`text-xs font-medium text-accent hover:underline disabled:opacity-50`,onClick:()=>K(``),children:n.workingDirectoryReset}):null]}),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.workingDirectoryHint})]}),(0,w.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-md bg-surface-hover/45 px-3 py-2 dark:bg-surface-hover/30`,children:[(0,w.jsx)(`input`,{type:`checkbox`,className:c(`ui-checkbox`,`mt-0.5`),checked:Kt,onChange:e=>W(e.target.checked)}),(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:n.agentLocalOnly}),(0,w.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.agentLocalOnlyHint})]})]})]}):null,Sn?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.channel}),(0,w.jsxs)(`select`,{className:ft(),value:L,onChange:e=>{let t=e.target.value;R(t),t===`local`&&W(!1),z(``)},children:[(0,w.jsx)(`option`,{value:`local`,children:n.channelLocal}),ht.map(e=>(0,w.jsxs)(`option`,{value:e.name,disabled:!e.enabled,children:[e.name,` `,e.enabled?``:`(disabled)`]},e.name))]})]}),xn?(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.recipient}),(0,w.jsxs)(v,{type:`button`,variant:`ghost`,className:`h-7 gap-1 px-2 text-xs`,title:n.refreshRecipientHint,onClick:()=>void Re(L).then(St),children:[(0,w.jsx)(d,{className:`size-3.5`,strokeWidth:1.75}),n.refreshList]})]}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-stretch sm:gap-2`,children:[(0,w.jsx)(`input`,{type:`text`,className:c(dt(),`min-w-0 w-full sm:flex-1`),value:zt,onChange:e=>z(e.target.value),placeholder:n.recipientPlaceholder}),(0,w.jsxs)(`select`,{className:pt,value:zt,onChange:e=>{let t=e.target.value;t&&z(t)},children:[(0,w.jsx)(`option`,{value:``,children:n.selectRecipient}),xt.length>0?xt.map(e=>(0,w.jsx)(`option`,{value:e.chatId,children:xe(e,n.lastActiveLabels)},`${e.channel}-${e.chatId}`)):(0,w.jsx)(`option`,{value:``,disabled:!0,children:n.noRecentChatsOption})]})]}),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:xt.length>0?n.enterManuallyOrSelect:n.noRecentChats})]}):null]}):null,(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.message}),(0,w.jsxs)(`div`,{className:`inline-flex rounded-lg border border-edge bg-surface-base p-0.5 dark:border-edge`,children:[(0,w.jsxs)(`button`,{type:`button`,className:c(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium`,Bt===`edit`?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover`),onClick:()=>On(`edit`),children:[(0,w.jsx)(ie,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),n.messageEdit]}),(0,w.jsxs)(`button`,{type:`button`,className:c(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium`,Bt===`preview`?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover`),onClick:()=>On(`preview`),children:[(0,w.jsx)(ce,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),n.messagePreview]})]})]}),(0,w.jsx)(`div`,{className:c(`overflow-hidden rounded-md border border-edge bg-surface-base dark:border-edge`,J&&`pointer-events-none opacity-60`),children:Bt===`edit`?(0,w.jsx)(ae,{initialContent:B,onChange:V,isDark:x,className:`h-[min(18rem,40vh)] min-h-[12rem]`},`cron-msg-${Nt??`new`}-${Ht}`):(0,w.jsx)(`div`,{className:`h-[min(18rem,40vh)] min-h-[12rem] max-h-[min(24rem,50vh)] overflow-y-auto px-3 py-2`,children:B.trim()?(0,w.jsx)(he,{content:B,compact:!0,className:`text-sm`}):(0,w.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.messagePlaceholder})})}),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.messageMarkdownHint})]})]})}),(0,w.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-4 py-3`,children:[(0,w.jsx)(v,{type:`button`,variant:`secondary`,onClick:An,children:n.cancel}),(0,w.jsx)(v,{type:`button`,variant:`primary`,disabled:J||!Cn,onClick:()=>void jn(),children:J?n.loading:I===`edit`?n.save:n.create})]})]})})]})}),_n?null:(0,w.jsx)(ne,{open:qt,onOpenChange:Jt,initialAbsolutePath:G.trim()||void 0,onConfirm:async e=>{await yn(e),Jt(!1)},wd:y.workingDirectory}),(0,w.jsx)(h,{open:fn,onOpenChange:e=>{pn(e),e&&hn(`all`)},children:(0,w.jsxs)(f,{children:[(0,w.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[62] bg-scrim`}),(0,w.jsx)(`div`,{className:`fixed inset-0 z-[62] flex items-center justify-center p-4 pointer-events-none`,children:(0,w.jsxs)(m,{className:`xopc-dialog-content-pane pointer-events-auto relative flex max-h-[min(90vh,840px)] w-full max-w-lg flex-col rounded-xl border border-edge bg-surface-panel shadow-popover outline-none sm:max-w-2xl dark:border-edge`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,w.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end border-b border-edge px-4 py-3`,children:[(0,w.jsx)(g,{className:`sr-only`,children:n.fromTemplate}),(0,w.jsx)(_,{asChild:!0,children:(0,w.jsx)(v,{type:`button`,variant:`ghost`,className:`h-9 w-9 shrink-0 p-0`,"aria-label":n.close,children:(0,w.jsx)(s,{className:`size-5`,strokeWidth:1.75})})})]}),(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,children:(0,w.jsx)(Ye,{cron:n,localeTag:ke,scheduleBadgeLabels:Rn,categoryFilter:mn,onCategoryFilterChange:hn,onSelectTemplate:kn})})]})})]})}),(0,w.jsx)(h,{open:Qt,onOpenChange:e=>{e||($t(!1),en(null))},children:(0,w.jsxs)(f,{children:[(0,w.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),(0,w.jsxs)(m,{className:c(`xopc-drawer-right fixed right-0 top-0 z-[60] flex h-full w-full max-w-lg flex-col border-l border-edge bg-surface-panel shadow-popover outline-none`,`dark:border-edge`),"aria-describedby":void 0,children:[(0,w.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[(0,w.jsx)(g,{className:`min-w-0 truncate text-base font-semibold text-fg`,children:Y?.name?.trim()||Y?.id||`—`}),(0,w.jsx)(_,{asChild:!0,children:(0,w.jsx)(v,{type:`button`,variant:`ghost`,className:`h-9 w-9 shrink-0 p-0`,"aria-label":n.close,children:(0,w.jsx)(s,{className:`size-5`,strokeWidth:1.75})})})]}),(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:rn?(0,w.jsx)(`div`,{className:`flex justify-center py-16`,children:(0,w.jsx)(u,{className:`size-8 animate-spin text-accent`,strokeWidth:1.75})}):Y?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.scheduleLabel}),(0,w.jsx)(`dd`,{className:`mt-1 font-mono text-fg`,children:(0,w.jsx)(`code`,{children:Y.schedule})})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.messageLabel}),(0,w.jsx)(`dd`,{className:`mt-1 min-w-0 break-words text-fg`,children:(0,w.jsx)(he,{content:we(Y),compact:!0,className:`text-sm`})})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.mode}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:Y.sessionTarget===`isolated`?n.modeAgentOption:n.modeDirectOption})]}),Y.sessionTarget===`isolated`?(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.agentProfile}),(0,w.jsx)(`dd`,{className:`mt-1 font-mono text-sm text-fg`,children:Y.agentId?.trim()?Y.agentId.trim():n.agentProfileDefault})]}):null,Y.sessionTarget===`isolated`?(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.workingDirectoryLabel}),(0,w.jsx)(`dd`,{className:`mt-1 break-all font-mono text-xs text-fg`,children:Y.workingDirectory?.trim()?Y.workingDirectory.trim():y.workingDirectory.notSet})]}):null,Y.delivery?.channel===`local`||Y.sessionTarget===`isolated`&&!Y.delivery?.to?(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.deliveryTarget}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:Y.delivery?.channel===`local`?n.deliveryTargetLocalChannel:n.deliveryLocalOnly})]}):Y.delivery?.to?(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.deliveryTarget}),(0,w.jsxs)(`dd`,{className:`mt-1 break-words text-fg`,children:[(0,w.jsx)(`code`,{className:`text-xs`,children:Y.delivery?.channel??``}),` → `,je(Y,n.channelLocal)]})]}):null,(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.status}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:Y.enabled?n.enabled:n.disabled})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.nextRun}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:Y.next_run?Oe(Y.next_run,n.timeLabels):`—`})]})]}),(0,w.jsx)(`h3`,{className:`mt-6 text-sm font-semibold text-fg`,children:n.detailRunHistory}),tn.length===0?(0,w.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:n.noRunsYet}):(0,w.jsx)(`div`,{className:`mt-2 overflow-x-auto`,children:(0,w.jsxs)(`table`,{className:`w-full border-collapse text-left text-xs`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-edge text-fg-muted`,children:[(0,w.jsx)(`th`,{className:`py-1.5 pr-2 font-medium`,children:n.colStarted}),(0,w.jsx)(`th`,{className:`py-1.5 pr-2 font-medium`,children:n.status}),(0,w.jsx)(`th`,{className:`py-1.5 pr-2 font-medium`,children:n.colDuration}),(0,w.jsx)(`th`,{className:`py-1.5 pr-2 font-medium`,children:n.colDetail}),(0,w.jsx)(`th`,{className:`py-1.5 font-medium`,children:n.colChat})]})}),(0,w.jsx)(`tbody`,{children:tn.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-edge/60`,children:[(0,w.jsx)(`td`,{className:`whitespace-nowrap py-1.5 pr-2 text-fg`,children:(0,w.jsx)(`time`,{dateTime:e.startedAt,children:Fe(e.startedAt)})}),(0,w.jsx)(`td`,{className:`py-1.5 pr-2`,children:(0,w.jsx)(`span`,{className:c(`inline-flex rounded px-1.5 py-0.5 font-medium`,e.status===`success`&&`bg-emerald-500/15 text-emerald-800 dark:text-emerald-300`,e.status===`failed`&&`bg-red-500/15 text-red-800 dark:text-red-300`),children:Ie(e.status,Fn)})}),(0,w.jsx)(`td`,{className:`py-1.5 pr-2 text-fg-muted`,children:Pe(e.duration)}),(0,w.jsx)(`td`,{className:`max-w-[8rem] truncate py-1.5 pr-2 text-fg-muted`,title:e.summary||e.error||``,children:Ce(e.summary||e.error,120)}),(0,w.jsx)(`td`,{className:`whitespace-nowrap py-1.5`,children:e.sessionKey?.trim()?(0,w.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-accent hover:underline`,title:n.openChatTitle,"aria-label":n.openChatTitle,onClick:()=>lt(e.sessionKey),children:n.openChat}):(0,w.jsx)(`span`,{className:`text-fg-disabled`,children:`—`})})]},e.id))})]})})]}):null})]})]})}),(0,w.jsx)(h,{open:on,onOpenChange:sn,children:(0,w.jsxs)(f,{children:[(0,w.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim`}),(0,w.jsx)(`div`,{className:`fixed inset-0 z-[70] flex items-center justify-center p-4 pointer-events-none`,children:(0,w.jsxs)(m,{className:`xopc-dialog-content-pane pointer-events-auto relative w-full max-w-md rounded-xl border border-edge bg-surface-panel p-4 shadow-popover dark:border-edge`,children:[(0,w.jsx)(g,{className:`text-base font-semibold text-fg`,children:cn===`delete`?n.delete:n.runNow}),(0,w.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:cn===`delete`?n.confirmDelete:n.confirmRun}),(0,w.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,w.jsx)(v,{type:`button`,variant:`secondary`,onClick:()=>{sn(!1),dn(null),ln(null)},children:n.cancel}),(0,w.jsx)(v,{type:`button`,variant:`primary`,className:cn===`delete`?`bg-red-600 hover:bg-red-700`:void 0,onClick:()=>void Pn(),children:cn===`delete`?n.delete:n.runNow})]})]})})]})})]}):(0,w.jsx)(`div`,{className:`mx-auto w-full max-w-app-main px-4 py-16 text-center text-sm text-fg-muted sm:px-8`,children:n.needToken})}export{ht as CronPage};
|
|
2
|
-
//# sourceMappingURL=cron-page-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{i as t,t as n}from"./vendor-react-QAsRxa6t.js";import{l as r,o as i,s as a}from"./url-D7yWllI8.js";import{c as o}from"./chunk-QFMPRPBF-DOYp8d2p.js";import{n as s,t as c}from"./cn-DPF56z7S.js";import{c as ee,n as te,r as ne,s as re}from"./session-working-directory-control-DKOtWs3-.js";import{c as ie,n as ae,t as oe,u as l}from"./model-selector-BLiY_O25.js";import{t as se}from"./ellipsis-vertical-BJP8MSr5.js";import{i as ce}from"./gateway-config-swr-Cph02QZn.js";import{t as le}from"./info-Ccltk00r.js";import{t as u}from"./loader-circle-B2bCE4iI.js";import{t as ue}from"./plus-CBODkzSX.js";import{t as d}from"./refresh-cw-D7hzzeQ5.js";import{a as f,i as p,n as m,o as h,s as g,t as _}from"./dist-Db1dcLr9.js";import{t as v}from"./button-CRQ9eQGX.js";import{i as y,o as b,r as x}from"./form-field-width-BlpNwrfn.js";import{i as de}from"./theme-store-CywXkKml.js";import{t as fe}from"./page-header-store-BFpnFTed.js";import{n as pe,r as me}from"./segmented-styles-DEG4J-_P.js";import{t as he}from"./markdown-view-BpEqr7_J.js";import{n as ge}from"./interaction-C4gx-xSs.js";import{t as _e}from"./chat-agents-api-BhqjQ7iL.js";import{C as ve,S as ye,_ as be,a as xe,b as Se,c as Ce,d as we,f as Te,g as Ee,h as De,i as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as Ie,u as Le,v as Re,x as ze,y as Be}from"./cron-utils-Dkj-Ldpf.js";import{a as Ve,i as He,n as Ue,r as We,t as Ge}from"./dist-1vucfpMU.js";var S=e(t(),1);function Ke(e,t){let n=e.templates;if(!n||typeof n!=`object`)return;let r=n[t];if(!r||typeof r!=`object`)return;let i=r.title?.trim(),a=r.prompt?.trim();if(!(!i||!a))return{title:i,description:(r.description??``).trim(),prompt:a}}var C=[`daily`,`monitoring`,`reports`,`automation`],qe=[{templateId:`morning_briefing`,category:`daily`,defaultSchedule:`0 7 * * 1-5`,defaultSessionTarget:`isolated`},{templateId:`standup_prep`,category:`daily`,defaultSchedule:`0 8 * * 1-5`,defaultSessionTarget:`isolated`},{templateId:`end_of_day_wrap_up`,category:`daily`,defaultSchedule:`0 18 * * 1-5`,defaultSessionTarget:`isolated`},{templateId:`inbox_triage`,category:`daily`,defaultSchedule:`30 8 * * 1-5`,defaultSessionTarget:`isolated`},{templateId:`competitor_watch`,category:`monitoring`,defaultSchedule:`0 9 * * 1`,defaultSessionTarget:`isolated`},{templateId:`trending_topics_monitor`,category:`monitoring`,defaultSchedule:`0 10 * * 1-5`,defaultSessionTarget:`isolated`},{templateId:`tech_radar_stack`,category:`monitoring`,defaultSchedule:`0 11 * * 3`,defaultSessionTarget:`isolated`},{templateId:`dependency_check_audit`,category:`monitoring`,defaultSchedule:`0 9 * * 0`,defaultSessionTarget:`isolated`},{templateId:`weekly_review`,category:`reports`,defaultSchedule:`0 17 * * 5`,defaultSessionTarget:`isolated`},{templateId:`code_quality_report`,category:`reports`,defaultSchedule:`0 14 * * 1`,defaultSessionTarget:`isolated`},{templateId:`git_activity_summary`,category:`reports`,defaultSchedule:`0 9 * * 1`,defaultSessionTarget:`isolated`},{templateId:`user_feedback_digest`,category:`reports`,defaultSchedule:`0 16 * * 5`,defaultSessionTarget:`isolated`},{templateId:`stale_todo_or_issue_sweep`,category:`automation`,defaultSchedule:`0 10 * * 2`,defaultSessionTarget:`isolated`},{templateId:`release_notes_or_changelog_draft`,category:`automation`,defaultSchedule:`0 10 * * 4`,defaultSessionTarget:`isolated`},{templateId:`workspace_cleanup_suggestions`,category:`automation`,defaultSchedule:`30 18 * * 5`,defaultSessionTarget:`isolated`},{templateId:`smoke_or_ci_health_reminder`,category:`automation`,defaultSchedule:`0 8 * * 1`,defaultSessionTarget:`isolated`}];function Je(e){return qe.find(t=>t.templateId===e)}var w=n();function Ye(e){let{cron:t,localeTag:n,scheduleBadgeLabels:r,categoryFilter:i,onCategoryFilterChange:a,onSelectTemplate:o}=e,s=i===`all`?[...qe]:qe.filter(e=>e.category===i);return(0,w.jsxs)(`div`,{className:`flex w-full flex-col gap-4`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-2`,role:`group`,"aria-label":t.fromTemplate,children:[(0,w.jsx)(v,{type:`button`,variant:i===`all`?`secondary`:`ghost`,className:`h-8 rounded-full px-3 py-1.5 text-xs`,onClick:()=>a(`all`),children:t.templateFilterAll}),C.map(e=>(0,w.jsx)(v,{type:`button`,variant:i===e?`secondary`:`ghost`,className:`h-8 rounded-full px-3 py-1.5 text-xs`,onClick:()=>a(e),children:t.templateCategories[e]},e))]}),s.length===0?(0,w.jsx)(`p`,{className:`text-center text-sm text-fg-muted`,children:t.templatesEmptyHint}):(0,w.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:s.map(e=>{let i=Ke(t,e.templateId);if(!i)return null;let a=Me({schedule:e.defaultSchedule,timezone:void 0,next_run:void 0},n,r);return(0,w.jsxs)(`button`,{type:`button`,className:c(`flex flex-col gap-1.5 rounded-xl border border-edge-subtle bg-surface-base p-4 text-left transition-colors`,`hover:border-accent/40 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`),onClick:()=>o(e.templateId),"aria-label":`${t.templateCategories[e.category]} — ${i.title}`,children:[(0,w.jsx)(`span`,{className:`font-semibold text-fg`,children:i.title}),(0,w.jsx)(`span`,{className:`line-clamp-2 text-sm text-fg-muted`,children:i.description}),(0,w.jsx)(`span`,{className:`mt-1 flex items-center gap-1 text-xs text-fg-muted`,children:(0,w.jsx)(`span`,{className:`tabular-nums`,children:a})})]},e.templateId)})})]})}var T=ke(),E=c(b,`min-w-0 shrink text-xs sm:min-w-[7rem] sm:max-w-[11rem]`),D=c(`h-9 min-w-[6.5rem] shrink-0 rounded-lg border border-edge-subtle bg-surface-panel px-2 py-1.5 text-sm text-fg`,x,`dark:bg-surface-panel`),Xe=c(`h-9 min-w-[9.5rem] shrink-0 rounded-lg border border-edge-subtle bg-surface-panel px-2 py-1.5 text-sm text-fg`,x),O=c(`h-9 w-14 shrink-0 rounded-lg border border-edge-subtle bg-surface-panel px-2 py-1.5 text-center text-sm tabular-nums text-fg`,x),Ze=c(`min-h-[2.5rem] w-full rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 font-mono text-xs text-fg`,x);function Qe(){let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function k(e){return Array.isArray(e)?e.filter(e=>typeof e==`number`).sort((e,t)=>e-t):[]}function A(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 $e(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 j(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 et(e){let t=e.trim(),n={mode:`custom`,intervalKind:`minutes`,onceDate:Qe(),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=T.CronExpressionParser.parse(t).fields,r=k(e.minute.values),i=k(e.hour.values),a=k(e.dayOfMonth.values),o=k(e.month.values),s=k(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=A(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=A(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],ee=`${e}-${String(s).padStart(2,`0`)}-${String(c).padStart(2,`0`)}`;return{...n,mode:`no_repeat`,minute:r[0],hour:i[0],onceDate:ee,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:j(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 tt(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)} * * ${$e(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 nt({value:e,onChange:t,labels:n,disabled:r}){let i=(0,S.useMemo)(()=>et(e),[e]),[a,o]=(0,S.useState)(i.mode),[s,ee]=(0,S.useState)(i.intervalKind),[te,ne]=(0,S.useState)(i.onceDate),[re,ie]=(0,S.useState)(i.intervalMinutes),[ae,oe]=(0,S.useState)(i.intervalHours),[l,se]=(0,S.useState)(i.minute),[ce,le]=(0,S.useState)(i.hour),[u,ue]=(0,S.useState)(i.weekDays),[d,f]=(0,S.useState)(i.dayOfMonth),[p,m]=(0,S.useState)(i.rawCron),[h,g]=(0,S.useState)(null),[_,v]=(0,S.useState)(null);(0,S.useEffect)(()=>{let t=et(e);o(t.mode),ee(t.intervalKind),ne(t.onceDate),ie(t.intervalMinutes),oe(t.intervalHours),se(t.minute),le(t.hour),ue(t.weekDays),f(t.dayOfMonth),m(t.rawCron),g(null),v(null)},[e]);let y=(0,S.useCallback)(e=>{t(tt({mode:a,intervalKind:s,onceDate:te,intervalMinutes:re,intervalHours:ae,minute:l,hour:ce,weekDays:u,dayOfMonth:d,rawCron:p,...e}))},[a,s,te,re,ae,l,ce,u,d,p,t]),b=`${String(ce).padStart(2,`0`)}:${String(l).padStart(2,`0`)}`,x=e=>{let t=e.target.value;if(!t)return;let[n,r]=t.split(`:`).map(e=>parseInt(e,10));Number.isNaN(n)||Number.isNaN(r)||y({minute:r,hour:n})},de=(0,w.jsxs)(`div`,{className:`flex min-w-0 flex-nowrap items-center gap-2 overflow-x-auto pb-0.5`,children:[(0,w.jsxs)(`select`,{className:E,disabled:r,value:a,onChange:e=>{let t=e.target.value;o(t),y({mode:t})},"aria-label":n.scheduleTimeLabel,children:[(0,w.jsx)(`option`,{value:`no_repeat`,children:n.modeNoRepeat}),(0,w.jsx)(`option`,{value:`interval`,children:n.modeInterval}),(0,w.jsx)(`option`,{value:`hourly`,children:n.modeHourly}),(0,w.jsx)(`option`,{value:`daily`,children:n.modeDaily}),(0,w.jsx)(`option`,{value:`weekly`,children:n.modeWeekly}),(0,w.jsx)(`option`,{value:`monthly`,children:n.modeMonthly}),(0,w.jsx)(`option`,{value:`custom`,children:n.modeCustom})]}),a===`no_repeat`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`input`,{type:`date`,disabled:r,className:Xe,value:te,onChange:e=>{let t=e.target.value;ne(t),y({onceDate:t})},"aria-label":n.modeNoRepeat}),(0,w.jsx)(`input`,{type:`time`,step:60,disabled:r,className:D,value:b,onChange:x,"aria-label":n.scheduleTimeLabel})]}),a===`interval`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`select`,{className:c(E,`w-auto min-w-[5rem]`),disabled:r,value:s,onChange:e=>{let t=e.target.value;ee(t),g(null),v(null),y({intervalKind:t})},"aria-label":n.modeInterval,children:[(0,w.jsx)(`option`,{value:`minutes`,children:n.intervalKindMinutes}),(0,w.jsx)(`option`,{value:`hours`,children:n.intervalKindHours})]}),s===`minutes`?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`input`,{type:`number`,min:1,max:59,disabled:r,className:O,value:h??String(re),onChange:e=>{let t=e.target.value;g(t);let n=parseInt(t,10);Number.isFinite(n)&&n>=1&&n<=59&&(ie(n),y({intervalMinutes:n}))},onBlur:()=>{if(h===null)return;let e=parseInt(h,10),t=!Number.isFinite(e)||e<1?5:Math.min(59,Math.max(1,Math.round(e)));ie(t),y({intervalMinutes:t}),g(null)},"aria-label":n.intervalMinutes}),(0,w.jsx)(`span`,{className:`shrink-0 text-sm text-fg-muted`,children:n.minuteUnit})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`input`,{type:`number`,min:1,max:23,disabled:r,className:O,value:_??String(ae),onChange:e=>{let t=e.target.value;v(t);let n=parseInt(t,10);Number.isFinite(n)&&n>=1&&n<=23&&(oe(n),y({intervalHours:n}))},onBlur:()=>{if(_===null)return;let e=parseInt(_,10),t=!Number.isFinite(e)||e<1?2:Math.min(23,Math.max(1,Math.round(e)));oe(t),y({intervalHours:t}),v(null)},"aria-label":n.intervalHours}),(0,w.jsx)(`span`,{className:`shrink-0 text-sm text-fg-muted`,children:n.hourUnit}),(0,w.jsx)(`select`,{className:c(E,`w-auto min-w-[4rem]`),disabled:r,value:l,onChange:e=>{let t=parseInt(e.target.value,10);se(t),y({minute:t})},"aria-label":n.minuteAtHour,children:Array.from({length:60},(e,t)=>(0,w.jsx)(`option`,{value:t,children:String(t).padStart(2,`0`)},t))}),(0,w.jsx)(`span`,{className:`shrink-0 text-sm text-fg-muted`,children:n.minuteUnit})]})]}),a===`daily`&&(0,w.jsx)(`input`,{type:`time`,step:60,disabled:r,className:D,value:b,onChange:x,"aria-label":n.scheduleTimeLabel}),a===`weekly`&&(0,w.jsx)(`input`,{type:`time`,step:60,disabled:r,className:D,value:b,onChange:x,"aria-label":n.scheduleTimeLabel}),a===`monthly`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`select`,{className:c(E,`w-auto min-w-[4.5rem]`),disabled:r,value:d,onChange:e=>{let t=parseInt(e.target.value,10);f(t),y({dayOfMonth:t})},"aria-label":n.dayOfMonth,children:Array.from({length:31},(e,t)=>t+1).map(e=>(0,w.jsx)(`option`,{value:e,children:e},e))}),(0,w.jsx)(`input`,{type:`time`,step:60,disabled:r,className:D,value:b,onChange:x,"aria-label":n.scheduleTimeLabel})]}),a===`hourly`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`select`,{className:c(E,`w-auto min-w-[4rem]`),disabled:r,value:l,onChange:e=>{let t=parseInt(e.target.value,10);se(t),y({minute:t})},"aria-label":n.minuteAtHour,children:Array.from({length:60},(e,t)=>(0,w.jsx)(`option`,{value:t,children:String(t).padStart(2,`0`)},t))}),(0,w.jsx)(`span`,{className:`shrink-0 text-sm text-fg-muted`,children:n.minuteUnit})]})]}),fe=a===`weekly`?(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1.5 pt-1`,role:`group`,"aria-label":n.modeWeekly,children:n.weekdays.map((e,t)=>{let n=u[t];return(0,w.jsx)(`button`,{type:`button`,disabled:r,className:c(`flex size-9 select-none items-center justify-center rounded-full border text-xs font-medium transition-colors`,n?`border-fg bg-fg text-surface-panel`:`border-edge-subtle bg-surface-panel text-fg hover:border-edge`),"aria-pressed":n,onClick:()=>{let e=[...u];e[t]=!e[t],ue(e),y({weekDays:e})},children:e},e)})}):null,pe=a===`custom`?(0,w.jsxs)(`div`,{className:`pt-1`,children:[(0,w.jsx)(`textarea`,{disabled:r,className:Ze,rows:2,spellCheck:!1,value:p,placeholder:`*/5 * * * *`,onChange:e=>{let n=e.target.value;m(n),t(n.trim()||`*/5 * * * *`)},"aria-label":n.modeCustom}),(0,w.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.customCronHint})]}):null;return(0,w.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.scheduleTimeLabel}),de,fe,pe]})}var rt=400;function it(e){let t=new Date(e);return t.setHours(0,0,0,0),t}function at(e){let t=it(e),n=t.getDay(),r=n===0?-6:1-n;return t.setDate(t.getDate()+r),t}function ot(e){return new Date(e.getFullYear(),e.getMonth(),1,0,0,0,0)}var st=`*/5 * * * *`,ct=`xopc.recentWorkspaceDirs.v1`,M=10;function lt(e){let t=e?.trim();t&&window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{sessionKey:t},bubbles:!0}))}function ut(e){let t=e.trim();if(t)try{let e=localStorage.getItem(ct),n=e?JSON.parse(e):[],r=[t,...(Array.isArray(n)?n.filter(e=>typeof e==`string`&&e.trim().length>0):[]).filter(e=>e!==t)].slice(0,M);localStorage.setItem(ct,JSON.stringify(r))}catch{}}function dt(e){return c(`w-full rounded-md border border-edge bg-surface-base px-3 py-2 text-sm text-fg placeholder:text-fg-disabled`,x,e&&`cursor-not-allowed opacity-60`)}function ft(){return c(b,y)}var pt=c(b,`w-full text-xs sm:w-auto sm:min-w-[11rem] sm:max-w-[17rem] sm:shrink-0`),mt=c(b,`w-auto min-w-[9rem] max-w-[14rem] shrink-0 text-xs`);function ht(){let e=a(e=>e.language),t=r(e),n=t.cron,y=t.chat,b=!!i(e=>e.token),x=de(e=>e.resolved)===`dark`,ke=e===`zh`?`zh-CN`:`en-US`,[C,qe]=(0,S.useState)([]),[T,E]=(0,S.useState)(`tasks`),[D,Xe]=(0,S.useState)(`created_desc`),[O,Ze]=(0,S.useState)(`day`),[Qe,k]=(0,S.useState)(``),[A,$e]=(0,S.useState)(``),[j,et]=(0,S.useState)(!1),tt=(0,S.useRef)(null),ct=(0,S.useRef)(j),M=typeof navigator<`u`&&`wakeLock`in navigator,[ht,gt]=(0,S.useState)([]),[_t,vt]=(0,S.useState)([]),[yt,bt]=(0,S.useState)(``),[xt,St]=(0,S.useState)([]),[Ct,wt]=(0,S.useState)([]),[Tt,Et]=(0,S.useState)(!1),[Dt,N]=(0,S.useState)(null),[Ot,kt]=(0,S.useState)([]),[P,At]=(0,S.useState)(!1),[F,jt]=(0,S.useState)(!1),[I,Mt]=(0,S.useState)(`add`),[Nt,Pt]=(0,S.useState)(null),[Ft,It]=(0,S.useState)(``),[Lt,Rt]=(0,S.useState)(st),[L,R]=(0,S.useState)(`local`),[zt,z]=(0,S.useState)(``),[B,V]=(0,S.useState)(``),[Bt,Vt]=(0,S.useState)(`edit`),[Ht,Ut]=(0,S.useState)(0),[H,Wt]=(0,S.useState)(`main`),[Gt,U]=(0,S.useState)(``),[Kt,W]=(0,S.useState)(!1),[G,K]=(0,S.useState)(``),[qt,Jt]=(0,S.useState)(!1),[Yt,q]=(0,S.useState)(``),[J,Xt]=(0,S.useState)(!1),Zt=(0,S.useRef)(!1),[Qt,$t]=(0,S.useState)(!1),[Y,en]=(0,S.useState)(null),[tn,nn]=(0,S.useState)([]),[rn,an]=(0,S.useState)(!1),[on,sn]=(0,S.useState)(!1),[cn,ln]=(0,S.useState)(null),[un,dn]=(0,S.useState)(null),[fn,pn]=(0,S.useState)(!1),[mn,hn]=(0,S.useState)(`all`),X=(0,S.useRef)(null),gn=(0,S.useCallback)(e=>{X.current=e,window.setTimeout(()=>{X.current===e&&(X.current=null)},400)},[]),Z=(0,S.useCallback)(()=>yt||(_t.length>0?_t[0].id:``),[yt,_t]),_n=typeof window<`u`&&!!window.electronAPI?.file?.openDirectory,vn=(0,S.useCallback)(async()=>{let e=typeof window<`u`?window.electronAPI?.file?.openDirectory:void 0;return e?e():null},[]),yn=(0,S.useCallback)(async e=>{let t=e.trim();t&&(ut(t),K(t))},[]),bn=(0,S.useMemo)(()=>{let e=new Set(Ct.map(e=>e.id)),t=[...Ct],n=Gt.trim().toLowerCase();return n&&!e.has(n)&&t.push({id:n}),t},[Ct,Gt]),xn=L!==`local`&&(H===`main`||H===`isolated`&&!Kt),Sn=H===`main`||H===`isolated`&&!Kt,Cn=!!Ft.trim()&&!!Lt.trim()&&!!B.trim()&&(!xn||!!zt.trim()),wn=(0,S.useCallback)(async()=>{At(!0);try{kt(await Te(rt))}catch{}finally{At(!1)}},[]),Q=(0,S.useCallback)(async()=>{Et(!0),N(null);try{qe(await Be())}catch(e){N(e instanceof Error?e.message:n.failedToLoadJobs)}finally{Et(!1)}},[n.failedToLoadJobs]),$=(0,S.useCallback)(async()=>{try{let[e,t,n,r]=await Promise.all([Ne(),be(),Ae(),_e().catch(()=>null)]);gt(e),vt(t),bt(n.model||``),r&&wt(r.items)}catch{}},[]);(0,S.useEffect)(()=>{b&&(Q(),$())},[b,Q,$]),(0,S.useEffect)(()=>{!b||T!==`history`||wn()},[b,T,wn]);let Tn=(0,S.useCallback)(async()=>{try{await tt.current?.release()}catch{}tt.current=null},[]),En=(0,S.useCallback)(async()=>{if(M)try{let e=await navigator.wakeLock.request(`screen`);tt.current=e,e.addEventListener(`release`,()=>{tt.current=null})}catch{N(n.wakeLockUnavailable),et(!1)}},[n.wakeLockUnavailable,M]);ct.current=j,(0,S.useEffect)(()=>{if(!j){Tn();return}En();let e=()=>{document.visibilityState===`visible`&&ct.current&&En()};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e),Tn()}},[j,En,Tn]),(0,S.useEffect)(()=>{if(!F||I!==`add`||Zt.current)return;let e=Z();e&&q(e)},[F,I,Z]),(0,S.useEffect)(()=>{!F||I!==`add`||new Set([`local`,...ht.map(e=>e.name)]).has(L)||R(`local`)},[ht,L,I,F]),(0,S.useEffect)(()=>{if(L===`local`){St([]);return}let e=!1;return Re(L).then(t=>{e||St(t)}),()=>{e=!0}},[L,F]);let Dn=(0,S.useCallback)(e=>{if(Zt.current=!1,jt(!0),Mt(e?`edit`:`add`),Pt(e?.id??null),e){It(e.name||``),Rt(e.schedule&&String(e.schedule).trim()||st);let t=we(e);V(t??``),Wt(e.sessionTarget||`main`),U((e.sessionTarget||`main`)===`isolated`&&e.agentId?.trim()?e.agentId.trim().toLowerCase():``),K((e.sessionTarget||`main`)===`isolated`&&e.workingDirectory?.trim()?e.workingDirectory.trim():``);let n=e.payload?.kind===`agentTurn`&&e.payload.model?.trim()?e.payload.model.trim():``;q(e.model?.trim()||n||Z());let r=e.delivery?.channel===`local`,i=(e.sessionTarget||`main`)===`isolated`&&!r&&(!e.delivery?.to||e.delivery.mode===`none`);if(W(i),r)R(`local`),z(``);else if(e.delivery&&e.delivery.mode!==`none`&&e.delivery.to)R(e.delivery.channel||`telegram`),z(e.delivery.to||``);else if(i)R(`telegram`),z(``);else{let e=t.split(`:`);e.length>=3&&[`telegram`,`cli`,`gateway`,`local`].includes(e[0])?(R(e[0]),z(e[1]),V(e.slice(2).join(`:`))):(R(`telegram`),z(``))}}else It(``),Rt(st),R(`local`),z(``),V(``),Wt(`main`),U(``),K(``),W(!1),q(Z());Vt(`edit`),Ut(e=>e+1)},[Z]),On=(0,S.useCallback)(e=>{Vt(e),e===`edit`&&Ut(e=>e+1)},[]),kn=(0,S.useCallback)(e=>{let n=Je(e),r=n?Ke(t.cron,e):void 0;!n||!r||(Zt.current=!1,Mt(`add`),Pt(null),It(r.title),Rt(n.defaultSchedule),V(r.prompt),Wt(n.defaultSessionTarget),R(`local`),z(``),W(!1),U(``),K(``),q(Z()),Vt(`edit`),Ut(e=>e+1),pn(!1),jt(!0))},[Z,t.cron]),An=(0,S.useCallback)(()=>{jt(!1),Mt(`add`),Pt(null),It(``),Rt(st),R(`local`),z(``),V(``),Wt(`main`),U(``),K(``),Jt(!1),W(!1),q(``),Vt(`edit`),Zt.current=!1},[]),jn=async()=>{if(!Ft.trim()){N(n.nameRequired);return}if(!Lt.trim()||!B.trim()){N(n.scheduleRequired);return}if(xn&&!zt.trim()){N(n.chatIdRequired);return}Xt(!0),N(null);try{let e=B.trim(),t;t=H===`isolated`&&Kt?{mode:`none`}:L===`local`?{mode:`direct`,channel:`local`}:{mode:`direct`,channel:L,to:zt.trim()};let n=H===`isolated`?{kind:`agentTurn`,message:e,...Yt.trim()?{model:Yt.trim()}:{}}:{kind:`systemEvent`,text:e},r=Yt.trim(),i=Gt.trim().toLowerCase(),a=H===`main`?null:i||null,o=G.trim(),s={name:Ft.trim(),schedule:Lt.trim(),sessionTarget:H,model:H===`isolated`&&r?r:void 0,delivery:t,payload:n,...I===`edit`?{agentId:a,workingDirectory:H===`isolated`&&o||null}:{...H===`isolated`&&i?{agentId:i}:{},...H===`isolated`&&o?{workingDirectory:o}:{}}};if(I===`edit`&&Nt)await ve(Nt,s);else{let{schedule:e,agentId:t,workingDirectory:n,...r}=s;await Le(e,{...r,...t==null?{}:{agentId:t},...n?{workingDirectory:n}:{}})}An(),await Q(),await $()}catch(e){N(e instanceof Error?e.message:I===`edit`?n.failedToUpdateJob:n.failedToCreateJob)}finally{Xt(!1)}},Mn=async e=>{$t(!0),en(e),an(!0),nn([]);try{let t=await Ee(e.id);t&&(en(t),nn(await De(e.id,20)))}catch{}finally{an(!1)}},Nn=async(e,t)=>{try{await ye(e.id,t),await Q(),await $()}catch(e){N(e instanceof Error?e.message:n.failedToToggleJob)}},Pn=async()=>{if(!un||!cn)return;let e=un,t=cn;sn(!1),dn(null),ln(null);try{t===`run`?await ze(e):(await Se(e),Y?.id===e&&($t(!1),en(null))),await Q(),await $(),await wn()}catch(e){N(e instanceof Error?e.message:n.actionFailed)}};(0,S.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(F?An():Qt&&($t(!1),en(null)))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[F,Qt,An]);let Fn={running:n.execStatusRunning,success:n.execStatusSuccess,failed:n.execStatusFailed,cancelled:n.execStatusCancelled},In=(0,S.useMemo)(()=>{let e=[...C];return e.sort((e,t)=>{let n=new Date(e.created_at).getTime(),r=new Date(t.created_at).getTime();return D===`created_desc`?r-n:n-r}),e},[C,D]),Ln=(0,S.useMemo)(()=>{let e=new Date,t=O===`day`?it(e):O===`week`?at(e):ot(e);return Ot.filter(e=>!(new Date(e.startedAt)<t||Qe&&e.jobId!==Qe||A&&e.status!==A))},[Ot,O,Qe,A]),Rn=n.scheduleBadge,zn=(0,S.useCallback)(()=>{Q(),$(),wn()},[Q,$,wn]),Bn=fe(e=>e.setPageHeader),Vn=fe(e=>e.clearPageHeader),{pathname:Hn}=o(),Un=Hn.startsWith(`/settings/`),Wn=(0,S.useMemo)(()=>(0,w.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center justify-end gap-2`,children:[(0,w.jsx)(v,{type:`button`,variant:`ghost`,className:`h-9 w-9 shrink-0 p-0`,disabled:Tt||P,title:n.refresh,"aria-label":n.refresh,onClick:()=>void zn(),children:(0,w.jsx)(d,{className:c(`size-4`,(Tt||P)&&`animate-spin`),strokeWidth:1.75})}),(0,w.jsxs)(v,{type:`button`,variant:`secondary`,className:`gap-2`,onClick:()=>{hn(`all`),pn(!0)},children:[(0,w.jsx)(re,{className:`size-4`,strokeWidth:1.75}),n.fromTemplate]}),(0,w.jsxs)(v,{type:`button`,variant:`primary`,className:`gap-2`,onClick:()=>Dn(),children:[(0,w.jsx)(ue,{className:`size-4`,strokeWidth:1.75}),n.addJob]})]}),[n.addJob,n.fromTemplate,n.refresh,Tt,Dn,zn,P]);return(0,S.useLayoutEffect)(()=>!b||Un?(Vn(),()=>Vn()):(Bn({startExtra:null,main:null,end:Wn}),()=>Vn()),[Vn,Wn,b,Un,Bn]),b?(0,w.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto bg-surface-panel`,children:[(0,w.jsxs)(`div`,{className:`mx-auto flex w-full max-w-app-main flex-col gap-6 px-4 py-6 sm:px-8`,children:[Dt?(0,w.jsx)(`div`,{className:`rounded-xl border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200`,role:`alert`,children:Dt}):null,(0,w.jsx)(`header`,{className:`flex flex-col gap-4`,children:(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-fg`,children:n.title}),(0,w.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm text-fg-muted`,children:n.subtitle})]})}),Un?(0,w.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 border-b border-edge-subtle pb-3 dark:border-edge-subtle`,children:Wn}):null,(0,w.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-edge-subtle pb-3 sm:flex-row sm:items-center sm:justify-between dark:border-edge-subtle`,children:[(0,w.jsxs)(`div`,{className:`flex gap-1`,role:`tablist`,"aria-label":n.title,children:[(0,w.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":T===`tasks`,className:c(`rounded-md px-3 py-2 text-sm font-medium transition-colors`,T===`tasks`?`text-fg`:`text-fg-muted hover:text-fg`),onClick:()=>E(`tasks`),children:n.tabMyTasks}),(0,w.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":T===`history`,className:c(`rounded-md px-3 py-2 text-sm font-medium transition-colors`,T===`history`?`text-fg`:`text-fg-muted hover:text-fg`),onClick:()=>E(`history`),children:n.tabRunHistory})]}),(0,w.jsx)(`div`,{className:c(`flex min-w-0 items-center gap-2`,T===`history`?`flex-nowrap overflow-x-auto pb-0.5 sm:justify-end`:`flex-wrap sm:justify-end`),children:T===`tasks`?(0,w.jsxs)(`select`,{className:mt,value:D,onChange:e=>Xe(e.target.value),"aria-label":n.sortCreatedDesc,children:[(0,w.jsx)(`option`,{value:`created_desc`,children:n.sortCreatedDesc}),(0,w.jsx)(`option`,{value:`created_asc`,children:n.sortCreatedAsc})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`div`,{className:c(me,`shrink-0`),role:`group`,"aria-label":n.runHistoryTitle,children:[`day`,`week`,`month`].map(e=>(0,w.jsx)(`button`,{type:`button`,className:c(pe,`px-2.5 py-1`,O===e&&`bg-surface-panel shadow-sm dark:bg-surface-panel dark:shadow-sm dark:ring-1 dark:ring-edge-strong/40`,O===e&&`text-fg`),onClick:()=>Ze(e),children:e===`day`?n.historyRangeDay:e===`week`?n.historyRangeWeek:n.historyRangeMonth},e))}),(0,w.jsxs)(`select`,{className:mt,value:Qe,onChange:e=>k(e.target.value),"aria-label":n.filterAllTasks,children:[(0,w.jsx)(`option`,{value:``,children:n.filterAllTasks}),C.map(e=>(0,w.jsx)(`option`,{value:e.id,children:e.name||e.id},e.id))]}),(0,w.jsxs)(`select`,{className:mt,value:A,onChange:e=>$e(e.target.value),"aria-label":n.filterAllStatuses,children:[(0,w.jsx)(`option`,{value:``,children:n.filterAllStatuses}),(0,w.jsx)(`option`,{value:`success`,children:n.execStatusSuccess}),(0,w.jsx)(`option`,{value:`failed`,children:n.execStatusFailed}),(0,w.jsx)(`option`,{value:`cancelled`,children:n.execStatusCancelled}),(0,w.jsx)(`option`,{value:`running`,children:n.execStatusRunning})]})]})})]}),T===`tasks`?(0,w.jsxs)(`section`,{"aria-labelledby":`cron-tasks-panel`,className:`flex flex-col gap-4`,children:[(0,w.jsx)(`h2`,{id:`cron-tasks-panel`,className:`sr-only`,children:n.tabMyTasks}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl border border-accent/25 bg-accent/5 px-4 py-3 dark:border-accent/30 dark:bg-accent/10 sm:flex-row sm:items-center sm:justify-between`,children:[(0,w.jsxs)(`div`,{className:`flex gap-3 text-sm text-fg`,children:[(0,w.jsx)(le,{className:`mt-0.5 size-4 shrink-0 text-accent`,strokeWidth:1.75,"aria-hidden":!0}),(0,w.jsx)(`p`,{className:`text-pretty text-fg-muted`,children:n.wakeBanner})]}),(0,w.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 sm:pl-4`,children:[(0,w.jsx)(`span`,{className:`text-sm text-fg`,children:n.keepAwake}),(0,w.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":j,disabled:!M,title:M?void 0:n.wakeLockUnavailable,className:c(`inline-flex h-6 w-10 shrink-0 items-center rounded-full border border-edge p-0.5 transition-colors`,j?`justify-end bg-accent`:`justify-start bg-surface-hover`,!M&&`cursor-not-allowed opacity-50`),onClick:()=>{M?et(e=>!e):N(n.wakeLockUnavailable)},children:(0,w.jsx)(`span`,{className:`size-4 rounded-full bg-surface-panel shadow-surface ring-1 ring-edge/40 dark:ring-edge/55`})})]})]}),Tt&&C.length===0?(0,w.jsx)(`div`,{className:`flex justify-center py-16`,"aria-busy":`true`,children:(0,w.jsx)(u,{className:`size-8 animate-spin text-accent`,strokeWidth:1.75})}):C.length===0?(0,w.jsxs)(`div`,{className:`flex flex-col gap-6 rounded-2xl bg-surface-base px-4 py-8 dark:bg-surface-hover/25 sm:px-6 sm:py-10`,children:[(0,w.jsx)(`div`,{className:`w-full max-w-3xl`,children:(0,w.jsx)(Ye,{cron:n,localeTag:ke,scheduleBadgeLabels:Rn,categoryFilter:mn,onCategoryFilterChange:hn,onSelectTemplate:kn})}),(0,w.jsx)(`div`,{className:`flex justify-center`,children:(0,w.jsx)(v,{type:`button`,variant:`primary`,onClick:()=>Dn(),children:n.emptyStateCta})})]}):(0,w.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:In.map(e=>(0,w.jsxs)(`article`,{role:`button`,tabIndex:0,className:c(`flex cursor-pointer flex-col rounded-xl border border-edge-subtle bg-surface-base text-left transition-colors duration-150 ease-out dark:border-edge-subtle`,`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`),onClick:()=>{if(X.current===e.id){X.current=null;return}Mn(e)},onKeyDown:t=>{if(t.key===`Enter`||t.key===` `){if(t.preventDefault(),X.current===e.id){X.current=null;return}Mn(e)}},children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-2 px-4 pt-3`,children:[(0,w.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e.enabled,className:c(`inline-flex h-6 w-10 shrink-0 items-center rounded-full border border-edge p-0.5 transition-colors`,e.enabled?`justify-end bg-accent`:`justify-start bg-surface-hover`),onClick:t=>{t.stopPropagation(),Nn(e,!e.enabled)},children:(0,w.jsx)(`span`,{className:`size-4 rounded-full bg-surface-panel shadow-surface ring-1 ring-edge/40 dark:ring-edge/55`})}),(0,w.jsxs)(He,{children:[(0,w.jsx)(Ve,{asChild:!0,children:(0,w.jsx)(v,{type:`button`,variant:`ghost`,className:`h-8 w-8 shrink-0 p-0`,"aria-label":n.jobCardMenuAria,onClick:e=>e.stopPropagation(),children:(0,w.jsx)(se,{className:`size-4`,strokeWidth:1.75})})}),(0,w.jsx)(We,{children:(0,w.jsxs)(Ge,{className:`z-50 min-w-[10rem] rounded-xl border border-edge-subtle bg-surface-panel p-1 shadow-elevated dark:border-edge-subtle`,sideOffset:4,align:`end`,onCloseAutoFocus:e=>e.preventDefault(),children:[(0,w.jsx)(Ue,{className:`cursor-pointer select-none rounded-lg px-2 py-1.5 text-sm text-fg outline-none data-highlighted:bg-surface-hover`,onSelect:()=>{gn(e.id),Dn(e)},children:n.edit}),(0,w.jsx)(Ue,{className:`cursor-pointer select-none rounded-lg px-2 py-1.5 text-sm text-fg outline-none data-highlighted:bg-surface-hover`,onSelect:()=>{gn(e.id),ln(`run`),dn(e.id),sn(!0)},children:n.runNow}),(0,w.jsx)(Ue,{className:`cursor-pointer select-none rounded-lg px-2 py-1.5 text-sm text-red-600 outline-none data-highlighted:bg-red-500/10 dark:text-red-400`,onSelect:()=>{gn(e.id),ln(`delete`),dn(e.id),sn(!0)},children:n.delete})]})})]})]}),(0,w.jsxs)(`div`,{className:`flex flex-1 flex-col gap-2 px-4 pb-3 pt-2`,children:[(0,w.jsx)(`h3`,{className:`line-clamp-2 font-semibold text-fg`,children:e.name||e.id}),(0,w.jsx)(`div`,{className:`max-h-[4.5rem] overflow-hidden text-sm text-fg-muted [&_.markdown-body]:text-sm [&_.markdown-body]:leading-snug`,title:we(e),children:(0,w.jsx)(he,{content:we(e),compact:!0})})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-1.5 border-t border-edge-subtle/90 px-4 py-2.5 text-xs text-fg-muted dark:border-edge-subtle`,children:[(0,w.jsx)(l,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),(0,w.jsx)(`span`,{className:`min-w-0 truncate`,children:Me(e,ke,Rn)})]})]},e.id))})]}):(0,w.jsxs)(`section`,{"aria-labelledby":`cron-history-panel`,className:`flex flex-col gap-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h2`,{id:`cron-history-panel`,className:`sr-only`,children:n.tabRunHistory}),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.runHistoryHint})]}),(0,w.jsx)(v,{type:`button`,variant:`ghost`,className:`h-9 w-9 shrink-0 p-0`,disabled:P,title:n.refresh,"aria-label":n.refresh,onClick:()=>void wn(),children:(0,w.jsx)(d,{className:c(`size-4`,P&&`animate-spin`),strokeWidth:1.75})})]}),P&&Ot.length===0?(0,w.jsx)(`div`,{className:`flex justify-center py-16`,children:(0,w.jsx)(u,{className:`size-8 animate-spin text-accent`,strokeWidth:1.75})}):Ln.length===0?(0,w.jsxs)(`div`,{className:`flex flex-col items-center rounded-2xl border border-dashed border-edge-subtle px-6 py-16 text-center dark:border-edge-subtle`,children:[(0,w.jsx)(l,{className:`mb-4 size-14 text-fg-disabled`,strokeWidth:1.1,"aria-hidden":!0}),(0,w.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:Ot.length===0?n.emptyHistoryTitle:n.noRunsYet}),(0,w.jsx)(`p`,{className:`mt-2 max-w-sm text-sm text-fg-muted`,children:Ot.length===0?n.emptyHistoryHint:n.runHistoryHint})]}):(0,w.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-edge-subtle bg-surface-base dark:border-edge-subtle`,children:(0,w.jsxs)(`table`,{className:`w-full min-w-[700px] border-collapse text-left text-sm`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-edge text-xs font-medium text-fg-muted`,children:[(0,w.jsx)(`th`,{className:`px-3 py-2.5 font-medium`,children:n.colStarted}),(0,w.jsx)(`th`,{className:`px-3 py-2.5 font-medium`,children:n.colJob}),(0,w.jsx)(`th`,{className:`px-3 py-2.5 font-medium`,children:n.status}),(0,w.jsx)(`th`,{className:`px-3 py-2.5 font-medium`,children:n.colDuration}),(0,w.jsx)(`th`,{className:`px-3 py-2.5 font-medium`,children:n.colDetail}),(0,w.jsx)(`th`,{className:`px-3 py-2.5 font-medium`,children:n.colChat})]})}),(0,w.jsx)(`tbody`,{children:Ln.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-edge/60 last:border-0`,children:[(0,w.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2.5 text-fg`,children:(0,w.jsx)(`time`,{dateTime:e.startedAt,children:Fe(e.startedAt)})}),(0,w.jsx)(`td`,{className:`max-w-[10rem] truncate px-3 py-2.5`,children:C.some(t=>t.id===e.jobId)?(0,w.jsx)(`button`,{type:`button`,className:`text-left text-accent hover:underline`,onClick:()=>{let t=C.find(t=>t.id===e.jobId);t&&Mn(t)},children:e.jobName||e.jobId}):(0,w.jsx)(`span`,{className:`text-fg-muted`,children:e.jobName||e.jobId})}),(0,w.jsx)(`td`,{className:`px-3 py-2.5`,children:(0,w.jsx)(`span`,{className:c(`inline-flex rounded-md px-2 py-0.5 text-xs font-medium`,e.status===`success`&&`bg-emerald-500/15 text-emerald-800 dark:text-emerald-300`,e.status===`failed`&&`bg-red-500/15 text-red-800 dark:text-red-300`,e.status===`running`&&`bg-accent/15 text-accent`,e.status===`cancelled`&&`bg-surface-hover text-fg-muted`),children:Ie(e.status,Fn)})}),(0,w.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2.5 text-fg-muted`,children:Pe(e.duration)}),(0,w.jsx)(`td`,{className:`max-w-xs truncate px-3 py-2.5 text-fg-muted`,title:e.summary||e.error||``,children:Ce(e.summary||e.error,96)}),(0,w.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2.5`,children:e.sessionKey?.trim()?(0,w.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-accent hover:underline`,title:n.openChatTitle,"aria-label":n.openChatTitle,onClick:()=>lt(e.sessionKey),children:n.openChat}):(0,w.jsx)(`span`,{className:`text-fg-disabled`,children:`—`})})]},e.id))})]})})]})]}),(0,w.jsx)(h,{open:F,onOpenChange:e=>!e&&An(),children:(0,w.jsxs)(f,{children:[(0,w.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),(0,w.jsx)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center p-4 pointer-events-none`,children:(0,w.jsxs)(m,{className:`xopc-dialog-content-pane pointer-events-auto relative flex max-h-[min(90vh,800px)] w-full max-w-md flex-col rounded-xl border border-edge bg-surface-panel shadow-popover outline-none sm:max-w-lg lg:max-w-xl dark:border-edge`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,w.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[(0,w.jsx)(g,{className:`text-base font-semibold text-fg`,children:I===`edit`?n.editJob:n.addJob}),(0,w.jsx)(_,{asChild:!0,children:(0,w.jsx)(v,{type:`button`,variant:`ghost`,className:`h-9 w-9 shrink-0 p-0`,"aria-label":n.close,children:(0,w.jsx)(s,{className:`size-5`,strokeWidth:1.75})})})]}),(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,w.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.name}),(0,w.jsx)(`input`,{type:`text`,className:dt(),value:Ft,onChange:e=>It(e.target.value),placeholder:n.namePlaceholder})]}),(0,w.jsx)(nt,{value:Lt,onChange:Rt,disabled:J,labels:n.schedulePicker}),(0,w.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.mode}),(0,w.jsxs)(`select`,{className:ft(),value:H,onChange:e=>{let t=e.target.value;Wt(t),t===`main`?(W(!1),U(``),K(``)):t===`isolated`&&!Yt.trim()&&q(Z())},children:[(0,w.jsx)(`option`,{value:`main`,children:n.modeDirectOption}),(0,w.jsx)(`option`,{value:`isolated`,children:n.modeAgentOption})]}),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:H===`main`?n.modeDirect:n.modeAgent})]}),H===`isolated`?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.model}),(0,w.jsx)(oe,{value:Yt,placeholder:y.modelPlaceholder,searchPlaceholder:y.modelSearchPlaceholder,noMatches:y.modelNoMatches,className:`w-full max-w-none min-w-0`,popoverContentClassName:`z-[70]`,onChange:e=>{Zt.current=!0,q(e)}})]}),(0,w.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.agentProfile}),(0,w.jsxs)(`select`,{className:ft(),value:Gt,disabled:J,onChange:e=>U(e.target.value),children:[(0,w.jsx)(`option`,{value:``,children:n.agentProfileDefault}),bn.map(e=>(0,w.jsx)(`option`,{value:e.id,children:e.name?`${e.id} — ${e.name}`:e.id},e.id))]}),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.agentProfileHint})]}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.workingDirectoryLabel}),(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsxs)(`button`,{type:`button`,disabled:J,className:c(`inline-flex min-h-8 max-w-[min(16rem,48vw)] min-w-0 shrink-0 items-center gap-1 rounded-lg px-2 py-1 text-xs`,`border border-edge-subtle/80 bg-surface-hover/40 dark:border-edge-subtle`,ge.transition,ge.focusRingPanel,`cursor-pointer hover:bg-surface-hover/70 dark:hover:bg-surface-hover/50`,J&&`cursor-not-allowed opacity-60`),title:G.trim()?`${G.trim()}\n${y.workingDirectory.chooseFolder}`:`${n.workingDirectoryHint}\n${y.workingDirectory.selectWorkingDirectory}`,onClick:e=>{e.stopPropagation(),!J&&(_n?(async()=>{let e=await vn();e&&yn(e)})():Jt(!0))},children:[(0,w.jsx)(ee,{className:`size-3.5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,w.jsx)(`span`,{className:`min-w-0 truncate text-left font-medium text-fg`,children:G.trim()?te(G.trim()):y.workingDirectory.notSet})]}),G.trim()?(0,w.jsx)(`button`,{type:`button`,disabled:J,className:`text-xs font-medium text-accent hover:underline disabled:opacity-50`,onClick:()=>K(``),children:n.workingDirectoryReset}):null]}),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.workingDirectoryHint})]}),(0,w.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-md bg-surface-hover/45 px-3 py-2 dark:bg-surface-hover/30`,children:[(0,w.jsx)(`input`,{type:`checkbox`,className:c(`ui-checkbox`,`mt-0.5`),checked:Kt,onChange:e=>W(e.target.checked)}),(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:n.agentLocalOnly}),(0,w.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.agentLocalOnlyHint})]})]})]}):null,Sn?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.channel}),(0,w.jsxs)(`select`,{className:ft(),value:L,onChange:e=>{let t=e.target.value;R(t),t===`local`&&W(!1),z(``)},children:[(0,w.jsx)(`option`,{value:`local`,children:n.channelLocal}),ht.map(e=>(0,w.jsxs)(`option`,{value:e.name,disabled:!e.enabled,children:[e.name,` `,e.enabled?``:`(disabled)`]},e.name))]})]}),xn?(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.recipient}),(0,w.jsxs)(v,{type:`button`,variant:`ghost`,className:`h-7 gap-1 px-2 text-xs`,title:n.refreshRecipientHint,onClick:()=>void Re(L).then(St),children:[(0,w.jsx)(d,{className:`size-3.5`,strokeWidth:1.75}),n.refreshList]})]}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-stretch sm:gap-2`,children:[(0,w.jsx)(`input`,{type:`text`,className:c(dt(),`min-w-0 w-full sm:flex-1`),value:zt,onChange:e=>z(e.target.value),placeholder:n.recipientPlaceholder}),(0,w.jsxs)(`select`,{className:pt,value:zt,onChange:e=>{let t=e.target.value;t&&z(t)},children:[(0,w.jsx)(`option`,{value:``,children:n.selectRecipient}),xt.length>0?xt.map(e=>(0,w.jsx)(`option`,{value:e.chatId,children:xe(e,n.lastActiveLabels)},`${e.channel}-${e.chatId}`)):(0,w.jsx)(`option`,{value:``,disabled:!0,children:n.noRecentChatsOption})]})]}),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:xt.length>0?n.enterManuallyOrSelect:n.noRecentChats})]}):null]}):null,(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:n.message}),(0,w.jsxs)(`div`,{className:`inline-flex rounded-lg border border-edge bg-surface-base p-0.5 dark:border-edge`,children:[(0,w.jsxs)(`button`,{type:`button`,className:c(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium`,Bt===`edit`?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover`),onClick:()=>On(`edit`),children:[(0,w.jsx)(ie,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),n.messageEdit]}),(0,w.jsxs)(`button`,{type:`button`,className:c(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium`,Bt===`preview`?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover`),onClick:()=>On(`preview`),children:[(0,w.jsx)(ce,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),n.messagePreview]})]})]}),(0,w.jsx)(`div`,{className:c(`overflow-hidden rounded-md border border-edge bg-surface-base dark:border-edge`,J&&`pointer-events-none opacity-60`),children:Bt===`edit`?(0,w.jsx)(ae,{initialContent:B,onChange:V,isDark:x,className:`h-[min(18rem,40vh)] min-h-[12rem]`},`cron-msg-${Nt??`new`}-${Ht}`):(0,w.jsx)(`div`,{className:`h-[min(18rem,40vh)] min-h-[12rem] max-h-[min(24rem,50vh)] overflow-y-auto px-3 py-2`,children:B.trim()?(0,w.jsx)(he,{content:B,compact:!0,className:`text-sm`}):(0,w.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.messagePlaceholder})})}),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.messageMarkdownHint})]})]})}),(0,w.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-4 py-3`,children:[(0,w.jsx)(v,{type:`button`,variant:`secondary`,onClick:An,children:n.cancel}),(0,w.jsx)(v,{type:`button`,variant:`primary`,disabled:J||!Cn,onClick:()=>void jn(),children:J?n.loading:I===`edit`?n.save:n.create})]})]})})]})}),_n?null:(0,w.jsx)(ne,{open:qt,onOpenChange:Jt,initialAbsolutePath:G.trim()||void 0,onConfirm:async e=>{await yn(e),Jt(!1)},wd:y.workingDirectory}),(0,w.jsx)(h,{open:fn,onOpenChange:e=>{pn(e),e&&hn(`all`)},children:(0,w.jsxs)(f,{children:[(0,w.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[62] bg-scrim`}),(0,w.jsx)(`div`,{className:`fixed inset-0 z-[62] flex items-center justify-center p-4 pointer-events-none`,children:(0,w.jsxs)(m,{className:`xopc-dialog-content-pane pointer-events-auto relative flex max-h-[min(90vh,840px)] w-full max-w-lg flex-col rounded-xl border border-edge bg-surface-panel shadow-popover outline-none sm:max-w-2xl dark:border-edge`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,w.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end border-b border-edge px-4 py-3`,children:[(0,w.jsx)(g,{className:`sr-only`,children:n.fromTemplate}),(0,w.jsx)(_,{asChild:!0,children:(0,w.jsx)(v,{type:`button`,variant:`ghost`,className:`h-9 w-9 shrink-0 p-0`,"aria-label":n.close,children:(0,w.jsx)(s,{className:`size-5`,strokeWidth:1.75})})})]}),(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,children:(0,w.jsx)(Ye,{cron:n,localeTag:ke,scheduleBadgeLabels:Rn,categoryFilter:mn,onCategoryFilterChange:hn,onSelectTemplate:kn})})]})})]})}),(0,w.jsx)(h,{open:Qt,onOpenChange:e=>{e||($t(!1),en(null))},children:(0,w.jsxs)(f,{children:[(0,w.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),(0,w.jsxs)(m,{className:c(`xopc-drawer-right fixed right-0 top-0 z-[60] flex h-full w-full max-w-lg flex-col border-l border-edge bg-surface-panel shadow-popover outline-none`,`dark:border-edge`),"aria-describedby":void 0,children:[(0,w.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[(0,w.jsx)(g,{className:`min-w-0 truncate text-base font-semibold text-fg`,children:Y?.name?.trim()||Y?.id||`—`}),(0,w.jsx)(_,{asChild:!0,children:(0,w.jsx)(v,{type:`button`,variant:`ghost`,className:`h-9 w-9 shrink-0 p-0`,"aria-label":n.close,children:(0,w.jsx)(s,{className:`size-5`,strokeWidth:1.75})})})]}),(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:rn?(0,w.jsx)(`div`,{className:`flex justify-center py-16`,children:(0,w.jsx)(u,{className:`size-8 animate-spin text-accent`,strokeWidth:1.75})}):Y?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.scheduleLabel}),(0,w.jsx)(`dd`,{className:`mt-1 font-mono text-fg`,children:(0,w.jsx)(`code`,{children:Y.schedule})})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.messageLabel}),(0,w.jsx)(`dd`,{className:`mt-1 min-w-0 break-words text-fg`,children:(0,w.jsx)(he,{content:we(Y),compact:!0,className:`text-sm`})})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.mode}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:Y.sessionTarget===`isolated`?n.modeAgentOption:n.modeDirectOption})]}),Y.sessionTarget===`isolated`?(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.agentProfile}),(0,w.jsx)(`dd`,{className:`mt-1 font-mono text-sm text-fg`,children:Y.agentId?.trim()?Y.agentId.trim():n.agentProfileDefault})]}):null,Y.sessionTarget===`isolated`?(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.workingDirectoryLabel}),(0,w.jsx)(`dd`,{className:`mt-1 break-all font-mono text-xs text-fg`,children:Y.workingDirectory?.trim()?Y.workingDirectory.trim():y.workingDirectory.notSet})]}):null,Y.delivery?.channel===`local`||Y.sessionTarget===`isolated`&&!Y.delivery?.to?(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.deliveryTarget}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:Y.delivery?.channel===`local`?n.deliveryTargetLocalChannel:n.deliveryLocalOnly})]}):Y.delivery?.to?(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.deliveryTarget}),(0,w.jsxs)(`dd`,{className:`mt-1 break-words text-fg`,children:[(0,w.jsx)(`code`,{className:`text-xs`,children:Y.delivery?.channel??``}),` → `,je(Y,n.channelLocal)]})]}):null,(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.status}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:Y.enabled?n.enabled:n.disabled})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:n.nextRun}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:Y.next_run?Oe(Y.next_run,n.timeLabels):`—`})]})]}),(0,w.jsx)(`h3`,{className:`mt-6 text-sm font-semibold text-fg`,children:n.detailRunHistory}),tn.length===0?(0,w.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:n.noRunsYet}):(0,w.jsx)(`div`,{className:`mt-2 overflow-x-auto`,children:(0,w.jsxs)(`table`,{className:`w-full border-collapse text-left text-xs`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-edge text-fg-muted`,children:[(0,w.jsx)(`th`,{className:`py-1.5 pr-2 font-medium`,children:n.colStarted}),(0,w.jsx)(`th`,{className:`py-1.5 pr-2 font-medium`,children:n.status}),(0,w.jsx)(`th`,{className:`py-1.5 pr-2 font-medium`,children:n.colDuration}),(0,w.jsx)(`th`,{className:`py-1.5 pr-2 font-medium`,children:n.colDetail}),(0,w.jsx)(`th`,{className:`py-1.5 font-medium`,children:n.colChat})]})}),(0,w.jsx)(`tbody`,{children:tn.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-edge/60`,children:[(0,w.jsx)(`td`,{className:`whitespace-nowrap py-1.5 pr-2 text-fg`,children:(0,w.jsx)(`time`,{dateTime:e.startedAt,children:Fe(e.startedAt)})}),(0,w.jsx)(`td`,{className:`py-1.5 pr-2`,children:(0,w.jsx)(`span`,{className:c(`inline-flex rounded px-1.5 py-0.5 font-medium`,e.status===`success`&&`bg-emerald-500/15 text-emerald-800 dark:text-emerald-300`,e.status===`failed`&&`bg-red-500/15 text-red-800 dark:text-red-300`),children:Ie(e.status,Fn)})}),(0,w.jsx)(`td`,{className:`py-1.5 pr-2 text-fg-muted`,children:Pe(e.duration)}),(0,w.jsx)(`td`,{className:`max-w-[8rem] truncate py-1.5 pr-2 text-fg-muted`,title:e.summary||e.error||``,children:Ce(e.summary||e.error,120)}),(0,w.jsx)(`td`,{className:`whitespace-nowrap py-1.5`,children:e.sessionKey?.trim()?(0,w.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-accent hover:underline`,title:n.openChatTitle,"aria-label":n.openChatTitle,onClick:()=>lt(e.sessionKey),children:n.openChat}):(0,w.jsx)(`span`,{className:`text-fg-disabled`,children:`—`})})]},e.id))})]})})]}):null})]})]})}),(0,w.jsx)(h,{open:on,onOpenChange:sn,children:(0,w.jsxs)(f,{children:[(0,w.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim`}),(0,w.jsx)(`div`,{className:`fixed inset-0 z-[70] flex items-center justify-center p-4 pointer-events-none`,children:(0,w.jsxs)(m,{className:`xopc-dialog-content-pane pointer-events-auto relative w-full max-w-md rounded-xl border border-edge bg-surface-panel p-4 shadow-popover dark:border-edge`,children:[(0,w.jsx)(g,{className:`text-base font-semibold text-fg`,children:cn===`delete`?n.delete:n.runNow}),(0,w.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:cn===`delete`?n.confirmDelete:n.confirmRun}),(0,w.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,w.jsx)(v,{type:`button`,variant:`secondary`,onClick:()=>{sn(!1),dn(null),ln(null)},children:n.cancel}),(0,w.jsx)(v,{type:`button`,variant:`primary`,className:cn===`delete`?`bg-red-600 hover:bg-red-700`:void 0,onClick:()=>void Pn(),children:cn===`delete`?n.delete:n.runNow})]})]})})]})})]}):(0,w.jsx)(`div`,{className:`mx-auto w-full max-w-app-main px-4 py-16 text-center text-sm text-fg-muted sm:px-8`,children:n.needToken})}export{ht as CronPage};
|
|
2
|
+
//# sourceMappingURL=cron-page-Cli49RKR.js.map
|