@kynetic-ai/spec 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -455
- package/dist/agent-runtime/bootstrap.d.ts +31 -0
- package/dist/agent-runtime/bootstrap.d.ts.map +1 -0
- package/dist/agent-runtime/bootstrap.js +302 -0
- package/dist/agent-runtime/bootstrap.js.map +1 -0
- package/dist/agent-runtime/dispatch.d.ts +150 -10
- package/dist/agent-runtime/dispatch.d.ts.map +1 -1
- package/dist/agent-runtime/dispatch.js +1248 -244
- package/dist/agent-runtime/dispatch.js.map +1 -1
- package/dist/agent-runtime/invocation.d.ts +28 -1
- package/dist/agent-runtime/invocation.d.ts.map +1 -1
- package/dist/agent-runtime/invocation.js +172 -60
- package/dist/agent-runtime/invocation.js.map +1 -1
- package/dist/agent-runtime/prompts.d.ts +9 -0
- package/dist/agent-runtime/prompts.d.ts.map +1 -1
- package/dist/agent-runtime/prompts.js +42 -7
- package/dist/agent-runtime/prompts.js.map +1 -1
- package/dist/agent-runtime/session-event-accumulator.d.ts +83 -0
- package/dist/agent-runtime/session-event-accumulator.d.ts.map +1 -0
- package/dist/agent-runtime/session-event-accumulator.js +203 -0
- package/dist/agent-runtime/session-event-accumulator.js.map +1 -0
- package/dist/agent-runtime/session-event-types.d.ts +67 -0
- package/dist/agent-runtime/session-event-types.d.ts.map +1 -0
- package/dist/agent-runtime/session-event-types.js +13 -0
- package/dist/agent-runtime/session-event-types.js.map +1 -0
- package/dist/agent-runtime/workspace.d.ts +244 -0
- package/dist/agent-runtime/workspace.d.ts.map +1 -0
- package/dist/agent-runtime/workspace.js +2025 -0
- package/dist/agent-runtime/workspace.js.map +1 -0
- package/dist/agents/adapters.d.ts.map +1 -1
- package/dist/agents/adapters.js +58 -13
- package/dist/agents/adapters.js.map +1 -1
- package/dist/agents/spawner.d.ts +8 -0
- package/dist/agents/spawner.d.ts.map +1 -1
- package/dist/agents/spawner.js +25 -3
- package/dist/agents/spawner.js.map +1 -1
- package/dist/cli/batch-exec.js +1 -1
- package/dist/cli/batch-exec.js.map +1 -1
- package/dist/cli/command-annotations.d.ts +15 -3
- package/dist/cli/command-annotations.d.ts.map +1 -1
- package/dist/cli/command-annotations.js +23 -3
- package/dist/cli/command-annotations.js.map +1 -1
- package/dist/cli/commands/agent.d.ts +2 -0
- package/dist/cli/commands/agent.d.ts.map +1 -1
- package/dist/cli/commands/agent.js +144 -27
- package/dist/cli/commands/agent.js.map +1 -1
- package/dist/cli/commands/agents.d.ts.map +1 -1
- package/dist/cli/commands/agents.js +5 -5
- package/dist/cli/commands/agents.js.map +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +118 -3
- package/dist/cli/commands/derive.js.map +1 -1
- package/dist/cli/commands/guard.d.ts.map +1 -1
- package/dist/cli/commands/guard.js +8 -6
- package/dist/cli/commands/guard.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +1 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +20 -0
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/item.d.ts.map +1 -1
- package/dist/cli/commands/item.js +205 -47
- package/dist/cli/commands/item.js.map +1 -1
- package/dist/cli/commands/log.d.ts.map +1 -1
- package/dist/cli/commands/log.js +24 -10
- package/dist/cli/commands/log.js.map +1 -1
- package/dist/cli/commands/meta.d.ts.map +1 -1
- package/dist/cli/commands/meta.js +10 -1
- package/dist/cli/commands/meta.js.map +1 -1
- package/dist/cli/commands/plan-import.d.ts +3 -3
- package/dist/cli/commands/plan-import.d.ts.map +1 -1
- package/dist/cli/commands/plan-import.js +213 -528
- package/dist/cli/commands/plan-import.js.map +1 -1
- package/dist/cli/commands/plan.d.ts.map +1 -1
- package/dist/cli/commands/plan.js +533 -83
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/review.d.ts +14 -0
- package/dist/cli/commands/review.d.ts.map +1 -0
- package/dist/cli/commands/review.js +1142 -0
- package/dist/cli/commands/review.js.map +1 -0
- package/dist/cli/commands/serve.d.ts +1 -0
- package/dist/cli/commands/serve.d.ts.map +1 -1
- package/dist/cli/commands/serve.js +33 -10
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/session/checkpoint.d.ts +2 -4
- package/dist/cli/commands/session/checkpoint.d.ts.map +1 -1
- package/dist/cli/commands/session/checkpoint.js +6 -107
- package/dist/cli/commands/session/checkpoint.js.map +1 -1
- package/dist/cli/commands/session/commands.d.ts.map +1 -1
- package/dist/cli/commands/session/commands.js +33 -23
- package/dist/cli/commands/session/commands.js.map +1 -1
- package/dist/cli/commands/session/compact.js +4 -4
- package/dist/cli/commands/session/compact.js.map +1 -1
- package/dist/cli/commands/session/create.js +2 -2
- package/dist/cli/commands/session/create.js.map +1 -1
- package/dist/cli/commands/session/format.d.ts.map +1 -1
- package/dist/cli/commands/session/format.js +1 -6
- package/dist/cli/commands/session/format.js.map +1 -1
- package/dist/cli/commands/session/log.d.ts +32 -7
- package/dist/cli/commands/session/log.d.ts.map +1 -1
- package/dist/cli/commands/session/log.js +166 -60
- package/dist/cli/commands/session/log.js.map +1 -1
- package/dist/cli/commands/session/migrate.d.ts +9 -0
- package/dist/cli/commands/session/migrate.d.ts.map +1 -0
- package/dist/cli/commands/session/migrate.js +46 -0
- package/dist/cli/commands/session/migrate.js.map +1 -0
- package/dist/cli/commands/session/stale-close.d.ts.map +1 -1
- package/dist/cli/commands/session/stale-close.js +5 -8
- package/dist/cli/commands/session/stale-close.js.map +1 -1
- package/dist/cli/commands/session/types.d.ts +1 -1
- package/dist/cli/commands/session/types.d.ts.map +1 -1
- package/dist/cli/commands/setup.d.ts +2 -2
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +287 -257
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/shadow.d.ts.map +1 -1
- package/dist/cli/commands/shadow.js +147 -31
- package/dist/cli/commands/shadow.js.map +1 -1
- package/dist/cli/commands/skill-crud.d.ts +7 -0
- package/dist/cli/commands/skill-crud.d.ts.map +1 -1
- package/dist/cli/commands/skill-crud.js +41 -18
- package/dist/cli/commands/skill-crud.js.map +1 -1
- package/dist/cli/commands/skill-diff.d.ts.map +1 -1
- package/dist/cli/commands/skill-diff.js +29 -3
- package/dist/cli/commands/skill-diff.js.map +1 -1
- package/dist/cli/commands/skill-install.d.ts.map +1 -1
- package/dist/cli/commands/skill-install.js +5 -4
- package/dist/cli/commands/skill-install.js.map +1 -1
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js +359 -49
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/commands/trait.d.ts.map +1 -1
- package/dist/cli/commands/trait.js +5 -27
- package/dist/cli/commands/trait.js.map +1 -1
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +113 -52
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +69 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/output.d.ts +26 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +108 -1
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/sync-mode.d.ts +44 -0
- package/dist/cli/sync-mode.d.ts.map +1 -0
- package/dist/cli/sync-mode.js +64 -0
- package/dist/cli/sync-mode.js.map +1 -0
- package/dist/daemon/middleware/project-context.ts +25 -7
- package/dist/daemon/project-context.ts +18 -0
- package/dist/daemon/routes/agent-dispatch.ts +107 -23
- package/dist/daemon/routes/aggregation.ts +184 -0
- package/dist/daemon/routes/inbox.ts +5 -0
- package/dist/daemon/routes/items.ts +167 -0
- package/dist/daemon/routes/meta.ts +141 -1
- package/dist/daemon/routes/plans.ts +147 -0
- package/dist/daemon/routes/projects.ts +28 -6
- package/dist/daemon/routes/ref-resolution.ts +119 -0
- package/dist/daemon/routes/refs.ts +42 -0
- package/dist/daemon/routes/session-related.ts +140 -0
- package/dist/daemon/routes/sessions.ts +581 -0
- package/dist/daemon/routes/tasks.ts +257 -2
- package/dist/daemon/routes/triage.ts +40 -1
- package/dist/daemon/routes/validation.ts +1 -1
- package/dist/daemon/server.ts +165 -50
- package/dist/daemon/session-sync.ts +11 -0
- package/dist/daemon/shadow-sync.ts +11 -0
- package/dist/daemon/watcher.ts +56 -5
- package/dist/daemon/websocket/project-resolution.ts +77 -0
- package/dist/export/json.d.ts.map +1 -1
- package/dist/export/json.js +104 -1
- package/dist/export/json.js.map +1 -1
- package/dist/export/types.d.ts +52 -1
- package/dist/export/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/parser/agent-detection.d.ts +1 -1
- package/dist/parser/agent-detection.d.ts.map +1 -1
- package/dist/parser/agent-detection.js +10 -0
- package/dist/parser/agent-detection.js.map +1 -1
- package/dist/parser/alignment.d.ts.map +1 -1
- package/dist/parser/alignment.js +4 -2
- package/dist/parser/alignment.js.map +1 -1
- package/dist/parser/config.d.ts +397 -2
- package/dist/parser/config.d.ts.map +1 -1
- package/dist/parser/config.js +125 -3
- package/dist/parser/config.js.map +1 -1
- package/dist/parser/dispatch-workspaces.d.ts +18 -0
- package/dist/parser/dispatch-workspaces.d.ts.map +1 -0
- package/dist/parser/dispatch-workspaces.js +209 -0
- package/dist/parser/dispatch-workspaces.js.map +1 -0
- package/dist/parser/doctor.d.ts.map +1 -1
- package/dist/parser/doctor.js +27 -8
- package/dist/parser/doctor.js.map +1 -1
- package/dist/parser/file-lock.d.ts.map +1 -1
- package/dist/parser/file-lock.js +9 -2
- package/dist/parser/file-lock.js.map +1 -1
- package/dist/parser/index.d.ts +6 -0
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +6 -0
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/plans.d.ts.map +1 -1
- package/dist/parser/plans.js +1 -0
- package/dist/parser/plans.js.map +1 -1
- package/dist/parser/refs.d.ts +8 -1
- package/dist/parser/refs.d.ts.map +1 -1
- package/dist/parser/refs.js +27 -1
- package/dist/parser/refs.js.map +1 -1
- package/dist/parser/review-operations.d.ts +72 -0
- package/dist/parser/review-operations.d.ts.map +1 -0
- package/dist/parser/review-operations.js +185 -0
- package/dist/parser/review-operations.js.map +1 -0
- package/dist/parser/review-task-integration.d.ts +78 -0
- package/dist/parser/review-task-integration.d.ts.map +1 -0
- package/dist/parser/review-task-integration.js +173 -0
- package/dist/parser/review-task-integration.js.map +1 -0
- package/dist/parser/review-threads.d.ts +101 -0
- package/dist/parser/review-threads.d.ts.map +1 -0
- package/dist/parser/review-threads.js +222 -0
- package/dist/parser/review-threads.js.map +1 -0
- package/dist/parser/review-validation.d.ts +69 -0
- package/dist/parser/review-validation.d.ts.map +1 -0
- package/dist/parser/review-validation.js +207 -0
- package/dist/parser/review-validation.js.map +1 -0
- package/dist/parser/reviews.d.ts +58 -0
- package/dist/parser/reviews.d.ts.map +1 -0
- package/dist/parser/reviews.js +230 -0
- package/dist/parser/reviews.js.map +1 -0
- package/dist/parser/session-branch.d.ts +91 -0
- package/dist/parser/session-branch.d.ts.map +1 -0
- package/dist/parser/session-branch.js +565 -0
- package/dist/parser/session-branch.js.map +1 -0
- package/dist/parser/session-sync-scheduler.d.ts +53 -0
- package/dist/parser/session-sync-scheduler.d.ts.map +1 -0
- package/dist/parser/session-sync-scheduler.js +100 -0
- package/dist/parser/session-sync-scheduler.js.map +1 -0
- package/dist/parser/setup-status.d.ts +7 -1
- package/dist/parser/setup-status.d.ts.map +1 -1
- package/dist/parser/setup-status.js +104 -39
- package/dist/parser/setup-status.js.map +1 -1
- package/dist/parser/shadow-sync-scheduler.d.ts +71 -0
- package/dist/parser/shadow-sync-scheduler.d.ts.map +1 -0
- package/dist/parser/shadow-sync-scheduler.js +139 -0
- package/dist/parser/shadow-sync-scheduler.js.map +1 -0
- package/dist/parser/shadow.d.ts +121 -14
- package/dist/parser/shadow.d.ts.map +1 -1
- package/dist/parser/shadow.js +752 -27
- package/dist/parser/shadow.js.map +1 -1
- package/dist/parser/skill-render.d.ts +24 -0
- package/dist/parser/skill-render.d.ts.map +1 -1
- package/dist/parser/skill-render.js +98 -26
- package/dist/parser/skill-render.js.map +1 -1
- package/dist/parser/validate.d.ts +43 -3
- package/dist/parser/validate.d.ts.map +1 -1
- package/dist/parser/validate.js +204 -30
- package/dist/parser/validate.js.map +1 -1
- package/dist/parser/yaml.d.ts +47 -11
- package/dist/parser/yaml.d.ts.map +1 -1
- package/dist/parser/yaml.js +329 -149
- package/dist/parser/yaml.js.map +1 -1
- package/dist/review/checks.d.ts +97 -0
- package/dist/review/checks.d.ts.map +1 -0
- package/dist/review/checks.js +175 -0
- package/dist/review/checks.js.map +1 -0
- package/dist/review/index.d.ts +3 -0
- package/dist/review/index.d.ts.map +1 -0
- package/dist/review/index.js +3 -0
- package/dist/review/index.js.map +1 -0
- package/dist/review/subject-bindings.d.ts +83 -0
- package/dist/review/subject-bindings.d.ts.map +1 -0
- package/dist/review/subject-bindings.js +175 -0
- package/dist/review/subject-bindings.js.map +1 -0
- package/dist/schema/common.d.ts +26 -0
- package/dist/schema/common.d.ts.map +1 -1
- package/dist/schema/common.js +13 -0
- package/dist/schema/common.js.map +1 -1
- package/dist/schema/dispatch-workspace.d.ts +2643 -0
- package/dist/schema/dispatch-workspace.d.ts.map +1 -0
- package/dist/schema/dispatch-workspace.js +187 -0
- package/dist/schema/dispatch-workspace.js.map +1 -0
- package/dist/schema/inbox.d.ts +8 -8
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +2 -0
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/meta.d.ts +663 -116
- package/dist/schema/meta.d.ts.map +1 -1
- package/dist/schema/meta.js +28 -0
- package/dist/schema/meta.js.map +1 -1
- package/dist/schema/plan.d.ts +30 -19
- package/dist/schema/plan.d.ts.map +1 -1
- package/dist/schema/plan.js +3 -1
- package/dist/schema/plan.js.map +1 -1
- package/dist/schema/review-records.d.ts +2676 -0
- package/dist/schema/review-records.d.ts.map +1 -0
- package/dist/schema/review-records.js +232 -0
- package/dist/schema/review-records.js.map +1 -0
- package/dist/schema/spec.d.ts +32 -14
- package/dist/schema/spec.d.ts.map +1 -1
- package/dist/schema/spec.js +5 -0
- package/dist/schema/spec.js.map +1 -1
- package/dist/schema/task.d.ts +187 -29
- package/dist/schema/task.d.ts.map +1 -1
- package/dist/schema/task.js +12 -2
- package/dist/schema/task.js.map +1 -1
- package/dist/schema/triage.d.ts +22 -22
- package/dist/sessions/cache.d.ts +119 -0
- package/dist/sessions/cache.d.ts.map +1 -0
- package/dist/sessions/cache.js +284 -0
- package/dist/sessions/cache.js.map +1 -0
- package/dist/sessions/index.d.ts +1 -0
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +2 -0
- package/dist/sessions/index.js.map +1 -1
- package/dist/sessions/legacy.d.ts +77 -0
- package/dist/sessions/legacy.d.ts.map +1 -0
- package/dist/sessions/legacy.js +146 -0
- package/dist/sessions/legacy.js.map +1 -0
- package/dist/sessions/store.d.ts +115 -71
- package/dist/sessions/store.d.ts.map +1 -1
- package/dist/sessions/store.js +357 -182
- package/dist/sessions/store.js.map +1 -1
- package/dist/sessions/types.d.ts +44 -16
- package/dist/sessions/types.d.ts.map +1 -1
- package/dist/sessions/types.js +11 -2
- package/dist/sessions/types.js.map +1 -1
- package/dist/strings/errors.d.ts +32 -0
- package/dist/strings/errors.d.ts.map +1 -1
- package/dist/strings/errors.js +17 -0
- package/dist/strings/errors.js.map +1 -1
- package/dist/strings/labels.d.ts +1 -0
- package/dist/strings/labels.d.ts.map +1 -1
- package/dist/strings/labels.js +1 -0
- package/dist/strings/labels.js.map +1 -1
- package/dist/utils/activity.d.ts +101 -0
- package/dist/utils/activity.d.ts.map +1 -0
- package/dist/utils/activity.js +408 -0
- package/dist/utils/activity.js.map +1 -0
- package/dist/utils/git.d.ts +31 -0
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +87 -0
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/web-ui/_app/immutable/assets/0.tmlwn-Ih.css +1 -0
- package/dist/web-ui/_app/immutable/assets/9.BwwJybWx.css +1 -0
- package/dist/web-ui/_app/immutable/chunks/2KqE8gtn.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/70-t_QvE.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/AiWQj974.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/B25nWFyA.js +5 -0
- package/dist/web-ui/_app/immutable/chunks/B2bcA_Q_.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/B5e5HYyB.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/B7-5z6eA.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/B7bGmhK0.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/B8tYZKAE.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/BFGAyJjD.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/BG0850zf.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/BG8eSzAd.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/BIMxXS8I.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/BSzL1fpU.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/BYtjHfeq.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/{D1ArdqNb.js → Bp5pFYXL.js} +1 -1
- package/dist/web-ui/_app/immutable/chunks/BsJFsuAT.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/BvpNHcD6.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/BypqA25-.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/C0w6WDm5.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/C5_PAZ0y.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/CDRO15Iv.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/CF1CoqD5.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/CS2sa4_m.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/CWUQwB9H.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/CY5FDdSU.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/C_7MTDoj.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/CaAJD3dl.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/{i-XnOIX0.js → ChB5iyEL.js} +1 -1
- package/dist/web-ui/_app/immutable/chunks/ChQD-6N8.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/{BCkp8Hs8.js → CqbsoCwA.js} +1 -1
- package/dist/web-ui/_app/immutable/chunks/DCeJW50p.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/DJtZNgcs.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/DKIeaprD.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/DLd2uVIA.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/DW_subyT.js +2 -0
- package/dist/web-ui/_app/immutable/chunks/DbU6lVn0.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/Dc7ZCC5m.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/Dd5umPsk.js +2 -0
- package/dist/web-ui/_app/immutable/chunks/Dg_zDpDS.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/Dgqu8Yuc.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/DmxsPZTB.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/DphTaFUB.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/DqK4iHp0.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/DqT6OH_u.js +2 -0
- package/dist/web-ui/_app/immutable/chunks/Ds9I9wQb.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/Du5ng3u4.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/DxJw79Wi.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/GFTX8GgV.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/HNjs76Zz.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/HVMjDi4_.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/P0A_fJvS.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/T3vGWjIL.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/VTmrX9Qu.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/Xvwhx_F1.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/Yyz1XMQA.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/dh5HeqUr.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/fZMteyca.js +62 -0
- package/dist/web-ui/_app/immutable/chunks/{D28BF5MJ.js → gPrj-hqC.js} +1 -1
- package/dist/web-ui/_app/immutable/chunks/htcWMiYN.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/oTsvd9y4.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/qJfLUwU4.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/xCtiO_JE.js +1 -0
- package/dist/web-ui/_app/immutable/chunks/y4GeEH6k.js +1 -0
- package/dist/web-ui/_app/immutable/entry/app.C4h_eOn6.js +2 -0
- package/dist/web-ui/_app/immutable/entry/start.CQFTf9ep.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/0.Dh1xO970.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/1.l75D3Opx.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/10.DBidBPc-.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/11.Ab0gUKWe.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/12.CMsnoxfs.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/13.D8YKuknB.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/14.DZ0aan7y.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/15.CUIKreDL.js +2 -0
- package/dist/web-ui/_app/immutable/nodes/16.BWc8--BO.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/2.CDUonbuh.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/3.Ctg3M00i.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/4.Ci-JDwbA.js +2 -0
- package/dist/web-ui/_app/immutable/nodes/5.CTyEDAq0.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/6.BTZZqsAb.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/7.BI52g_Jo.js +137 -0
- package/dist/web-ui/_app/immutable/nodes/8.3hZPaB9x.js +1 -0
- package/dist/web-ui/_app/immutable/nodes/9.DS49kvwl.js +29 -0
- package/dist/web-ui/_app/version.json +1 -1
- package/dist/web-ui/favicon-192.png +0 -0
- package/dist/web-ui/favicon-32.png +0 -0
- package/dist/web-ui/favicon.ico +0 -0
- package/dist/web-ui/index.html +14 -11
- package/package.json +14 -7
- package/plugin/.claude-plugin/marketplace.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugins/kspec/skills/merge/SKILL.md +127 -0
- package/plugin/plugins/kspec/skills/plan/SKILL.md +55 -26
- package/plugin/plugins/kspec/skills/review/SKILL.md +350 -133
- package/plugin/plugins/kspec/skills/task-work/SKILL.md +96 -106
- package/templates/agents-sections/04-pr-workflow.md +15 -12
- package/templates/agents-sections/06-ralph-loop.md +15 -10
- package/templates/skills/manifest.yaml +25 -7
- package/templates/skills/merge/SKILL.md +120 -0
- package/templates/skills/plan/SKILL.md +55 -26
- package/templates/skills/review/SKILL.md +346 -130
- package/templates/skills/task-work/SKILL.md +93 -103
- package/dist/web-ui/_app/immutable/assets/0.BxCxvrZR.css +0 -1
- package/dist/web-ui/_app/immutable/chunks/B-CZR0q8.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/B1IR5Su5.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/B_Cvvtc4.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/BtFaGGII.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/Bu8JVsCH.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/C87u-CNA.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/CrFkBTYp.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/D6RtLpzL.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/D7FHSgx2.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/DBXrsxZQ.js +0 -2
- package/dist/web-ui/_app/immutable/chunks/Da_hHMuA.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/Do6LchSF.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/DoNPtcAw.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/DtUbXRZz.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/DyFPRlLl.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/DzAP8lRM.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/DzVXElzN.js +0 -2
- package/dist/web-ui/_app/immutable/chunks/aoPBFken.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/laxtrUO3.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/q1nIWgqB.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/sTLbk5Nm.js +0 -1
- package/dist/web-ui/_app/immutable/chunks/vwKgQu5P.js +0 -5
- package/dist/web-ui/_app/immutable/entry/app.BCwMcqnT.js +0 -2
- package/dist/web-ui/_app/immutable/entry/start.wKCQH-tt.js +0 -1
- package/dist/web-ui/_app/immutable/nodes/0.CjGVMG74.js +0 -1
- package/dist/web-ui/_app/immutable/nodes/1.B6_AIPan.js +0 -1
- package/dist/web-ui/_app/immutable/nodes/2.q4oCS7Ws.js +0 -1
- package/dist/web-ui/_app/immutable/nodes/3.rTKZf9o2.js +0 -1
- package/dist/web-ui/_app/immutable/nodes/4.DVIDRu1d.js +0 -1
- package/dist/web-ui/_app/immutable/nodes/5.8PtPXIOd.js +0 -1
- package/dist/web-ui/_app/immutable/nodes/6.ZZrTemy_.js +0 -1
- package/dist/web-ui/_app/immutable/nodes/7.IP-gxCxi.js +0 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import{f as E,c as je,a as w,t as we}from"../chunks/y4GeEH6k.js";import{p as us,f as q,g as d,r as O,a as ds,c as L,s as N,t as x,n as re,e as kn,b as it,Q as mt,u as le,P as _i,d as ge}from"../chunks/CaAJD3dl.js";import{s as D,d as ki}from"../chunks/DqT6OH_u.js";import{i as R,s as Sn,r as $n}from"../chunks/Dg_zDpDS.js";import{h as Xe,j as ot,p as jt,B as Ve,l as Nn,a as Si,i as $i,b as Ni,aJ as Oi,q as Ai,s as Ti,A as Ii,aK as Li,aL as Ei,d as Ci}from"../chunks/Dd5umPsk.js";import{s as Mi,a as Pi}from"../chunks/ChQD-6N8.js";import{b as as}from"../chunks/CDRO15Iv.js";import{g as Bi}from"../chunks/BsJFsuAT.js";import{p as xi}from"../chunks/gPrj-hqC.js";import{C as ts}from"../chunks/CF1CoqD5.js";import{C as ss}from"../chunks/Du5ng3u4.js";import{C as ns}from"../chunks/DKIeaprD.js";import{B as Os}from"../chunks/P0A_fJvS.js";import{S as Je}from"../chunks/BG8eSzAd.js";import{h as nn,r as rn}from"../chunks/fZMteyca.js";import{I as On}from"../chunks/C5_PAZ0y.js";import{C as ji}from"../chunks/BvpNHcD6.js";import{F as Ki}from"../chunks/Dc7ZCC5m.js";const Di=!1,pa=Object.freeze(Object.defineProperty({__proto__:null,ssr:Di},Symbol.toStringTag,{value:"Module"})),Ds=Symbol.for("yaml.alias"),Ms=Symbol.for("yaml.document"),Ze=Symbol.for("yaml.map"),An=Symbol.for("yaml.pair"),Ke=Symbol.for("yaml.scalar"),Nt=Symbol.for("yaml.seq"),Se=Symbol.for("yaml.node.type"),ft=n=>!!n&&typeof n=="object"&&n[Se]===Ds,hs=n=>!!n&&typeof n=="object"&&n[Se]===Ms,Vt=n=>!!n&&typeof n=="object"&&n[Se]===Ze,Q=n=>!!n&&typeof n=="object"&&n[Se]===An,V=n=>!!n&&typeof n=="object"&&n[Se]===Ke,Jt=n=>!!n&&typeof n=="object"&&n[Se]===Nt;function Y(n){if(n&&typeof n=="object")switch(n[Se]){case Ze:case Nt:return!0}return!1}function G(n){if(n&&typeof n=="object")switch(n[Se]){case Ds:case Ze:case Ke:case Nt:return!0}return!1}const Tn=n=>(V(n)||Y(n))&&!!n.anchor,rt=Symbol("break visit"),Ui=Symbol("skip children"),Ut=Symbol("remove node");function Ot(n,e){const t=Fi(e);hs(n)?bt(null,n.contents,t,Object.freeze([n]))===Ut&&(n.contents=null):bt(null,n,t,Object.freeze([]))}Ot.BREAK=rt;Ot.SKIP=Ui;Ot.REMOVE=Ut;function bt(n,e,t,s){const i=Ri(n,e,t,s);if(G(i)||Q(i))return qi(n,s,i),bt(n,i,t,s);if(typeof i!="symbol"){if(Y(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){const o=bt(r,e.items[r],t,s);if(typeof o=="number")r=o-1;else{if(o===rt)return rt;o===Ut&&(e.items.splice(r,1),r-=1)}}}else if(Q(e)){s=Object.freeze(s.concat(e));const r=bt("key",e.key,t,s);if(r===rt)return rt;r===Ut&&(e.key=null);const o=bt("value",e.value,t,s);if(o===rt)return rt;o===Ut&&(e.value=null)}}return i}function Fi(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function Ri(n,e,t,s){if(typeof t=="function")return t(n,e,s);if(Vt(e))return t.Map?.(n,e,s);if(Jt(e))return t.Seq?.(n,e,s);if(Q(e))return t.Pair?.(n,e,s);if(V(e))return t.Scalar?.(n,e,s);if(ft(e))return t.Alias?.(n,e,s)}function qi(n,e,t){const s=e[e.length-1];if(Y(s))s.items[n]=t;else if(Q(s))n==="key"?s.key=t:s.value=t;else if(hs(s))s.contents=t;else{const i=ft(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Vi={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ji=n=>n.replace(/[!,[\]{}]/g,e=>Vi[e]);class ce{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ce.defaultYaml,e),this.tags=Object.assign({},ce.defaultTags,t)}clone(){const e=new ce(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new ce(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ce.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ce.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:ce.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ce.defaultTags),this.atNextDocument=!1);const s=e.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}const[,s,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);const r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return s==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+Ji(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(e&&s.length>0&&G(e.contents)){const r={};Ot(e.contents,(o,a)=>{G(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
|
|
2
|
+
`)}}ce.defaultYaml={explicit:!1,version:"1.2"};ce.defaultTags={"!!":"tag:yaml.org,2002:"};function In(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function Ln(n){const e=new Set;return Ot(n,{Value(t,s){s.anchor&&e.add(s.anchor)}}),e}function En(n,e){for(let t=1;;++t){const s=`${n}${t}`;if(!e.has(s))return s}}function Yi(n,e){const t=[],s=new Map;let i=null;return{onAnchor:r=>{t.push(r),i??(i=Ln(n));const o=En(e,i);return i.add(o),o},setAnchors:()=>{for(const r of t){const o=s.get(r);if(typeof o=="object"&&o.anchor&&(V(o.node)||Y(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:s}}function vt(n,e,t,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){const o=s[i],a=vt(n,s,String(i),o);a===void 0?delete s[i]:a!==o&&(s[i]=a)}else if(s instanceof Map)for(const i of Array.from(s.keys())){const r=s.get(i),o=vt(n,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(const i of Array.from(s)){const r=vt(n,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(const[i,r]of Object.entries(s)){const o=vt(n,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return n.call(e,t,s)}function ke(n,e,t){if(Array.isArray(n))return n.map((s,i)=>ke(s,String(i),t));if(n&&typeof n.toJSON=="function"){if(!t||!Tn(n))return n.toJSON(e,t);const s={aliasCount:0,count:1,res:void 0};t.anchors.set(n,s),t.onCreate=r=>{s.res=r,delete t.onCreate};const i=n.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof n=="bigint"&&!t?.keep?Number(n):n}class Us{constructor(e){Object.defineProperty(this,Se,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!hs(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=ke(this,"",o);if(typeof i=="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?vt(r,{"":a},"",a):a}}class Fs extends Us{constructor(e){super(Ds),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let s;t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],Ot(e,{Node:(r,o)=>{(ft(o)||Tn(o))&&s.push(o)}}),t&&(t.aliasResolveCache=s));let i;for(const r of s){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};const{anchors:s,doc:i,maxAliasCount:r}=t,o=this.resolve(i,t);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=s.get(o);if(a||(ke(o,null,t),a=s.get(o)),a?.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=is(i,o,s)),a.count*a.aliasCount>r)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,s){const i=`*${this.source}`;if(e){if(In(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}}function is(n,e,t){if(ft(e)){const s=e.resolve(n),i=t&&s&&t.get(s);return i?i.count*i.aliasCount:0}else if(Y(e)){let s=0;for(const i of e.items){const r=is(n,i,t);r>s&&(s=r)}return s}else if(Q(e)){const s=is(n,e.key,t),i=is(n,e.value,t);return Math.max(s,i)}return 1}const Cn=n=>!n||typeof n!="function"&&typeof n!="object";class M extends Us{constructor(e){super(Ke),this.value=e}toJSON(e,t){return t?.keep?this.value:ke(this.value,e,t)}toString(){return String(this.value)}}M.BLOCK_FOLDED="BLOCK_FOLDED";M.BLOCK_LITERAL="BLOCK_LITERAL";M.PLAIN="PLAIN";M.QUOTE_DOUBLE="QUOTE_DOUBLE";M.QUOTE_SINGLE="QUOTE_SINGLE";const Gi="tag:yaml.org,2002:";function Qi(n,e,t){if(e){const s=t.filter(r=>r.tag===e),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(s=>s.identify?.(n)&&!s.format)}function Rt(n,e,t){if(hs(n)&&(n=n.contents),G(n))return n;if(Q(n)){const f=t.schema[Ze].createNode?.(t.schema,null,t);return f.items.push(n),f}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t;let l;if(s&&n&&typeof n=="object"){if(l=a.get(n),l)return l.anchor??(l.anchor=i(n)),new Fs(l.anchor);l={anchor:null,node:null},a.set(n,l)}e?.startsWith("!!")&&(e=Gi+e.slice(2));let c=Qi(n,e,o.tags);if(!c){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){const f=new M(n);return l&&(l.node=f),f}c=n instanceof Map?o[Ze]:Symbol.iterator in Object(n)?o[Nt]:o[Ze]}r&&(r(c),delete t.onTagObj);const p=c?.createNode?c.createNode(t.schema,n,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,n,t):new M(n);return e?p.tag=e:c.default||(p.tag=c.tag),l&&(l.node=p),p}function ls(n,e,t){let s=t;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return Rt(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}const Kt=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done;class Mn extends Us{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(s=>G(s)||Q(s)?s.clone(e):s),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Kt(e))this.add(t);else{const[s,...i]=e,r=this.get(s,!0);if(Y(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(s,ls(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(e){const[t,...s]=e;if(s.length===0)return this.delete(t);const i=this.get(t,!0);if(Y(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){const[s,...i]=e,r=this.get(s,!0);return i.length===0?!t&&V(r)?r.value:r:Y(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Q(t))return!1;const s=t.value;return s==null||e&&V(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){const[t,...s]=e;if(s.length===0)return this.has(t);const i=this.get(t,!0);return Y(i)?i.hasIn(s):!1}setIn(e,t){const[s,...i]=e;if(i.length===0)this.set(s,t);else{const r=this.get(s,!0);if(Y(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(s,ls(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}}const Hi=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function Ye(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}const at=(n,e,t)=>n.endsWith(`
|
|
3
|
+
`)?Ye(t,e):t.includes(`
|
|
4
|
+
`)?`
|
|
5
|
+
`+Ye(t,e):(n.endsWith(" ")?"":" ")+t,Pn="flow",Ps="block",rs="quoted";function ps(n,e,t="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return n;i<r&&(r=0);const l=Math.max(1+r,1+i-e.length);if(n.length<=l)return n;const c=[],p={};let f=i-e.length;typeof s=="number"&&(s>i-Math.max(2,r)?c.push(0):f=i-s);let u,g,y=!1,h=-1,m=-1,_=-1;t===Ps&&(h=on(n,h,e.length),h!==-1&&(f=h+l));for(let $;$=n[h+=1];){if(t===rs&&$==="\\"){switch(m=h,n[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}_=h}if($===`
|
|
6
|
+
`)t===Ps&&(h=on(n,h,e.length)),f=h+e.length+l,u=void 0;else{if($===" "&&g&&g!==" "&&g!==`
|
|
7
|
+
`&&g!==" "){const A=n[h+1];A&&A!==" "&&A!==`
|
|
8
|
+
`&&A!==" "&&(u=h)}if(h>=f)if(u)c.push(u),f=u+l,u=void 0;else if(t===rs){for(;g===" "||g===" ";)g=$,$=n[h+=1],y=!0;const A=h>_+1?h-2:m-1;if(p[A])return n;c.push(A),p[A]=!0,f=A+l,u=void 0}else y=!0}g=$}if(y&&a&&a(),c.length===0)return n;o&&o();let k=n.slice(0,c[0]);for(let $=0;$<c.length;++$){const A=c[$],T=c[$+1]||n.length;A===0?k=`
|
|
9
|
+
${e}${n.slice(0,T)}`:(t===rs&&p[A]&&(k+=`${n[A]}\\`),k+=`
|
|
10
|
+
${e}${n.slice(A+1,T)}`)}return k}function on(n,e,t){let s=e,i=e+1,r=n[i];for(;r===" "||r===" ";)if(e<i+t)r=n[++e];else{do r=n[++e];while(r&&r!==`
|
|
11
|
+
`);s=e,i=e+1,r=n[i]}return s}const ms=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),gs=n=>/^(%|---|\.\.\.)/m.test(n);function Wi(n,e,t){if(!e||e<0)return!1;const s=e-t,i=n.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(n[r]===`
|
|
12
|
+
`){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}function Ft(n,e){const t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:s}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(gs(n)?" ":"");let o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);const p=t.substr(l+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||t[l+2]==='"'||t.length<i)l+=1;else{for(o+=t.slice(a,l)+`
|
|
13
|
+
|
|
14
|
+
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
|
|
15
|
+
`,l+=2;o+=r,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,s?o:ps(o,r,rs,ms(e,!1))}function Bs(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test(n))return Ft(n,e);const t=e.indent||(gs(n)?" ":""),s="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
|
+
${t}`)+"'";return e.implicitKey?s:ps(s,t,Pn,ms(e,!1))}function wt(n,e){const{singleQuote:t}=e.options;let s;if(t===!1)s=Ft;else{const i=n.includes('"'),r=n.includes("'");i&&!r?s=Bs:r&&!i?s=Ft:s=t?Bs:Ft}return s(n,e)}let xs;try{xs=new RegExp(`(^|(?<!
|
|
18
|
+
))
|
|
19
|
+
+(?!
|
|
20
|
+
|$)`,"g")}catch{xs=/\n+(?!\n|$)/g}function os({comment:n,type:e,value:t},s,i,r){const{blockQuote:o,commentString:a,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(t))return wt(t,s);const c=s.indent||(s.forceBlockIndent||gs(t)?" ":""),p=o==="literal"?!0:o==="folded"||e===M.BLOCK_FOLDED?!1:e===M.BLOCK_LITERAL?!0:!Wi(t,l,c.length);if(!t)return p?`|
|
|
21
|
+
`:`>
|
|
22
|
+
`;let f,u;for(u=t.length;u>0;--u){const T=t[u-1];if(T!==`
|
|
23
|
+
`&&T!==" "&&T!==" ")break}let g=t.substring(u);const y=g.indexOf(`
|
|
24
|
+
`);y===-1?f="-":t===g||y!==g.length-1?(f="+",r&&r()):f="",g&&(t=t.slice(0,-g.length),g[g.length-1]===`
|
|
25
|
+
`&&(g=g.slice(0,-1)),g=g.replace(xs,`$&${c}`));let h=!1,m,_=-1;for(m=0;m<t.length;++m){const T=t[m];if(T===" ")h=!0;else if(T===`
|
|
26
|
+
`)_=m;else break}let k=t.substring(0,_<m?_+1:m);k&&(t=t.substring(k.length),k=k.replace(/\n+/g,`$&${c}`));let A=(h?c?"2":"1":"")+f;if(n&&(A+=" "+a(n.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const T=t.replace(/\n+/g,`
|
|
27
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let I=!1;const P=ms(s,!0);o!=="folded"&&e!==M.BLOCK_FOLDED&&(P.onOverflow=()=>{I=!0});const b=ps(`${k}${T}${g}`,c,Ps,P);if(!I)return`>${A}
|
|
28
|
+
${c}${b}`}return t=t.replace(/\n+/g,`$&${c}`),`|${A}
|
|
29
|
+
${c}${k}${t}${g}`}function zi(n,e,t,s){const{type:i,value:r}=n,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:p}=e;if(a&&r.includes(`
|
|
30
|
+
`)||p&&/[[\]{},]/.test(r))return wt(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||p||!r.includes(`
|
|
31
|
+
`)?wt(r,e):os(n,e,t,s);if(!a&&!p&&i!==M.PLAIN&&r.includes(`
|
|
32
|
+
`))return os(n,e,t,s);if(gs(r)){if(l==="")return e.forceBlockIndent=!0,os(n,e,t,s);if(a&&l===c)return wt(r,e)}const f=r.replace(/\n+/g,`$&
|
|
33
|
+
${l}`);if(o){const u=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(f),{compat:g,tags:y}=e.doc.schema;if(y.some(u)||g?.some(u))return wt(r,e)}return a?f:ps(f,l,Pn,ms(e,!1))}function Rs(n,e,t,s){const{implicitKey:i,inFlow:r}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)});let{type:a}=n;a!==M.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=M.QUOTE_DOUBLE);const l=p=>{switch(p){case M.BLOCK_FOLDED:case M.BLOCK_LITERAL:return i||r?wt(o.value,e):os(o,e,t,s);case M.QUOTE_DOUBLE:return Ft(o.value,e);case M.QUOTE_SINGLE:return Bs(o.value,e);case M.PLAIN:return zi(o,e,t,s);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:p,defaultStringType:f}=e.options,u=i&&p||f;if(c=l(u),c===null)throw new Error(`Unsupported default string type ${u}`)}return c}function Bn(n,e){const t=Object.assign({blockQuote:!0,commentString:Hi,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e);let s;switch(t.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:s,options:t}}function Xi(n,e){if(e.tag){const i=n.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,s;if(V(e)){s=e.value;let i=n.filter(r=>r.identify?.(s));if(i.length>1){const r=i.filter(o=>o.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else s=e,t=n.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!t){const i=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return t}function Zi(n,e,{anchors:t,doc:s}){if(!s.directives)return"";const i=[],r=(V(n)||Y(n))&&n.anchor;r&&In(r)&&(t.add(r),i.push(`&${r}`));const o=n.tag??(e.default?null:e.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}function St(n,e,t,s){if(Q(n))return n.toString(e,t,s);if(ft(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let i;const r=G(n)?n:e.doc.createNode(n,{onTagObj:l=>i=l});i??(i=Xi(e.doc.schema.tags,r));const o=Zi(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(r,e,t,s):V(r)?Rs(r,e,t,s):r.toString(e,t,s);return o?V(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
34
|
+
${e.indent}${a}`:a}function er({key:n,value:e},t,s,i){const{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:p,simpleKeys:f}}=t;let u=G(n)&&n.comment||null;if(f){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(Y(n)||!G(n)&&typeof n=="object"){const P="With simple keys, collection cannot be used as a key value";throw new Error(P)}}let g=!f&&(!n||u&&e==null&&!t.inFlow||Y(n)||(V(n)?n.type===M.BLOCK_FOLDED||n.type===M.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!g&&(f||!r),indent:a+l});let y=!1,h=!1,m=St(n,t,()=>y=!0,()=>h=!0);if(!g&&!t.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(t.inFlow){if(r||e==null)return y&&s&&s(),m===""?"?":g?`? ${m}`:m}else if(r&&!f||e==null&&g)return m=`? ${m}`,u&&!y?m+=at(m,t.indent,c(u)):h&&i&&i(),m;y&&(u=null),g?(u&&(m+=at(m,t.indent,c(u))),m=`? ${m}
|
|
35
|
+
${a}:`):(m=`${m}:`,u&&(m+=at(m,t.indent,c(u))));let _,k,$;G(e)?(_=!!e.spaceBefore,k=e.commentBefore,$=e.comment):(_=!1,k=null,$=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!g&&!u&&V(e)&&(t.indentAtStart=m.length+1),h=!1,!p&&l.length>=2&&!t.inFlow&&!g&&Jt(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let A=!1;const T=St(e,t,()=>A=!0,()=>h=!0);let I=" ";if(u||_||k){if(I=_?`
|
|
36
|
+
`:"",k){const P=c(k);I+=`
|
|
37
|
+
${Ye(P,t.indent)}`}T===""&&!t.inFlow?I===`
|
|
38
|
+
`&&$&&(I=`
|
|
39
|
+
|
|
40
|
+
`):I+=`
|
|
41
|
+
${t.indent}`}else if(!g&&Y(e)){const P=T[0],b=T.indexOf(`
|
|
42
|
+
`),j=b!==-1,ne=t.inFlow??e.flow??e.items.length===0;if(j||!ne){let W=!1;if(j&&(P==="&"||P==="!")){let B=T.indexOf(" ");P==="&"&&B!==-1&&B<b&&T[B+1]==="!"&&(B=T.indexOf(" ",B+1)),(B===-1||b<B)&&(W=!0)}W||(I=`
|
|
43
|
+
${t.indent}`)}}else(T===""||T[0]===`
|
|
44
|
+
`)&&(I="");return m+=I+T,t.inFlow?A&&s&&s():$&&!A?m+=at(m,t.indent,c($)):h&&i&&i(),m}function xn(n,e){(n==="debug"||n==="warn")&&console.warn(e)}const Wt="<<",Ge={identify:n=>n===Wt||typeof n=="symbol"&&n.description===Wt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new M(Symbol(Wt)),{addToJSMap:jn}),stringify:()=>Wt},tr=(n,e)=>(Ge.identify(e)||V(e)&&(!e.type||e.type===M.PLAIN)&&Ge.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===Ge.tag&&t.default);function jn(n,e,t){if(t=n&&ft(t)?t.resolve(n.doc):t,Jt(t))for(const s of t.items)As(n,e,s);else if(Array.isArray(t))for(const s of t)As(n,e,s);else As(n,e,t)}function As(n,e,t){const s=n&&ft(t)?t.resolve(n.doc):t;if(!Vt(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,n,Map);for(const[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Kn(n,e,{key:t,value:s}){if(G(t)&&t.addToJSMap)t.addToJSMap(n,e,s);else if(tr(n,t))jn(n,e,s);else{const i=ke(t,"",n);if(e instanceof Map)e.set(i,ke(s,i,n));else if(e instanceof Set)e.add(i);else{const r=sr(t,i,n),o=ke(s,r,n);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function sr(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(G(n)&&t?.doc){const s=Bn(t.doc,{});s.anchors=new Set;for(const r of t.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;const i=n.toString(s);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),xn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}function qs(n,e,t){const s=Rt(n,void 0,t),i=Rt(e,void 0,t);return new fe(s,i)}class fe{constructor(e,t=null){Object.defineProperty(this,Se,{value:An}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return G(t)&&(t=t.clone(e)),G(s)&&(s=s.clone(e)),new fe(t,s)}toJSON(e,t){const s=t?.mapAsMap?new Map:{};return Kn(t,s,this)}toString(e,t,s){return e?.doc?er(this,e,t,s):JSON.stringify(this)}}function Dn(n,e,t){return(e.inFlow??n.flow?ir:nr)(n,e,t)}function nr({comment:n,items:e},t,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=t,p=Object.assign({},t,{indent:r,type:null});let f=!1;const u=[];for(let y=0;y<e.length;++y){const h=e[y];let m=null;if(G(h))!f&&h.spaceBefore&&u.push(""),cs(t,u,h.commentBefore,f),h.comment&&(m=h.comment);else if(Q(h)){const k=G(h.key)?h.key:null;k&&(!f&&k.spaceBefore&&u.push(""),cs(t,u,k.commentBefore,f))}f=!1;let _=St(h,p,()=>m=null,()=>f=!0);m&&(_+=at(_,r,c(m))),f&&m&&(f=!1),u.push(s+_)}let g;if(u.length===0)g=i.start+i.end;else{g=u[0];for(let y=1;y<u.length;++y){const h=u[y];g+=h?`
|
|
45
|
+
${l}${h}`:`
|
|
46
|
+
`}}return n?(g+=`
|
|
47
|
+
`+Ye(c(n),l),a&&a()):f&&o&&o(),g}function ir({items:n},e,{flowChars:t,itemIndent:s}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;s+=r;const l=Object.assign({},e,{indent:s,inFlow:!0,type:null});let c=!1,p=0;const f=[];for(let y=0;y<n.length;++y){const h=n[y];let m=null;if(G(h))h.spaceBefore&&f.push(""),cs(e,f,h.commentBefore,!1),h.comment&&(m=h.comment);else if(Q(h)){const k=G(h.key)?h.key:null;k&&(k.spaceBefore&&f.push(""),cs(e,f,k.commentBefore,!1),k.comment&&(c=!0));const $=G(h.value)?h.value:null;$?($.comment&&(m=$.comment),$.commentBefore&&(c=!0)):h.value==null&&k?.comment&&(m=k.comment)}m&&(c=!0);let _=St(h,l,()=>m=null);y<n.length-1&&(_+=","),m&&(_+=at(_,s,a(m))),!c&&(f.length>p||_.includes(`
|
|
48
|
+
`))&&(c=!0),f.push(_),p=f.length}const{start:u,end:g}=t;if(f.length===0)return u+g;if(!c){const y=f.reduce((h,m)=>h+m.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=u;for(const h of f)y+=h?`
|
|
49
|
+
${r}${i}${h}`:`
|
|
50
|
+
`;return`${y}
|
|
51
|
+
${i}${g}`}else return`${u}${o}${f.join(" ")}${o}${g}`}function cs({indent:n,options:{commentString:e}},t,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const r=Ye(e(s),n);t.push(r.trimStart())}}function lt(n,e){const t=V(e)?e.value:e;for(const s of n)if(Q(s)&&(s.key===e||s.key===t||V(s.key)&&s.key.value===t))return s}class _e extends Mn{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ze,e),this.items=[]}static from(e,t,s){const{keepUndefined:i,replacer:r}=s,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(qs(l,c,s))};if(t instanceof Map)for(const[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(const l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let s;Q(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new fe(e,e?.value):s=new fe(e.key,e.value);const i=lt(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${s.key} already set`);V(i.value)&&Cn(s.value)?i.value.value=s.value:i.value=s.value}else if(r){const o=this.items.findIndex(a=>r(s,a)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){const t=lt(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const i=lt(this.items,e)?.value;return(!t&&V(i)?i.value:i)??void 0}has(e){return!!lt(this.items,e)}set(e,t){this.add(new fe(e,t),!0)}toJSON(e,t,s){const i=s?new s:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(const r of this.items)Kn(t,i,r);return i}toString(e,t,s){if(!e)return JSON.stringify(this);for(const i of this.items)if(!Q(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Dn(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}}const At={collection:"map",default:!0,nodeClass:_e,tag:"tag:yaml.org,2002:map",resolve(n,e){return Vt(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>_e.from(n,e,t)};class ct extends Mn{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Nt,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=zt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const s=zt(e);if(typeof s!="number")return;const i=this.items[s];return!t&&V(i)?i.value:i}has(e){const t=zt(e);return typeof t=="number"&&t<this.items.length}set(e,t){const s=zt(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[s];V(i)&&Cn(t)?i.value=t:this.items[s]=t}toJSON(e,t){const s=[];t?.onCreate&&t.onCreate(s);let i=0;for(const r of this.items)s.push(ke(r,String(i++),t));return s}toString(e,t,s){return e?Dn(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){const{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){const l=t instanceof Set?a:String(o++);a=i.call(t,l,a)}r.items.push(Rt(a,void 0,s))}}return r}}function zt(n){let e=V(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const Tt={collection:"seq",default:!0,nodeClass:ct,tag:"tag:yaml.org,2002:seq",resolve(n,e){return Jt(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>ct.from(n,e,t)},ys={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,s){return e=Object.assign({actualString:!0},e),Rs(n,e,t,s)}},bs={identify:n=>n==null,createNode:()=>new M(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new M(null),stringify:({source:n},e)=>typeof n=="string"&&bs.test.test(n)?n:e.options.nullStr},Vs={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new M(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&Vs.test.test(n)){const s=n[0]==="t"||n[0]==="T";if(e===s)return n}return e?t.options.trueStr:t.options.falseStr}};function Me({format:n,minFractionDigits:e,tag:t,value:s}){if(typeof s=="bigint")return String(s);const i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const Un={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Me},Fn={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():Me(n)}},Rn={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){const e=new M(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:Me},vs=n=>typeof n=="bigint"||Number.isInteger(n),Js=(n,e,t,{intAsBigInt:s})=>s?BigInt(n):parseInt(n.substring(e),t);function qn(n,e,t){const{value:s}=n;return vs(s)&&s>=0?t+s.toString(e):Me(n)}const Vn={identify:n=>vs(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>Js(n,2,8,t),stringify:n=>qn(n,8,"0o")},Jn={identify:vs,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>Js(n,0,10,t),stringify:Me},Yn={identify:n=>vs(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>Js(n,2,16,t),stringify:n=>qn(n,16,"0x")},rr=[At,Tt,ys,bs,Vs,Vn,Jn,Yn,Un,Fn,Rn];function an(n){return typeof n=="bigint"||Number.isInteger(n)}const Xt=({value:n})=>JSON.stringify(n),or=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Xt},{identify:n=>n==null,createNode:()=>new M(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Xt},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Xt},{identify:an,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>an(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:Xt}],ar={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},lr=[At,Tt].concat(or,ar),Ys={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof atob=="function"){const t=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let i=0;i<t.length;++i)s[i]=t.charCodeAt(i);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},s,i,r){if(!t)return"";const o=t;let a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=M.BLOCK_LITERAL),e!==M.QUOTE_DOUBLE){const l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(a.length/l),p=new Array(c);for(let f=0,u=0;f<c;++f,u+=l)p[f]=a.substr(u,l);a=p.join(e===M.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return Rs({comment:n,type:e,value:a},s,i,r)}};function Gn(n,e){if(Jt(n))for(let t=0;t<n.items.length;++t){let s=n.items[t];if(!Q(s)){if(Vt(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");const i=s.items[0]||new fe(new M(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
|
|
53
|
+
${i.key.commentBefore}`:s.commentBefore),s.comment){const r=i.value??i.key;r.comment=r.comment?`${s.comment}
|
|
54
|
+
${r.comment}`:s.comment}s=i}n.items[t]=Q(s)?s:new fe(s)}}else e("Expected a sequence for this tag");return n}function Qn(n,e,t){const{replacer:s}=t,i=new ct(n);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(qs(a,l,t))}return i}const Gs={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Gn,createNode:Qn};class _t extends ct{constructor(){super(),this.add=_e.prototype.add.bind(this),this.delete=_e.prototype.delete.bind(this),this.get=_e.prototype.get.bind(this),this.has=_e.prototype.has.bind(this),this.set=_e.prototype.set.bind(this),this.tag=_t.tag}toJSON(e,t){if(!t)return super.toJSON(e);const s=new Map;t?.onCreate&&t.onCreate(s);for(const i of this.items){let r,o;if(Q(i)?(r=ke(i.key,"",t),o=ke(i.value,r,t)):r=ke(i,"",t),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(e,t,s){const i=Qn(e,t,s),r=new this;return r.items=i.items,r}}_t.tag="tag:yaml.org,2002:omap";const Qs={collection:"seq",identify:n=>n instanceof Map,nodeClass:_t,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){const t=Gn(n,e),s=[];for(const{key:i}of t.items)V(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new _t,t)},createNode:(n,e,t)=>_t.from(n,e,t)};function Hn({value:n,source:e},t){return e&&(n?Wn:zn).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}const Wn={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new M(!0),stringify:Hn},zn={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new M(!1),stringify:Hn},cr={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Me},fr={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():Me(n)}},ur={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){const e=new M(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){const s=n.substring(t+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:Me},Yt=n=>typeof n=="bigint"||Number.isInteger(n);function ws(n,e,t,{intAsBigInt:s}){const i=n[0];if((i==="-"||i==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),s){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}const o=BigInt(n);return i==="-"?BigInt(-1)*o:o}const r=parseInt(n,t);return i==="-"?-1*r:r}function Hs(n,e,t){const{value:s}=n;if(Yt(s)){const i=s.toString(e);return s<0?"-"+t+i.substr(1):t+i}return Me(n)}const dr={identify:Yt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>ws(n,2,2,t),stringify:n=>Hs(n,2,"0b")},hr={identify:Yt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>ws(n,1,8,t),stringify:n=>Hs(n,8,"0")},pr={identify:Yt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>ws(n,0,10,t),stringify:Me},mr={identify:Yt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>ws(n,2,16,t),stringify:n=>Hs(n,16,"0x")};class kt extends _e{constructor(e){super(e),this.tag=kt.tag}add(e){let t;Q(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new fe(e.key,null):t=new fe(e,null),lt(this.items,t.key)||this.items.push(t)}get(e,t){const s=lt(this.items,e);return!t&&Q(s)?V(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const s=lt(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new fe(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw new Error("Set items must all have null values")}static from(e,t,s){const{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(qs(o,null,s));return r}}kt.tag="tag:yaml.org,2002:set";const Ws={collection:"map",identify:n=>n instanceof Set,nodeClass:kt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>kt.from(n,e,t),resolve(n,e){if(Vt(n)){if(n.hasAllNullValues(!0))return Object.assign(new kt,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};function zs(n,e){const t=n[0],s=t==="-"||t==="+"?n.substring(1):n,i=o=>e?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function Xn(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Me(n);let s="";e<0&&(s="-",e*=t(-1));const i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Zn={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>zs(n,t),stringify:Xn},ei={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>zs(n,!1),stringify:Xn},_s={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){const e=n.match(_s.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,s,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,s-1,i,r||0,o||0,a||0,l);const p=e[8];if(p&&p!=="Z"){let f=zs(p,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},ln=[At,Tt,ys,bs,Wn,zn,dr,hr,pr,mr,cr,fr,ur,Ys,Ge,Qs,Gs,Ws,Zn,ei,_s],cn=new Map([["core",rr],["failsafe",[At,Tt,ys]],["json",lr],["yaml11",ln],["yaml-1.1",ln]]),fn={binary:Ys,bool:Vs,float:Rn,floatExp:Fn,floatNaN:Un,floatTime:ei,int:Jn,intHex:Yn,intOct:Vn,intTime:Zn,map:At,merge:Ge,null:bs,omap:Qs,pairs:Gs,seq:Tt,set:Ws,timestamp:_s},gr={"tag:yaml.org,2002:binary":Ys,"tag:yaml.org,2002:merge":Ge,"tag:yaml.org,2002:omap":Qs,"tag:yaml.org,2002:pairs":Gs,"tag:yaml.org,2002:set":Ws,"tag:yaml.org,2002:timestamp":_s};function Ts(n,e,t){const s=cn.get(e);if(s&&!n)return t&&!s.includes(Ge)?s.concat(Ge):s.slice();let i=s;if(!i)if(Array.isArray(n))i=[];else{const r=Array.from(cn.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(n))for(const r of n)i=i.concat(r);else typeof n=="function"&&(i=n(i.slice()));return t&&(i=i.concat(Ge)),i.reduce((r,o)=>{const a=typeof o=="string"?fn[o]:o;if(!a){const l=JSON.stringify(o),c=Object.keys(fn).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}const yr=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0;class Xs{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Ts(e,"compat"):e?Ts(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?gr:{},this.tags=Ts(t,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,Ze,{value:At}),Object.defineProperty(this,Ke,{value:ys}),Object.defineProperty(this,Nt,{value:Tt}),this.sortMapEntries=typeof o=="function"?o:o===!0?yr:null}clone(){const e=Object.create(Xs.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function br(n,e){const t=[];let s=e.directives===!0;if(e.directives!==!1&&n.directives){const l=n.directives.toString(n);l?(t.push(l),s=!0):n.directives.docStart&&(s=!0)}s&&t.push("---");const i=Bn(n,e),{commentString:r}=i.options;if(n.commentBefore){t.length!==1&&t.unshift("");const l=r(n.commentBefore);t.unshift(Ye(l,""))}let o=!1,a=null;if(n.contents){if(G(n.contents)){if(n.contents.spaceBefore&&s&&t.push(""),n.contents.commentBefore){const p=r(n.contents.commentBefore);t.push(Ye(p,""))}i.forceBlockIndent=!!n.comment,a=n.contents.comment}const l=a?void 0:()=>o=!0;let c=St(n.contents,i,()=>a=null,l);a&&(c+=at(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(St(n.contents,i));if(n.directives?.docEnd)if(n.comment){const l=r(n.comment);l.includes(`
|
|
55
|
+
`)?(t.push("..."),t.push(Ye(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=n.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(Ye(r(l),"")))}return t.join(`
|
|
56
|
+
`)+`
|
|
57
|
+
`}class ks{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Se,{value:Ms});let i=null;typeof t=="function"||Array.isArray(t)?i=t:s===void 0&&t&&(s=t,t=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ce({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,i,s)}clone(){const e=Object.create(ks.prototype,{[Se]:{value:Ms}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=G(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){gt(this.contents)&&this.contents.add(e)}addIn(e,t){gt(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const s=Ln(this);e.anchor=!t||s.has(t)?En(t||"a",s):t}return new Fs(e.anchor)}createNode(e,t,s){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){const m=k=>typeof k=="number"||k instanceof String||k instanceof Number,_=t.filter(m).map(String);_.length>0&&(t=t.concat(_)),i=t}else s===void 0&&t&&(s=t,t=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:p}=s??{},{onAnchor:f,setAnchors:u,sourceObjects:g}=Yi(this,o||"a"),y={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:g},h=Rt(e,p,y);return a&&Y(h)&&(h.flow=!0),u(),h}createPair(e,t,s={}){const i=this.createNode(e,null,s),r=this.createNode(t,null,s);return new fe(i,r)}delete(e){return gt(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Kt(e)?this.contents==null?!1:(this.contents=null,!0):gt(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Y(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Kt(e)?!t&&V(this.contents)?this.contents.value:this.contents:Y(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Y(this.contents)?this.contents.has(e):!1}hasIn(e){return Kt(e)?this.contents!==void 0:Y(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=ls(this.schema,[e],t):gt(this.contents)&&this.contents.set(e,t)}setIn(e,t){Kt(e)?this.contents=t:this.contents==null?this.contents=ls(this.schema,Array.from(e),t):gt(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ce({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ce({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new Xs(Object.assign(s,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=ke(this.contents,t??"",a);if(typeof r=="function")for(const{count:c,res:p}of a.anchors.values())r(p,c);return typeof o=="function"?vt(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return br(this,e)}}function gt(n){if(Y(n))return!0;throw new Error("Expected a YAML collection as document contents")}class ti extends Error{constructor(e,t,s,i){super(),this.name=e,this.code=s,this.message=i,this.pos=t}}class Dt extends ti{constructor(e,t,s){super("YAMLParseError",e,t,s)}}class vr extends ti{constructor(e,t,s){super("YAMLWarning",e,t,s)}}const un=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));const{line:s,col:i}=t.linePos[0];t.message+=` at line ${s}, column ${i}`;let r=i-1,o=n.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,r))){let a=n.substring(e.lineStarts[s-2],e.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`…
|
|
58
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=t.linePos[1];l?.line===s&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));const c=" ".repeat(r)+"^".repeat(a);t.message+=`:
|
|
59
|
+
|
|
60
|
+
${o}
|
|
61
|
+
${c}
|
|
62
|
+
`}};function $t(n,{flow:e,indicator:t,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,p=a,f="",u="",g=!1,y=!1,h=null,m=null,_=null,k=null,$=null,A=null,T=null;for(const b of n)switch(y&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&r(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),h&&(c&&b.type!=="comment"&&b.type!=="newline"&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),b.type){case"space":!e&&(t!=="doc-start"||s?.type!=="flow-collection")&&b.source.includes(" ")&&(h=b),p=!0;break;case"comment":{p||r(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const j=b.source.substring(1)||" ";f?f+=u+j:f=j,u="",c=!1;break}case"newline":c?f?f+=b.source:(!A||t!=="seq-item-ind")&&(l=!0):u+=b.source,c=!0,g=!0,(m||_)&&(k=b),p=!0;break;case"anchor":m&&r(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&r(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=b,T??(T=b.offset),c=!1,p=!1,y=!0;break;case"tag":{_&&r(b,"MULTIPLE_TAGS","A node can have at most one tag"),_=b,T??(T=b.offset),c=!1,p=!1,y=!0;break}case t:(m||_)&&r(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),A&&r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),A=b,c=t==="seq-item-ind"||t==="explicit-key-ind",p=!1;break;case"comma":if(e){$&&r(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),$=b,c=!1,p=!1;break}default:r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),c=!1,p=!1}const I=n[n.length-1],P=I?I.offset+I.source.length:i;return y&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(c&&h.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:$,found:A,spaceBefore:l,comment:f,hasNewline:g,anchor:m,tag:_,newlineAfterProp:k,end:P,start:T??P}}function qt(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
63
|
+
`))return!0;if(n.end){for(const e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of n.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(qt(e.key)||qt(e.value))return!0}return!1;default:return!0}}function js(n,e,t){if(e?.type==="flow-collection"){const s=e.end[0];s.indent===n&&(s.source==="]"||s.source==="}")&&qt(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function si(n,e,t){const{uniqueKeys:s}=n.options;if(s===!1)return!1;const i=typeof s=="function"?s:(r,o)=>r===o||V(r)&&V(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}const dn="All mapping items must start at the same column";function wr({composeNode:n,composeEmptyNode:e},t,s,i,r){const o=r?.nodeClass??_e,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=s.offset,c=null;for(const p of s.items){const{start:f,key:u,sep:g,value:y}=p,h=$t(f,{indicator:"explicit-key-ind",next:u??g?.[0],offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0}),m=!h.found;if(m){if(u&&(u.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==s.indent&&i(l,"BAD_INDENT",dn)),!h.anchor&&!h.tag&&!g){c=h.end,h.comment&&(a.comment?a.comment+=`
|
|
64
|
+
`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||qt(u))&&i(u??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==s.indent&&i(l,"BAD_INDENT",dn);t.atKey=!0;const _=h.end,k=u?n(t,u,h,i):e(t,_,f,null,h,i);t.schema.compat&&js(s.indent,u,i),t.atKey=!1,si(t,a.items,k)&&i(_,"DUPLICATE_KEY","Map keys must be unique");const $=$t(g??[],{indicator:"map-value-ind",next:y,offset:k.range[2],onError:i,parentIndent:s.indent,startOnNewline:!u||u.type==="block-scalar"});if(l=$.end,$.found){m&&(y?.type==="block-map"&&!$.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&h.start<$.found.offset-1024&&i(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const A=y?n(t,y,$,i):e(t,l,g,null,$,i);t.schema.compat&&js(s.indent,y,i),l=A.range[2];const T=new fe(k,A);t.options.keepSourceTokens&&(T.srcToken=p),a.items.push(T)}else{m&&i(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),$.comment&&(k.comment?k.comment+=`
|
|
65
|
+
`+$.comment:k.comment=$.comment);const A=new fe(k);t.options.keepSourceTokens&&(A.srcToken=p),a.items.push(A)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,l,c??l],a}function _r({composeNode:n,composeEmptyNode:e},t,s,i,r){const o=r?.nodeClass??ct,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=s.offset,c=null;for(const{start:p,value:f}of s.items){const u=$t(p,{indicator:"seq-item-ind",next:f,offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||f)f?.type==="block-seq"?i(u.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=u.end,u.comment&&(a.comment=u.comment);continue}const g=f?n(t,f,u,i):e(t,u.end,p,null,u,i);t.schema.compat&&js(s.indent,f,i),l=g.range[2],a.items.push(g)}return a.range=[s.offset,l,c??l],a}function Gt(n,e,t,s){let i="";if(n){let r=!1,o="";for(const a of n){const{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=l.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=l),r=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}const Is="Block collections are not allowed within flow collections",Ls=n=>n&&(n.type==="block-map"||n.type==="block-seq");function kr({composeNode:n,composeEmptyNode:e},t,s,i,r){const o=s.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?_e:ct),c=new l(t.schema);c.flow=!0;const p=t.atRoot;p&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=s.offset+s.start.source.length;for(let m=0;m<s.items.length;++m){const _=s.items[m],{start:k,key:$,sep:A,value:T}=_,I=$t(k,{flow:a,indicator:"explicit-key-ind",next:$??A?.[0],offset:f,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!I.found){if(!I.anchor&&!I.tag&&!A&&!T){m===0&&I.comma?i(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):m<s.items.length-1&&i(I.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),I.comment&&(c.comment?c.comment+=`
|
|
66
|
+
`+I.comment:c.comment=I.comment),f=I.end;continue}!o&&t.options.strict&&qt($)&&i($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)I.comma&&i(I.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(I.comma||i(I.start,"MISSING_CHAR",`Missing , between ${a} items`),I.comment){let P="";e:for(const b of k)switch(b.type){case"comma":case"space":break;case"comment":P=b.source.substring(1);break e;default:break e}if(P){let b=c.items[c.items.length-1];Q(b)&&(b=b.value??b.key),b.comment?b.comment+=`
|
|
67
|
+
`+P:b.comment=P,I.comment=I.comment.substring(P.length+1)}}if(!o&&!A&&!I.found){const P=T?n(t,T,I,i):e(t,I.end,A,null,I,i);c.items.push(P),f=P.range[2],Ls(T)&&i(P.range,"BLOCK_IN_FLOW",Is)}else{t.atKey=!0;const P=I.end,b=$?n(t,$,I,i):e(t,P,k,null,I,i);Ls($)&&i(b.range,"BLOCK_IN_FLOW",Is),t.atKey=!1;const j=$t(A??[],{flow:a,indicator:"map-value-ind",next:T,offset:b.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(j.found){if(!o&&!I.found&&t.options.strict){if(A)for(const B of A){if(B===j.found)break;if(B.type==="newline"){i(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}I.start<j.found.offset-1024&&i(j.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&T.source?.[0]===":"?i(T,"MISSING_CHAR",`Missing space after : in ${a}`):i(j.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const ne=T?n(t,T,j,i):j.found?e(t,j.end,A,null,j,i):null;ne?Ls(T)&&i(ne.range,"BLOCK_IN_FLOW",Is):j.comment&&(b.comment?b.comment+=`
|
|
68
|
+
`+j.comment:b.comment=j.comment);const W=new fe(b,ne);if(t.options.keepSourceTokens&&(W.srcToken=_),o){const B=c;si(t,B.items,b)&&i(P,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(W)}else{const B=new _e(t.schema);B.flow=!0,B.items.push(W);const z=(ne??b).range;B.range=[b.range[0],z[1],z[2]],c.items.push(B)}f=ne?ne.range[2]:j.end}}const u=o?"}":"]",[g,...y]=s.end;let h=f;if(g?.source===u)h=g.offset+g.source.length;else{const m=a[0].toUpperCase()+a.substring(1),_=p?`${m} must end with a ${u}`:`${m} in block collection must be sufficiently indented and end with a ${u}`;i(f,p?"MISSING_CHAR":"BAD_INDENT",_),g&&g.source.length!==1&&y.unshift(g)}if(y.length>0){const m=Gt(y,h,t.options.strict,i);m.comment&&(c.comment?c.comment+=`
|
|
69
|
+
`+m.comment:c.comment=m.comment),c.range=[s.offset,h,m.offset]}else c.range=[s.offset,h,h];return c}function Es(n,e,t,s,i,r){const o=t.type==="block-map"?wr(n,e,t,s,r):t.type==="block-seq"?_r(n,e,t,s,r):kr(n,e,t,s,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function Sr(n,e,t,s,i){const r=s.tag,o=r?e.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null;if(t.type==="block-seq"){const{anchor:u,newlineAfterProp:g}=s,y=u&&r?u.offset>r.offset?u:r:u??r;y&&(!g||g.offset<y.offset)&&i(y,"MISSING_CHAR","Missing newline after block sequence props")}const a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===_e.tagName&&a==="map"||o===ct.tagName&&a==="seq")return Es(n,e,t,i,o);let l=e.schema.tags.find(u=>u.tag===o&&u.collection===a);if(!l){const u=e.schema.knownTags[o];if(u?.collection===a)e.schema.tags.push(Object.assign({},u,{default:!1})),l=u;else return u?i(r,"BAD_COLLECTION_TYPE",`${u.tag} used for ${a} collection, but expects ${u.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Es(n,e,t,i,o)}const c=Es(n,e,t,i,o,l),p=l.resolve?.(c,u=>i(r,"TAG_RESOLVE_FAILED",u),e.options)??c,f=G(p)?p:new M(p);return f.range=c.range,f.tag=o,l?.format&&(f.format=l.format),f}function $r(n,e,t){const s=e.offset,i=Nr(e,n.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const r=i.mode===">"?M.BLOCK_FOLDED:M.BLOCK_LITERAL,o=e.source?Or(e.source):[];let a=o.length;for(let h=o.length-1;h>=0;--h){const m=o[h][1];if(m===""||m==="\r")a=h;else break}if(a===0){const h=i.chomp==="+"&&o.length>0?`
|
|
70
|
+
`.repeat(Math.max(1,o.length-1)):"";let m=s+i.length;return e.source&&(m+=e.source.length),{value:h,type:r,comment:i.comment,range:[s,m,m]}}let l=e.indent+i.indent,c=e.offset+i.length,p=0;for(let h=0;h<a;++h){const[m,_]=o[h];if(_===""||_==="\r")i.indent===0&&m.length>l&&(l=m.length);else{m.length<l&&t(c+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=m.length),p=h,l===0&&!n.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=m.length+_.length+1}for(let h=o.length-1;h>=a;--h)o[h][0].length>l&&(a=h+1);let f="",u="",g=!1;for(let h=0;h<p;++h)f+=o[h][0].slice(l)+`
|
|
71
|
+
`;for(let h=p;h<a;++h){let[m,_]=o[h];c+=m.length+_.length+1;const k=_[_.length-1]==="\r";if(k&&(_=_.slice(0,-1)),_&&m.length<l){const A=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-_.length-(k?2:1),"BAD_INDENT",A),m=""}r===M.BLOCK_LITERAL?(f+=u+m.slice(l)+_,u=`
|
|
72
|
+
`):m.length>l||_[0]===" "?(u===" "?u=`
|
|
73
|
+
`:!g&&u===`
|
|
74
|
+
`&&(u=`
|
|
75
|
+
|
|
76
|
+
`),f+=u+m.slice(l)+_,u=`
|
|
77
|
+
`,g=!0):_===""?u===`
|
|
78
|
+
`?f+=`
|
|
79
|
+
`:u=`
|
|
80
|
+
`:(f+=u+_,u=" ",g=!1)}switch(i.chomp){case"-":break;case"+":for(let h=a;h<o.length;++h)f+=`
|
|
81
|
+
`+o[h][0].slice(l);f[f.length-1]!==`
|
|
82
|
+
`&&(f+=`
|
|
83
|
+
`);break;default:f+=`
|
|
84
|
+
`}const y=s+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[s,y,y]}}function Nr({offset:n,props:e},t,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],r=i[0];let o=0,a="",l=-1;for(let u=1;u<i.length;++u){const g=i[u];if(!a&&(g==="-"||g==="+"))a=g;else{const y=Number(g);!o&&y?o=y:l===-1&&(l=n+u)}}l!==-1&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,p="",f=i.length;for(let u=1;u<e.length;++u){const g=e[u];switch(g.type){case"space":c=!0;case"newline":f+=g.source.length;break;case"comment":t&&!c&&s(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=g.source.length,p=g.source.substring(1);break;case"error":s(g,"UNEXPECTED_TOKEN",g.message),f+=g.source.length;break;default:{const y=`Unexpected token in block scalar header: ${g.type}`;s(g,"UNEXPECTED_TOKEN",y);const h=g.source;h&&typeof h=="string"&&(f+=h.length)}}}return{mode:r,indent:o,chomp:a,comment:p,length:f}}function Or(n){const e=n.split(/\n( *)/),t=e[0],s=t.match(/^( *)/),r=[s?.[1]?[s[1],t.slice(s[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}function Ar(n,e,t){const{offset:s,type:i,source:r,end:o}=n;let a,l;const c=(u,g,y)=>t(s+u,g,y);switch(i){case"scalar":a=M.PLAIN,l=Tr(r,c);break;case"single-quoted-scalar":a=M.QUOTE_SINGLE,l=Ir(r,c);break;case"double-quoted-scalar":a=M.QUOTE_DOUBLE,l=Lr(r,c);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}const p=s+r.length,f=Gt(o,p,e,t);return{value:l,type:a,comment:f.comment,range:[s,p,f.offset]}}function Tr(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),ni(n)}function Ir(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),ni(n.slice(1,-1)).replace(/''/g,"'")}function ni(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
85
|
+
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
86
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=e.exec(n);if(!s)return n;let i=s[1],r=" ",o=e.lastIndex;for(t.lastIndex=o;s=t.exec(n);)s[1]===""?r===`
|
|
87
|
+
`?i+=r:r=`
|
|
88
|
+
`:(i+=r+s[1],r=" "),o=t.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,s=a.exec(n),i+r+(s?.[1]??"")}function Lr(n,e){let t="";for(let s=1;s<n.length-1;++s){const i=n[s];if(!(i==="\r"&&n[s+1]===`
|
|
89
|
+
`))if(i===`
|
|
90
|
+
`){const{fold:r,offset:o}=Er(n,s);t+=r,s=o}else if(i==="\\"){let r=n[++s];const o=Cr[r];if(o)t+=o;else if(r===`
|
|
91
|
+
`)for(r=n[s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="\r"&&n[s+1]===`
|
|
92
|
+
`)for(r=n[++s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="x"||r==="u"||r==="U"){const a={x:2,u:4,U:8}[r];t+=Mr(n,s+1,a,e),s+=a}else{const a=n.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){const r=s;let o=n[s+1];for(;o===" "||o===" ";)o=n[++s+1];o!==`
|
|
93
|
+
`&&!(o==="\r"&&n[s+2]===`
|
|
94
|
+
`)&&(t+=s>r?n.slice(r,s+1):i)}else t+=i}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function Er(n,e){let t="",s=n[e+1];for(;(s===" "||s===" "||s===`
|
|
95
|
+
`||s==="\r")&&!(s==="\r"&&n[e+2]!==`
|
|
96
|
+
`);)s===`
|
|
97
|
+
`&&(t+=`
|
|
98
|
+
`),e+=1,s=n[e+1];return t||(t=" "),{fold:t,offset:e}}const Cr={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Mr(n,e,t,s){const i=n.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const a=n.substr(e-2,t+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function ii(n,e,t,s){const{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?$r(n,e,s):Ar(e,n.options.strict,s),l=t?n.directives.tagName(t.source,f=>s(t,"TAG_RESOLVE_FAILED",f)):null;let c;n.options.stringKeys&&n.atKey?c=n.schema[Ke]:l?c=Pr(n.schema,i,l,t,s):e.type==="scalar"?c=Br(n,i,e,s):c=n.schema[Ke];let p;try{const f=c.resolve(i,u=>s(t??e,"TAG_RESOLVE_FAILED",u),n.options);p=V(f)?f:new M(f)}catch(f){const u=f instanceof Error?f.message:String(f);s(t??e,"TAG_RESOLVE_FAILED",u),p=new M(i)}return p.range=a,p.source=i,r&&(p.type=r),l&&(p.tag=l),c.format&&(p.format=c.format),o&&(p.comment=o),p}function Pr(n,e,t,s,i){if(t==="!")return n[Ke];const r=[];for(const a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(const a of r)if(a.test?.test(e))return a;const o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[Ke])}function Br({atKey:n,directives:e,schema:t},s,i,r){const o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(s))||t[Ke];if(t.compat){const a=t.compat.find(l=>l.default&&l.test?.test(s))??t[Ke];if(o.tag!==a.tag){const l=e.tagString(o.tag),c=e.tagString(a.tag),p=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}function xr(n,e,t){if(e){t??(t=e.length);for(let s=t-1;s>=0;--s){let i=e[s];switch(i.type){case"space":case"comment":case"newline":n-=i.source.length;continue}for(i=e[++s];i?.type==="space";)n+=i.source.length,i=e[++s];break}}return n}const jr={composeNode:ri,composeEmptyNode:Zs};function ri(n,e,t,s){const i=n.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t;let c,p=!0;switch(e.type){case"alias":c=Kr(n,e,s),(a||l)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=ii(n,e,l,s),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=Sr(jr,n,e,t,s),a&&(c.anchor=a.source.substring(1));break;default:{const f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",f),c=Zs(n,e.offset,void 0,null,t,s),p=!1}}return a&&c.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&n.options.stringKeys&&(!V(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&s(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),n.options.keepSourceTokens&&p&&(c.srcToken=e),c}function Zs(n,e,t,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){const p={type:"scalar",offset:xr(e,t,s),indent:-1,source:""},f=ii(n,p,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function Kr({options:n},{offset:e,source:t,end:s},i){const r=new Fs(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+t.length,a=Gt(s,o,n.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}function Dr(n,e,{offset:t,start:s,value:i,end:r},o){const a=Object.assign({_directives:e},n),l=new ks(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},p=$t(s,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?ri(c,i,p,o):Zs(c,p.end,s,null,p,o);const f=l.contents.range[2],u=Gt(r,f,!1,o);return u.comment&&(l.comment=u.comment),l.range=[t,f,u.offset],l}function xt(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];const{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function hn(n){let e="",t=!1,s=!1;for(let i=0;i<n.length;++i){const r=n[i];switch(r[0]){case"#":e+=(e===""?"":s?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(r.substring(1)||" "),t=!0,s=!1;break;case"%":n[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(s=!0),t=!1}}return{comment:e,afterEmptyLine:s}}class Ur{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,i,r)=>{const o=xt(t);r?this.warnings.push(new vr(o,s,i)):this.errors.push(new Dt(o,s,i))},this.directives=new ce({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:s,afterEmptyLine:i}=hn(this.prelude);if(s){const r=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${s}`:s;else if(i||e.directives.docStart||!r)e.commentBefore=s;else if(Y(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Q(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${s}
|
|
104
|
+
${a}`:s}else{const o=r.commentBefore;r.commentBefore=o?`${s}
|
|
105
|
+
${o}`:s}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:hn(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(const i of e)yield*this.next(i);yield*this.end(t,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,s,i)=>{const r=xt(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=Dr(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new Dt(xt(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new Dt(xt(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const t=Gt(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
|
|
106
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Dt(xt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const s=Object.assign({_directives:this.directives},this.options),i=new ks(void 0,s);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}}const oi="\uFEFF",ai="",li="",Ks="";function Fr(n){switch(n){case oi:return"byte-order-mark";case ai:return"doc-mode";case li:return"flow-error-end";case Ks:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
107
|
+
`:case`\r
|
|
108
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Ce(n){switch(n){case void 0:case" ":case`
|
|
109
|
+
`:case"\r":case" ":return!0;default:return!1}}const pn=new Set("0123456789ABCDEFabcdef"),Rr=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Zt=new Set(",[]{}"),qr=new Set(` ,[]{}
|
|
110
|
+
\r `),Cs=n=>!n||qr.has(n);class Vr{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let s=this.next??"stream";for(;s&&(t||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
111
|
+
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
112
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;for(;t===" ";)t=this.buffer[++s+e];if(t==="\r"){const i=this.buffer[s+e+1];if(i===`
|
|
113
|
+
`||!i&&!this.atEnd)return e+s+1}return t===`
|
|
114
|
+
`||s>=this.indentNext||!t&&!this.atEnd?e+s:-1}if(t==="-"||t==="."){const s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&Ce(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
115
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===oi&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,s=e.indexOf("#");for(;s!==-1;){const r=e[s-1];if(r===" "||r===" "){t=s-1;break}else s=e.indexOf("#",s+1)}for(;;){const r=e[t-1];if(r===" "||r===" ")t-=1;else break}const i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield ai,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&Ce(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Ce(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Ce(t)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Cs),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,s=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=s=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&i[0]!=="#"||s===0&&(i.startsWith("---")||i.startsWith("..."))&&Ce(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield li,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Cs),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||Ce(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}const s=this.buffer.substring(0,t);let i=s.indexOf(`
|
|
116
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){const r=this.continueScalar(i+1);if(r===-1)break;i=s.indexOf(`
|
|
117
|
+
`,r)}i!==-1&&(t=i-(s[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>Ce(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":t+=1;break;case`
|
|
118
|
+
`:e=r,t=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
119
|
+
`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
|
|
120
|
+
`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
|
|
121
|
+
`;)s=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
|
|
122
|
+
`&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield Ks,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){const r=this.buffer[s+1];if(Ce(r)||e&&Zt.has(r))break;t=s}else if(Ce(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===`
|
|
123
|
+
`?(s+=1,i=`
|
|
124
|
+
`,r=this.buffer[s+1]):t=s),r==="#"||e&&Zt.has(r))break;if(i===`
|
|
125
|
+
`){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&Zt.has(i))break;t=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ks,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Cs))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(Ce(t)||e&&Zt.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!Ce(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Rr.has(t))t=this.buffer[++e];else if(t==="%"&&pn.has(this.buffer[e+1])&&pn.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
|
|
126
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
127
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s===" ");const i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class Jr{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){const r=t+s>>1;this.lineStarts[r]<e?t=r+1:s=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}}function ze(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function mn(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function ci(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function es(n){switch(n.type){case"document":return n.start;case"block-map":{const e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function yt(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function gn(n){if(n.start.type==="flow-seq-start")for(const e of n.items)e.sep&&!e.value&&!ze(e.start,"explicit-key-ind")&&!ze(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,ci(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Yr{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Vr,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(e,t))yield*this.next(s);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=Fr(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const s=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in s?s.indent:0:t.type==="flow-collection"&&s.type==="document"&&(t.indent=0),t.type==="flow-collection"&&gn(t),s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{const i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{const i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&mn(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(s.type==="document"?s.end=i.start:s.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{mn(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=es(this.peek(2)),s=yt(t);let i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
128
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
129
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const s=!this.onKeyLine&&this.indent===e.indent,i=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let r=[];if(i&&t.sep&&!t.value){const o=[];for(let a=0;a<t.sep.length;++a){const l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ze(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(ci(t.key)&&!ze(t.sep,"newline")){const o=yt(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(ze(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const o=yt(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):ze(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ze(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||ze(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const i=es(s),r=yt(i);gn(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
130
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
131
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=es(e),s=yt(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=es(e),s=yt(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Gr(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Jr||null,prettyErrors:e}}function Qr(n,e={}){const{lineCounter:t,prettyErrors:s}=Gr(e),i=new Yr(t?.addNewLine),r=new Ur(e);let o=null;for(const a of r.compose(i.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Dt(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&t&&(o.errors.forEach(un(n,t)),o.warnings.forEach(un(n,t))),o}function fi(n,e,t){let s;const i=Qr(n,t);if(!i)return null;if(i.warnings.forEach(r=>xn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},t))}function fs(n){return n?n.startsWith("@")?n.slice(1):n:null}function Hr(n){return n.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function yn(n){const e=fs(n);return e?[e,n,e.toUpperCase()]:[n]}function Wr(n){const e=new Map;for(const t of n){for(const s of yn(t.ulid))e.set(s,t);for(const s of t.slugs)for(const i of yn(s))e.set(i,t)}return e}function bn(n,e){const t=fs(e);if(!t)return null;for(const s of n){const i=fs(s);if(i&&(i===t||i.toUpperCase()===t.toUpperCase()))return s.startsWith("@")?s:`@${i}`}return null}function vn(n){try{const e=fi(n);if(!Array.isArray(e))return null;const t=e.map(s=>{if(!s||typeof s!="object")return;const i=s;if(typeof i.slug=="string"&&i.slug.length>0)return i.slug;if(typeof i.title=="string"&&i.title.trim().length>0)return Hr(i.title)}).filter(s=>typeof s=="string"&&s.length>0);return t.length>0?t:null}catch{return null}}function wn(n){try{const e=fi(n);if(e&&typeof e=="object"&&!Array.isArray(e))return e.derive_from_specs===!0}catch{}return/(?:^|\n)\s*derive_from_specs\s*:\s*true\s*$/im.test(n)}function zr(n,e){const t=[];for(let s=e;s<n.length;s+=1){const i=n[s]??"";if(s>e&&/^##\s+.+?\s*$/.test(i))break;t.push(i)}return t.join(`
|
|
132
|
+
`)}function Xr(n,e,t,s,i){if(n==="specs"){const r=vn(t);if(!r)return null;const o=r.map(a=>bn(i.derived_specs,a)).filter(a=>!!a);return o.length!==r.length||o.length===0?null:{type:"embedded-candidate",embedType:"spec",rawMarkdown:e,refs:o}}if(n==="tasks"){if((wn(t)||wn(s))&&i.derived_tasks.length>0)return{type:"embedded-candidate",embedType:"task",rawMarkdown:e,refs:[...i.derived_tasks]};const o=vn(t);if(o){const a=o.map(l=>bn(i.derived_tasks,l)).filter(l=>!!l);if(a.length===o.length&&a.length>0)return{type:"embedded-candidate",embedType:"task",rawMarkdown:e,refs:a}}}return null}function _n(n,e){const t=n.join(`
|
|
133
|
+
`).trim();t&&e.push({type:"markdown",markdown:t}),n.length=0}function Zr(n,e){const t=n.split(`
|
|
134
|
+
`),s=[],i=[];let r=null,o="";for(let a=0;a<t.length;a+=1){const l=t[a]??"",c=l.match(/^##\s+(.+?)\s*$/);if(c){r=c[1]?.trim().toLowerCase()??null,o=zr(t,a),i.push(l);continue}const p=l.match(/^```([A-Za-z0-9_-]+)?\s*$/);if(!p){i.push(l);continue}const f=[l];let u=!1;for(a+=1;a<t.length;a+=1){const m=t[a]??"";if(f.push(m),/^```\s*$/.test(m)){u=!0;break}}const g=f.join(`
|
|
135
|
+
`),y=p[1]?.toLowerCase()??"",h=u?f.slice(1,-1).join(`
|
|
136
|
+
`):f.slice(1).join(`
|
|
137
|
+
`);if((y==="yaml"||y==="yml")&&r){const m=Xr(r,g,h,o,e);if(m){_n(i,s),s.push(m);continue}}i.push(g)}return _n(i,s),s}function eo(n,e){if(!n.content)return[];const t=Wr(e.batchItems??[]),s=Zr(n.content,n),i=[];for(const r of s){if(r.type==="markdown"){i.push(r);continue}if(e.batchLoading){i.push({type:"embedded",embedType:r.embedType,rawMarkdown:r.rawMarkdown,refs:r.refs,state:"loading"});continue}if(e.batchError){i.push({type:"embedded",embedType:r.embedType,rawMarkdown:r.rawMarkdown,refs:r.refs,state:"error",errorMessage:e.batchError});continue}const o=r.refs.map(a=>{const l=fs(a);return l?t.get(l)??t.get(l.toUpperCase())??null:null}).filter(a=>!!a);if(o.length!==r.refs.length){i.push({type:"markdown",markdown:r.rawMarkdown});continue}if(r.embedType==="spec"&&o.every(a=>a.kind==="item")){i.push({type:"embedded",embedType:r.embedType,rawMarkdown:r.rawMarkdown,refs:r.refs,state:"ready",items:o});continue}if(r.embedType==="task"&&o.every(a=>a.kind==="task")){i.push({type:"embedded",embedType:r.embedType,rawMarkdown:r.rawMarkdown,refs:r.refs,state:"ready",items:o});continue}i.push({type:"markdown",markdown:r.rawMarkdown})}return i}var to=E('<div class="prose prose-sm dark:prose-invert max-w-none" data-testid="plan-content-rendered"><!></div>'),so=E("<!> <!>",1),no=E("<!> <!>",1),io=E("<!> <!>",1),ro=E('<div class="not-prose space-y-3"></div>'),oo=E('<div class="not-prose space-y-3"><div class="rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive"> </div> <div class="prose prose-sm dark:prose-invert max-w-none"><!></div></div>'),ao=E('<div class="flex flex-wrap items-center gap-2"><!> <!> <!></div> <div class="space-y-1"><h4 class="text-sm font-semibold"> </h4> <p class="text-xs text-muted-foreground font-mono"> </p></div>',1),lo=E('<div class="flex flex-wrap gap-2"><!> <!></div> <p class="text-xs text-muted-foreground">Open spec detail to review full acceptance criteria.</p>',1),co=E("<!> <!>",1),fo=E('<a class="block rounded-lg border transition-colors hover:bg-muted/30" data-testid="plan-embedded-spec-card"><!></a>'),uo=E('<div class="not-prose space-y-3" data-testid="plan-embedded-specs"></div>'),ho=E('<div class="flex flex-wrap items-center gap-2"><!> <!> <!></div> <div class="space-y-1"><h4 class="text-sm font-semibold"> </h4> <p class="text-xs text-muted-foreground font-mono"> </p></div>',1),po=E('<p class="text-xs text-muted-foreground"> </p>'),mo=E("<!> <!>",1),go=E('<a class="block rounded-lg border transition-colors hover:bg-muted/30" data-testid="plan-embedded-task-card"><!></a>'),yo=E('<div class="not-prose space-y-3" data-testid="plan-embedded-tasks"></div>'),bo=E('<div class="flex flex-col gap-4" data-testid="plan-embedded-blocks"></div>');function vo(n,e){us(e,!0);function t(a){return`${as}/items?ref=${encodeURIComponent(a)}`}function s(a){return`${as}/tasks?ref=${encodeURIComponent(a)}`}function i(a){return a?a.replaceAll("_"," ").replace(/\b\w/g,l=>l.toUpperCase()):"Unknown"}function r(a){return a?a.replace(/\b\w/g,l=>l.toUpperCase()):"Unspecified"}var o=bo();Xe(o,21,()=>e.blocks,ot,(a,l)=>{var c=je(),p=q(c);{var f=g=>{var y=to(),h=L(y);nn(h,()=>rn(d(l).markdown)),O(y),w(g,y)},u=g=>{var y=je(),h=q(y);{var m=k=>{var $=ro();Xe($,21,()=>Array(Math.max(d(l).refs.length,1)),ot,(A,T)=>{ts(A,{class:"border-dashed",children:(I,P)=>{var b=io(),j=q(b);ns(j,{class:"pb-2",children:(W,B)=>{var z=so(),$e=q(z);Je($e,{class:"h-5 w-40 ds-shimmer"});var U=N($e,2);Je(U,{class:"h-4 w-24 ds-shimmer"}),w(W,z)},$$slots:{default:!0}});var ne=N(j,2);ss(ne,{class:"space-y-2",children:(W,B)=>{var z=no(),$e=q(z);Je($e,{class:"h-4 w-full ds-shimmer"});var U=N($e,2);Je(U,{class:"h-4 w-5/6 ds-shimmer"}),w(W,z)},$$slots:{default:!0}}),w(I,b)},$$slots:{default:!0}})}),O($),x(()=>jt($,"data-testid",`plan-embedded-${d(l).embedType}-loading`)),w(k,$)},_=k=>{var $=je(),A=q($);{var T=P=>{var b=oo(),j=L(b),ne=L(j);O(j);var W=N(j,2),B=L(W);nn(B,()=>rn(d(l).rawMarkdown)),O(W),O(b),x(()=>{jt(b,"data-testid",`plan-embedded-${d(l).embedType}-error`),D(ne,`Failed to load embedded ${d(l).embedType??""} details: ${d(l).errorMessage??""}`)}),w(P,b)},I=P=>{var b=je(),j=q(b);{var ne=B=>{var z=uo();Xe(z,21,()=>d(l).items,ot,($e,U)=>{var he=fo(),Ne=L(he);ts(Ne,{class:"border-0 shadow-none",children:(Oe,It)=>{var De=co(),Ue=q(De);ns(Ue,{class:"gap-3 pb-3",children:(Qe,Pe)=>{var Ae=ao(),ye=q(Ae),oe=L(ye);Ve(oe,{variant:"outline",children:(H,te)=>{re();var K=we();x(()=>D(K,d(U).type)),w(H,K)},$$slots:{default:!0}});var Te=N(oe,2);Ve(Te,{variant:"secondary",children:(H,te)=>{re();var K=we();x(S=>D(K,S),[()=>i(d(U).status)]),w(H,K)},$$slots:{default:!0}});var Be=N(Te,2);Ve(Be,{variant:"secondary",children:(H,te)=>{re();var K=we();x(S=>D(K,S),[()=>r(d(U).maturity)]),w(H,K)},$$slots:{default:!0}}),O(ye);var v=N(ye,2),C=L(v),F=L(C,!0);O(C);var X=N(C,2),pe=L(X);O(X),O(v),x(()=>{D(F,d(U).title),D(pe,`@${d(U).slugs[0]??d(U).ulid??""}`)}),w(Qe,Ae)},$$slots:{default:!0}});var et=N(Ue,2);ss(et,{class:"space-y-3",children:(Qe,Pe)=>{var Ae=lo(),ye=q(Ae),oe=L(ye);Ve(oe,{variant:"outline",children:(Be,v)=>{re();var C=we();x(()=>D(C,`${d(U).ac_count??""} AC${d(U).ac_count===1?"":"s"}`)),w(Be,C)},$$slots:{default:!0}});var Te=N(oe,2);Xe(Te,17,()=>d(U).traits,ot,(Be,v)=>{Ve(Be,{variant:"outline",children:(C,F)=>{re();var X=we();x(()=>D(X,d(v))),w(C,X)},$$slots:{default:!0}})}),O(ye),re(2),w(Qe,Ae)},$$slots:{default:!0}}),w(Oe,De)},$$slots:{default:!0}}),O(he),x(Oe=>jt(he,"href",Oe),[()=>t(d(U).slugs[0]??d(U).ulid)]),w($e,he)}),O(z),w(B,z)},W=B=>{var z=yo();Xe(z,21,()=>d(l).items,ot,($e,U)=>{var he=go(),Ne=L(he);ts(Ne,{class:"border-0 shadow-none",children:(Oe,It)=>{var De=mo(),Ue=q(De);ns(Ue,{class:"gap-3 pb-3",children:(Pe,Ae)=>{var ye=ho(),oe=q(ye),Te=L(oe);Ve(Te,{variant:"secondary",children:(K,S)=>{re();var be=we();x(Fe=>D(be,Fe),[()=>i(d(U).status)]),w(K,be)},$$slots:{default:!0}});var Be=N(Te,2);Ve(Be,{variant:"outline",children:(K,S)=>{re();var be=we();x(()=>D(be,`P${d(U).priority??""}`)),w(K,be)},$$slots:{default:!0}});var v=N(Be,2);{var C=K=>{Ve(K,{variant:"outline",children:(S,be)=>{re();var Fe=we();x(()=>D(Fe,d(U).assignee)),w(S,Fe)},$$slots:{default:!0}})};R(v,K=>{d(U).assignee&&K(C)})}O(oe);var F=N(oe,2),X=L(F),pe=L(X,!0);O(X);var H=N(X,2),te=L(H);O(H),O(F),x(()=>{D(pe,d(U).title),D(te,`@${d(U).slugs[0]??d(U).ulid??""}`)}),w(Pe,ye)},$$slots:{default:!0}});var et=N(Ue,2);{var Qe=Pe=>{ss(Pe,{class:"pt-0",children:(Ae,ye)=>{var oe=po(),Te=L(oe);O(oe),x(()=>D(Te,`Spec: ${d(U).spec_ref??""}`)),w(Ae,oe)},$$slots:{default:!0}})};R(et,Pe=>{d(U).spec_ref&&Pe(Qe)})}w(Oe,De)},$$slots:{default:!0}}),O(he),x(Oe=>jt(he,"href",Oe),[()=>s(d(U).slugs[0]??d(U).ulid)]),w($e,he)}),O(z),w(B,z)};R(j,B=>{d(l).embedType==="spec"?B(ne):B(W,!1)},!0)}w(P,b)};R(A,P=>{d(l).state==="error"?P(T):P(I,!1)},!0)}w(k,$)};R(h,k=>{d(l).state==="loading"?k(m):k(_,!1)},!0)}w(g,y)};R(p,g=>{d(l).type==="markdown"?g(f):g(u,!1)})}w(a,c)}),O(o),w(n,o),ds()}function wo(n,e){us(e,!0);let t=$n(e,["$$slots","$$events","$$legacy"]);const s=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"}],["path",{d:"M15 5.764v15"}],["path",{d:"M9 3.236v15"}]];On(n,Sn({name:"map"},()=>t,{get iconNode(){return s},children:(i,r)=>{var o=je(),a=q(o);Nn(a,()=>e.children??kn),w(i,o)},$$slots:{default:!0}})),ds()}function _o(n,e){us(e,!0);let t=$n(e,["$$slots","$$events","$$legacy"]);const s=[["path",{d:"M13 5h8"}],["path",{d:"M13 12h8"}],["path",{d:"M13 19h8"}],["path",{d:"m3 17 2 2 4-4"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1"}]];On(n,Sn({name:"list-todo"},()=>t,{get iconNode(){return s},children:(i,r)=>{var o=je(),a=q(o);Nn(a,()=>e.children??kn),w(i,o)},$$slots:{default:!0}})),ds()}var ko=E("· <!>",1),So=E('<p class="text-sm text-muted-foreground" data-testid="plans-summary"> <!> <!></p>'),$o=E('<div class="bg-destructive/10 text-destructive p-4 rounded-lg text-sm" data-testid="error-message" role="alert"> </div>'),No=E('<div class="h-28 rounded-lg bg-muted ds-shimmer"></div>'),Oo=E('<div class="space-y-2" data-testid="plans-loading"></div>'),Ao=E('Create plans with <code class="text-xs bg-muted px-1 py-0.5 rounded">kspec plan add</code> to track implementation progress.',1),To=E('<h2 class="text-lg font-medium text-muted-foreground mb-1">No plans yet</h2> <p class="text-sm text-muted-foreground"><!></p>',1),Io=E('<h2 class="text-lg font-medium text-muted-foreground mb-1">No matching plans</h2> <p class="text-sm text-muted-foreground">Try adjusting the filter above.</p>',1),Lo=E('<div class="flex flex-col items-center justify-center py-16" data-testid="plans-empty"><!> <!></div>'),Eo=E('<div class="flex items-start justify-between gap-4"><div class="flex-1 min-w-0"><div class="flex items-center gap-2 mb-1"><!> <h3 class="text-sm font-semibold truncate" data-testid="plan-title"> </h3></div></div></div>'),Co=E('<span class="inline-flex items-center gap-1"><span class="inline-block size-2 rounded-full bg-[var(--design-status-completed)]"></span> </span>'),Mo=E('<span class="inline-flex items-center gap-1"><span class="inline-block size-2 rounded-full bg-[var(--design-status-in-progress)]"></span> </span>'),Po=E('<span class="inline-flex items-center gap-1"><span class="inline-block size-2 rounded-full bg-[var(--design-status-pending)]"></span> </span>'),Bo=E('<span class="inline-flex items-center gap-1"><span class="inline-block size-2 rounded-full bg-[var(--design-status-blocked)]"></span> </span>'),xo=E('<div class="flex items-center gap-3"><div class="flex-1 h-2 rounded-full bg-muted overflow-hidden" data-testid="plan-progress-bar"><div class="h-full rounded-full transition-all duration-300 bg-[var(--design-status-completed)]"></div></div> <span class="text-xs font-medium text-muted-foreground whitespace-nowrap" data-testid="plan-progress-text"> </span></div> <div class="flex flex-wrap gap-2 text-xs text-muted-foreground" data-testid="plan-task-breakdown"><!> <!> <!> <!></div>',1),jo=E('<span>·</span> <code class="text-xs bg-muted px-1 py-0.5 rounded" data-testid="plan-slug"> </code>',1),Ko=E("<!> View Specs",1),Do=E("<!> View Tasks",1),Uo=E(" <!>",1),Fo=E('<div class="space-y-2" data-testid="plan-content-loading"><!> <!> <!> <!> <!></div>'),Ro=E('<div class="text-sm text-destructive bg-destructive/10 p-3 rounded" role="alert" data-testid="plan-content-error"> </div>'),qo=E('<div class="prose prose-sm dark:prose-invert max-w-none"><!></div>'),Vo=E('<p class="text-sm text-muted-foreground italic" data-testid="plan-content-empty">No content available for this plan.</p>'),Jo=E('<div class="mt-3 border-t pt-3" data-testid="plan-content-section"><!></div>'),Yo=E('<div class="flex flex-col gap-3"><!> <div class="flex items-center gap-2 text-xs text-muted-foreground"><span data-testid="plan-created-at"> </span> <span>·</span> <span data-testid="plan-spec-count"> </span> <span>·</span> <span data-testid="plan-task-count"> </span> <!></div></div> <div class="flex items-center gap-2 pt-1" data-testid="plan-actions"><!> <!> <!></div> <!>',1),Go=E("<!> <!>",1),Qo=E('<div class="flex flex-col gap-3" data-testid="plans-list"></div>'),Ho=E('<div class="flex flex-col gap-4 p-6"><div class="flex items-center justify-between"><div><h1 class="text-2xl font-bold">Plans</h1> <!></div></div> <div class="flex flex-wrap gap-2 items-center" data-testid="plans-filters"><label for="plans-status-filter" class="text-sm font-medium text-muted-foreground">Status</label> <select id="plans-status-filter" class="rounded-md border bg-background px-3 py-1.5 text-sm" data-testid="plans-status-filter"><option>All Status</option><option>Draft</option><option>Approved</option><option>Active</option><option>Completed</option><option>Rejected</option></select></div> <!> <!></div>');function ma(n,e){us(e,!0);const t=()=>Pi(xi,"$page",s),[s,i]=Mi();let r=le(()=>t().url.searchParams.get("status")||"all");function o(v){const C=new URL(t().url);v==="all"?C.searchParams.delete("status"):C.searchParams.set("status",v),Bi(C,{replaceState:!0,keepFocus:!0,noScroll:!0})}let a=it(null),l=it(mt({})),c=it(mt({})),p=it(mt({})),f=it(mt({})),u=it(mt({})),g=it(mt({}));const y={draft:"Draft",approved:"Approved",active:"Active",completed:"Completed",rejected:"Rejected"},h={draft:"bg-status-pending text-status-pending-fg",approved:"bg-status-pending-review text-status-pending-review-fg",active:"bg-status-in-progress text-status-in-progress-fg",completed:"bg-status-completed text-status-completed-fg",rejected:"bg-status-blocked text-status-blocked-fg"},m=Si(()=>({queryKey:Ai.plans.lists(),queryFn:()=>Oi(),enabled:Ni()}));let _=le(()=>m.data?.items??[]),k=le(()=>m.isLoading),$=le(()=>m.error?.message??""),A=le(()=>d(r)==="all"?d(_):d(_).filter(v=>v.status===d(r))),T=le(()=>{const v={};for(const C of d(_))v[C.status]=(v[C.status]??0)+1;return v});async function I(v){const C=v.slugs[0]??v._ulid;if(d(a)===v._ulid){ge(a,null);return}if(ge(a,v._ulid,!0),d(l)[v._ulid]!==void 0){d(f)[v._ulid]===void 0&&!d(u)[v._ulid]&&v.derived_specs.length+v.derived_tasks.length>0&&P(v);return}if(!d(c)[v._ulid]){ge(c,{...d(c),[v._ulid]:!0},!0),ge(p,{...d(p),[v._ulid]:""},!0);try{const F=await Li(C);ge(l,{...d(l),[v._ulid]:F},!0),F.derived_specs.length+F.derived_tasks.length>0&&P(F)}catch(F){ge(p,{...d(p),[v._ulid]:F instanceof Error?F.message:"Failed to load plan content"},!0)}finally{ge(c,{...d(c),[v._ulid]:!1},!0)}}}async function P(v){if(d(u)[v._ulid])return;const C=[...v.derived_specs,...v.derived_tasks];if(C.length===0){ge(f,{...d(f),[v._ulid]:[]},!0);return}ge(u,{...d(u),[v._ulid]:!0},!0),ge(g,{...d(g),[v._ulid]:""},!0);try{const F=await Ei(C);ge(f,{...d(f),[v._ulid]:F.items},!0)}catch(F){ge(g,{...d(g),[v._ulid]:F instanceof Error?F.message:"Failed to load embedded items"},!0)}finally{ge(u,{...d(u),[v._ulid]:!1},!0)}}function b(v){const C=new Date(v),X=new Date().getTime()-C.getTime(),pe=Math.floor(X/6e4),H=Math.floor(X/36e5),te=Math.floor(X/864e5);return pe<1?"just now":pe<60?`${pe}m ago`:H<24?`${H}h ago`:te<7?`${te}d ago`:C.toLocaleDateString()}function j(v){return v.task_progress.total===0?0:Math.round(v.task_progress.completed/v.task_progress.total*100)}function ne(v){const C=d(l)[v];return C?eo(C,{batchItems:d(f)[v],batchLoading:d(u)[v],batchError:d(g)[v]}):[]}var W=Ho(),B=L(W),z=L(B),$e=N(L(z),2);{var U=v=>{var C=So(),F=L(C),X=N(F);{var pe=K=>{var S=ko(),be=N(q(S));Xe(be,17,()=>Object.entries(d(T)),ot,(Fe,Ie,Re)=>{var tt=le(()=>_i(d(Ie),2));let He=()=>d(tt)[0],Lt=()=>d(tt)[1];re();var Le=we();x((ae,Ee)=>D(Le,`${Lt()??""} ${ae??""}${Ee??""}`),[()=>y[He()]?.toLowerCase()??He(),()=>Re<Object.entries(d(T)).length-1?", ":""]),w(Fe,Le)}),w(K,S)};R(X,K=>{Object.keys(d(T)).length>0&&K(pe)})}var H=N(X,2);{var te=K=>{var S=we();x(()=>D(S,`· Showing ${d(A).length??""} filtered`)),w(K,S)};R(H,K=>{d(A).length!==d(_).length&&K(te)})}O(C),x(()=>D(F,`${d(_).length??""} plan${d(_).length===1?"":"s"} `)),w(v,C)};R($e,v=>{d(k)||v(U)})}O(z),O(B);var he=N(B,2),Ne=N(L(he),2);Ne.__change=v=>o(v.currentTarget.value);var Oe=L(Ne);Oe.value=Oe.__value="all";var It=N(Oe);It.value=It.__value="draft";var De=N(It);De.value=De.__value="approved";var Ue=N(De);Ue.value=Ue.__value="active";var et=N(Ue);et.value=et.__value="completed";var Qe=N(et);Qe.value=Qe.__value="rejected",O(Ne);var Pe;$i(Ne),O(he);var Ae=N(he,2);{var ye=v=>{var C=$o(),F=L(C,!0);O(C),x(()=>D(F,d($))),w(v,C)};R(Ae,v=>{d($)&&v(ye)})}var oe=N(Ae,2);{var Te=v=>{var C=Oo();Xe(C,20,()=>Array(3),ot,(F,X)=>{var pe=No();w(F,pe)}),O(C),w(v,C)},Be=v=>{var C=je(),F=q(C);{var X=H=>{var te=Lo(),K=L(te);wo(K,{class:"size-12 text-muted-foreground/30 mb-4"});var S=N(K,2);{var be=Ie=>{var Re=To(),tt=N(q(Re),2),He=L(tt);{var Lt=ae=>{var Ee=we("No plan data available in the snapshot.");w(ae,Ee)},Le=ae=>{var Ee=Ao();re(2),w(ae,Ee)};R(He,ae=>{Ci()?ae(Lt):ae(Le,!1)})}O(tt),w(Ie,Re)},Fe=Ie=>{var Re=Io();re(2),w(Ie,Re)};R(S,Ie=>{d(_).length===0?Ie(be):Ie(Fe,!1)})}O(te),w(H,te)},pe=H=>{var te=Qo();Xe(te,21,()=>d(A),K=>K._ulid,(K,S)=>{ts(K,{class:"transition-all duration-200 hover:shadow-md","data-testid":"plan-card",children:(be,Fe)=>{var Ie=Go(),Re=q(Ie);ns(Re,{class:"pb-3",children:(He,Lt)=>{var Le=Eo(),ae=L(Le),Ee=L(ae),Qt=L(Ee);{let Ss=le(()=>h[d(S).status]??"bg-muted text-muted-foreground");Ve(Qt,{get class(){return d(Ss)},"data-testid":"plan-status",children:(Mt,en)=>{re();var ut=we();x(()=>D(ut,y[d(S).status]??d(S).status)),w(Mt,ut)},$$slots:{default:!0}})}var Et=N(Qt,2),Ct=L(Et,!0);O(Et),O(Ee),O(ae),O(Le),x(()=>D(Ct,d(S).title)),w(He,Le)},$$slots:{default:!0}});var tt=N(Re,2);ss(tt,{class:"pt-0",children:(He,Lt)=>{var Le=Yo(),ae=q(Le),Ee=L(ae);{var Qt=J=>{var ie=xo(),me=q(ie),ue=L(me),We=L(ue);O(ue);var se=N(ue,2),de=L(se);O(se),O(me);var st=N(me,2),nt=L(st);{var dt=Z=>{var ee=Co(),qe=N(L(ee));O(ee),x(()=>D(qe,` ${d(S).task_progress.completed??""} completed`)),w(Z,ee)};R(nt,Z=>{d(S).task_progress.completed>0&&Z(dt)})}var ve=N(nt,2);{var xe=Z=>{var ee=Mo(),qe=N(L(ee));O(ee),x(()=>D(qe,` ${d(S).task_progress.in_progress??""} in progress`)),w(Z,ee)};R(ve,Z=>{d(S).task_progress.in_progress>0&&Z(xe)})}var ht=N(ve,2);{var Ns=Z=>{var ee=Po(),qe=N(L(ee));O(ee),x(()=>D(qe,` ${d(S).task_progress.pending??""} pending`)),w(Z,ee)};R(ht,Z=>{d(S).task_progress.pending>0&&Z(Ns)})}var Pt=N(ht,2);{var Ht=Z=>{var ee=Bo(),qe=N(L(ee));O(ee),x(()=>D(qe,` ${d(S).task_progress.blocked??""} blocked`)),w(Z,ee)};R(Pt,Z=>{d(S).task_progress.blocked>0&&Z(Ht)})}O(st),x((Z,ee)=>{Ii(We,`width: ${Z??""}%`),D(de,`${ee??""}% (${d(S).task_progress.completed??""}/${d(S).task_progress.total??""} tasks)`)},[()=>j(d(S)),()=>j(d(S))]),w(J,ie)};R(Ee,J=>{d(S).task_progress.total>0&&J(Qt)})}var Et=N(Ee,2),Ct=L(Et),Ss=L(Ct,!0);O(Ct);var Mt=N(Ct,4),en=L(Mt);O(Mt);var ut=N(Mt,4),ui=L(ut);O(ut);var di=N(ut,2);{var hi=J=>{var ie=jo(),me=N(q(ie),2),ue=L(me);O(me),x(()=>D(ue,`@${d(S).slugs[0]??""}`)),w(J,ie)};R(di,J=>{d(S).slugs.length>0&&J(hi)})}O(Et),O(ae);var $s=N(ae,2),tn=L($s);{var pi=J=>{{let ie=le(()=>as),me=le(()=>encodeURIComponent(d(S).slugs[0]??d(S)._ulid));Os(J,{variant:"outline",size:"sm",get href(){return`${d(ie)??""}/items?plan=${d(me)??""}`},class:"h-7 gap-1.5 text-xs","data-testid":"plan-view-specs",children:(ue,We)=>{var se=Ko(),de=q(se);Ki(de,{class:"size-3.5"}),re(),w(ue,se)},$$slots:{default:!0}})}};R(tn,J=>{d(S).spec_count>0&&J(pi)})}var sn=N(tn,2);{var mi=J=>{{let ie=le(()=>as),me=le(()=>encodeURIComponent(d(S).slugs[0]??d(S)._ulid));Os(J,{variant:"outline",size:"sm",get href(){return`${d(ie)??""}/tasks?plan=${d(me)??""}`},class:"h-7 gap-1.5 text-xs","data-testid":"plan-view-tasks",children:(ue,We)=>{var se=Do(),de=q(se);_o(de,{class:"size-3.5"}),re(),w(ue,se)},$$slots:{default:!0}})}};R(sn,J=>{d(S).task_count>0&&J(mi)})}var gi=N(sn,2);{let J=le(()=>d(a)===d(S)._ulid);Os(gi,{variant:"ghost",size:"sm",class:"h-7 gap-1.5 text-xs ml-auto",onclick:()=>I(d(S)),get"aria-expanded"(){return d(J)},get"aria-controls"(){return`plan-content-${d(S)._ulid??""}`},"data-testid":"plan-expand-toggle",children:(ie,me)=>{re();var ue=Uo(),We=q(ue),se=N(We);{let de=le(()=>d(a)===d(S)._ulid?"rotate-180":"");ji(se,{get class(){return`size-3.5 transition-transform duration-200 ${d(de)??""}`}})}x(()=>D(We,`${d(a)===d(S)._ulid?"Hide Content":"Show Content"} `)),w(ie,ue)},$$slots:{default:!0}})}O($s);var yi=N($s,2);{var bi=J=>{var ie=Jo(),me=L(ie);{var ue=se=>{var de=Fo(),st=L(de);Je(st,{class:"h-4 w-full"});var nt=N(st,2);Je(nt,{class:"h-4 w-5/6"});var dt=N(nt,2);Je(dt,{class:"h-4 w-4/6"});var ve=N(dt,2);Je(ve,{class:"h-4 w-full"});var xe=N(ve,2);Je(xe,{class:"h-4 w-3/6"}),O(de),w(se,de)},We=se=>{var de=je(),st=q(de);{var nt=ve=>{var xe=Ro(),ht=L(xe,!0);O(xe),x(()=>D(ht,d(p)[d(S)._ulid])),w(ve,xe)},dt=ve=>{var xe=je(),ht=q(xe);{var Ns=Pt=>{var Ht=je(),Z=q(Ht);{var ee=pt=>{var Bt=qo(),vi=L(Bt);{let wi=le(()=>ne(d(S)._ulid));vo(vi,{get blocks(){return d(wi)}})}O(Bt),w(pt,Bt)},qe=pt=>{var Bt=Vo();w(pt,Bt)};R(Z,pt=>{d(l)[d(S)._ulid].content?pt(ee):pt(qe,!1)})}w(Pt,Ht)};R(ht,Pt=>{d(l)[d(S)._ulid]!==void 0&&Pt(Ns)},!0)}w(ve,xe)};R(st,ve=>{d(p)[d(S)._ulid]?ve(nt):ve(dt,!1)},!0)}w(se,de)};R(me,se=>{d(c)[d(S)._ulid]?se(ue):se(We,!1)})}O(ie),x(()=>jt(ie,"id",`plan-content-${d(S)._ulid??""}`)),w(J,ie)};R(yi,J=>{d(a)===d(S)._ulid&&J(bi)})}x(J=>{D(Ss,J),D(en,`${d(S).spec_count??""} spec${d(S).spec_count===1?"":"s"}`),D(ui,`${d(S).task_count??""} task${d(S).task_count===1?"":"s"}`)},[()=>b(d(S).created_at)]),w(He,Le)},$$slots:{default:!0}}),w(be,Ie)},$$slots:{default:!0}})}),O(te),w(H,te)};R(F,H=>{d(A).length===0?H(X):H(pe,!1)},!0)}w(v,C)};R(oe,v=>{d(k)?v(Te):v(Be,!1)})}O(W),x(()=>{Pe!==(Pe=d(r))&&(Ne.value=(Ne.__value=d(r))??"",Ti(Ne,d(r)))}),w(n,W),ds(),i()}ki(["change"]);export{ma as component,pa as universal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as v,a as s,t as m,c as Ue}from"../chunks/y4GeEH6k.js";import{a as Qt}from"../chunks/oTsvd9y4.js";import{p as Tt,c as n,s as a,g as e,r as o,t as A,u as c,f as N,n as w,a as wt,y as ht,d as vt,b as xt}from"../chunks/CaAJD3dl.js";import{d as zt,s as p,e as jt}from"../chunks/DqT6OH_u.js";import{i as y,b as Bt}from"../chunks/Dg_zDpDS.js";import{Q as Ut,M as Vt,h as we,y as $t,p as $e,j as Ve,a as Kt,b as bt,N as Ht,q as yt,O as Zt,P as Yt,d as Gt,B as Xt}from"../chunks/Dd5umPsk.js";import{a as Jt}from"../chunks/qJfLUwU4.js";import{s as At,a as Dt}from"../chunks/ChQD-6N8.js";import{g as et}from"../chunks/BsJFsuAT.js";import{p as Rt}from"../chunks/gPrj-hqC.js";import{b as fe}from"../chunks/CDRO15Iv.js";import{a as Pt,i as Wt,g as St,f as es}from"../chunks/CS2sa4_m.js";import{S as Xe,a as Je,b as We,c as J}from"../chunks/B8tYZKAE.js";import{B as ts}from"../chunks/P0A_fJvS.js";import{X as ss}from"../chunks/GFTX8GgV.js";import{R as as}from"../chunks/DJtZNgcs.js";import{i as kt,h as rs,a as os,S as is}from"../chunks/xCtiO_JE.js";import{A as ns}from"../chunks/B2bcA_Q_.js";import{Z as ls}from"../chunks/B5e5HYyB.js";import{T as ds}from"../chunks/DqK4iHp0.js";import{L as cs}from"../chunks/Dgqu8Yuc.js";var us=class extends Ut{constructor(k,D){super(k,D)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(k){super.setOptions({...k,behavior:kt()})}getOptimisticResult(k){return k.behavior=kt(),super.getOptimisticResult(k)}fetchNextPage(k){return this.fetch({...k,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(k){return this.fetch({...k,meta:{fetchMore:{direction:"backward"}}})}createResult(k,D){const{state:h}=k,Ae=super.createResult(k,D),{isFetching:De,isRefetching:Me,isError:Re,isRefetchError:Ne}=Ae,H=h.fetchMeta?.fetchMore?.direction,z=Re&&H==="forward",j=De&&H==="forward",O=Re&&H==="backward",q=De&&H==="backward";return{...Ae,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:os(D,h.data),hasPreviousPage:rs(D,h.data),isFetchNextPageError:z,isFetchingNextPage:j,isFetchPreviousPageError:O,isFetchingPreviousPage:q,isRefetchError:Ne&&!z&&!O,isRefetching:Me&&!j&&!q}}};function vs(k,D){return Vt(k,us)}var fs=v('<button type="button"> </button>'),gs=v("<!> <!> <!>",1),ps=v("<!> <!>",1),_s=v("<!> <!>",1),ms=v("<!> <!>",1),hs=v('<div class="min-w-[150px]"><label for="session-agent-type-filter" class="text-xs font-medium text-muted-foreground mb-1 block">Agent Type</label> <!></div>'),xs=v("<!> <!>",1),$s=v("<!> <!>",1),bs=v('<div class="min-w-[130px]"><label for="session-agent-filter" class="text-xs font-medium text-muted-foreground mb-1 block">Agent</label> <!></div>'),ys=v("<!> <!> <!> <!>",1),Ps=v("<!> <!>",1),Ss=v("<!> Clear filters",1),ks=v('<span class="text-xs text-muted-foreground ml-auto" data-testid="session-filter-count"> </span>'),Ts=v('<div class="flex flex-wrap items-end gap-3" data-testid="session-filter-controls"><div class="min-w-[240px]"><label class="text-xs font-medium text-muted-foreground mb-1 block">Status</label> <div class="flex flex-wrap gap-1.5" data-testid="session-filter-status-group"><button type="button" data-testid="session-filter-status-all">All</button> <!></div></div> <div class="min-w-[130px]"><label for="session-trigger-filter" class="text-xs font-medium text-muted-foreground mb-1 block">Trigger</label> <!></div> <!> <!> <div class="min-w-[130px]"><label for="session-date-filter" class="text-xs font-medium text-muted-foreground mb-1 block">Time Range</label> <!></div> <!> <!></div>');function ws(k,D){Tt(D,!0);const h=()=>Dt(Rt,"$page",Ae),[Ae,De]=At(),Me=["active","completed","failed","abandoned","timed_out","stalled"],Re={"":"All Statuses",all:"All Statuses",active:"Active",completed:"Completed",failed:"Failed",abandoned:"Abandoned",timed_out:"Timed Out",stalled:"Stalled"},Ne={"":"All Time",all:"All Time",today:"Today","7d":"Last 7 days","30d":"Last 30 days"},H={"":"All Triggers",all:"All Triggers",manual:"Manual",dispatched:"Dispatched"};let z=c(()=>h().url.searchParams.getAll("status")),j=c(()=>h().url.searchParams.get("agent_id")||""),O=c(()=>h().url.searchParams.get("agent_type")||""),q=c(()=>h().url.searchParams.get("trigger")||""),B=c(()=>h().url.searchParams.get("since")||""),oe=c(()=>h().url.searchParams.get("task_id")||""),ie=c(()=>h().url.searchParams.get("spec_ref")||""),W=c(()=>e(z).length>0||e(j)||e(O)||e(q)||e(B)||e(oe)||e(ie)),ee=c(()=>e(q)||"all"),be=c(()=>Oe(e(B)));function C(d){const r=new Date;switch(d){case"today":return new Date(r.getFullYear(),r.getMonth(),r.getDate()).toISOString();case"7d":{const l=new Date(r);return l.setDate(l.getDate()-7),l.toISOString()}case"30d":{const l=new Date(r);return l.setDate(l.getDate()-30),l.toISOString()}default:return}}function Oe(d){if(!d)return"all";const r=new Date(d);if(Number.isNaN(r.getTime()))return"all";const f=Date.now()-r.getTime(),g=1440*60*1e3,_=new Date,R=new Date(_.getFullYear(),_.getMonth(),_.getDate()).getTime();return Math.abs(r.getTime()-R)<60*1e3?"today":Math.abs(f-7*g)<600*1e3?"7d":Math.abs(f-30*g)<600*1e3?"30d":"all"}function ge(d,r){let l;Array.isArray(r)?l=r.length>0?r[r.length-1]:void 0:l=r;const f=new URLSearchParams(h().url.searchParams);!l||l==="all"?f.delete(d):f.set(d,l),f.delete("offset");const g=f.toString(),_=g?`${fe}/sessions?${g}`:`${fe}/sessions`;et(_,{replaceState:!0,keepFocus:!0,noScroll:!0})}function tt(d){const r=new URLSearchParams(h().url.searchParams),l=r.getAll("status"),f=l.includes(d)?l.filter(R=>R!==d):[...l,d];r.delete("status");for(const R of f)r.append("status",R);r.delete("offset");const g=r.toString(),_=g?`${fe}/sessions?${g}`:`${fe}/sessions`;et(_,{replaceState:!0,keepFocus:!0,noScroll:!0})}function st(){ge("status",void 0)}function te(){et(`${fe}/sessions`,{replaceState:!0,keepFocus:!0,noScroll:!0})}var ne=Ts(),Z=n(ne),le=a(n(Z),2),de=n(le);de.__click=st;var Ke=a(de,2);we(Ke,17,()=>Me,Ve,(d,r)=>{var l=fs();l.__click=()=>tt(e(r));var f=n(l,!0);o(l),A((g,_)=>{$t(l,1,`h-8 rounded-md border px-2.5 text-xs transition-colors ${g??""}`),$e(l,"data-testid",`session-filter-status-${e(r)}`),$e(l,"aria-pressed",_),p(f,Re[e(r)])},[()=>e(z).includes(e(r))?"bg-primary text-primary-foreground border-primary":"bg-background hover:bg-accent",()=>e(z).includes(e(r))]),s(d,l)}),o(le),o(Z);var ye=a(Z,2),He=a(n(ye),2);Xe(He,{get value(){return e(ee)},onValueChange:d=>ge("trigger",d),children:(d,r)=>{var l=ps(),f=N(l);Je(f,{id:"session-trigger-filter","data-testid":"session-filter-trigger",class:"h-8 text-xs",children:(_,R)=>{w();var P=m();A(()=>p(P,H[e(ee)]||"All Triggers")),s(_,P)},$$slots:{default:!0}});var g=a(f,2);We(g,{children:(_,R)=>{var P=gs(),U=N(P);J(U,{value:"all",children:(x,F)=>{w();var E=m("All Triggers");s(x,E)},$$slots:{default:!0}});var M=a(U,2);J(M,{value:"manual",children:(x,F)=>{w();var E=m("Manual");s(x,E)},$$slots:{default:!0}});var se=a(M,2);J(se,{value:"dispatched",children:(x,F)=>{w();var E=m("Dispatched");s(x,E)},$$slots:{default:!0}}),s(_,P)},$$slots:{default:!0}}),s(d,l)},$$slots:{default:!0}}),o(ye);var Fe=a(ye,2);{var Ze=d=>{var r=hs(),l=a(n(r),2);{let f=c(()=>e(O)||"all");Xe(l,{get value(){return e(f)},onValueChange:g=>ge("agent_type",g),children:(g,_)=>{var R=ms(),P=N(R);Je(P,{id:"session-agent-type-filter","data-testid":"session-filter-agent-type",class:"h-8 text-xs",children:(M,se)=>{w();var x=m();A(()=>p(x,e(O)||"All Types")),s(M,x)},$$slots:{default:!0}});var U=a(P,2);We(U,{children:(M,se)=>{var x=_s(),F=N(x);J(F,{value:"all",children:(L,ce)=>{w();var t=m("All Types");s(L,t)},$$slots:{default:!0}});var E=a(F,2);we(E,17,()=>D.agentTypes,Ve,(L,ce)=>{J(L,{get value(){return e(ce)},children:(t,i)=>{w();var I=m();A(()=>p(I,e(ce))),s(t,I)},$$slots:{default:!0}})}),s(M,x)},$$slots:{default:!0}}),s(g,R)},$$slots:{default:!0}})}o(r),s(d,r)};y(Fe,d=>{(D.agentTypes.length>1||e(O))&&d(Ze)})}var Pe=a(Fe,2);{var qe=d=>{var r=bs(),l=a(n(r),2);{let f=c(()=>e(j)||"all");Xe(l,{get value(){return e(f)},onValueChange:g=>ge("agent_id",g),children:(g,_)=>{var R=$s(),P=N(R);Je(P,{id:"session-agent-filter","data-testid":"session-filter-agent",class:"h-8 text-xs",children:(M,se)=>{w();var x=m();A(()=>p(x,e(j)||"All Agents")),s(M,x)},$$slots:{default:!0}});var U=a(P,2);We(U,{children:(M,se)=>{var x=xs(),F=N(x);J(F,{value:"all",children:(L,ce)=>{w();var t=m("All Agents");s(L,t)},$$slots:{default:!0}});var E=a(F,2);we(E,17,()=>D.agentIds,Ve,(L,ce)=>{J(L,{get value(){return e(ce)},children:(t,i)=>{w();var I=m();A(()=>p(I,e(ce))),s(t,I)},$$slots:{default:!0}})}),s(M,x)},$$slots:{default:!0}}),s(g,R)},$$slots:{default:!0}})}o(r),s(d,r)};y(Pe,d=>{(D.agentIds.length>1||e(j))&&d(qe)})}var Ee=a(Pe,2),at=a(n(Ee),2);Xe(at,{get value(){return e(be)},onValueChange:d=>ge("since",C(d)),children:(d,r)=>{var l=Ps(),f=N(l);Je(f,{id:"session-date-filter","data-testid":"session-filter-date",class:"h-8 text-xs",children:(_,R)=>{w();var P=m();A(()=>p(P,Ne[e(be)]||"All Time")),s(_,P)},$$slots:{default:!0}});var g=a(f,2);We(g,{children:(_,R)=>{var P=ys(),U=N(P);J(U,{value:"all",children:(F,E)=>{w();var L=m("All Time");s(F,L)},$$slots:{default:!0}});var M=a(U,2);J(M,{value:"today",children:(F,E)=>{w();var L=m("Today");s(F,L)},$$slots:{default:!0}});var se=a(M,2);J(se,{value:"7d",children:(F,E)=>{w();var L=m("Last 7 days");s(F,L)},$$slots:{default:!0}});var x=a(se,2);J(x,{value:"30d",children:(F,E)=>{w();var L=m("Last 30 days");s(F,L)},$$slots:{default:!0}}),s(_,P)},$$slots:{default:!0}}),s(d,l)},$$slots:{default:!0}}),o(Ee);var Ye=a(Ee,2);{var rt=d=>{ts(d,{variant:"ghost",size:"sm",onclick:te,class:"h-8 text-xs gap-1","data-testid":"session-clear-filters",children:(r,l)=>{var f=Ss(),g=N(f);ss(g,{class:"size-3"}),w(),s(r,f)},$$slots:{default:!0}})};y(Ye,d=>{e(W)&&d(rt)})}var ot=a(Ye,2);{var it=d=>{var r=ks(),l=n(r);o(r),A(()=>p(l,`${D.filteredTotal??""} of ${D.unfilteredTotal??""} session${D.unfilteredTotal===1?"":"s"}`)),s(d,r)};y(ot,d=>{e(W)&&D.unfilteredTotal>0&&d(it)})}o(ne),A(()=>{$t(de,1,`h-8 rounded-md border px-2.5 text-xs transition-colors ${e(z).length===0?"bg-primary text-primary-foreground border-primary":"bg-background hover:bg-accent"}`),$e(de,"aria-pressed",e(z).length===0)}),s(k,ne),wt(),De()}zt(["click"]);var As=v('<p class="text-sm text-muted-foreground" data-testid="session-search-count"> </p>'),Ds=v('<p class="text-sm text-muted-foreground" data-testid="sessions-count"> </p>'),Rs=v('<div class="bg-destructive/10 text-destructive p-4 rounded-lg" role="alert" data-testid="sessions-error"> </div>'),Fs=v('<div class="h-16 rounded-lg bg-muted ds-shimmer"></div>'),Is=v('<div class="space-y-2" data-testid="sessions-loading"></div>'),Ls=v('<div class="flex flex-col items-center justify-center py-16" data-testid="sessions-empty"><!> <h2 class="text-lg font-medium text-muted-foreground mb-1"><!></h2> <p class="text-sm text-muted-foreground"><!></p></div>'),Ms=v('<div class="rounded-md bg-muted/40 p-3" data-testid="session-search-match"><p class="text-[11px] uppercase tracking-wide text-muted-foreground"> </p> <p class="mt-1 text-sm text-foreground/90 break-words"> </p></div>'),Ns=v('<a class="block rounded-lg border p-4 hover:bg-accent/30 transition-colors" data-testid="session-search-session"><div class="flex items-center justify-between gap-3"><div><p class="text-sm font-medium"> </p> <p class="text-xs text-muted-foreground font-mono"> </p></div> <p class="text-xs text-muted-foreground"> </p></div> <div class="mt-3 space-y-2"></div></a>'),Os=v('<div class="space-y-3" data-testid="session-search-results"></div>'),qs=v('<span class="text-xs text-muted-foreground">·</span> <span data-testid="session-task-ref"><!></span>',1),Es=v('<a class="flex items-center gap-4 p-3 rounded-lg border hover:bg-accent/30 transition-colors" data-testid="session-row"><!> <span class="flex-shrink-0" data-testid="session-trigger-icon"><!></span> <div class="flex-1 min-w-0"><div class="flex items-center gap-2"><span class="text-sm font-medium"> </span> <span class="text-xs text-muted-foreground font-mono" data-testid="session-id"> </span> <!></div> <div class="text-xs text-muted-foreground"><span data-testid="session-trigger-label"> </span> <!> <!></div></div> <div class="text-right flex-shrink-0"><p class="text-xs font-mono text-muted-foreground" data-testid="session-duration"> </p> <p class="text-[10px] text-muted-foreground/60" data-testid="session-age"> </p></div></a>'),Cs=v('<div class="flex items-center justify-center py-4 gap-2 text-muted-foreground" data-testid="sessions-loading-more"><!> <span class="text-sm">Loading more sessions...</span></div>'),Qs=v('<div class="flex items-center justify-center py-4" data-testid="sessions-end-of-list"><span class="text-xs text-muted-foreground/60"> </span></div>'),zs=v('<div class="h-1" data-testid="scroll-sentinel" aria-hidden="true"></div>'),js=v('<div class="space-y-2" data-testid="sessions-list"></div> <!> <!> <!>',1),Bs=v('<div class="flex flex-col gap-4 p-6"><div><h1 class="text-2xl font-bold">Sessions</h1> <!></div> <form class="flex gap-2" data-testid="session-search-form"><div class="relative flex-1"><!> <input type="search" class="h-10 w-full rounded-md border bg-background pl-9 pr-3 text-sm" placeholder="Search session events" data-testid="session-search-input"/></div> <button type="submit" class="h-10 rounded-md border px-4 text-sm font-medium hover:bg-accent" data-testid="session-search-submit">Search</button></form> <!> <!> <!></div>');function ua(k,D){Tt(D,!0);const h=()=>Dt(Rt,"$page",Ae),[Ae,De]=At(),Me=25,Re=200,Ne=50;let H=xt(""),z=xt(void 0),j,O=c(()=>h().url.searchParams.getAll("status")),q=c(()=>h().url.searchParams.get("agent_id")||""),B=c(()=>h().url.searchParams.get("agent_type")||""),oe=c(()=>h().url.searchParams.get("trigger")||""),ie=c(()=>h().url.searchParams.get("since")||""),W=c(()=>h().url.searchParams.get("task_id")||""),ee=c(()=>h().url.searchParams.get("spec_ref")||""),be=c(()=>h().url.searchParams.get("q")||""),C=c(()=>e(be).trim().length>0),Oe=c(()=>e(O).length>0||e(q)||e(B)||e(oe)||e(ie)||e(W)||e(ee));function ge(){const t={};return e(O).length>0&&(t.status=e(O)),e(q)&&(t.agent_id=e(q)),e(B)&&(t.agent_type=e(B)),e(oe)&&(t.trigger=e(oe)),e(ie)&&(t.since=e(ie)),e(W)&&(t.task_id=e(W)),e(ee)&&(t.spec_ref=e(ee)),t}function tt(t){const i={offset:t,limit:Me};return e(O).length>0&&(i.status=e(O)),e(q)&&(i.agent_id=e(q)),e(B)&&(i.agent_type=e(B)),e(oe)&&(i.trigger=e(oe)),e(ie)&&(i.since=e(ie)),e(W)&&(i.task_id=e(W)),e(ee)&&(i.spec_ref=e(ee)),i}function st(){const t={q:e(be).trim(),limit:Ne};return e(O).length>0&&(t.status=e(O)),e(q)&&(t.agent_id=e(q)),e(B)&&(t.agent_type=e(B)),e(oe)&&(t.trigger=e(oe)),e(ie)&&(t.since=e(ie)),e(W)&&(t.task_id=e(W)),e(ee)&&(t.spec_ref=e(ee)),t}const te=vs(()=>({queryKey:yt.sessions.list({...ge(),mode:"paginated"}),queryFn:({pageParam:t})=>Ht(tt(t)),initialPageParam:0,getNextPageParam:t=>{const i=t.offset+t.items.length;return i<t.total?i:void 0},enabled:bt()&&!e(C)})),ne=Kt(()=>({queryKey:yt.sessions.list({...ge(),mode:"search",q:e(be)}),queryFn:()=>Zt(st()),enabled:bt()&&e(C)}));let Z=c(()=>te.data?.pages.flatMap(t=>t.items)??[]),le=c(()=>te.data?.pages[0]?.total??0),de=c(()=>te.isLoading),Ke=c(()=>te.isFetchingNextPage),ye=c(()=>e(C)?!0:!te.hasNextPage),He=c(()=>te.error?.message??ne.error?.message??""),Fe=c(()=>ne.data?.items??[]),Ze=c(()=>ne.data?.total_matches??0),Pe=c(()=>ne.data?.total_sessions??0),qe=c(()=>ne.isLoading),Ee=c(()=>te.data?.pages[0]?.unfiltered_total??0),at=c(()=>{const t=new Set;for(const i of e(Z))i.agent_id&&t.add(i.agent_id);return e(q)&&t.add(e(q)),[...t].sort()}),Ye=c(()=>{const t=new Set;for(const i of e(Z))t.add(i.agent_type);return e(B)&&t.add(e(B)),[...t].sort()});function rt(t){switch(t){case"active":return"bg-status-in-progress text-status-in-progress-fg";case"completed":return"bg-status-completed text-status-completed-fg";case"failed":return"bg-status-blocked text-status-blocked-fg";case"abandoned":return"bg-status-needs-work text-status-needs-work-fg";case"timed_out":return"bg-status-pending text-status-pending-fg";case"stalled":return"bg-status-needs-work text-status-needs-work-fg";default:return"bg-status-cancelled text-status-cancelled-fg"}}function ot(t){const i=new URLSearchParams(h().url.searchParams),I=t.trim();I.length===0?i.delete("q"):i.set("q",I),i.delete("offset");const Se=i.toString();et(Se?`${fe}/sessions?${Se}`:`${fe}/sessions`,{replaceState:!0,keepFocus:!0,noScroll:!0})}function it(t){t.preventDefault(),ot(e(H))}ht(()=>{vt(H,e(be),!0)}),ht(()=>{if(e(z))return j=new IntersectionObserver(t=>{t[0]?.isIntersecting&&!e(C)&&!e(Ke)&&!e(ye)&&!e(de)&&te.fetchNextPage()},{rootMargin:`${Re}px`}),j.observe(e(z)),()=>{j?.disconnect(),j=void 0}}),Qt(()=>{j?.disconnect()});var d=Bs(),r=n(d),l=a(n(r),2);{var f=t=>{var i=As(),I=n(i);o(i),A(()=>p(I,`${e(Ze)??""} match${e(Ze)===1?"":"es"} across ${e(Pe)??""} session${e(Pe)===1?"":"s"}`)),s(t,i)},g=t=>{var i=Ue(),I=N(i);{var Se=ke=>{var ae=Ds(),pe=n(ae);o(ae),A(()=>p(pe,`${e(Z).length??""} of ${e(le)??""} session${e(le)===1?"":"s"}`)),s(ke,ae)};y(I,ke=>{!e(de)&&e(le)>0&&!e(Oe)&&ke(Se)},!0)}s(t,i)};y(l,t=>{e(C)&&!e(qe)?t(f):t(g,!1)})}o(r);var _=a(r,2),R=n(_),P=n(R);is(P,{class:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"});var U=a(P,2);Yt(U),o(R),w(2),o(_);var M=a(_,2);{var se=t=>{{let i=c(()=>e(C)?e(Pe):e(le));ws(t,{get filteredTotal(){return e(i)},get unfilteredTotal(){return e(Ee)},get agentIds(){return e(at)},get agentTypes(){return e(Ye)}})}};y(M,t=>{(!e(de)&&!e(qe)||e(Z).length>0||e(Fe).length>0)&&t(se)})}var x=a(M,2);{var F=t=>{var i=Rs(),I=n(i,!0);o(i),A(()=>p(I,e(He))),s(t,i)};y(x,t=>{e(He)&&t(F)})}var E=a(x,2);{var L=t=>{var i=Is();we(i,20,()=>Array(5),Ve,(I,Se)=>{var ke=Fs();s(I,ke)}),o(i),s(t,i)},ce=t=>{var i=Ue(),I=N(i);{var Se=ae=>{var pe=Ls(),Ge=n(pe);ns(Ge,{class:"size-12 text-muted-foreground/30 mb-4"});var Ce=a(Ge,2),nt=n(Ce);{var _e=T=>{var Q=m("No matching sessions");s(T,Q)},me=T=>{var Q=m("No sessions yet");s(T,Q)};y(nt,T=>{e(C)||e(Oe)?T(_e):T(me,!1)})}o(Ce);var re=a(Ce,2),Y=n(re);{var ue=T=>{var Q=m("Session data is not available in static mode.");s(T,Q)},he=T=>{var Q=Ue(),Qe=N(Q);{var S=$=>{var G=m("Try adjusting your search or filters.");s($,G)},u=$=>{var G=Ue(),ve=N(G);{var Te=V=>{var X=m("Try adjusting your filters.");s(V,X)},xe=V=>{var X=m("Sessions are created when agents run tasks.");s(V,X)};y(ve,V=>{e(Oe)?V(Te):V(xe,!1)},!0)}s($,G)};y(Qe,$=>{e(C)?$(S):$(u,!1)},!0)}s(T,Q)};y(Y,T=>{Gt()?T(ue):T(he,!1)})}o(re),o(pe),s(ae,pe)},ke=ae=>{var pe=Ue(),Ge=N(pe);{var Ce=_e=>{var me=Os();we(me,21,()=>e(Fe),re=>re.session_id,(re,Y)=>{var ue=Ns(),he=n(ue),T=n(he),Q=n(T),Qe=n(Q,!0);o(Q);var S=a(Q,2),u=n(S,!0);o(S),o(T);var $=a(T,2),G=n($,!0);o($),o(he);var ve=a(he,2);we(ve,21,()=>e(Y).matches,Ve,(Te,xe)=>{var V=Ms(),X=n(V),ze=n(X);o(X);var Ie=a(X,2),lt=n(Ie,!0);o(Ie),o(V),A(je=>{p(ze,`${e(xe).event_type??""} #${e(xe).event_seq??""} · ${je??""}`),p(lt,e(xe).content_excerpt)},[()=>new Date(e(xe).timestamp).toISOString()]),s(Te,V)}),o(ve),o(ue),A(Te=>{$e(ue,"href",`${fe??""}/sessions/${e(Y).session_id??""}`),$e(ue,"data-session-id",e(Y).session_id),p(Qe,e(Y).agent_type),p(u,e(Y).session_id),p(G,Te)},[()=>Pt(e(Y).started_at)]),s(re,ue)}),o(me),s(_e,me)},nt=_e=>{var me=js(),re=N(me);we(re,21,()=>e(Z),S=>S.id,(S,u)=>{var $=Es(),G=n($);{let b=c(()=>rt(e(u).status));Xt(G,{get class(){return e(b)},children:(K,Be)=>{w();var Le=m();A(()=>p(Le,e(u).status)),s(K,Le)},$$slots:{default:!0}})}var ve=a(G,2),Te=n(ve);{var xe=b=>{ls(b,{class:"size-3.5 text-status-in-progress"})},V=b=>{ds(b,{class:"size-3.5 text-muted-foreground"})};y(Te,b=>{Wt(e(u).trigger)?b(xe):b(V,!1)})}o(ve);var X=a(ve,2),ze=n(X),Ie=n(ze),lt=n(Ie,!0);o(Ie);var je=a(Ie,2),Ft=n(je,!0);o(je);var It=a(je,2);{var Lt=b=>{var K=qs(),Be=a(N(K),2),Le=n(Be);{let ut=c(()=>e(u).task_title??void 0);as(Le,{get ref(){return e(u).task_id},type:"task",get title(){return e(ut)},inline:!0,class:"text-xs"})}o(Be),s(b,K)};y(It,b=>{e(u).task_id&&b(Lt)})}o(ze);var ft=a(ze,2),dt=n(ft),Mt=n(dt,!0);o(dt);var gt=a(dt),pt=a(gt);{var Nt=b=>{var K=m();A(()=>p(K,`· ${e(u).iteration_count??""} iterations`)),s(b,K)};y(pt,b=>{e(u).iteration_count>0&&b(Nt)})}var Ot=a(pt,2);{var qt=b=>{var K=m();A(()=>p(K,`· ${e(u).tasks_completed??""} tasks`)),s(b,K)};y(Ot,b=>{e(u).tasks_completed>0&&b(qt)})}o(ft),o(X);var _t=a(X,2),ct=n(_t),Et=n(ct,!0);o(ct);var mt=a(ct,2),Ct=n(mt,!0);o(mt),o(_t),o($),A((b,K,Be,Le,ut)=>{$e($,"href",`${fe??""}/sessions/${e(u).id??""}`),$e($,"data-session-id",e(u).id),$e(ve,"title",b),p(lt,e(u).agent_type),p(Ft,K),p(Mt,Be),p(gt,` · ${e(u).event_count??""} events `),p(Et,Le),p(Ct,ut)},[()=>St(e(u).trigger),()=>e(u).id.slice(0,8),()=>St(e(u).trigger),()=>es(e(u).duration_ms),()=>Pt(e(u).started_at)]),s(S,$)}),o(re);var Y=a(re,2);{var ue=S=>{var u=Cs(),$=n(u);cs($,{class:"size-4 animate-spin"}),w(2),o(u),s(S,u)};y(Y,S=>{e(Ke)&&S(ue)})}var he=a(Y,2);{var T=S=>{var u=Qs(),$=n(u),G=n($);o($),o(u),A(()=>p(G,`All ${e(le)??""} sessions loaded`)),s(S,u)};y(he,S=>{e(ye)&&e(Z).length>0&&S(T)})}var Q=a(he,2);{var Qe=S=>{var u=zs();Bt(u,$=>vt(z,$),()=>e(z)),s(S,u)};y(Q,S=>{e(ye)||S(Qe)})}s(_e,me)};y(Ge,_e=>{e(C)?_e(Ce):_e(nt,!1)},!0)}s(ae,pe)};y(I,ae=>{(e(C)?e(Fe).length===0:e(Z).length===0)&&(e(C)?e(Pe)===0:e(le)===0)?ae(Se):ae(ke,!1)},!0)}s(t,i)};y(E,t=>{e(de)||e(C)&&e(qe)?t(L):t(ce,!1)})}o(d),jt("submit",_,it),Jt(U,()=>e(H),t=>vt(H,t)),s(k,d),wt(),De()}export{ua as component};
|