@dendelion/paper-camp 0.4.0 → 0.6.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.
Files changed (39) hide show
  1. package/README.md +6 -0
  2. package/dist/app/assets/main-CDaKqAAm.js +200 -0
  3. package/dist/app/assets/main-CDaKqAAm.js.map +1 -0
  4. package/dist/app/assets/main-DVU0frJi.css +1 -0
  5. package/dist/app/index.html +2 -2
  6. package/dist/chunks/{serializer.B8u-L8BI.js → serializer.DbnJzwVr.js} +1220 -990
  7. package/dist/chunks/serializer.DbnJzwVr.js.map +1 -0
  8. package/dist/cli/index.js +17247 -1494
  9. package/dist/cli/index.js.map +1 -1
  10. package/dist/core/content-hash.d.ts +14 -0
  11. package/dist/core/content-hash.d.ts.map +1 -0
  12. package/dist/core/content-hash.test.d.ts +2 -0
  13. package/dist/core/content-hash.test.d.ts.map +1 -0
  14. package/dist/core/entity.test.d.ts +2 -0
  15. package/dist/core/entity.test.d.ts.map +1 -0
  16. package/dist/core/index.js +54 -49
  17. package/dist/core/parser.d.ts +9 -1
  18. package/dist/core/parser.d.ts.map +1 -1
  19. package/dist/core/readers.d.ts +14 -20
  20. package/dist/core/readers.d.ts.map +1 -1
  21. package/dist/core/scaffold.d.ts.map +1 -1
  22. package/dist/core/scaffold.test.d.ts +2 -0
  23. package/dist/core/scaffold.test.d.ts.map +1 -0
  24. package/dist/core/schemas.d.ts +49 -5
  25. package/dist/core/schemas.d.ts.map +1 -1
  26. package/dist/core/serializer.d.ts +46 -6
  27. package/dist/core/serializer.d.ts.map +1 -1
  28. package/dist/core/templates.d.ts +9 -0
  29. package/dist/core/templates.d.ts.map +1 -0
  30. package/dist/types/index.d.ts +44 -4
  31. package/dist/types/index.d.ts.map +1 -1
  32. package/dist/types/index.js.map +1 -1
  33. package/package.json +11 -4
  34. package/dist/app/assets/main-6nYButky.js +0 -232
  35. package/dist/app/assets/main-6nYButky.js.map +0 -1
  36. package/dist/app/assets/main-DUnpdvQF.css +0 -1
  37. package/dist/chunks/serializer.B8u-L8BI.js.map +0 -1
  38. package/dist/core/idea-status.d.ts +0 -7
  39. package/dist/core/idea-status.d.ts.map +0 -1
@@ -1,52 +1,52 @@
1
- import { readdir as Fs, readFile as ft, mkdir as se, writeFile as ne, access as qs, rename as Us } from "node:fs/promises";
2
- import { join as P, dirname as Ys } from "node:path";
3
- import { z as E } from "zod";
4
- import { AGENT_IDS as Ue } from "../types/index.js";
5
- const Vs = /^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/;
6
- function Js(s) {
1
+ import { readdir as Rs, readFile as Ye, mkdir as X, writeFile as G, access as Fs, rename as qs } from "node:fs/promises";
2
+ import { join as _, dirname as Qt } from "node:path";
3
+ import { z as b } from "zod";
4
+ import { AGENT_IDS as $e } from "../types/index.js";
5
+ const Us = /^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/;
6
+ function Ys(s) {
7
7
  return s.length >= 2 && (s.startsWith('"') && s.endsWith('"') || s.startsWith("'") && s.endsWith("'")) ? s.slice(1, -1) : s;
8
8
  }
9
- function Tt(s) {
9
+ function _t(s) {
10
10
  return s === "" || /[\s#"]/.test(s) ? `"${s.replace(/"/g, '\\"')}"` : s;
11
11
  }
12
- function Gt(s) {
12
+ function Xt(s) {
13
13
  const e = s.trim();
14
14
  if (!e || e.startsWith("#")) return null;
15
- const t = e.match(Vs);
16
- return t ? { key: t[1], value: Js(t[2]) } : null;
15
+ const t = e.match(Us);
16
+ return t ? { key: t[1], value: Ys(t[2]) } : null;
17
17
  }
18
- function Mi(s) {
18
+ function Fi(s) {
19
19
  const e = [];
20
20
  for (const t of s.split(`
21
21
  `)) {
22
- const n = Gt(t);
22
+ const n = Xt(t);
23
23
  n && e.push(n);
24
24
  }
25
25
  return e;
26
26
  }
27
- function Di(s, e) {
27
+ function qi(s, e) {
28
28
  const t = new Map(e.map((r) => [r.key, r.value])), n = s.length > 0 ? s.split(`
29
29
  `) : [], i = [];
30
30
  for (const r of n) {
31
- const o = Gt(r);
31
+ const o = Xt(r);
32
32
  if (!o) {
33
33
  i.push(r);
34
34
  continue;
35
35
  }
36
- t.has(o.key) && (i.push(`${o.key}=${Tt(t.get(o.key) ?? "")}`), t.delete(o.key));
36
+ t.has(o.key) && (i.push(`${o.key}=${_t(t.get(o.key) ?? "")}`), t.delete(o.key));
37
37
  }
38
38
  for (const [r, o] of t)
39
- i.push(`${r}=${Tt(o)}`);
39
+ i.push(`${r}=${_t(o)}`);
40
40
  for (; i.length > 0 && i[i.length - 1] === ""; ) i.pop();
41
41
  return i.length > 0 ? `${i.join(`
42
42
  `)}
43
43
  ` : "";
44
44
  }
45
- const ut = Symbol.for("yaml.alias"), it = Symbol.for("yaml.document"), W = Symbol.for("yaml.map"), Ht = Symbol.for("yaml.pair"), Y = Symbol.for("yaml.scalar"), ue = Symbol.for("yaml.seq"), K = Symbol.for("yaml.node.type"), he = (s) => !!s && typeof s == "object" && s[K] === ut, Ee = (s) => !!s && typeof s == "object" && s[K] === it, Ie = (s) => !!s && typeof s == "object" && s[K] === W, _ = (s) => !!s && typeof s == "object" && s[K] === Ht, T = (s) => !!s && typeof s == "object" && s[K] === Y, Ae = (s) => !!s && typeof s == "object" && s[K] === ue;
45
+ const ut = Symbol.for("yaml.alias"), rt = Symbol.for("yaml.document"), z = Symbol.for("yaml.map"), zt = Symbol.for("yaml.pair"), V = Symbol.for("yaml.scalar"), ue = Symbol.for("yaml.seq"), K = Symbol.for("yaml.node.type"), he = (s) => !!s && typeof s == "object" && s[K] === ut, Ie = (s) => !!s && typeof s == "object" && s[K] === rt, Ae = (s) => !!s && typeof s == "object" && s[K] === z, v = (s) => !!s && typeof s == "object" && s[K] === zt, T = (s) => !!s && typeof s == "object" && s[K] === V, Oe = (s) => !!s && typeof s == "object" && s[K] === ue;
46
46
  function L(s) {
47
47
  if (s && typeof s == "object")
48
48
  switch (s[K]) {
49
- case W:
49
+ case z:
50
50
  case ue:
51
51
  return !0;
52
52
  }
@@ -56,25 +56,25 @@ function C(s) {
56
56
  if (s && typeof s == "object")
57
57
  switch (s[K]) {
58
58
  case ut:
59
- case W:
60
- case Y:
59
+ case z:
60
+ case V:
61
61
  case ue:
62
62
  return !0;
63
63
  }
64
64
  return !1;
65
65
  }
66
- const Wt = (s) => (T(s) || L(s)) && !!s.anchor, Q = Symbol("break visit"), Gs = Symbol("skip children"), we = Symbol("remove node");
66
+ const xt = (s) => (T(s) || L(s)) && !!s.anchor, x = Symbol("break visit"), Vs = Symbol("skip children"), we = Symbol("remove node");
67
67
  function de(s, e) {
68
- const t = Hs(e);
69
- Ee(s) ? ie(null, s.contents, t, Object.freeze([s])) === we && (s.contents = null) : ie(null, s, t, Object.freeze([]));
68
+ const t = Js(e);
69
+ Ie(s) ? ie(null, s.contents, t, Object.freeze([s])) === we && (s.contents = null) : ie(null, s, t, Object.freeze([]));
70
70
  }
71
- de.BREAK = Q;
72
- de.SKIP = Gs;
71
+ de.BREAK = x;
72
+ de.SKIP = Vs;
73
73
  de.REMOVE = we;
74
74
  function ie(s, e, t, n) {
75
- const i = Ws(s, e, t, n);
76
- if (C(i) || _(i))
77
- return Qs(s, n, i), ie(s, i, t, n);
75
+ const i = Hs(s, e, t, n);
76
+ if (C(i) || v(i))
77
+ return Gs(s, n, i), ie(s, i, t, n);
78
78
  if (typeof i != "symbol") {
79
79
  if (L(e)) {
80
80
  n = Object.freeze(n.concat(e));
@@ -83,26 +83,26 @@ function ie(s, e, t, n) {
83
83
  if (typeof o == "number")
84
84
  r = o - 1;
85
85
  else {
86
- if (o === Q)
87
- return Q;
86
+ if (o === x)
87
+ return x;
88
88
  o === we && (e.items.splice(r, 1), r -= 1);
89
89
  }
90
90
  }
91
- } else if (_(e)) {
91
+ } else if (v(e)) {
92
92
  n = Object.freeze(n.concat(e));
93
93
  const r = ie("key", e.key, t, n);
94
- if (r === Q)
95
- return Q;
94
+ if (r === x)
95
+ return x;
96
96
  r === we && (e.key = null);
97
97
  const o = ie("value", e.value, t, n);
98
- if (o === Q)
99
- return Q;
98
+ if (o === x)
99
+ return x;
100
100
  o === we && (e.value = null);
101
101
  }
102
102
  }
103
103
  return i;
104
104
  }
105
- function Hs(s) {
105
+ function Js(s) {
106
106
  return typeof s == "object" && (s.Collection || s.Node || s.Value) ? Object.assign({
107
107
  Alias: s.Node,
108
108
  Map: s.Node,
@@ -117,48 +117,48 @@ function Hs(s) {
117
117
  Seq: s.Collection
118
118
  }, s) : s;
119
119
  }
120
- function Ws(s, e, t, n) {
120
+ function Hs(s, e, t, n) {
121
121
  var i, r, o, a, l;
122
122
  if (typeof t == "function")
123
123
  return t(s, e, n);
124
- if (Ie(e))
125
- return (i = t.Map) == null ? void 0 : i.call(t, s, e, n);
126
124
  if (Ae(e))
125
+ return (i = t.Map) == null ? void 0 : i.call(t, s, e, n);
126
+ if (Oe(e))
127
127
  return (r = t.Seq) == null ? void 0 : r.call(t, s, e, n);
128
- if (_(e))
128
+ if (v(e))
129
129
  return (o = t.Pair) == null ? void 0 : o.call(t, s, e, n);
130
130
  if (T(e))
131
131
  return (a = t.Scalar) == null ? void 0 : a.call(t, s, e, n);
132
132
  if (he(e))
133
133
  return (l = t.Alias) == null ? void 0 : l.call(t, s, e, n);
134
134
  }
135
- function Qs(s, e, t) {
135
+ function Gs(s, e, t) {
136
136
  const n = e[e.length - 1];
137
137
  if (L(n))
138
138
  n.items[s] = t;
139
- else if (_(n))
139
+ else if (v(n))
140
140
  s === "key" ? n.key = t : n.value = t;
141
- else if (Ee(n))
141
+ else if (Ie(n))
142
142
  n.contents = t;
143
143
  else {
144
144
  const i = he(n) ? "alias" : "scalar";
145
145
  throw new Error(`Cannot replace node with ${i} parent`);
146
146
  }
147
147
  }
148
- const Xs = {
148
+ const Ws = {
149
149
  "!": "%21",
150
150
  ",": "%2C",
151
151
  "[": "%5B",
152
152
  "]": "%5D",
153
153
  "{": "%7B",
154
154
  "}": "%7D"
155
- }, zs = (s) => s.replace(/[!,[\]{}]/g, (e) => Xs[e]);
156
- class B {
155
+ }, Qs = (s) => s.replace(/[!,[\]{}]/g, (e) => Ws[e]);
156
+ class D {
157
157
  constructor(e, t) {
158
- this.docStart = null, this.docEnd = !1, this.yaml = Object.assign({}, B.defaultYaml, e), this.tags = Object.assign({}, B.defaultTags, t);
158
+ this.docStart = null, this.docEnd = !1, this.yaml = Object.assign({}, D.defaultYaml, e), this.tags = Object.assign({}, D.defaultTags, t);
159
159
  }
160
160
  clone() {
161
- const e = new B(this.yaml, this.tags);
161
+ const e = new D(this.yaml, this.tags);
162
162
  return e.docStart = this.docStart, e;
163
163
  }
164
164
  /**
@@ -166,16 +166,16 @@ class B {
166
166
  * update the stream state according to the current version's spec.
167
167
  */
168
168
  atDocument() {
169
- const e = new B(this.yaml, this.tags);
169
+ const e = new D(this.yaml, this.tags);
170
170
  switch (this.yaml.version) {
171
171
  case "1.1":
172
172
  this.atNextDocument = !0;
173
173
  break;
174
174
  case "1.2":
175
175
  this.atNextDocument = !1, this.yaml = {
176
- explicit: B.defaultYaml.explicit,
176
+ explicit: D.defaultYaml.explicit,
177
177
  version: "1.2"
178
- }, this.tags = Object.assign({}, B.defaultTags);
178
+ }, this.tags = Object.assign({}, D.defaultTags);
179
179
  break;
180
180
  }
181
181
  return e;
@@ -185,7 +185,7 @@ class B {
185
185
  * @returns `true` on success
186
186
  */
187
187
  add(e, t) {
188
- this.atNextDocument && (this.yaml = { explicit: B.defaultYaml.explicit, version: "1.1" }, this.tags = Object.assign({}, B.defaultTags), this.atNextDocument = !1);
188
+ this.atNextDocument && (this.yaml = { explicit: D.defaultYaml.explicit, version: "1.1" }, this.tags = Object.assign({}, D.defaultTags), this.atNextDocument = !1);
189
189
  const n = e.trim().split(/[ \t]+/), i = n.shift();
190
190
  switch (i) {
191
191
  case "%TAG": {
@@ -242,7 +242,7 @@ class B {
242
242
  tagString(e) {
243
243
  for (const [t, n] of Object.entries(this.tags))
244
244
  if (e.startsWith(n))
245
- return t + zs(e.substring(n.length));
245
+ return t + Qs(e.substring(n.length));
246
246
  return e[0] === "!" ? e : `!<${e}>`;
247
247
  }
248
248
  toString(e) {
@@ -261,16 +261,16 @@ class B {
261
261
  `);
262
262
  }
263
263
  }
264
- B.defaultYaml = { explicit: !1, version: "1.2" };
265
- B.defaultTags = { "!!": "tag:yaml.org,2002:" };
266
- function Qt(s) {
264
+ D.defaultYaml = { explicit: !1, version: "1.2" };
265
+ D.defaultTags = { "!!": "tag:yaml.org,2002:" };
266
+ function Zt(s) {
267
267
  if (/[\x00-\x19\s,[\]{}]/.test(s)) {
268
268
  const t = `Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;
269
269
  throw new Error(t);
270
270
  }
271
271
  return !0;
272
272
  }
273
- function Xt(s) {
273
+ function es(s) {
274
274
  const e = /* @__PURE__ */ new Set();
275
275
  return de(s, {
276
276
  Value(t, n) {
@@ -278,20 +278,20 @@ function Xt(s) {
278
278
  }
279
279
  }), e;
280
280
  }
281
- function zt(s, e) {
281
+ function ts(s, e) {
282
282
  for (let t = 1; ; ++t) {
283
283
  const n = `${s}${t}`;
284
284
  if (!e.has(n))
285
285
  return n;
286
286
  }
287
287
  }
288
- function Zs(s, e) {
288
+ function Xs(s, e) {
289
289
  const t = [], n = /* @__PURE__ */ new Map();
290
290
  let i = null;
291
291
  return {
292
292
  onAnchor: (r) => {
293
- t.push(r), i ?? (i = Xt(s));
294
- const o = zt(e, i);
293
+ t.push(r), i ?? (i = es(s));
294
+ const o = ts(e, i);
295
295
  return i.add(o), o;
296
296
  },
297
297
  /**
@@ -337,11 +337,11 @@ function re(s, e, t, n) {
337
337
  }
338
338
  return s.call(e, t, n);
339
339
  }
340
- function j(s, e, t) {
340
+ function B(s, e, t) {
341
341
  if (Array.isArray(s))
342
- return s.map((n, i) => j(n, String(i), t));
342
+ return s.map((n, i) => B(n, String(i), t));
343
343
  if (s && typeof s.toJSON == "function") {
344
- if (!t || !Wt(s))
344
+ if (!t || !xt(s))
345
345
  return s.toJSON(e, t);
346
346
  const n = { aliasCount: 0, count: 1, res: void 0 };
347
347
  t.anchors.set(s, n), t.onCreate = (r) => {
@@ -363,7 +363,7 @@ class ht {
363
363
  }
364
364
  /** A plain JavaScript representation of this node. */
365
365
  toJS(e, { mapAsMap: t, maxAliasCount: n, onAnchor: i, reviver: r } = {}) {
366
- if (!Ee(e))
366
+ if (!Ie(e))
367
367
  throw new TypeError("A document argument is required");
368
368
  const o = {
369
369
  anchors: /* @__PURE__ */ new Map(),
@@ -372,7 +372,7 @@ class ht {
372
372
  mapAsMap: t === !0,
373
373
  mapKeyWarned: !1,
374
374
  maxAliasCount: typeof n == "number" ? n : 100
375
- }, a = j(this, "", o);
375
+ }, a = B(this, "", o);
376
376
  if (typeof i == "function")
377
377
  for (const { count: l, res: c } of o.anchors.values())
378
378
  i(c, l);
@@ -397,7 +397,7 @@ class dt extends ht {
397
397
  let n;
398
398
  t != null && t.aliasResolveCache ? n = t.aliasResolveCache : (n = [], de(e, {
399
399
  Node: (r, o) => {
400
- (he(o) || Wt(o)) && n.push(o);
400
+ (he(o) || xt(o)) && n.push(o);
401
401
  }
402
402
  }), t && (t.aliasResolveCache = n));
403
403
  let i;
@@ -417,11 +417,11 @@ class dt extends ht {
417
417
  throw new ReferenceError(l);
418
418
  }
419
419
  let a = n.get(o);
420
- if (a || (j(o, null, t), a = n.get(o)), (a == null ? void 0 : a.res) === void 0) {
420
+ if (a || (B(o, null, t), a = n.get(o)), (a == null ? void 0 : a.res) === void 0) {
421
421
  const l = "This should not happen: Alias anchor was not resolved?";
422
422
  throw new ReferenceError(l);
423
423
  }
424
- if (r >= 0 && (a.count += 1, a.aliasCount === 0 && (a.aliasCount = De(i, o, n)), a.count * a.aliasCount > r)) {
424
+ if (r >= 0 && (a.count += 1, a.aliasCount === 0 && (a.aliasCount = Be(i, o, n)), a.count * a.aliasCount > r)) {
425
425
  const l = "Excessive alias count indicates a resource exhaustion attack";
426
426
  throw new ReferenceError(l);
427
427
  }
@@ -430,7 +430,7 @@ class dt extends ht {
430
430
  toString(e, t, n) {
431
431
  const i = `*${this.source}`;
432
432
  if (e) {
433
- if (Qt(this.source), e.options.verifyAliasOrder && !e.anchors.has(this.source)) {
433
+ if (Zt(this.source), e.options.verifyAliasOrder && !e.anchors.has(this.source)) {
434
434
  const r = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
435
435
  throw new Error(r);
436
436
  }
@@ -440,42 +440,42 @@ class dt extends ht {
440
440
  return i;
441
441
  }
442
442
  }
443
- function De(s, e, t) {
443
+ function Be(s, e, t) {
444
444
  if (he(e)) {
445
445
  const n = e.resolve(s), i = t && n && t.get(n);
446
446
  return i ? i.count * i.aliasCount : 0;
447
447
  } else if (L(e)) {
448
448
  let n = 0;
449
449
  for (const i of e.items) {
450
- const r = De(s, i, t);
450
+ const r = Be(s, i, t);
451
451
  r > n && (n = r);
452
452
  }
453
453
  return n;
454
- } else if (_(e)) {
455
- const n = De(s, e.key, t), i = De(s, e.value, t);
454
+ } else if (v(e)) {
455
+ const n = Be(s, e.key, t), i = Be(s, e.value, t);
456
456
  return Math.max(n, i);
457
457
  }
458
458
  return 1;
459
459
  }
460
- const Zt = (s) => !s || typeof s != "function" && typeof s != "object";
461
- class I extends ht {
460
+ const ss = (s) => !s || typeof s != "function" && typeof s != "object";
461
+ class $ extends ht {
462
462
  constructor(e) {
463
- super(Y), this.value = e;
463
+ super(V), this.value = e;
464
464
  }
465
465
  toJSON(e, t) {
466
- return t != null && t.keep ? this.value : j(this.value, e, t);
466
+ return t != null && t.keep ? this.value : B(this.value, e, t);
467
467
  }
468
468
  toString() {
469
469
  return String(this.value);
470
470
  }
471
471
  }
472
- I.BLOCK_FOLDED = "BLOCK_FOLDED";
473
- I.BLOCK_LITERAL = "BLOCK_LITERAL";
474
- I.PLAIN = "PLAIN";
475
- I.QUOTE_DOUBLE = "QUOTE_DOUBLE";
476
- I.QUOTE_SINGLE = "QUOTE_SINGLE";
477
- const xs = "tag:yaml.org,2002:";
478
- function en(s, e, t) {
472
+ $.BLOCK_FOLDED = "BLOCK_FOLDED";
473
+ $.BLOCK_LITERAL = "BLOCK_LITERAL";
474
+ $.PLAIN = "PLAIN";
475
+ $.QUOTE_DOUBLE = "QUOTE_DOUBLE";
476
+ $.QUOTE_SINGLE = "QUOTE_SINGLE";
477
+ const zs = "tag:yaml.org,2002:";
478
+ function xs(s, e, t) {
479
479
  if (e) {
480
480
  const n = t.filter((r) => r.tag === e), i = n.find((r) => !r.format) ?? n[0];
481
481
  if (!i)
@@ -487,12 +487,12 @@ function en(s, e, t) {
487
487
  return ((i = n.identify) == null ? void 0 : i.call(n, s)) && !n.format;
488
488
  });
489
489
  }
490
- function Se(s, e, t) {
490
+ function Ne(s, e, t) {
491
491
  var f, h, d;
492
- if (Ee(s) && (s = s.contents), C(s))
492
+ if (Ie(s) && (s = s.contents), C(s))
493
493
  return s;
494
- if (_(s)) {
495
- const g = (h = (f = t.schema[W]).createNode) == null ? void 0 : h.call(f, t.schema, null, t);
494
+ if (v(s)) {
495
+ const g = (h = (f = t.schema[z]).createNode) == null ? void 0 : h.call(f, t.schema, null, t);
496
496
  return g.items.push(s), g;
497
497
  }
498
498
  (s instanceof String || s instanceof Number || s instanceof Boolean || typeof BigInt < "u" && s instanceof BigInt) && (s = s.valueOf());
@@ -503,20 +503,20 @@ function Se(s, e, t) {
503
503
  return l.anchor ?? (l.anchor = i(s)), new dt(l.anchor);
504
504
  l = { anchor: null, node: null }, a.set(s, l);
505
505
  }
506
- e != null && e.startsWith("!!") && (e = xs + e.slice(2));
507
- let c = en(s, e, o.tags);
506
+ e != null && e.startsWith("!!") && (e = zs + e.slice(2));
507
+ let c = xs(s, e, o.tags);
508
508
  if (!c) {
509
509
  if (s && typeof s.toJSON == "function" && (s = s.toJSON()), !s || typeof s != "object") {
510
- const g = new I(s);
510
+ const g = new $(s);
511
511
  return l && (l.node = g), g;
512
512
  }
513
- c = s instanceof Map ? o[W] : Symbol.iterator in Object(s) ? o[ue] : o[W];
513
+ c = s instanceof Map ? o[z] : Symbol.iterator in Object(s) ? o[ue] : o[z];
514
514
  }
515
515
  r && (r(c), delete t.onTagObj);
516
- const p = c != null && c.createNode ? c.createNode(t.schema, s, t) : typeof ((d = c == null ? void 0 : c.nodeClass) == null ? void 0 : d.from) == "function" ? c.nodeClass.from(t.schema, s, t) : new I(s);
516
+ const p = c != null && c.createNode ? c.createNode(t.schema, s, t) : typeof ((d = c == null ? void 0 : c.nodeClass) == null ? void 0 : d.from) == "function" ? c.nodeClass.from(t.schema, s, t) : new $(s);
517
517
  return e ? p.tag = e : c.default || (p.tag = c.tag), l && (l.node = p), p;
518
518
  }
519
- function Re(s, e, t) {
519
+ function Fe(s, e, t) {
520
520
  let n = t;
521
521
  for (let i = e.length - 1; i >= 0; --i) {
522
522
  const r = e[i];
@@ -526,7 +526,7 @@ function Re(s, e, t) {
526
526
  } else
527
527
  n = /* @__PURE__ */ new Map([[r, n]]);
528
528
  }
529
- return Se(n, void 0, {
529
+ return Ne(n, void 0, {
530
530
  aliasDuplicateObjects: !1,
531
531
  keepUndefined: !1,
532
532
  onAnchor: () => {
@@ -537,7 +537,7 @@ function Re(s, e, t) {
537
537
  });
538
538
  }
539
539
  const ye = (s) => s == null || typeof s == "object" && !!s[Symbol.iterator]().next().done;
540
- class xt extends ht {
540
+ class ns extends ht {
541
541
  constructor(e, t) {
542
542
  super(e), Object.defineProperty(this, "schema", {
543
543
  value: t,
@@ -553,7 +553,7 @@ class xt extends ht {
553
553
  */
554
554
  clone(e) {
555
555
  const t = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
556
- return e && (t.schema = e), t.items = t.items.map((n) => C(n) || _(n) ? n.clone(e) : n), this.range && (t.range = this.range.slice()), t;
556
+ return e && (t.schema = e), t.items = t.items.map((n) => C(n) || v(n) ? n.clone(e) : n), this.range && (t.range = this.range.slice()), t;
557
557
  }
558
558
  /**
559
559
  * Adds a value to the collection. For `!!map` and `!!omap` the value must
@@ -568,7 +568,7 @@ class xt extends ht {
568
568
  if (L(r))
569
569
  r.addIn(i, t);
570
570
  else if (r === void 0 && this.schema)
571
- this.set(n, Re(this.schema, i, t));
571
+ this.set(n, Fe(this.schema, i, t));
572
572
  else
573
573
  throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`);
574
574
  }
@@ -597,7 +597,7 @@ class xt extends ht {
597
597
  }
598
598
  hasAllNullValues(e) {
599
599
  return this.items.every((t) => {
600
- if (!_(t))
600
+ if (!v(t))
601
601
  return !1;
602
602
  const n = t.value;
603
603
  return n == null || e && T(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
@@ -626,21 +626,21 @@ class xt extends ht {
626
626
  if (L(r))
627
627
  r.setIn(i, t);
628
628
  else if (r === void 0 && this.schema)
629
- this.set(n, Re(this.schema, i, t));
629
+ this.set(n, Fe(this.schema, i, t));
630
630
  else
631
631
  throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`);
632
632
  }
633
633
  }
634
634
  }
635
- const tn = (s) => s.replace(/^(?!$)(?: $)?/gm, "#");
636
- function J(s, e) {
635
+ const Zs = (s) => s.replace(/^(?!$)(?: $)?/gm, "#");
636
+ function H(s, e) {
637
637
  return /^\n+$/.test(s) ? s.substring(1) : e ? s.replace(/^(?! *$)/gm, e) : s;
638
638
  }
639
- const X = (s, e, t) => s.endsWith(`
640
- `) ? J(t, e) : t.includes(`
639
+ const Z = (s, e, t) => s.endsWith(`
640
+ `) ? H(t, e) : t.includes(`
641
641
  `) ? `
642
- ` + J(t, e) : (s.endsWith(" ") ? "" : " ") + t, es = "flow", rt = "block", je = "quoted";
643
- function Ye(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentWidth: r = 20, onFold: o, onOverflow: a } = {}) {
642
+ ` + H(t, e) : (s.endsWith(" ") ? "" : " ") + t, is = "flow", ot = "block", Ke = "quoted";
643
+ function Ve(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentWidth: r = 20, onFold: o, onOverflow: a } = {}) {
644
644
  if (!i || i < 0)
645
645
  return s;
646
646
  i < r && (r = 0);
@@ -651,9 +651,9 @@ function Ye(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
651
651
  let f = i - e.length;
652
652
  typeof n == "number" && (n > i - Math.max(2, r) ? c.push(0) : f = i - n);
653
653
  let h, d, g = !1, u = -1, m = -1, y = -1;
654
- t === rt && (u = Lt(s, u, e.length), u !== -1 && (f = u + l));
655
- for (let S; S = s[u += 1]; ) {
656
- if (t === je && S === "\\") {
654
+ t === ot && (u = Pt(s, u, e.length), u !== -1 && (f = u + l));
655
+ for (let N; N = s[u += 1]; ) {
656
+ if (t === Ke && N === "\\") {
657
657
  switch (m = u, s[u + 1]) {
658
658
  case "x":
659
659
  u += 3;
@@ -669,44 +669,44 @@ function Ye(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
669
669
  }
670
670
  y = u;
671
671
  }
672
- if (S === `
672
+ if (N === `
673
673
  `)
674
- t === rt && (u = Lt(s, u, e.length)), f = u + e.length + l, h = void 0;
674
+ t === ot && (u = Pt(s, u, e.length)), f = u + e.length + l, h = void 0;
675
675
  else {
676
- if (S === " " && d && d !== " " && d !== `
676
+ if (N === " " && d && d !== " " && d !== `
677
677
  ` && d !== " ") {
678
- const k = s[u + 1];
679
- k && k !== " " && k !== `
680
- ` && k !== " " && (h = u);
678
+ const S = s[u + 1];
679
+ S && S !== " " && S !== `
680
+ ` && S !== " " && (h = u);
681
681
  }
682
682
  if (u >= f)
683
683
  if (h)
684
684
  c.push(h), f = h + l, h = void 0;
685
- else if (t === je) {
685
+ else if (t === Ke) {
686
686
  for (; d === " " || d === " "; )
687
- d = S, S = s[u += 1], g = !0;
688
- const k = u > y + 1 ? u - 2 : m - 1;
689
- if (p[k])
687
+ d = N, N = s[u += 1], g = !0;
688
+ const S = u > y + 1 ? u - 2 : m - 1;
689
+ if (p[S])
690
690
  return s;
691
- c.push(k), p[k] = !0, f = k + l, h = void 0;
691
+ c.push(S), p[S] = !0, f = S + l, h = void 0;
692
692
  } else
693
693
  g = !0;
694
694
  }
695
- d = S;
695
+ d = N;
696
696
  }
697
697
  if (g && a && a(), c.length === 0)
698
698
  return s;
699
699
  o && o();
700
- let b = s.slice(0, c[0]);
701
- for (let S = 0; S < c.length; ++S) {
702
- const k = c[S], N = c[S + 1] || s.length;
703
- k === 0 ? b = `
704
- ${e}${s.slice(0, N)}` : (t === je && p[k] && (b += `${s[k]}\\`), b += `
705
- ${e}${s.slice(k + 1, N)}`);
700
+ let w = s.slice(0, c[0]);
701
+ for (let N = 0; N < c.length; ++N) {
702
+ const S = c[N], E = c[N + 1] || s.length;
703
+ S === 0 ? w = `
704
+ ${e}${s.slice(0, E)}` : (t === Ke && p[S] && (w += `${s[S]}\\`), w += `
705
+ ${e}${s.slice(S + 1, E)}`);
706
706
  }
707
- return b;
707
+ return w;
708
708
  }
709
- function Lt(s, e, t) {
709
+ function Pt(s, e, t) {
710
710
  let n = e, i = e + 1, r = s[i];
711
711
  for (; r === " " || r === " "; )
712
712
  if (e < i + t)
@@ -720,12 +720,12 @@ function Lt(s, e, t) {
720
720
  }
721
721
  return n;
722
722
  }
723
- const Ve = (s, e) => ({
723
+ const Je = (s, e) => ({
724
724
  indentAtStart: e ? s.indent.length : s.indentAtStart,
725
725
  lineWidth: s.options.lineWidth,
726
726
  minContentWidth: s.options.minContentWidth
727
- }), Je = (s) => /^(%|---|\.\.\.)/m.test(s);
728
- function sn(s, e, t) {
727
+ }), He = (s) => /^(%|---|\.\.\.)/m.test(s);
728
+ function en(s, e, t) {
729
729
  if (!e || e < 0)
730
730
  return !1;
731
731
  const n = e - t, i = s.length;
@@ -745,7 +745,7 @@ function ke(s, e) {
745
745
  const t = JSON.stringify(s);
746
746
  if (e.options.doubleQuotedAsJSON)
747
747
  return t;
748
- const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (Je(s) ? " " : "");
748
+ const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (He(s) ? " " : "");
749
749
  let o = "", a = 0;
750
750
  for (let l = 0, c = t[l]; c; c = t[++l])
751
751
  if (c === " " && t[l + 1] === "\\" && t[l + 2] === "n" && (o += t.slice(a, l) + "\\ ", l += 1, a = l, c = "\\"), c === "\\")
@@ -800,15 +800,15 @@ function ke(s, e) {
800
800
  default:
801
801
  l += 1;
802
802
  }
803
- return o = a ? o + t.slice(a) : t, n ? o : Ye(o, r, je, Ve(e, !1));
803
+ return o = a ? o + t.slice(a) : t, n ? o : Ve(o, r, Ke, Je(e, !1));
804
804
  }
805
- function ot(s, e) {
805
+ function at(s, e) {
806
806
  if (e.options.singleQuote === !1 || e.implicitKey && s.includes(`
807
807
  `) || /[ \t]\n|\n[ \t]/.test(s))
808
808
  return ke(s, e);
809
- const t = e.indent || (Je(s) ? " " : ""), n = "'" + s.replace(/'/g, "''").replace(/\n+/g, `$&
809
+ const t = e.indent || (He(s) ? " " : ""), n = "'" + s.replace(/'/g, "''").replace(/\n+/g, `$&
810
810
  ${t}`) + "'";
811
- return e.implicitKey ? n : Ye(n, t, es, Ve(e, !1));
811
+ return e.implicitKey ? n : Ve(n, t, is, Je(e, !1));
812
812
  }
813
813
  function oe(s, e) {
814
814
  const { singleQuote: t } = e.options;
@@ -817,84 +817,84 @@ function oe(s, e) {
817
817
  n = ke;
818
818
  else {
819
819
  const i = s.includes('"'), r = s.includes("'");
820
- i && !r ? n = ot : r && !i ? n = ke : n = t ? ot : ke;
820
+ i && !r ? n = at : r && !i ? n = ke : n = t ? at : ke;
821
821
  }
822
822
  return n(s, e);
823
823
  }
824
- let at;
824
+ let lt;
825
825
  try {
826
- at = new RegExp(`(^|(?<!
826
+ lt = new RegExp(`(^|(?<!
827
827
  ))
828
828
  +(?!
829
829
  |$)`, "g");
830
830
  } catch {
831
- at = /\n+(?!\n|$)/g;
831
+ lt = /\n+(?!\n|$)/g;
832
832
  }
833
- function Ke({ comment: s, type: e, value: t }, n, i, r) {
833
+ function Re({ comment: s, type: e, value: t }, n, i, r) {
834
834
  const { blockQuote: o, commentString: a, lineWidth: l } = n.options;
835
835
  if (!o || /\n[\t ]+$/.test(t))
836
836
  return oe(t, n);
837
- const c = n.indent || (n.forceBlockIndent || Je(t) ? " " : ""), p = o === "literal" ? !0 : o === "folded" || e === I.BLOCK_FOLDED ? !1 : e === I.BLOCK_LITERAL ? !0 : !sn(t, l, c.length);
837
+ const c = n.indent || (n.forceBlockIndent || He(t) ? " " : ""), p = o === "literal" ? !0 : o === "folded" || e === $.BLOCK_FOLDED ? !1 : e === $.BLOCK_LITERAL ? !0 : !en(t, l, c.length);
838
838
  if (!t)
839
839
  return p ? `|
840
840
  ` : `>
841
841
  `;
842
842
  let f, h;
843
843
  for (h = t.length; h > 0; --h) {
844
- const N = t[h - 1];
845
- if (N !== `
846
- ` && N !== " " && N !== " ")
844
+ const E = t[h - 1];
845
+ if (E !== `
846
+ ` && E !== " " && E !== " ")
847
847
  break;
848
848
  }
849
849
  let d = t.substring(h);
850
850
  const g = d.indexOf(`
851
851
  `);
852
852
  g === -1 ? f = "-" : t === d || g !== d.length - 1 ? (f = "+", r && r()) : f = "", d && (t = t.slice(0, -d.length), d[d.length - 1] === `
853
- ` && (d = d.slice(0, -1)), d = d.replace(at, `$&${c}`));
853
+ ` && (d = d.slice(0, -1)), d = d.replace(lt, `$&${c}`));
854
854
  let u = !1, m, y = -1;
855
855
  for (m = 0; m < t.length; ++m) {
856
- const N = t[m];
857
- if (N === " ")
856
+ const E = t[m];
857
+ if (E === " ")
858
858
  u = !0;
859
- else if (N === `
859
+ else if (E === `
860
860
  `)
861
861
  y = m;
862
862
  else
863
863
  break;
864
864
  }
865
- let b = t.substring(0, y < m ? y + 1 : m);
866
- b && (t = t.substring(b.length), b = b.replace(/\n+/g, `$&${c}`));
867
- let k = (u ? c ? "2" : "1" : "") + f;
868
- if (s && (k += " " + a(s.replace(/ ?[\r\n]+/g, " ")), i && i()), !p) {
869
- const N = t.replace(/\n+/g, `
865
+ let w = t.substring(0, y < m ? y + 1 : m);
866
+ w && (t = t.substring(w.length), w = w.replace(/\n+/g, `$&${c}`));
867
+ let S = (u ? c ? "2" : "1" : "") + f;
868
+ if (s && (S += " " + a(s.replace(/ ?[\r\n]+/g, " ")), i && i()), !p) {
869
+ const E = t.replace(/\n+/g, `
870
870
  $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${c}`);
871
- let $ = !1;
872
- const A = Ve(n, !0);
873
- o !== "folded" && e !== I.BLOCK_FOLDED && (A.onOverflow = () => {
874
- $ = !0;
871
+ let A = !1;
872
+ const I = Je(n, !0);
873
+ o !== "folded" && e !== $.BLOCK_FOLDED && (I.onOverflow = () => {
874
+ A = !0;
875
875
  });
876
- const w = Ye(`${b}${N}${d}`, c, rt, A);
877
- if (!$)
878
- return `>${k}
879
- ${c}${w}`;
876
+ const k = Ve(`${w}${E}${d}`, c, ot, I);
877
+ if (!A)
878
+ return `>${S}
879
+ ${c}${k}`;
880
880
  }
881
- return t = t.replace(/\n+/g, `$&${c}`), `|${k}
882
- ${c}${b}${t}${d}`;
881
+ return t = t.replace(/\n+/g, `$&${c}`), `|${S}
882
+ ${c}${w}${t}${d}`;
883
883
  }
884
- function nn(s, e, t, n) {
884
+ function tn(s, e, t, n) {
885
885
  const { type: i, value: r } = s, { actualString: o, implicitKey: a, indent: l, indentStep: c, inFlow: p } = e;
886
886
  if (a && r.includes(`
887
887
  `) || p && /[[\]{},]/.test(r))
888
888
  return oe(r, e);
889
889
  if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))
890
890
  return a || p || !r.includes(`
891
- `) ? oe(r, e) : Ke(s, e, t, n);
892
- if (!a && !p && i !== I.PLAIN && r.includes(`
891
+ `) ? oe(r, e) : Re(s, e, t, n);
892
+ if (!a && !p && i !== $.PLAIN && r.includes(`
893
893
  `))
894
- return Ke(s, e, t, n);
895
- if (Je(r)) {
894
+ return Re(s, e, t, n);
895
+ if (He(r)) {
896
896
  if (l === "")
897
- return e.forceBlockIndent = !0, Ke(s, e, t, n);
897
+ return e.forceBlockIndent = !0, Re(s, e, t, n);
898
898
  if (a && l === c)
899
899
  return oe(r, e);
900
900
  }
@@ -908,23 +908,23 @@ ${l}`);
908
908
  if (g.some(h) || d != null && d.some(h))
909
909
  return oe(r, e);
910
910
  }
911
- return a ? f : Ye(f, l, es, Ve(e, !1));
911
+ return a ? f : Ve(f, l, is, Je(e, !1));
912
912
  }
913
913
  function pt(s, e, t, n) {
914
914
  const { implicitKey: i, inFlow: r } = e, o = typeof s.value == "string" ? s : Object.assign({}, s, { value: String(s.value) });
915
915
  let { type: a } = s;
916
- a !== I.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value) && (a = I.QUOTE_DOUBLE);
916
+ a !== $.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value) && (a = $.QUOTE_DOUBLE);
917
917
  const l = (p) => {
918
918
  switch (p) {
919
- case I.BLOCK_FOLDED:
920
- case I.BLOCK_LITERAL:
921
- return i || r ? oe(o.value, e) : Ke(o, e, t, n);
922
- case I.QUOTE_DOUBLE:
919
+ case $.BLOCK_FOLDED:
920
+ case $.BLOCK_LITERAL:
921
+ return i || r ? oe(o.value, e) : Re(o, e, t, n);
922
+ case $.QUOTE_DOUBLE:
923
923
  return ke(o.value, e);
924
- case I.QUOTE_SINGLE:
925
- return ot(o.value, e);
926
- case I.PLAIN:
927
- return nn(o, e, t, n);
924
+ case $.QUOTE_SINGLE:
925
+ return at(o.value, e);
926
+ case $.PLAIN:
927
+ return tn(o, e, t, n);
928
928
  default:
929
929
  return null;
930
930
  }
@@ -937,10 +937,10 @@ function pt(s, e, t, n) {
937
937
  }
938
938
  return c;
939
939
  }
940
- function ts(s, e) {
940
+ function rs(s, e) {
941
941
  const t = Object.assign({
942
942
  blockQuote: !0,
943
- commentString: tn,
943
+ commentString: Zs,
944
944
  defaultKeyType: null,
945
945
  defaultStringType: "PLAIN",
946
946
  directives: null,
@@ -979,7 +979,7 @@ function ts(s, e) {
979
979
  options: t
980
980
  };
981
981
  }
982
- function rn(s, e) {
982
+ function sn(s, e) {
983
983
  var i;
984
984
  if (e.tag) {
985
985
  const r = s.filter((o) => o.tag === e.tag);
@@ -1006,17 +1006,17 @@ function rn(s, e) {
1006
1006
  }
1007
1007
  return t;
1008
1008
  }
1009
- function on(s, e, { anchors: t, doc: n }) {
1009
+ function nn(s, e, { anchors: t, doc: n }) {
1010
1010
  if (!n.directives)
1011
1011
  return "";
1012
1012
  const i = [], r = (T(s) || L(s)) && s.anchor;
1013
- r && Qt(r) && (t.add(r), i.push(`&${r}`));
1013
+ r && Zt(r) && (t.add(r), i.push(`&${r}`));
1014
1014
  const o = s.tag ?? (e.default ? null : e.tag);
1015
1015
  return o && i.push(n.directives.tagString(o)), i.join(" ");
1016
1016
  }
1017
1017
  function ce(s, e, t, n) {
1018
1018
  var l;
1019
- if (_(s))
1019
+ if (v(s))
1020
1020
  return s.toString(e, t, n);
1021
1021
  if (he(s)) {
1022
1022
  if (e.doc.directives)
@@ -1027,25 +1027,25 @@ function ce(s, e, t, n) {
1027
1027
  }
1028
1028
  let i;
1029
1029
  const r = C(s) ? s : e.doc.createNode(s, { onTagObj: (c) => i = c });
1030
- i ?? (i = rn(e.doc.schema.tags, r));
1031
- const o = on(r, i, e);
1030
+ i ?? (i = sn(e.doc.schema.tags, r));
1031
+ const o = nn(r, i, e);
1032
1032
  o.length > 0 && (e.indentAtStart = (e.indentAtStart ?? 0) + o.length + 1);
1033
1033
  const a = typeof i.stringify == "function" ? i.stringify(r, e, t, n) : T(r) ? pt(r, e, t, n) : r.toString(e, t, n);
1034
1034
  return o ? T(r) || a[0] === "{" || a[0] === "[" ? `${o} ${a}` : `${o}
1035
1035
  ${e.indent}${a}` : a;
1036
1036
  }
1037
- function an({ key: s, value: e }, t, n, i) {
1037
+ function rn({ key: s, value: e }, t, n, i) {
1038
1038
  const { allNullValues: r, doc: o, indent: a, indentStep: l, options: { commentString: c, indentSeq: p, simpleKeys: f } } = t;
1039
1039
  let h = C(s) && s.comment || null;
1040
1040
  if (f) {
1041
1041
  if (h)
1042
1042
  throw new Error("With simple keys, key nodes cannot have comments");
1043
1043
  if (L(s) || !C(s) && typeof s == "object") {
1044
- const A = "With simple keys, collection cannot be used as a key value";
1045
- throw new Error(A);
1044
+ const I = "With simple keys, collection cannot be used as a key value";
1045
+ throw new Error(I);
1046
1046
  }
1047
1047
  }
1048
- let d = !f && (!s || h && e == null && !t.inFlow || L(s) || (T(s) ? s.type === I.BLOCK_FOLDED || s.type === I.BLOCK_LITERAL : typeof s == "object"));
1048
+ let d = !f && (!s || h && e == null && !t.inFlow || L(s) || (T(s) ? s.type === $.BLOCK_FOLDED || s.type === $.BLOCK_LITERAL : typeof s == "object"));
1049
1049
  t = Object.assign({}, t, {
1050
1050
  allNullValues: !1,
1051
1051
  implicitKey: !d && (f || !r),
@@ -1061,58 +1061,58 @@ function an({ key: s, value: e }, t, n, i) {
1061
1061
  if (r || e == null)
1062
1062
  return g && n && n(), m === "" ? "?" : d ? `? ${m}` : m;
1063
1063
  } else if (r && !f || e == null && d)
1064
- return m = `? ${m}`, h && !g ? m += X(m, t.indent, c(h)) : u && i && i(), m;
1065
- g && (h = null), d ? (h && (m += X(m, t.indent, c(h))), m = `? ${m}
1066
- ${a}:`) : (m = `${m}:`, h && (m += X(m, t.indent, c(h))));
1067
- let y, b, S;
1068
- C(e) ? (y = !!e.spaceBefore, b = e.commentBefore, S = e.comment) : (y = !1, b = null, S = null, e && typeof e == "object" && (e = o.createNode(e))), t.implicitKey = !1, !d && !h && T(e) && (t.indentAtStart = m.length + 1), u = !1, !p && l.length >= 2 && !t.inFlow && !d && Ae(e) && !e.flow && !e.tag && !e.anchor && (t.indent = t.indent.substring(2));
1069
- let k = !1;
1070
- const N = ce(e, t, () => k = !0, () => u = !0);
1071
- let $ = " ";
1072
- if (h || y || b) {
1073
- if ($ = y ? `
1074
- ` : "", b) {
1075
- const A = c(b);
1076
- $ += `
1077
- ${J(A, t.indent)}`;
1064
+ return m = `? ${m}`, h && !g ? m += Z(m, t.indent, c(h)) : u && i && i(), m;
1065
+ g && (h = null), d ? (h && (m += Z(m, t.indent, c(h))), m = `? ${m}
1066
+ ${a}:`) : (m = `${m}:`, h && (m += Z(m, t.indent, c(h))));
1067
+ let y, w, N;
1068
+ C(e) ? (y = !!e.spaceBefore, w = e.commentBefore, N = e.comment) : (y = !1, w = null, N = null, e && typeof e == "object" && (e = o.createNode(e))), t.implicitKey = !1, !d && !h && T(e) && (t.indentAtStart = m.length + 1), u = !1, !p && l.length >= 2 && !t.inFlow && !d && Oe(e) && !e.flow && !e.tag && !e.anchor && (t.indent = t.indent.substring(2));
1069
+ let S = !1;
1070
+ const E = ce(e, t, () => S = !0, () => u = !0);
1071
+ let A = " ";
1072
+ if (h || y || w) {
1073
+ if (A = y ? `
1074
+ ` : "", w) {
1075
+ const I = c(w);
1076
+ A += `
1077
+ ${H(I, t.indent)}`;
1078
1078
  }
1079
- N === "" && !t.inFlow ? $ === `
1080
- ` && S && ($ = `
1079
+ E === "" && !t.inFlow ? A === `
1080
+ ` && N && (A = `
1081
1081
 
1082
- `) : $ += `
1082
+ `) : A += `
1083
1083
  ${t.indent}`;
1084
1084
  } else if (!d && L(e)) {
1085
- const A = N[0], w = N.indexOf(`
1086
- `), O = w !== -1, v = t.inFlow ?? e.flow ?? e.items.length === 0;
1087
- if (O || !v) {
1088
- let V = !1;
1089
- if (O && (A === "&" || A === "!")) {
1090
- let R = N.indexOf(" ");
1091
- A === "&" && R !== -1 && R < w && N[R + 1] === "!" && (R = N.indexOf(" ", R + 1)), (R === -1 || w < R) && (V = !0);
1085
+ const I = E[0], k = E.indexOf(`
1086
+ `), O = k !== -1, P = t.inFlow ?? e.flow ?? e.items.length === 0;
1087
+ if (O || !P) {
1088
+ let J = !1;
1089
+ if (O && (I === "&" || I === "!")) {
1090
+ let R = E.indexOf(" ");
1091
+ I === "&" && R !== -1 && R < k && E[R + 1] === "!" && (R = E.indexOf(" ", R + 1)), (R === -1 || k < R) && (J = !0);
1092
1092
  }
1093
- V || ($ = `
1093
+ J || (A = `
1094
1094
  ${t.indent}`);
1095
1095
  }
1096
- } else (N === "" || N[0] === `
1097
- `) && ($ = "");
1098
- return m += $ + N, t.inFlow ? k && n && n() : S && !k ? m += X(m, t.indent, c(S)) : u && i && i(), m;
1096
+ } else (E === "" || E[0] === `
1097
+ `) && (A = "");
1098
+ return m += A + E, t.inFlow ? S && n && n() : N && !S ? m += Z(m, t.indent, c(N)) : u && i && i(), m;
1099
1099
  }
1100
- function ss(s, e) {
1100
+ function os(s, e) {
1101
1101
  (s === "debug" || s === "warn") && console.warn(e);
1102
1102
  }
1103
- const Le = "<<", G = {
1104
- identify: (s) => s === Le || typeof s == "symbol" && s.description === Le,
1103
+ const ve = "<<", W = {
1104
+ identify: (s) => s === ve || typeof s == "symbol" && s.description === ve,
1105
1105
  default: "key",
1106
1106
  tag: "tag:yaml.org,2002:merge",
1107
1107
  test: /^<<$/,
1108
- resolve: () => Object.assign(new I(Symbol(Le)), {
1109
- addToJSMap: ns
1108
+ resolve: () => Object.assign(new $(Symbol(ve)), {
1109
+ addToJSMap: as
1110
1110
  }),
1111
- stringify: () => Le
1112
- }, ln = (s, e) => (G.identify(e) || T(e) && (!e.type || e.type === I.PLAIN) && G.identify(e.value)) && (s == null ? void 0 : s.doc.schema.tags.some((t) => t.tag === G.tag && t.default));
1113
- function ns(s, e, t) {
1114
- const n = is(s, t);
1115
- if (Ae(n))
1111
+ stringify: () => ve
1112
+ }, on = (s, e) => (W.identify(e) || T(e) && (!e.type || e.type === $.PLAIN) && W.identify(e.value)) && (s == null ? void 0 : s.doc.schema.tags.some((t) => t.tag === W.tag && t.default));
1113
+ function as(s, e, t) {
1114
+ const n = ls(s, t);
1115
+ if (Oe(n))
1116
1116
  for (const i of n.items)
1117
1117
  Ze(s, e, i);
1118
1118
  else if (Array.isArray(n))
@@ -1122,8 +1122,8 @@ function ns(s, e, t) {
1122
1122
  Ze(s, e, n);
1123
1123
  }
1124
1124
  function Ze(s, e, t) {
1125
- const n = is(s, t);
1126
- if (!Ie(n))
1125
+ const n = ls(s, t);
1126
+ if (!Ae(n))
1127
1127
  throw new Error("Merge sources must be maps or map aliases");
1128
1128
  const i = n.toJSON(null, s, Map);
1129
1129
  for (const [r, o] of i)
@@ -1135,22 +1135,22 @@ function Ze(s, e, t) {
1135
1135
  });
1136
1136
  return e;
1137
1137
  }
1138
- function is(s, e) {
1138
+ function ls(s, e) {
1139
1139
  return s && he(e) ? e.resolve(s.doc, s) : e;
1140
1140
  }
1141
- function rs(s, e, { key: t, value: n }) {
1141
+ function cs(s, e, { key: t, value: n }) {
1142
1142
  if (C(t) && t.addToJSMap)
1143
1143
  t.addToJSMap(s, e, n);
1144
- else if (ln(s, t))
1145
- ns(s, e, n);
1144
+ else if (on(s, t))
1145
+ as(s, e, n);
1146
1146
  else {
1147
- const i = j(t, "", s);
1147
+ const i = B(t, "", s);
1148
1148
  if (e instanceof Map)
1149
- e.set(i, j(n, i, s));
1149
+ e.set(i, B(n, i, s));
1150
1150
  else if (e instanceof Set)
1151
1151
  e.add(i);
1152
1152
  else {
1153
- const r = cn(t, i, s), o = j(n, r, s);
1153
+ const r = an(t, i, s), o = B(n, r, s);
1154
1154
  r in e ? Object.defineProperty(e, r, {
1155
1155
  value: o,
1156
1156
  writable: !0,
@@ -1161,13 +1161,13 @@ function rs(s, e, { key: t, value: n }) {
1161
1161
  }
1162
1162
  return e;
1163
1163
  }
1164
- function cn(s, e, t) {
1164
+ function an(s, e, t) {
1165
1165
  if (e === null)
1166
1166
  return "";
1167
1167
  if (typeof e != "object")
1168
1168
  return String(e);
1169
1169
  if (C(s) && (t != null && t.doc)) {
1170
- const n = ts(t.doc, {});
1170
+ const n = rs(t.doc, {});
1171
1171
  n.anchors = /* @__PURE__ */ new Set();
1172
1172
  for (const r of t.anchors.keys())
1173
1173
  n.anchors.add(r.anchor);
@@ -1175,19 +1175,19 @@ function cn(s, e, t) {
1175
1175
  const i = s.toString(n);
1176
1176
  if (!t.mapKeyWarned) {
1177
1177
  let r = JSON.stringify(i);
1178
- r.length > 40 && (r = r.substring(0, 36) + '..."'), ss(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;
1178
+ r.length > 40 && (r = r.substring(0, 36) + '..."'), os(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;
1179
1179
  }
1180
1180
  return i;
1181
1181
  }
1182
1182
  return JSON.stringify(e);
1183
1183
  }
1184
1184
  function mt(s, e, t) {
1185
- const n = Se(s, void 0, t), i = Se(e, void 0, t);
1185
+ const n = Ne(s, void 0, t), i = Ne(e, void 0, t);
1186
1186
  return new M(n, i);
1187
1187
  }
1188
1188
  class M {
1189
1189
  constructor(e, t = null) {
1190
- Object.defineProperty(this, K, { value: Ht }), this.key = e, this.value = t;
1190
+ Object.defineProperty(this, K, { value: zt }), this.key = e, this.value = t;
1191
1191
  }
1192
1192
  clone(e) {
1193
1193
  let { key: t, value: n } = this;
@@ -1195,16 +1195,16 @@ class M {
1195
1195
  }
1196
1196
  toJSON(e, t) {
1197
1197
  const n = t != null && t.mapAsMap ? /* @__PURE__ */ new Map() : {};
1198
- return rs(t, n, this);
1198
+ return cs(t, n, this);
1199
1199
  }
1200
1200
  toString(e, t, n) {
1201
- return e != null && e.doc ? an(this, e, t, n) : JSON.stringify(this);
1201
+ return e != null && e.doc ? rn(this, e, t, n) : JSON.stringify(this);
1202
1202
  }
1203
1203
  }
1204
- function os(s, e, t) {
1205
- return (e.inFlow ?? s.flow ? un : fn)(s, e, t);
1204
+ function fs(s, e, t) {
1205
+ return (e.inFlow ?? s.flow ? cn : ln)(s, e, t);
1206
1206
  }
1207
- function fn({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, itemIndent: r, onChompKeep: o, onComment: a }) {
1207
+ function ln({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, itemIndent: r, onChompKeep: o, onComment: a }) {
1208
1208
  const { indent: l, options: { commentString: c } } = t, p = Object.assign({}, t, { indent: r, type: null });
1209
1209
  let f = !1;
1210
1210
  const h = [];
@@ -1212,14 +1212,14 @@ function fn({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, ite
1212
1212
  const u = e[g];
1213
1213
  let m = null;
1214
1214
  if (C(u))
1215
- !f && u.spaceBefore && h.push(""), Fe(t, h, u.commentBefore, f), u.comment && (m = u.comment);
1216
- else if (_(u)) {
1217
- const b = C(u.key) ? u.key : null;
1218
- b && (!f && b.spaceBefore && h.push(""), Fe(t, h, b.commentBefore, f));
1215
+ !f && u.spaceBefore && h.push(""), qe(t, h, u.commentBefore, f), u.comment && (m = u.comment);
1216
+ else if (v(u)) {
1217
+ const w = C(u.key) ? u.key : null;
1218
+ w && (!f && w.spaceBefore && h.push(""), qe(t, h, w.commentBefore, f));
1219
1219
  }
1220
1220
  f = !1;
1221
1221
  let y = ce(u, p, () => m = null, () => f = !0);
1222
- m && (y += X(y, r, c(m))), f && m && (f = !1), h.push(n + y);
1222
+ m && (y += Z(y, r, c(m))), f && m && (f = !1), h.push(n + y);
1223
1223
  }
1224
1224
  let d;
1225
1225
  if (h.length === 0)
@@ -1234,9 +1234,9 @@ ${l}${u}` : `
1234
1234
  }
1235
1235
  }
1236
1236
  return s ? (d += `
1237
- ` + J(c(s), l), a && a()) : f && o && o(), d;
1237
+ ` + H(c(s), l), a && a()) : f && o && o(), d;
1238
1238
  }
1239
- function un({ items: s }, e, { flowChars: t, itemIndent: n }) {
1239
+ function cn({ items: s }, e, { flowChars: t, itemIndent: n }) {
1240
1240
  const { indent: i, indentStep: r, flowCollectionPadding: o, options: { commentString: a } } = e;
1241
1241
  n += r;
1242
1242
  const l = Object.assign({}, e, {
@@ -1250,17 +1250,17 @@ function un({ items: s }, e, { flowChars: t, itemIndent: n }) {
1250
1250
  const u = s[g];
1251
1251
  let m = null;
1252
1252
  if (C(u))
1253
- u.spaceBefore && f.push(""), Fe(e, f, u.commentBefore, !1), u.comment && (m = u.comment);
1254
- else if (_(u)) {
1255
- const b = C(u.key) ? u.key : null;
1256
- b && (b.spaceBefore && f.push(""), Fe(e, f, b.commentBefore, !1), b.comment && (c = !0));
1257
- const S = C(u.value) ? u.value : null;
1258
- S ? (S.comment && (m = S.comment), S.commentBefore && (c = !0)) : u.value == null && (b != null && b.comment) && (m = b.comment);
1253
+ u.spaceBefore && f.push(""), qe(e, f, u.commentBefore, !1), u.comment && (m = u.comment);
1254
+ else if (v(u)) {
1255
+ const w = C(u.key) ? u.key : null;
1256
+ w && (w.spaceBefore && f.push(""), qe(e, f, w.commentBefore, !1), w.comment && (c = !0));
1257
+ const N = C(u.value) ? u.value : null;
1258
+ N ? (N.comment && (m = N.comment), N.commentBefore && (c = !0)) : u.value == null && (w != null && w.comment) && (m = w.comment);
1259
1259
  }
1260
1260
  m && (c = !0);
1261
1261
  let y = ce(u, l, () => m = null);
1262
1262
  c || (c = f.length > p || y.includes(`
1263
- `)), g < s.length - 1 ? y += "," : e.options.trailingComma && (e.options.lineWidth > 0 && (c || (c = f.reduce((b, S) => b + S.length + 2, 2) + (y.length + 2) > e.options.lineWidth)), c && (y += ",")), m && (y += X(y, n, a(m))), f.push(y), p = f.length;
1263
+ `)), g < s.length - 1 ? y += "," : e.options.trailingComma && (e.options.lineWidth > 0 && (c || (c = f.reduce((w, N) => w + N.length + 2, 2) + (y.length + 2) > e.options.lineWidth)), c && (y += ",")), m && (y += Z(y, n, a(m))), f.push(y), p = f.length;
1264
1264
  }
1265
1265
  const { start: h, end: d } = t;
1266
1266
  if (f.length === 0)
@@ -1280,24 +1280,24 @@ ${i}${d}`;
1280
1280
  } else
1281
1281
  return `${h}${o}${f.join(" ")}${o}${d}`;
1282
1282
  }
1283
- function Fe({ indent: s, options: { commentString: e } }, t, n, i) {
1283
+ function qe({ indent: s, options: { commentString: e } }, t, n, i) {
1284
1284
  if (n && i && (n = n.replace(/^\n+/, "")), n) {
1285
- const r = J(e(n), s);
1285
+ const r = H(e(n), s);
1286
1286
  t.push(r.trimStart());
1287
1287
  }
1288
1288
  }
1289
- function z(s, e) {
1289
+ function ee(s, e) {
1290
1290
  const t = T(e) ? e.value : e;
1291
1291
  for (const n of s)
1292
- if (_(n) && (n.key === e || n.key === t || T(n.key) && n.key.value === t))
1292
+ if (v(n) && (n.key === e || n.key === t || T(n.key) && n.key.value === t))
1293
1293
  return n;
1294
1294
  }
1295
- class D extends xt {
1295
+ class j extends ns {
1296
1296
  static get tagName() {
1297
1297
  return "tag:yaml.org,2002:map";
1298
1298
  }
1299
1299
  constructor(e) {
1300
- super(W, e), this.items = [];
1300
+ super(z, e), this.items = [];
1301
1301
  }
1302
1302
  /**
1303
1303
  * A generic collection parsing method that can be extended
@@ -1328,12 +1328,12 @@ class D extends xt {
1328
1328
  add(e, t) {
1329
1329
  var o;
1330
1330
  let n;
1331
- _(e) ? n = e : !e || typeof e != "object" || !("key" in e) ? n = new M(e, e == null ? void 0 : e.value) : n = new M(e.key, e.value);
1332
- const i = z(this.items, n.key), r = (o = this.schema) == null ? void 0 : o.sortMapEntries;
1331
+ v(e) ? n = e : !e || typeof e != "object" || !("key" in e) ? n = new M(e, e == null ? void 0 : e.value) : n = new M(e.key, e.value);
1332
+ const i = ee(this.items, n.key), r = (o = this.schema) == null ? void 0 : o.sortMapEntries;
1333
1333
  if (i) {
1334
1334
  if (!t)
1335
1335
  throw new Error(`Key ${n.key} already set`);
1336
- T(i.value) && Zt(n.value) ? i.value.value = n.value : i.value = n.value;
1336
+ T(i.value) && ss(n.value) ? i.value.value = n.value : i.value = n.value;
1337
1337
  } else if (r) {
1338
1338
  const a = this.items.findIndex((l) => r(n, l) < 0);
1339
1339
  a === -1 ? this.items.push(n) : this.items.splice(a, 0, n);
@@ -1341,15 +1341,15 @@ class D extends xt {
1341
1341
  this.items.push(n);
1342
1342
  }
1343
1343
  delete(e) {
1344
- const t = z(this.items, e);
1344
+ const t = ee(this.items, e);
1345
1345
  return t ? this.items.splice(this.items.indexOf(t), 1).length > 0 : !1;
1346
1346
  }
1347
1347
  get(e, t) {
1348
- const n = z(this.items, e), i = n == null ? void 0 : n.value;
1348
+ const n = ee(this.items, e), i = n == null ? void 0 : n.value;
1349
1349
  return (!t && T(i) ? i.value : i) ?? void 0;
1350
1350
  }
1351
1351
  has(e) {
1352
- return !!z(this.items, e);
1352
+ return !!ee(this.items, e);
1353
1353
  }
1354
1354
  set(e, t) {
1355
1355
  this.add(new M(e, t), !0);
@@ -1363,16 +1363,16 @@ class D extends xt {
1363
1363
  const i = n ? new n() : t != null && t.mapAsMap ? /* @__PURE__ */ new Map() : {};
1364
1364
  t != null && t.onCreate && t.onCreate(i);
1365
1365
  for (const r of this.items)
1366
- rs(t, i, r);
1366
+ cs(t, i, r);
1367
1367
  return i;
1368
1368
  }
1369
1369
  toString(e, t, n) {
1370
1370
  if (!e)
1371
1371
  return JSON.stringify(this);
1372
1372
  for (const i of this.items)
1373
- if (!_(i))
1373
+ if (!v(i))
1374
1374
  throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);
1375
- return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), os(this, e, {
1375
+ return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), fs(this, e, {
1376
1376
  blockItemPrefix: "",
1377
1377
  flowChars: { start: "{", end: "}" },
1378
1378
  itemIndent: e.indent || "",
@@ -1384,14 +1384,14 @@ class D extends xt {
1384
1384
  const pe = {
1385
1385
  collection: "map",
1386
1386
  default: !0,
1387
- nodeClass: D,
1387
+ nodeClass: j,
1388
1388
  tag: "tag:yaml.org,2002:map",
1389
1389
  resolve(s, e) {
1390
- return Ie(s) || e("Expected a mapping for this tag"), s;
1390
+ return Ae(s) || e("Expected a mapping for this tag"), s;
1391
1391
  },
1392
- createNode: (s, e, t) => D.from(s, e, t)
1392
+ createNode: (s, e, t) => j.from(s, e, t)
1393
1393
  };
1394
- class x extends xt {
1394
+ class te extends ns {
1395
1395
  static get tagName() {
1396
1396
  return "tag:yaml.org,2002:seq";
1397
1397
  }
@@ -1410,11 +1410,11 @@ class x extends xt {
1410
1410
  * @returns `true` if the item was found and removed.
1411
1411
  */
1412
1412
  delete(e) {
1413
- const t = Ce(e);
1413
+ const t = _e(e);
1414
1414
  return typeof t != "number" ? !1 : this.items.splice(t, 1).length > 0;
1415
1415
  }
1416
1416
  get(e, t) {
1417
- const n = Ce(e);
1417
+ const n = _e(e);
1418
1418
  if (typeof n != "number")
1419
1419
  return;
1420
1420
  const i = this.items[n];
@@ -1427,7 +1427,7 @@ class x extends xt {
1427
1427
  * It may be wrapped in a `Scalar`.
1428
1428
  */
1429
1429
  has(e) {
1430
- const t = Ce(e);
1430
+ const t = _e(e);
1431
1431
  return typeof t == "number" && t < this.items.length;
1432
1432
  }
1433
1433
  /**
@@ -1438,22 +1438,22 @@ class x extends xt {
1438
1438
  * It may be wrapped in a `Scalar`.
1439
1439
  */
1440
1440
  set(e, t) {
1441
- const n = Ce(e);
1441
+ const n = _e(e);
1442
1442
  if (typeof n != "number")
1443
1443
  throw new Error(`Expected a valid index, not ${e}.`);
1444
1444
  const i = this.items[n];
1445
- T(i) && Zt(t) ? i.value = t : this.items[n] = t;
1445
+ T(i) && ss(t) ? i.value = t : this.items[n] = t;
1446
1446
  }
1447
1447
  toJSON(e, t) {
1448
1448
  const n = [];
1449
1449
  t != null && t.onCreate && t.onCreate(n);
1450
1450
  let i = 0;
1451
1451
  for (const r of this.items)
1452
- n.push(j(r, String(i++), t));
1452
+ n.push(B(r, String(i++), t));
1453
1453
  return n;
1454
1454
  }
1455
1455
  toString(e, t, n) {
1456
- return e ? os(this, e, {
1456
+ return e ? fs(this, e, {
1457
1457
  blockItemPrefix: "- ",
1458
1458
  flowChars: { start: "[", end: "]" },
1459
1459
  itemIndent: (e.indent || "") + " ",
@@ -1470,25 +1470,25 @@ class x extends xt {
1470
1470
  const l = t instanceof Set ? a : String(o++);
1471
1471
  a = i.call(t, l, a);
1472
1472
  }
1473
- r.items.push(Se(a, void 0, n));
1473
+ r.items.push(Ne(a, void 0, n));
1474
1474
  }
1475
1475
  }
1476
1476
  return r;
1477
1477
  }
1478
1478
  }
1479
- function Ce(s) {
1479
+ function _e(s) {
1480
1480
  let e = T(s) ? s.value : s;
1481
1481
  return e && typeof e == "string" && (e = Number(e)), typeof e == "number" && Number.isInteger(e) && e >= 0 ? e : null;
1482
1482
  }
1483
1483
  const me = {
1484
1484
  collection: "seq",
1485
1485
  default: !0,
1486
- nodeClass: x,
1486
+ nodeClass: te,
1487
1487
  tag: "tag:yaml.org,2002:seq",
1488
1488
  resolve(s, e) {
1489
- return Ae(s) || e("Expected a sequence for this tag"), s;
1489
+ return Oe(s) || e("Expected a sequence for this tag"), s;
1490
1490
  },
1491
- createNode: (s, e, t) => x.from(s, e, t)
1491
+ createNode: (s, e, t) => te.from(s, e, t)
1492
1492
  }, Ge = {
1493
1493
  identify: (s) => typeof s == "string",
1494
1494
  default: !0,
@@ -1497,20 +1497,20 @@ const me = {
1497
1497
  stringify(s, e, t, n) {
1498
1498
  return e = Object.assign({ actualString: !0 }, e), pt(s, e, t, n);
1499
1499
  }
1500
- }, He = {
1500
+ }, We = {
1501
1501
  identify: (s) => s == null,
1502
- createNode: () => new I(null),
1502
+ createNode: () => new $(null),
1503
1503
  default: !0,
1504
1504
  tag: "tag:yaml.org,2002:null",
1505
1505
  test: /^(?:~|[Nn]ull|NULL)?$/,
1506
- resolve: () => new I(null),
1507
- stringify: ({ source: s }, e) => typeof s == "string" && He.test.test(s) ? s : e.options.nullStr
1506
+ resolve: () => new $(null),
1507
+ stringify: ({ source: s }, e) => typeof s == "string" && We.test.test(s) ? s : e.options.nullStr
1508
1508
  }, gt = {
1509
1509
  identify: (s) => typeof s == "boolean",
1510
1510
  default: !0,
1511
1511
  tag: "tag:yaml.org,2002:bool",
1512
1512
  test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
1513
- resolve: (s) => new I(s[0] === "t" || s[0] === "T"),
1513
+ resolve: (s) => new $(s[0] === "t" || s[0] === "T"),
1514
1514
  stringify({ source: s, value: e }, t) {
1515
1515
  if (s && gt.test.test(s)) {
1516
1516
  const n = s[0] === "t" || s[0] === "T";
@@ -1536,14 +1536,14 @@ function U({ format: s, minFractionDigits: e, tag: t, value: n }) {
1536
1536
  }
1537
1537
  return r;
1538
1538
  }
1539
- const as = {
1539
+ const us = {
1540
1540
  identify: (s) => typeof s == "number",
1541
1541
  default: !0,
1542
1542
  tag: "tag:yaml.org,2002:float",
1543
1543
  test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
1544
1544
  resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
1545
1545
  stringify: U
1546
- }, ls = {
1546
+ }, hs = {
1547
1547
  identify: (s) => typeof s == "number",
1548
1548
  default: !0,
1549
1549
  tag: "tag:yaml.org,2002:float",
@@ -1554,76 +1554,76 @@ const as = {
1554
1554
  const e = Number(s.value);
1555
1555
  return isFinite(e) ? e.toExponential() : U(s);
1556
1556
  }
1557
- }, cs = {
1557
+ }, ds = {
1558
1558
  identify: (s) => typeof s == "number",
1559
1559
  default: !0,
1560
1560
  tag: "tag:yaml.org,2002:float",
1561
1561
  test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
1562
1562
  resolve(s) {
1563
- const e = new I(parseFloat(s)), t = s.indexOf(".");
1563
+ const e = new $(parseFloat(s)), t = s.indexOf(".");
1564
1564
  return t !== -1 && s[s.length - 1] === "0" && (e.minFractionDigits = s.length - t - 1), e;
1565
1565
  },
1566
1566
  stringify: U
1567
- }, We = (s) => typeof s == "bigint" || Number.isInteger(s), yt = (s, e, t, { intAsBigInt: n }) => n ? BigInt(s) : parseInt(s.substring(e), t);
1568
- function fs(s, e, t) {
1567
+ }, Qe = (s) => typeof s == "bigint" || Number.isInteger(s), yt = (s, e, t, { intAsBigInt: n }) => n ? BigInt(s) : parseInt(s.substring(e), t);
1568
+ function ps(s, e, t) {
1569
1569
  const { value: n } = s;
1570
- return We(n) && n >= 0 ? t + n.toString(e) : U(s);
1570
+ return Qe(n) && n >= 0 ? t + n.toString(e) : U(s);
1571
1571
  }
1572
- const us = {
1573
- identify: (s) => We(s) && s >= 0,
1572
+ const ms = {
1573
+ identify: (s) => Qe(s) && s >= 0,
1574
1574
  default: !0,
1575
1575
  tag: "tag:yaml.org,2002:int",
1576
1576
  format: "OCT",
1577
1577
  test: /^0o[0-7]+$/,
1578
1578
  resolve: (s, e, t) => yt(s, 2, 8, t),
1579
- stringify: (s) => fs(s, 8, "0o")
1580
- }, hs = {
1581
- identify: We,
1579
+ stringify: (s) => ps(s, 8, "0o")
1580
+ }, gs = {
1581
+ identify: Qe,
1582
1582
  default: !0,
1583
1583
  tag: "tag:yaml.org,2002:int",
1584
1584
  test: /^[-+]?[0-9]+$/,
1585
1585
  resolve: (s, e, t) => yt(s, 0, 10, t),
1586
1586
  stringify: U
1587
- }, ds = {
1588
- identify: (s) => We(s) && s >= 0,
1587
+ }, ys = {
1588
+ identify: (s) => Qe(s) && s >= 0,
1589
1589
  default: !0,
1590
1590
  tag: "tag:yaml.org,2002:int",
1591
1591
  format: "HEX",
1592
1592
  test: /^0x[0-9a-fA-F]+$/,
1593
1593
  resolve: (s, e, t) => yt(s, 2, 16, t),
1594
- stringify: (s) => fs(s, 16, "0x")
1595
- }, hn = [
1594
+ stringify: (s) => ps(s, 16, "0x")
1595
+ }, fn = [
1596
1596
  pe,
1597
1597
  me,
1598
1598
  Ge,
1599
- He,
1599
+ We,
1600
1600
  gt,
1601
+ ms,
1602
+ gs,
1603
+ ys,
1601
1604
  us,
1602
1605
  hs,
1603
- ds,
1604
- as,
1605
- ls,
1606
- cs
1606
+ ds
1607
1607
  ];
1608
- function Ct(s) {
1608
+ function Dt(s) {
1609
1609
  return typeof s == "bigint" || Number.isInteger(s);
1610
1610
  }
1611
- const _e = ({ value: s }) => JSON.stringify(s), dn = [
1611
+ const Pe = ({ value: s }) => JSON.stringify(s), un = [
1612
1612
  {
1613
1613
  identify: (s) => typeof s == "string",
1614
1614
  default: !0,
1615
1615
  tag: "tag:yaml.org,2002:str",
1616
1616
  resolve: (s) => s,
1617
- stringify: _e
1617
+ stringify: Pe
1618
1618
  },
1619
1619
  {
1620
1620
  identify: (s) => s == null,
1621
- createNode: () => new I(null),
1621
+ createNode: () => new $(null),
1622
1622
  default: !0,
1623
1623
  tag: "tag:yaml.org,2002:null",
1624
1624
  test: /^null$/,
1625
1625
  resolve: () => null,
1626
- stringify: _e
1626
+ stringify: Pe
1627
1627
  },
1628
1628
  {
1629
1629
  identify: (s) => typeof s == "boolean",
@@ -1631,15 +1631,15 @@ const _e = ({ value: s }) => JSON.stringify(s), dn = [
1631
1631
  tag: "tag:yaml.org,2002:bool",
1632
1632
  test: /^true$|^false$/,
1633
1633
  resolve: (s) => s === "true",
1634
- stringify: _e
1634
+ stringify: Pe
1635
1635
  },
1636
1636
  {
1637
- identify: Ct,
1637
+ identify: Dt,
1638
1638
  default: !0,
1639
1639
  tag: "tag:yaml.org,2002:int",
1640
1640
  test: /^-?(?:0|[1-9][0-9]*)$/,
1641
1641
  resolve: (s, e, { intAsBigInt: t }) => t ? BigInt(s) : parseInt(s, 10),
1642
- stringify: ({ value: s }) => Ct(s) ? s.toString() : JSON.stringify(s)
1642
+ stringify: ({ value: s }) => Dt(s) ? s.toString() : JSON.stringify(s)
1643
1643
  },
1644
1644
  {
1645
1645
  identify: (s) => typeof s == "number",
@@ -1647,16 +1647,16 @@ const _e = ({ value: s }) => JSON.stringify(s), dn = [
1647
1647
  tag: "tag:yaml.org,2002:float",
1648
1648
  test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
1649
1649
  resolve: (s) => parseFloat(s),
1650
- stringify: _e
1650
+ stringify: Pe
1651
1651
  }
1652
- ], pn = {
1652
+ ], hn = {
1653
1653
  default: !0,
1654
1654
  tag: "",
1655
1655
  test: /^/,
1656
1656
  resolve(s, e) {
1657
1657
  return e(`Unresolved plain scalar ${JSON.stringify(s)}`), s;
1658
1658
  }
1659
- }, mn = [pe, me].concat(dn, pn), bt = {
1659
+ }, dn = [pe, me].concat(un, hn), bt = {
1660
1660
  identify: (s) => s instanceof Uint8Array,
1661
1661
  // Buffer inherits from Uint8Array
1662
1662
  default: !1,
@@ -1690,24 +1690,24 @@ const _e = ({ value: s }) => JSON.stringify(s), dn = [
1690
1690
  a = btoa(l);
1691
1691
  } else
1692
1692
  throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
1693
- if (e ?? (e = I.BLOCK_LITERAL), e !== I.QUOTE_DOUBLE) {
1693
+ if (e ?? (e = $.BLOCK_LITERAL), e !== $.QUOTE_DOUBLE) {
1694
1694
  const l = Math.max(n.options.lineWidth - n.indent.length, n.options.minContentWidth), c = Math.ceil(a.length / l), p = new Array(c);
1695
1695
  for (let f = 0, h = 0; f < c; ++f, h += l)
1696
1696
  p[f] = a.substr(h, l);
1697
- a = p.join(e === I.BLOCK_LITERAL ? `
1697
+ a = p.join(e === $.BLOCK_LITERAL ? `
1698
1698
  ` : " ");
1699
1699
  }
1700
1700
  return pt({ comment: s, type: e, value: a }, n, i, r);
1701
1701
  }
1702
1702
  };
1703
- function ps(s, e) {
1704
- if (Ae(s))
1703
+ function bs(s, e) {
1704
+ if (Oe(s))
1705
1705
  for (let t = 0; t < s.items.length; ++t) {
1706
1706
  let n = s.items[t];
1707
- if (!_(n)) {
1708
- if (Ie(n)) {
1707
+ if (!v(n)) {
1708
+ if (Ae(n)) {
1709
1709
  n.items.length > 1 && e("Each pair must have its own sequence indicator");
1710
- const i = n.items[0] || new M(new I(null));
1710
+ const i = n.items[0] || new M(new $(null));
1711
1711
  if (n.commentBefore && (i.key.commentBefore = i.key.commentBefore ? `${n.commentBefore}
1712
1712
  ${i.key.commentBefore}` : n.commentBefore), n.comment) {
1713
1713
  const r = i.value ?? i.key;
@@ -1716,15 +1716,15 @@ ${r.comment}` : n.comment;
1716
1716
  }
1717
1717
  n = i;
1718
1718
  }
1719
- s.items[t] = _(n) ? n : new M(n);
1719
+ s.items[t] = v(n) ? n : new M(n);
1720
1720
  }
1721
1721
  }
1722
1722
  else
1723
1723
  e("Expected a sequence for this tag");
1724
1724
  return s;
1725
1725
  }
1726
- function ms(s, e, t) {
1727
- const { replacer: n } = t, i = new x(s);
1726
+ function ws(s, e, t) {
1727
+ const { replacer: n } = t, i = new te(s);
1728
1728
  i.tag = "tag:yaml.org,2002:pairs";
1729
1729
  let r = 0;
1730
1730
  if (e && Symbol.iterator in Object(e))
@@ -1752,12 +1752,12 @@ const wt = {
1752
1752
  collection: "seq",
1753
1753
  default: !1,
1754
1754
  tag: "tag:yaml.org,2002:pairs",
1755
- resolve: ps,
1756
- createNode: ms
1755
+ resolve: bs,
1756
+ createNode: ws
1757
1757
  };
1758
- class ae extends x {
1758
+ class ae extends te {
1759
1759
  constructor() {
1760
- super(), this.add = D.prototype.add.bind(this), this.delete = D.prototype.delete.bind(this), this.get = D.prototype.get.bind(this), this.has = D.prototype.has.bind(this), this.set = D.prototype.set.bind(this), this.tag = ae.tag;
1760
+ super(), this.add = j.prototype.add.bind(this), this.delete = j.prototype.delete.bind(this), this.get = j.prototype.get.bind(this), this.has = j.prototype.has.bind(this), this.set = j.prototype.set.bind(this), this.tag = ae.tag;
1761
1761
  }
1762
1762
  /**
1763
1763
  * If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
@@ -1770,14 +1770,14 @@ class ae extends x {
1770
1770
  t != null && t.onCreate && t.onCreate(n);
1771
1771
  for (const i of this.items) {
1772
1772
  let r, o;
1773
- if (_(i) ? (r = j(i.key, "", t), o = j(i.value, r, t)) : r = j(i, "", t), n.has(r))
1773
+ if (v(i) ? (r = B(i.key, "", t), o = B(i.value, r, t)) : r = B(i, "", t), n.has(r))
1774
1774
  throw new Error("Ordered maps must not include duplicate keys");
1775
1775
  n.set(r, o);
1776
1776
  }
1777
1777
  return n;
1778
1778
  }
1779
1779
  static from(e, t, n) {
1780
- const i = ms(e, t, n), r = new this();
1780
+ const i = ws(e, t, n), r = new this();
1781
1781
  return r.items = i.items, r;
1782
1782
  }
1783
1783
  }
@@ -1789,38 +1789,38 @@ const kt = {
1789
1789
  default: !1,
1790
1790
  tag: "tag:yaml.org,2002:omap",
1791
1791
  resolve(s, e) {
1792
- const t = ps(s, e), n = [];
1792
+ const t = bs(s, e), n = [];
1793
1793
  for (const { key: i } of t.items)
1794
1794
  T(i) && (n.includes(i.value) ? e(`Ordered maps must not include duplicate keys: ${i.value}`) : n.push(i.value));
1795
1795
  return Object.assign(new ae(), t);
1796
1796
  },
1797
1797
  createNode: (s, e, t) => ae.from(s, e, t)
1798
1798
  };
1799
- function gs({ value: s, source: e }, t) {
1800
- return e && (s ? ys : bs).test.test(e) ? e : s ? t.options.trueStr : t.options.falseStr;
1799
+ function ks({ value: s, source: e }, t) {
1800
+ return e && (s ? Ss : Ns).test.test(e) ? e : s ? t.options.trueStr : t.options.falseStr;
1801
1801
  }
1802
- const ys = {
1802
+ const Ss = {
1803
1803
  identify: (s) => s === !0,
1804
1804
  default: !0,
1805
1805
  tag: "tag:yaml.org,2002:bool",
1806
1806
  test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
1807
- resolve: () => new I(!0),
1808
- stringify: gs
1809
- }, bs = {
1807
+ resolve: () => new $(!0),
1808
+ stringify: ks
1809
+ }, Ns = {
1810
1810
  identify: (s) => s === !1,
1811
1811
  default: !0,
1812
1812
  tag: "tag:yaml.org,2002:bool",
1813
1813
  test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
1814
- resolve: () => new I(!1),
1815
- stringify: gs
1816
- }, gn = {
1814
+ resolve: () => new $(!1),
1815
+ stringify: ks
1816
+ }, pn = {
1817
1817
  identify: (s) => typeof s == "number",
1818
1818
  default: !0,
1819
1819
  tag: "tag:yaml.org,2002:float",
1820
1820
  test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
1821
1821
  resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
1822
1822
  stringify: U
1823
- }, yn = {
1823
+ }, mn = {
1824
1824
  identify: (s) => typeof s == "number",
1825
1825
  default: !0,
1826
1826
  tag: "tag:yaml.org,2002:float",
@@ -1831,13 +1831,13 @@ const ys = {
1831
1831
  const e = Number(s.value);
1832
1832
  return isFinite(e) ? e.toExponential() : U(s);
1833
1833
  }
1834
- }, bn = {
1834
+ }, gn = {
1835
1835
  identify: (s) => typeof s == "number",
1836
1836
  default: !0,
1837
1837
  tag: "tag:yaml.org,2002:float",
1838
1838
  test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
1839
1839
  resolve(s) {
1840
- const e = new I(parseFloat(s.replace(/_/g, ""))), t = s.indexOf(".");
1840
+ const e = new $(parseFloat(s.replace(/_/g, ""))), t = s.indexOf(".");
1841
1841
  if (t !== -1) {
1842
1842
  const n = s.substring(t + 1).replace(/_/g, "");
1843
1843
  n[n.length - 1] === "0" && (e.minFractionDigits = n.length);
@@ -1845,8 +1845,8 @@ const ys = {
1845
1845
  return e;
1846
1846
  },
1847
1847
  stringify: U
1848
- }, $e = (s) => typeof s == "bigint" || Number.isInteger(s);
1849
- function Qe(s, e, t, { intAsBigInt: n }) {
1848
+ }, Te = (s) => typeof s == "bigint" || Number.isInteger(s);
1849
+ function Xe(s, e, t, { intAsBigInt: n }) {
1850
1850
  const i = s[0];
1851
1851
  if ((i === "-" || i === "+") && (e += 1), s = s.substring(e).replace(/_/g, ""), n) {
1852
1852
  switch (t) {
@@ -1868,64 +1868,64 @@ function Qe(s, e, t, { intAsBigInt: n }) {
1868
1868
  }
1869
1869
  function St(s, e, t) {
1870
1870
  const { value: n } = s;
1871
- if ($e(n)) {
1871
+ if (Te(n)) {
1872
1872
  const i = n.toString(e);
1873
1873
  return n < 0 ? "-" + t + i.substr(1) : t + i;
1874
1874
  }
1875
1875
  return U(s);
1876
1876
  }
1877
- const wn = {
1878
- identify: $e,
1877
+ const yn = {
1878
+ identify: Te,
1879
1879
  default: !0,
1880
1880
  tag: "tag:yaml.org,2002:int",
1881
1881
  format: "BIN",
1882
1882
  test: /^[-+]?0b[0-1_]+$/,
1883
- resolve: (s, e, t) => Qe(s, 2, 2, t),
1883
+ resolve: (s, e, t) => Xe(s, 2, 2, t),
1884
1884
  stringify: (s) => St(s, 2, "0b")
1885
- }, kn = {
1886
- identify: $e,
1885
+ }, bn = {
1886
+ identify: Te,
1887
1887
  default: !0,
1888
1888
  tag: "tag:yaml.org,2002:int",
1889
1889
  format: "OCT",
1890
1890
  test: /^[-+]?0[0-7_]+$/,
1891
- resolve: (s, e, t) => Qe(s, 1, 8, t),
1891
+ resolve: (s, e, t) => Xe(s, 1, 8, t),
1892
1892
  stringify: (s) => St(s, 8, "0")
1893
- }, Sn = {
1894
- identify: $e,
1893
+ }, wn = {
1894
+ identify: Te,
1895
1895
  default: !0,
1896
1896
  tag: "tag:yaml.org,2002:int",
1897
1897
  test: /^[-+]?[0-9][0-9_]*$/,
1898
- resolve: (s, e, t) => Qe(s, 0, 10, t),
1898
+ resolve: (s, e, t) => Xe(s, 0, 10, t),
1899
1899
  stringify: U
1900
- }, Nn = {
1901
- identify: $e,
1900
+ }, kn = {
1901
+ identify: Te,
1902
1902
  default: !0,
1903
1903
  tag: "tag:yaml.org,2002:int",
1904
1904
  format: "HEX",
1905
1905
  test: /^[-+]?0x[0-9a-fA-F_]+$/,
1906
- resolve: (s, e, t) => Qe(s, 2, 16, t),
1906
+ resolve: (s, e, t) => Xe(s, 2, 16, t),
1907
1907
  stringify: (s) => St(s, 16, "0x")
1908
1908
  };
1909
- class le extends D {
1909
+ class le extends j {
1910
1910
  constructor(e) {
1911
1911
  super(e), this.tag = le.tag;
1912
1912
  }
1913
1913
  add(e) {
1914
1914
  let t;
1915
- _(e) ? t = e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? t = new M(e.key, null) : t = new M(e, null), z(this.items, t.key) || this.items.push(t);
1915
+ v(e) ? t = e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? t = new M(e.key, null) : t = new M(e, null), ee(this.items, t.key) || this.items.push(t);
1916
1916
  }
1917
1917
  /**
1918
1918
  * If `keepPair` is `true`, returns the Pair matching `key`.
1919
1919
  * Otherwise, returns the value of that Pair's key.
1920
1920
  */
1921
1921
  get(e, t) {
1922
- const n = z(this.items, e);
1923
- return !t && _(n) ? T(n.key) ? n.key.value : n.key : n;
1922
+ const n = ee(this.items, e);
1923
+ return !t && v(n) ? T(n.key) ? n.key.value : n.key : n;
1924
1924
  }
1925
1925
  set(e, t) {
1926
1926
  if (typeof t != "boolean")
1927
1927
  throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);
1928
- const n = z(this.items, e);
1928
+ const n = ee(this.items, e);
1929
1929
  n && !t ? this.items.splice(this.items.indexOf(n), 1) : !n && t && this.items.push(new M(e));
1930
1930
  }
1931
1931
  toJSON(e, t) {
@@ -1955,7 +1955,7 @@ const Nt = {
1955
1955
  tag: "tag:yaml.org,2002:set",
1956
1956
  createNode: (s, e, t) => le.from(s, e, t),
1957
1957
  resolve(s, e) {
1958
- if (Ie(s)) {
1958
+ if (Ae(s)) {
1959
1959
  if (s.hasAllNullValues(!0))
1960
1960
  return Object.assign(new le(), s);
1961
1961
  e("Set items must all have null values");
@@ -1968,7 +1968,7 @@ function Et(s, e) {
1968
1968
  const t = s[0], n = t === "-" || t === "+" ? s.substring(1) : s, i = (o) => e ? BigInt(o) : Number(o), r = n.replace(/_/g, "").split(":").reduce((o, a) => o * i(60) + i(a), i(0));
1969
1969
  return t === "-" ? i(-1) * r : r;
1970
1970
  }
1971
- function ws(s) {
1971
+ function Es(s) {
1972
1972
  let { value: e } = s, t = (o) => o;
1973
1973
  if (typeof e == "bigint")
1974
1974
  t = (o) => BigInt(o);
@@ -1979,23 +1979,23 @@ function ws(s) {
1979
1979
  const i = t(60), r = [e % i];
1980
1980
  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))), n + r.map((o) => String(o).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
1981
1981
  }
1982
- const ks = {
1982
+ const $s = {
1983
1983
  identify: (s) => typeof s == "bigint" || Number.isInteger(s),
1984
1984
  default: !0,
1985
1985
  tag: "tag:yaml.org,2002:int",
1986
1986
  format: "TIME",
1987
1987
  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
1988
1988
  resolve: (s, e, { intAsBigInt: t }) => Et(s, t),
1989
- stringify: ws
1990
- }, Ss = {
1989
+ stringify: Es
1990
+ }, Is = {
1991
1991
  identify: (s) => typeof s == "number",
1992
1992
  default: !0,
1993
1993
  tag: "tag:yaml.org,2002:float",
1994
1994
  format: "TIME",
1995
1995
  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
1996
1996
  resolve: (s) => Et(s, !1),
1997
- stringify: ws
1998
- }, Xe = {
1997
+ stringify: Es
1998
+ }, ze = {
1999
1999
  identify: (s) => s instanceof Date,
2000
2000
  default: !0,
2001
2001
  tag: "tag:yaml.org,2002:timestamp",
@@ -2004,7 +2004,7 @@ const ks = {
2004
2004
  // assumed to be 00:00:00Z (start of day, UTC).
2005
2005
  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})?))?)?$"),
2006
2006
  resolve(s) {
2007
- const e = s.match(Xe.test);
2007
+ const e = s.match(ze.test);
2008
2008
  if (!e)
2009
2009
  throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
2010
2010
  const [, t, n, i, r, o, a] = e.map(Number), l = e[7] ? Number((e[7] + "00").substr(1, 3)) : 0;
@@ -2017,97 +2017,97 @@ const ks = {
2017
2017
  return new Date(c);
2018
2018
  },
2019
2019
  stringify: ({ value: s }) => (s == null ? void 0 : s.toISOString().replace(/(T00:00:00)?\.000Z$/, "")) ?? ""
2020
- }, _t = [
2020
+ }, Mt = [
2021
2021
  pe,
2022
2022
  me,
2023
2023
  Ge,
2024
- He,
2025
- ys,
2026
- bs,
2024
+ We,
2025
+ Ss,
2026
+ Ns,
2027
+ yn,
2028
+ bn,
2027
2029
  wn,
2028
2030
  kn,
2029
- Sn,
2030
- Nn,
2031
+ pn,
2032
+ mn,
2031
2033
  gn,
2032
- yn,
2033
- bn,
2034
2034
  bt,
2035
- G,
2035
+ W,
2036
2036
  kt,
2037
2037
  wt,
2038
2038
  Nt,
2039
- ks,
2040
- Ss,
2041
- Xe
2042
- ], vt = /* @__PURE__ */ new Map([
2043
- ["core", hn],
2039
+ $s,
2040
+ Is,
2041
+ ze
2042
+ ], jt = /* @__PURE__ */ new Map([
2043
+ ["core", fn],
2044
2044
  ["failsafe", [pe, me, Ge]],
2045
- ["json", mn],
2046
- ["yaml11", _t],
2047
- ["yaml-1.1", _t]
2048
- ]), Pt = {
2045
+ ["json", dn],
2046
+ ["yaml11", Mt],
2047
+ ["yaml-1.1", Mt]
2048
+ ]), Bt = {
2049
2049
  binary: bt,
2050
2050
  bool: gt,
2051
- float: cs,
2052
- floatExp: ls,
2053
- floatNaN: as,
2054
- floatTime: Ss,
2055
- int: hs,
2056
- intHex: ds,
2057
- intOct: us,
2058
- intTime: ks,
2051
+ float: ds,
2052
+ floatExp: hs,
2053
+ floatNaN: us,
2054
+ floatTime: Is,
2055
+ int: gs,
2056
+ intHex: ys,
2057
+ intOct: ms,
2058
+ intTime: $s,
2059
2059
  map: pe,
2060
- merge: G,
2061
- null: He,
2060
+ merge: W,
2061
+ null: We,
2062
2062
  omap: kt,
2063
2063
  pairs: wt,
2064
2064
  seq: me,
2065
2065
  set: Nt,
2066
- timestamp: Xe
2067
- }, En = {
2066
+ timestamp: ze
2067
+ }, Sn = {
2068
2068
  "tag:yaml.org,2002:binary": bt,
2069
- "tag:yaml.org,2002:merge": G,
2069
+ "tag:yaml.org,2002:merge": W,
2070
2070
  "tag:yaml.org,2002:omap": kt,
2071
2071
  "tag:yaml.org,2002:pairs": wt,
2072
2072
  "tag:yaml.org,2002:set": Nt,
2073
- "tag:yaml.org,2002:timestamp": Xe
2073
+ "tag:yaml.org,2002:timestamp": ze
2074
2074
  };
2075
- function xe(s, e, t) {
2076
- const n = vt.get(e);
2075
+ function et(s, e, t) {
2076
+ const n = jt.get(e);
2077
2077
  if (n && !s)
2078
- return t && !n.includes(G) ? n.concat(G) : n.slice();
2078
+ return t && !n.includes(W) ? n.concat(W) : n.slice();
2079
2079
  let i = n;
2080
2080
  if (!i)
2081
2081
  if (Array.isArray(s))
2082
2082
  i = [];
2083
2083
  else {
2084
- const r = Array.from(vt.keys()).filter((o) => o !== "yaml11").map((o) => JSON.stringify(o)).join(", ");
2084
+ const r = Array.from(jt.keys()).filter((o) => o !== "yaml11").map((o) => JSON.stringify(o)).join(", ");
2085
2085
  throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`);
2086
2086
  }
2087
2087
  if (Array.isArray(s))
2088
2088
  for (const r of s)
2089
2089
  i = i.concat(r);
2090
2090
  else typeof s == "function" && (i = s(i.slice()));
2091
- return t && (i = i.concat(G)), i.reduce((r, o) => {
2092
- const a = typeof o == "string" ? Pt[o] : o;
2091
+ return t && (i = i.concat(W)), i.reduce((r, o) => {
2092
+ const a = typeof o == "string" ? Bt[o] : o;
2093
2093
  if (!a) {
2094
- const l = JSON.stringify(o), c = Object.keys(Pt).map((p) => JSON.stringify(p)).join(", ");
2094
+ const l = JSON.stringify(o), c = Object.keys(Bt).map((p) => JSON.stringify(p)).join(", ");
2095
2095
  throw new Error(`Unknown custom tag ${l}; use one of ${c}`);
2096
2096
  }
2097
2097
  return r.includes(a) || r.push(a), r;
2098
2098
  }, []);
2099
2099
  }
2100
- const In = (s, e) => s.key < e.key ? -1 : s.key > e.key ? 1 : 0;
2101
- class It {
2100
+ const Nn = (s, e) => s.key < e.key ? -1 : s.key > e.key ? 1 : 0;
2101
+ class $t {
2102
2102
  constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: i, schema: r, sortMapEntries: o, toStringDefaults: a }) {
2103
- this.compat = Array.isArray(e) ? xe(e, "compat") : e ? xe(null, e) : null, this.name = typeof r == "string" && r || "core", this.knownTags = i ? En : {}, this.tags = xe(t, this.name, n), this.toStringOptions = a ?? null, Object.defineProperty(this, W, { value: pe }), Object.defineProperty(this, Y, { value: Ge }), Object.defineProperty(this, ue, { value: me }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? In : null;
2103
+ this.compat = Array.isArray(e) ? et(e, "compat") : e ? et(null, e) : null, this.name = typeof r == "string" && r || "core", this.knownTags = i ? Sn : {}, this.tags = et(t, this.name, n), this.toStringOptions = a ?? null, Object.defineProperty(this, z, { value: pe }), Object.defineProperty(this, V, { value: Ge }), Object.defineProperty(this, ue, { value: me }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? Nn : null;
2104
2104
  }
2105
2105
  clone() {
2106
- const e = Object.create(It.prototype, Object.getOwnPropertyDescriptors(this));
2106
+ const e = Object.create($t.prototype, Object.getOwnPropertyDescriptors(this));
2107
2107
  return e.tags = this.tags.slice(), e;
2108
2108
  }
2109
2109
  }
2110
- function An(s, e) {
2110
+ function En(s, e) {
2111
2111
  var l;
2112
2112
  const t = [];
2113
2113
  let n = e.directives === !0;
@@ -2116,44 +2116,44 @@ function An(s, e) {
2116
2116
  c ? (t.push(c), n = !0) : s.directives.docStart && (n = !0);
2117
2117
  }
2118
2118
  n && t.push("---");
2119
- const i = ts(s, e), { commentString: r } = i.options;
2119
+ const i = rs(s, e), { commentString: r } = i.options;
2120
2120
  if (s.commentBefore) {
2121
2121
  t.length !== 1 && t.unshift("");
2122
2122
  const c = r(s.commentBefore);
2123
- t.unshift(J(c, ""));
2123
+ t.unshift(H(c, ""));
2124
2124
  }
2125
2125
  let o = !1, a = null;
2126
2126
  if (s.contents) {
2127
2127
  if (C(s.contents)) {
2128
2128
  if (s.contents.spaceBefore && n && t.push(""), s.contents.commentBefore) {
2129
2129
  const f = r(s.contents.commentBefore);
2130
- t.push(J(f, ""));
2130
+ t.push(H(f, ""));
2131
2131
  }
2132
2132
  i.forceBlockIndent = !!s.comment, a = s.contents.comment;
2133
2133
  }
2134
2134
  const c = a ? void 0 : () => o = !0;
2135
2135
  let p = ce(s.contents, i, () => a = null, c);
2136
- a && (p += X(p, "", r(a))), (p[0] === "|" || p[0] === ">") && t[t.length - 1] === "---" ? t[t.length - 1] = `--- ${p}` : t.push(p);
2136
+ a && (p += Z(p, "", r(a))), (p[0] === "|" || p[0] === ">") && t[t.length - 1] === "---" ? t[t.length - 1] = `--- ${p}` : t.push(p);
2137
2137
  } else
2138
2138
  t.push(ce(s.contents, i));
2139
2139
  if ((l = s.directives) != null && l.docEnd)
2140
2140
  if (s.comment) {
2141
2141
  const c = r(s.comment);
2142
2142
  c.includes(`
2143
- `) ? (t.push("..."), t.push(J(c, ""))) : t.push(`... ${c}`);
2143
+ `) ? (t.push("..."), t.push(H(c, ""))) : t.push(`... ${c}`);
2144
2144
  } else
2145
2145
  t.push("...");
2146
2146
  else {
2147
2147
  let c = s.comment;
2148
- c && o && (c = c.replace(/^\n+/, "")), c && ((!o || a) && t[t.length - 1] !== "" && t.push(""), t.push(J(r(c), "")));
2148
+ c && o && (c = c.replace(/^\n+/, "")), c && ((!o || a) && t[t.length - 1] !== "" && t.push(""), t.push(H(r(c), "")));
2149
2149
  }
2150
2150
  return t.join(`
2151
2151
  `) + `
2152
2152
  `;
2153
2153
  }
2154
- class Oe {
2154
+ class Le {
2155
2155
  constructor(e, t, n) {
2156
- this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, K, { value: it });
2156
+ this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, K, { value: rt });
2157
2157
  let i = null;
2158
2158
  typeof t == "function" || Array.isArray(t) ? i = t : n === void 0 && t && (n = t, t = void 0);
2159
2159
  const r = Object.assign({
@@ -2168,7 +2168,7 @@ class Oe {
2168
2168
  }, n);
2169
2169
  this.options = r;
2170
2170
  let { version: o } = r;
2171
- n != null && n._directives ? (this.directives = n._directives.atDocument(), this.directives.yaml.explicit && (o = this.directives.yaml.version)) : this.directives = new B({ version: o }), this.setSchema(o, n), this.contents = e === void 0 ? null : this.createNode(e, i, n);
2171
+ n != null && n._directives ? (this.directives = n._directives.atDocument(), this.directives.yaml.explicit && (o = this.directives.yaml.version)) : this.directives = new D({ version: o }), this.setSchema(o, n), this.contents = e === void 0 ? null : this.createNode(e, i, n);
2172
2172
  }
2173
2173
  /**
2174
2174
  * Create a deep copy of this Document and its contents.
@@ -2176,18 +2176,18 @@ class Oe {
2176
2176
  * Custom Node values that inherit from `Object` still refer to their original instances.
2177
2177
  */
2178
2178
  clone() {
2179
- const e = Object.create(Oe.prototype, {
2180
- [K]: { value: it }
2179
+ const e = Object.create(Le.prototype, {
2180
+ [K]: { value: rt }
2181
2181
  });
2182
2182
  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 = C(this.contents) ? this.contents.clone(e.schema) : this.contents, this.range && (e.range = this.range.slice()), e;
2183
2183
  }
2184
2184
  /** Adds a value to the document. */
2185
2185
  add(e) {
2186
- ee(this.contents) && this.contents.add(e);
2186
+ se(this.contents) && this.contents.add(e);
2187
2187
  }
2188
2188
  /** Adds a value to the document. */
2189
2189
  addIn(e, t) {
2190
- ee(this.contents) && this.contents.addIn(e, t);
2190
+ se(this.contents) && this.contents.addIn(e, t);
2191
2191
  }
2192
2192
  /**
2193
2193
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -2200,9 +2200,9 @@ class Oe {
2200
2200
  */
2201
2201
  createAlias(e, t) {
2202
2202
  if (!e.anchor) {
2203
- const n = Xt(this);
2203
+ const n = es(this);
2204
2204
  e.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
2205
- !t || n.has(t) ? zt(t || "a", n) : t;
2205
+ !t || n.has(t) ? ts(t || "a", n) : t;
2206
2206
  }
2207
2207
  return new dt(e.anchor);
2208
2208
  }
@@ -2211,10 +2211,10 @@ class Oe {
2211
2211
  if (typeof t == "function")
2212
2212
  e = t.call({ "": e }, "", e), i = t;
2213
2213
  else if (Array.isArray(t)) {
2214
- const m = (b) => typeof b == "number" || b instanceof String || b instanceof Number, y = t.filter(m).map(String);
2214
+ const m = (w) => typeof w == "number" || w instanceof String || w instanceof Number, y = t.filter(m).map(String);
2215
2215
  y.length > 0 && (t = t.concat(y)), i = t;
2216
2216
  } else n === void 0 && t && (n = t, t = void 0);
2217
- const { aliasDuplicateObjects: r, anchorPrefix: o, flow: a, keepUndefined: l, onTagObj: c, tag: p } = n ?? {}, { onAnchor: f, setAnchors: h, sourceObjects: d } = Zs(
2217
+ const { aliasDuplicateObjects: r, anchorPrefix: o, flow: a, keepUndefined: l, onTagObj: c, tag: p } = n ?? {}, { onAnchor: f, setAnchors: h, sourceObjects: d } = Xs(
2218
2218
  this,
2219
2219
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
2220
2220
  o || "a"
@@ -2226,7 +2226,7 @@ class Oe {
2226
2226
  replacer: i,
2227
2227
  schema: this.schema,
2228
2228
  sourceObjects: d
2229
- }, u = Se(e, p, g);
2229
+ }, u = Ne(e, p, g);
2230
2230
  return a && L(u) && (u.flow = !0), h(), u;
2231
2231
  }
2232
2232
  /**
@@ -2242,14 +2242,14 @@ class Oe {
2242
2242
  * @returns `true` if the item was found and removed.
2243
2243
  */
2244
2244
  delete(e) {
2245
- return ee(this.contents) ? this.contents.delete(e) : !1;
2245
+ return se(this.contents) ? this.contents.delete(e) : !1;
2246
2246
  }
2247
2247
  /**
2248
2248
  * Removes a value from the document.
2249
2249
  * @returns `true` if the item was found and removed.
2250
2250
  */
2251
2251
  deleteIn(e) {
2252
- return ye(e) ? this.contents == null ? !1 : (this.contents = null, !0) : ee(this.contents) ? this.contents.deleteIn(e) : !1;
2252
+ return ye(e) ? this.contents == null ? !1 : (this.contents = null, !0) : se(this.contents) ? this.contents.deleteIn(e) : !1;
2253
2253
  }
2254
2254
  /**
2255
2255
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -2284,14 +2284,14 @@ class Oe {
2284
2284
  * boolean to add/remove the item from the set.
2285
2285
  */
2286
2286
  set(e, t) {
2287
- this.contents == null ? this.contents = Re(this.schema, [e], t) : ee(this.contents) && this.contents.set(e, t);
2287
+ this.contents == null ? this.contents = Fe(this.schema, [e], t) : se(this.contents) && this.contents.set(e, t);
2288
2288
  }
2289
2289
  /**
2290
2290
  * Sets a value in this document. For `!!set`, `value` needs to be a
2291
2291
  * boolean to add/remove the item from the set.
2292
2292
  */
2293
2293
  setIn(e, t) {
2294
- ye(e) ? this.contents = t : this.contents == null ? this.contents = Re(this.schema, Array.from(e), t) : ee(this.contents) && this.contents.setIn(e, t);
2294
+ ye(e) ? this.contents = t : this.contents == null ? this.contents = Fe(this.schema, Array.from(e), t) : se(this.contents) && this.contents.setIn(e, t);
2295
2295
  }
2296
2296
  /**
2297
2297
  * Change the YAML version and schema used by the document.
@@ -2305,11 +2305,11 @@ class Oe {
2305
2305
  let n;
2306
2306
  switch (e) {
2307
2307
  case "1.1":
2308
- this.directives ? this.directives.yaml.version = "1.1" : this.directives = new B({ version: "1.1" }), n = { resolveKnownTags: !1, schema: "yaml-1.1" };
2308
+ this.directives ? this.directives.yaml.version = "1.1" : this.directives = new D({ version: "1.1" }), n = { resolveKnownTags: !1, schema: "yaml-1.1" };
2309
2309
  break;
2310
2310
  case "1.2":
2311
2311
  case "next":
2312
- this.directives ? this.directives.yaml.version = e : this.directives = new B({ version: e }), n = { resolveKnownTags: !0, schema: "core" };
2312
+ this.directives ? this.directives.yaml.version = e : this.directives = new D({ version: e }), n = { resolveKnownTags: !0, schema: "core" };
2313
2313
  break;
2314
2314
  case null:
2315
2315
  this.directives && delete this.directives, n = null;
@@ -2322,7 +2322,7 @@ class Oe {
2322
2322
  if (t.schema instanceof Object)
2323
2323
  this.schema = t.schema;
2324
2324
  else if (n)
2325
- this.schema = new It(Object.assign(n, t));
2325
+ this.schema = new $t(Object.assign(n, t));
2326
2326
  else
2327
2327
  throw new Error("With a null YAML version, the { schema: Schema } option is required");
2328
2328
  }
@@ -2335,7 +2335,7 @@ class Oe {
2335
2335
  mapAsMap: n === !0,
2336
2336
  mapKeyWarned: !1,
2337
2337
  maxAliasCount: typeof i == "number" ? i : 100
2338
- }, l = j(this.contents, t ?? "", a);
2338
+ }, l = B(this.contents, t ?? "", a);
2339
2339
  if (typeof r == "function")
2340
2340
  for (const { count: c, res: p } of a.anchors.values())
2341
2341
  r(p, c);
@@ -2358,30 +2358,30 @@ class Oe {
2358
2358
  const t = JSON.stringify(e.indent);
2359
2359
  throw new Error(`"indent" option must be a positive integer, not ${t}`);
2360
2360
  }
2361
- return An(this, e);
2361
+ return En(this, e);
2362
2362
  }
2363
2363
  }
2364
- function ee(s) {
2364
+ function se(s) {
2365
2365
  if (L(s))
2366
2366
  return !0;
2367
2367
  throw new Error("Expected a YAML collection as document contents");
2368
2368
  }
2369
- class Ns extends Error {
2369
+ class As extends Error {
2370
2370
  constructor(e, t, n, i) {
2371
2371
  super(), this.name = e, this.code = n, this.message = i, this.pos = t;
2372
2372
  }
2373
2373
  }
2374
- class be extends Ns {
2374
+ class be extends As {
2375
2375
  constructor(e, t, n) {
2376
2376
  super("YAMLParseError", e, t, n);
2377
2377
  }
2378
2378
  }
2379
- class $n extends Ns {
2379
+ class $n extends As {
2380
2380
  constructor(e, t, n) {
2381
2381
  super("YAMLWarning", e, t, n);
2382
2382
  }
2383
2383
  }
2384
- const Bt = (s, e) => (t) => {
2384
+ const Kt = (s, e) => (t) => {
2385
2385
  if (t.pos[0] === -1)
2386
2386
  return;
2387
2387
  t.linePos = t.pos.map((a) => e.linePos(a));
@@ -2410,54 +2410,54 @@ ${c}
2410
2410
  }
2411
2411
  };
2412
2412
  function fe(s, { flow: e, indicator: t, next: n, offset: i, onError: r, parentIndent: o, startOnNewline: a }) {
2413
- let l = !1, c = a, p = a, f = "", h = "", d = !1, g = !1, u = null, m = null, y = null, b = null, S = null, k = null, N = null;
2414
- for (const w of s)
2415
- switch (g && (w.type !== "space" && w.type !== "newline" && w.type !== "comma" && r(w.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), g = !1), u && (c && w.type !== "comment" && w.type !== "newline" && r(u, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), u = null), w.type) {
2413
+ let l = !1, c = a, p = a, f = "", h = "", d = !1, g = !1, u = null, m = null, y = null, w = null, N = null, S = null, E = null;
2414
+ for (const k of s)
2415
+ switch (g && (k.type !== "space" && k.type !== "newline" && k.type !== "comma" && r(k.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), g = !1), u && (c && k.type !== "comment" && k.type !== "newline" && r(u, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), u = null), k.type) {
2416
2416
  case "space":
2417
- !e && (t !== "doc-start" || (n == null ? void 0 : n.type) !== "flow-collection") && w.source.includes(" ") && (u = w), p = !0;
2417
+ !e && (t !== "doc-start" || (n == null ? void 0 : n.type) !== "flow-collection") && k.source.includes(" ") && (u = k), p = !0;
2418
2418
  break;
2419
2419
  case "comment": {
2420
- p || r(w, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
2421
- const O = w.source.substring(1) || " ";
2420
+ p || r(k, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
2421
+ const O = k.source.substring(1) || " ";
2422
2422
  f ? f += h + O : f = O, h = "", c = !1;
2423
2423
  break;
2424
2424
  }
2425
2425
  case "newline":
2426
- c ? f ? f += w.source : (!k || t !== "seq-item-ind") && (l = !0) : h += w.source, c = !0, d = !0, (m || y) && (b = w), p = !0;
2426
+ c ? f ? f += k.source : (!S || t !== "seq-item-ind") && (l = !0) : h += k.source, c = !0, d = !0, (m || y) && (w = k), p = !0;
2427
2427
  break;
2428
2428
  case "anchor":
2429
- m && r(w, "MULTIPLE_ANCHORS", "A node can have at most one anchor"), w.source.endsWith(":") && r(w.offset + w.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", !0), m = w, N ?? (N = w.offset), c = !1, p = !1, g = !0;
2429
+ m && r(k, "MULTIPLE_ANCHORS", "A node can have at most one anchor"), k.source.endsWith(":") && r(k.offset + k.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", !0), m = k, E ?? (E = k.offset), c = !1, p = !1, g = !0;
2430
2430
  break;
2431
2431
  case "tag": {
2432
- y && r(w, "MULTIPLE_TAGS", "A node can have at most one tag"), y = w, N ?? (N = w.offset), c = !1, p = !1, g = !0;
2432
+ y && r(k, "MULTIPLE_TAGS", "A node can have at most one tag"), y = k, E ?? (E = k.offset), c = !1, p = !1, g = !0;
2433
2433
  break;
2434
2434
  }
2435
2435
  case t:
2436
- (m || y) && r(w, "BAD_PROP_ORDER", `Anchors and tags must be after the ${w.source} indicator`), k && r(w, "UNEXPECTED_TOKEN", `Unexpected ${w.source} in ${e ?? "collection"}`), k = w, c = t === "seq-item-ind" || t === "explicit-key-ind", p = !1;
2436
+ (m || y) && r(k, "BAD_PROP_ORDER", `Anchors and tags must be after the ${k.source} indicator`), S && r(k, "UNEXPECTED_TOKEN", `Unexpected ${k.source} in ${e ?? "collection"}`), S = k, c = t === "seq-item-ind" || t === "explicit-key-ind", p = !1;
2437
2437
  break;
2438
2438
  case "comma":
2439
2439
  if (e) {
2440
- S && r(w, "UNEXPECTED_TOKEN", `Unexpected , in ${e}`), S = w, c = !1, p = !1;
2440
+ N && r(k, "UNEXPECTED_TOKEN", `Unexpected , in ${e}`), N = k, c = !1, p = !1;
2441
2441
  break;
2442
2442
  }
2443
2443
  default:
2444
- r(w, "UNEXPECTED_TOKEN", `Unexpected ${w.type} token`), c = !1, p = !1;
2444
+ r(k, "UNEXPECTED_TOKEN", `Unexpected ${k.type} token`), c = !1, p = !1;
2445
2445
  }
2446
- const $ = s[s.length - 1], A = $ ? $.offset + $.source.length : i;
2446
+ const A = s[s.length - 1], I = A ? A.offset + A.source.length : i;
2447
2447
  return g && n && n.type !== "space" && n.type !== "newline" && n.type !== "comma" && (n.type !== "scalar" || n.source !== "") && r(n.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), u && (c && u.indent <= o || (n == null ? void 0 : n.type) === "block-map" || (n == null ? void 0 : n.type) === "block-seq") && r(u, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), {
2448
- comma: S,
2449
- found: k,
2448
+ comma: N,
2449
+ found: S,
2450
2450
  spaceBefore: l,
2451
2451
  comment: f,
2452
2452
  hasNewline: d,
2453
2453
  anchor: m,
2454
2454
  tag: y,
2455
- newlineAfterProp: b,
2456
- end: A,
2457
- start: N ?? A
2455
+ newlineAfterProp: w,
2456
+ end: I,
2457
+ start: E ?? I
2458
2458
  };
2459
2459
  }
2460
- function Ne(s) {
2460
+ function Ee(s) {
2461
2461
  if (!s)
2462
2462
  return null;
2463
2463
  switch (s.type) {
@@ -2484,7 +2484,7 @@ function Ne(s) {
2484
2484
  if (t.type === "newline")
2485
2485
  return !0;
2486
2486
  }
2487
- if (Ne(e.key) || Ne(e.value))
2487
+ if (Ee(e.key) || Ee(e.value))
2488
2488
  return !0;
2489
2489
  }
2490
2490
  return !1;
@@ -2492,23 +2492,23 @@ function Ne(s) {
2492
2492
  return !0;
2493
2493
  }
2494
2494
  }
2495
- function lt(s, e, t) {
2495
+ function ct(s, e, t) {
2496
2496
  if ((e == null ? void 0 : e.type) === "flow-collection") {
2497
2497
  const n = e.end[0];
2498
- n.indent === s && (n.source === "]" || n.source === "}") && Ne(e) && t(n, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
2498
+ n.indent === s && (n.source === "]" || n.source === "}") && Ee(e) && t(n, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
2499
2499
  }
2500
2500
  }
2501
- function Es(s, e, t) {
2501
+ function Os(s, e, t) {
2502
2502
  const { uniqueKeys: n } = s.options;
2503
2503
  if (n === !1)
2504
2504
  return !1;
2505
2505
  const i = typeof n == "function" ? n : (r, o) => r === o || T(r) && T(o) && r.value === o.value;
2506
2506
  return e.some((r) => i(r.key, t));
2507
2507
  }
2508
- const Mt = "All mapping items must start at the same column";
2509
- function On({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2508
+ const Rt = "All mapping items must start at the same column";
2509
+ function In({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2510
2510
  var p;
2511
- const o = (r == null ? void 0 : r.nodeClass) ?? D, a = new o(t.schema);
2511
+ const o = (r == null ? void 0 : r.nodeClass) ?? j, a = new o(t.schema);
2512
2512
  t.atRoot && (t.atRoot = !1);
2513
2513
  let l = n.offset, c = null;
2514
2514
  for (const f of n.items) {
@@ -2521,41 +2521,41 @@ function On({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2521
2521
  startOnNewline: !0
2522
2522
  }), y = !m.found;
2523
2523
  if (y) {
2524
- if (d && (d.type === "block-seq" ? i(l, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in d && d.indent !== n.indent && i(l, "BAD_INDENT", Mt)), !m.anchor && !m.tag && !g) {
2524
+ if (d && (d.type === "block-seq" ? i(l, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in d && d.indent !== n.indent && i(l, "BAD_INDENT", Rt)), !m.anchor && !m.tag && !g) {
2525
2525
  c = m.end, m.comment && (a.comment ? a.comment += `
2526
2526
  ` + m.comment : a.comment = m.comment);
2527
2527
  continue;
2528
2528
  }
2529
- (m.newlineAfterProp || Ne(d)) && i(d ?? h[h.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
2530
- } else ((p = m.found) == null ? void 0 : p.indent) !== n.indent && i(l, "BAD_INDENT", Mt);
2529
+ (m.newlineAfterProp || Ee(d)) && i(d ?? h[h.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
2530
+ } else ((p = m.found) == null ? void 0 : p.indent) !== n.indent && i(l, "BAD_INDENT", Rt);
2531
2531
  t.atKey = !0;
2532
- const b = m.end, S = d ? s(t, d, m, i) : e(t, b, h, null, m, i);
2533
- t.schema.compat && lt(n.indent, d, i), t.atKey = !1, Es(t, a.items, S) && i(b, "DUPLICATE_KEY", "Map keys must be unique");
2534
- const k = fe(g ?? [], {
2532
+ const w = m.end, N = d ? s(t, d, m, i) : e(t, w, h, null, m, i);
2533
+ t.schema.compat && ct(n.indent, d, i), t.atKey = !1, Os(t, a.items, N) && i(w, "DUPLICATE_KEY", "Map keys must be unique");
2534
+ const S = fe(g ?? [], {
2535
2535
  indicator: "map-value-ind",
2536
2536
  next: u,
2537
- offset: S.range[2],
2537
+ offset: N.range[2],
2538
2538
  onError: i,
2539
2539
  parentIndent: n.indent,
2540
2540
  startOnNewline: !d || d.type === "block-scalar"
2541
2541
  });
2542
- if (l = k.end, k.found) {
2543
- y && ((u == null ? void 0 : u.type) === "block-map" && !k.hasNewline && i(l, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), t.options.strict && m.start < k.found.offset - 1024 && i(S.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
2544
- const N = u ? s(t, u, k, i) : e(t, l, g, null, k, i);
2545
- t.schema.compat && lt(n.indent, u, i), l = N.range[2];
2546
- const $ = new M(S, N);
2547
- t.options.keepSourceTokens && ($.srcToken = f), a.items.push($);
2542
+ if (l = S.end, S.found) {
2543
+ y && ((u == null ? void 0 : u.type) === "block-map" && !S.hasNewline && i(l, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), t.options.strict && m.start < S.found.offset - 1024 && i(N.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
2544
+ const E = u ? s(t, u, S, i) : e(t, l, g, null, S, i);
2545
+ t.schema.compat && ct(n.indent, u, i), l = E.range[2];
2546
+ const A = new M(N, E);
2547
+ t.options.keepSourceTokens && (A.srcToken = f), a.items.push(A);
2548
2548
  } else {
2549
- y && i(S.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"), k.comment && (S.comment ? S.comment += `
2550
- ` + k.comment : S.comment = k.comment);
2551
- const N = new M(S);
2552
- t.options.keepSourceTokens && (N.srcToken = f), a.items.push(N);
2549
+ y && i(N.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"), S.comment && (N.comment ? N.comment += `
2550
+ ` + S.comment : N.comment = S.comment);
2551
+ const E = new M(N);
2552
+ t.options.keepSourceTokens && (E.srcToken = f), a.items.push(E);
2553
2553
  }
2554
2554
  }
2555
2555
  return c && c < l && i(c, "IMPOSSIBLE", "Map comment with trailing content"), a.range = [n.offset, l, c ?? l], a;
2556
2556
  }
2557
- function Tn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2558
- const o = (r == null ? void 0 : r.nodeClass) ?? x, a = new o(t.schema);
2557
+ function An({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2558
+ const o = (r == null ? void 0 : r.nodeClass) ?? te, a = new o(t.schema);
2559
2559
  t.atRoot && (t.atRoot = !1), t.atKey && (t.atKey = !1);
2560
2560
  let l = n.offset, c = null;
2561
2561
  for (const { start: p, value: f } of n.items) {
@@ -2575,11 +2575,11 @@ function Tn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2575
2575
  continue;
2576
2576
  }
2577
2577
  const d = f ? s(t, f, h, i) : e(t, h.end, p, null, h, i);
2578
- t.schema.compat && lt(n.indent, f, i), l = d.range[2], a.items.push(d);
2578
+ t.schema.compat && ct(n.indent, f, i), l = d.range[2], a.items.push(d);
2579
2579
  }
2580
2580
  return a.range = [n.offset, l, c ?? l], a;
2581
2581
  }
2582
- function Te(s, e, t, n) {
2582
+ function Ce(s, e, t, n) {
2583
2583
  let i = "";
2584
2584
  if (s) {
2585
2585
  let r = !1, o = "";
@@ -2606,102 +2606,102 @@ function Te(s, e, t, n) {
2606
2606
  }
2607
2607
  return { comment: i, offset: e };
2608
2608
  }
2609
- const et = "Block collections are not allowed within flow collections", tt = (s) => s && (s.type === "block-map" || s.type === "block-seq");
2610
- function Ln({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2609
+ const tt = "Block collections are not allowed within flow collections", st = (s) => s && (s.type === "block-map" || s.type === "block-seq");
2610
+ function On({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2611
2611
  var m;
2612
- const o = n.start.source === "{", a = o ? "flow map" : "flow sequence", l = (r == null ? void 0 : r.nodeClass) ?? (o ? D : x), c = new l(t.schema);
2612
+ const o = n.start.source === "{", a = o ? "flow map" : "flow sequence", l = (r == null ? void 0 : r.nodeClass) ?? (o ? j : te), c = new l(t.schema);
2613
2613
  c.flow = !0;
2614
2614
  const p = t.atRoot;
2615
2615
  p && (t.atRoot = !1), t.atKey && (t.atKey = !1);
2616
2616
  let f = n.offset + n.start.source.length;
2617
2617
  for (let y = 0; y < n.items.length; ++y) {
2618
- const b = n.items[y], { start: S, key: k, sep: N, value: $ } = b, A = fe(S, {
2618
+ const w = n.items[y], { start: N, key: S, sep: E, value: A } = w, I = fe(N, {
2619
2619
  flow: a,
2620
2620
  indicator: "explicit-key-ind",
2621
- next: k ?? (N == null ? void 0 : N[0]),
2621
+ next: S ?? (E == null ? void 0 : E[0]),
2622
2622
  offset: f,
2623
2623
  onError: i,
2624
2624
  parentIndent: n.indent,
2625
2625
  startOnNewline: !1
2626
2626
  });
2627
- if (!A.found) {
2628
- if (!A.anchor && !A.tag && !N && !$) {
2629
- y === 0 && A.comma ? i(A.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${a}`) : y < n.items.length - 1 && i(A.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${a}`), A.comment && (c.comment ? c.comment += `
2630
- ` + A.comment : c.comment = A.comment), f = A.end;
2627
+ if (!I.found) {
2628
+ if (!I.anchor && !I.tag && !E && !A) {
2629
+ y === 0 && I.comma ? i(I.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${a}`) : y < n.items.length - 1 && i(I.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${a}`), I.comment && (c.comment ? c.comment += `
2630
+ ` + I.comment : c.comment = I.comment), f = I.end;
2631
2631
  continue;
2632
2632
  }
2633
- !o && t.options.strict && Ne(k) && i(
2634
- k,
2633
+ !o && t.options.strict && Ee(S) && i(
2634
+ S,
2635
2635
  // checked by containsNewline()
2636
2636
  "MULTILINE_IMPLICIT_KEY",
2637
2637
  "Implicit keys of flow sequence pairs need to be on a single line"
2638
2638
  );
2639
2639
  }
2640
2640
  if (y === 0)
2641
- A.comma && i(A.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${a}`);
2642
- else if (A.comma || i(A.start, "MISSING_CHAR", `Missing , between ${a} items`), A.comment) {
2643
- let w = "";
2644
- e: for (const O of S)
2641
+ I.comma && i(I.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${a}`);
2642
+ else if (I.comma || i(I.start, "MISSING_CHAR", `Missing , between ${a} items`), I.comment) {
2643
+ let k = "";
2644
+ e: for (const O of N)
2645
2645
  switch (O.type) {
2646
2646
  case "comma":
2647
2647
  case "space":
2648
2648
  break;
2649
2649
  case "comment":
2650
- w = O.source.substring(1);
2650
+ k = O.source.substring(1);
2651
2651
  break e;
2652
2652
  default:
2653
2653
  break e;
2654
2654
  }
2655
- if (w) {
2655
+ if (k) {
2656
2656
  let O = c.items[c.items.length - 1];
2657
- _(O) && (O = O.value ?? O.key), O.comment ? O.comment += `
2658
- ` + w : O.comment = w, A.comment = A.comment.substring(w.length + 1);
2657
+ v(O) && (O = O.value ?? O.key), O.comment ? O.comment += `
2658
+ ` + k : O.comment = k, I.comment = I.comment.substring(k.length + 1);
2659
2659
  }
2660
2660
  }
2661
- if (!o && !N && !A.found) {
2662
- const w = $ ? s(t, $, A, i) : e(t, A.end, N, null, A, i);
2663
- c.items.push(w), f = w.range[2], tt($) && i(w.range, "BLOCK_IN_FLOW", et);
2661
+ if (!o && !E && !I.found) {
2662
+ const k = A ? s(t, A, I, i) : e(t, I.end, E, null, I, i);
2663
+ c.items.push(k), f = k.range[2], st(A) && i(k.range, "BLOCK_IN_FLOW", tt);
2664
2664
  } else {
2665
2665
  t.atKey = !0;
2666
- const w = A.end, O = k ? s(t, k, A, i) : e(t, w, S, null, A, i);
2667
- tt(k) && i(O.range, "BLOCK_IN_FLOW", et), t.atKey = !1;
2668
- const v = fe(N ?? [], {
2666
+ const k = I.end, O = S ? s(t, S, I, i) : e(t, k, N, null, I, i);
2667
+ st(S) && i(O.range, "BLOCK_IN_FLOW", tt), t.atKey = !1;
2668
+ const P = fe(E ?? [], {
2669
2669
  flow: a,
2670
2670
  indicator: "map-value-ind",
2671
- next: $,
2671
+ next: A,
2672
2672
  offset: O.range[2],
2673
2673
  onError: i,
2674
2674
  parentIndent: n.indent,
2675
2675
  startOnNewline: !1
2676
2676
  });
2677
- if (v.found) {
2678
- if (!o && !A.found && t.options.strict) {
2679
- if (N)
2680
- for (const F of N) {
2681
- if (F === v.found)
2677
+ if (P.found) {
2678
+ if (!o && !I.found && t.options.strict) {
2679
+ if (E)
2680
+ for (const F of E) {
2681
+ if (F === P.found)
2682
2682
  break;
2683
2683
  if (F.type === "newline") {
2684
2684
  i(F, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
2685
2685
  break;
2686
2686
  }
2687
2687
  }
2688
- A.start < v.found.offset - 1024 && i(v.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
2688
+ I.start < P.found.offset - 1024 && i(P.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
2689
2689
  }
2690
- } else $ && ("source" in $ && ((m = $.source) == null ? void 0 : m[0]) === ":" ? i($, "MISSING_CHAR", `Missing space after : in ${a}`) : i(v.start, "MISSING_CHAR", `Missing , or : between ${a} items`));
2691
- const V = $ ? s(t, $, v, i) : v.found ? e(t, v.end, N, null, v, i) : null;
2692
- V ? tt($) && i(V.range, "BLOCK_IN_FLOW", et) : v.comment && (O.comment ? O.comment += `
2693
- ` + v.comment : O.comment = v.comment);
2694
- const R = new M(O, V);
2695
- if (t.options.keepSourceTokens && (R.srcToken = b), o) {
2690
+ } else A && ("source" in A && ((m = A.source) == null ? void 0 : m[0]) === ":" ? i(A, "MISSING_CHAR", `Missing space after : in ${a}`) : i(P.start, "MISSING_CHAR", `Missing , or : between ${a} items`));
2691
+ const J = A ? s(t, A, P, i) : P.found ? e(t, P.end, E, null, P, i) : null;
2692
+ J ? st(A) && i(J.range, "BLOCK_IN_FLOW", tt) : P.comment && (O.comment ? O.comment += `
2693
+ ` + P.comment : O.comment = P.comment);
2694
+ const R = new M(O, J);
2695
+ if (t.options.keepSourceTokens && (R.srcToken = w), o) {
2696
2696
  const F = c;
2697
- Es(t, F.items, O) && i(w, "DUPLICATE_KEY", "Map keys must be unique"), F.items.push(R);
2697
+ Os(t, F.items, O) && i(k, "DUPLICATE_KEY", "Map keys must be unique"), F.items.push(R);
2698
2698
  } else {
2699
- const F = new D(t.schema);
2699
+ const F = new j(t.schema);
2700
2700
  F.flow = !0, F.items.push(R);
2701
- const Ot = (V ?? O).range;
2702
- F.range = [O.range[0], Ot[1], Ot[2]], c.items.push(F);
2701
+ const vt = (J ?? O).range;
2702
+ F.range = [O.range[0], vt[1], vt[2]], c.items.push(F);
2703
2703
  }
2704
- f = V ? V.range[2] : v.end;
2704
+ f = J ? J.range[2] : P.end;
2705
2705
  }
2706
2706
  }
2707
2707
  const h = o ? "}" : "]", [d, ...g] = n.end;
@@ -2709,22 +2709,22 @@ function Ln({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2709
2709
  if ((d == null ? void 0 : d.source) === h)
2710
2710
  u = d.offset + d.source.length;
2711
2711
  else {
2712
- const y = a[0].toUpperCase() + a.substring(1), b = p ? `${y} must end with a ${h}` : `${y} in block collection must be sufficiently indented and end with a ${h}`;
2713
- i(f, p ? "MISSING_CHAR" : "BAD_INDENT", b), d && d.source.length !== 1 && g.unshift(d);
2712
+ const y = a[0].toUpperCase() + a.substring(1), w = p ? `${y} must end with a ${h}` : `${y} in block collection must be sufficiently indented and end with a ${h}`;
2713
+ i(f, p ? "MISSING_CHAR" : "BAD_INDENT", w), d && d.source.length !== 1 && g.unshift(d);
2714
2714
  }
2715
2715
  if (g.length > 0) {
2716
- const y = Te(g, u, t.options.strict, i);
2716
+ const y = Ce(g, u, t.options.strict, i);
2717
2717
  y.comment && (c.comment ? c.comment += `
2718
2718
  ` + y.comment : c.comment = y.comment), c.range = [n.offset, u, y.offset];
2719
2719
  } else
2720
2720
  c.range = [n.offset, u, u];
2721
2721
  return c;
2722
2722
  }
2723
- function st(s, e, t, n, i, r) {
2724
- const o = t.type === "block-map" ? On(s, e, t, n, r) : t.type === "block-seq" ? Tn(s, e, t, n, r) : Ln(s, e, t, n, r), a = o.constructor;
2723
+ function nt(s, e, t, n, i, r) {
2724
+ const o = t.type === "block-map" ? In(s, e, t, n, r) : t.type === "block-seq" ? An(s, e, t, n, r) : On(s, e, t, n, r), a = o.constructor;
2725
2725
  return i === "!" || i === a.tagName ? (o.tag = a.tagName, o) : (i && (o.tag = i), o);
2726
2726
  }
2727
- function Cn(s, e, t, n, i) {
2727
+ function Tn(s, e, t, n, i) {
2728
2728
  var h;
2729
2729
  const r = n.tag, o = r ? e.directives.tagName(r.source, (d) => i(r, "TAG_RESOLVE_FAILED", d)) : null;
2730
2730
  if (t.type === "block-seq") {
@@ -2732,24 +2732,24 @@ function Cn(s, e, t, n, i) {
2732
2732
  u && (!g || g.offset < u.offset) && i(u, "MISSING_CHAR", "Missing newline after block sequence props");
2733
2733
  }
2734
2734
  const a = t.type === "block-map" ? "map" : t.type === "block-seq" ? "seq" : t.start.source === "{" ? "map" : "seq";
2735
- if (!r || !o || o === "!" || o === D.tagName && a === "map" || o === x.tagName && a === "seq")
2736
- return st(s, e, t, i, o);
2735
+ if (!r || !o || o === "!" || o === j.tagName && a === "map" || o === te.tagName && a === "seq")
2736
+ return nt(s, e, t, i, o);
2737
2737
  let l = e.schema.tags.find((d) => d.tag === o && d.collection === a);
2738
2738
  if (!l) {
2739
2739
  const d = e.schema.knownTags[o];
2740
2740
  if ((d == null ? void 0 : d.collection) === a)
2741
2741
  e.schema.tags.push(Object.assign({}, d, { default: !1 })), l = d;
2742
2742
  else
2743
- return d ? i(r, "BAD_COLLECTION_TYPE", `${d.tag} used for ${a} collection, but expects ${d.collection ?? "scalar"}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), st(s, e, t, i, o);
2743
+ return d ? i(r, "BAD_COLLECTION_TYPE", `${d.tag} used for ${a} collection, but expects ${d.collection ?? "scalar"}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), nt(s, e, t, i, o);
2744
2744
  }
2745
- const c = st(s, e, t, i, o, l), p = ((h = l.resolve) == null ? void 0 : h.call(l, c, (d) => i(r, "TAG_RESOLVE_FAILED", d), e.options)) ?? c, f = C(p) ? p : new I(p);
2745
+ const c = nt(s, e, t, i, o, l), p = ((h = l.resolve) == null ? void 0 : h.call(l, c, (d) => i(r, "TAG_RESOLVE_FAILED", d), e.options)) ?? c, f = C(p) ? p : new $(p);
2746
2746
  return f.range = c.range, f.tag = o, l != null && l.format && (f.format = l.format), f;
2747
2747
  }
2748
- function _n(s, e, t) {
2749
- const n = e.offset, i = vn(e, s.options.strict, t);
2748
+ function Ln(s, e, t) {
2749
+ const n = e.offset, i = Cn(e, s.options.strict, t);
2750
2750
  if (!i)
2751
2751
  return { value: "", type: null, comment: "", range: [n, n, n] };
2752
- const r = i.mode === ">" ? I.BLOCK_FOLDED : I.BLOCK_LITERAL, o = e.source ? Pn(e.source) : [];
2752
+ const r = i.mode === ">" ? $.BLOCK_FOLDED : $.BLOCK_LITERAL, o = e.source ? vn(e.source) : [];
2753
2753
  let a = o.length;
2754
2754
  for (let u = o.length - 1; u >= 0; --u) {
2755
2755
  const m = o[u][1];
@@ -2784,12 +2784,12 @@ function _n(s, e, t) {
2784
2784
  for (let u = p; u < a; ++u) {
2785
2785
  let [m, y] = o[u];
2786
2786
  c += m.length + y.length + 1;
2787
- const b = y[y.length - 1] === "\r";
2788
- if (b && (y = y.slice(0, -1)), y && m.length < l) {
2789
- const k = `Block scalar lines must not be less indented than their ${i.indent ? "explicit indentation indicator" : "first line"}`;
2790
- t(c - y.length - (b ? 2 : 1), "BAD_INDENT", k), m = "";
2787
+ const w = y[y.length - 1] === "\r";
2788
+ if (w && (y = y.slice(0, -1)), y && m.length < l) {
2789
+ const S = `Block scalar lines must not be less indented than their ${i.indent ? "explicit indentation indicator" : "first line"}`;
2790
+ t(c - y.length - (w ? 2 : 1), "BAD_INDENT", S), m = "";
2791
2791
  }
2792
- r === I.BLOCK_LITERAL ? (f += h + m.slice(l) + y, h = `
2792
+ r === $.BLOCK_LITERAL ? (f += h + m.slice(l) + y, h = `
2793
2793
  `) : m.length > l || y[0] === " " ? (h === " " ? h = `
2794
2794
  ` : !d && h === `
2795
2795
  ` && (h = `
@@ -2818,7 +2818,7 @@ function _n(s, e, t) {
2818
2818
  const g = n + i.length + e.source.length;
2819
2819
  return { value: f, type: r, comment: i.comment, range: [n, g, g] };
2820
2820
  }
2821
- function vn({ offset: s, props: e }, t, n) {
2821
+ function Cn({ offset: s, props: e }, t, n) {
2822
2822
  if (e[0].type !== "block-scalar-header")
2823
2823
  return n(e[0], "IMPOSSIBLE", "Block scalar header not found"), null;
2824
2824
  const { source: i } = e[0], r = i[0];
@@ -2858,25 +2858,25 @@ function vn({ offset: s, props: e }, t, n) {
2858
2858
  }
2859
2859
  return { mode: r, indent: o, chomp: a, comment: p, length: f };
2860
2860
  }
2861
- function Pn(s) {
2861
+ function vn(s) {
2862
2862
  const e = s.split(/\n( *)/), t = e[0], n = t.match(/^( *)/), r = [n != null && n[1] ? [n[1], t.slice(n[1].length)] : ["", t]];
2863
2863
  for (let o = 1; o < e.length; o += 2)
2864
2864
  r.push([e[o], e[o + 1]]);
2865
2865
  return r;
2866
2866
  }
2867
- function Bn(s, e, t) {
2867
+ function _n(s, e, t) {
2868
2868
  const { offset: n, type: i, source: r, end: o } = s;
2869
2869
  let a, l;
2870
2870
  const c = (h, d, g) => t(n + h, d, g);
2871
2871
  switch (i) {
2872
2872
  case "scalar":
2873
- a = I.PLAIN, l = Mn(r, c);
2873
+ a = $.PLAIN, l = Pn(r, c);
2874
2874
  break;
2875
2875
  case "single-quoted-scalar":
2876
- a = I.QUOTE_SINGLE, l = Dn(r, c);
2876
+ a = $.QUOTE_SINGLE, l = Dn(r, c);
2877
2877
  break;
2878
2878
  case "double-quoted-scalar":
2879
- a = I.QUOTE_DOUBLE, l = jn(r, c);
2879
+ a = $.QUOTE_DOUBLE, l = Mn(r, c);
2880
2880
  break;
2881
2881
  default:
2882
2882
  return t(s, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${i}`), {
@@ -2886,7 +2886,7 @@ function Bn(s, e, t) {
2886
2886
  range: [n, n + r.length, n + r.length]
2887
2887
  };
2888
2888
  }
2889
- const p = n + r.length, f = Te(o, p, e, t);
2889
+ const p = n + r.length, f = Ce(o, p, e, t);
2890
2890
  return {
2891
2891
  value: l,
2892
2892
  type: a,
@@ -2894,7 +2894,7 @@ function Bn(s, e, t) {
2894
2894
  range: [n, p, f.offset]
2895
2895
  };
2896
2896
  }
2897
- function Mn(s, e) {
2897
+ function Pn(s, e) {
2898
2898
  let t = "";
2899
2899
  switch (s[0]) {
2900
2900
  case " ":
@@ -2917,12 +2917,12 @@ function Mn(s, e) {
2917
2917
  break;
2918
2918
  }
2919
2919
  }
2920
- return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`), Is(s);
2920
+ return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`), Ts(s);
2921
2921
  }
2922
2922
  function Dn(s, e) {
2923
- return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"), Is(s.slice(1, -1)).replace(/''/g, "'");
2923
+ return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"), Ts(s.slice(1, -1)).replace(/''/g, "'");
2924
2924
  }
2925
- function Is(s) {
2925
+ function Ts(s) {
2926
2926
  let e, t;
2927
2927
  try {
2928
2928
  e = new RegExp(`(.*?)(?<![ ])[ ]*\r?
@@ -2942,7 +2942,7 @@ function Is(s) {
2942
2942
  const a = /[ \t]*(.*)/sy;
2943
2943
  return a.lastIndex = o, n = a.exec(s), i + r + ((n == null ? void 0 : n[1]) ?? "");
2944
2944
  }
2945
- function jn(s, e) {
2945
+ function Mn(s, e) {
2946
2946
  let t = "";
2947
2947
  for (let n = 1; n < s.length - 1; ++n) {
2948
2948
  const i = s[n];
@@ -2950,11 +2950,11 @@ function jn(s, e) {
2950
2950
  `))
2951
2951
  if (i === `
2952
2952
  `) {
2953
- const { fold: r, offset: o } = Kn(s, n);
2953
+ const { fold: r, offset: o } = jn(s, n);
2954
2954
  t += r, n = o;
2955
2955
  } else if (i === "\\") {
2956
2956
  let r = s[++n];
2957
- const o = Rn[r];
2957
+ const o = Bn[r];
2958
2958
  if (o)
2959
2959
  t += o;
2960
2960
  else if (r === `
@@ -2967,7 +2967,7 @@ function jn(s, e) {
2967
2967
  r = s[++n + 1];
2968
2968
  else if (r === "x" || r === "u" || r === "U") {
2969
2969
  const a = r === "x" ? 2 : r === "u" ? 4 : 8;
2970
- t += Fn(s, n + 1, a, e), n += a;
2970
+ t += Kn(s, n + 1, a, e), n += a;
2971
2971
  } else {
2972
2972
  const a = s.substr(n - 1, 2);
2973
2973
  e(n - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${a}`), t += a;
@@ -2985,7 +2985,7 @@ function jn(s, e) {
2985
2985
  }
2986
2986
  return (s[s.length - 1] !== '"' || s.length === 1) && e(s.length, "MISSING_CHAR", 'Missing closing "quote'), t;
2987
2987
  }
2988
- function Kn(s, e) {
2988
+ function jn(s, e) {
2989
2989
  let t = "", n = s[e + 1];
2990
2990
  for (; (n === " " || n === " " || n === `
2991
2991
  ` || n === "\r") && !(n === "\r" && s[e + 2] !== `
@@ -2995,7 +2995,7 @@ function Kn(s, e) {
2995
2995
  `), e += 1, n = s[e + 1];
2996
2996
  return t || (t = " "), { fold: t, offset: e };
2997
2997
  }
2998
- const Rn = {
2998
+ const Bn = {
2999
2999
  0: "\0",
3000
3000
  // null character
3001
3001
  a: "\x07",
@@ -3029,7 +3029,7 @@ const Rn = {
3029
3029
  "\\": "\\",
3030
3030
  " ": " "
3031
3031
  };
3032
- function Fn(s, e, t, n) {
3032
+ function Kn(s, e, t, n) {
3033
3033
  const i = s.substr(e, t), o = i.length === t && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
3034
3034
  try {
3035
3035
  return String.fromCodePoint(o);
@@ -3038,24 +3038,24 @@ function Fn(s, e, t, n) {
3038
3038
  return n(e - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${a}`), a;
3039
3039
  }
3040
3040
  }
3041
- function As(s, e, t, n) {
3042
- const { value: i, type: r, comment: o, range: a } = e.type === "block-scalar" ? _n(s, e, n) : Bn(e, s.options.strict, n), l = t ? s.directives.tagName(t.source, (f) => n(t, "TAG_RESOLVE_FAILED", f)) : null;
3041
+ function Ls(s, e, t, n) {
3042
+ const { value: i, type: r, comment: o, range: a } = e.type === "block-scalar" ? Ln(s, e, n) : _n(e, s.options.strict, n), l = t ? s.directives.tagName(t.source, (f) => n(t, "TAG_RESOLVE_FAILED", f)) : null;
3043
3043
  let c;
3044
- s.options.stringKeys && s.atKey ? c = s.schema[Y] : l ? c = qn(s.schema, i, l, t, n) : e.type === "scalar" ? c = Un(s, i, e, n) : c = s.schema[Y];
3044
+ s.options.stringKeys && s.atKey ? c = s.schema[V] : l ? c = Rn(s.schema, i, l, t, n) : e.type === "scalar" ? c = Fn(s, i, e, n) : c = s.schema[V];
3045
3045
  let p;
3046
3046
  try {
3047
3047
  const f = c.resolve(i, (h) => n(t ?? e, "TAG_RESOLVE_FAILED", h), s.options);
3048
- p = T(f) ? f : new I(f);
3048
+ p = T(f) ? f : new $(f);
3049
3049
  } catch (f) {
3050
3050
  const h = f instanceof Error ? f.message : String(f);
3051
- n(t ?? e, "TAG_RESOLVE_FAILED", h), p = new I(i);
3051
+ n(t ?? e, "TAG_RESOLVE_FAILED", h), p = new $(i);
3052
3052
  }
3053
3053
  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;
3054
3054
  }
3055
- function qn(s, e, t, n, i) {
3055
+ function Rn(s, e, t, n, i) {
3056
3056
  var a;
3057
3057
  if (t === "!")
3058
- return s[Y];
3058
+ return s[V];
3059
3059
  const r = [];
3060
3060
  for (const l of s.tags)
3061
3061
  if (!l.collection && l.tag === t)
@@ -3067,18 +3067,18 @@ function qn(s, e, t, n, i) {
3067
3067
  if ((a = l.test) != null && a.test(e))
3068
3068
  return l;
3069
3069
  const o = s.knownTags[t];
3070
- return o && !o.collection ? (s.tags.push(Object.assign({}, o, { default: !1, test: void 0 })), o) : (i(n, "TAG_RESOLVE_FAILED", `Unresolved tag: ${t}`, t !== "tag:yaml.org,2002:str"), s[Y]);
3070
+ return o && !o.collection ? (s.tags.push(Object.assign({}, o, { default: !1, test: void 0 })), o) : (i(n, "TAG_RESOLVE_FAILED", `Unresolved tag: ${t}`, t !== "tag:yaml.org,2002:str"), s[V]);
3071
3071
  }
3072
- function Un({ atKey: s, directives: e, schema: t }, n, i, r) {
3072
+ function Fn({ atKey: s, directives: e, schema: t }, n, i, r) {
3073
3073
  const o = t.tags.find((a) => {
3074
3074
  var l;
3075
3075
  return (a.default === !0 || s && a.default === "key") && ((l = a.test) == null ? void 0 : l.test(n));
3076
- }) || t[Y];
3076
+ }) || t[V];
3077
3077
  if (t.compat) {
3078
3078
  const a = t.compat.find((l) => {
3079
3079
  var c;
3080
3080
  return l.default && ((c = l.test) == null ? void 0 : c.test(n));
3081
- }) ?? t[Y];
3081
+ }) ?? t[V];
3082
3082
  if (o.tag !== a.tag) {
3083
3083
  const l = e.tagString(o.tag), c = e.tagString(a.tag), p = `Value may be parsed as either ${l} or ${c}`;
3084
3084
  r(i, "TAG_RESOLVE_FAILED", p, !0);
@@ -3086,7 +3086,7 @@ function Un({ atKey: s, directives: e, schema: t }, n, i, r) {
3086
3086
  }
3087
3087
  return o;
3088
3088
  }
3089
- function Yn(s, e, t) {
3089
+ function qn(s, e, t) {
3090
3090
  if (e) {
3091
3091
  t ?? (t = e.length);
3092
3092
  for (let n = t - 1; n >= 0; --n) {
@@ -3105,25 +3105,25 @@ function Yn(s, e, t) {
3105
3105
  }
3106
3106
  return s;
3107
3107
  }
3108
- const Vn = { composeNode: $s, composeEmptyNode: At };
3109
- function $s(s, e, t, n) {
3108
+ const Un = { composeNode: Cs, composeEmptyNode: It };
3109
+ function Cs(s, e, t, n) {
3110
3110
  const i = s.atKey, { spaceBefore: r, comment: o, anchor: a, tag: l } = t;
3111
3111
  let c, p = !0;
3112
3112
  switch (e.type) {
3113
3113
  case "alias":
3114
- c = Jn(s, e, n), (a || l) && n(e, "ALIAS_PROPS", "An alias node must not specify any properties");
3114
+ c = Yn(s, e, n), (a || l) && n(e, "ALIAS_PROPS", "An alias node must not specify any properties");
3115
3115
  break;
3116
3116
  case "scalar":
3117
3117
  case "single-quoted-scalar":
3118
3118
  case "double-quoted-scalar":
3119
3119
  case "block-scalar":
3120
- c = As(s, e, l, n), a && (c.anchor = a.source.substring(1));
3120
+ c = Ls(s, e, l, n), a && (c.anchor = a.source.substring(1));
3121
3121
  break;
3122
3122
  case "block-map":
3123
3123
  case "block-seq":
3124
3124
  case "flow-collection":
3125
3125
  try {
3126
- c = Cn(Vn, s, e, t, n), a && (c.anchor = a.source.substring(1));
3126
+ c = Tn(Un, s, e, t, n), a && (c.anchor = a.source.substring(1));
3127
3127
  } catch (f) {
3128
3128
  const h = f instanceof Error ? f.message : String(f);
3129
3129
  n(e, "RESOURCE_EXHAUSTION", h);
@@ -3134,25 +3134,25 @@ function $s(s, e, t, n) {
3134
3134
  n(e, "UNEXPECTED_TOKEN", f), p = !1;
3135
3135
  }
3136
3136
  }
3137
- return c ?? (c = At(s, e.offset, void 0, null, t, n)), a && c.anchor === "" && n(a, "BAD_ALIAS", "Anchor cannot be an empty string"), i && s.options.stringKeys && (!T(c) || typeof c.value != "string" || c.tag && c.tag !== "tag:yaml.org,2002:str") && n(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), s.options.keepSourceTokens && p && (c.srcToken = e), c;
3137
+ return c ?? (c = It(s, e.offset, void 0, null, t, n)), a && c.anchor === "" && n(a, "BAD_ALIAS", "Anchor cannot be an empty string"), i && s.options.stringKeys && (!T(c) || typeof c.value != "string" || c.tag && c.tag !== "tag:yaml.org,2002:str") && n(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), s.options.keepSourceTokens && p && (c.srcToken = e), c;
3138
3138
  }
3139
- function At(s, e, t, n, { spaceBefore: i, comment: r, anchor: o, tag: a, end: l }, c) {
3139
+ function It(s, e, t, n, { spaceBefore: i, comment: r, anchor: o, tag: a, end: l }, c) {
3140
3140
  const p = {
3141
3141
  type: "scalar",
3142
- offset: Yn(e, t, n),
3142
+ offset: qn(e, t, n),
3143
3143
  indent: -1,
3144
3144
  source: ""
3145
- }, f = As(s, p, a, c);
3145
+ }, f = Ls(s, p, a, c);
3146
3146
  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;
3147
3147
  }
3148
- function Jn({ options: s }, { offset: e, source: t, end: n }, i) {
3148
+ function Yn({ options: s }, { offset: e, source: t, end: n }, i) {
3149
3149
  const r = new dt(t.substring(1));
3150
3150
  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);
3151
- const o = e + t.length, a = Te(n, o, s.strict, i);
3151
+ const o = e + t.length, a = Ce(n, o, s.strict, i);
3152
3152
  return r.range = [e, o, a.offset], a.comment && (r.comment = a.comment), r;
3153
3153
  }
3154
- function Gn(s, e, { offset: t, start: n, value: i, end: r }, o) {
3155
- const a = Object.assign({ _directives: e }, s), l = new Oe(void 0, a), c = {
3154
+ function Vn(s, e, { offset: t, start: n, value: i, end: r }, o) {
3155
+ const a = Object.assign({ _directives: e }, s), l = new Le(void 0, a), c = {
3156
3156
  atKey: !1,
3157
3157
  atRoot: !0,
3158
3158
  directives: l.directives,
@@ -3166,8 +3166,8 @@ function Gn(s, e, { offset: t, start: n, value: i, end: r }, o) {
3166
3166
  parentIndent: 0,
3167
3167
  startOnNewline: !0
3168
3168
  });
3169
- 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 ? $s(c, i, p, o) : At(c, p.end, n, null, p, o);
3170
- const f = l.contents.range[2], h = Te(r, f, !1, o);
3169
+ 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 ? Cs(c, i, p, o) : It(c, p.end, n, null, p, o);
3170
+ const f = l.contents.range[2], h = Ce(r, f, !1, o);
3171
3171
  return h.comment && (l.comment = h.comment), l.range = [t, f, h.offset], l;
3172
3172
  }
3173
3173
  function ge(s) {
@@ -3178,7 +3178,7 @@ function ge(s) {
3178
3178
  const { offset: e, source: t } = s;
3179
3179
  return [e, e + (typeof t == "string" ? t.length : 1)];
3180
3180
  }
3181
- function Dt(s) {
3181
+ function Ft(s) {
3182
3182
  var i;
3183
3183
  let e = "", t = !1, n = !1;
3184
3184
  for (let r = 0; r < s.length; ++r) {
@@ -3199,15 +3199,15 @@ function Dt(s) {
3199
3199
  }
3200
3200
  return { comment: e, afterEmptyLine: n };
3201
3201
  }
3202
- class Hn {
3202
+ class Jn {
3203
3203
  constructor(e = {}) {
3204
3204
  this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (t, n, i, r) => {
3205
3205
  const o = ge(t);
3206
3206
  r ? this.warnings.push(new $n(o, n, i)) : this.errors.push(new be(o, n, i));
3207
- }, this.directives = new B({ version: e.version || "1.2" }), this.options = e;
3207
+ }, this.directives = new D({ version: e.version || "1.2" }), this.options = e;
3208
3208
  }
3209
3209
  decorate(e, t) {
3210
- const { comment: n, afterEmptyLine: i } = Dt(this.prelude);
3210
+ const { comment: n, afterEmptyLine: i } = Ft(this.prelude);
3211
3211
  if (n) {
3212
3212
  const r = e.contents;
3213
3213
  if (t)
@@ -3217,7 +3217,7 @@ ${n}` : n;
3217
3217
  e.commentBefore = n;
3218
3218
  else if (L(r) && !r.flow && r.items.length > 0) {
3219
3219
  let o = r.items[0];
3220
- _(o) && (o = o.key);
3220
+ v(o) && (o = o.key);
3221
3221
  const a = o.commentBefore;
3222
3222
  o.commentBefore = a ? `${n}
3223
3223
  ${a}` : n;
@@ -3243,7 +3243,7 @@ ${o}` : n;
3243
3243
  */
3244
3244
  streamInfo() {
3245
3245
  return {
3246
- comment: Dt(this.prelude).comment,
3246
+ comment: Ft(this.prelude).comment,
3247
3247
  directives: this.directives,
3248
3248
  errors: this.errors,
3249
3249
  warnings: this.warnings
@@ -3270,7 +3270,7 @@ ${o}` : n;
3270
3270
  }), this.prelude.push(e.source), this.atDirectives = !0;
3271
3271
  break;
3272
3272
  case "document": {
3273
- const t = Gn(this.options, this.directives, e, this.onError);
3273
+ const t = Vn(this.options, this.directives, e, this.onError);
3274
3274
  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;
3275
3275
  break;
3276
3276
  }
@@ -3293,7 +3293,7 @@ ${o}` : n;
3293
3293
  break;
3294
3294
  }
3295
3295
  this.doc.directives.docEnd = !0;
3296
- const t = Te(e.end, e.offset + e.source.length, this.doc.options.strict, this.onError);
3296
+ const t = Ce(e.end, e.offset + e.source.length, this.doc.options.strict, this.onError);
3297
3297
  if (this.decorate(this.doc, !0), t.comment) {
3298
3298
  const n = this.doc.comment;
3299
3299
  this.doc.comment = n ? `${n}
@@ -3316,21 +3316,21 @@ ${t.comment}` : t.comment;
3316
3316
  if (this.doc)
3317
3317
  this.decorate(this.doc, !0), yield this.doc, this.doc = null;
3318
3318
  else if (e) {
3319
- const n = Object.assign({ _directives: this.directives }, this.options), i = new Oe(void 0, n);
3319
+ const n = Object.assign({ _directives: this.directives }, this.options), i = new Le(void 0, n);
3320
3320
  this.atDirectives && this.onError(t, "MISSING_CHAR", "Missing directives-end indicator line"), i.range = [0, t, t], this.decorate(i, !1), yield i;
3321
3321
  }
3322
3322
  }
3323
3323
  }
3324
- const Os = "\uFEFF", Ts = "", Ls = "", ct = "";
3325
- function Wn(s) {
3324
+ const vs = "\uFEFF", _s = "", Ps = "", ft = "";
3325
+ function Hn(s) {
3326
3326
  switch (s) {
3327
- case Os:
3327
+ case vs:
3328
3328
  return "byte-order-mark";
3329
- case Ts:
3329
+ case _s:
3330
3330
  return "doc-mode";
3331
- case Ls:
3331
+ case Ps:
3332
3332
  return "flow-error-end";
3333
- case ct:
3333
+ case ft:
3334
3334
  return "scalar";
3335
3335
  case "---":
3336
3336
  return "doc-start";
@@ -3396,9 +3396,9 @@ function q(s) {
3396
3396
  return !1;
3397
3397
  }
3398
3398
  }
3399
- const jt = new Set("0123456789ABCDEFabcdef"), Qn = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), ve = new Set(",[]{}"), Xn = new Set(` ,[]{}
3400
- \r `), nt = (s) => !s || Xn.has(s);
3401
- class zn {
3399
+ const qt = new Set("0123456789ABCDEFabcdef"), Gn = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), De = new Set(",[]{}"), Wn = new Set(` ,[]{}
3400
+ \r `), it = (s) => !s || Wn.has(s);
3401
+ class Qn {
3402
3402
  constructor() {
3403
3403
  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;
3404
3404
  }
@@ -3490,7 +3490,7 @@ class zn {
3490
3490
  let e = this.getLine();
3491
3491
  if (e === null)
3492
3492
  return this.setNext("stream");
3493
- if (e[0] === Os && (yield* this.pushCount(1), e = e.substring(1)), e[0] === "%") {
3493
+ if (e[0] === vs && (yield* this.pushCount(1), e = e.substring(1)), e[0] === "%") {
3494
3494
  let t = e.length, n = e.indexOf("#");
3495
3495
  for (; n !== -1; ) {
3496
3496
  const r = e[n - 1];
@@ -3514,7 +3514,7 @@ class zn {
3514
3514
  const t = yield* this.pushSpaces(!0);
3515
3515
  return yield* this.pushCount(e.length - t), yield* this.pushNewline(), "stream";
3516
3516
  }
3517
- return yield Ts, yield* this.parseLineStart();
3517
+ return yield _s, yield* this.parseLineStart();
3518
3518
  }
3519
3519
  *parseLineStart() {
3520
3520
  const e = this.charAt(0);
@@ -3557,7 +3557,7 @@ class zn {
3557
3557
  case "]":
3558
3558
  return yield* this.pushCount(1), "doc";
3559
3559
  case "*":
3560
- return yield* this.pushUntil(nt), "doc";
3560
+ return yield* this.pushUntil(it), "doc";
3561
3561
  case '"':
3562
3562
  case "'":
3563
3563
  return yield* this.parseQuotedScalar();
@@ -3577,7 +3577,7 @@ class zn {
3577
3577
  if (i === null)
3578
3578
  return this.setNext("flow");
3579
3579
  if ((n !== -1 && n < this.indentNext && i[0] !== "#" || n === 0 && (i.startsWith("---") || i.startsWith("...")) && q(i[3])) && !(n === this.indentNext - 1 && this.flowLevel === 1 && (i[0] === "]" || i[0] === "}")))
3580
- return this.flowLevel = 0, yield Ls, yield* this.parseLineStart();
3580
+ return this.flowLevel = 0, yield Ps, yield* this.parseLineStart();
3581
3581
  let r = 0;
3582
3582
  for (; i[r] === ","; )
3583
3583
  r += yield* this.pushCount(1), r += yield* this.pushSpaces(!0), this.flowKey = !1;
@@ -3593,7 +3593,7 @@ class zn {
3593
3593
  case "]":
3594
3594
  return yield* this.pushCount(1), this.flowKey = !0, this.flowLevel -= 1, this.flowLevel ? "flow" : "doc";
3595
3595
  case "*":
3596
- return yield* this.pushUntil(nt), "flow";
3596
+ return yield* this.pushUntil(it), "flow";
3597
3597
  case '"':
3598
3598
  case "'":
3599
3599
  return this.flowKey = !0, yield* this.parseQuotedScalar();
@@ -3715,7 +3715,7 @@ class zn {
3715
3715
  else
3716
3716
  break;
3717
3717
  } while (!0);
3718
- return yield ct, yield* this.pushToIndex(e + 1, !0), yield* this.parseLineStart();
3718
+ return yield ft, yield* this.pushToIndex(e + 1, !0), yield* this.parseLineStart();
3719
3719
  }
3720
3720
  *parsePlainScalar() {
3721
3721
  const e = this.flowLevel > 0;
@@ -3723,14 +3723,14 @@ class zn {
3723
3723
  for (; i = this.buffer[++n]; )
3724
3724
  if (i === ":") {
3725
3725
  const r = this.buffer[n + 1];
3726
- if (q(r) || e && ve.has(r))
3726
+ if (q(r) || e && De.has(r))
3727
3727
  break;
3728
3728
  t = n;
3729
3729
  } else if (q(i)) {
3730
3730
  let r = this.buffer[n + 1];
3731
3731
  if (i === "\r" && (r === `
3732
3732
  ` ? (n += 1, i = `
3733
- `, r = this.buffer[n + 1]) : t = n), r === "#" || e && ve.has(r))
3733
+ `, r = this.buffer[n + 1]) : t = n), r === "#" || e && De.has(r))
3734
3734
  break;
3735
3735
  if (i === `
3736
3736
  `) {
@@ -3740,11 +3740,11 @@ class zn {
3740
3740
  n = Math.max(n, o - 2);
3741
3741
  }
3742
3742
  } else {
3743
- if (e && ve.has(i))
3743
+ if (e && De.has(i))
3744
3744
  break;
3745
3745
  t = n;
3746
3746
  }
3747
- return !i && !this.atEnd ? this.setNext("plain-scalar") : (yield ct, yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
3747
+ return !i && !this.atEnd ? this.setNext("plain-scalar") : (yield ft, yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
3748
3748
  }
3749
3749
  *pushCount(e) {
3750
3750
  return e > 0 ? (yield this.buffer.substr(this.pos, e), this.pos += e, e) : 0;
@@ -3761,13 +3761,13 @@ class zn {
3761
3761
  e += yield* this.pushTag(), e += yield* this.pushSpaces(!0);
3762
3762
  continue e;
3763
3763
  case "&":
3764
- e += yield* this.pushUntil(nt), e += yield* this.pushSpaces(!0);
3764
+ e += yield* this.pushUntil(it), e += yield* this.pushSpaces(!0);
3765
3765
  continue e;
3766
3766
  case "-":
3767
3767
  case "?":
3768
3768
  case ":": {
3769
3769
  const t = this.flowLevel > 0, n = this.charAt(1);
3770
- if (q(n) || t && ve.has(n)) {
3770
+ if (q(n) || t && De.has(n)) {
3771
3771
  t ? this.flowKey && (this.flowKey = !1) : this.indentNext = this.indentValue + 1, e += yield* this.pushCount(1), e += yield* this.pushSpaces(!0);
3772
3772
  continue e;
3773
3773
  }
@@ -3786,9 +3786,9 @@ class zn {
3786
3786
  } else {
3787
3787
  let e = this.pos + 1, t = this.buffer[e];
3788
3788
  for (; t; )
3789
- if (Qn.has(t))
3789
+ if (Gn.has(t))
3790
3790
  t = this.buffer[++e];
3791
- else if (t === "%" && jt.has(this.buffer[e + 1]) && jt.has(this.buffer[e + 2]))
3791
+ else if (t === "%" && qt.has(this.buffer[e + 1]) && qt.has(this.buffer[e + 2]))
3792
3792
  t = this.buffer[e += 3];
3793
3793
  else
3794
3794
  break;
@@ -3816,7 +3816,7 @@ class zn {
3816
3816
  return yield* this.pushToIndex(t, !1);
3817
3817
  }
3818
3818
  }
3819
- class Zn {
3819
+ class Xn {
3820
3820
  constructor() {
3821
3821
  this.lineStarts = [], this.addNewLine = (e) => this.lineStarts.push(e), this.linePos = (e) => {
3822
3822
  let t = 0, n = this.lineStarts.length;
@@ -3833,13 +3833,13 @@ class Zn {
3833
3833
  };
3834
3834
  }
3835
3835
  }
3836
- function H(s, e) {
3836
+ function Q(s, e) {
3837
3837
  for (let t = 0; t < s.length; ++t)
3838
3838
  if (s[t].type === e)
3839
3839
  return !0;
3840
3840
  return !1;
3841
3841
  }
3842
- function Kt(s) {
3842
+ function Ut(s) {
3843
3843
  for (let e = 0; e < s.length; ++e)
3844
3844
  switch (s[e].type) {
3845
3845
  case "space":
@@ -3851,7 +3851,7 @@ function Kt(s) {
3851
3851
  }
3852
3852
  return -1;
3853
3853
  }
3854
- function Cs(s) {
3854
+ function Ds(s) {
3855
3855
  switch (s == null ? void 0 : s.type) {
3856
3856
  case "alias":
3857
3857
  case "scalar":
@@ -3863,7 +3863,7 @@ function Cs(s) {
3863
3863
  return !1;
3864
3864
  }
3865
3865
  }
3866
- function Pe(s) {
3866
+ function Me(s) {
3867
3867
  switch (s.type) {
3868
3868
  case "document":
3869
3869
  return s.start;
@@ -3877,7 +3877,7 @@ function Pe(s) {
3877
3877
  return [];
3878
3878
  }
3879
3879
  }
3880
- function te(s) {
3880
+ function ne(s) {
3881
3881
  var t;
3882
3882
  if (s.length === 0)
3883
3883
  return [];
@@ -3895,25 +3895,25 @@ function te(s) {
3895
3895
  ;
3896
3896
  return s.splice(e, s.length);
3897
3897
  }
3898
- function qe(s, e) {
3898
+ function Ue(s, e) {
3899
3899
  if (e.length < 1e5)
3900
3900
  Array.prototype.push.apply(s, e);
3901
3901
  else
3902
3902
  for (let t = 0; t < e.length; ++t)
3903
3903
  s.push(e[t]);
3904
3904
  }
3905
- function Rt(s) {
3905
+ function Yt(s) {
3906
3906
  if (s.start.type === "flow-seq-start")
3907
3907
  for (const e of s.items)
3908
- e.sep && !e.value && !H(e.start, "explicit-key-ind") && !H(e.sep, "map-value-ind") && (e.key && (e.value = e.key), delete e.key, Cs(e.value) ? e.value.end ? qe(e.value.end, e.sep) : e.value.end = e.sep : qe(e.start, e.sep), delete e.sep);
3908
+ e.sep && !e.value && !Q(e.start, "explicit-key-ind") && !Q(e.sep, "map-value-ind") && (e.key && (e.value = e.key), delete e.key, Ds(e.value) ? e.value.end ? Ue(e.value.end, e.sep) : e.value.end = e.sep : Ue(e.start, e.sep), delete e.sep);
3909
3909
  }
3910
- class xn {
3910
+ class zn {
3911
3911
  /**
3912
3912
  * @param onNewLine - If defined, called separately with the start position of
3913
3913
  * each new line (in `parse()`, including the start of input).
3914
3914
  */
3915
3915
  constructor(e) {
3916
- this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new zn(), this.onNewLine = e;
3916
+ this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new Qn(), this.onNewLine = e;
3917
3917
  }
3918
3918
  /**
3919
3919
  * Parse `source` as a YAML stream.
@@ -3937,7 +3937,7 @@ class xn {
3937
3937
  this.atScalar = !1, yield* this.step(), this.offset += e.length;
3938
3938
  return;
3939
3939
  }
3940
- const t = Wn(e);
3940
+ const t = Hn(e);
3941
3941
  if (t)
3942
3942
  if (t === "scalar")
3943
3943
  this.atNewLine = !1, this.atScalar = !0, this.type = "scalar";
@@ -4026,7 +4026,7 @@ class xn {
4026
4026
  yield t;
4027
4027
  else {
4028
4028
  const n = this.peek(1);
4029
- switch (t.type === "block-scalar" ? t.indent = "indent" in n ? n.indent : 0 : t.type === "flow-collection" && n.type === "document" && (t.indent = 0), t.type === "flow-collection" && Rt(t), n.type) {
4029
+ switch (t.type === "block-scalar" ? t.indent = "indent" in n ? n.indent : 0 : t.type === "flow-collection" && n.type === "document" && (t.indent = 0), t.type === "flow-collection" && Yt(t), n.type) {
4030
4030
  case "document":
4031
4031
  n.value = t;
4032
4032
  break;
@@ -4061,7 +4061,7 @@ class xn {
4061
4061
  }
4062
4062
  if ((n.type === "document" || n.type === "block-map" || n.type === "block-seq") && (t.type === "block-map" || t.type === "block-seq")) {
4063
4063
  const i = t.items[t.items.length - 1];
4064
- i && !i.sep && !i.value && i.start.length > 0 && Kt(i.start) === -1 && (t.indent === 0 || i.start.every((r) => r.type !== "comment" || r.indent < t.indent)) && (n.type === "document" ? n.end = i.start : n.items.push({ start: i.start }), t.items.splice(-1, 1));
4064
+ i && !i.sep && !i.value && i.start.length > 0 && Ut(i.start) === -1 && (t.indent === 0 || i.start.every((r) => r.type !== "comment" || r.indent < t.indent)) && (n.type === "document" ? n.end = i.start : n.items.push({ start: i.start }), t.items.splice(-1, 1));
4065
4065
  }
4066
4066
  }
4067
4067
  }
@@ -4099,7 +4099,7 @@ class xn {
4099
4099
  return yield* this.lineEnd(e);
4100
4100
  switch (this.type) {
4101
4101
  case "doc-start": {
4102
- Kt(e.start) !== -1 ? (yield* this.pop(), yield* this.step()) : e.start.push(this.sourceToken);
4102
+ Ut(e.start) !== -1 ? (yield* this.pop(), yield* this.step()) : e.start.push(this.sourceToken);
4103
4103
  return;
4104
4104
  }
4105
4105
  case "anchor":
@@ -4120,7 +4120,7 @@ class xn {
4120
4120
  }
4121
4121
  *scalar(e) {
4122
4122
  if (this.type === "map-value-ind") {
4123
- const t = Pe(this.peek(2)), n = te(t);
4123
+ const t = Me(this.peek(2)), n = ne(t);
4124
4124
  let i;
4125
4125
  e.end ? (i = e.end, i.push(this.sourceToken), delete e.end) : i = [this.sourceToken];
4126
4126
  const r = {
@@ -4174,7 +4174,7 @@ class xn {
4174
4174
  if (this.atIndentedComment(t.start, e.indent)) {
4175
4175
  const i = e.items[e.items.length - 2], r = (n = i == null ? void 0 : i.value) == null ? void 0 : n.end;
4176
4176
  if (Array.isArray(r)) {
4177
- qe(r, t.start), r.push(this.sourceToken), e.items.pop();
4177
+ Ue(r, t.start), r.push(this.sourceToken), e.items.pop();
4178
4178
  return;
4179
4179
  }
4180
4180
  }
@@ -4222,15 +4222,15 @@ class xn {
4222
4222
  if (t.sep)
4223
4223
  if (t.value)
4224
4224
  e.items.push({ start: [], key: null, sep: [this.sourceToken] });
4225
- else if (H(t.sep, "map-value-ind"))
4225
+ else if (Q(t.sep, "map-value-ind"))
4226
4226
  this.stack.push({
4227
4227
  type: "block-map",
4228
4228
  offset: this.offset,
4229
4229
  indent: this.indent,
4230
4230
  items: [{ start: o, key: null, sep: [this.sourceToken] }]
4231
4231
  });
4232
- else if (Cs(t.key) && !H(t.sep, "newline")) {
4233
- const a = te(t.start), l = t.key, c = t.sep;
4232
+ else if (Ds(t.key) && !Q(t.sep, "newline")) {
4233
+ const a = ne(t.start), l = t.key, c = t.sep;
4234
4234
  c.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
4235
4235
  type: "block-map",
4236
4236
  offset: this.offset,
@@ -4238,10 +4238,10 @@ class xn {
4238
4238
  items: [{ start: a, key: l, sep: c }]
4239
4239
  });
4240
4240
  } else o.length > 0 ? t.sep = t.sep.concat(o, this.sourceToken) : t.sep.push(this.sourceToken);
4241
- else if (H(t.start, "newline"))
4241
+ else if (Q(t.start, "newline"))
4242
4242
  Object.assign(t, { key: null, sep: [this.sourceToken] });
4243
4243
  else {
4244
- const a = te(t.start);
4244
+ const a = ne(t.start);
4245
4245
  this.stack.push({
4246
4246
  type: "block-map",
4247
4247
  offset: this.offset,
@@ -4250,7 +4250,7 @@ class xn {
4250
4250
  });
4251
4251
  }
4252
4252
  else
4253
- t.sep ? t.value || r ? e.items.push({ start: o, key: null, sep: [this.sourceToken] }) : H(t.sep, "map-value-ind") ? this.stack.push({
4253
+ t.sep ? t.value || r ? e.items.push({ start: o, key: null, sep: [this.sourceToken] }) : Q(t.sep, "map-value-ind") ? this.stack.push({
4254
4254
  type: "block-map",
4255
4255
  offset: this.offset,
4256
4256
  indent: this.indent,
@@ -4270,7 +4270,7 @@ class xn {
4270
4270
  const a = this.startBlockValue(e);
4271
4271
  if (a) {
4272
4272
  if (a.type === "block-seq") {
4273
- if (!t.explicitKey && t.sep && !H(t.sep, "newline")) {
4273
+ if (!t.explicitKey && t.sep && !Q(t.sep, "newline")) {
4274
4274
  yield* this.pop({
4275
4275
  type: "error",
4276
4276
  offset: this.offset,
@@ -4307,7 +4307,7 @@ class xn {
4307
4307
  if (this.atIndentedComment(t.start, e.indent)) {
4308
4308
  const i = e.items[e.items.length - 2], r = (n = i == null ? void 0 : i.value) == null ? void 0 : n.end;
4309
4309
  if (Array.isArray(r)) {
4310
- qe(r, t.start), r.push(this.sourceToken), e.items.pop();
4310
+ Ue(r, t.start), r.push(this.sourceToken), e.items.pop();
4311
4311
  return;
4312
4312
  }
4313
4313
  }
@@ -4323,7 +4323,7 @@ class xn {
4323
4323
  case "seq-item-ind":
4324
4324
  if (this.indent !== e.indent)
4325
4325
  break;
4326
- t.value || H(t.start, "seq-item-ind") ? e.items.push({ start: [this.sourceToken] }) : t.start.push(this.sourceToken);
4326
+ t.value || Q(t.start, "seq-item-ind") ? e.items.push({ start: [this.sourceToken] }) : t.start.push(this.sourceToken);
4327
4327
  return;
4328
4328
  }
4329
4329
  if (this.indent > e.indent) {
@@ -4378,8 +4378,8 @@ class xn {
4378
4378
  if (n.type === "block-map" && (this.type === "map-value-ind" && n.indent === e.indent || this.type === "newline" && !n.items[n.items.length - 1].sep))
4379
4379
  yield* this.pop(), yield* this.step();
4380
4380
  else if (this.type === "map-value-ind" && n.type !== "flow-collection") {
4381
- const i = Pe(n), r = te(i);
4382
- Rt(e);
4381
+ const i = Me(n), r = ne(i);
4382
+ Yt(e);
4383
4383
  const o = e.end.splice(1, e.end.length);
4384
4384
  o.push(this.sourceToken);
4385
4385
  const a = {
@@ -4442,7 +4442,7 @@ class xn {
4442
4442
  };
4443
4443
  case "explicit-key-ind": {
4444
4444
  this.onKeyLine = !0;
4445
- const t = Pe(e), n = te(t);
4445
+ const t = Me(e), n = ne(t);
4446
4446
  return n.push(this.sourceToken), {
4447
4447
  type: "block-map",
4448
4448
  offset: this.offset,
@@ -4452,7 +4452,7 @@ class xn {
4452
4452
  }
4453
4453
  case "map-value-ind": {
4454
4454
  this.onKeyLine = !0;
4455
- const t = Pe(e), n = te(t);
4455
+ const t = Me(e), n = ne(t);
4456
4456
  return {
4457
4457
  type: "block-map",
4458
4458
  offset: this.offset,
@@ -4488,12 +4488,12 @@ class xn {
4488
4488
  }
4489
4489
  }
4490
4490
  }
4491
- function ei(s) {
4491
+ function xn(s) {
4492
4492
  const e = s.prettyErrors !== !1;
4493
- return { lineCounter: s.lineCounter || e && new Zn() || null, prettyErrors: e };
4493
+ return { lineCounter: s.lineCounter || e && new Xn() || null, prettyErrors: e };
4494
4494
  }
4495
- function ti(s, e = {}) {
4496
- const { lineCounter: t, prettyErrors: n } = ei(e), i = new xn(t == null ? void 0 : t.addNewLine), r = new Hn(e);
4495
+ function Zn(s, e = {}) {
4496
+ const { lineCounter: t, prettyErrors: n } = xn(e), i = new zn(t == null ? void 0 : t.addNewLine), r = new Jn(e);
4497
4497
  let o = null;
4498
4498
  for (const a of r.compose(i.parse(s), !0, s.length))
4499
4499
  if (!o)
@@ -4502,94 +4502,128 @@ function ti(s, e = {}) {
4502
4502
  o.errors.push(new be(a.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
4503
4503
  break;
4504
4504
  }
4505
- return n && t && (o.errors.forEach(Bt(s, t)), o.warnings.forEach(Bt(s, t))), o;
4505
+ return n && t && (o.errors.forEach(Kt(s, t)), o.warnings.forEach(Kt(s, t))), o;
4506
4506
  }
4507
- function si(s, e, t) {
4507
+ function ei(s, e, t) {
4508
4508
  let n;
4509
- const i = ti(s, t);
4509
+ const i = Zn(s, t);
4510
4510
  if (!i)
4511
4511
  return null;
4512
- if (i.warnings.forEach((r) => ss(i.options.logLevel, r)), i.errors.length > 0) {
4512
+ if (i.warnings.forEach((r) => os(i.options.logLevel, r)), i.errors.length > 0) {
4513
4513
  if (i.options.logLevel !== "silent")
4514
4514
  throw i.errors[0];
4515
4515
  i.errors = [];
4516
4516
  }
4517
4517
  return i.toJS(Object.assign({ reviver: n }, t));
4518
4518
  }
4519
- function ni(s, e, t) {
4519
+ function ti(s, e, t) {
4520
4520
  let n = null;
4521
4521
  if (Array.isArray(e) && (n = e), s === void 0) {
4522
4522
  const { keepUndefined: i } = {};
4523
4523
  if (!i)
4524
4524
  return;
4525
4525
  }
4526
- return Ee(s) && !n ? s.toString(t) : new Oe(s, n, t).toString(t);
4526
+ return Ie(s) && !n ? s.toString(t) : new Le(s, n, t).toString(t);
4527
4527
  }
4528
- const Be = E.preprocess(
4528
+ const je = b.preprocess(
4529
4529
  (s) => typeof s == "string" ? { agent: s } : s,
4530
- E.object({
4531
- agent: E.enum(Ue),
4532
- model: E.string().optional(),
4533
- effort: E.string().optional()
4530
+ b.object({
4531
+ agent: b.enum($e),
4532
+ model: b.string().optional(),
4533
+ effort: b.string().optional()
4534
4534
  })
4535
- ), Z = E.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected YYYY-MM-DD"), ii = E.object({
4536
- status: E.enum(["idea", "planned", "in-progress", "review", "done", "dropped"]),
4537
- kind: E.enum(["feat", "fix", "chore", "docs", "refactor"]).optional(),
4538
- id: E.string().optional(),
4539
- idea: E.string().optional(),
4540
- agent: E.enum(Ue).optional(),
4541
- created: Z,
4542
- updated: Z.optional(),
4543
- tags: E.string().optional()
4544
- }), ri = E.object({
4545
- date: Z,
4546
- status: E.enum(["decided", "superseded"]),
4547
- "superseded-by": E.string().optional()
4548
- }), oi = E.object({
4549
- status: E.enum(["open", "resolved"]),
4550
- raised: Z,
4551
- "resolved-by": E.string().optional(),
4552
- blocks: E.string().optional()
4553
- }), ai = E.object({
4554
- id: E.string().describe("Permanent plan ID, e.g. FEAT-24"),
4555
- title: E.string().describe('Human-readable plan name, e.g. "Plan storage architecture"'),
4556
- kind: E.enum(["feat", "fix", "chore", "docs", "refactor"]).describe("Plan kind matching Conventional Commits types"),
4557
- status: E.enum(["idea", "planned", "in-progress", "review", "done", "dropped"]).describe("Current lifecycle status"),
4558
- idea: E.string().optional().describe("IDEA-N backlink if this plan grew out of an idea"),
4559
- agent: E.enum(Ue).optional().describe("Per-plan agent override"),
4560
- created: Z.describe("Creation date (YYYY-MM-DD)"),
4561
- updated: Z.optional().describe("Last significant update date (YYYY-MM-DD)"),
4562
- audited: Z.optional().describe("Date of last successful convergence audit (YYYY-MM-DD)"),
4563
- tags: E.array(E.string()).optional().describe("Tagging categories")
4564
- }), li = E.object({
4565
- id: E.string().describe("Permanent idea ID, e.g. IDEA-20"),
4566
- title: E.string().describe("Short idea headline (3-6 words)")
4567
- }), ci = E.object({
4568
- version: E.string(),
4569
- projectName: E.string(),
4570
- initializedAt: E.string(),
4571
- nextId: E.object({
4572
- feat: E.number(),
4573
- fix: E.number(),
4574
- chore: E.number(),
4575
- docs: E.number(),
4576
- refactor: E.number()
4535
+ ), Y = b.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected YYYY-MM-DD"), si = b.object({
4536
+ status: b.enum(["idea", "planned", "in-progress", "review", "done", "dropped"]),
4537
+ kind: b.enum(["feat", "fix", "chore", "docs", "refactor"]).optional(),
4538
+ id: b.string().optional(),
4539
+ idea: b.string().optional(),
4540
+ agent: b.enum($e).optional(),
4541
+ created: Y,
4542
+ updated: Y.optional(),
4543
+ tags: b.string().optional()
4544
+ }), ni = b.object({
4545
+ date: Y,
4546
+ status: b.enum(["decided", "superseded"]),
4547
+ "superseded-by": b.string().optional()
4548
+ }), ii = b.object({
4549
+ status: b.enum(["open", "resolved"]),
4550
+ raised: Y,
4551
+ "resolved-by": b.string().optional(),
4552
+ blocks: b.string().optional()
4553
+ }), ri = b.object({
4554
+ id: b.string().describe("Permanent plan ID, e.g. FEAT-24"),
4555
+ title: b.string().describe('Human-readable plan name, e.g. "Plan storage architecture"'),
4556
+ kind: b.enum(["feat", "fix", "chore", "docs", "refactor"]).describe("Plan kind matching Conventional Commits types"),
4557
+ status: b.enum(["idea", "planned", "in-progress", "review", "done", "dropped"]).describe("Current lifecycle status"),
4558
+ idea: b.string().optional().describe("IDEA-N backlink if this plan grew out of an idea"),
4559
+ agent: b.enum($e).optional().describe("Per-plan agent override"),
4560
+ created: Y.describe("Creation date (YYYY-MM-DD)"),
4561
+ updated: Y.optional().describe("Last significant update date (YYYY-MM-DD)"),
4562
+ audited: Y.optional().describe("Date of last successful convergence audit (YYYY-MM-DD)"),
4563
+ "audited-hash": b.string().optional().describe("Content hash of the plan at last audit, used to detect edits regardless of mtime"),
4564
+ tags: b.array(b.string()).optional().describe("Tagging categories")
4565
+ }), oi = b.object({
4566
+ id: b.string().describe("Permanent idea ID, e.g. IDEA-20"),
4567
+ title: b.string().describe("Short idea headline (3-6 words)"),
4568
+ kind: b.enum(["idea", "note"]).optional().describe('"note" for ideas that never need a plan; omitted means a plan-bearing idea'),
4569
+ status: b.enum(["open", "done", "dropped"]).optional().describe("Manual lifecycle, valid only on notes — plan-bearing ideas carry no status")
4570
+ }).refine((s) => s.status === void 0 || s.kind === "note", {
4571
+ message: "status is only valid on ideas with kind: note",
4572
+ path: ["status"]
4573
+ }), ai = b.object({
4574
+ id: b.string().describe("Permanent lifetime entity ID, e.g. IDEA-45 — never changes"),
4575
+ title: b.string().describe("Human-readable entity name"),
4576
+ type: b.enum(["feat", "fix", "chore", "docs", "refactor"]).optional().describe(
4577
+ "Work classification (Conventional Commits values) driving commit types and branch prefixes; usually set once a plan is drafted"
4578
+ ),
4579
+ kind: b.enum(["note"]).optional().describe('"note" marks an entity that never grows phases; omitted for normal ideas'),
4580
+ status: b.enum(["idea", "planned", "in-progress", "review", "done", "dropped", "open"]).describe(
4581
+ "Lifecycle status: idea → planned → in-progress → review → done/dropped; notes use open → done/dropped"
4582
+ ),
4583
+ agent: b.enum($e).optional().describe("Per-entity agent override"),
4584
+ created: Y.describe("Creation date (YYYY-MM-DD)"),
4585
+ updated: Y.optional().describe("Last significant update date (YYYY-MM-DD)"),
4586
+ audited: Y.optional().describe("Date of last successful convergence audit (YYYY-MM-DD)"),
4587
+ "audited-hash": b.string().optional().describe(
4588
+ "Content hash of the entity at last audit, used to detect edits regardless of mtime"
4589
+ ),
4590
+ tags: b.array(b.string()).optional().describe("Tagging categories")
4591
+ }).refine((s) => s.kind !== "note" || ["open", "done", "dropped"].includes(s.status), {
4592
+ message: "a note entity must use status open, done, or dropped",
4593
+ path: ["status"]
4594
+ }).refine((s) => s.kind === "note" || s.status !== "open", {
4595
+ message: "status open is only valid on entities with kind: note",
4596
+ path: ["status"]
4597
+ }), li = b.object({
4598
+ version: b.string(),
4599
+ projectName: b.string(),
4600
+ initializedAt: b.string(),
4601
+ nextId: b.object({
4602
+ // The unified-entity counter: all new entities mint lifetime IDEA-N ids
4603
+ // from here. The per-kind counters are legacy, still present in
4604
+ // pre-migration configs.
4605
+ idea: b.number().optional(),
4606
+ feat: b.number().optional(),
4607
+ fix: b.number().optional(),
4608
+ chore: b.number().optional(),
4609
+ docs: b.number().optional(),
4610
+ refactor: b.number().optional()
4577
4611
  }).optional(),
4578
- defaultAgent: E.enum(Ue).optional(),
4579
- defaultAgents: E.object({
4580
- phase: Be,
4581
- planDraft: Be,
4582
- ideaExtend: Be,
4583
- commitSuggest: Be
4612
+ defaultAgent: b.enum($e).optional(),
4613
+ defaultAgents: b.object({
4614
+ phase: je,
4615
+ planDraft: je,
4616
+ ideaExtend: je,
4617
+ commitSuggest: je
4584
4618
  }).optional()
4585
- }), Ft = /^##\s+(.+?)\s*$/, fi = /^\*\*([A-Za-z][A-Za-z-]*):\*\*\s*(.*)$/, ui = /^###\s+Phases\s*$/i, hi = /^###\s+Log\s*$/i, di = /^###\s+Clarifications\s*$/i, _s = /^#{2,3}\s+/, qt = /^[-*]\s+\[([ xX])\]\s+(.*)$/, pi = /^\[review\]\s+(.*)$/, mi = /^-\s+(\d{4}-\d{2}-\d{2}):\s*(.*)$/;
4586
- function vs(s, e, t) {
4619
+ }), Vt = /^##\s+(.+?)\s*$/, ci = /^\*\*([A-Za-z][A-Za-z-]*):\*\*\s*(.*)$/, fi = /^###\s+Phases\s*$/i, ui = /^###\s+Log\s*$/i, hi = /^###\s+Clarifications\s*$/i, Ms = /^#{2,3}\s+/, Jt = /^[-*]\s+\[([ xX])\]\s+(.*)$/, di = /^\[review\]\s+(.*)$/, pi = /^-\s+(\d{4}-\d{2}-\d{2}):\s*(.*)$/;
4620
+ function js(s, e, t) {
4587
4621
  const n = s.split(`
4588
4622
  `), i = n.findIndex((l) => e.test(l));
4589
4623
  if (i === -1) return { body: s, entries: [] };
4590
4624
  let r = n.length;
4591
4625
  for (let l = i + 1; l < n.length; l++)
4592
- if (_s.test(n[l])) {
4626
+ if (Ms.test(n[l])) {
4593
4627
  r = l;
4594
4628
  break;
4595
4629
  }
@@ -4597,16 +4631,16 @@ function vs(s, e, t) {
4597
4631
  return { body: [...n.slice(0, i), ...n.slice(r)].join(`
4598
4632
  `).trim(), entries: o };
4599
4633
  }
4600
- function gi(s, e, t) {
4634
+ function mi(s, e, t) {
4601
4635
  const n = [];
4602
4636
  let i = e;
4603
4637
  for (; i < t; ) {
4604
- const r = s[i].match(qt);
4638
+ const r = s[i].match(Jt);
4605
4639
  if (r) {
4606
- const o = r[1].toLowerCase() === "x", a = r[2].trim(), l = a.match(pi), c = l ? l[1].trim() : a, p = l ? "review" : void 0, f = [];
4640
+ const o = r[1].toLowerCase() === "x", a = r[2].trim(), l = a.match(di), c = l ? l[1].trim() : a, p = l ? "review" : void 0, f = [];
4607
4641
  for (i++; i < t; ) {
4608
4642
  const h = s[i];
4609
- if (h.trim() === "" || qt.test(h) || _s.test(h)) break;
4643
+ if (h.trim() === "" || Jt.test(h) || Ms.test(h)) break;
4610
4644
  if (/^\s/.test(h))
4611
4645
  f.push(h.trimStart()), i++;
4612
4646
  else
@@ -4624,60 +4658,60 @@ function gi(s, e, t) {
4624
4658
  }
4625
4659
  return n;
4626
4660
  }
4627
- function Ps(s) {
4628
- const e = vs(s, ui, gi);
4661
+ function At(s) {
4662
+ const e = js(s, fi, mi);
4629
4663
  return { body: e.body, phases: e.entries };
4630
4664
  }
4631
- function yi(s, e, t) {
4665
+ function gi(s, e, t) {
4632
4666
  const n = [];
4633
4667
  for (let i = e; i < t; i++) {
4634
- const r = s[i].match(mi);
4668
+ const r = s[i].match(pi);
4635
4669
  r && n.push({ date: r[1], text: r[2].trim() });
4636
4670
  }
4637
4671
  return n;
4638
4672
  }
4639
4673
  function Bs(s, e) {
4640
- return vs(s, e, yi);
4674
+ return js(s, e, gi);
4641
4675
  }
4642
- function Ms(s) {
4643
- const { body: e, entries: t } = Bs(s, hi);
4676
+ function xe(s) {
4677
+ const { body: e, entries: t } = Bs(s, ui);
4644
4678
  return { body: e, log: t };
4645
4679
  }
4646
- function Ds(s) {
4647
- const { body: e, entries: t } = Bs(s, di);
4680
+ function Ot(s) {
4681
+ const { body: e, entries: t } = Bs(s, hi);
4648
4682
  return { body: e, clarifications: t };
4649
4683
  }
4650
- function $t(s) {
4684
+ function Tt(s) {
4651
4685
  const e = s.split(`
4652
4686
  `), t = [];
4653
4687
  for (let i = 0; i < e.length; i++)
4654
- Ft.test(e[i]) && t.push(i);
4688
+ Vt.test(e[i]) && t.push(i);
4655
4689
  const n = [];
4656
4690
  for (let i = 0; i < t.length; i++) {
4657
- const r = t[i], o = i + 1 < t.length ? t[i + 1] : e.length, a = e[r].match(Ft)[1], l = e.slice(r + 1, o);
4691
+ const r = t[i], o = i + 1 < t.length ? t[i + 1] : e.length, a = e[r].match(Vt)[1], l = e.slice(r + 1, o);
4658
4692
  let c = 0;
4659
4693
  for (; c < l.length && l[c].trim() === ""; ) c++;
4660
4694
  const p = {};
4661
4695
  for (; c < l.length; ) {
4662
- const b = l[c].match(fi);
4663
- if (!b) break;
4664
- p[b[1].toLowerCase()] = b[2].trim(), c++;
4696
+ const w = l[c].match(ci);
4697
+ if (!w) break;
4698
+ p[w[1].toLowerCase()] = w[2].trim(), c++;
4665
4699
  }
4666
4700
  for (; c < l.length && l[c].trim() === ""; ) c++;
4667
4701
  const f = l.slice(c).join(`
4668
4702
  `).trim();
4669
- let { body: h, phases: d } = Ps(f);
4670
- const { body: g, log: u } = Ms(h);
4703
+ let { body: h, phases: d } = At(f);
4704
+ const { body: g, log: u } = xe(h);
4671
4705
  h = g;
4672
- const { body: m, clarifications: y } = Ds(h);
4706
+ const { body: m, clarifications: y } = Ot(h);
4673
4707
  h = m, n.push({ title: a, fields: p, body: h, phases: d, log: u, clarifications: y });
4674
4708
  }
4675
4709
  return n;
4676
4710
  }
4677
- function Ut(s) {
4711
+ function Ui(s) {
4678
4712
  const e = [], t = [];
4679
- for (const n of $t(s)) {
4680
- const i = ii.safeParse(n.fields);
4713
+ for (const n of Tt(s)) {
4714
+ const i = si.safeParse(n.fields);
4681
4715
  if (!i.success) {
4682
4716
  t.push({
4683
4717
  title: n.title,
@@ -4704,10 +4738,10 @@ function Ut(s) {
4704
4738
  }
4705
4739
  return { entries: e, warnings: t };
4706
4740
  }
4707
- function ji(s) {
4741
+ function Yi(s) {
4708
4742
  const e = [], t = [];
4709
- for (const n of $t(s)) {
4710
- const i = ri.safeParse(n.fields);
4743
+ for (const n of Tt(s)) {
4744
+ const i = ni.safeParse(n.fields);
4711
4745
  if (!i.success) {
4712
4746
  t.push({
4713
4747
  title: n.title,
@@ -4726,10 +4760,10 @@ function ji(s) {
4726
4760
  }
4727
4761
  return { entries: e, warnings: t };
4728
4762
  }
4729
- function Ki(s) {
4763
+ function Vi(s) {
4730
4764
  const e = [], t = [];
4731
- for (const n of $t(s)) {
4732
- const i = oi.safeParse(n.fields);
4765
+ for (const n of Tt(s)) {
4766
+ const i = ii.safeParse(n.fields);
4733
4767
  if (!i.success) {
4734
4768
  t.push({
4735
4769
  title: n.title,
@@ -4749,15 +4783,15 @@ function Ki(s) {
4749
4783
  }
4750
4784
  return { entries: e, warnings: t };
4751
4785
  }
4752
- const bi = /^---\s*\r?\n([\s\S]*?)\r?\n---\s*(?:\r?\n)?/;
4753
- function js(s, e) {
4754
- const t = [], n = s.match(bi);
4786
+ const yi = /^---\s*\r?\n([\s\S]*?)\r?\n---\s*(?:\r?\n)?/;
4787
+ function Lt(s, e) {
4788
+ const t = [], n = s.match(yi);
4755
4789
  if (!n)
4756
4790
  return { data: null, body: s.trim(), warnings: t };
4757
4791
  const i = n[1], r = s.slice(n[0].length).trim();
4758
4792
  let o;
4759
4793
  try {
4760
- o = si(i);
4794
+ o = ei(i);
4761
4795
  } catch (l) {
4762
4796
  return t.push({
4763
4797
  title: "(frontmatter)",
@@ -4779,20 +4813,55 @@ function js(s, e) {
4779
4813
  }
4780
4814
  return { data: a.data, body: r, warnings: t };
4781
4815
  }
4782
- function wi(s) {
4816
+ function bi(s) {
4817
+ const e = [], {
4818
+ data: t,
4819
+ body: n,
4820
+ warnings: i
4821
+ } = Lt(s, ai);
4822
+ if (e.push(...i), !t)
4823
+ return { entries: [], warnings: e };
4824
+ let r = n;
4825
+ const { body: o, phases: a } = At(r);
4826
+ r = o;
4827
+ const { body: l, log: c } = xe(r);
4828
+ r = l;
4829
+ const { body: p, clarifications: f } = Ot(r);
4830
+ return r = p, t.kind === "note" && a.length > 0 && e.push({
4831
+ title: t.title,
4832
+ message: "note entities must not carry a Phases section — kept, but fix the file"
4833
+ }), { entries: [{
4834
+ id: t.id,
4835
+ title: t.title,
4836
+ type: t.type,
4837
+ kind: t.kind,
4838
+ status: t.status,
4839
+ agent: t.agent,
4840
+ created: t.created,
4841
+ updated: t.updated,
4842
+ audited: t.audited,
4843
+ auditedHash: t["audited-hash"],
4844
+ tags: t.tags ?? [],
4845
+ body: r,
4846
+ phases: a,
4847
+ log: c,
4848
+ clarifications: f
4849
+ }], warnings: e };
4850
+ }
4851
+ function Ji(s) {
4783
4852
  const e = [], {
4784
4853
  data: t,
4785
4854
  body: n,
4786
4855
  warnings: i
4787
- } = js(s, ai);
4856
+ } = Lt(s, ri);
4788
4857
  if (e.push(...i), !t)
4789
4858
  return { entries: [], warnings: e };
4790
4859
  let r = n;
4791
- const { body: o, phases: a } = Ps(r);
4860
+ const { body: o, phases: a } = At(r);
4792
4861
  r = o;
4793
- const { body: l, log: c } = Ms(r);
4862
+ const { body: l, log: c } = xe(r);
4794
4863
  r = l;
4795
- const { body: p, clarifications: f } = Ds(r);
4864
+ const { body: p, clarifications: f } = Ot(r);
4796
4865
  return r = p, { entries: [{
4797
4866
  title: t.title,
4798
4867
  status: t.status,
@@ -4803,6 +4872,7 @@ function wi(s) {
4803
4872
  created: t.created,
4804
4873
  updated: t.updated,
4805
4874
  audited: t.audited,
4875
+ auditedHash: t["audited-hash"],
4806
4876
  tags: t.tags ?? [],
4807
4877
  body: r,
4808
4878
  phases: a,
@@ -4810,28 +4880,34 @@ function wi(s) {
4810
4880
  clarifications: f
4811
4881
  }], warnings: e };
4812
4882
  }
4813
- function ki(s) {
4883
+ function Hi(s) {
4814
4884
  const {
4815
4885
  data: e,
4816
4886
  body: t,
4817
4887
  warnings: n
4818
- } = js(s, li);
4819
- return e ? { entries: [{
4888
+ } = Lt(s, oi);
4889
+ if (!e)
4890
+ return { entries: [], warnings: n };
4891
+ const { body: i, log: r } = xe(t);
4892
+ return { entries: [{
4820
4893
  id: e.id,
4821
4894
  title: e.title,
4822
- body: t || ""
4823
- }], warnings: n } : { entries: [], warnings: n };
4895
+ body: i || "",
4896
+ ...e.kind && { kind: e.kind },
4897
+ ...e.status && { status: e.status },
4898
+ ...r.length > 0 && { log: r }
4899
+ }], warnings: n };
4824
4900
  }
4825
- const Si = /^(IDEA-\d+):\s*/, Ni = /\n---+\n/;
4826
- function Yt(s) {
4827
- return s.split(Ni).filter(Boolean).map((t) => {
4901
+ const wi = /^(IDEA-\d+):\s*/, ki = /\n---+\n/;
4902
+ function Gi(s) {
4903
+ return s.split(ki).filter(Boolean).map((t) => {
4828
4904
  var l;
4829
4905
  const n = t.match(/^#{1,3}\s+(.+)/m), i = n ? n[1].trim() : ((l = t.trim().split(`
4830
- `)[0]) == null ? void 0 : l.trim()) ?? "Untitled", r = i.match(Si), o = (r == null ? void 0 : r[1]) ?? null, a = o ? i.slice(r[0].length) : i;
4906
+ `)[0]) == null ? void 0 : l.trim()) ?? "Untitled", r = i.match(wi), o = (r == null ? void 0 : r[1]) ?? null, a = o ? i.slice(r[0].length) : i;
4831
4907
  return { id: o, title: a, body: t.trim() };
4832
4908
  });
4833
4909
  }
4834
- function Ri(s, e, t) {
4910
+ function Wi(s, e, t) {
4835
4911
  const n = new Set(s.map((r) => r.title)), i = [];
4836
4912
  for (const r of s)
4837
4913
  r.supersededBy && !n.has(r.supersededBy) && i.push({
@@ -4858,178 +4934,267 @@ function Ri(s, e, t) {
4858
4934
  }
4859
4935
  return i;
4860
4936
  }
4861
- const Vt = /^##\s+(\d{4}-\d{2}-\d{2})\s*$/, Ei = /^[-*]\s+(.*)$/;
4862
- function Fi(s) {
4937
+ const Ht = /^##\s+(\d{4}-\d{2}-\d{2})\s*$/, Si = /^[-*]\s+(.*)$/;
4938
+ function Qi(s) {
4863
4939
  const e = s.split(`
4864
4940
  `), t = [];
4865
4941
  for (let i = 0; i < e.length; i++)
4866
- Vt.test(e[i]) && t.push(i);
4942
+ Ht.test(e[i]) && t.push(i);
4867
4943
  const n = [];
4868
4944
  for (let i = 0; i < t.length; i++) {
4869
- const r = t[i], o = i + 1 < t.length ? t[i + 1] : e.length, a = e[r].match(Vt)[1], l = e.slice(r + 1, o).map((c) => c.match(Ei)).filter((c) => c !== null).map((c) => c[1].trim());
4945
+ const r = t[i], o = i + 1 < t.length ? t[i + 1] : e.length, a = e[r].match(Ht)[1], l = e.slice(r + 1, o).map((c) => c.match(Si)).filter((c) => c !== null).map((c) => c[1].trim());
4870
4946
  n.push({ date: a, items: l });
4871
4947
  }
4872
4948
  return n;
4873
4949
  }
4874
- async function Ks(s) {
4950
+ async function Ni(s) {
4875
4951
  try {
4876
- return await Fs(s);
4952
+ return await Rs(s);
4877
4953
  } catch {
4878
4954
  return [];
4879
4955
  }
4880
4956
  }
4881
- async function ze(s) {
4957
+ async function Ei(s) {
4882
4958
  try {
4883
- return await ft(s, "utf-8");
4959
+ return await Ye(s, "utf-8");
4884
4960
  } catch {
4885
4961
  return "";
4886
4962
  }
4887
4963
  }
4888
- async function Ii(s) {
4964
+ async function Ks(s) {
4889
4965
  const e = [], t = [];
4890
4966
  let n = 0;
4891
- for (const i of [s, P(s, "archive")]) {
4892
- const r = (await Ks(i)).filter((o) => o.endsWith(".md") && o !== "index.md");
4967
+ for (const i of [s, _(s, "archive")]) {
4968
+ const r = (await Ni(i)).filter((o) => o.endsWith(".md") && o !== "index.md");
4893
4969
  n += r.length;
4894
4970
  for (const o of r) {
4895
- const a = await ze(P(i, o));
4971
+ const a = await Ei(_(i, o));
4896
4972
  if (!a) {
4897
- t.push({ title: o, message: "Could not read plan file" });
4973
+ t.push({ title: o, message: "Could not read entity file" });
4898
4974
  continue;
4899
4975
  }
4900
- const l = wi(a);
4976
+ const l = bi(a);
4901
4977
  e.push(...l.entries), t.push(...l.warnings);
4902
4978
  }
4903
4979
  }
4904
4980
  return { entries: e, warnings: t, fileCount: n };
4905
4981
  }
4906
- async function Ai(s) {
4907
- const e = [], t = [], n = (await Ks(s)).filter((i) => i.endsWith(".md") && i !== "index.md");
4908
- for (const i of n) {
4909
- const r = await ze(P(s, i));
4910
- if (!r) {
4911
- t.push({ title: i, message: "Could not read idea file" });
4912
- continue;
4913
- }
4914
- const o = ki(r);
4915
- e.push(...o.entries), t.push(...o.warnings);
4916
- }
4917
- return { entries: e, warnings: t, fileCount: n.length };
4918
- }
4919
- async function qi(s, e) {
4920
- const [t, n] = await Promise.all([
4921
- Ii(s),
4922
- ze(e)
4923
- ]);
4924
- if (t.fileCount === 0)
4925
- return Ut(n);
4926
- const i = Ut(n), r = /* @__PURE__ */ new Set();
4927
- for (const a of t.entries)
4928
- r.add(a.id ?? a.title);
4929
- const o = i.entries.filter((a) => {
4930
- const l = a.id ?? a.title;
4931
- return r.has(l) ? !1 : (r.add(l), !0);
4932
- });
4982
+ function $i(s) {
4983
+ return {
4984
+ title: s.title,
4985
+ // Non-note entities can't carry the note-only 'open' (schema-enforced).
4986
+ status: s.status,
4987
+ kind: s.type,
4988
+ id: s.id,
4989
+ agent: s.agent,
4990
+ created: s.created,
4991
+ updated: s.updated,
4992
+ audited: s.audited,
4993
+ auditedHash: s.auditedHash,
4994
+ tags: s.tags,
4995
+ body: s.body,
4996
+ phases: s.phases,
4997
+ log: s.log,
4998
+ clarifications: s.clarifications
4999
+ };
5000
+ }
5001
+ function Ii(s) {
4933
5002
  return {
4934
- entries: [...t.entries, ...o],
4935
- warnings: [...i.warnings, ...t.warnings]
5003
+ id: s.id,
5004
+ title: s.title,
5005
+ body: s.body,
5006
+ kind: "note",
5007
+ status: s.status,
5008
+ log: s.log
4936
5009
  };
4937
5010
  }
4938
- async function Ui(s, e) {
4939
- const [t, n] = await Promise.all([
4940
- Ai(s),
4941
- ze(e)
4942
- ]);
4943
- if (t.fileCount === 0 && !n)
4944
- return { entries: [], warnings: t.warnings };
4945
- if (t.fileCount === 0)
4946
- return { entries: Yt(n), warnings: t.warnings };
4947
- if (!n)
4948
- return t;
4949
- const i = Yt(n), r = /* @__PURE__ */ new Set();
4950
- for (const a of t.entries)
4951
- a.id && r.add(a.id);
4952
- const o = i.filter((a) => a.id ? r.has(a.id) ? !1 : (r.add(a.id), !0) : !0);
5011
+ async function Xi(s) {
5012
+ const { entries: e, warnings: t } = await Ks(s);
5013
+ return {
5014
+ entries: e.filter((n) => n.kind !== "note").map($i),
5015
+ warnings: t
5016
+ };
5017
+ }
5018
+ async function zi(s) {
5019
+ const { entries: e, warnings: t } = await Ks(s);
4953
5020
  return {
4954
- entries: [...t.entries, ...o],
4955
- warnings: [...t.warnings]
5021
+ entries: e.filter((n) => n.kind === "note").map(Ii),
5022
+ warnings: t
4956
5023
  };
4957
5024
  }
4958
- const $i = "0.1.0";
4959
- class Oi extends Error {
5025
+ const Ai = `---
5026
+ name: paper-camp
5027
+ description: Work inside a project that has a papercamp/ folder — its unified idea entities (each holding its plan as a section), decisions log, open questions, and progress log. Use this whenever the working directory contains papercamp/ (papercamp/ideas/, papercamp/decisions.md, papercamp/open-questions.md, papercamp/progress.md), and especially before starting, continuing, or completing any plan phase, drafting an idea, logging a decision, or answering "what are we working on / what's next".
5028
+ ---
5029
+
5030
+ # Paper Camp
5031
+
5032
+ Paper Camp is this project's planning methodology: plans, ideas, decisions, and
5033
+ open questions live as markdown files under \`papercamp/\`, and an append-only
5034
+ \`papercamp/progress.md\` is the changelog. This skill tells you how to read that
5035
+ state before acting and how to keep it honest as you work.
5036
+
5037
+ If a \`papercamp\` MCP server is connected in this session, prefer its tools
5038
+ (list/get plans, update phase, append progress, etc.) over raw file access —
5039
+ they enforce the same guards (id allocation, branch conflicts) that the file
5040
+ grammar below assumes. Everything in this skill still applies conceptually;
5041
+ only the mechanism changes.
5042
+
5043
+ ## Before doing any work
5044
+
5045
+ Read, in this order, whatever exists:
5046
+
5047
+ 1. \`papercamp/ideas/index.md\` — every entity's id/title/type/status/tags, at
5048
+ a glance. Ideas and plans are one thing: an entity is an *idea* for its
5049
+ whole life, and its plan is a \`### Phases\` section inside the same file.
5050
+ 2. The specific entity file at \`papercamp/ideas/<ID>.md\` (e.g. \`IDEA-43.md\`)
5051
+ for the work you're about to do — YAML frontmatter (\`id\`, \`title\`,
5052
+ \`type\`, \`status\`, \`tags\`, ...) plus prose rationale, then optionally a
5053
+ \`### Phases\` list of \`- [ ]\`/\`- [x]\` checkboxes with an indented
5054
+ description under each. Done/dropped entities live in
5055
+ \`papercamp/ideas/archive/\`.
5056
+ 3. \`papercamp/decisions.md\` — settled calls that constrain your approach.
5057
+ Don't re-litigate a logged decision without flagging it to the user first.
5058
+ 4. \`papercamp/open-questions.md\` — unresolved questions that might block or
5059
+ redirect the work you're about to start.
5060
+ 5. The last handful of entries in \`papercamp/progress.md\` for recent context
5061
+ on what just happened.
5062
+
5063
+ Skip files that don't exist yet (a fresh project may have empty logs).
5064
+
5065
+ ## While working
5066
+
5067
+ - Work one plan phase at a time unless told otherwise — don't cascade into
5068
+ later phases just because they look quick.
5069
+ - If a phase's boundary or intent is unclear, ask before continuing.
5070
+ - Prose in plans and ideas is more current than your memory of past
5071
+ conversations. If they conflict, the files win — say so and resync.
5072
+
5073
+ ## Keep the project current as you go
5074
+
5075
+ - **Plan phases**: when you finish a phase, flip its checkbox from \`- [ ]\` to
5076
+ \`- [x]\` in the plan's frontmatter file. Change only that line — don't touch
5077
+ other phases or prose.
5078
+ - **Plan status**: keep the plan's \`status:\` frontmatter honest
5079
+ (\`planned\` / \`in-progress\` / \`review\` / \`done\`). When every phase is
5080
+ checked, set status to \`review\` — never \`done\`. \`done\` is a human-only
5081
+ promotion after review; an agent finishing the last phase does not close
5082
+ the plan itself.
5083
+ - **Progress log**: add one bullet describing what you did under today's
5084
+ \`## YYYY-MM-DD\` heading at the top of \`papercamp/progress.md\` (newest day
5085
+ first; create the heading if today's isn't there yet). Be specific enough
5086
+ that a future read of the log alone explains what changed and why, without
5087
+ needing to re-read the diff.
5088
+ - **Decisions / open questions**: if you settle something ambiguous while
5089
+ working, log it in \`papercamp/decisions.md\`; if you surface a question you
5090
+ can't resolve yourself, add it to \`papercamp/open-questions.md\` rather than
5091
+ guessing silently.
5092
+
5093
+ ## What this skill deliberately does not do
5094
+
5095
+ It does not maintain a separate "current focus" file — that's derived at
5096
+ session start from live plan/progress data, not hand-maintained here. It does
5097
+ not define the file formats in full; treat the existing files under
5098
+ \`papercamp/\` as the grammar reference (mirror their structure exactly rather
5099
+ than inventing a new shape).
5100
+ `, Gt = "$CLAUDE_PROJECT_DIR/node_modules/.bin/paper-camp", Oi = `${JSON.stringify(
5101
+ {
5102
+ hooks: {
5103
+ SessionStart: [
5104
+ {
5105
+ matcher: "*",
5106
+ hooks: [{ type: "command", command: `"${Gt}" session-focus` }]
5107
+ }
5108
+ ],
5109
+ PostToolUse: [
5110
+ {
5111
+ matcher: "Write",
5112
+ hooks: [{ type: "command", command: `"${Gt}" post-tool-use-log` }]
5113
+ }
5114
+ ]
5115
+ }
5116
+ },
5117
+ null,
5118
+ 2
5119
+ )}
5120
+ `, Ti = "0.1.0";
5121
+ class Li extends Error {
4960
5122
  constructor(e) {
4961
5123
  super(`Paper Camp is already initialized in ${e} (papercamp/config.json exists).`);
4962
5124
  }
4963
5125
  }
4964
- async function Me(s) {
5126
+ async function Se(s) {
4965
5127
  try {
4966
- return await qs(s), !0;
5128
+ return await Fs(s), !0;
4967
5129
  } catch {
4968
5130
  return !1;
4969
5131
  }
4970
5132
  }
4971
- const Ti = ["progress.md", "decisions.md", "open-questions.md"];
4972
- async function Yi(s, e) {
4973
- const t = P(s, "papercamp"), n = P(t, "config.json");
4974
- if (await Me(n))
4975
- throw new Oi(s);
5133
+ const Ci = ["progress.md", "decisions.md", "open-questions.md"];
5134
+ async function xi(s, e) {
5135
+ const t = _(s, "papercamp"), n = _(t, "config.json");
5136
+ if (await Se(n))
5137
+ throw new Li(s);
4976
5138
  const i = {
4977
- version: $i,
5139
+ version: Ti,
4978
5140
  projectName: e.projectName,
4979
5141
  initializedAt: (/* @__PURE__ */ new Date()).toISOString(),
4980
- nextId: { feat: 1, fix: 1, chore: 1, docs: 1, refactor: 1 }
5142
+ nextId: { idea: 1 }
4981
5143
  };
4982
- ci.parse(i), await se(t, { recursive: !0 });
4983
- const r = P(t, "plans");
4984
- await se(r, { recursive: !0 });
4985
- const o = P(r, "index.md");
4986
- await Me(o) || await ne(o, `# Plans
4987
-
4988
- No plans yet.
4989
- `, "utf-8");
4990
- const a = P(r, "archive");
4991
- await se(a, { recursive: !0 });
4992
- const l = P(t, "ideas");
4993
- await se(l, { recursive: !0 });
4994
- const c = P(l, "index.md");
4995
- if (!await Me(c)) {
4996
- const p = e.intent ? `# ${e.projectName}
5144
+ li.parse(i), await X(t, { recursive: !0 });
5145
+ const r = _(t, "ideas");
5146
+ await X(r, { recursive: !0 });
5147
+ const o = _(r, "archive");
5148
+ await X(o, { recursive: !0 });
5149
+ const a = _(r, "index.md");
5150
+ if (!await Se(a)) {
5151
+ const l = e.intent ? `# ${e.projectName}
4997
5152
 
4998
5153
  ${e.intent}
4999
5154
  ` : `# ${e.projectName}
5000
5155
 
5001
5156
  What are you building, and why?
5002
5157
  `;
5003
- await ne(c, p, "utf-8");
5004
- }
5005
- for (const p of Ti) {
5006
- const f = P(t, p);
5007
- await Me(f) || await ne(f, "", "utf-8");
5008
- }
5009
- await ne(n, `${JSON.stringify(i, null, 2)}
5010
- `, "utf-8");
5011
- }
5012
- function Vi() {
5158
+ await G(a, l, "utf-8");
5159
+ }
5160
+ for (const l of Ci) {
5161
+ const c = _(t, l);
5162
+ await Se(c) || await G(c, "", "utf-8");
5163
+ }
5164
+ await G(n, `${JSON.stringify(i, null, 2)}
5165
+ `, "utf-8"), await vi(s);
5166
+ }
5167
+ async function vi(s) {
5168
+ const e = _(s, ".claude", "skills", "paper-camp");
5169
+ await X(e, { recursive: !0 });
5170
+ const t = _(e, "SKILL.md");
5171
+ await Se(t) || await G(t, Ai, "utf-8");
5172
+ const n = _(s, ".claude");
5173
+ await X(n, { recursive: !0 });
5174
+ const i = _(n, "settings.json");
5175
+ await Se(i) || await G(i, Oi, "utf-8");
5176
+ }
5177
+ function _i() {
5013
5178
  return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
5014
5179
  }
5015
- let Jt = Promise.resolve();
5016
- async function Ji(s, e) {
5017
- const t = Jt.then(async () => {
5180
+ let Wt = Promise.resolve();
5181
+ async function Pi(s, e) {
5182
+ const t = Wt.then(async () => {
5018
5183
  let n = null;
5019
5184
  try {
5020
- n = JSON.parse(await ft(s, "utf-8"));
5185
+ n = JSON.parse(await Ye(s, "utf-8"));
5021
5186
  } catch {
5022
5187
  return;
5023
5188
  }
5024
5189
  if (!(n != null && n.nextId)) return;
5025
5190
  const i = n.nextId[e] ?? 1, r = `${e.toUpperCase()}-${i}`;
5026
- return n.nextId[e] = i + 1, await ne(s, `${JSON.stringify(n, null, 2)}
5191
+ return n.nextId[e] = i + 1, await G(s, `${JSON.stringify(n, null, 2)}
5027
5192
  `), r;
5028
5193
  });
5029
- return Jt = t.catch(() => {
5194
+ return Wt = t.catch(() => {
5030
5195
  }), t;
5031
5196
  }
5032
- function Li(s) {
5197
+ function Di(s) {
5033
5198
  const e = [`## ${s.title}`, "", `**Status:** ${s.status}`];
5034
5199
  if (s.kind && e.push(`**Kind:** ${s.kind}`), s.id && e.push(`**Id:** ${s.id}`), s.idea && e.push(`**Idea:** ${s.idea}`), s.agent && e.push(`**Agent:** ${s.agent}`), e.push(`**Created:** ${s.created}`), s.updated && e.push(`**Updated:** ${s.updated}`), s.tags && s.tags.length > 0 && e.push(`**Tags:** ${s.tags.join(", ")}`), e.push(""), s.body && e.push(s.body, ""), s.clarifications && s.clarifications.length > 0) {
5035
5200
  e.push("### Clarifications");
@@ -5055,12 +5220,12 @@ function Li(s) {
5055
5220
  return e.join(`
5056
5221
  `).trimEnd();
5057
5222
  }
5058
- function Gi(s) {
5223
+ function Zi(s) {
5059
5224
  const e = [`## ${s.title}`, "", `**Date:** ${s.date}`, `**Status:** ${s.status}`];
5060
5225
  return s.supersededBy && e.push(`**Superseded-by:** ${s.supersededBy}`), e.push(""), s.body && e.push(s.body), e.join(`
5061
5226
  `).trimEnd();
5062
5227
  }
5063
- function Ci(s) {
5228
+ function Mi(s) {
5064
5229
  const e = [
5065
5230
  `## ${s.title}`,
5066
5231
  "",
@@ -5070,27 +5235,55 @@ function Ci(s) {
5070
5235
  return s.resolvedBy && e.push(`**Resolved-by:** ${s.resolvedBy}`), s.blocks && e.push(`**Blocks:** ${s.blocks}`), e.push(""), s.body && e.push(s.body), e.join(`
5071
5236
  `).trimEnd();
5072
5237
  }
5073
- function Hi(s, e) {
5238
+ function er(s, e) {
5074
5239
  return [`## ${s}`, ...e.map((t) => `- ${t}`)].join(`
5075
5240
  `);
5076
5241
  }
5077
- function Wi(s) {
5078
- return s.length === 0 ? "" : `${s.map((e) => Li(e)).join(`
5242
+ async function tr(s, e) {
5243
+ const t = `## ${_i()}`;
5244
+ let n = "";
5245
+ try {
5246
+ n = await Ye(s, "utf-8");
5247
+ } catch (i) {
5248
+ if (i.code !== "ENOENT") throw i;
5249
+ }
5250
+ if (await X(Qt(s), { recursive: !0 }), n.startsWith(`${t}
5251
+ `))
5252
+ await G(
5253
+ s,
5254
+ `${t}
5255
+ - ${e}
5256
+ ${n.slice(t.length + 1)}`,
5257
+ "utf-8"
5258
+ );
5259
+ else {
5260
+ const i = n.trimEnd(), r = i ? `${t}
5261
+ - ${e}
5262
+
5263
+ ${i}
5264
+ ` : `${t}
5265
+ - ${e}
5266
+ `;
5267
+ await G(s, r, "utf-8");
5268
+ }
5269
+ }
5270
+ function sr(s) {
5271
+ return s.length === 0 ? "" : `${s.map((e) => Di(e)).join(`
5079
5272
 
5080
5273
  `)}
5081
5274
  `;
5082
5275
  }
5083
- function Qi(s) {
5084
- return s.length === 0 ? "" : `${s.map((e) => Ci(e)).join(`
5276
+ function nr(s) {
5277
+ return s.length === 0 ? "" : `${s.map((e) => Mi(e)).join(`
5085
5278
 
5086
5279
  `)}
5087
5280
  `;
5088
5281
  }
5089
- async function Xi(s, e) {
5090
- await se(Ys(s), { recursive: !0 });
5282
+ async function ir(s, e) {
5283
+ await X(Qt(s), { recursive: !0 });
5091
5284
  let t = "";
5092
5285
  try {
5093
- t = await ft(s, "utf-8");
5286
+ t = await Ye(s, "utf-8");
5094
5287
  } catch (r) {
5095
5288
  if (r.code !== "ENOENT") throw r;
5096
5289
  }
@@ -5099,15 +5292,15 @@ async function Xi(s, e) {
5099
5292
  ${e}
5100
5293
  ` : `${e}
5101
5294
  `;
5102
- await ne(s, i, "utf-8");
5295
+ await G(s, i, "utf-8");
5103
5296
  }
5104
- function Rs(s) {
5105
- let e = ni(s);
5297
+ function Ct(s) {
5298
+ let e = ti(s);
5106
5299
  return e = e.trimEnd(), `---
5107
5300
  ${e}
5108
5301
  ---`;
5109
5302
  }
5110
- function zi(s) {
5303
+ function rr(s) {
5111
5304
  const e = {
5112
5305
  id: s.id,
5113
5306
  title: s.title,
@@ -5115,8 +5308,8 @@ function zi(s) {
5115
5308
  status: s.status,
5116
5309
  created: s.created
5117
5310
  };
5118
- s.idea && (e.idea = s.idea), s.agent && (e.agent = s.agent), s.updated && (e.updated = s.updated), s.audited && (e.audited = s.audited), s.tags && s.tags.length > 0 && (e.tags = s.tags);
5119
- const t = [Rs(e)];
5311
+ s.idea && (e.idea = s.idea), s.agent && (e.agent = s.agent), s.updated && (e.updated = s.updated), s.audited && (e.audited = s.audited), s.auditedHash && (e["audited-hash"] = s.auditedHash), s.tags && s.tags.length > 0 && (e.tags = s.tags);
5312
+ const t = [Ct(e)];
5120
5313
  if (s.body && t.push(s.body), s.clarifications && s.clarifications.length > 0) {
5121
5314
  const n = ["### Clarifications"];
5122
5315
  for (const i of s.clarifications)
@@ -5147,103 +5340,140 @@ function zi(s) {
5147
5340
 
5148
5341
  `).trimEnd();
5149
5342
  }
5150
- function Zi(s) {
5343
+ function or(s) {
5344
+ const e = {
5345
+ id: s.id,
5346
+ title: s.title
5347
+ };
5348
+ s.type && (e.type = s.type), s.kind && (e.kind = s.kind), e.status = s.status, e.created = s.created, s.agent && (e.agent = s.agent), s.updated && (e.updated = s.updated), s.audited && (e.audited = s.audited), s.auditedHash && (e["audited-hash"] = s.auditedHash), s.tags && s.tags.length > 0 && (e.tags = s.tags);
5349
+ const t = [Ct(e)];
5350
+ if (s.body && t.push(s.body), s.clarifications && s.clarifications.length > 0) {
5351
+ const n = ["### Clarifications"];
5352
+ for (const i of s.clarifications)
5353
+ n.push(`- ${i.date}: ${i.text}`);
5354
+ t.push(n.join(`
5355
+ `));
5356
+ }
5357
+ if (s.phases && s.phases.length > 0) {
5358
+ const n = ["### Phases"];
5359
+ for (const i of s.phases) {
5360
+ const r = i.source === "review" ? `[review] ${i.text}` : i.text;
5361
+ if (n.push(`- [${i.done ? "x" : " "}] ${r}`), i.description)
5362
+ for (const o of i.description.split(`
5363
+ `))
5364
+ n.push(` ${o}`);
5365
+ }
5366
+ t.push(n.join(`
5367
+ `));
5368
+ }
5369
+ if (s.log && s.log.length > 0) {
5370
+ const n = ["### Log"];
5371
+ for (const i of s.log)
5372
+ n.push(`- ${i.date}: ${i.text}`);
5373
+ t.push(n.join(`
5374
+ `));
5375
+ }
5376
+ return t.join(`
5377
+
5378
+ `).trimEnd();
5379
+ }
5380
+ async function ar(s) {
5381
+ return Pi(s, "idea");
5382
+ }
5383
+ function lr(s) {
5151
5384
  const e = {
5152
5385
  id: s.id,
5153
5386
  title: s.title
5154
- }, t = [Rs(e)], n = `## ${s.id}: ${s.title}`;
5155
- return t.push(s.body ? `${n}
5387
+ };
5388
+ s.kind && (e.kind = s.kind), s.status && (e.status = s.status);
5389
+ const t = [Ct(e)], n = `## ${s.id}: ${s.title}`;
5390
+ if (t.push(s.body ? `${n}
5156
5391
 
5157
- ${s.body}` : n), t.join(`
5392
+ ${s.body}` : n), s.log && s.log.length > 0) {
5393
+ const i = ["### Log"];
5394
+ for (const r of s.log)
5395
+ i.push(`- ${r.date}: ${r.text}`);
5396
+ t.push(i.join(`
5397
+ `));
5398
+ }
5399
+ return t.join(`
5158
5400
 
5159
5401
  `).trimEnd();
5160
5402
  }
5161
- async function xi(s, e) {
5162
- const t = P(s, "papercamp", "plans"), n = P(t, "archive"), i = P(t, `${e}.md`), r = P(n, `${e}.md`);
5163
- await se(n, { recursive: !0 });
5403
+ async function cr(s, e) {
5404
+ const t = _(s, "papercamp", "ideas"), n = _(t, "archive"), i = _(t, `${e}.md`), r = _(n, `${e}.md`);
5405
+ await X(n, { recursive: !0 });
5164
5406
  try {
5165
- return await Us(i, r), !0;
5407
+ return await qs(i, r), !0;
5166
5408
  } catch (o) {
5167
5409
  if (o.code === "ENOENT") return !1;
5168
5410
  throw o;
5169
5411
  }
5170
5412
  }
5171
- function er(s) {
5172
- return s.length === 0 ? `# Plans
5173
-
5174
- No plans yet.
5175
- ` : `# Plans
5176
-
5177
- | Id | Title | Status | Tags |
5178
- |----|-------|--------|------|
5179
- ${[...s].sort((n, i) => {
5180
- const r = n.id ? Number.parseInt(n.id.replace(/^[A-Z]+-/, ""), 10) : Number.NaN, o = i.id ? Number.parseInt(i.id.replace(/^[A-Z]+-/, ""), 10) : Number.NaN;
5181
- return !Number.isNaN(r) && !Number.isNaN(o) ? r - o : (n.title || "").localeCompare(i.title || "");
5182
- }).map(
5183
- (n) => `| ${n.id || ""} | ${(n.title || "").replace(/\|/g, "\\|")} | ${n.status} | ${(n.tags || []).join(", ")} |`
5184
- ).join(`
5185
- `)}
5186
- `;
5187
- }
5188
- function tr(s) {
5413
+ function fr(s) {
5189
5414
  return s.length === 0 ? `# Ideas
5190
5415
 
5191
5416
  No ideas yet.
5192
5417
  ` : `# Ideas
5193
5418
 
5194
- | Id | Title | Status |
5195
- |----|-------|--------|
5419
+ | Id | Title | Type | Status | Tags |
5420
+ |----|-------|------|--------|------|
5196
5421
  ${[...s].sort((n, i) => {
5197
- const r = n.id ? Number.parseInt(n.id.replace("IDEA-", ""), 10) : Number.NaN, o = i.id ? Number.parseInt(i.id.replace("IDEA-", ""), 10) : Number.NaN;
5198
- return !Number.isNaN(r) && !Number.isNaN(o) ? r - o : (n.title || "").localeCompare(i.title || "");
5422
+ const r = Number.parseInt(n.id.replace(/^[A-Z]+-/, ""), 10), o = Number.parseInt(i.id.replace(/^[A-Z]+-/, ""), 10);
5423
+ return !Number.isNaN(r) && !Number.isNaN(o) ? r - o : n.title.localeCompare(i.title);
5199
5424
  }).map(
5200
- (n) => `| ${n.id || ""} | ${(n.title || "").replace(/\|/g, "\\|")} | ${n.status || "planned"} |`
5425
+ (n) => `| ${n.id} | ${n.title.replace(/\|/g, "\\|")} | ${n.type ?? (n.kind === "note" ? "note" : "—")} | ${n.status} | ${(n.tags ?? []).join(", ")} |`
5201
5426
  ).join(`
5202
5427
  `)}
5203
5428
  `;
5204
5429
  }
5205
5430
  export {
5206
- Oi as A,
5207
- Yt as B,
5208
- Ki as C,
5209
- wi as D,
5210
- Ut as E,
5211
- Fi as F,
5212
- $t as G,
5213
- ii as H,
5214
- ai as I,
5215
- Ai as J,
5216
- Ii as K,
5217
- Ui as L,
5218
- qi as M,
5219
- Rs as N,
5220
- Vi as O,
5221
- $i as P,
5222
- Be as a,
5223
- Xi as b,
5224
- Di as c,
5225
- xi as d,
5226
- Ji as e,
5227
- Z as f,
5228
- ri as g,
5229
- Ri as h,
5230
- Gi as i,
5231
- Zi as j,
5232
- tr as k,
5233
- Ci as l,
5234
- Qi as m,
5235
- Li as n,
5236
- zi as o,
5237
- Wi as p,
5238
- er as q,
5239
- Hi as r,
5240
- li as s,
5241
- Yi as t,
5242
- oi as u,
5243
- ci as v,
5244
- ji as w,
5245
- Mi as x,
5246
- js as y,
5247
- ki as z
5431
+ Li as A,
5432
+ Yi as B,
5433
+ bi as C,
5434
+ Fi as D,
5435
+ Lt as E,
5436
+ Hi as F,
5437
+ Gi as G,
5438
+ Vi as H,
5439
+ Ji as I,
5440
+ Ui as J,
5441
+ Qi as K,
5442
+ Tt as L,
5443
+ si as M,
5444
+ ri as N,
5445
+ tr as O,
5446
+ Ti as P,
5447
+ Ks as Q,
5448
+ zi as R,
5449
+ Xi as S,
5450
+ Ct as T,
5451
+ _i as U,
5452
+ je as a,
5453
+ ir as b,
5454
+ qi as c,
5455
+ cr as d,
5456
+ ar as e,
5457
+ Pi as f,
5458
+ Y as g,
5459
+ ni as h,
5460
+ ai as i,
5461
+ Ii as j,
5462
+ $i as k,
5463
+ Wi as l,
5464
+ Zi as m,
5465
+ fr as n,
5466
+ or as o,
5467
+ lr as p,
5468
+ Mi as q,
5469
+ nr as r,
5470
+ Di as s,
5471
+ rr as t,
5472
+ sr as u,
5473
+ er as v,
5474
+ oi as w,
5475
+ xi as x,
5476
+ ii as y,
5477
+ li as z
5248
5478
  };
5249
- //# sourceMappingURL=serializer.B8u-L8BI.js.map
5479
+ //# sourceMappingURL=serializer.DbnJzwVr.js.map