@cloud-cli/on 0.1.4 → 0.1.6

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 (2) hide show
  1. package/dist/on.js +1421 -1021
  2. package/package.json +2 -1
package/dist/on.js CHANGED
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
- import { parseArgs as Ss } from "node:util";
3
- import { createServer as Ns } from "node:http";
4
- import { readFile as tt, mkdtemp as _t, writeFile as Os, rm as As } from "node:fs/promises";
5
- import kt, { join as st } from "node:path";
6
- import { spawn as jt } from "node:child_process";
7
- import { existsSync as Es } from "node:fs";
8
- import { tmpdir as Bt } from "node:os";
9
- import { join as Ts } from "node:path/posix";
10
- import { randomUUID as Is } from "node:crypto";
11
- function x(s, e, t) {
2
+ import { parseArgs as As } from "node:util";
3
+ import { createServer as vs } from "node:http";
4
+ import { readFile as nt, writeFile as $s, mkdtemp as Ls, rm as Cs } from "node:fs/promises";
5
+ import Nt, { join as it } from "node:path";
6
+ import { spawn as Ut } from "node:child_process";
7
+ import { mkdirSync as js, existsSync as Bs } from "node:fs";
8
+ import { tmpdir as Ft } from "node:os";
9
+ import { join as Ms } from "node:path/posix";
10
+ import { randomUUID as Ps } from "node:crypto";
11
+ function _e(s, e, t) {
12
12
  s.writeHead(e, { "content-type": "application/json" }).end(JSON.stringify(t));
13
13
  }
14
- function $s(s) {
14
+ function Ds(s) {
15
15
  const e = Number.parseInt(s, 10);
16
16
  if (!Number.isInteger(e) || e < 0 || e > 65535)
17
17
  throw new Error(
@@ -19,69 +19,69 @@ function $s(s) {
19
19
  );
20
20
  return e;
21
21
  }
22
- function nt(s) {
22
+ function rt(s) {
23
23
  if (!s || typeof s != "object" || Array.isArray(s))
24
24
  throw new Error("Incoming webhook payload must be a JSON object.");
25
25
  return s;
26
26
  }
27
- function Mt(s) {
27
+ function qt(s) {
28
28
  return typeof s == "object" && s !== null ? new Proxy(s, {
29
29
  get(e, t) {
30
30
  const n = Reflect.get(e, t);
31
- return typeof n == "object" && n !== null ? Mt(n) : t === "toString" ? () => "'" + JSON.stringify(e) + "'" : n;
31
+ return typeof n == "object" && n !== null ? qt(n) : t === "toString" ? () => "'" + JSON.stringify(e) + "'" : n;
32
32
  }
33
33
  }) : s ?? "";
34
34
  }
35
- function _e(s, e) {
35
+ function je(s, e) {
36
36
  const t = Function(
37
37
  "context",
38
38
  "const { secrets = {}, inputs = {}, step = {}, env } = context;return `" + s + "`;"
39
39
  );
40
40
  return String(t(e) || "");
41
41
  }
42
- function Ls(s, e) {
42
+ function xs(s, e) {
43
43
  if (!e)
44
44
  return { ...s };
45
45
  const t = { inputs: s };
46
46
  for (const [n, i] of Object.entries(e))
47
- t.inputs[n] = _e(`\${${i}}`, t);
47
+ t.inputs[n] = je(`\${${i}}`, t);
48
48
  return t.inputs;
49
49
  }
50
- const it = /* @__PURE__ */ Symbol.for("yaml.alias"), Qe = /* @__PURE__ */ Symbol.for("yaml.document"), J = /* @__PURE__ */ Symbol.for("yaml.map"), Pt = /* @__PURE__ */ Symbol.for("yaml.pair"), U = /* @__PURE__ */ Symbol.for("yaml.scalar"), ae = /* @__PURE__ */ Symbol.for("yaml.seq"), P = /* @__PURE__ */ Symbol.for("yaml.node.type"), Q = (s) => !!s && typeof s == "object" && s[P] === it, je = (s) => !!s && typeof s == "object" && s[P] === Qe, be = (s) => !!s && typeof s == "object" && s[P] === J, L = (s) => !!s && typeof s == "object" && s[P] === Pt, T = (s) => !!s && typeof s == "object" && s[P] === U, we = (s) => !!s && typeof s == "object" && s[P] === ae;
51
- function I(s) {
50
+ const ot = /* @__PURE__ */ Symbol.for("yaml.alias"), Xe = /* @__PURE__ */ Symbol.for("yaml.document"), J = /* @__PURE__ */ Symbol.for("yaml.map"), Vt = /* @__PURE__ */ Symbol.for("yaml.pair"), R = /* @__PURE__ */ Symbol.for("yaml.scalar"), le = /* @__PURE__ */ Symbol.for("yaml.seq"), D = /* @__PURE__ */ Symbol.for("yaml.node.type"), Q = (s) => !!s && typeof s == "object" && s[D] === ot, Be = (s) => !!s && typeof s == "object" && s[D] === Xe, be = (s) => !!s && typeof s == "object" && s[D] === J, $ = (s) => !!s && typeof s == "object" && s[D] === Vt, I = (s) => !!s && typeof s == "object" && s[D] === R, we = (s) => !!s && typeof s == "object" && s[D] === le;
51
+ function A(s) {
52
52
  if (s && typeof s == "object")
53
- switch (s[P]) {
53
+ switch (s[D]) {
54
54
  case J:
55
- case ae:
55
+ case le:
56
56
  return !0;
57
57
  }
58
58
  return !1;
59
59
  }
60
- function $(s) {
60
+ function v(s) {
61
61
  if (s && typeof s == "object")
62
- switch (s[P]) {
63
- case it:
62
+ switch (s[D]) {
63
+ case ot:
64
64
  case J:
65
- case U:
66
- case ae:
65
+ case R:
66
+ case le:
67
67
  return !0;
68
68
  }
69
69
  return !1;
70
70
  }
71
- const Kt = (s) => (T(s) || I(s)) && !!s.anchor, Y = /* @__PURE__ */ Symbol("break visit"), vs = /* @__PURE__ */ Symbol("skip children"), pe = /* @__PURE__ */ Symbol("remove node");
72
- function le(s, e) {
73
- const t = Cs(e);
74
- je(s) ? ee(null, s.contents, t, Object.freeze([s])) === pe && (s.contents = null) : ee(null, s, t, Object.freeze([]));
71
+ const Jt = (s) => (I(s) || A(s)) && !!s.anchor, Y = /* @__PURE__ */ Symbol("break visit"), Ks = /* @__PURE__ */ Symbol("skip children"), pe = /* @__PURE__ */ Symbol("remove node");
72
+ function ae(s, e) {
73
+ const t = Rs(e);
74
+ Be(s) ? ee(null, s.contents, t, Object.freeze([s])) === pe && (s.contents = null) : ee(null, s, t, Object.freeze([]));
75
75
  }
76
- le.BREAK = Y;
77
- le.SKIP = vs;
78
- le.REMOVE = pe;
76
+ ae.BREAK = Y;
77
+ ae.SKIP = Ks;
78
+ ae.REMOVE = pe;
79
79
  function ee(s, e, t, n) {
80
- const i = _s(s, e, t, n);
81
- if ($(i) || L(i))
82
- return js(s, n, i), ee(s, i, t, n);
80
+ const i = Us(s, e, t, n);
81
+ if (v(i) || $(i))
82
+ return Fs(s, n, i), ee(s, i, t, n);
83
83
  if (typeof i != "symbol") {
84
- if (I(e)) {
84
+ if (A(e)) {
85
85
  n = Object.freeze(n.concat(e));
86
86
  for (let r = 0; r < e.items.length; ++r) {
87
87
  const o = ee(r, e.items[r], t, n);
@@ -93,7 +93,7 @@ function ee(s, e, t, n) {
93
93
  o === pe && (e.items.splice(r, 1), r -= 1);
94
94
  }
95
95
  }
96
- } else if (L(e)) {
96
+ } else if ($(e)) {
97
97
  n = Object.freeze(n.concat(e));
98
98
  const r = ee("key", e.key, t, n);
99
99
  if (r === Y)
@@ -107,7 +107,7 @@ function ee(s, e, t, n) {
107
107
  }
108
108
  return i;
109
109
  }
110
- function Cs(s) {
110
+ function Rs(s) {
111
111
  return typeof s == "object" && (s.Collection || s.Node || s.Value) ? Object.assign({
112
112
  Alias: s.Node,
113
113
  Map: s.Node,
@@ -122,47 +122,47 @@ function Cs(s) {
122
122
  Seq: s.Collection
123
123
  }, s) : s;
124
124
  }
125
- function _s(s, e, t, n) {
125
+ function Us(s, e, t, n) {
126
126
  if (typeof t == "function")
127
127
  return t(s, e, n);
128
128
  if (be(e))
129
129
  return t.Map?.(s, e, n);
130
130
  if (we(e))
131
131
  return t.Seq?.(s, e, n);
132
- if (L(e))
132
+ if ($(e))
133
133
  return t.Pair?.(s, e, n);
134
- if (T(e))
134
+ if (I(e))
135
135
  return t.Scalar?.(s, e, n);
136
136
  if (Q(e))
137
137
  return t.Alias?.(s, e, n);
138
138
  }
139
- function js(s, e, t) {
139
+ function Fs(s, e, t) {
140
140
  const n = e[e.length - 1];
141
- if (I(n))
141
+ if (A(n))
142
142
  n.items[s] = t;
143
- else if (L(n))
143
+ else if ($(n))
144
144
  s === "key" ? n.key = t : n.value = t;
145
- else if (je(n))
145
+ else if (Be(n))
146
146
  n.contents = t;
147
147
  else {
148
148
  const i = Q(n) ? "alias" : "scalar";
149
149
  throw new Error(`Cannot replace node with ${i} parent`);
150
150
  }
151
151
  }
152
- const Bs = {
152
+ const qs = {
153
153
  "!": "%21",
154
154
  ",": "%2C",
155
155
  "[": "%5B",
156
156
  "]": "%5D",
157
157
  "{": "%7B",
158
158
  "}": "%7D"
159
- }, Ms = (s) => s.replace(/[!,[\]{}]/g, (e) => Bs[e]);
160
- class _ {
159
+ }, Vs = (s) => s.replace(/[!,[\]{}]/g, (e) => qs[e]);
160
+ class j {
161
161
  constructor(e, t) {
162
- this.docStart = null, this.docEnd = !1, this.yaml = Object.assign({}, _.defaultYaml, e), this.tags = Object.assign({}, _.defaultTags, t);
162
+ this.docStart = null, this.docEnd = !1, this.yaml = Object.assign({}, j.defaultYaml, e), this.tags = Object.assign({}, j.defaultTags, t);
163
163
  }
164
164
  clone() {
165
- const e = new _(this.yaml, this.tags);
165
+ const e = new j(this.yaml, this.tags);
166
166
  return e.docStart = this.docStart, e;
167
167
  }
168
168
  /**
@@ -170,16 +170,16 @@ class _ {
170
170
  * update the stream state according to the current version's spec.
171
171
  */
172
172
  atDocument() {
173
- const e = new _(this.yaml, this.tags);
173
+ const e = new j(this.yaml, this.tags);
174
174
  switch (this.yaml.version) {
175
175
  case "1.1":
176
176
  this.atNextDocument = !0;
177
177
  break;
178
178
  case "1.2":
179
179
  this.atNextDocument = !1, this.yaml = {
180
- explicit: _.defaultYaml.explicit,
180
+ explicit: j.defaultYaml.explicit,
181
181
  version: "1.2"
182
- }, this.tags = Object.assign({}, _.defaultTags);
182
+ }, this.tags = Object.assign({}, j.defaultTags);
183
183
  break;
184
184
  }
185
185
  return e;
@@ -189,7 +189,7 @@ class _ {
189
189
  * @returns `true` on success
190
190
  */
191
191
  add(e, t) {
192
- this.atNextDocument && (this.yaml = { explicit: _.defaultYaml.explicit, version: "1.1" }, this.tags = Object.assign({}, _.defaultTags), this.atNextDocument = !1);
192
+ this.atNextDocument && (this.yaml = { explicit: j.defaultYaml.explicit, version: "1.1" }, this.tags = Object.assign({}, j.defaultTags), this.atNextDocument = !1);
193
193
  const n = e.trim().split(/[ \t]+/), i = n.shift();
194
194
  switch (i) {
195
195
  case "%TAG": {
@@ -246,56 +246,56 @@ class _ {
246
246
  tagString(e) {
247
247
  for (const [t, n] of Object.entries(this.tags))
248
248
  if (e.startsWith(n))
249
- return t + Ms(e.substring(n.length));
249
+ return t + Vs(e.substring(n.length));
250
250
  return e[0] === "!" ? e : `!<${e}>`;
251
251
  }
252
252
  toString(e) {
253
253
  const t = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [], n = Object.entries(this.tags);
254
254
  let i;
255
- if (e && n.length > 0 && $(e.contents)) {
255
+ if (e && n.length > 0 && v(e.contents)) {
256
256
  const r = {};
257
- le(e.contents, (o, a) => {
258
- $(a) && a.tag && (r[a.tag] = !0);
257
+ ae(e.contents, (o, l) => {
258
+ v(l) && l.tag && (r[l.tag] = !0);
259
259
  }), i = Object.keys(r);
260
260
  } else
261
261
  i = [];
262
262
  for (const [r, o] of n)
263
- r === "!!" && o === "tag:yaml.org,2002:" || (!e || i.some((a) => a.startsWith(o))) && t.push(`%TAG ${r} ${o}`);
263
+ r === "!!" && o === "tag:yaml.org,2002:" || (!e || i.some((l) => l.startsWith(o))) && t.push(`%TAG ${r} ${o}`);
264
264
  return t.join(`
265
265
  `);
266
266
  }
267
267
  }
268
- _.defaultYaml = { explicit: !1, version: "1.2" };
269
- _.defaultTags = { "!!": "tag:yaml.org,2002:" };
270
- function Dt(s) {
268
+ j.defaultYaml = { explicit: !1, version: "1.2" };
269
+ j.defaultTags = { "!!": "tag:yaml.org,2002:" };
270
+ function Yt(s) {
271
271
  if (/[\x00-\x19\s,[\]{}]/.test(s)) {
272
272
  const t = `Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;
273
273
  throw new Error(t);
274
274
  }
275
275
  return !0;
276
276
  }
277
- function Ut(s) {
277
+ function Gt(s) {
278
278
  const e = /* @__PURE__ */ new Set();
279
- return le(s, {
279
+ return ae(s, {
280
280
  Value(t, n) {
281
281
  n.anchor && e.add(n.anchor);
282
282
  }
283
283
  }), e;
284
284
  }
285
- function Ft(s, e) {
285
+ function Ht(s, e) {
286
286
  for (let t = 1; ; ++t) {
287
287
  const n = `${s}${t}`;
288
288
  if (!e.has(n))
289
289
  return n;
290
290
  }
291
291
  }
292
- function Ps(s, e) {
292
+ function Js(s, e) {
293
293
  const t = [], n = /* @__PURE__ */ new Map();
294
294
  let i = null;
295
295
  return {
296
296
  onAnchor: (r) => {
297
- t.push(r), i ?? (i = Ut(s));
298
- const o = Ft(e, i);
297
+ t.push(r), i ?? (i = Gt(s));
298
+ const o = Ht(e, i);
299
299
  return i.add(o), o;
300
300
  },
301
301
  /**
@@ -306,11 +306,11 @@ function Ps(s, e) {
306
306
  setAnchors: () => {
307
307
  for (const r of t) {
308
308
  const o = n.get(r);
309
- if (typeof o == "object" && o.anchor && (T(o.node) || I(o.node)))
309
+ if (typeof o == "object" && o.anchor && (I(o.node) || A(o.node)))
310
310
  o.node.anchor = o.anchor;
311
311
  else {
312
- const a = new Error("Failed to resolve repeated object (this should not happen)");
313
- throw a.source = r, a;
312
+ const l = new Error("Failed to resolve repeated object (this should not happen)");
313
+ throw l.source = r, l;
314
314
  }
315
315
  }
316
316
  },
@@ -321,8 +321,8 @@ function te(s, e, t, n) {
321
321
  if (n && typeof n == "object")
322
322
  if (Array.isArray(n))
323
323
  for (let i = 0, r = n.length; i < r; ++i) {
324
- const o = n[i], a = te(s, n, String(i), o);
325
- a === void 0 ? delete n[i] : a !== o && (n[i] = a);
324
+ const o = n[i], l = te(s, n, String(i), o);
325
+ l === void 0 ? delete n[i] : l !== o && (n[i] = l);
326
326
  }
327
327
  else if (n instanceof Map)
328
328
  for (const i of Array.from(n.keys())) {
@@ -341,11 +341,11 @@ function te(s, e, t, n) {
341
341
  }
342
342
  return s.call(e, t, n);
343
343
  }
344
- function M(s, e, t) {
344
+ function P(s, e, t) {
345
345
  if (Array.isArray(s))
346
- return s.map((n, i) => M(n, String(i), t));
346
+ return s.map((n, i) => P(n, String(i), t));
347
347
  if (s && typeof s.toJSON == "function") {
348
- if (!t || !Kt(s))
348
+ if (!t || !Jt(s))
349
349
  return s.toJSON(e, t);
350
350
  const n = { aliasCount: 0, count: 1, res: void 0 };
351
351
  t.anchors.set(s, n), t.onCreate = (r) => {
@@ -356,9 +356,9 @@ function M(s, e, t) {
356
356
  }
357
357
  return typeof s == "bigint" && !t?.keep ? Number(s) : s;
358
358
  }
359
- class rt {
359
+ class lt {
360
360
  constructor(e) {
361
- Object.defineProperty(this, P, { value: e });
361
+ Object.defineProperty(this, D, { value: e });
362
362
  }
363
363
  /** Create a copy of this node. */
364
364
  clone() {
@@ -367,7 +367,7 @@ class rt {
367
367
  }
368
368
  /** A plain JavaScript representation of this node. */
369
369
  toJS(e, { mapAsMap: t, maxAliasCount: n, onAnchor: i, reviver: r } = {}) {
370
- if (!je(e))
370
+ if (!Be(e))
371
371
  throw new TypeError("A document argument is required");
372
372
  const o = {
373
373
  anchors: /* @__PURE__ */ new Map(),
@@ -376,16 +376,16 @@ class rt {
376
376
  mapAsMap: t === !0,
377
377
  mapKeyWarned: !1,
378
378
  maxAliasCount: typeof n == "number" ? n : 100
379
- }, a = M(this, "", o);
379
+ }, l = P(this, "", o);
380
380
  if (typeof i == "function")
381
- for (const { count: l, res: c } of o.anchors.values())
382
- i(c, l);
383
- return typeof r == "function" ? te(r, { "": a }, "", a) : a;
381
+ for (const { count: a, res: c } of o.anchors.values())
382
+ i(c, a);
383
+ return typeof r == "function" ? te(r, { "": l }, "", l) : l;
384
384
  }
385
385
  }
386
- class ot extends rt {
386
+ class at extends lt {
387
387
  constructor(e) {
388
- super(it), this.source = e, Object.defineProperty(this, "tag", {
388
+ super(ot), this.source = e, Object.defineProperty(this, "tag", {
389
389
  set() {
390
390
  throw new Error("Alias nodes cannot have tags");
391
391
  }
@@ -397,9 +397,9 @@ class ot extends rt {
397
397
  */
398
398
  resolve(e, t) {
399
399
  let n;
400
- t?.aliasResolveCache ? n = t.aliasResolveCache : (n = [], le(e, {
400
+ t?.aliasResolveCache ? n = t.aliasResolveCache : (n = [], ae(e, {
401
401
  Node: (r, o) => {
402
- (Q(o) || Kt(o)) && n.push(o);
402
+ (Q(o) || Jt(o)) && n.push(o);
403
403
  }
404
404
  }), t && (t.aliasResolveCache = n));
405
405
  let i;
@@ -415,24 +415,24 @@ class ot extends rt {
415
415
  return { source: this.source };
416
416
  const { anchors: n, doc: i, maxAliasCount: r } = t, o = this.resolve(i, t);
417
417
  if (!o) {
418
- const l = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
419
- throw new ReferenceError(l);
418
+ const a = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
419
+ throw new ReferenceError(a);
420
420
  }
421
- let a = n.get(o);
422
- if (a || (M(o, null, t), a = n.get(o)), a?.res === void 0) {
423
- const l = "This should not happen: Alias anchor was not resolved?";
424
- throw new ReferenceError(l);
421
+ let l = n.get(o);
422
+ if (l || (P(o, null, t), l = n.get(o)), l?.res === void 0) {
423
+ const a = "This should not happen: Alias anchor was not resolved?";
424
+ throw new ReferenceError(a);
425
425
  }
426
- if (r >= 0 && (a.count += 1, a.aliasCount === 0 && (a.aliasCount = Ie(i, o, n)), a.count * a.aliasCount > r)) {
427
- const l = "Excessive alias count indicates a resource exhaustion attack";
428
- throw new ReferenceError(l);
426
+ if (r >= 0 && (l.count += 1, l.aliasCount === 0 && (l.aliasCount = Ae(i, o, n)), l.count * l.aliasCount > r)) {
427
+ const a = "Excessive alias count indicates a resource exhaustion attack";
428
+ throw new ReferenceError(a);
429
429
  }
430
- return a.res;
430
+ return l.res;
431
431
  }
432
432
  toString(e, t, n) {
433
433
  const i = `*${this.source}`;
434
434
  if (e) {
435
- if (Dt(this.source), e.options.verifyAliasOrder && !e.anchors.has(this.source)) {
435
+ if (Yt(this.source), e.options.verifyAliasOrder && !e.anchors.has(this.source)) {
436
436
  const r = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
437
437
  throw new Error(r);
438
438
  }
@@ -442,42 +442,42 @@ class ot extends rt {
442
442
  return i;
443
443
  }
444
444
  }
445
- function Ie(s, e, t) {
445
+ function Ae(s, e, t) {
446
446
  if (Q(e)) {
447
447
  const n = e.resolve(s), i = t && n && t.get(n);
448
448
  return i ? i.count * i.aliasCount : 0;
449
- } else if (I(e)) {
449
+ } else if (A(e)) {
450
450
  let n = 0;
451
451
  for (const i of e.items) {
452
- const r = Ie(s, i, t);
452
+ const r = Ae(s, i, t);
453
453
  r > n && (n = r);
454
454
  }
455
455
  return n;
456
- } else if (L(e)) {
457
- const n = Ie(s, e.key, t), i = Ie(s, e.value, t);
456
+ } else if ($(e)) {
457
+ const n = Ae(s, e.key, t), i = Ae(s, e.value, t);
458
458
  return Math.max(n, i);
459
459
  }
460
460
  return 1;
461
461
  }
462
- const Rt = (s) => !s || typeof s != "function" && typeof s != "object";
463
- class O extends rt {
462
+ const Wt = (s) => !s || typeof s != "function" && typeof s != "object";
463
+ class N extends lt {
464
464
  constructor(e) {
465
- super(U), this.value = e;
465
+ super(R), this.value = e;
466
466
  }
467
467
  toJSON(e, t) {
468
- return t?.keep ? this.value : M(this.value, e, t);
468
+ return t?.keep ? this.value : P(this.value, e, t);
469
469
  }
470
470
  toString() {
471
471
  return String(this.value);
472
472
  }
473
473
  }
474
- O.BLOCK_FOLDED = "BLOCK_FOLDED";
475
- O.BLOCK_LITERAL = "BLOCK_LITERAL";
476
- O.PLAIN = "PLAIN";
477
- O.QUOTE_DOUBLE = "QUOTE_DOUBLE";
478
- O.QUOTE_SINGLE = "QUOTE_SINGLE";
479
- const Ks = "tag:yaml.org,2002:";
480
- function Ds(s, e, t) {
474
+ N.BLOCK_FOLDED = "BLOCK_FOLDED";
475
+ N.BLOCK_LITERAL = "BLOCK_LITERAL";
476
+ N.PLAIN = "PLAIN";
477
+ N.QUOTE_DOUBLE = "QUOTE_DOUBLE";
478
+ N.QUOTE_SINGLE = "QUOTE_SINGLE";
479
+ const Ys = "tag:yaml.org,2002:";
480
+ function Gs(s, e, t) {
481
481
  if (e) {
482
482
  const n = t.filter((r) => r.tag === e), i = n.find((r) => !r.format) ?? n[0];
483
483
  if (!i)
@@ -487,34 +487,34 @@ function Ds(s, e, t) {
487
487
  return t.find((n) => n.identify?.(s) && !n.format);
488
488
  }
489
489
  function ge(s, e, t) {
490
- if (je(s) && (s = s.contents), $(s))
490
+ if (Be(s) && (s = s.contents), v(s))
491
491
  return s;
492
- if (L(s)) {
492
+ if ($(s)) {
493
493
  const u = t.schema[J].createNode?.(t.schema, null, t);
494
494
  return u.items.push(s), u;
495
495
  }
496
496
  (s instanceof String || s instanceof Number || s instanceof Boolean || typeof BigInt < "u" && s instanceof BigInt) && (s = s.valueOf());
497
- const { aliasDuplicateObjects: n, onAnchor: i, onTagObj: r, schema: o, sourceObjects: a } = t;
498
- let l;
497
+ const { aliasDuplicateObjects: n, onAnchor: i, onTagObj: r, schema: o, sourceObjects: l } = t;
498
+ let a;
499
499
  if (n && s && typeof s == "object") {
500
- if (l = a.get(s), l)
501
- return l.anchor ?? (l.anchor = i(s)), new ot(l.anchor);
502
- l = { anchor: null, node: null }, a.set(s, l);
500
+ if (a = l.get(s), a)
501
+ return a.anchor ?? (a.anchor = i(s)), new at(a.anchor);
502
+ a = { anchor: null, node: null }, l.set(s, a);
503
503
  }
504
- e?.startsWith("!!") && (e = Ks + e.slice(2));
505
- let c = Ds(s, e, o.tags);
504
+ e?.startsWith("!!") && (e = Ys + e.slice(2));
505
+ let c = Gs(s, e, o.tags);
506
506
  if (!c) {
507
507
  if (s && typeof s.toJSON == "function" && (s = s.toJSON()), !s || typeof s != "object") {
508
- const u = new O(s);
509
- return l && (l.node = u), u;
508
+ const u = new N(s);
509
+ return a && (a.node = u), u;
510
510
  }
511
- c = s instanceof Map ? o[J] : Symbol.iterator in Object(s) ? o[ae] : o[J];
511
+ c = s instanceof Map ? o[J] : Symbol.iterator in Object(s) ? o[le] : o[J];
512
512
  }
513
513
  r && (r(c), delete t.onTagObj);
514
- const d = c?.createNode ? c.createNode(t.schema, s, t) : typeof c?.nodeClass?.from == "function" ? c.nodeClass.from(t.schema, s, t) : new O(s);
515
- return e ? d.tag = e : c.default || (d.tag = c.tag), l && (l.node = d), d;
514
+ const d = c?.createNode ? c.createNode(t.schema, s, t) : typeof c?.nodeClass?.from == "function" ? c.nodeClass.from(t.schema, s, t) : new N(s);
515
+ return e ? d.tag = e : c.default || (d.tag = c.tag), a && (a.node = d), d;
516
516
  }
517
- function ve(s, e, t) {
517
+ function Le(s, e, t) {
518
518
  let n = t;
519
519
  for (let i = e.length - 1; i >= 0; --i) {
520
520
  const r = e[i];
@@ -535,7 +535,7 @@ function ve(s, e, t) {
535
535
  });
536
536
  }
537
537
  const he = (s) => s == null || typeof s == "object" && !!s[Symbol.iterator]().next().done;
538
- class qt extends rt {
538
+ class Qt extends lt {
539
539
  constructor(e, t) {
540
540
  super(e), Object.defineProperty(this, "schema", {
541
541
  value: t,
@@ -551,7 +551,7 @@ class qt extends rt {
551
551
  */
552
552
  clone(e) {
553
553
  const t = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
554
- return e && (t.schema = e), t.items = t.items.map((n) => $(n) || L(n) ? n.clone(e) : n), this.range && (t.range = this.range.slice()), t;
554
+ return e && (t.schema = e), t.items = t.items.map((n) => v(n) || $(n) ? n.clone(e) : n), this.range && (t.range = this.range.slice()), t;
555
555
  }
556
556
  /**
557
557
  * Adds a value to the collection. For `!!map` and `!!omap` the value must
@@ -563,10 +563,10 @@ class qt extends rt {
563
563
  this.add(t);
564
564
  else {
565
565
  const [n, ...i] = e, r = this.get(n, !0);
566
- if (I(r))
566
+ if (A(r))
567
567
  r.addIn(i, t);
568
568
  else if (r === void 0 && this.schema)
569
- this.set(n, ve(this.schema, i, t));
569
+ this.set(n, Le(this.schema, i, t));
570
570
  else
571
571
  throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`);
572
572
  }
@@ -580,7 +580,7 @@ class qt extends rt {
580
580
  if (n.length === 0)
581
581
  return this.delete(t);
582
582
  const i = this.get(t, !0);
583
- if (I(i))
583
+ if (A(i))
584
584
  return i.deleteIn(n);
585
585
  throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`);
586
586
  }
@@ -591,14 +591,14 @@ class qt extends rt {
591
591
  */
592
592
  getIn(e, t) {
593
593
  const [n, ...i] = e, r = this.get(n, !0);
594
- return i.length === 0 ? !t && T(r) ? r.value : r : I(r) ? r.getIn(i, t) : void 0;
594
+ return i.length === 0 ? !t && I(r) ? r.value : r : A(r) ? r.getIn(i, t) : void 0;
595
595
  }
596
596
  hasAllNullValues(e) {
597
597
  return this.items.every((t) => {
598
- if (!L(t))
598
+ if (!$(t))
599
599
  return !1;
600
600
  const n = t.value;
601
- return n == null || e && T(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
601
+ return n == null || e && I(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
602
602
  });
603
603
  }
604
604
  /**
@@ -609,7 +609,7 @@ class qt extends rt {
609
609
  if (n.length === 0)
610
610
  return this.has(t);
611
611
  const i = this.get(t, !0);
612
- return I(i) ? i.hasIn(n) : !1;
612
+ return A(i) ? i.hasIn(n) : !1;
613
613
  }
614
614
  /**
615
615
  * Sets a value in this collection. For `!!set`, `value` needs to be a
@@ -621,37 +621,37 @@ class qt extends rt {
621
621
  this.set(n, t);
622
622
  else {
623
623
  const r = this.get(n, !0);
624
- if (I(r))
624
+ if (A(r))
625
625
  r.setIn(i, t);
626
626
  else if (r === void 0 && this.schema)
627
- this.set(n, ve(this.schema, i, t));
627
+ this.set(n, Le(this.schema, i, t));
628
628
  else
629
629
  throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`);
630
630
  }
631
631
  }
632
632
  }
633
- const Us = (s) => s.replace(/^(?!$)(?: $)?/gm, "#");
634
- function F(s, e) {
633
+ const Hs = (s) => s.replace(/^(?!$)(?: $)?/gm, "#");
634
+ function U(s, e) {
635
635
  return /^\n+$/.test(s) ? s.substring(1) : e ? s.replace(/^(?! *$)/gm, e) : s;
636
636
  }
637
637
  const G = (s, e, t) => s.endsWith(`
638
- `) ? F(t, e) : t.includes(`
638
+ `) ? U(t, e) : t.includes(`
639
639
  `) ? `
640
- ` + F(t, e) : (s.endsWith(" ") ? "" : " ") + t, Vt = "flow", Xe = "block", $e = "quoted";
641
- function Be(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentWidth: r = 20, onFold: o, onOverflow: a } = {}) {
640
+ ` + U(t, e) : (s.endsWith(" ") ? "" : " ") + t, Xt = "flow", ze = "block", ve = "quoted";
641
+ function Me(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentWidth: r = 20, onFold: o, onOverflow: l } = {}) {
642
642
  if (!i || i < 0)
643
643
  return s;
644
644
  i < r && (r = 0);
645
- const l = Math.max(1 + r, 1 + i - e.length);
646
- if (s.length <= l)
645
+ const a = Math.max(1 + r, 1 + i - e.length);
646
+ if (s.length <= a)
647
647
  return s;
648
648
  const c = [], d = {};
649
649
  let u = i - e.length;
650
650
  typeof n == "number" && (n > i - Math.max(2, r) ? c.push(0) : u = i - n);
651
651
  let f, p, g = !1, h = -1, m = -1, b = -1;
652
- t === Xe && (h = St(s, h, e.length), h !== -1 && (u = h + l));
653
- for (let k; k = s[h += 1]; ) {
654
- if (t === $e && k === "\\") {
652
+ t === ze && (h = Ot(s, h, e.length), h !== -1 && (u = h + a));
653
+ for (let S; S = s[h += 1]; ) {
654
+ if (t === ve && S === "\\") {
655
655
  switch (m = h, s[h + 1]) {
656
656
  case "x":
657
657
  h += 3;
@@ -667,44 +667,44 @@ function Be(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
667
667
  }
668
668
  b = h;
669
669
  }
670
- if (k === `
670
+ if (S === `
671
671
  `)
672
- t === Xe && (h = St(s, h, e.length)), u = h + e.length + l, f = void 0;
672
+ t === ze && (h = Ot(s, h, e.length)), u = h + e.length + a, f = void 0;
673
673
  else {
674
- if (k === " " && p && p !== " " && p !== `
674
+ if (S === " " && p && p !== " " && p !== `
675
675
  ` && p !== " ") {
676
- const S = s[h + 1];
677
- S && S !== " " && S !== `
678
- ` && S !== " " && (f = h);
676
+ const k = s[h + 1];
677
+ k && k !== " " && k !== `
678
+ ` && k !== " " && (f = h);
679
679
  }
680
680
  if (h >= u)
681
681
  if (f)
682
- c.push(f), u = f + l, f = void 0;
683
- else if (t === $e) {
682
+ c.push(f), u = f + a, f = void 0;
683
+ else if (t === ve) {
684
684
  for (; p === " " || p === " "; )
685
- p = k, k = s[h += 1], g = !0;
686
- const S = h > b + 1 ? h - 2 : m - 1;
687
- if (d[S])
685
+ p = S, S = s[h += 1], g = !0;
686
+ const k = h > b + 1 ? h - 2 : m - 1;
687
+ if (d[k])
688
688
  return s;
689
- c.push(S), d[S] = !0, u = S + l, f = void 0;
689
+ c.push(k), d[k] = !0, u = k + a, f = void 0;
690
690
  } else
691
691
  g = !0;
692
692
  }
693
- p = k;
693
+ p = S;
694
694
  }
695
- if (g && a && a(), c.length === 0)
695
+ if (g && l && l(), c.length === 0)
696
696
  return s;
697
697
  o && o();
698
698
  let w = s.slice(0, c[0]);
699
- for (let k = 0; k < c.length; ++k) {
700
- const S = c[k], N = c[k + 1] || s.length;
701
- S === 0 ? w = `
702
- ${e}${s.slice(0, N)}` : (t === $e && d[S] && (w += `${s[S]}\\`), w += `
703
- ${e}${s.slice(S + 1, N)}`);
699
+ for (let S = 0; S < c.length; ++S) {
700
+ const k = c[S], _ = c[S + 1] || s.length;
701
+ k === 0 ? w = `
702
+ ${e}${s.slice(0, _)}` : (t === ve && d[k] && (w += `${s[k]}\\`), w += `
703
+ ${e}${s.slice(k + 1, _)}`);
704
704
  }
705
705
  return w;
706
706
  }
707
- function St(s, e, t) {
707
+ function Ot(s, e, t) {
708
708
  let n = e, i = e + 1, r = s[i];
709
709
  for (; r === " " || r === " "; )
710
710
  if (e < i + t)
@@ -718,12 +718,12 @@ function St(s, e, t) {
718
718
  }
719
719
  return n;
720
720
  }
721
- const Me = (s, e) => ({
721
+ const Pe = (s, e) => ({
722
722
  indentAtStart: e ? s.indent.length : s.indentAtStart,
723
723
  lineWidth: s.options.lineWidth,
724
724
  minContentWidth: s.options.minContentWidth
725
- }), Pe = (s) => /^(%|---|\.\.\.)/m.test(s);
726
- function Fs(s, e, t) {
725
+ }), De = (s) => /^(%|---|\.\.\.)/m.test(s);
726
+ function Ws(s, e, t) {
727
727
  if (!e || e < 0)
728
728
  return !1;
729
729
  const n = e - t, i = s.length;
@@ -743,15 +743,15 @@ function me(s, e) {
743
743
  const t = JSON.stringify(s);
744
744
  if (e.options.doubleQuotedAsJSON)
745
745
  return t;
746
- const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (Pe(s) ? " " : "");
747
- let o = "", a = 0;
748
- for (let l = 0, c = t[l]; c; c = t[++l])
749
- if (c === " " && t[l + 1] === "\\" && t[l + 2] === "n" && (o += t.slice(a, l) + "\\ ", l += 1, a = l, c = "\\"), c === "\\")
750
- switch (t[l + 1]) {
746
+ const { implicitKey: n } = e, i = e.options.doubleQuotedMinMultiLineLength, r = e.indent || (De(s) ? " " : "");
747
+ let o = "", l = 0;
748
+ for (let a = 0, c = t[a]; c; c = t[++a])
749
+ if (c === " " && t[a + 1] === "\\" && t[a + 2] === "n" && (o += t.slice(l, a) + "\\ ", a += 1, l = a, c = "\\"), c === "\\")
750
+ switch (t[a + 1]) {
751
751
  case "u":
752
752
  {
753
- o += t.slice(a, l);
754
- const d = t.substr(l + 2, 4);
753
+ o += t.slice(l, a);
754
+ const d = t.substr(a + 2, 4);
755
755
  switch (d) {
756
756
  case "0000":
757
757
  o += "\\0";
@@ -778,35 +778,35 @@ function me(s, e) {
778
778
  o += "\\P";
779
779
  break;
780
780
  default:
781
- d.substr(0, 2) === "00" ? o += "\\x" + d.substr(2) : o += t.substr(l, 6);
781
+ d.substr(0, 2) === "00" ? o += "\\x" + d.substr(2) : o += t.substr(a, 6);
782
782
  }
783
- l += 5, a = l + 1;
783
+ a += 5, l = a + 1;
784
784
  }
785
785
  break;
786
786
  case "n":
787
- if (n || t[l + 2] === '"' || t.length < i)
788
- l += 1;
787
+ if (n || t[a + 2] === '"' || t.length < i)
788
+ a += 1;
789
789
  else {
790
- for (o += t.slice(a, l) + `
790
+ for (o += t.slice(l, a) + `
791
791
 
792
- `; t[l + 2] === "\\" && t[l + 3] === "n" && t[l + 4] !== '"'; )
792
+ `; t[a + 2] === "\\" && t[a + 3] === "n" && t[a + 4] !== '"'; )
793
793
  o += `
794
- `, l += 2;
795
- o += r, t[l + 2] === " " && (o += "\\"), l += 1, a = l + 1;
794
+ `, a += 2;
795
+ o += r, t[a + 2] === " " && (o += "\\"), a += 1, l = a + 1;
796
796
  }
797
797
  break;
798
798
  default:
799
- l += 1;
799
+ a += 1;
800
800
  }
801
- return o = a ? o + t.slice(a) : t, n ? o : Be(o, r, $e, Me(e, !1));
801
+ return o = l ? o + t.slice(l) : t, n ? o : Me(o, r, ve, Pe(e, !1));
802
802
  }
803
- function xe(s, e) {
803
+ function Ze(s, e) {
804
804
  if (e.options.singleQuote === !1 || e.implicitKey && s.includes(`
805
805
  `) || /[ \t]\n|\n[ \t]/.test(s))
806
806
  return me(s, e);
807
- const t = e.indent || (Pe(s) ? " " : ""), n = "'" + s.replace(/'/g, "''").replace(/\n+/g, `$&
807
+ const t = e.indent || (De(s) ? " " : ""), n = "'" + s.replace(/'/g, "''").replace(/\n+/g, `$&
808
808
  ${t}`) + "'";
809
- return e.implicitKey ? n : Be(n, t, Vt, Me(e, !1));
809
+ return e.implicitKey ? n : Me(n, t, Xt, Pe(e, !1));
810
810
  }
811
811
  function se(s, e) {
812
812
  const { singleQuote: t } = e.options;
@@ -815,46 +815,46 @@ function se(s, e) {
815
815
  n = me;
816
816
  else {
817
817
  const i = s.includes('"'), r = s.includes("'");
818
- i && !r ? n = xe : r && !i ? n = me : n = t ? xe : me;
818
+ i && !r ? n = Ze : r && !i ? n = me : n = t ? Ze : me;
819
819
  }
820
820
  return n(s, e);
821
821
  }
822
- let ze;
822
+ let et;
823
823
  try {
824
- ze = new RegExp(`(^|(?<!
824
+ et = new RegExp(`(^|(?<!
825
825
  ))
826
826
  +(?!
827
827
  |$)`, "g");
828
828
  } catch {
829
- ze = /\n+(?!\n|$)/g;
829
+ et = /\n+(?!\n|$)/g;
830
830
  }
831
- function Le({ comment: s, type: e, value: t }, n, i, r) {
832
- const { blockQuote: o, commentString: a, lineWidth: l } = n.options;
831
+ function $e({ comment: s, type: e, value: t }, n, i, r) {
832
+ const { blockQuote: o, commentString: l, lineWidth: a } = n.options;
833
833
  if (!o || /\n[\t ]+$/.test(t))
834
834
  return se(t, n);
835
- const c = n.indent || (n.forceBlockIndent || Pe(t) ? " " : ""), d = o === "literal" ? !0 : o === "folded" || e === O.BLOCK_FOLDED ? !1 : e === O.BLOCK_LITERAL ? !0 : !Fs(t, l, c.length);
835
+ const c = n.indent || (n.forceBlockIndent || De(t) ? " " : ""), d = o === "literal" ? !0 : o === "folded" || e === N.BLOCK_FOLDED ? !1 : e === N.BLOCK_LITERAL ? !0 : !Ws(t, a, c.length);
836
836
  if (!t)
837
837
  return d ? `|
838
838
  ` : `>
839
839
  `;
840
840
  let u, f;
841
841
  for (f = t.length; f > 0; --f) {
842
- const N = t[f - 1];
843
- if (N !== `
844
- ` && N !== " " && N !== " ")
842
+ const _ = t[f - 1];
843
+ if (_ !== `
844
+ ` && _ !== " " && _ !== " ")
845
845
  break;
846
846
  }
847
847
  let p = t.substring(f);
848
848
  const g = p.indexOf(`
849
849
  `);
850
850
  g === -1 ? u = "-" : t === p || g !== p.length - 1 ? (u = "+", r && r()) : u = "", p && (t = t.slice(0, -p.length), p[p.length - 1] === `
851
- ` && (p = p.slice(0, -1)), p = p.replace(ze, `$&${c}`));
851
+ ` && (p = p.slice(0, -1)), p = p.replace(et, `$&${c}`));
852
852
  let h = !1, m, b = -1;
853
853
  for (m = 0; m < t.length; ++m) {
854
- const N = t[m];
855
- if (N === " ")
854
+ const _ = t[m];
855
+ if (_ === " ")
856
856
  h = !0;
857
- else if (N === `
857
+ else if (_ === `
858
858
  `)
859
859
  b = m;
860
860
  else
@@ -862,80 +862,80 @@ function Le({ comment: s, type: e, value: t }, n, i, r) {
862
862
  }
863
863
  let w = t.substring(0, b < m ? b + 1 : m);
864
864
  w && (t = t.substring(w.length), w = w.replace(/\n+/g, `$&${c}`));
865
- let S = (h ? c ? "2" : "1" : "") + u;
866
- if (s && (S += " " + a(s.replace(/ ?[\r\n]+/g, " ")), i && i()), !d) {
867
- const N = t.replace(/\n+/g, `
865
+ let k = (h ? c ? "2" : "1" : "") + u;
866
+ if (s && (k += " " + l(s.replace(/ ?[\r\n]+/g, " ")), i && i()), !d) {
867
+ const _ = t.replace(/\n+/g, `
868
868
  $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${c}`);
869
- let A = !1;
870
- const E = Me(n, !0);
871
- o !== "folded" && e !== O.BLOCK_FOLDED && (E.onOverflow = () => {
872
- A = !0;
869
+ let O = !1;
870
+ const T = Pe(n, !0);
871
+ o !== "folded" && e !== N.BLOCK_FOLDED && (T.onOverflow = () => {
872
+ O = !0;
873
873
  });
874
- const y = Be(`${w}${N}${p}`, c, Xe, E);
875
- if (!A)
876
- return `>${S}
874
+ const y = Me(`${w}${_}${p}`, c, ze, T);
875
+ if (!O)
876
+ return `>${k}
877
877
  ${c}${y}`;
878
878
  }
879
- return t = t.replace(/\n+/g, `$&${c}`), `|${S}
879
+ return t = t.replace(/\n+/g, `$&${c}`), `|${k}
880
880
  ${c}${w}${t}${p}`;
881
881
  }
882
- function Rs(s, e, t, n) {
883
- const { type: i, value: r } = s, { actualString: o, implicitKey: a, indent: l, indentStep: c, inFlow: d } = e;
884
- if (a && r.includes(`
882
+ function Qs(s, e, t, n) {
883
+ const { type: i, value: r } = s, { actualString: o, implicitKey: l, indent: a, indentStep: c, inFlow: d } = e;
884
+ if (l && r.includes(`
885
885
  `) || d && /[[\]{},]/.test(r))
886
886
  return se(r, e);
887
887
  if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))
888
- return a || d || !r.includes(`
889
- `) ? se(r, e) : Le(s, e, t, n);
890
- if (!a && !d && i !== O.PLAIN && r.includes(`
888
+ return l || d || !r.includes(`
889
+ `) ? se(r, e) : $e(s, e, t, n);
890
+ if (!l && !d && i !== N.PLAIN && r.includes(`
891
891
  `))
892
- return Le(s, e, t, n);
893
- if (Pe(r)) {
894
- if (l === "")
895
- return e.forceBlockIndent = !0, Le(s, e, t, n);
896
- if (a && l === c)
892
+ return $e(s, e, t, n);
893
+ if (De(r)) {
894
+ if (a === "")
895
+ return e.forceBlockIndent = !0, $e(s, e, t, n);
896
+ if (l && a === c)
897
897
  return se(r, e);
898
898
  }
899
899
  const u = r.replace(/\n+/g, `$&
900
- ${l}`);
900
+ ${a}`);
901
901
  if (o) {
902
902
  const f = (h) => h.default && h.tag !== "tag:yaml.org,2002:str" && h.test?.test(u), { compat: p, tags: g } = e.doc.schema;
903
903
  if (g.some(f) || p?.some(f))
904
904
  return se(r, e);
905
905
  }
906
- return a ? u : Be(u, l, Vt, Me(e, !1));
906
+ return l ? u : Me(u, a, Xt, Pe(e, !1));
907
907
  }
908
- function at(s, e, t, n) {
908
+ function ct(s, e, t, n) {
909
909
  const { implicitKey: i, inFlow: r } = e, o = typeof s.value == "string" ? s : Object.assign({}, s, { value: String(s.value) });
910
- let { type: a } = s;
911
- a !== O.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value) && (a = O.QUOTE_DOUBLE);
912
- const l = (d) => {
910
+ let { type: l } = s;
911
+ l !== N.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value) && (l = N.QUOTE_DOUBLE);
912
+ const a = (d) => {
913
913
  switch (d) {
914
- case O.BLOCK_FOLDED:
915
- case O.BLOCK_LITERAL:
916
- return i || r ? se(o.value, e) : Le(o, e, t, n);
917
- case O.QUOTE_DOUBLE:
914
+ case N.BLOCK_FOLDED:
915
+ case N.BLOCK_LITERAL:
916
+ return i || r ? se(o.value, e) : $e(o, e, t, n);
917
+ case N.QUOTE_DOUBLE:
918
918
  return me(o.value, e);
919
- case O.QUOTE_SINGLE:
920
- return xe(o.value, e);
921
- case O.PLAIN:
922
- return Rs(o, e, t, n);
919
+ case N.QUOTE_SINGLE:
920
+ return Ze(o.value, e);
921
+ case N.PLAIN:
922
+ return Qs(o, e, t, n);
923
923
  default:
924
924
  return null;
925
925
  }
926
926
  };
927
- let c = l(a);
927
+ let c = a(l);
928
928
  if (c === null) {
929
929
  const { defaultKeyType: d, defaultStringType: u } = e.options, f = i && d || u;
930
- if (c = l(f), c === null)
930
+ if (c = a(f), c === null)
931
931
  throw new Error(`Unsupported default string type ${f}`);
932
932
  }
933
933
  return c;
934
934
  }
935
- function Jt(s, e) {
935
+ function zt(s, e) {
936
936
  const t = Object.assign({
937
937
  blockQuote: !0,
938
- commentString: Us,
938
+ commentString: Hs,
939
939
  defaultKeyType: null,
940
940
  defaultStringType: "PLAIN",
941
941
  directives: null,
@@ -973,14 +973,14 @@ function Jt(s, e) {
973
973
  options: t
974
974
  };
975
975
  }
976
- function qs(s, e) {
976
+ function Xs(s, e) {
977
977
  if (e.tag) {
978
978
  const i = s.filter((r) => r.tag === e.tag);
979
979
  if (i.length > 0)
980
980
  return i.find((r) => r.format === e.format) ?? i[0];
981
981
  }
982
982
  let t, n;
983
- if (T(e)) {
983
+ if (I(e)) {
984
984
  n = e.value;
985
985
  let i = s.filter((r) => r.identify?.(n));
986
986
  if (i.length > 1) {
@@ -996,16 +996,16 @@ function qs(s, e) {
996
996
  }
997
997
  return t;
998
998
  }
999
- function Vs(s, e, { anchors: t, doc: n }) {
999
+ function zs(s, e, { anchors: t, doc: n }) {
1000
1000
  if (!n.directives)
1001
1001
  return "";
1002
- const i = [], r = (T(s) || I(s)) && s.anchor;
1003
- r && Dt(r) && (t.add(r), i.push(`&${r}`));
1002
+ const i = [], r = (I(s) || A(s)) && s.anchor;
1003
+ r && Yt(r) && (t.add(r), i.push(`&${r}`));
1004
1004
  const o = s.tag ?? (e.default ? null : e.tag);
1005
1005
  return o && i.push(n.directives.tagString(o)), i.join(" ");
1006
1006
  }
1007
1007
  function re(s, e, t, n) {
1008
- if (L(s))
1008
+ if ($(s))
1009
1009
  return s.toString(e, t, n);
1010
1010
  if (Q(s)) {
1011
1011
  if (e.doc.directives)
@@ -1015,30 +1015,30 @@ function re(s, e, t, n) {
1015
1015
  e.resolvedAliases ? e.resolvedAliases.add(s) : e.resolvedAliases = /* @__PURE__ */ new Set([s]), s = s.resolve(e.doc);
1016
1016
  }
1017
1017
  let i;
1018
- const r = $(s) ? s : e.doc.createNode(s, { onTagObj: (l) => i = l });
1019
- i ?? (i = qs(e.doc.schema.tags, r));
1020
- const o = Vs(r, i, e);
1018
+ const r = v(s) ? s : e.doc.createNode(s, { onTagObj: (a) => i = a });
1019
+ i ?? (i = Xs(e.doc.schema.tags, r));
1020
+ const o = zs(r, i, e);
1021
1021
  o.length > 0 && (e.indentAtStart = (e.indentAtStart ?? 0) + o.length + 1);
1022
- const a = typeof i.stringify == "function" ? i.stringify(r, e, t, n) : T(r) ? at(r, e, t, n) : r.toString(e, t, n);
1023
- return o ? T(r) || a[0] === "{" || a[0] === "[" ? `${o} ${a}` : `${o}
1024
- ${e.indent}${a}` : a;
1022
+ const l = typeof i.stringify == "function" ? i.stringify(r, e, t, n) : I(r) ? ct(r, e, t, n) : r.toString(e, t, n);
1023
+ return o ? I(r) || l[0] === "{" || l[0] === "[" ? `${o} ${l}` : `${o}
1024
+ ${e.indent}${l}` : l;
1025
1025
  }
1026
- function Js({ key: s, value: e }, t, n, i) {
1027
- const { allNullValues: r, doc: o, indent: a, indentStep: l, options: { commentString: c, indentSeq: d, simpleKeys: u } } = t;
1028
- let f = $(s) && s.comment || null;
1026
+ function Zs({ key: s, value: e }, t, n, i) {
1027
+ const { allNullValues: r, doc: o, indent: l, indentStep: a, options: { commentString: c, indentSeq: d, simpleKeys: u } } = t;
1028
+ let f = v(s) && s.comment || null;
1029
1029
  if (u) {
1030
1030
  if (f)
1031
1031
  throw new Error("With simple keys, key nodes cannot have comments");
1032
- if (I(s) || !$(s) && typeof s == "object") {
1033
- const E = "With simple keys, collection cannot be used as a key value";
1034
- throw new Error(E);
1032
+ if (A(s) || !v(s) && typeof s == "object") {
1033
+ const T = "With simple keys, collection cannot be used as a key value";
1034
+ throw new Error(T);
1035
1035
  }
1036
1036
  }
1037
- let p = !u && (!s || f && e == null && !t.inFlow || I(s) || (T(s) ? s.type === O.BLOCK_FOLDED || s.type === O.BLOCK_LITERAL : typeof s == "object"));
1037
+ let p = !u && (!s || f && e == null && !t.inFlow || A(s) || (I(s) ? s.type === N.BLOCK_FOLDED || s.type === N.BLOCK_LITERAL : typeof s == "object"));
1038
1038
  t = Object.assign({}, t, {
1039
1039
  allNullValues: !1,
1040
1040
  implicitKey: !p && (u || !r),
1041
- indent: a + l
1041
+ indent: l + a
1042
1042
  });
1043
1043
  let g = !1, h = !1, m = re(s, t, () => g = !0, () => h = !0);
1044
1044
  if (!p && !t.inFlow && m.length > 1024) {
@@ -1052,54 +1052,54 @@ function Js({ key: s, value: e }, t, n, i) {
1052
1052
  } else if (r && !u || e == null && p)
1053
1053
  return m = `? ${m}`, f && !g ? m += G(m, t.indent, c(f)) : h && i && i(), m;
1054
1054
  g && (f = null), p ? (f && (m += G(m, t.indent, c(f))), m = `? ${m}
1055
- ${a}:`) : (m = `${m}:`, f && (m += G(m, t.indent, c(f))));
1056
- let b, w, k;
1057
- $(e) ? (b = !!e.spaceBefore, w = e.commentBefore, k = e.comment) : (b = !1, w = null, k = null, e && typeof e == "object" && (e = o.createNode(e))), t.implicitKey = !1, !p && !f && T(e) && (t.indentAtStart = m.length + 1), h = !1, !d && l.length >= 2 && !t.inFlow && !p && we(e) && !e.flow && !e.tag && !e.anchor && (t.indent = t.indent.substring(2));
1058
- let S = !1;
1059
- const N = re(e, t, () => S = !0, () => h = !0);
1060
- let A = " ";
1055
+ ${l}:`) : (m = `${m}:`, f && (m += G(m, t.indent, c(f))));
1056
+ let b, w, S;
1057
+ v(e) ? (b = !!e.spaceBefore, w = e.commentBefore, S = e.comment) : (b = !1, w = null, S = null, e && typeof e == "object" && (e = o.createNode(e))), t.implicitKey = !1, !p && !f && I(e) && (t.indentAtStart = m.length + 1), h = !1, !d && a.length >= 2 && !t.inFlow && !p && we(e) && !e.flow && !e.tag && !e.anchor && (t.indent = t.indent.substring(2));
1058
+ let k = !1;
1059
+ const _ = re(e, t, () => k = !0, () => h = !0);
1060
+ let O = " ";
1061
1061
  if (f || b || w) {
1062
- if (A = b ? `
1062
+ if (O = b ? `
1063
1063
  ` : "", w) {
1064
- const E = c(w);
1065
- A += `
1066
- ${F(E, t.indent)}`;
1064
+ const T = c(w);
1065
+ O += `
1066
+ ${U(T, t.indent)}`;
1067
1067
  }
1068
- N === "" && !t.inFlow ? A === `
1069
- ` && k && (A = `
1068
+ _ === "" && !t.inFlow ? O === `
1069
+ ` && S && (O = `
1070
1070
 
1071
- `) : A += `
1071
+ `) : O += `
1072
1072
  ${t.indent}`;
1073
- } else if (!p && I(e)) {
1074
- const E = N[0], y = N.indexOf(`
1075
- `), v = y !== -1, q = t.inFlow ?? e.flow ?? e.items.length === 0;
1076
- if (v || !q) {
1073
+ } else if (!p && A(e)) {
1074
+ const T = _[0], y = _.indexOf(`
1075
+ `), L = y !== -1, q = t.inFlow ?? e.flow ?? e.items.length === 0;
1076
+ if (L || !q) {
1077
1077
  let X = !1;
1078
- if (v && (E === "&" || E === "!")) {
1079
- let C = N.indexOf(" ");
1080
- E === "&" && C !== -1 && C < y && N[C + 1] === "!" && (C = N.indexOf(" ", C + 1)), (C === -1 || y < C) && (X = !0);
1078
+ if (L && (T === "&" || T === "!")) {
1079
+ let C = _.indexOf(" ");
1080
+ T === "&" && C !== -1 && C < y && _[C + 1] === "!" && (C = _.indexOf(" ", C + 1)), (C === -1 || y < C) && (X = !0);
1081
1081
  }
1082
- X || (A = `
1082
+ X || (O = `
1083
1083
  ${t.indent}`);
1084
1084
  }
1085
- } else (N === "" || N[0] === `
1086
- `) && (A = "");
1087
- return m += A + N, t.inFlow ? S && n && n() : k && !S ? m += G(m, t.indent, c(k)) : h && i && i(), m;
1085
+ } else (_ === "" || _[0] === `
1086
+ `) && (O = "");
1087
+ return m += O + _, t.inFlow ? k && n && n() : S && !k ? m += G(m, t.indent, c(S)) : h && i && i(), m;
1088
1088
  }
1089
- function Yt(s, e) {
1089
+ function Zt(s, e) {
1090
1090
  (s === "debug" || s === "warn") && console.warn(e);
1091
1091
  }
1092
- const Ne = "<<", R = {
1092
+ const Ne = "<<", F = {
1093
1093
  identify: (s) => s === Ne || typeof s == "symbol" && s.description === Ne,
1094
1094
  default: "key",
1095
1095
  tag: "tag:yaml.org,2002:merge",
1096
1096
  test: /^<<$/,
1097
- resolve: () => Object.assign(new O(Symbol(Ne)), {
1098
- addToJSMap: Gt
1097
+ resolve: () => Object.assign(new N(Symbol(Ne)), {
1098
+ addToJSMap: es
1099
1099
  }),
1100
1100
  stringify: () => Ne
1101
- }, Ys = (s, e) => (R.identify(e) || T(e) && (!e.type || e.type === O.PLAIN) && R.identify(e.value)) && s?.doc.schema.tags.some((t) => t.tag === R.tag && t.default);
1102
- function Gt(s, e, t) {
1101
+ }, en = (s, e) => (F.identify(e) || I(e) && (!e.type || e.type === N.PLAIN) && F.identify(e.value)) && s?.doc.schema.tags.some((t) => t.tag === F.tag && t.default);
1102
+ function es(s, e, t) {
1103
1103
  if (t = s && Q(t) ? t.resolve(s.doc) : t, we(t))
1104
1104
  for (const n of t.items)
1105
1105
  Ve(s, e, n);
@@ -1123,19 +1123,19 @@ function Ve(s, e, t) {
1123
1123
  });
1124
1124
  return e;
1125
1125
  }
1126
- function Wt(s, e, { key: t, value: n }) {
1127
- if ($(t) && t.addToJSMap)
1126
+ function ts(s, e, { key: t, value: n }) {
1127
+ if (v(t) && t.addToJSMap)
1128
1128
  t.addToJSMap(s, e, n);
1129
- else if (Ys(s, t))
1130
- Gt(s, e, n);
1129
+ else if (en(s, t))
1130
+ es(s, e, n);
1131
1131
  else {
1132
- const i = M(t, "", s);
1132
+ const i = P(t, "", s);
1133
1133
  if (e instanceof Map)
1134
- e.set(i, M(n, i, s));
1134
+ e.set(i, P(n, i, s));
1135
1135
  else if (e instanceof Set)
1136
1136
  e.add(i);
1137
1137
  else {
1138
- const r = Gs(t, i, s), o = M(n, r, s);
1138
+ const r = tn(t, i, s), o = P(n, r, s);
1139
1139
  r in e ? Object.defineProperty(e, r, {
1140
1140
  value: o,
1141
1141
  writable: !0,
@@ -1146,13 +1146,13 @@ function Wt(s, e, { key: t, value: n }) {
1146
1146
  }
1147
1147
  return e;
1148
1148
  }
1149
- function Gs(s, e, t) {
1149
+ function tn(s, e, t) {
1150
1150
  if (e === null)
1151
1151
  return "";
1152
1152
  if (typeof e != "object")
1153
1153
  return String(e);
1154
- if ($(s) && t?.doc) {
1155
- const n = Jt(t.doc, {});
1154
+ if (v(s) && t?.doc) {
1155
+ const n = zt(t.doc, {});
1156
1156
  n.anchors = /* @__PURE__ */ new Set();
1157
1157
  for (const r of t.anchors.keys())
1158
1158
  n.anchors.add(r.anchor);
@@ -1160,46 +1160,46 @@ function Gs(s, e, t) {
1160
1160
  const i = s.toString(n);
1161
1161
  if (!t.mapKeyWarned) {
1162
1162
  let r = JSON.stringify(i);
1163
- r.length > 40 && (r = r.substring(0, 36) + '..."'), Yt(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;
1163
+ r.length > 40 && (r = r.substring(0, 36) + '..."'), Zt(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;
1164
1164
  }
1165
1165
  return i;
1166
1166
  }
1167
1167
  return JSON.stringify(e);
1168
1168
  }
1169
- function lt(s, e, t) {
1169
+ function ft(s, e, t) {
1170
1170
  const n = ge(s, void 0, t), i = ge(e, void 0, t);
1171
- return new j(n, i);
1171
+ return new B(n, i);
1172
1172
  }
1173
- class j {
1173
+ class B {
1174
1174
  constructor(e, t = null) {
1175
- Object.defineProperty(this, P, { value: Pt }), this.key = e, this.value = t;
1175
+ Object.defineProperty(this, D, { value: Vt }), this.key = e, this.value = t;
1176
1176
  }
1177
1177
  clone(e) {
1178
1178
  let { key: t, value: n } = this;
1179
- return $(t) && (t = t.clone(e)), $(n) && (n = n.clone(e)), new j(t, n);
1179
+ return v(t) && (t = t.clone(e)), v(n) && (n = n.clone(e)), new B(t, n);
1180
1180
  }
1181
1181
  toJSON(e, t) {
1182
1182
  const n = t?.mapAsMap ? /* @__PURE__ */ new Map() : {};
1183
- return Wt(t, n, this);
1183
+ return ts(t, n, this);
1184
1184
  }
1185
1185
  toString(e, t, n) {
1186
- return e?.doc ? Js(this, e, t, n) : JSON.stringify(this);
1186
+ return e?.doc ? Zs(this, e, t, n) : JSON.stringify(this);
1187
1187
  }
1188
1188
  }
1189
- function Ht(s, e, t) {
1190
- return (e.inFlow ?? s.flow ? Hs : Ws)(s, e, t);
1189
+ function ss(s, e, t) {
1190
+ return (e.inFlow ?? s.flow ? nn : sn)(s, e, t);
1191
1191
  }
1192
- function Ws({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, itemIndent: r, onChompKeep: o, onComment: a }) {
1193
- const { indent: l, options: { commentString: c } } = t, d = Object.assign({}, t, { indent: r, type: null });
1192
+ function sn({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, itemIndent: r, onChompKeep: o, onComment: l }) {
1193
+ const { indent: a, options: { commentString: c } } = t, d = Object.assign({}, t, { indent: r, type: null });
1194
1194
  let u = !1;
1195
1195
  const f = [];
1196
1196
  for (let g = 0; g < e.length; ++g) {
1197
1197
  const h = e[g];
1198
1198
  let m = null;
1199
- if ($(h))
1199
+ if (v(h))
1200
1200
  !u && h.spaceBefore && f.push(""), Ce(t, f, h.commentBefore, u), h.comment && (m = h.comment);
1201
- else if (L(h)) {
1202
- const w = $(h.key) ? h.key : null;
1201
+ else if ($(h)) {
1202
+ const w = v(h.key) ? h.key : null;
1203
1203
  w && (!u && w.spaceBefore && f.push(""), Ce(t, f, w.commentBefore, u));
1204
1204
  }
1205
1205
  u = !1;
@@ -1214,17 +1214,17 @@ function Ws({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, ite
1214
1214
  for (let g = 1; g < f.length; ++g) {
1215
1215
  const h = f[g];
1216
1216
  p += h ? `
1217
- ${l}${h}` : `
1217
+ ${a}${h}` : `
1218
1218
  `;
1219
1219
  }
1220
1220
  }
1221
1221
  return s ? (p += `
1222
- ` + F(c(s), l), a && a()) : u && o && o(), p;
1222
+ ` + U(c(s), a), l && l()) : u && o && o(), p;
1223
1223
  }
1224
- function Hs({ items: s }, e, { flowChars: t, itemIndent: n }) {
1225
- const { indent: i, indentStep: r, flowCollectionPadding: o, options: { commentString: a } } = e;
1224
+ function nn({ items: s }, e, { flowChars: t, itemIndent: n }) {
1225
+ const { indent: i, indentStep: r, flowCollectionPadding: o, options: { commentString: l } } = e;
1226
1226
  n += r;
1227
- const l = Object.assign({}, e, {
1227
+ const a = Object.assign({}, e, {
1228
1228
  indent: n,
1229
1229
  inFlow: !0,
1230
1230
  type: null
@@ -1234,17 +1234,17 @@ function Hs({ items: s }, e, { flowChars: t, itemIndent: n }) {
1234
1234
  for (let g = 0; g < s.length; ++g) {
1235
1235
  const h = s[g];
1236
1236
  let m = null;
1237
- if ($(h))
1237
+ if (v(h))
1238
1238
  h.spaceBefore && u.push(""), Ce(e, u, h.commentBefore, !1), h.comment && (m = h.comment);
1239
- else if (L(h)) {
1240
- const w = $(h.key) ? h.key : null;
1239
+ else if ($(h)) {
1240
+ const w = v(h.key) ? h.key : null;
1241
1241
  w && (w.spaceBefore && u.push(""), Ce(e, u, w.commentBefore, !1), w.comment && (c = !0));
1242
- const k = $(h.value) ? h.value : null;
1243
- k ? (k.comment && (m = k.comment), k.commentBefore && (c = !0)) : h.value == null && w?.comment && (m = w.comment);
1242
+ const S = v(h.value) ? h.value : null;
1243
+ S ? (S.comment && (m = S.comment), S.commentBefore && (c = !0)) : h.value == null && w?.comment && (m = w.comment);
1244
1244
  }
1245
1245
  m && (c = !0);
1246
- let b = re(h, l, () => m = null);
1247
- g < s.length - 1 && (b += ","), m && (b += G(b, n, a(m))), !c && (u.length > d || b.includes(`
1246
+ let b = re(h, a, () => m = null);
1247
+ g < s.length - 1 && (b += ","), m && (b += G(b, n, l(m))), !c && (u.length > d || b.includes(`
1248
1248
  `)) && (c = !0), u.push(b), d = u.length;
1249
1249
  }
1250
1250
  const { start: f, end: p } = t;
@@ -1267,17 +1267,17 @@ ${i}${p}`;
1267
1267
  }
1268
1268
  function Ce({ indent: s, options: { commentString: e } }, t, n, i) {
1269
1269
  if (n && i && (n = n.replace(/^\n+/, "")), n) {
1270
- const r = F(e(n), s);
1270
+ const r = U(e(n), s);
1271
1271
  t.push(r.trimStart());
1272
1272
  }
1273
1273
  }
1274
- function W(s, e) {
1275
- const t = T(e) ? e.value : e;
1274
+ function H(s, e) {
1275
+ const t = I(e) ? e.value : e;
1276
1276
  for (const n of s)
1277
- if (L(n) && (n.key === e || n.key === t || T(n.key) && n.key.value === t))
1277
+ if ($(n) && (n.key === e || n.key === t || I(n.key) && n.key.value === t))
1278
1278
  return n;
1279
1279
  }
1280
- class B extends qt {
1280
+ class M extends Qt {
1281
1281
  static get tagName() {
1282
1282
  return "tag:yaml.org,2002:map";
1283
1283
  }
@@ -1289,19 +1289,19 @@ class B extends qt {
1289
1289
  * to other node classes that inherit from YAMLMap
1290
1290
  */
1291
1291
  static from(e, t, n) {
1292
- const { keepUndefined: i, replacer: r } = n, o = new this(e), a = (l, c) => {
1292
+ const { keepUndefined: i, replacer: r } = n, o = new this(e), l = (a, c) => {
1293
1293
  if (typeof r == "function")
1294
- c = r.call(t, l, c);
1295
- else if (Array.isArray(r) && !r.includes(l))
1294
+ c = r.call(t, a, c);
1295
+ else if (Array.isArray(r) && !r.includes(a))
1296
1296
  return;
1297
- (c !== void 0 || i) && o.items.push(lt(l, c, n));
1297
+ (c !== void 0 || i) && o.items.push(ft(a, c, n));
1298
1298
  };
1299
1299
  if (t instanceof Map)
1300
- for (const [l, c] of t)
1301
- a(l, c);
1300
+ for (const [a, c] of t)
1301
+ l(a, c);
1302
1302
  else if (t && typeof t == "object")
1303
- for (const l of Object.keys(t))
1304
- a(l, t[l]);
1303
+ for (const a of Object.keys(t))
1304
+ l(a, t[a]);
1305
1305
  return typeof e.sortMapEntries == "function" && o.items.sort(e.sortMapEntries), o;
1306
1306
  }
1307
1307
  /**
@@ -1312,31 +1312,31 @@ class B extends qt {
1312
1312
  */
1313
1313
  add(e, t) {
1314
1314
  let n;
1315
- L(e) ? n = e : !e || typeof e != "object" || !("key" in e) ? n = new j(e, e?.value) : n = new j(e.key, e.value);
1316
- const i = W(this.items, n.key), r = this.schema?.sortMapEntries;
1315
+ $(e) ? n = e : !e || typeof e != "object" || !("key" in e) ? n = new B(e, e?.value) : n = new B(e.key, e.value);
1316
+ const i = H(this.items, n.key), r = this.schema?.sortMapEntries;
1317
1317
  if (i) {
1318
1318
  if (!t)
1319
1319
  throw new Error(`Key ${n.key} already set`);
1320
- T(i.value) && Rt(n.value) ? i.value.value = n.value : i.value = n.value;
1320
+ I(i.value) && Wt(n.value) ? i.value.value = n.value : i.value = n.value;
1321
1321
  } else if (r) {
1322
- const o = this.items.findIndex((a) => r(n, a) < 0);
1322
+ const o = this.items.findIndex((l) => r(n, l) < 0);
1323
1323
  o === -1 ? this.items.push(n) : this.items.splice(o, 0, n);
1324
1324
  } else
1325
1325
  this.items.push(n);
1326
1326
  }
1327
1327
  delete(e) {
1328
- const t = W(this.items, e);
1328
+ const t = H(this.items, e);
1329
1329
  return t ? this.items.splice(this.items.indexOf(t), 1).length > 0 : !1;
1330
1330
  }
1331
1331
  get(e, t) {
1332
- const i = W(this.items, e)?.value;
1333
- return (!t && T(i) ? i.value : i) ?? void 0;
1332
+ const i = H(this.items, e)?.value;
1333
+ return (!t && I(i) ? i.value : i) ?? void 0;
1334
1334
  }
1335
1335
  has(e) {
1336
- return !!W(this.items, e);
1336
+ return !!H(this.items, e);
1337
1337
  }
1338
1338
  set(e, t) {
1339
- this.add(new j(e, t), !0);
1339
+ this.add(new B(e, t), !0);
1340
1340
  }
1341
1341
  /**
1342
1342
  * @param ctx - Conversion context, originally set in Document#toJS()
@@ -1347,16 +1347,16 @@ class B extends qt {
1347
1347
  const i = n ? new n() : t?.mapAsMap ? /* @__PURE__ */ new Map() : {};
1348
1348
  t?.onCreate && t.onCreate(i);
1349
1349
  for (const r of this.items)
1350
- Wt(t, i, r);
1350
+ ts(t, i, r);
1351
1351
  return i;
1352
1352
  }
1353
1353
  toString(e, t, n) {
1354
1354
  if (!e)
1355
1355
  return JSON.stringify(this);
1356
1356
  for (const i of this.items)
1357
- if (!L(i))
1357
+ if (!$(i))
1358
1358
  throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);
1359
- return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), Ht(this, e, {
1359
+ return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), ss(this, e, {
1360
1360
  blockItemPrefix: "",
1361
1361
  flowChars: { start: "{", end: "}" },
1362
1362
  itemIndent: e.indent || "",
@@ -1368,19 +1368,19 @@ class B extends qt {
1368
1368
  const ce = {
1369
1369
  collection: "map",
1370
1370
  default: !0,
1371
- nodeClass: B,
1371
+ nodeClass: M,
1372
1372
  tag: "tag:yaml.org,2002:map",
1373
1373
  resolve(s, e) {
1374
1374
  return be(s) || e("Expected a mapping for this tag"), s;
1375
1375
  },
1376
- createNode: (s, e, t) => B.from(s, e, t)
1376
+ createNode: (s, e, t) => M.from(s, e, t)
1377
1377
  };
1378
- class H extends qt {
1378
+ class W extends Qt {
1379
1379
  static get tagName() {
1380
1380
  return "tag:yaml.org,2002:seq";
1381
1381
  }
1382
1382
  constructor(e) {
1383
- super(ae, e), this.items = [];
1383
+ super(le, e), this.items = [];
1384
1384
  }
1385
1385
  add(e) {
1386
1386
  this.items.push(e);
@@ -1402,7 +1402,7 @@ class H extends qt {
1402
1402
  if (typeof n != "number")
1403
1403
  return;
1404
1404
  const i = this.items[n];
1405
- return !t && T(i) ? i.value : i;
1405
+ return !t && I(i) ? i.value : i;
1406
1406
  }
1407
1407
  /**
1408
1408
  * Checks if the collection includes a value with the key `key`.
@@ -1426,18 +1426,18 @@ class H extends qt {
1426
1426
  if (typeof n != "number")
1427
1427
  throw new Error(`Expected a valid index, not ${e}.`);
1428
1428
  const i = this.items[n];
1429
- T(i) && Rt(t) ? i.value = t : this.items[n] = t;
1429
+ I(i) && Wt(t) ? i.value = t : this.items[n] = t;
1430
1430
  }
1431
1431
  toJSON(e, t) {
1432
1432
  const n = [];
1433
1433
  t?.onCreate && t.onCreate(n);
1434
1434
  let i = 0;
1435
1435
  for (const r of this.items)
1436
- n.push(M(r, String(i++), t));
1436
+ n.push(P(r, String(i++), t));
1437
1437
  return n;
1438
1438
  }
1439
1439
  toString(e, t, n) {
1440
- return e ? Ht(this, e, {
1440
+ return e ? ss(this, e, {
1441
1441
  blockItemPrefix: "- ",
1442
1442
  flowChars: { start: "[", end: "]" },
1443
1443
  itemIndent: (e.indent || "") + " ",
@@ -1449,54 +1449,54 @@ class H extends qt {
1449
1449
  const { replacer: i } = n, r = new this(e);
1450
1450
  if (t && Symbol.iterator in Object(t)) {
1451
1451
  let o = 0;
1452
- for (let a of t) {
1452
+ for (let l of t) {
1453
1453
  if (typeof i == "function") {
1454
- const l = t instanceof Set ? a : String(o++);
1455
- a = i.call(t, l, a);
1454
+ const a = t instanceof Set ? l : String(o++);
1455
+ l = i.call(t, a, l);
1456
1456
  }
1457
- r.items.push(ge(a, void 0, n));
1457
+ r.items.push(ge(l, void 0, n));
1458
1458
  }
1459
1459
  }
1460
1460
  return r;
1461
1461
  }
1462
1462
  }
1463
1463
  function Oe(s) {
1464
- let e = T(s) ? s.value : s;
1464
+ let e = I(s) ? s.value : s;
1465
1465
  return e && typeof e == "string" && (e = Number(e)), typeof e == "number" && Number.isInteger(e) && e >= 0 ? e : null;
1466
1466
  }
1467
1467
  const fe = {
1468
1468
  collection: "seq",
1469
1469
  default: !0,
1470
- nodeClass: H,
1470
+ nodeClass: W,
1471
1471
  tag: "tag:yaml.org,2002:seq",
1472
1472
  resolve(s, e) {
1473
1473
  return we(s) || e("Expected a sequence for this tag"), s;
1474
1474
  },
1475
- createNode: (s, e, t) => H.from(s, e, t)
1476
- }, Ke = {
1475
+ createNode: (s, e, t) => W.from(s, e, t)
1476
+ }, xe = {
1477
1477
  identify: (s) => typeof s == "string",
1478
1478
  default: !0,
1479
1479
  tag: "tag:yaml.org,2002:str",
1480
1480
  resolve: (s) => s,
1481
1481
  stringify(s, e, t, n) {
1482
- return e = Object.assign({ actualString: !0 }, e), at(s, e, t, n);
1482
+ return e = Object.assign({ actualString: !0 }, e), ct(s, e, t, n);
1483
1483
  }
1484
- }, De = {
1484
+ }, Ke = {
1485
1485
  identify: (s) => s == null,
1486
- createNode: () => new O(null),
1486
+ createNode: () => new N(null),
1487
1487
  default: !0,
1488
1488
  tag: "tag:yaml.org,2002:null",
1489
1489
  test: /^(?:~|[Nn]ull|NULL)?$/,
1490
- resolve: () => new O(null),
1491
- stringify: ({ source: s }, e) => typeof s == "string" && De.test.test(s) ? s : e.options.nullStr
1492
- }, ct = {
1490
+ resolve: () => new N(null),
1491
+ stringify: ({ source: s }, e) => typeof s == "string" && Ke.test.test(s) ? s : e.options.nullStr
1492
+ }, ut = {
1493
1493
  identify: (s) => typeof s == "boolean",
1494
1494
  default: !0,
1495
1495
  tag: "tag:yaml.org,2002:bool",
1496
1496
  test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
1497
- resolve: (s) => new O(s[0] === "t" || s[0] === "T"),
1497
+ resolve: (s) => new N(s[0] === "t" || s[0] === "T"),
1498
1498
  stringify({ source: s, value: e }, t) {
1499
- if (s && ct.test.test(s)) {
1499
+ if (s && ut.test.test(s)) {
1500
1500
  const n = s[0] === "t" || s[0] === "T";
1501
1501
  if (e === n)
1502
1502
  return s;
@@ -1504,7 +1504,7 @@ const fe = {
1504
1504
  return e ? t.options.trueStr : t.options.falseStr;
1505
1505
  }
1506
1506
  };
1507
- function D({ format: s, minFractionDigits: e, tag: t, value: n }) {
1507
+ function K({ format: s, minFractionDigits: e, tag: t, value: n }) {
1508
1508
  if (typeof n == "bigint")
1509
1509
  return String(n);
1510
1510
  const i = typeof n == "number" ? n : Number(n);
@@ -1514,20 +1514,20 @@ function D({ format: s, minFractionDigits: e, tag: t, value: n }) {
1514
1514
  if (!s && e && (!t || t === "tag:yaml.org,2002:float") && /^\d/.test(r)) {
1515
1515
  let o = r.indexOf(".");
1516
1516
  o < 0 && (o = r.length, r += ".");
1517
- let a = e - (r.length - o - 1);
1518
- for (; a-- > 0; )
1517
+ let l = e - (r.length - o - 1);
1518
+ for (; l-- > 0; )
1519
1519
  r += "0";
1520
1520
  }
1521
1521
  return r;
1522
1522
  }
1523
- const Qt = {
1523
+ const ns = {
1524
1524
  identify: (s) => typeof s == "number",
1525
1525
  default: !0,
1526
1526
  tag: "tag:yaml.org,2002:float",
1527
1527
  test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
1528
1528
  resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
1529
- stringify: D
1530
- }, Xt = {
1529
+ stringify: K
1530
+ }, is = {
1531
1531
  identify: (s) => typeof s == "number",
1532
1532
  default: !0,
1533
1533
  tag: "tag:yaml.org,2002:float",
@@ -1536,78 +1536,78 @@ const Qt = {
1536
1536
  resolve: (s) => parseFloat(s),
1537
1537
  stringify(s) {
1538
1538
  const e = Number(s.value);
1539
- return isFinite(e) ? e.toExponential() : D(s);
1539
+ return isFinite(e) ? e.toExponential() : K(s);
1540
1540
  }
1541
- }, xt = {
1541
+ }, rs = {
1542
1542
  identify: (s) => typeof s == "number",
1543
1543
  default: !0,
1544
1544
  tag: "tag:yaml.org,2002:float",
1545
1545
  test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
1546
1546
  resolve(s) {
1547
- const e = new O(parseFloat(s)), t = s.indexOf(".");
1547
+ const e = new N(parseFloat(s)), t = s.indexOf(".");
1548
1548
  return t !== -1 && s[s.length - 1] === "0" && (e.minFractionDigits = s.length - t - 1), e;
1549
1549
  },
1550
- stringify: D
1551
- }, Ue = (s) => typeof s == "bigint" || Number.isInteger(s), ft = (s, e, t, { intAsBigInt: n }) => n ? BigInt(s) : parseInt(s.substring(e), t);
1552
- function zt(s, e, t) {
1550
+ stringify: K
1551
+ }, Re = (s) => typeof s == "bigint" || Number.isInteger(s), ht = (s, e, t, { intAsBigInt: n }) => n ? BigInt(s) : parseInt(s.substring(e), t);
1552
+ function os(s, e, t) {
1553
1553
  const { value: n } = s;
1554
- return Ue(n) && n >= 0 ? t + n.toString(e) : D(s);
1554
+ return Re(n) && n >= 0 ? t + n.toString(e) : K(s);
1555
1555
  }
1556
- const Zt = {
1557
- identify: (s) => Ue(s) && s >= 0,
1556
+ const ls = {
1557
+ identify: (s) => Re(s) && s >= 0,
1558
1558
  default: !0,
1559
1559
  tag: "tag:yaml.org,2002:int",
1560
1560
  format: "OCT",
1561
1561
  test: /^0o[0-7]+$/,
1562
- resolve: (s, e, t) => ft(s, 2, 8, t),
1563
- stringify: (s) => zt(s, 8, "0o")
1564
- }, es = {
1565
- identify: Ue,
1562
+ resolve: (s, e, t) => ht(s, 2, 8, t),
1563
+ stringify: (s) => os(s, 8, "0o")
1564
+ }, as = {
1565
+ identify: Re,
1566
1566
  default: !0,
1567
1567
  tag: "tag:yaml.org,2002:int",
1568
1568
  test: /^[-+]?[0-9]+$/,
1569
- resolve: (s, e, t) => ft(s, 0, 10, t),
1570
- stringify: D
1571
- }, ts = {
1572
- identify: (s) => Ue(s) && s >= 0,
1569
+ resolve: (s, e, t) => ht(s, 0, 10, t),
1570
+ stringify: K
1571
+ }, cs = {
1572
+ identify: (s) => Re(s) && s >= 0,
1573
1573
  default: !0,
1574
1574
  tag: "tag:yaml.org,2002:int",
1575
1575
  format: "HEX",
1576
1576
  test: /^0x[0-9a-fA-F]+$/,
1577
- resolve: (s, e, t) => ft(s, 2, 16, t),
1578
- stringify: (s) => zt(s, 16, "0x")
1579
- }, Qs = [
1577
+ resolve: (s, e, t) => ht(s, 2, 16, t),
1578
+ stringify: (s) => os(s, 16, "0x")
1579
+ }, rn = [
1580
1580
  ce,
1581
1581
  fe,
1582
+ xe,
1582
1583
  Ke,
1583
- De,
1584
- ct,
1585
- Zt,
1586
- es,
1587
- ts,
1588
- Qt,
1589
- Xt,
1590
- xt
1584
+ ut,
1585
+ ls,
1586
+ as,
1587
+ cs,
1588
+ ns,
1589
+ is,
1590
+ rs
1591
1591
  ];
1592
- function Nt(s) {
1592
+ function Et(s) {
1593
1593
  return typeof s == "bigint" || Number.isInteger(s);
1594
1594
  }
1595
- const Ae = ({ value: s }) => JSON.stringify(s), Xs = [
1595
+ const Ee = ({ value: s }) => JSON.stringify(s), on = [
1596
1596
  {
1597
1597
  identify: (s) => typeof s == "string",
1598
1598
  default: !0,
1599
1599
  tag: "tag:yaml.org,2002:str",
1600
1600
  resolve: (s) => s,
1601
- stringify: Ae
1601
+ stringify: Ee
1602
1602
  },
1603
1603
  {
1604
1604
  identify: (s) => s == null,
1605
- createNode: () => new O(null),
1605
+ createNode: () => new N(null),
1606
1606
  default: !0,
1607
1607
  tag: "tag:yaml.org,2002:null",
1608
1608
  test: /^null$/,
1609
1609
  resolve: () => null,
1610
- stringify: Ae
1610
+ stringify: Ee
1611
1611
  },
1612
1612
  {
1613
1613
  identify: (s) => typeof s == "boolean",
@@ -1615,15 +1615,15 @@ const Ae = ({ value: s }) => JSON.stringify(s), Xs = [
1615
1615
  tag: "tag:yaml.org,2002:bool",
1616
1616
  test: /^true$|^false$/,
1617
1617
  resolve: (s) => s === "true",
1618
- stringify: Ae
1618
+ stringify: Ee
1619
1619
  },
1620
1620
  {
1621
- identify: Nt,
1621
+ identify: Et,
1622
1622
  default: !0,
1623
1623
  tag: "tag:yaml.org,2002:int",
1624
1624
  test: /^-?(?:0|[1-9][0-9]*)$/,
1625
1625
  resolve: (s, e, { intAsBigInt: t }) => t ? BigInt(s) : parseInt(s, 10),
1626
- stringify: ({ value: s }) => Nt(s) ? s.toString() : JSON.stringify(s)
1626
+ stringify: ({ value: s }) => Et(s) ? s.toString() : JSON.stringify(s)
1627
1627
  },
1628
1628
  {
1629
1629
  identify: (s) => typeof s == "number",
@@ -1631,16 +1631,16 @@ const Ae = ({ value: s }) => JSON.stringify(s), Xs = [
1631
1631
  tag: "tag:yaml.org,2002:float",
1632
1632
  test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
1633
1633
  resolve: (s) => parseFloat(s),
1634
- stringify: Ae
1634
+ stringify: Ee
1635
1635
  }
1636
- ], xs = {
1636
+ ], ln = {
1637
1637
  default: !0,
1638
1638
  tag: "",
1639
1639
  test: /^/,
1640
1640
  resolve(s, e) {
1641
1641
  return e(`Unresolved plain scalar ${JSON.stringify(s)}`), s;
1642
1642
  }
1643
- }, zs = [ce, fe].concat(Xs, xs), ut = {
1643
+ }, an = [ce, fe].concat(on, ln), dt = {
1644
1644
  identify: (s) => s instanceof Uint8Array,
1645
1645
  // Buffer inherits from Uint8Array
1646
1646
  default: !1,
@@ -1666,32 +1666,32 @@ const Ae = ({ value: s }) => JSON.stringify(s), Xs = [
1666
1666
  if (!t)
1667
1667
  return "";
1668
1668
  const o = t;
1669
- let a;
1669
+ let l;
1670
1670
  if (typeof btoa == "function") {
1671
- let l = "";
1671
+ let a = "";
1672
1672
  for (let c = 0; c < o.length; ++c)
1673
- l += String.fromCharCode(o[c]);
1674
- a = btoa(l);
1673
+ a += String.fromCharCode(o[c]);
1674
+ l = btoa(a);
1675
1675
  } else
1676
1676
  throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
1677
- if (e ?? (e = O.BLOCK_LITERAL), e !== O.QUOTE_DOUBLE) {
1678
- const l = Math.max(n.options.lineWidth - n.indent.length, n.options.minContentWidth), c = Math.ceil(a.length / l), d = new Array(c);
1679
- for (let u = 0, f = 0; u < c; ++u, f += l)
1680
- d[u] = a.substr(f, l);
1681
- a = d.join(e === O.BLOCK_LITERAL ? `
1677
+ if (e ?? (e = N.BLOCK_LITERAL), e !== N.QUOTE_DOUBLE) {
1678
+ const a = Math.max(n.options.lineWidth - n.indent.length, n.options.minContentWidth), c = Math.ceil(l.length / a), d = new Array(c);
1679
+ for (let u = 0, f = 0; u < c; ++u, f += a)
1680
+ d[u] = l.substr(f, a);
1681
+ l = d.join(e === N.BLOCK_LITERAL ? `
1682
1682
  ` : " ");
1683
1683
  }
1684
- return at({ comment: s, type: e, value: a }, n, i, r);
1684
+ return ct({ comment: s, type: e, value: l }, n, i, r);
1685
1685
  }
1686
1686
  };
1687
- function ss(s, e) {
1687
+ function fs(s, e) {
1688
1688
  if (we(s))
1689
1689
  for (let t = 0; t < s.items.length; ++t) {
1690
1690
  let n = s.items[t];
1691
- if (!L(n)) {
1691
+ if (!$(n)) {
1692
1692
  if (be(n)) {
1693
1693
  n.items.length > 1 && e("Each pair must have its own sequence indicator");
1694
- const i = n.items[0] || new j(new O(null));
1694
+ const i = n.items[0] || new B(new N(null));
1695
1695
  if (n.commentBefore && (i.key.commentBefore = i.key.commentBefore ? `${n.commentBefore}
1696
1696
  ${i.key.commentBefore}` : n.commentBefore), n.comment) {
1697
1697
  const r = i.value ?? i.key;
@@ -1700,48 +1700,48 @@ ${r.comment}` : n.comment;
1700
1700
  }
1701
1701
  n = i;
1702
1702
  }
1703
- s.items[t] = L(n) ? n : new j(n);
1703
+ s.items[t] = $(n) ? n : new B(n);
1704
1704
  }
1705
1705
  }
1706
1706
  else
1707
1707
  e("Expected a sequence for this tag");
1708
1708
  return s;
1709
1709
  }
1710
- function ns(s, e, t) {
1711
- const { replacer: n } = t, i = new H(s);
1710
+ function us(s, e, t) {
1711
+ const { replacer: n } = t, i = new W(s);
1712
1712
  i.tag = "tag:yaml.org,2002:pairs";
1713
1713
  let r = 0;
1714
1714
  if (e && Symbol.iterator in Object(e))
1715
1715
  for (let o of e) {
1716
1716
  typeof n == "function" && (o = n.call(e, String(r++), o));
1717
- let a, l;
1717
+ let l, a;
1718
1718
  if (Array.isArray(o))
1719
1719
  if (o.length === 2)
1720
- a = o[0], l = o[1];
1720
+ l = o[0], a = o[1];
1721
1721
  else
1722
1722
  throw new TypeError(`Expected [key, value] tuple: ${o}`);
1723
1723
  else if (o && o instanceof Object) {
1724
1724
  const c = Object.keys(o);
1725
1725
  if (c.length === 1)
1726
- a = c[0], l = o[a];
1726
+ l = c[0], a = o[l];
1727
1727
  else
1728
1728
  throw new TypeError(`Expected tuple with one key, not ${c.length} keys`);
1729
1729
  } else
1730
- a = o;
1731
- i.items.push(lt(a, l, t));
1730
+ l = o;
1731
+ i.items.push(ft(l, a, t));
1732
1732
  }
1733
1733
  return i;
1734
1734
  }
1735
- const ht = {
1735
+ const pt = {
1736
1736
  collection: "seq",
1737
1737
  default: !1,
1738
1738
  tag: "tag:yaml.org,2002:pairs",
1739
- resolve: ss,
1740
- createNode: ns
1739
+ resolve: fs,
1740
+ createNode: us
1741
1741
  };
1742
- class ne extends H {
1742
+ class ne extends W {
1743
1743
  constructor() {
1744
- super(), this.add = B.prototype.add.bind(this), this.delete = B.prototype.delete.bind(this), this.get = B.prototype.get.bind(this), this.has = B.prototype.has.bind(this), this.set = B.prototype.set.bind(this), this.tag = ne.tag;
1744
+ super(), this.add = M.prototype.add.bind(this), this.delete = M.prototype.delete.bind(this), this.get = M.prototype.get.bind(this), this.has = M.prototype.has.bind(this), this.set = M.prototype.set.bind(this), this.tag = ne.tag;
1745
1745
  }
1746
1746
  /**
1747
1747
  * If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
@@ -1754,57 +1754,57 @@ class ne extends H {
1754
1754
  t?.onCreate && t.onCreate(n);
1755
1755
  for (const i of this.items) {
1756
1756
  let r, o;
1757
- if (L(i) ? (r = M(i.key, "", t), o = M(i.value, r, t)) : r = M(i, "", t), n.has(r))
1757
+ if ($(i) ? (r = P(i.key, "", t), o = P(i.value, r, t)) : r = P(i, "", t), n.has(r))
1758
1758
  throw new Error("Ordered maps must not include duplicate keys");
1759
1759
  n.set(r, o);
1760
1760
  }
1761
1761
  return n;
1762
1762
  }
1763
1763
  static from(e, t, n) {
1764
- const i = ns(e, t, n), r = new this();
1764
+ const i = us(e, t, n), r = new this();
1765
1765
  return r.items = i.items, r;
1766
1766
  }
1767
1767
  }
1768
1768
  ne.tag = "tag:yaml.org,2002:omap";
1769
- const dt = {
1769
+ const mt = {
1770
1770
  collection: "seq",
1771
1771
  identify: (s) => s instanceof Map,
1772
1772
  nodeClass: ne,
1773
1773
  default: !1,
1774
1774
  tag: "tag:yaml.org,2002:omap",
1775
1775
  resolve(s, e) {
1776
- const t = ss(s, e), n = [];
1776
+ const t = fs(s, e), n = [];
1777
1777
  for (const { key: i } of t.items)
1778
- T(i) && (n.includes(i.value) ? e(`Ordered maps must not include duplicate keys: ${i.value}`) : n.push(i.value));
1778
+ I(i) && (n.includes(i.value) ? e(`Ordered maps must not include duplicate keys: ${i.value}`) : n.push(i.value));
1779
1779
  return Object.assign(new ne(), t);
1780
1780
  },
1781
1781
  createNode: (s, e, t) => ne.from(s, e, t)
1782
1782
  };
1783
- function is({ value: s, source: e }, t) {
1784
- return e && (s ? rs : os).test.test(e) ? e : s ? t.options.trueStr : t.options.falseStr;
1783
+ function hs({ value: s, source: e }, t) {
1784
+ return e && (s ? ds : ps).test.test(e) ? e : s ? t.options.trueStr : t.options.falseStr;
1785
1785
  }
1786
- const rs = {
1786
+ const ds = {
1787
1787
  identify: (s) => s === !0,
1788
1788
  default: !0,
1789
1789
  tag: "tag:yaml.org,2002:bool",
1790
1790
  test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
1791
- resolve: () => new O(!0),
1792
- stringify: is
1793
- }, os = {
1791
+ resolve: () => new N(!0),
1792
+ stringify: hs
1793
+ }, ps = {
1794
1794
  identify: (s) => s === !1,
1795
1795
  default: !0,
1796
1796
  tag: "tag:yaml.org,2002:bool",
1797
1797
  test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
1798
- resolve: () => new O(!1),
1799
- stringify: is
1800
- }, Zs = {
1798
+ resolve: () => new N(!1),
1799
+ stringify: hs
1800
+ }, cn = {
1801
1801
  identify: (s) => typeof s == "number",
1802
1802
  default: !0,
1803
1803
  tag: "tag:yaml.org,2002:float",
1804
1804
  test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
1805
1805
  resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
1806
- stringify: D
1807
- }, en = {
1806
+ stringify: K
1807
+ }, fn = {
1808
1808
  identify: (s) => typeof s == "number",
1809
1809
  default: !0,
1810
1810
  tag: "tag:yaml.org,2002:float",
@@ -1813,24 +1813,24 @@ const rs = {
1813
1813
  resolve: (s) => parseFloat(s.replace(/_/g, "")),
1814
1814
  stringify(s) {
1815
1815
  const e = Number(s.value);
1816
- return isFinite(e) ? e.toExponential() : D(s);
1816
+ return isFinite(e) ? e.toExponential() : K(s);
1817
1817
  }
1818
- }, tn = {
1818
+ }, un = {
1819
1819
  identify: (s) => typeof s == "number",
1820
1820
  default: !0,
1821
1821
  tag: "tag:yaml.org,2002:float",
1822
1822
  test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
1823
1823
  resolve(s) {
1824
- const e = new O(parseFloat(s.replace(/_/g, ""))), t = s.indexOf(".");
1824
+ const e = new N(parseFloat(s.replace(/_/g, ""))), t = s.indexOf(".");
1825
1825
  if (t !== -1) {
1826
1826
  const n = s.substring(t + 1).replace(/_/g, "");
1827
1827
  n[n.length - 1] === "0" && (e.minFractionDigits = n.length);
1828
1828
  }
1829
1829
  return e;
1830
1830
  },
1831
- stringify: D
1832
- }, ke = (s) => typeof s == "bigint" || Number.isInteger(s);
1833
- function Fe(s, e, t, { intAsBigInt: n }) {
1831
+ stringify: K
1832
+ }, Se = (s) => typeof s == "bigint" || Number.isInteger(s);
1833
+ function Ue(s, e, t, { intAsBigInt: n }) {
1834
1834
  const i = s[0];
1835
1835
  if ((i === "-" || i === "+") && (e += 1), s = s.substring(e).replace(/_/g, ""), n) {
1836
1836
  switch (t) {
@@ -1850,67 +1850,67 @@ function Fe(s, e, t, { intAsBigInt: n }) {
1850
1850
  const r = parseInt(s, t);
1851
1851
  return i === "-" ? -1 * r : r;
1852
1852
  }
1853
- function pt(s, e, t) {
1853
+ function gt(s, e, t) {
1854
1854
  const { value: n } = s;
1855
- if (ke(n)) {
1855
+ if (Se(n)) {
1856
1856
  const i = n.toString(e);
1857
1857
  return n < 0 ? "-" + t + i.substr(1) : t + i;
1858
1858
  }
1859
- return D(s);
1859
+ return K(s);
1860
1860
  }
1861
- const sn = {
1862
- identify: ke,
1861
+ const hn = {
1862
+ identify: Se,
1863
1863
  default: !0,
1864
1864
  tag: "tag:yaml.org,2002:int",
1865
1865
  format: "BIN",
1866
1866
  test: /^[-+]?0b[0-1_]+$/,
1867
- resolve: (s, e, t) => Fe(s, 2, 2, t),
1868
- stringify: (s) => pt(s, 2, "0b")
1869
- }, nn = {
1870
- identify: ke,
1867
+ resolve: (s, e, t) => Ue(s, 2, 2, t),
1868
+ stringify: (s) => gt(s, 2, "0b")
1869
+ }, dn = {
1870
+ identify: Se,
1871
1871
  default: !0,
1872
1872
  tag: "tag:yaml.org,2002:int",
1873
1873
  format: "OCT",
1874
1874
  test: /^[-+]?0[0-7_]+$/,
1875
- resolve: (s, e, t) => Fe(s, 1, 8, t),
1876
- stringify: (s) => pt(s, 8, "0")
1877
- }, rn = {
1878
- identify: ke,
1875
+ resolve: (s, e, t) => Ue(s, 1, 8, t),
1876
+ stringify: (s) => gt(s, 8, "0")
1877
+ }, pn = {
1878
+ identify: Se,
1879
1879
  default: !0,
1880
1880
  tag: "tag:yaml.org,2002:int",
1881
1881
  test: /^[-+]?[0-9][0-9_]*$/,
1882
- resolve: (s, e, t) => Fe(s, 0, 10, t),
1883
- stringify: D
1884
- }, on = {
1885
- identify: ke,
1882
+ resolve: (s, e, t) => Ue(s, 0, 10, t),
1883
+ stringify: K
1884
+ }, mn = {
1885
+ identify: Se,
1886
1886
  default: !0,
1887
1887
  tag: "tag:yaml.org,2002:int",
1888
1888
  format: "HEX",
1889
1889
  test: /^[-+]?0x[0-9a-fA-F_]+$/,
1890
- resolve: (s, e, t) => Fe(s, 2, 16, t),
1891
- stringify: (s) => pt(s, 16, "0x")
1890
+ resolve: (s, e, t) => Ue(s, 2, 16, t),
1891
+ stringify: (s) => gt(s, 16, "0x")
1892
1892
  };
1893
- class ie extends B {
1893
+ class ie extends M {
1894
1894
  constructor(e) {
1895
1895
  super(e), this.tag = ie.tag;
1896
1896
  }
1897
1897
  add(e) {
1898
1898
  let t;
1899
- L(e) ? t = e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? t = new j(e.key, null) : t = new j(e, null), W(this.items, t.key) || this.items.push(t);
1899
+ $(e) ? t = e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? t = new B(e.key, null) : t = new B(e, null), H(this.items, t.key) || this.items.push(t);
1900
1900
  }
1901
1901
  /**
1902
1902
  * If `keepPair` is `true`, returns the Pair matching `key`.
1903
1903
  * Otherwise, returns the value of that Pair's key.
1904
1904
  */
1905
1905
  get(e, t) {
1906
- const n = W(this.items, e);
1907
- return !t && L(n) ? T(n.key) ? n.key.value : n.key : n;
1906
+ const n = H(this.items, e);
1907
+ return !t && $(n) ? I(n.key) ? n.key.value : n.key : n;
1908
1908
  }
1909
1909
  set(e, t) {
1910
1910
  if (typeof t != "boolean")
1911
1911
  throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);
1912
- const n = W(this.items, e);
1913
- n && !t ? this.items.splice(this.items.indexOf(n), 1) : !n && t && this.items.push(new j(e));
1912
+ const n = H(this.items, e);
1913
+ n && !t ? this.items.splice(this.items.indexOf(n), 1) : !n && t && this.items.push(new B(e));
1914
1914
  }
1915
1915
  toJSON(e, t) {
1916
1916
  return super.toJSON(e, t, Set);
@@ -1926,12 +1926,12 @@ class ie extends B {
1926
1926
  const { replacer: i } = n, r = new this(e);
1927
1927
  if (t && Symbol.iterator in Object(t))
1928
1928
  for (let o of t)
1929
- typeof i == "function" && (o = i.call(t, o, o)), r.items.push(lt(o, null, n));
1929
+ typeof i == "function" && (o = i.call(t, o, o)), r.items.push(ft(o, null, n));
1930
1930
  return r;
1931
1931
  }
1932
1932
  }
1933
1933
  ie.tag = "tag:yaml.org,2002:set";
1934
- const mt = {
1934
+ const yt = {
1935
1935
  collection: "map",
1936
1936
  identify: (s) => s instanceof Set,
1937
1937
  nodeClass: ie,
@@ -1948,38 +1948,38 @@ const mt = {
1948
1948
  return s;
1949
1949
  }
1950
1950
  };
1951
- function gt(s, e) {
1952
- 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));
1951
+ function bt(s, e) {
1952
+ 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, l) => o * i(60) + i(l), i(0));
1953
1953
  return t === "-" ? i(-1) * r : r;
1954
1954
  }
1955
- function as(s) {
1955
+ function ms(s) {
1956
1956
  let { value: e } = s, t = (o) => o;
1957
1957
  if (typeof e == "bigint")
1958
1958
  t = (o) => BigInt(o);
1959
1959
  else if (isNaN(e) || !isFinite(e))
1960
- return D(s);
1960
+ return K(s);
1961
1961
  let n = "";
1962
1962
  e < 0 && (n = "-", e *= t(-1));
1963
1963
  const i = t(60), r = [e % i];
1964
1964
  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*$/, "");
1965
1965
  }
1966
- const ls = {
1966
+ const gs = {
1967
1967
  identify: (s) => typeof s == "bigint" || Number.isInteger(s),
1968
1968
  default: !0,
1969
1969
  tag: "tag:yaml.org,2002:int",
1970
1970
  format: "TIME",
1971
1971
  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
1972
- resolve: (s, e, { intAsBigInt: t }) => gt(s, t),
1973
- stringify: as
1974
- }, cs = {
1972
+ resolve: (s, e, { intAsBigInt: t }) => bt(s, t),
1973
+ stringify: ms
1974
+ }, ys = {
1975
1975
  identify: (s) => typeof s == "number",
1976
1976
  default: !0,
1977
1977
  tag: "tag:yaml.org,2002:float",
1978
1978
  format: "TIME",
1979
1979
  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
1980
- resolve: (s) => gt(s, !1),
1981
- stringify: as
1982
- }, Re = {
1980
+ resolve: (s) => bt(s, !1),
1981
+ stringify: ms
1982
+ }, Fe = {
1983
1983
  identify: (s) => s instanceof Date,
1984
1984
  default: !0,
1985
1985
  tag: "tag:yaml.org,2002:timestamp",
@@ -1988,147 +1988,147 @@ const ls = {
1988
1988
  // assumed to be 00:00:00Z (start of day, UTC).
1989
1989
  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})?))?)?$"),
1990
1990
  resolve(s) {
1991
- const e = s.match(Re.test);
1991
+ const e = s.match(Fe.test);
1992
1992
  if (!e)
1993
1993
  throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
1994
- const [, t, n, i, r, o, a] = e.map(Number), l = e[7] ? Number((e[7] + "00").substr(1, 3)) : 0;
1995
- let c = Date.UTC(t, n - 1, i, r || 0, o || 0, a || 0, l);
1994
+ const [, t, n, i, r, o, l] = e.map(Number), a = e[7] ? Number((e[7] + "00").substr(1, 3)) : 0;
1995
+ let c = Date.UTC(t, n - 1, i, r || 0, o || 0, l || 0, a);
1996
1996
  const d = e[8];
1997
1997
  if (d && d !== "Z") {
1998
- let u = gt(d, !1);
1998
+ let u = bt(d, !1);
1999
1999
  Math.abs(u) < 30 && (u *= 60), c -= 6e4 * u;
2000
2000
  }
2001
2001
  return new Date(c);
2002
2002
  },
2003
2003
  stringify: ({ value: s }) => s?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? ""
2004
- }, Ot = [
2004
+ }, Tt = [
2005
2005
  ce,
2006
2006
  fe,
2007
+ xe,
2007
2008
  Ke,
2008
- De,
2009
- rs,
2010
- os,
2011
- sn,
2012
- nn,
2013
- rn,
2014
- on,
2015
- Zs,
2016
- en,
2017
- tn,
2018
- ut,
2019
- R,
2009
+ ds,
2010
+ ps,
2011
+ hn,
2012
+ dn,
2013
+ pn,
2014
+ mn,
2015
+ cn,
2016
+ fn,
2017
+ un,
2020
2018
  dt,
2021
- ht,
2019
+ F,
2022
2020
  mt,
2023
- ls,
2024
- cs,
2025
- Re
2026
- ], At = /* @__PURE__ */ new Map([
2027
- ["core", Qs],
2028
- ["failsafe", [ce, fe, Ke]],
2029
- ["json", zs],
2030
- ["yaml11", Ot],
2031
- ["yaml-1.1", Ot]
2032
- ]), Et = {
2033
- binary: ut,
2034
- bool: ct,
2035
- float: xt,
2036
- floatExp: Xt,
2037
- floatNaN: Qt,
2038
- floatTime: cs,
2039
- int: es,
2040
- intHex: ts,
2041
- intOct: Zt,
2042
- intTime: ls,
2021
+ pt,
2022
+ yt,
2023
+ gs,
2024
+ ys,
2025
+ Fe
2026
+ ], It = /* @__PURE__ */ new Map([
2027
+ ["core", rn],
2028
+ ["failsafe", [ce, fe, xe]],
2029
+ ["json", an],
2030
+ ["yaml11", Tt],
2031
+ ["yaml-1.1", Tt]
2032
+ ]), At = {
2033
+ binary: dt,
2034
+ bool: ut,
2035
+ float: rs,
2036
+ floatExp: is,
2037
+ floatNaN: ns,
2038
+ floatTime: ys,
2039
+ int: as,
2040
+ intHex: cs,
2041
+ intOct: ls,
2042
+ intTime: gs,
2043
2043
  map: ce,
2044
- merge: R,
2045
- null: De,
2046
- omap: dt,
2047
- pairs: ht,
2044
+ merge: F,
2045
+ null: Ke,
2046
+ omap: mt,
2047
+ pairs: pt,
2048
2048
  seq: fe,
2049
- set: mt,
2050
- timestamp: Re
2051
- }, an = {
2052
- "tag:yaml.org,2002:binary": ut,
2053
- "tag:yaml.org,2002:merge": R,
2054
- "tag:yaml.org,2002:omap": dt,
2055
- "tag:yaml.org,2002:pairs": ht,
2056
- "tag:yaml.org,2002:set": mt,
2057
- "tag:yaml.org,2002:timestamp": Re
2049
+ set: yt,
2050
+ timestamp: Fe
2051
+ }, gn = {
2052
+ "tag:yaml.org,2002:binary": dt,
2053
+ "tag:yaml.org,2002:merge": F,
2054
+ "tag:yaml.org,2002:omap": mt,
2055
+ "tag:yaml.org,2002:pairs": pt,
2056
+ "tag:yaml.org,2002:set": yt,
2057
+ "tag:yaml.org,2002:timestamp": Fe
2058
2058
  };
2059
2059
  function Je(s, e, t) {
2060
- const n = At.get(e);
2060
+ const n = It.get(e);
2061
2061
  if (n && !s)
2062
- return t && !n.includes(R) ? n.concat(R) : n.slice();
2062
+ return t && !n.includes(F) ? n.concat(F) : n.slice();
2063
2063
  let i = n;
2064
2064
  if (!i)
2065
2065
  if (Array.isArray(s))
2066
2066
  i = [];
2067
2067
  else {
2068
- const r = Array.from(At.keys()).filter((o) => o !== "yaml11").map((o) => JSON.stringify(o)).join(", ");
2068
+ const r = Array.from(It.keys()).filter((o) => o !== "yaml11").map((o) => JSON.stringify(o)).join(", ");
2069
2069
  throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`);
2070
2070
  }
2071
2071
  if (Array.isArray(s))
2072
2072
  for (const r of s)
2073
2073
  i = i.concat(r);
2074
2074
  else typeof s == "function" && (i = s(i.slice()));
2075
- return t && (i = i.concat(R)), i.reduce((r, o) => {
2076
- const a = typeof o == "string" ? Et[o] : o;
2077
- if (!a) {
2078
- const l = JSON.stringify(o), c = Object.keys(Et).map((d) => JSON.stringify(d)).join(", ");
2079
- throw new Error(`Unknown custom tag ${l}; use one of ${c}`);
2075
+ return t && (i = i.concat(F)), i.reduce((r, o) => {
2076
+ const l = typeof o == "string" ? At[o] : o;
2077
+ if (!l) {
2078
+ const a = JSON.stringify(o), c = Object.keys(At).map((d) => JSON.stringify(d)).join(", ");
2079
+ throw new Error(`Unknown custom tag ${a}; use one of ${c}`);
2080
2080
  }
2081
- return r.includes(a) || r.push(a), r;
2081
+ return r.includes(l) || r.push(l), r;
2082
2082
  }, []);
2083
2083
  }
2084
- const ln = (s, e) => s.key < e.key ? -1 : s.key > e.key ? 1 : 0;
2085
- class yt {
2086
- constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: i, schema: r, sortMapEntries: o, toStringDefaults: a }) {
2087
- this.compat = Array.isArray(e) ? Je(e, "compat") : e ? Je(null, e) : null, this.name = typeof r == "string" && r || "core", this.knownTags = i ? an : {}, this.tags = Je(t, this.name, n), this.toStringOptions = a ?? null, Object.defineProperty(this, J, { value: ce }), Object.defineProperty(this, U, { value: Ke }), Object.defineProperty(this, ae, { value: fe }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? ln : null;
2084
+ const yn = (s, e) => s.key < e.key ? -1 : s.key > e.key ? 1 : 0;
2085
+ class wt {
2086
+ constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: i, schema: r, sortMapEntries: o, toStringDefaults: l }) {
2087
+ this.compat = Array.isArray(e) ? Je(e, "compat") : e ? Je(null, e) : null, this.name = typeof r == "string" && r || "core", this.knownTags = i ? gn : {}, this.tags = Je(t, this.name, n), this.toStringOptions = l ?? null, Object.defineProperty(this, J, { value: ce }), Object.defineProperty(this, R, { value: xe }), Object.defineProperty(this, le, { value: fe }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? yn : null;
2088
2088
  }
2089
2089
  clone() {
2090
- const e = Object.create(yt.prototype, Object.getOwnPropertyDescriptors(this));
2090
+ const e = Object.create(wt.prototype, Object.getOwnPropertyDescriptors(this));
2091
2091
  return e.tags = this.tags.slice(), e;
2092
2092
  }
2093
2093
  }
2094
- function cn(s, e) {
2094
+ function bn(s, e) {
2095
2095
  const t = [];
2096
2096
  let n = e.directives === !0;
2097
2097
  if (e.directives !== !1 && s.directives) {
2098
- const l = s.directives.toString(s);
2099
- l ? (t.push(l), n = !0) : s.directives.docStart && (n = !0);
2098
+ const a = s.directives.toString(s);
2099
+ a ? (t.push(a), n = !0) : s.directives.docStart && (n = !0);
2100
2100
  }
2101
2101
  n && t.push("---");
2102
- const i = Jt(s, e), { commentString: r } = i.options;
2102
+ const i = zt(s, e), { commentString: r } = i.options;
2103
2103
  if (s.commentBefore) {
2104
2104
  t.length !== 1 && t.unshift("");
2105
- const l = r(s.commentBefore);
2106
- t.unshift(F(l, ""));
2105
+ const a = r(s.commentBefore);
2106
+ t.unshift(U(a, ""));
2107
2107
  }
2108
- let o = !1, a = null;
2108
+ let o = !1, l = null;
2109
2109
  if (s.contents) {
2110
- if ($(s.contents)) {
2110
+ if (v(s.contents)) {
2111
2111
  if (s.contents.spaceBefore && n && t.push(""), s.contents.commentBefore) {
2112
2112
  const d = r(s.contents.commentBefore);
2113
- t.push(F(d, ""));
2113
+ t.push(U(d, ""));
2114
2114
  }
2115
- i.forceBlockIndent = !!s.comment, a = s.contents.comment;
2115
+ i.forceBlockIndent = !!s.comment, l = s.contents.comment;
2116
2116
  }
2117
- const l = a ? void 0 : () => o = !0;
2118
- let c = re(s.contents, i, () => a = null, l);
2119
- a && (c += G(c, "", r(a))), (c[0] === "|" || c[0] === ">") && t[t.length - 1] === "---" ? t[t.length - 1] = `--- ${c}` : t.push(c);
2117
+ const a = l ? void 0 : () => o = !0;
2118
+ let c = re(s.contents, i, () => l = null, a);
2119
+ l && (c += G(c, "", r(l))), (c[0] === "|" || c[0] === ">") && t[t.length - 1] === "---" ? t[t.length - 1] = `--- ${c}` : t.push(c);
2120
2120
  } else
2121
2121
  t.push(re(s.contents, i));
2122
2122
  if (s.directives?.docEnd)
2123
2123
  if (s.comment) {
2124
- const l = r(s.comment);
2125
- l.includes(`
2126
- `) ? (t.push("..."), t.push(F(l, ""))) : t.push(`... ${l}`);
2124
+ const a = r(s.comment);
2125
+ a.includes(`
2126
+ `) ? (t.push("..."), t.push(U(a, ""))) : t.push(`... ${a}`);
2127
2127
  } else
2128
2128
  t.push("...");
2129
2129
  else {
2130
- let l = s.comment;
2131
- l && o && (l = l.replace(/^\n+/, "")), l && ((!o || a) && t[t.length - 1] !== "" && t.push(""), t.push(F(r(l), "")));
2130
+ let a = s.comment;
2131
+ a && o && (a = a.replace(/^\n+/, "")), a && ((!o || l) && t[t.length - 1] !== "" && t.push(""), t.push(U(r(a), "")));
2132
2132
  }
2133
2133
  return t.join(`
2134
2134
  `) + `
@@ -2136,7 +2136,7 @@ function cn(s, e) {
2136
2136
  }
2137
2137
  class qe {
2138
2138
  constructor(e, t, n) {
2139
- this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, P, { value: Qe });
2139
+ this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, D, { value: Xe });
2140
2140
  let i = null;
2141
2141
  typeof t == "function" || Array.isArray(t) ? i = t : n === void 0 && t && (n = t, t = void 0);
2142
2142
  const r = Object.assign({
@@ -2151,7 +2151,7 @@ class qe {
2151
2151
  }, n);
2152
2152
  this.options = r;
2153
2153
  let { version: o } = r;
2154
- n?._directives ? (this.directives = n._directives.atDocument(), this.directives.yaml.explicit && (o = this.directives.yaml.version)) : this.directives = new _({ version: o }), this.setSchema(o, n), this.contents = e === void 0 ? null : this.createNode(e, i, n);
2154
+ n?._directives ? (this.directives = n._directives.atDocument(), this.directives.yaml.explicit && (o = this.directives.yaml.version)) : this.directives = new j({ version: o }), this.setSchema(o, n), this.contents = e === void 0 ? null : this.createNode(e, i, n);
2155
2155
  }
2156
2156
  /**
2157
2157
  * Create a deep copy of this Document and its contents.
@@ -2160,9 +2160,9 @@ class qe {
2160
2160
  */
2161
2161
  clone() {
2162
2162
  const e = Object.create(qe.prototype, {
2163
- [P]: { value: Qe }
2163
+ [D]: { value: Xe }
2164
2164
  });
2165
- 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 = $(this.contents) ? this.contents.clone(e.schema) : this.contents, this.range && (e.range = this.range.slice()), e;
2165
+ 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 = v(this.contents) ? this.contents.clone(e.schema) : this.contents, this.range && (e.range = this.range.slice()), e;
2166
2166
  }
2167
2167
  /** Adds a value to the document. */
2168
2168
  add(e) {
@@ -2183,11 +2183,11 @@ class qe {
2183
2183
  */
2184
2184
  createAlias(e, t) {
2185
2185
  if (!e.anchor) {
2186
- const n = Ut(this);
2186
+ const n = Gt(this);
2187
2187
  e.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
2188
- !t || n.has(t) ? Ft(t || "a", n) : t;
2188
+ !t || n.has(t) ? Ht(t || "a", n) : t;
2189
2189
  }
2190
- return new ot(e.anchor);
2190
+ return new at(e.anchor);
2191
2191
  }
2192
2192
  createNode(e, t, n) {
2193
2193
  let i;
@@ -2197,20 +2197,20 @@ class qe {
2197
2197
  const m = (w) => typeof w == "number" || w instanceof String || w instanceof Number, b = t.filter(m).map(String);
2198
2198
  b.length > 0 && (t = t.concat(b)), i = t;
2199
2199
  } else n === void 0 && t && (n = t, t = void 0);
2200
- const { aliasDuplicateObjects: r, anchorPrefix: o, flow: a, keepUndefined: l, onTagObj: c, tag: d } = n ?? {}, { onAnchor: u, setAnchors: f, sourceObjects: p } = Ps(
2200
+ const { aliasDuplicateObjects: r, anchorPrefix: o, flow: l, keepUndefined: a, onTagObj: c, tag: d } = n ?? {}, { onAnchor: u, setAnchors: f, sourceObjects: p } = Js(
2201
2201
  this,
2202
2202
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
2203
2203
  o || "a"
2204
2204
  ), g = {
2205
2205
  aliasDuplicateObjects: r ?? !0,
2206
- keepUndefined: l ?? !1,
2206
+ keepUndefined: a ?? !1,
2207
2207
  onAnchor: u,
2208
2208
  onTagObj: c,
2209
2209
  replacer: i,
2210
2210
  schema: this.schema,
2211
2211
  sourceObjects: p
2212
2212
  }, h = ge(e, d, g);
2213
- return a && I(h) && (h.flow = !0), f(), h;
2213
+ return l && A(h) && (h.flow = !0), f(), h;
2214
2214
  }
2215
2215
  /**
2216
2216
  * Convert a key and a value into a `Pair` using the current schema,
@@ -2218,7 +2218,7 @@ class qe {
2218
2218
  */
2219
2219
  createPair(e, t, n = {}) {
2220
2220
  const i = this.createNode(e, null, n), r = this.createNode(t, null, n);
2221
- return new j(i, r);
2221
+ return new B(i, r);
2222
2222
  }
2223
2223
  /**
2224
2224
  * Removes a value from the document.
@@ -2240,7 +2240,7 @@ class qe {
2240
2240
  * `true` (collections are always returned intact).
2241
2241
  */
2242
2242
  get(e, t) {
2243
- return I(this.contents) ? this.contents.get(e, t) : void 0;
2243
+ return A(this.contents) ? this.contents.get(e, t) : void 0;
2244
2244
  }
2245
2245
  /**
2246
2246
  * Returns item at `path`, or `undefined` if not found. By default unwraps
@@ -2248,33 +2248,33 @@ class qe {
2248
2248
  * `true` (collections are always returned intact).
2249
2249
  */
2250
2250
  getIn(e, t) {
2251
- return he(e) ? !t && T(this.contents) ? this.contents.value : this.contents : I(this.contents) ? this.contents.getIn(e, t) : void 0;
2251
+ return he(e) ? !t && I(this.contents) ? this.contents.value : this.contents : A(this.contents) ? this.contents.getIn(e, t) : void 0;
2252
2252
  }
2253
2253
  /**
2254
2254
  * Checks if the document includes a value with the key `key`.
2255
2255
  */
2256
2256
  has(e) {
2257
- return I(this.contents) ? this.contents.has(e) : !1;
2257
+ return A(this.contents) ? this.contents.has(e) : !1;
2258
2258
  }
2259
2259
  /**
2260
2260
  * Checks if the document includes a value at `path`.
2261
2261
  */
2262
2262
  hasIn(e) {
2263
- return he(e) ? this.contents !== void 0 : I(this.contents) ? this.contents.hasIn(e) : !1;
2263
+ return he(e) ? this.contents !== void 0 : A(this.contents) ? this.contents.hasIn(e) : !1;
2264
2264
  }
2265
2265
  /**
2266
2266
  * Sets a value in this document. For `!!set`, `value` needs to be a
2267
2267
  * boolean to add/remove the item from the set.
2268
2268
  */
2269
2269
  set(e, t) {
2270
- this.contents == null ? this.contents = ve(this.schema, [e], t) : z(this.contents) && this.contents.set(e, t);
2270
+ this.contents == null ? this.contents = Le(this.schema, [e], t) : z(this.contents) && this.contents.set(e, t);
2271
2271
  }
2272
2272
  /**
2273
2273
  * Sets a value in this document. For `!!set`, `value` needs to be a
2274
2274
  * boolean to add/remove the item from the set.
2275
2275
  */
2276
2276
  setIn(e, t) {
2277
- he(e) ? this.contents = t : this.contents == null ? this.contents = ve(this.schema, Array.from(e), t) : z(this.contents) && this.contents.setIn(e, t);
2277
+ he(e) ? this.contents = t : this.contents == null ? this.contents = Le(this.schema, Array.from(e), t) : z(this.contents) && this.contents.setIn(e, t);
2278
2278
  }
2279
2279
  /**
2280
2280
  * Change the YAML version and schema used by the document.
@@ -2288,11 +2288,11 @@ class qe {
2288
2288
  let n;
2289
2289
  switch (e) {
2290
2290
  case "1.1":
2291
- this.directives ? this.directives.yaml.version = "1.1" : this.directives = new _({ version: "1.1" }), n = { resolveKnownTags: !1, schema: "yaml-1.1" };
2291
+ this.directives ? this.directives.yaml.version = "1.1" : this.directives = new j({ version: "1.1" }), n = { resolveKnownTags: !1, schema: "yaml-1.1" };
2292
2292
  break;
2293
2293
  case "1.2":
2294
2294
  case "next":
2295
- this.directives ? this.directives.yaml.version = e : this.directives = new _({ version: e }), n = { resolveKnownTags: !0, schema: "core" };
2295
+ this.directives ? this.directives.yaml.version = e : this.directives = new j({ version: e }), n = { resolveKnownTags: !0, schema: "core" };
2296
2296
  break;
2297
2297
  case null:
2298
2298
  this.directives && delete this.directives, n = null;
@@ -2305,24 +2305,24 @@ class qe {
2305
2305
  if (t.schema instanceof Object)
2306
2306
  this.schema = t.schema;
2307
2307
  else if (n)
2308
- this.schema = new yt(Object.assign(n, t));
2308
+ this.schema = new wt(Object.assign(n, t));
2309
2309
  else
2310
2310
  throw new Error("With a null YAML version, the { schema: Schema } option is required");
2311
2311
  }
2312
2312
  // json & jsonArg are only used from toJSON()
2313
2313
  toJS({ json: e, jsonArg: t, mapAsMap: n, maxAliasCount: i, onAnchor: r, reviver: o } = {}) {
2314
- const a = {
2314
+ const l = {
2315
2315
  anchors: /* @__PURE__ */ new Map(),
2316
2316
  doc: this,
2317
2317
  keep: !e,
2318
2318
  mapAsMap: n === !0,
2319
2319
  mapKeyWarned: !1,
2320
2320
  maxAliasCount: typeof i == "number" ? i : 100
2321
- }, l = M(this.contents, t ?? "", a);
2321
+ }, a = P(this.contents, t ?? "", l);
2322
2322
  if (typeof r == "function")
2323
- for (const { count: c, res: d } of a.anchors.values())
2323
+ for (const { count: c, res: d } of l.anchors.values())
2324
2324
  r(d, c);
2325
- return typeof o == "function" ? te(o, { "": l }, "", l) : l;
2325
+ return typeof o == "function" ? te(o, { "": a }, "", a) : a;
2326
2326
  }
2327
2327
  /**
2328
2328
  * A JSON representation of the document `contents`.
@@ -2341,50 +2341,50 @@ class qe {
2341
2341
  const t = JSON.stringify(e.indent);
2342
2342
  throw new Error(`"indent" option must be a positive integer, not ${t}`);
2343
2343
  }
2344
- return cn(this, e);
2344
+ return bn(this, e);
2345
2345
  }
2346
2346
  }
2347
2347
  function z(s) {
2348
- if (I(s))
2348
+ if (A(s))
2349
2349
  return !0;
2350
2350
  throw new Error("Expected a YAML collection as document contents");
2351
2351
  }
2352
- class fs extends Error {
2352
+ class bs extends Error {
2353
2353
  constructor(e, t, n, i) {
2354
2354
  super(), this.name = e, this.code = n, this.message = i, this.pos = t;
2355
2355
  }
2356
2356
  }
2357
- class de extends fs {
2357
+ class de extends bs {
2358
2358
  constructor(e, t, n) {
2359
2359
  super("YAMLParseError", e, t, n);
2360
2360
  }
2361
2361
  }
2362
- class fn extends fs {
2362
+ class wn extends bs {
2363
2363
  constructor(e, t, n) {
2364
2364
  super("YAMLWarning", e, t, n);
2365
2365
  }
2366
2366
  }
2367
- const Tt = (s, e) => (t) => {
2367
+ const vt = (s, e) => (t) => {
2368
2368
  if (t.pos[0] === -1)
2369
2369
  return;
2370
- t.linePos = t.pos.map((a) => e.linePos(a));
2370
+ t.linePos = t.pos.map((l) => e.linePos(l));
2371
2371
  const { line: n, col: i } = t.linePos[0];
2372
2372
  t.message += ` at line ${n}, column ${i}`;
2373
2373
  let r = i - 1, o = s.substring(e.lineStarts[n - 1], e.lineStarts[n]).replace(/[\n\r]+$/, "");
2374
2374
  if (r >= 60 && o.length > 80) {
2375
- const a = Math.min(r - 39, o.length - 79);
2376
- o = "…" + o.substring(a), r -= a - 1;
2375
+ const l = Math.min(r - 39, o.length - 79);
2376
+ o = "…" + o.substring(l), r -= l - 1;
2377
2377
  }
2378
2378
  if (o.length > 80 && (o = o.substring(0, 79) + "…"), n > 1 && /^ *$/.test(o.substring(0, r))) {
2379
- let a = s.substring(e.lineStarts[n - 2], e.lineStarts[n - 1]);
2380
- a.length > 80 && (a = a.substring(0, 79) + `…
2381
- `), o = a + o;
2379
+ let l = s.substring(e.lineStarts[n - 2], e.lineStarts[n - 1]);
2380
+ l.length > 80 && (l = l.substring(0, 79) + `…
2381
+ `), o = l + o;
2382
2382
  }
2383
2383
  if (/[^ ]/.test(o)) {
2384
- let a = 1;
2385
- const l = t.linePos[1];
2386
- l?.line === n && l.col > i && (a = Math.max(1, Math.min(l.col - i, 80 - r)));
2387
- const c = " ".repeat(r) + "^".repeat(a);
2384
+ let l = 1;
2385
+ const a = t.linePos[1];
2386
+ a?.line === n && a.col > i && (l = Math.max(1, Math.min(a.col - i, 80 - r)));
2387
+ const c = " ".repeat(r) + "^".repeat(l);
2388
2388
  t.message += `:
2389
2389
 
2390
2390
  ${o}
@@ -2392,8 +2392,8 @@ ${c}
2392
2392
  `;
2393
2393
  }
2394
2394
  };
2395
- function oe(s, { flow: e, indicator: t, next: n, offset: i, onError: r, parentIndent: o, startOnNewline: a }) {
2396
- let l = !1, c = a, d = a, u = "", f = "", p = !1, g = !1, h = null, m = null, b = null, w = null, k = null, S = null, N = null;
2395
+ function oe(s, { flow: e, indicator: t, next: n, offset: i, onError: r, parentIndent: o, startOnNewline: l }) {
2396
+ let a = !1, c = l, d = l, u = "", f = "", p = !1, g = !1, h = null, m = null, b = null, w = null, S = null, k = null, _ = null;
2397
2397
  for (const y of s)
2398
2398
  switch (g && (y.type !== "space" && y.type !== "newline" && y.type !== "comma" && r(y.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), g = !1), h && (c && y.type !== "comment" && y.type !== "newline" && r(h, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), h = null), y.type) {
2399
2399
  case "space":
@@ -2401,44 +2401,44 @@ function oe(s, { flow: e, indicator: t, next: n, offset: i, onError: r, parentIn
2401
2401
  break;
2402
2402
  case "comment": {
2403
2403
  d || r(y, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
2404
- const v = y.source.substring(1) || " ";
2405
- u ? u += f + v : u = v, f = "", c = !1;
2404
+ const L = y.source.substring(1) || " ";
2405
+ u ? u += f + L : u = L, f = "", c = !1;
2406
2406
  break;
2407
2407
  }
2408
2408
  case "newline":
2409
- c ? u ? u += y.source : (!S || t !== "seq-item-ind") && (l = !0) : f += y.source, c = !0, p = !0, (m || b) && (w = y), d = !0;
2409
+ c ? u ? u += y.source : (!k || t !== "seq-item-ind") && (a = !0) : f += y.source, c = !0, p = !0, (m || b) && (w = y), d = !0;
2410
2410
  break;
2411
2411
  case "anchor":
2412
- m && r(y, "MULTIPLE_ANCHORS", "A node can have at most one anchor"), y.source.endsWith(":") && r(y.offset + y.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", !0), m = y, N ?? (N = y.offset), c = !1, d = !1, g = !0;
2412
+ m && r(y, "MULTIPLE_ANCHORS", "A node can have at most one anchor"), y.source.endsWith(":") && r(y.offset + y.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", !0), m = y, _ ?? (_ = y.offset), c = !1, d = !1, g = !0;
2413
2413
  break;
2414
2414
  case "tag": {
2415
- b && r(y, "MULTIPLE_TAGS", "A node can have at most one tag"), b = y, N ?? (N = y.offset), c = !1, d = !1, g = !0;
2415
+ b && r(y, "MULTIPLE_TAGS", "A node can have at most one tag"), b = y, _ ?? (_ = y.offset), c = !1, d = !1, g = !0;
2416
2416
  break;
2417
2417
  }
2418
2418
  case t:
2419
- (m || b) && r(y, "BAD_PROP_ORDER", `Anchors and tags must be after the ${y.source} indicator`), S && r(y, "UNEXPECTED_TOKEN", `Unexpected ${y.source} in ${e ?? "collection"}`), S = y, c = t === "seq-item-ind" || t === "explicit-key-ind", d = !1;
2419
+ (m || b) && r(y, "BAD_PROP_ORDER", `Anchors and tags must be after the ${y.source} indicator`), k && r(y, "UNEXPECTED_TOKEN", `Unexpected ${y.source} in ${e ?? "collection"}`), k = y, c = t === "seq-item-ind" || t === "explicit-key-ind", d = !1;
2420
2420
  break;
2421
2421
  case "comma":
2422
2422
  if (e) {
2423
- k && r(y, "UNEXPECTED_TOKEN", `Unexpected , in ${e}`), k = y, c = !1, d = !1;
2423
+ S && r(y, "UNEXPECTED_TOKEN", `Unexpected , in ${e}`), S = y, c = !1, d = !1;
2424
2424
  break;
2425
2425
  }
2426
2426
  // else fallthrough
2427
2427
  default:
2428
2428
  r(y, "UNEXPECTED_TOKEN", `Unexpected ${y.type} token`), c = !1, d = !1;
2429
2429
  }
2430
- const A = s[s.length - 1], E = A ? A.offset + A.source.length : i;
2430
+ const O = s[s.length - 1], T = O ? O.offset + O.source.length : i;
2431
2431
  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"), h && (c && h.indent <= o || n?.type === "block-map" || n?.type === "block-seq") && r(h, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), {
2432
- comma: k,
2433
- found: S,
2434
- spaceBefore: l,
2432
+ comma: S,
2433
+ found: k,
2434
+ spaceBefore: a,
2435
2435
  comment: u,
2436
2436
  hasNewline: p,
2437
2437
  anchor: m,
2438
2438
  tag: b,
2439
2439
  newlineAfterProp: w,
2440
- end: E,
2441
- start: N ?? E
2440
+ end: T,
2441
+ start: _ ?? T
2442
2442
  };
2443
2443
  }
2444
2444
  function ye(s) {
@@ -2476,45 +2476,45 @@ function ye(s) {
2476
2476
  return !0;
2477
2477
  }
2478
2478
  }
2479
- function Ze(s, e, t) {
2479
+ function tt(s, e, t) {
2480
2480
  if (e?.type === "flow-collection") {
2481
2481
  const n = e.end[0];
2482
2482
  n.indent === s && (n.source === "]" || n.source === "}") && ye(e) && t(n, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
2483
2483
  }
2484
2484
  }
2485
- function us(s, e, t) {
2485
+ function ws(s, e, t) {
2486
2486
  const { uniqueKeys: n } = s.options;
2487
2487
  if (n === !1)
2488
2488
  return !1;
2489
- const i = typeof n == "function" ? n : (r, o) => r === o || T(r) && T(o) && r.value === o.value;
2489
+ const i = typeof n == "function" ? n : (r, o) => r === o || I(r) && I(o) && r.value === o.value;
2490
2490
  return e.some((r) => i(r.key, t));
2491
2491
  }
2492
- const It = "All mapping items must start at the same column";
2493
- function un({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2494
- const o = r?.nodeClass ?? B, a = new o(t.schema);
2492
+ const $t = "All mapping items must start at the same column";
2493
+ function Sn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2494
+ const o = r?.nodeClass ?? M, l = new o(t.schema);
2495
2495
  t.atRoot && (t.atRoot = !1);
2496
- let l = n.offset, c = null;
2496
+ let a = n.offset, c = null;
2497
2497
  for (const d of n.items) {
2498
2498
  const { start: u, key: f, sep: p, value: g } = d, h = oe(u, {
2499
2499
  indicator: "explicit-key-ind",
2500
2500
  next: f ?? p?.[0],
2501
- offset: l,
2501
+ offset: a,
2502
2502
  onError: i,
2503
2503
  parentIndent: n.indent,
2504
2504
  startOnNewline: !0
2505
2505
  }), m = !h.found;
2506
2506
  if (m) {
2507
- if (f && (f.type === "block-seq" ? i(l, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in f && f.indent !== n.indent && i(l, "BAD_INDENT", It)), !h.anchor && !h.tag && !p) {
2508
- c = h.end, h.comment && (a.comment ? a.comment += `
2509
- ` + h.comment : a.comment = h.comment);
2507
+ if (f && (f.type === "block-seq" ? i(a, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in f && f.indent !== n.indent && i(a, "BAD_INDENT", $t)), !h.anchor && !h.tag && !p) {
2508
+ c = h.end, h.comment && (l.comment ? l.comment += `
2509
+ ` + h.comment : l.comment = h.comment);
2510
2510
  continue;
2511
2511
  }
2512
2512
  (h.newlineAfterProp || ye(f)) && i(f ?? u[u.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
2513
- } else h.found?.indent !== n.indent && i(l, "BAD_INDENT", It);
2513
+ } else h.found?.indent !== n.indent && i(a, "BAD_INDENT", $t);
2514
2514
  t.atKey = !0;
2515
2515
  const b = h.end, w = f ? s(t, f, h, i) : e(t, b, u, null, h, i);
2516
- t.schema.compat && Ze(n.indent, f, i), t.atKey = !1, us(t, a.items, w) && i(b, "DUPLICATE_KEY", "Map keys must be unique");
2517
- const k = oe(p ?? [], {
2516
+ t.schema.compat && tt(n.indent, f, i), t.atKey = !1, ws(t, l.items, w) && i(b, "DUPLICATE_KEY", "Map keys must be unique");
2517
+ const S = oe(p ?? [], {
2518
2518
  indicator: "map-value-ind",
2519
2519
  next: g,
2520
2520
  offset: w.range[2],
@@ -2522,168 +2522,168 @@ function un({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2522
2522
  parentIndent: n.indent,
2523
2523
  startOnNewline: !f || f.type === "block-scalar"
2524
2524
  });
2525
- if (l = k.end, k.found) {
2526
- m && (g?.type === "block-map" && !k.hasNewline && i(l, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), t.options.strict && h.start < k.found.offset - 1024 && i(w.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
2527
- const S = g ? s(t, g, k, i) : e(t, l, p, null, k, i);
2528
- t.schema.compat && Ze(n.indent, g, i), l = S.range[2];
2529
- const N = new j(w, S);
2530
- t.options.keepSourceTokens && (N.srcToken = d), a.items.push(N);
2525
+ if (a = S.end, S.found) {
2526
+ m && (g?.type === "block-map" && !S.hasNewline && i(a, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), t.options.strict && h.start < S.found.offset - 1024 && i(w.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
2527
+ const k = g ? s(t, g, S, i) : e(t, a, p, null, S, i);
2528
+ t.schema.compat && tt(n.indent, g, i), a = k.range[2];
2529
+ const _ = new B(w, k);
2530
+ t.options.keepSourceTokens && (_.srcToken = d), l.items.push(_);
2531
2531
  } else {
2532
- m && i(w.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"), k.comment && (w.comment ? w.comment += `
2533
- ` + k.comment : w.comment = k.comment);
2534
- const S = new j(w);
2535
- t.options.keepSourceTokens && (S.srcToken = d), a.items.push(S);
2532
+ m && i(w.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"), S.comment && (w.comment ? w.comment += `
2533
+ ` + S.comment : w.comment = S.comment);
2534
+ const k = new B(w);
2535
+ t.options.keepSourceTokens && (k.srcToken = d), l.items.push(k);
2536
2536
  }
2537
2537
  }
2538
- return c && c < l && i(c, "IMPOSSIBLE", "Map comment with trailing content"), a.range = [n.offset, l, c ?? l], a;
2538
+ return c && c < a && i(c, "IMPOSSIBLE", "Map comment with trailing content"), l.range = [n.offset, a, c ?? a], l;
2539
2539
  }
2540
- function hn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2541
- const o = r?.nodeClass ?? H, a = new o(t.schema);
2540
+ function kn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2541
+ const o = r?.nodeClass ?? W, l = new o(t.schema);
2542
2542
  t.atRoot && (t.atRoot = !1), t.atKey && (t.atKey = !1);
2543
- let l = n.offset, c = null;
2543
+ let a = n.offset, c = null;
2544
2544
  for (const { start: d, value: u } of n.items) {
2545
2545
  const f = oe(d, {
2546
2546
  indicator: "seq-item-ind",
2547
2547
  next: u,
2548
- offset: l,
2548
+ offset: a,
2549
2549
  onError: i,
2550
2550
  parentIndent: n.indent,
2551
2551
  startOnNewline: !0
2552
2552
  });
2553
2553
  if (!f.found)
2554
2554
  if (f.anchor || f.tag || u)
2555
- u?.type === "block-seq" ? i(f.end, "BAD_INDENT", "All sequence items must start at the same column") : i(l, "MISSING_CHAR", "Sequence item without - indicator");
2555
+ u?.type === "block-seq" ? i(f.end, "BAD_INDENT", "All sequence items must start at the same column") : i(a, "MISSING_CHAR", "Sequence item without - indicator");
2556
2556
  else {
2557
- c = f.end, f.comment && (a.comment = f.comment);
2557
+ c = f.end, f.comment && (l.comment = f.comment);
2558
2558
  continue;
2559
2559
  }
2560
2560
  const p = u ? s(t, u, f, i) : e(t, f.end, d, null, f, i);
2561
- t.schema.compat && Ze(n.indent, u, i), l = p.range[2], a.items.push(p);
2561
+ t.schema.compat && tt(n.indent, u, i), a = p.range[2], l.items.push(p);
2562
2562
  }
2563
- return a.range = [n.offset, l, c ?? l], a;
2563
+ return l.range = [n.offset, a, c ?? a], l;
2564
2564
  }
2565
- function Se(s, e, t, n) {
2565
+ function ke(s, e, t, n) {
2566
2566
  let i = "";
2567
2567
  if (s) {
2568
2568
  let r = !1, o = "";
2569
- for (const a of s) {
2570
- const { source: l, type: c } = a;
2569
+ for (const l of s) {
2570
+ const { source: a, type: c } = l;
2571
2571
  switch (c) {
2572
2572
  case "space":
2573
2573
  r = !0;
2574
2574
  break;
2575
2575
  case "comment": {
2576
- t && !r && n(a, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
2577
- const d = l.substring(1) || " ";
2576
+ t && !r && n(l, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
2577
+ const d = a.substring(1) || " ";
2578
2578
  i ? i += o + d : i = d, o = "";
2579
2579
  break;
2580
2580
  }
2581
2581
  case "newline":
2582
- i && (o += l), r = !0;
2582
+ i && (o += a), r = !0;
2583
2583
  break;
2584
2584
  default:
2585
- n(a, "UNEXPECTED_TOKEN", `Unexpected ${c} at node end`);
2585
+ n(l, "UNEXPECTED_TOKEN", `Unexpected ${c} at node end`);
2586
2586
  }
2587
- e += l.length;
2587
+ e += a.length;
2588
2588
  }
2589
2589
  }
2590
2590
  return { comment: i, offset: e };
2591
2591
  }
2592
2592
  const Ye = "Block collections are not allowed within flow collections", Ge = (s) => s && (s.type === "block-map" || s.type === "block-seq");
2593
- function dn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2594
- const o = n.start.source === "{", a = o ? "flow map" : "flow sequence", l = r?.nodeClass ?? (o ? B : H), c = new l(t.schema);
2593
+ function _n({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2594
+ const o = n.start.source === "{", l = o ? "flow map" : "flow sequence", a = r?.nodeClass ?? (o ? M : W), c = new a(t.schema);
2595
2595
  c.flow = !0;
2596
2596
  const d = t.atRoot;
2597
2597
  d && (t.atRoot = !1), t.atKey && (t.atKey = !1);
2598
2598
  let u = n.offset + n.start.source.length;
2599
2599
  for (let m = 0; m < n.items.length; ++m) {
2600
- const b = n.items[m], { start: w, key: k, sep: S, value: N } = b, A = oe(w, {
2601
- flow: a,
2600
+ const b = n.items[m], { start: w, key: S, sep: k, value: _ } = b, O = oe(w, {
2601
+ flow: l,
2602
2602
  indicator: "explicit-key-ind",
2603
- next: k ?? S?.[0],
2603
+ next: S ?? k?.[0],
2604
2604
  offset: u,
2605
2605
  onError: i,
2606
2606
  parentIndent: n.indent,
2607
2607
  startOnNewline: !1
2608
2608
  });
2609
- if (!A.found) {
2610
- if (!A.anchor && !A.tag && !S && !N) {
2611
- m === 0 && A.comma ? i(A.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${a}`) : m < n.items.length - 1 && i(A.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${a}`), A.comment && (c.comment ? c.comment += `
2612
- ` + A.comment : c.comment = A.comment), u = A.end;
2609
+ if (!O.found) {
2610
+ if (!O.anchor && !O.tag && !k && !_) {
2611
+ m === 0 && O.comma ? i(O.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${l}`) : m < n.items.length - 1 && i(O.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${l}`), O.comment && (c.comment ? c.comment += `
2612
+ ` + O.comment : c.comment = O.comment), u = O.end;
2613
2613
  continue;
2614
2614
  }
2615
- !o && t.options.strict && ye(k) && i(
2616
- k,
2615
+ !o && t.options.strict && ye(S) && i(
2616
+ S,
2617
2617
  // checked by containsNewline()
2618
2618
  "MULTILINE_IMPLICIT_KEY",
2619
2619
  "Implicit keys of flow sequence pairs need to be on a single line"
2620
2620
  );
2621
2621
  }
2622
2622
  if (m === 0)
2623
- A.comma && i(A.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${a}`);
2624
- else if (A.comma || i(A.start, "MISSING_CHAR", `Missing , between ${a} items`), A.comment) {
2625
- let E = "";
2623
+ O.comma && i(O.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${l}`);
2624
+ else if (O.comma || i(O.start, "MISSING_CHAR", `Missing , between ${l} items`), O.comment) {
2625
+ let T = "";
2626
2626
  e: for (const y of w)
2627
2627
  switch (y.type) {
2628
2628
  case "comma":
2629
2629
  case "space":
2630
2630
  break;
2631
2631
  case "comment":
2632
- E = y.source.substring(1);
2632
+ T = y.source.substring(1);
2633
2633
  break e;
2634
2634
  default:
2635
2635
  break e;
2636
2636
  }
2637
- if (E) {
2637
+ if (T) {
2638
2638
  let y = c.items[c.items.length - 1];
2639
- L(y) && (y = y.value ?? y.key), y.comment ? y.comment += `
2640
- ` + E : y.comment = E, A.comment = A.comment.substring(E.length + 1);
2639
+ $(y) && (y = y.value ?? y.key), y.comment ? y.comment += `
2640
+ ` + T : y.comment = T, O.comment = O.comment.substring(T.length + 1);
2641
2641
  }
2642
2642
  }
2643
- if (!o && !S && !A.found) {
2644
- const E = N ? s(t, N, A, i) : e(t, A.end, S, null, A, i);
2645
- c.items.push(E), u = E.range[2], Ge(N) && i(E.range, "BLOCK_IN_FLOW", Ye);
2643
+ if (!o && !k && !O.found) {
2644
+ const T = _ ? s(t, _, O, i) : e(t, O.end, k, null, O, i);
2645
+ c.items.push(T), u = T.range[2], Ge(_) && i(T.range, "BLOCK_IN_FLOW", Ye);
2646
2646
  } else {
2647
2647
  t.atKey = !0;
2648
- const E = A.end, y = k ? s(t, k, A, i) : e(t, E, w, null, A, i);
2649
- Ge(k) && i(y.range, "BLOCK_IN_FLOW", Ye), t.atKey = !1;
2650
- const v = oe(S ?? [], {
2651
- flow: a,
2648
+ const T = O.end, y = S ? s(t, S, O, i) : e(t, T, w, null, O, i);
2649
+ Ge(S) && i(y.range, "BLOCK_IN_FLOW", Ye), t.atKey = !1;
2650
+ const L = oe(k ?? [], {
2651
+ flow: l,
2652
2652
  indicator: "map-value-ind",
2653
- next: N,
2653
+ next: _,
2654
2654
  offset: y.range[2],
2655
2655
  onError: i,
2656
2656
  parentIndent: n.indent,
2657
2657
  startOnNewline: !1
2658
2658
  });
2659
- if (v.found) {
2660
- if (!o && !A.found && t.options.strict) {
2661
- if (S)
2662
- for (const C of S) {
2663
- if (C === v.found)
2659
+ if (L.found) {
2660
+ if (!o && !O.found && t.options.strict) {
2661
+ if (k)
2662
+ for (const C of k) {
2663
+ if (C === L.found)
2664
2664
  break;
2665
2665
  if (C.type === "newline") {
2666
2666
  i(C, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
2667
2667
  break;
2668
2668
  }
2669
2669
  }
2670
- 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");
2670
+ O.start < L.found.offset - 1024 && i(L.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
2671
2671
  }
2672
- } else N && ("source" in N && N.source?.[0] === ":" ? i(N, "MISSING_CHAR", `Missing space after : in ${a}`) : i(v.start, "MISSING_CHAR", `Missing , or : between ${a} items`));
2673
- const q = N ? s(t, N, v, i) : v.found ? e(t, v.end, S, null, v, i) : null;
2674
- q ? Ge(N) && i(q.range, "BLOCK_IN_FLOW", Ye) : v.comment && (y.comment ? y.comment += `
2675
- ` + v.comment : y.comment = v.comment);
2676
- const X = new j(y, q);
2672
+ } else _ && ("source" in _ && _.source?.[0] === ":" ? i(_, "MISSING_CHAR", `Missing space after : in ${l}`) : i(L.start, "MISSING_CHAR", `Missing , or : between ${l} items`));
2673
+ const q = _ ? s(t, _, L, i) : L.found ? e(t, L.end, k, null, L, i) : null;
2674
+ q ? Ge(_) && i(q.range, "BLOCK_IN_FLOW", Ye) : L.comment && (y.comment ? y.comment += `
2675
+ ` + L.comment : y.comment = L.comment);
2676
+ const X = new B(y, q);
2677
2677
  if (t.options.keepSourceTokens && (X.srcToken = b), o) {
2678
2678
  const C = c;
2679
- us(t, C.items, y) && i(E, "DUPLICATE_KEY", "Map keys must be unique"), C.items.push(X);
2679
+ ws(t, C.items, y) && i(T, "DUPLICATE_KEY", "Map keys must be unique"), C.items.push(X);
2680
2680
  } else {
2681
- const C = new B(t.schema);
2681
+ const C = new M(t.schema);
2682
2682
  C.flow = !0, C.items.push(X);
2683
- const wt = (q ?? y).range;
2684
- C.range = [y.range[0], wt[1], wt[2]], c.items.push(C);
2683
+ const _t = (q ?? y).range;
2684
+ C.range = [y.range[0], _t[1], _t[2]], c.items.push(C);
2685
2685
  }
2686
- u = q ? q.range[2] : v.end;
2686
+ u = q ? q.range[2] : L.end;
2687
2687
  }
2688
2688
  }
2689
2689
  const f = o ? "}" : "]", [p, ...g] = n.end;
@@ -2691,91 +2691,91 @@ function dn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
2691
2691
  if (p?.source === f)
2692
2692
  h = p.offset + p.source.length;
2693
2693
  else {
2694
- const m = a[0].toUpperCase() + a.substring(1), b = d ? `${m} must end with a ${f}` : `${m} in block collection must be sufficiently indented and end with a ${f}`;
2694
+ const m = l[0].toUpperCase() + l.substring(1), b = d ? `${m} must end with a ${f}` : `${m} in block collection must be sufficiently indented and end with a ${f}`;
2695
2695
  i(u, d ? "MISSING_CHAR" : "BAD_INDENT", b), p && p.source.length !== 1 && g.unshift(p);
2696
2696
  }
2697
2697
  if (g.length > 0) {
2698
- const m = Se(g, h, t.options.strict, i);
2698
+ const m = ke(g, h, t.options.strict, i);
2699
2699
  m.comment && (c.comment ? c.comment += `
2700
2700
  ` + m.comment : c.comment = m.comment), c.range = [n.offset, h, m.offset];
2701
2701
  } else
2702
2702
  c.range = [n.offset, h, h];
2703
2703
  return c;
2704
2704
  }
2705
- function We(s, e, t, n, i, r) {
2706
- const o = t.type === "block-map" ? un(s, e, t, n, r) : t.type === "block-seq" ? hn(s, e, t, n, r) : dn(s, e, t, n, r), a = o.constructor;
2707
- return i === "!" || i === a.tagName ? (o.tag = a.tagName, o) : (i && (o.tag = i), o);
2705
+ function He(s, e, t, n, i, r) {
2706
+ const o = t.type === "block-map" ? Sn(s, e, t, n, r) : t.type === "block-seq" ? kn(s, e, t, n, r) : _n(s, e, t, n, r), l = o.constructor;
2707
+ return i === "!" || i === l.tagName ? (o.tag = l.tagName, o) : (i && (o.tag = i), o);
2708
2708
  }
2709
- function pn(s, e, t, n, i) {
2709
+ function Nn(s, e, t, n, i) {
2710
2710
  const r = n.tag, o = r ? e.directives.tagName(r.source, (f) => i(r, "TAG_RESOLVE_FAILED", f)) : null;
2711
2711
  if (t.type === "block-seq") {
2712
2712
  const { anchor: f, newlineAfterProp: p } = n, g = f && r ? f.offset > r.offset ? f : r : f ?? r;
2713
2713
  g && (!p || p.offset < g.offset) && i(g, "MISSING_CHAR", "Missing newline after block sequence props");
2714
2714
  }
2715
- const a = t.type === "block-map" ? "map" : t.type === "block-seq" ? "seq" : t.start.source === "{" ? "map" : "seq";
2716
- if (!r || !o || o === "!" || o === B.tagName && a === "map" || o === H.tagName && a === "seq")
2717
- return We(s, e, t, i, o);
2718
- let l = e.schema.tags.find((f) => f.tag === o && f.collection === a);
2719
- if (!l) {
2715
+ const l = t.type === "block-map" ? "map" : t.type === "block-seq" ? "seq" : t.start.source === "{" ? "map" : "seq";
2716
+ if (!r || !o || o === "!" || o === M.tagName && l === "map" || o === W.tagName && l === "seq")
2717
+ return He(s, e, t, i, o);
2718
+ let a = e.schema.tags.find((f) => f.tag === o && f.collection === l);
2719
+ if (!a) {
2720
2720
  const f = e.schema.knownTags[o];
2721
- if (f?.collection === a)
2722
- e.schema.tags.push(Object.assign({}, f, { default: !1 })), l = f;
2721
+ if (f?.collection === l)
2722
+ e.schema.tags.push(Object.assign({}, f, { default: !1 })), a = f;
2723
2723
  else
2724
- return f ? i(r, "BAD_COLLECTION_TYPE", `${f.tag} used for ${a} collection, but expects ${f.collection ?? "scalar"}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), We(s, e, t, i, o);
2724
+ return f ? i(r, "BAD_COLLECTION_TYPE", `${f.tag} used for ${l} collection, but expects ${f.collection ?? "scalar"}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), He(s, e, t, i, o);
2725
2725
  }
2726
- const c = We(s, e, t, i, o, l), d = l.resolve?.(c, (f) => i(r, "TAG_RESOLVE_FAILED", f), e.options) ?? c, u = $(d) ? d : new O(d);
2727
- return u.range = c.range, u.tag = o, l?.format && (u.format = l.format), u;
2726
+ const c = He(s, e, t, i, o, a), d = a.resolve?.(c, (f) => i(r, "TAG_RESOLVE_FAILED", f), e.options) ?? c, u = v(d) ? d : new N(d);
2727
+ return u.range = c.range, u.tag = o, a?.format && (u.format = a.format), u;
2728
2728
  }
2729
- function mn(s, e, t) {
2730
- const n = e.offset, i = gn(e, s.options.strict, t);
2729
+ function On(s, e, t) {
2730
+ const n = e.offset, i = En(e, s.options.strict, t);
2731
2731
  if (!i)
2732
2732
  return { value: "", type: null, comment: "", range: [n, n, n] };
2733
- const r = i.mode === ">" ? O.BLOCK_FOLDED : O.BLOCK_LITERAL, o = e.source ? yn(e.source) : [];
2734
- let a = o.length;
2733
+ const r = i.mode === ">" ? N.BLOCK_FOLDED : N.BLOCK_LITERAL, o = e.source ? Tn(e.source) : [];
2734
+ let l = o.length;
2735
2735
  for (let h = o.length - 1; h >= 0; --h) {
2736
2736
  const m = o[h][1];
2737
2737
  if (m === "" || m === "\r")
2738
- a = h;
2738
+ l = h;
2739
2739
  else
2740
2740
  break;
2741
2741
  }
2742
- if (a === 0) {
2742
+ if (l === 0) {
2743
2743
  const h = i.chomp === "+" && o.length > 0 ? `
2744
2744
  `.repeat(Math.max(1, o.length - 1)) : "";
2745
2745
  let m = n + i.length;
2746
2746
  return e.source && (m += e.source.length), { value: h, type: r, comment: i.comment, range: [n, m, m] };
2747
2747
  }
2748
- let l = e.indent + i.indent, c = e.offset + i.length, d = 0;
2749
- for (let h = 0; h < a; ++h) {
2748
+ let a = e.indent + i.indent, c = e.offset + i.length, d = 0;
2749
+ for (let h = 0; h < l; ++h) {
2750
2750
  const [m, b] = o[h];
2751
2751
  if (b === "" || b === "\r")
2752
- i.indent === 0 && m.length > l && (l = m.length);
2752
+ i.indent === 0 && m.length > a && (a = m.length);
2753
2753
  else {
2754
- m.length < l && t(c + m.length, "MISSING_CHAR", "Block scalars with more-indented leading empty lines must use an explicit indentation indicator"), i.indent === 0 && (l = m.length), d = h, l === 0 && !s.atRoot && t(c, "BAD_INDENT", "Block scalar values in collections must be indented");
2754
+ m.length < a && t(c + m.length, "MISSING_CHAR", "Block scalars with more-indented leading empty lines must use an explicit indentation indicator"), i.indent === 0 && (a = m.length), d = h, a === 0 && !s.atRoot && t(c, "BAD_INDENT", "Block scalar values in collections must be indented");
2755
2755
  break;
2756
2756
  }
2757
2757
  c += m.length + b.length + 1;
2758
2758
  }
2759
- for (let h = o.length - 1; h >= a; --h)
2760
- o[h][0].length > l && (a = h + 1);
2759
+ for (let h = o.length - 1; h >= l; --h)
2760
+ o[h][0].length > a && (l = h + 1);
2761
2761
  let u = "", f = "", p = !1;
2762
2762
  for (let h = 0; h < d; ++h)
2763
- u += o[h][0].slice(l) + `
2763
+ u += o[h][0].slice(a) + `
2764
2764
  `;
2765
- for (let h = d; h < a; ++h) {
2765
+ for (let h = d; h < l; ++h) {
2766
2766
  let [m, b] = o[h];
2767
2767
  c += m.length + b.length + 1;
2768
2768
  const w = b[b.length - 1] === "\r";
2769
- if (w && (b = b.slice(0, -1)), b && m.length < l) {
2770
- const S = `Block scalar lines must not be less indented than their ${i.indent ? "explicit indentation indicator" : "first line"}`;
2771
- t(c - b.length - (w ? 2 : 1), "BAD_INDENT", S), m = "";
2769
+ if (w && (b = b.slice(0, -1)), b && m.length < a) {
2770
+ const k = `Block scalar lines must not be less indented than their ${i.indent ? "explicit indentation indicator" : "first line"}`;
2771
+ t(c - b.length - (w ? 2 : 1), "BAD_INDENT", k), m = "";
2772
2772
  }
2773
- r === O.BLOCK_LITERAL ? (u += f + m.slice(l) + b, f = `
2774
- `) : m.length > l || b[0] === " " ? (f === " " ? f = `
2773
+ r === N.BLOCK_LITERAL ? (u += f + m.slice(a) + b, f = `
2774
+ `) : m.length > a || b[0] === " " ? (f === " " ? f = `
2775
2775
  ` : !p && f === `
2776
2776
  ` && (f = `
2777
2777
 
2778
- `), u += f + m.slice(l) + b, f = `
2778
+ `), u += f + m.slice(a) + b, f = `
2779
2779
  `, p = !0) : b === "" ? f === `
2780
2780
  ` ? u += `
2781
2781
  ` : f = `
@@ -2785,9 +2785,9 @@ function mn(s, e, t) {
2785
2785
  case "-":
2786
2786
  break;
2787
2787
  case "+":
2788
- for (let h = a; h < o.length; ++h)
2788
+ for (let h = l; h < o.length; ++h)
2789
2789
  u += `
2790
- ` + o[h][0].slice(l);
2790
+ ` + o[h][0].slice(a);
2791
2791
  u[u.length - 1] !== `
2792
2792
  ` && (u += `
2793
2793
  `);
@@ -2799,21 +2799,21 @@ function mn(s, e, t) {
2799
2799
  const g = n + i.length + e.source.length;
2800
2800
  return { value: u, type: r, comment: i.comment, range: [n, g, g] };
2801
2801
  }
2802
- function gn({ offset: s, props: e }, t, n) {
2802
+ function En({ offset: s, props: e }, t, n) {
2803
2803
  if (e[0].type !== "block-scalar-header")
2804
2804
  return n(e[0], "IMPOSSIBLE", "Block scalar header not found"), null;
2805
2805
  const { source: i } = e[0], r = i[0];
2806
- let o = 0, a = "", l = -1;
2806
+ let o = 0, l = "", a = -1;
2807
2807
  for (let f = 1; f < i.length; ++f) {
2808
2808
  const p = i[f];
2809
- if (!a && (p === "-" || p === "+"))
2810
- a = p;
2809
+ if (!l && (p === "-" || p === "+"))
2810
+ l = p;
2811
2811
  else {
2812
2812
  const g = Number(p);
2813
- !o && g ? o = g : l === -1 && (l = s + f);
2813
+ !o && g ? o = g : a === -1 && (a = s + f);
2814
2814
  }
2815
2815
  }
2816
- l !== -1 && n(l, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${i}`);
2816
+ a !== -1 && n(a, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${i}`);
2817
2817
  let c = !1, d = "", u = i.length;
2818
2818
  for (let f = 1; f < e.length; ++f) {
2819
2819
  const p = e[f];
@@ -2839,27 +2839,27 @@ function gn({ offset: s, props: e }, t, n) {
2839
2839
  }
2840
2840
  }
2841
2841
  }
2842
- return { mode: r, indent: o, chomp: a, comment: d, length: u };
2842
+ return { mode: r, indent: o, chomp: l, comment: d, length: u };
2843
2843
  }
2844
- function yn(s) {
2844
+ function Tn(s) {
2845
2845
  const e = s.split(/\n( *)/), t = e[0], n = t.match(/^( *)/), r = [n?.[1] ? [n[1], t.slice(n[1].length)] : ["", t]];
2846
2846
  for (let o = 1; o < e.length; o += 2)
2847
2847
  r.push([e[o], e[o + 1]]);
2848
2848
  return r;
2849
2849
  }
2850
- function bn(s, e, t) {
2850
+ function In(s, e, t) {
2851
2851
  const { offset: n, type: i, source: r, end: o } = s;
2852
- let a, l;
2852
+ let l, a;
2853
2853
  const c = (f, p, g) => t(n + f, p, g);
2854
2854
  switch (i) {
2855
2855
  case "scalar":
2856
- a = O.PLAIN, l = wn(r, c);
2856
+ l = N.PLAIN, a = An(r, c);
2857
2857
  break;
2858
2858
  case "single-quoted-scalar":
2859
- a = O.QUOTE_SINGLE, l = kn(r, c);
2859
+ l = N.QUOTE_SINGLE, a = vn(r, c);
2860
2860
  break;
2861
2861
  case "double-quoted-scalar":
2862
- a = O.QUOTE_DOUBLE, l = Sn(r, c);
2862
+ l = N.QUOTE_DOUBLE, a = $n(r, c);
2863
2863
  break;
2864
2864
  /* istanbul ignore next should not happen */
2865
2865
  default:
@@ -2870,15 +2870,15 @@ function bn(s, e, t) {
2870
2870
  range: [n, n + r.length, n + r.length]
2871
2871
  };
2872
2872
  }
2873
- const d = n + r.length, u = Se(o, d, e, t);
2873
+ const d = n + r.length, u = ke(o, d, e, t);
2874
2874
  return {
2875
- value: l,
2876
- type: a,
2875
+ value: a,
2876
+ type: l,
2877
2877
  comment: u.comment,
2878
2878
  range: [n, d, u.offset]
2879
2879
  };
2880
2880
  }
2881
- function wn(s, e) {
2881
+ function An(s, e) {
2882
2882
  let t = "";
2883
2883
  switch (s[0]) {
2884
2884
  /* istanbul ignore next should not happen */
@@ -2902,12 +2902,12 @@ function wn(s, e) {
2902
2902
  break;
2903
2903
  }
2904
2904
  }
2905
- return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`), hs(s);
2905
+ return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`), Ss(s);
2906
2906
  }
2907
- function kn(s, e) {
2908
- return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"), hs(s.slice(1, -1)).replace(/''/g, "'");
2907
+ function vn(s, e) {
2908
+ return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"), Ss(s.slice(1, -1)).replace(/''/g, "'");
2909
2909
  }
2910
- function hs(s) {
2910
+ function Ss(s) {
2911
2911
  let e, t;
2912
2912
  try {
2913
2913
  e = new RegExp(`(.*?)(?<![ ])[ ]*\r?
@@ -2924,10 +2924,10 @@ function hs(s) {
2924
2924
  n[1] === "" ? r === `
2925
2925
  ` ? i += r : r = `
2926
2926
  ` : (i += r + n[1], r = " "), o = t.lastIndex;
2927
- const a = /[ \t]*(.*)/sy;
2928
- return a.lastIndex = o, n = a.exec(s), i + r + (n?.[1] ?? "");
2927
+ const l = /[ \t]*(.*)/sy;
2928
+ return l.lastIndex = o, n = l.exec(s), i + r + (n?.[1] ?? "");
2929
2929
  }
2930
- function Sn(s, e) {
2930
+ function $n(s, e) {
2931
2931
  let t = "";
2932
2932
  for (let n = 1; n < s.length - 1; ++n) {
2933
2933
  const i = s[n];
@@ -2935,11 +2935,11 @@ function Sn(s, e) {
2935
2935
  `))
2936
2936
  if (i === `
2937
2937
  `) {
2938
- const { fold: r, offset: o } = Nn(s, n);
2938
+ const { fold: r, offset: o } = Ln(s, n);
2939
2939
  t += r, n = o;
2940
2940
  } else if (i === "\\") {
2941
2941
  let r = s[++n];
2942
- const o = On[r];
2942
+ const o = Cn[r];
2943
2943
  if (o)
2944
2944
  t += o;
2945
2945
  else if (r === `
@@ -2951,11 +2951,11 @@ function Sn(s, e) {
2951
2951
  for (r = s[++n + 1]; r === " " || r === " "; )
2952
2952
  r = s[++n + 1];
2953
2953
  else if (r === "x" || r === "u" || r === "U") {
2954
- const a = { x: 2, u: 4, U: 8 }[r];
2955
- t += An(s, n + 1, a, e), n += a;
2954
+ const l = { x: 2, u: 4, U: 8 }[r];
2955
+ t += jn(s, n + 1, l, e), n += l;
2956
2956
  } else {
2957
- const a = s.substr(n - 1, 2);
2958
- e(n - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${a}`), t += a;
2957
+ const l = s.substr(n - 1, 2);
2958
+ e(n - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${l}`), t += l;
2959
2959
  }
2960
2960
  } else if (i === " " || i === " ") {
2961
2961
  const r = n;
@@ -2970,7 +2970,7 @@ function Sn(s, e) {
2970
2970
  }
2971
2971
  return (s[s.length - 1] !== '"' || s.length === 1) && e(s.length, "MISSING_CHAR", 'Missing closing "quote'), t;
2972
2972
  }
2973
- function Nn(s, e) {
2973
+ function Ln(s, e) {
2974
2974
  let t = "", n = s[e + 1];
2975
2975
  for (; (n === " " || n === " " || n === `
2976
2976
  ` || n === "\r") && !(n === "\r" && s[e + 2] !== `
@@ -2980,7 +2980,7 @@ function Nn(s, e) {
2980
2980
  `), e += 1, n = s[e + 1];
2981
2981
  return t || (t = " "), { fold: t, offset: e };
2982
2982
  }
2983
- const On = {
2983
+ const Cn = {
2984
2984
  0: "\0",
2985
2985
  // null character
2986
2986
  a: "\x07",
@@ -3014,56 +3014,56 @@ const On = {
3014
3014
  "\\": "\\",
3015
3015
  " ": " "
3016
3016
  };
3017
- function An(s, e, t, n) {
3017
+ function jn(s, e, t, n) {
3018
3018
  const i = s.substr(e, t), o = i.length === t && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
3019
3019
  if (isNaN(o)) {
3020
- const a = s.substr(e - 2, t + 2);
3021
- return n(e - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${a}`), a;
3020
+ const l = s.substr(e - 2, t + 2);
3021
+ return n(e - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${l}`), l;
3022
3022
  }
3023
3023
  return String.fromCodePoint(o);
3024
3024
  }
3025
- function ds(s, e, t, n) {
3026
- const { value: i, type: r, comment: o, range: a } = e.type === "block-scalar" ? mn(s, e, n) : bn(e, s.options.strict, n), l = t ? s.directives.tagName(t.source, (u) => n(t, "TAG_RESOLVE_FAILED", u)) : null;
3025
+ function ks(s, e, t, n) {
3026
+ const { value: i, type: r, comment: o, range: l } = e.type === "block-scalar" ? On(s, e, n) : In(e, s.options.strict, n), a = t ? s.directives.tagName(t.source, (u) => n(t, "TAG_RESOLVE_FAILED", u)) : null;
3027
3027
  let c;
3028
- s.options.stringKeys && s.atKey ? c = s.schema[U] : l ? c = En(s.schema, i, l, t, n) : e.type === "scalar" ? c = Tn(s, i, e, n) : c = s.schema[U];
3028
+ s.options.stringKeys && s.atKey ? c = s.schema[R] : a ? c = Bn(s.schema, i, a, t, n) : e.type === "scalar" ? c = Mn(s, i, e, n) : c = s.schema[R];
3029
3029
  let d;
3030
3030
  try {
3031
3031
  const u = c.resolve(i, (f) => n(t ?? e, "TAG_RESOLVE_FAILED", f), s.options);
3032
- d = T(u) ? u : new O(u);
3032
+ d = I(u) ? u : new N(u);
3033
3033
  } catch (u) {
3034
3034
  const f = u instanceof Error ? u.message : String(u);
3035
- n(t ?? e, "TAG_RESOLVE_FAILED", f), d = new O(i);
3035
+ n(t ?? e, "TAG_RESOLVE_FAILED", f), d = new N(i);
3036
3036
  }
3037
- return d.range = a, d.source = i, r && (d.type = r), l && (d.tag = l), c.format && (d.format = c.format), o && (d.comment = o), d;
3037
+ return d.range = l, d.source = i, r && (d.type = r), a && (d.tag = a), c.format && (d.format = c.format), o && (d.comment = o), d;
3038
3038
  }
3039
- function En(s, e, t, n, i) {
3039
+ function Bn(s, e, t, n, i) {
3040
3040
  if (t === "!")
3041
- return s[U];
3041
+ return s[R];
3042
3042
  const r = [];
3043
- for (const a of s.tags)
3044
- if (!a.collection && a.tag === t)
3045
- if (a.default && a.test)
3046
- r.push(a);
3043
+ for (const l of s.tags)
3044
+ if (!l.collection && l.tag === t)
3045
+ if (l.default && l.test)
3046
+ r.push(l);
3047
3047
  else
3048
- return a;
3049
- for (const a of r)
3050
- if (a.test?.test(e))
3051
- return a;
3048
+ return l;
3049
+ for (const l of r)
3050
+ if (l.test?.test(e))
3051
+ return l;
3052
3052
  const o = s.knownTags[t];
3053
- 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[U]);
3053
+ 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[R]);
3054
3054
  }
3055
- function Tn({ atKey: s, directives: e, schema: t }, n, i, r) {
3056
- const o = t.tags.find((a) => (a.default === !0 || s && a.default === "key") && a.test?.test(n)) || t[U];
3055
+ function Mn({ atKey: s, directives: e, schema: t }, n, i, r) {
3056
+ const o = t.tags.find((l) => (l.default === !0 || s && l.default === "key") && l.test?.test(n)) || t[R];
3057
3057
  if (t.compat) {
3058
- const a = t.compat.find((l) => l.default && l.test?.test(n)) ?? t[U];
3059
- if (o.tag !== a.tag) {
3060
- const l = e.tagString(o.tag), c = e.tagString(a.tag), d = `Value may be parsed as either ${l} or ${c}`;
3058
+ const l = t.compat.find((a) => a.default && a.test?.test(n)) ?? t[R];
3059
+ if (o.tag !== l.tag) {
3060
+ const a = e.tagString(o.tag), c = e.tagString(l.tag), d = `Value may be parsed as either ${a} or ${c}`;
3061
3061
  r(i, "TAG_RESOLVE_FAILED", d, !0);
3062
3062
  }
3063
3063
  }
3064
3064
  return o;
3065
3065
  }
3066
- function In(s, e, t) {
3066
+ function Pn(s, e, t) {
3067
3067
  if (e) {
3068
3068
  t ?? (t = e.length);
3069
3069
  for (let n = t - 1; n >= 0; --n) {
@@ -3082,54 +3082,54 @@ function In(s, e, t) {
3082
3082
  }
3083
3083
  return s;
3084
3084
  }
3085
- const $n = { composeNode: ps, composeEmptyNode: bt };
3086
- function ps(s, e, t, n) {
3087
- const i = s.atKey, { spaceBefore: r, comment: o, anchor: a, tag: l } = t;
3085
+ const Dn = { composeNode: _s, composeEmptyNode: St };
3086
+ function _s(s, e, t, n) {
3087
+ const i = s.atKey, { spaceBefore: r, comment: o, anchor: l, tag: a } = t;
3088
3088
  let c, d = !0;
3089
3089
  switch (e.type) {
3090
3090
  case "alias":
3091
- c = Ln(s, e, n), (a || l) && n(e, "ALIAS_PROPS", "An alias node must not specify any properties");
3091
+ c = xn(s, e, n), (l || a) && n(e, "ALIAS_PROPS", "An alias node must not specify any properties");
3092
3092
  break;
3093
3093
  case "scalar":
3094
3094
  case "single-quoted-scalar":
3095
3095
  case "double-quoted-scalar":
3096
3096
  case "block-scalar":
3097
- c = ds(s, e, l, n), a && (c.anchor = a.source.substring(1));
3097
+ c = ks(s, e, a, n), l && (c.anchor = l.source.substring(1));
3098
3098
  break;
3099
3099
  case "block-map":
3100
3100
  case "block-seq":
3101
3101
  case "flow-collection":
3102
- c = pn($n, s, e, t, n), a && (c.anchor = a.source.substring(1));
3102
+ c = Nn(Dn, s, e, t, n), l && (c.anchor = l.source.substring(1));
3103
3103
  break;
3104
3104
  default: {
3105
3105
  const u = e.type === "error" ? e.message : `Unsupported token (type: ${e.type})`;
3106
- n(e, "UNEXPECTED_TOKEN", u), c = bt(s, e.offset, void 0, null, t, n), d = !1;
3106
+ n(e, "UNEXPECTED_TOKEN", u), c = St(s, e.offset, void 0, null, t, n), d = !1;
3107
3107
  }
3108
3108
  }
3109
- return 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 && d && (c.srcToken = e), c;
3109
+ return l && c.anchor === "" && n(l, "BAD_ALIAS", "Anchor cannot be an empty string"), i && s.options.stringKeys && (!I(c) || typeof c.value != "string" || c.tag && c.tag !== "tag:yaml.org,2002:str") && n(a ?? 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 && d && (c.srcToken = e), c;
3110
3110
  }
3111
- function bt(s, e, t, n, { spaceBefore: i, comment: r, anchor: o, tag: a, end: l }, c) {
3111
+ function St(s, e, t, n, { spaceBefore: i, comment: r, anchor: o, tag: l, end: a }, c) {
3112
3112
  const d = {
3113
3113
  type: "scalar",
3114
- offset: In(e, t, n),
3114
+ offset: Pn(e, t, n),
3115
3115
  indent: -1,
3116
3116
  source: ""
3117
- }, u = ds(s, d, a, c);
3118
- return o && (u.anchor = o.source.substring(1), u.anchor === "" && c(o, "BAD_ALIAS", "Anchor cannot be an empty string")), i && (u.spaceBefore = !0), r && (u.comment = r, u.range[2] = l), u;
3117
+ }, u = ks(s, d, l, c);
3118
+ return o && (u.anchor = o.source.substring(1), u.anchor === "" && c(o, "BAD_ALIAS", "Anchor cannot be an empty string")), i && (u.spaceBefore = !0), r && (u.comment = r, u.range[2] = a), u;
3119
3119
  }
3120
- function Ln({ options: s }, { offset: e, source: t, end: n }, i) {
3121
- const r = new ot(t.substring(1));
3120
+ function xn({ options: s }, { offset: e, source: t, end: n }, i) {
3121
+ const r = new at(t.substring(1));
3122
3122
  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);
3123
- const o = e + t.length, a = Se(n, o, s.strict, i);
3124
- return r.range = [e, o, a.offset], a.comment && (r.comment = a.comment), r;
3123
+ const o = e + t.length, l = ke(n, o, s.strict, i);
3124
+ return r.range = [e, o, l.offset], l.comment && (r.comment = l.comment), r;
3125
3125
  }
3126
- function vn(s, e, { offset: t, start: n, value: i, end: r }, o) {
3127
- const a = Object.assign({ _directives: e }, s), l = new qe(void 0, a), c = {
3126
+ function Kn(s, e, { offset: t, start: n, value: i, end: r }, o) {
3127
+ const l = Object.assign({ _directives: e }, s), a = new qe(void 0, l), c = {
3128
3128
  atKey: !1,
3129
3129
  atRoot: !0,
3130
- directives: l.directives,
3131
- options: l.options,
3132
- schema: l.schema
3130
+ directives: a.directives,
3131
+ options: a.options,
3132
+ schema: a.schema
3133
3133
  }, d = oe(n, {
3134
3134
  indicator: "doc-start",
3135
3135
  next: i ?? r?.[0],
@@ -3138,9 +3138,9 @@ function vn(s, e, { offset: t, start: n, value: i, end: r }, o) {
3138
3138
  parentIndent: 0,
3139
3139
  startOnNewline: !0
3140
3140
  });
3141
- d.found && (l.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !d.hasNewline && o(d.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), l.contents = i ? ps(c, i, d, o) : bt(c, d.end, n, null, d, o);
3142
- const u = l.contents.range[2], f = Se(r, u, !1, o);
3143
- return f.comment && (l.comment = f.comment), l.range = [t, u, f.offset], l;
3141
+ d.found && (a.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !d.hasNewline && o(d.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), a.contents = i ? _s(c, i, d, o) : St(c, d.end, n, null, d, o);
3142
+ const u = a.contents.range[2], f = ke(r, u, !1, o);
3143
+ return f.comment && (a.comment = f.comment), a.range = [t, u, f.offset], a;
3144
3144
  }
3145
3145
  function ue(s) {
3146
3146
  if (typeof s == "number")
@@ -3150,7 +3150,7 @@ function ue(s) {
3150
3150
  const { offset: e, source: t } = s;
3151
3151
  return [e, e + (typeof t == "string" ? t.length : 1)];
3152
3152
  }
3153
- function $t(s) {
3153
+ function Lt(s) {
3154
3154
  let e = "", t = !1, n = !1;
3155
3155
  for (let i = 0; i < s.length; ++i) {
3156
3156
  const r = s[i];
@@ -3170,15 +3170,15 @@ function $t(s) {
3170
3170
  }
3171
3171
  return { comment: e, afterEmptyLine: n };
3172
3172
  }
3173
- class Cn {
3173
+ class Rn {
3174
3174
  constructor(e = {}) {
3175
3175
  this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (t, n, i, r) => {
3176
3176
  const o = ue(t);
3177
- r ? this.warnings.push(new fn(o, n, i)) : this.errors.push(new de(o, n, i));
3178
- }, this.directives = new _({ version: e.version || "1.2" }), this.options = e;
3177
+ r ? this.warnings.push(new wn(o, n, i)) : this.errors.push(new de(o, n, i));
3178
+ }, this.directives = new j({ version: e.version || "1.2" }), this.options = e;
3179
3179
  }
3180
3180
  decorate(e, t) {
3181
- const { comment: n, afterEmptyLine: i } = $t(this.prelude);
3181
+ const { comment: n, afterEmptyLine: i } = Lt(this.prelude);
3182
3182
  if (n) {
3183
3183
  const r = e.contents;
3184
3184
  if (t)
@@ -3186,12 +3186,12 @@ class Cn {
3186
3186
  ${n}` : n;
3187
3187
  else if (i || e.directives.docStart || !r)
3188
3188
  e.commentBefore = n;
3189
- else if (I(r) && !r.flow && r.items.length > 0) {
3189
+ else if (A(r) && !r.flow && r.items.length > 0) {
3190
3190
  let o = r.items[0];
3191
- L(o) && (o = o.key);
3192
- const a = o.commentBefore;
3193
- o.commentBefore = a ? `${n}
3194
- ${a}` : n;
3191
+ $(o) && (o = o.key);
3192
+ const l = o.commentBefore;
3193
+ o.commentBefore = l ? `${n}
3194
+ ${l}` : n;
3195
3195
  } else {
3196
3196
  const o = r.commentBefore;
3197
3197
  r.commentBefore = o ? `${n}
@@ -3207,7 +3207,7 @@ ${o}` : n;
3207
3207
  */
3208
3208
  streamInfo() {
3209
3209
  return {
3210
- comment: $t(this.prelude).comment,
3210
+ comment: Lt(this.prelude).comment,
3211
3211
  directives: this.directives,
3212
3212
  errors: this.errors,
3213
3213
  warnings: this.warnings
@@ -3234,7 +3234,7 @@ ${o}` : n;
3234
3234
  }), this.prelude.push(e.source), this.atDirectives = !0;
3235
3235
  break;
3236
3236
  case "document": {
3237
- const t = vn(this.options, this.directives, e, this.onError);
3237
+ const t = Kn(this.options, this.directives, e, this.onError);
3238
3238
  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;
3239
3239
  break;
3240
3240
  }
@@ -3257,7 +3257,7 @@ ${o}` : n;
3257
3257
  break;
3258
3258
  }
3259
3259
  this.doc.directives.docEnd = !0;
3260
- const t = Se(e.end, e.offset + e.source.length, this.doc.options.strict, this.onError);
3260
+ const t = ke(e.end, e.offset + e.source.length, this.doc.options.strict, this.onError);
3261
3261
  if (this.decorate(this.doc, !0), t.comment) {
3262
3262
  const n = this.doc.comment;
3263
3263
  this.doc.comment = n ? `${n}
@@ -3285,16 +3285,16 @@ ${t.comment}` : t.comment;
3285
3285
  }
3286
3286
  }
3287
3287
  }
3288
- const ms = "\uFEFF", gs = "", ys = "", et = "";
3289
- function _n(s) {
3288
+ const Ns = "\uFEFF", Os = "", Es = "", st = "";
3289
+ function Un(s) {
3290
3290
  switch (s) {
3291
- case ms:
3291
+ case Ns:
3292
3292
  return "byte-order-mark";
3293
- case gs:
3293
+ case Os:
3294
3294
  return "doc-mode";
3295
- case ys:
3295
+ case Es:
3296
3296
  return "flow-error-end";
3297
- case et:
3297
+ case st:
3298
3298
  return "scalar";
3299
3299
  case "---":
3300
3300
  return "doc-start";
@@ -3347,7 +3347,7 @@ function _n(s) {
3347
3347
  }
3348
3348
  return null;
3349
3349
  }
3350
- function K(s) {
3350
+ function x(s) {
3351
3351
  switch (s) {
3352
3352
  case void 0:
3353
3353
  case " ":
@@ -3360,9 +3360,9 @@ function K(s) {
3360
3360
  return !1;
3361
3361
  }
3362
3362
  }
3363
- const Lt = new Set("0123456789ABCDEFabcdef"), jn = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), Ee = new Set(",[]{}"), Bn = new Set(` ,[]{}
3364
- \r `), He = (s) => !s || Bn.has(s);
3365
- class Mn {
3363
+ const Ct = new Set("0123456789ABCDEFabcdef"), Fn = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), Te = new Set(",[]{}"), qn = new Set(` ,[]{}
3364
+ \r `), We = (s) => !s || qn.has(s);
3365
+ class Vn {
3366
3366
  constructor() {
3367
3367
  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;
3368
3368
  }
@@ -3411,7 +3411,7 @@ class Mn {
3411
3411
  }
3412
3412
  if (t === "-" || t === ".") {
3413
3413
  const n = this.buffer.substr(e, 3);
3414
- if ((n === "---" || n === "...") && K(this.buffer[e + 3]))
3414
+ if ((n === "---" || n === "...") && x(this.buffer[e + 3]))
3415
3415
  return -1;
3416
3416
  }
3417
3417
  return e;
@@ -3454,7 +3454,7 @@ class Mn {
3454
3454
  let e = this.getLine();
3455
3455
  if (e === null)
3456
3456
  return this.setNext("stream");
3457
- if (e[0] === ms && (yield* this.pushCount(1), e = e.substring(1)), e[0] === "%") {
3457
+ if (e[0] === Ns && (yield* this.pushCount(1), e = e.substring(1)), e[0] === "%") {
3458
3458
  let t = e.length, n = e.indexOf("#");
3459
3459
  for (; n !== -1; ) {
3460
3460
  const r = e[n - 1];
@@ -3478,7 +3478,7 @@ class Mn {
3478
3478
  const t = yield* this.pushSpaces(!0);
3479
3479
  return yield* this.pushCount(e.length - t), yield* this.pushNewline(), "stream";
3480
3480
  }
3481
- return yield gs, yield* this.parseLineStart();
3481
+ return yield Os, yield* this.parseLineStart();
3482
3482
  }
3483
3483
  *parseLineStart() {
3484
3484
  const e = this.charAt(0);
@@ -3488,16 +3488,16 @@ class Mn {
3488
3488
  if (!this.atEnd && !this.hasChars(4))
3489
3489
  return this.setNext("line-start");
3490
3490
  const t = this.peek(3);
3491
- if ((t === "---" || t === "...") && K(this.charAt(3)))
3491
+ if ((t === "---" || t === "...") && x(this.charAt(3)))
3492
3492
  return yield* this.pushCount(3), this.indentValue = 0, this.indentNext = 0, t === "---" ? "doc" : "stream";
3493
3493
  }
3494
- return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !K(this.charAt(1)) && (this.indentNext = this.indentValue), yield* this.parseBlockStart();
3494
+ return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !x(this.charAt(1)) && (this.indentNext = this.indentValue), yield* this.parseBlockStart();
3495
3495
  }
3496
3496
  *parseBlockStart() {
3497
3497
  const [e, t] = this.peek(2);
3498
3498
  if (!t && !this.atEnd)
3499
3499
  return this.setNext("block-start");
3500
- if ((e === "-" || e === "?" || e === ":") && K(t)) {
3500
+ if ((e === "-" || e === "?" || e === ":") && x(t)) {
3501
3501
  const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0));
3502
3502
  return this.indentNext = this.indentValue + 1, this.indentValue += n, yield* this.parseBlockStart();
3503
3503
  }
@@ -3522,7 +3522,7 @@ class Mn {
3522
3522
  case "]":
3523
3523
  return yield* this.pushCount(1), "doc";
3524
3524
  case "*":
3525
- return yield* this.pushUntil(He), "doc";
3525
+ return yield* this.pushUntil(We), "doc";
3526
3526
  case '"':
3527
3527
  case "'":
3528
3528
  return yield* this.parseQuotedScalar();
@@ -3541,8 +3541,8 @@ class Mn {
3541
3541
  const i = this.getLine();
3542
3542
  if (i === null)
3543
3543
  return this.setNext("flow");
3544
- if ((n !== -1 && n < this.indentNext && i[0] !== "#" || n === 0 && (i.startsWith("---") || i.startsWith("...")) && K(i[3])) && !(n === this.indentNext - 1 && this.flowLevel === 1 && (i[0] === "]" || i[0] === "}")))
3545
- return this.flowLevel = 0, yield ys, yield* this.parseLineStart();
3544
+ if ((n !== -1 && n < this.indentNext && i[0] !== "#" || n === 0 && (i.startsWith("---") || i.startsWith("...")) && x(i[3])) && !(n === this.indentNext - 1 && this.flowLevel === 1 && (i[0] === "]" || i[0] === "}")))
3545
+ return this.flowLevel = 0, yield Es, yield* this.parseLineStart();
3546
3546
  let r = 0;
3547
3547
  for (; i[r] === ","; )
3548
3548
  r += yield* this.pushCount(1), r += yield* this.pushSpaces(!0), this.flowKey = !1;
@@ -3558,13 +3558,13 @@ class Mn {
3558
3558
  case "]":
3559
3559
  return yield* this.pushCount(1), this.flowKey = !0, this.flowLevel -= 1, this.flowLevel ? "flow" : "doc";
3560
3560
  case "*":
3561
- return yield* this.pushUntil(He), "flow";
3561
+ return yield* this.pushUntil(We), "flow";
3562
3562
  case '"':
3563
3563
  case "'":
3564
3564
  return this.flowKey = !0, yield* this.parseQuotedScalar();
3565
3565
  case ":": {
3566
3566
  const o = this.charAt(1);
3567
- if (this.flowKey || K(o) || o === ",")
3567
+ if (this.flowKey || x(o) || o === ",")
3568
3568
  return this.flowKey = !1, yield* this.pushCount(1), yield* this.pushSpaces(!0), "flow";
3569
3569
  }
3570
3570
  // fallthrough
@@ -3619,7 +3619,7 @@ class Mn {
3619
3619
  else if (t !== "-")
3620
3620
  break;
3621
3621
  }
3622
- return yield* this.pushUntil((t) => K(t) || t === "#");
3622
+ return yield* this.pushUntil((t) => x(t) || t === "#");
3623
3623
  }
3624
3624
  *parseBlockScalar() {
3625
3625
  let e = this.pos - 1, t = 0, n;
@@ -3673,16 +3673,16 @@ class Mn {
3673
3673
  do {
3674
3674
  let r = e - 1, o = this.buffer[r];
3675
3675
  o === "\r" && (o = this.buffer[--r]);
3676
- const a = r;
3676
+ const l = r;
3677
3677
  for (; o === " "; )
3678
3678
  o = this.buffer[--r];
3679
3679
  if (o === `
3680
- ` && r >= this.pos && r + 1 + t > a)
3680
+ ` && r >= this.pos && r + 1 + t > l)
3681
3681
  e = r;
3682
3682
  else
3683
3683
  break;
3684
3684
  } while (!0);
3685
- return yield et, yield* this.pushToIndex(e + 1, !0), yield* this.parseLineStart();
3685
+ return yield st, yield* this.pushToIndex(e + 1, !0), yield* this.parseLineStart();
3686
3686
  }
3687
3687
  *parsePlainScalar() {
3688
3688
  const e = this.flowLevel > 0;
@@ -3690,14 +3690,14 @@ class Mn {
3690
3690
  for (; i = this.buffer[++n]; )
3691
3691
  if (i === ":") {
3692
3692
  const r = this.buffer[n + 1];
3693
- if (K(r) || e && Ee.has(r))
3693
+ if (x(r) || e && Te.has(r))
3694
3694
  break;
3695
3695
  t = n;
3696
- } else if (K(i)) {
3696
+ } else if (x(i)) {
3697
3697
  let r = this.buffer[n + 1];
3698
3698
  if (i === "\r" && (r === `
3699
3699
  ` ? (n += 1, i = `
3700
- `, r = this.buffer[n + 1]) : t = n), r === "#" || e && Ee.has(r))
3700
+ `, r = this.buffer[n + 1]) : t = n), r === "#" || e && Te.has(r))
3701
3701
  break;
3702
3702
  if (i === `
3703
3703
  `) {
@@ -3707,11 +3707,11 @@ class Mn {
3707
3707
  n = Math.max(n, o - 2);
3708
3708
  }
3709
3709
  } else {
3710
- if (e && Ee.has(i))
3710
+ if (e && Te.has(i))
3711
3711
  break;
3712
3712
  t = n;
3713
3713
  }
3714
- return !i && !this.atEnd ? this.setNext("plain-scalar") : (yield et, yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
3714
+ return !i && !this.atEnd ? this.setNext("plain-scalar") : (yield st, yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
3715
3715
  }
3716
3716
  *pushCount(e) {
3717
3717
  return e > 0 ? (yield this.buffer.substr(this.pos, e), this.pos += e, e) : 0;
@@ -3725,14 +3725,14 @@ class Mn {
3725
3725
  case "!":
3726
3726
  return (yield* this.pushTag()) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
3727
3727
  case "&":
3728
- return (yield* this.pushUntil(He)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
3728
+ return (yield* this.pushUntil(We)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
3729
3729
  case "-":
3730
3730
  // this is an error
3731
3731
  case "?":
3732
3732
  // this is an error outside flow collections
3733
3733
  case ":": {
3734
3734
  const e = this.flowLevel > 0, t = this.charAt(1);
3735
- if (K(t) || e && Ee.has(t))
3735
+ if (x(t) || e && Te.has(t))
3736
3736
  return e ? this.flowKey && (this.flowKey = !1) : this.indentNext = this.indentValue + 1, (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
3737
3737
  }
3738
3738
  }
@@ -3741,15 +3741,15 @@ class Mn {
3741
3741
  *pushTag() {
3742
3742
  if (this.charAt(1) === "<") {
3743
3743
  let e = this.pos + 2, t = this.buffer[e];
3744
- for (; !K(t) && t !== ">"; )
3744
+ for (; !x(t) && t !== ">"; )
3745
3745
  t = this.buffer[++e];
3746
3746
  return yield* this.pushToIndex(t === ">" ? e + 1 : e, !1);
3747
3747
  } else {
3748
3748
  let e = this.pos + 1, t = this.buffer[e];
3749
3749
  for (; t; )
3750
- if (jn.has(t))
3750
+ if (Fn.has(t))
3751
3751
  t = this.buffer[++e];
3752
- else if (t === "%" && Lt.has(this.buffer[e + 1]) && Lt.has(this.buffer[e + 2]))
3752
+ else if (t === "%" && Ct.has(this.buffer[e + 1]) && Ct.has(this.buffer[e + 2]))
3753
3753
  t = this.buffer[e += 3];
3754
3754
  else
3755
3755
  break;
@@ -3777,7 +3777,7 @@ class Mn {
3777
3777
  return yield* this.pushToIndex(t, !1);
3778
3778
  }
3779
3779
  }
3780
- class Pn {
3780
+ class Jn {
3781
3781
  constructor() {
3782
3782
  this.lineStarts = [], this.addNewLine = (e) => this.lineStarts.push(e), this.linePos = (e) => {
3783
3783
  let t = 0, n = this.lineStarts.length;
@@ -3800,7 +3800,7 @@ function V(s, e) {
3800
3800
  return !0;
3801
3801
  return !1;
3802
3802
  }
3803
- function vt(s) {
3803
+ function jt(s) {
3804
3804
  for (let e = 0; e < s.length; ++e)
3805
3805
  switch (s[e].type) {
3806
3806
  case "space":
@@ -3812,7 +3812,7 @@ function vt(s) {
3812
3812
  }
3813
3813
  return -1;
3814
3814
  }
3815
- function bs(s) {
3815
+ function Ts(s) {
3816
3816
  switch (s?.type) {
3817
3817
  case "alias":
3818
3818
  case "scalar":
@@ -3824,7 +3824,7 @@ function bs(s) {
3824
3824
  return !1;
3825
3825
  }
3826
3826
  }
3827
- function Te(s) {
3827
+ function Ie(s) {
3828
3828
  switch (s.type) {
3829
3829
  case "document":
3830
3830
  return s.start;
@@ -3856,18 +3856,18 @@ function Z(s) {
3856
3856
  ;
3857
3857
  return s.splice(e, s.length);
3858
3858
  }
3859
- function Ct(s) {
3859
+ function Bt(s) {
3860
3860
  if (s.start.type === "flow-seq-start")
3861
3861
  for (const e of s.items)
3862
- e.sep && !e.value && !V(e.start, "explicit-key-ind") && !V(e.sep, "map-value-ind") && (e.key && (e.value = e.key), delete e.key, bs(e.value) ? e.value.end ? Array.prototype.push.apply(e.value.end, e.sep) : e.value.end = e.sep : Array.prototype.push.apply(e.start, e.sep), delete e.sep);
3862
+ e.sep && !e.value && !V(e.start, "explicit-key-ind") && !V(e.sep, "map-value-ind") && (e.key && (e.value = e.key), delete e.key, Ts(e.value) ? e.value.end ? Array.prototype.push.apply(e.value.end, e.sep) : e.value.end = e.sep : Array.prototype.push.apply(e.start, e.sep), delete e.sep);
3863
3863
  }
3864
- class Kn {
3864
+ class Yn {
3865
3865
  /**
3866
3866
  * @param onNewLine - If defined, called separately with the start position of
3867
3867
  * each new line (in `parse()`, including the start of input).
3868
3868
  */
3869
3869
  constructor(e) {
3870
- this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new Mn(), this.onNewLine = e;
3870
+ this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new Vn(), this.onNewLine = e;
3871
3871
  }
3872
3872
  /**
3873
3873
  * Parse `source` as a YAML stream.
@@ -3891,7 +3891,7 @@ class Kn {
3891
3891
  this.atScalar = !1, yield* this.step(), this.offset += e.length;
3892
3892
  return;
3893
3893
  }
3894
- const t = _n(e);
3894
+ const t = Un(e);
3895
3895
  if (t)
3896
3896
  if (t === "scalar")
3897
3897
  this.atNewLine = !1, this.atScalar = !0, this.type = "scalar";
@@ -3980,7 +3980,7 @@ class Kn {
3980
3980
  yield t;
3981
3981
  else {
3982
3982
  const n = this.peek(1);
3983
- 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" && Ct(t), n.type) {
3983
+ 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" && Bt(t), n.type) {
3984
3984
  case "document":
3985
3985
  n.value = t;
3986
3986
  break;
@@ -4016,7 +4016,7 @@ class Kn {
4016
4016
  }
4017
4017
  if ((n.type === "document" || n.type === "block-map" || n.type === "block-seq") && (t.type === "block-map" || t.type === "block-seq")) {
4018
4018
  const i = t.items[t.items.length - 1];
4019
- i && !i.sep && !i.value && i.start.length > 0 && vt(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));
4019
+ i && !i.sep && !i.value && i.start.length > 0 && jt(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));
4020
4020
  }
4021
4021
  }
4022
4022
  }
@@ -4054,7 +4054,7 @@ class Kn {
4054
4054
  return yield* this.lineEnd(e);
4055
4055
  switch (this.type) {
4056
4056
  case "doc-start": {
4057
- vt(e.start) !== -1 ? (yield* this.pop(), yield* this.step()) : e.start.push(this.sourceToken);
4057
+ jt(e.start) !== -1 ? (yield* this.pop(), yield* this.step()) : e.start.push(this.sourceToken);
4058
4058
  return;
4059
4059
  }
4060
4060
  case "anchor":
@@ -4075,7 +4075,7 @@ class Kn {
4075
4075
  }
4076
4076
  *scalar(e) {
4077
4077
  if (this.type === "map-value-ind") {
4078
- const t = Te(this.peek(2)), n = Z(t);
4078
+ const t = Ie(this.peek(2)), n = Z(t);
4079
4079
  let i;
4080
4080
  e.end ? (i = e.end, i.push(this.sourceToken), delete e.end) : i = [this.sourceToken];
4081
4081
  const r = {
@@ -4142,16 +4142,16 @@ class Kn {
4142
4142
  let r = [];
4143
4143
  if (i && t.sep && !t.value) {
4144
4144
  const o = [];
4145
- for (let a = 0; a < t.sep.length; ++a) {
4146
- const l = t.sep[a];
4147
- switch (l.type) {
4145
+ for (let l = 0; l < t.sep.length; ++l) {
4146
+ const a = t.sep[l];
4147
+ switch (a.type) {
4148
4148
  case "newline":
4149
- o.push(a);
4149
+ o.push(l);
4150
4150
  break;
4151
4151
  case "space":
4152
4152
  break;
4153
4153
  case "comment":
4154
- l.indent > e.indent && (o.length = 0);
4154
+ a.indent > e.indent && (o.length = 0);
4155
4155
  break;
4156
4156
  default:
4157
4157
  o.length = 0;
@@ -4184,13 +4184,13 @@ class Kn {
4184
4184
  indent: this.indent,
4185
4185
  items: [{ start: r, key: null, sep: [this.sourceToken] }]
4186
4186
  });
4187
- else if (bs(t.key) && !V(t.sep, "newline")) {
4188
- const o = Z(t.start), a = t.key, l = t.sep;
4189
- l.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
4187
+ else if (Ts(t.key) && !V(t.sep, "newline")) {
4188
+ const o = Z(t.start), l = t.key, a = t.sep;
4189
+ a.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
4190
4190
  type: "block-map",
4191
4191
  offset: this.offset,
4192
4192
  indent: this.indent,
4193
- items: [{ start: o, key: a, sep: l }]
4193
+ items: [{ start: o, key: l, sep: a }]
4194
4194
  });
4195
4195
  } else r.length > 0 ? t.sep = t.sep.concat(r, this.sourceToken) : t.sep.push(this.sourceToken);
4196
4196
  else if (V(t.start, "newline"))
@@ -4332,17 +4332,17 @@ class Kn {
4332
4332
  if (n.type === "block-map" && (this.type === "map-value-ind" && n.indent === e.indent || this.type === "newline" && !n.items[n.items.length - 1].sep))
4333
4333
  yield* this.pop(), yield* this.step();
4334
4334
  else if (this.type === "map-value-ind" && n.type !== "flow-collection") {
4335
- const i = Te(n), r = Z(i);
4336
- Ct(e);
4335
+ const i = Ie(n), r = Z(i);
4336
+ Bt(e);
4337
4337
  const o = e.end.splice(1, e.end.length);
4338
4338
  o.push(this.sourceToken);
4339
- const a = {
4339
+ const l = {
4340
4340
  type: "block-map",
4341
4341
  offset: e.offset,
4342
4342
  indent: e.indent,
4343
4343
  items: [{ start: r, key: e, sep: o }]
4344
4344
  };
4345
- this.onKeyLine = !0, this.stack[this.stack.length - 1] = a;
4345
+ this.onKeyLine = !0, this.stack[this.stack.length - 1] = l;
4346
4346
  } else
4347
4347
  yield* this.lineEnd(e);
4348
4348
  }
@@ -4396,7 +4396,7 @@ class Kn {
4396
4396
  };
4397
4397
  case "explicit-key-ind": {
4398
4398
  this.onKeyLine = !0;
4399
- const t = Te(e), n = Z(t);
4399
+ const t = Ie(e), n = Z(t);
4400
4400
  return n.push(this.sourceToken), {
4401
4401
  type: "block-map",
4402
4402
  offset: this.offset,
@@ -4406,7 +4406,7 @@ class Kn {
4406
4406
  }
4407
4407
  case "map-value-ind": {
4408
4408
  this.onKeyLine = !0;
4409
- const t = Te(e), n = Z(t);
4409
+ const t = Ie(e), n = Z(t);
4410
4410
  return {
4411
4411
  type: "block-map",
4412
4412
  offset: this.offset,
@@ -4440,44 +4440,44 @@ class Kn {
4440
4440
  }
4441
4441
  }
4442
4442
  }
4443
- function Dn(s) {
4443
+ function Gn(s) {
4444
4444
  const e = s.prettyErrors !== !1;
4445
- return { lineCounter: s.lineCounter || e && new Pn() || null, prettyErrors: e };
4445
+ return { lineCounter: s.lineCounter || e && new Jn() || null, prettyErrors: e };
4446
4446
  }
4447
- function Un(s, e = {}) {
4448
- const { lineCounter: t, prettyErrors: n } = Dn(e), i = new Kn(t?.addNewLine), r = new Cn(e);
4447
+ function Hn(s, e = {}) {
4448
+ const { lineCounter: t, prettyErrors: n } = Gn(e), i = new Yn(t?.addNewLine), r = new Rn(e);
4449
4449
  let o = null;
4450
- for (const a of r.compose(i.parse(s), !0, s.length))
4450
+ for (const l of r.compose(i.parse(s), !0, s.length))
4451
4451
  if (!o)
4452
- o = a;
4452
+ o = l;
4453
4453
  else if (o.options.logLevel !== "silent") {
4454
- o.errors.push(new de(a.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
4454
+ o.errors.push(new de(l.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
4455
4455
  break;
4456
4456
  }
4457
- return n && t && (o.errors.forEach(Tt(s, t)), o.warnings.forEach(Tt(s, t))), o;
4457
+ return n && t && (o.errors.forEach(vt(s, t)), o.warnings.forEach(vt(s, t))), o;
4458
4458
  }
4459
- function Fn(s, e, t) {
4459
+ function Wn(s, e, t) {
4460
4460
  let n;
4461
- const i = Un(s, t);
4461
+ const i = Hn(s, t);
4462
4462
  if (!i)
4463
4463
  return null;
4464
- if (i.warnings.forEach((r) => Yt(i.options.logLevel, r)), i.errors.length > 0) {
4464
+ if (i.warnings.forEach((r) => Zt(i.options.logLevel, r)), i.errors.length > 0) {
4465
4465
  if (i.options.logLevel !== "silent")
4466
4466
  throw i.errors[0];
4467
4467
  i.errors = [];
4468
4468
  }
4469
4469
  return i.toJS(Object.assign({ reviver: n }, t));
4470
4470
  }
4471
- function Rn(s) {
4472
- return kt.isAbsolute(s) ? s : kt.resolve(process.cwd(), s);
4471
+ function Qn(s) {
4472
+ return Nt.isAbsolute(s) ? s : Nt.resolve(process.cwd(), s);
4473
4473
  }
4474
- async function qn(s) {
4474
+ async function Xn(s) {
4475
4475
  if (!s)
4476
4476
  return { on: {} };
4477
- const e = Rn(s), t = await tt(e, "utf8");
4478
- return e.endsWith(".yaml") || e.endsWith(".yml") ? Fn(t) ?? { on: {} } : JSON.parse(t);
4477
+ const e = Qn(s), t = await nt(e, "utf8");
4478
+ return e.endsWith(".yaml") || e.endsWith(".yml") ? Wn(t) ?? { on: {} } : JSON.parse(t);
4479
4479
  }
4480
- function Vn(s) {
4480
+ function zn(s) {
4481
4481
  return s.split(/\r?\n/u).map((e) => e.trim()).filter((e) => e.length > 0 && !e.startsWith("#")).reduce((e, t) => {
4482
4482
  const n = t.indexOf("=");
4483
4483
  if (n <= 0)
@@ -4486,27 +4486,381 @@ function Vn(s) {
4486
4486
  return e[i] = r, e;
4487
4487
  }, {});
4488
4488
  }
4489
- async function Jn(s) {
4489
+ async function Zn(s) {
4490
4490
  const e = {};
4491
4491
  for (const [t, n] of Object.entries(process.env))
4492
4492
  typeof n == "string" && (e[t] = n);
4493
4493
  for (const t of s ?? []) {
4494
- const n = await tt(t, "utf8");
4494
+ const n = await nt(t, "utf8");
4495
4495
  if (t.endsWith(".json")) {
4496
- const i = nt(JSON.parse(n));
4496
+ const i = rt(JSON.parse(n));
4497
4497
  for (const [r, o] of Object.entries(i))
4498
4498
  o != null && (e[r] = String(o));
4499
4499
  continue;
4500
4500
  }
4501
- Object.assign(e, Vn(n));
4501
+ Object.assign(e, zn(n));
4502
4502
  }
4503
4503
  return e;
4504
4504
  }
4505
- const ws = await _t(st(Bt(), "workflow-reports"));
4506
- async function Yn(s, e) {
4505
+ var Qe = function(s, e) {
4506
+ return Object.defineProperty ? Object.defineProperty(s, "raw", { value: e }) : s.raw = e, s;
4507
+ }, E;
4508
+ (function(s) {
4509
+ s[s.EOS = 0] = "EOS", s[s.Text = 1] = "Text", s[s.Incomplete = 2] = "Incomplete", s[s.ESC = 3] = "ESC", s[s.Unknown = 4] = "Unknown", s[s.SGR = 5] = "SGR", s[s.OSCURL = 6] = "OSCURL";
4510
+ })(E || (E = {}));
4511
+ class ei {
4512
+ constructor() {
4513
+ this.VERSION = "6.0.6", this.setup_palettes(), this._use_classes = !1, this.bold = !1, this.faint = !1, this.italic = !1, this.underline = !1, this.fg = this.bg = null, this._buffer = "", this._url_allowlist = { http: 1, https: 1 }, this._escape_html = !0, this.boldStyle = "font-weight:bold", this.faintStyle = "opacity:0.7", this.italicStyle = "font-style:italic", this.underlineStyle = "text-decoration:underline";
4514
+ }
4515
+ set use_classes(e) {
4516
+ this._use_classes = e;
4517
+ }
4518
+ get use_classes() {
4519
+ return this._use_classes;
4520
+ }
4521
+ set url_allowlist(e) {
4522
+ this._url_allowlist = e;
4523
+ }
4524
+ get url_allowlist() {
4525
+ return this._url_allowlist;
4526
+ }
4527
+ set escape_html(e) {
4528
+ this._escape_html = e;
4529
+ }
4530
+ get escape_html() {
4531
+ return this._escape_html;
4532
+ }
4533
+ set boldStyle(e) {
4534
+ this._boldStyle = e;
4535
+ }
4536
+ get boldStyle() {
4537
+ return this._boldStyle;
4538
+ }
4539
+ set faintStyle(e) {
4540
+ this._faintStyle = e;
4541
+ }
4542
+ get faintStyle() {
4543
+ return this._faintStyle;
4544
+ }
4545
+ set italicStyle(e) {
4546
+ this._italicStyle = e;
4547
+ }
4548
+ get italicStyle() {
4549
+ return this._italicStyle;
4550
+ }
4551
+ set underlineStyle(e) {
4552
+ this._underlineStyle = e;
4553
+ }
4554
+ get underlineStyle() {
4555
+ return this._underlineStyle;
4556
+ }
4557
+ setup_palettes() {
4558
+ this.ansi_colors = [
4559
+ [
4560
+ { rgb: [0, 0, 0], class_name: "ansi-black" },
4561
+ { rgb: [187, 0, 0], class_name: "ansi-red" },
4562
+ { rgb: [0, 187, 0], class_name: "ansi-green" },
4563
+ { rgb: [187, 187, 0], class_name: "ansi-yellow" },
4564
+ { rgb: [0, 0, 187], class_name: "ansi-blue" },
4565
+ { rgb: [187, 0, 187], class_name: "ansi-magenta" },
4566
+ { rgb: [0, 187, 187], class_name: "ansi-cyan" },
4567
+ { rgb: [255, 255, 255], class_name: "ansi-white" }
4568
+ ],
4569
+ [
4570
+ { rgb: [85, 85, 85], class_name: "ansi-bright-black" },
4571
+ { rgb: [255, 85, 85], class_name: "ansi-bright-red" },
4572
+ { rgb: [0, 255, 0], class_name: "ansi-bright-green" },
4573
+ { rgb: [255, 255, 85], class_name: "ansi-bright-yellow" },
4574
+ { rgb: [85, 85, 255], class_name: "ansi-bright-blue" },
4575
+ { rgb: [255, 85, 255], class_name: "ansi-bright-magenta" },
4576
+ { rgb: [85, 255, 255], class_name: "ansi-bright-cyan" },
4577
+ { rgb: [255, 255, 255], class_name: "ansi-bright-white" }
4578
+ ]
4579
+ ], this.palette_256 = [], this.ansi_colors.forEach((n) => {
4580
+ n.forEach((i) => {
4581
+ this.palette_256.push(i);
4582
+ });
4583
+ });
4584
+ let e = [0, 95, 135, 175, 215, 255];
4585
+ for (let n = 0; n < 6; ++n)
4586
+ for (let i = 0; i < 6; ++i)
4587
+ for (let r = 0; r < 6; ++r) {
4588
+ let o = { rgb: [e[n], e[i], e[r]], class_name: "truecolor" };
4589
+ this.palette_256.push(o);
4590
+ }
4591
+ let t = 8;
4592
+ for (let n = 0; n < 24; ++n, t += 10) {
4593
+ let i = { rgb: [t, t, t], class_name: "truecolor" };
4594
+ this.palette_256.push(i);
4595
+ }
4596
+ }
4597
+ escape_txt_for_html(e) {
4598
+ return this._escape_html ? e.replace(/[&<>"']/gm, (t) => {
4599
+ if (t === "&")
4600
+ return "&amp;";
4601
+ if (t === "<")
4602
+ return "&lt;";
4603
+ if (t === ">")
4604
+ return "&gt;";
4605
+ if (t === '"')
4606
+ return "&quot;";
4607
+ if (t === "'")
4608
+ return "&#x27;";
4609
+ }) : e;
4610
+ }
4611
+ append_buffer(e) {
4612
+ var t = this._buffer + e;
4613
+ this._buffer = t;
4614
+ }
4615
+ get_next_packet() {
4616
+ var e = {
4617
+ kind: E.EOS,
4618
+ text: "",
4619
+ url: ""
4620
+ }, t = this._buffer.length;
4621
+ if (t == 0)
4622
+ return e;
4623
+ var n = this._buffer.indexOf("\x1B");
4624
+ if (n == -1)
4625
+ return e.kind = E.Text, e.text = this._buffer, this._buffer = "", e;
4626
+ if (n > 0)
4627
+ return e.kind = E.Text, e.text = this._buffer.slice(0, n), this._buffer = this._buffer.slice(n), e;
4628
+ if (n == 0) {
4629
+ if (t < 3)
4630
+ return e.kind = E.Incomplete, e;
4631
+ var i = this._buffer.charAt(1);
4632
+ if (i != "[" && i != "]" && i != "(")
4633
+ return e.kind = E.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
4634
+ if (i == "[") {
4635
+ this._csi_regex || (this._csi_regex = Mt(Pt || (Pt = Qe([`
4636
+ ^ # beginning of line
4637
+ #
4638
+ # First attempt
4639
+ (?: # legal sequence
4640
+ \x1B[ # CSI
4641
+ ([<-?]?) # private-mode char
4642
+ ([d;]*) # any digits or semicolons
4643
+ ([ -/]? # an intermediate modifier
4644
+ [@-~]) # the command
4645
+ )
4646
+ | # alternate (second attempt)
4647
+ (?: # illegal sequence
4648
+ \x1B[ # CSI
4649
+ [ -~]* # anything legal
4650
+ ([\0-:]) # anything illegal
4651
+ )
4652
+ `], [`
4653
+ ^ # beginning of line
4654
+ #
4655
+ # First attempt
4656
+ (?: # legal sequence
4657
+ \\x1b\\[ # CSI
4658
+ ([\\x3c-\\x3f]?) # private-mode char
4659
+ ([\\d;]*) # any digits or semicolons
4660
+ ([\\x20-\\x2f]? # an intermediate modifier
4661
+ [\\x40-\\x7e]) # the command
4662
+ )
4663
+ | # alternate (second attempt)
4664
+ (?: # illegal sequence
4665
+ \\x1b\\[ # CSI
4666
+ [\\x20-\\x7e]* # anything legal
4667
+ ([\\x00-\\x1f:]) # anything illegal
4668
+ )
4669
+ `]))));
4670
+ let o = this._buffer.match(this._csi_regex);
4671
+ if (o === null)
4672
+ return e.kind = E.Incomplete, e;
4673
+ if (o[4])
4674
+ return e.kind = E.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
4675
+ o[1] != "" || o[3] != "m" ? e.kind = E.Unknown : e.kind = E.SGR, e.text = o[2];
4676
+ var r = o[0].length;
4677
+ return this._buffer = this._buffer.slice(r), e;
4678
+ } else if (i == "]") {
4679
+ if (t < 4)
4680
+ return e.kind = E.Incomplete, e;
4681
+ if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";")
4682
+ return e.kind = E.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
4683
+ this._osc_st || (this._osc_st = ti(Dt || (Dt = Qe([`
4684
+ (?: # legal sequence
4685
+ (\x1B\\) # ESC | # alternate
4686
+ (\x07) # BEL (what xterm did)
4687
+ )
4688
+ | # alternate (second attempt)
4689
+ ( # illegal sequence
4690
+ [\0-] # anything illegal
4691
+ | # alternate
4692
+ [\b-] # anything illegal
4693
+ | # alternate
4694
+ [-] # anything illegal
4695
+ )
4696
+ `], [`
4697
+ (?: # legal sequence
4698
+ (\\x1b\\\\) # ESC \\
4699
+ | # alternate
4700
+ (\\x07) # BEL (what xterm did)
4701
+ )
4702
+ | # alternate (second attempt)
4703
+ ( # illegal sequence
4704
+ [\\x00-\\x06] # anything illegal
4705
+ | # alternate
4706
+ [\\x08-\\x1a] # anything illegal
4707
+ | # alternate
4708
+ [\\x1c-\\x1f] # anything illegal
4709
+ )
4710
+ `])))), this._osc_st.lastIndex = 0;
4711
+ {
4712
+ let a = this._osc_st.exec(this._buffer);
4713
+ if (a === null)
4714
+ return e.kind = E.Incomplete, e;
4715
+ if (a[3])
4716
+ return e.kind = E.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
4717
+ }
4718
+ {
4719
+ let a = this._osc_st.exec(this._buffer);
4720
+ if (a === null)
4721
+ return e.kind = E.Incomplete, e;
4722
+ if (a[3])
4723
+ return e.kind = E.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
4724
+ }
4725
+ this._osc_regex || (this._osc_regex = Mt(xt || (xt = Qe([`
4726
+ ^ # beginning of line
4727
+ #
4728
+ \x1B]8; # OSC Hyperlink
4729
+ [ -:<-~]* # params (excluding ;)
4730
+ ; # end of params
4731
+ ([!-~]{0,512}) # URL capture
4732
+ (?: # ST
4733
+ (?:\x1B\\) # ESC | # alternate
4734
+ (?:\x07) # BEL (what xterm did)
4735
+ )
4736
+ ([ -~]+) # TEXT capture
4737
+ \x1B]8;; # OSC Hyperlink End
4738
+ (?: # ST
4739
+ (?:\x1B\\) # ESC | # alternate
4740
+ (?:\x07) # BEL (what xterm did)
4741
+ )
4742
+ `], [`
4743
+ ^ # beginning of line
4744
+ #
4745
+ \\x1b\\]8; # OSC Hyperlink
4746
+ [\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)
4747
+ ; # end of params
4748
+ ([\\x21-\\x7e]{0,512}) # URL capture
4749
+ (?: # ST
4750
+ (?:\\x1b\\\\) # ESC \\
4751
+ | # alternate
4752
+ (?:\\x07) # BEL (what xterm did)
4753
+ )
4754
+ ([\\x20-\\x7e]+) # TEXT capture
4755
+ \\x1b\\]8;; # OSC Hyperlink End
4756
+ (?: # ST
4757
+ (?:\\x1b\\\\) # ESC \\
4758
+ | # alternate
4759
+ (?:\\x07) # BEL (what xterm did)
4760
+ )
4761
+ `]))));
4762
+ let o = this._buffer.match(this._osc_regex);
4763
+ if (o === null)
4764
+ return e.kind = E.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
4765
+ e.kind = E.OSCURL, e.url = o[1], e.text = o[2];
4766
+ var r = o[0].length;
4767
+ return this._buffer = this._buffer.slice(r), e;
4768
+ } else if (i == "(")
4769
+ return e.kind = E.Unknown, this._buffer = this._buffer.slice(3), e;
4770
+ }
4771
+ }
4772
+ ansi_to_html(e) {
4773
+ this.append_buffer(e);
4774
+ for (var t = []; ; ) {
4775
+ var n = this.get_next_packet();
4776
+ if (n.kind == E.EOS || n.kind == E.Incomplete)
4777
+ break;
4778
+ n.kind == E.ESC || n.kind == E.Unknown || (n.kind == E.Text ? t.push(this.transform_to_html(this.with_state(n))) : n.kind == E.SGR ? this.process_ansi(n) : n.kind == E.OSCURL && t.push(this.process_hyperlink(n)));
4779
+ }
4780
+ return t.join("");
4781
+ }
4782
+ with_state(e) {
4783
+ return { bold: this.bold, faint: this.faint, italic: this.italic, underline: this.underline, fg: this.fg, bg: this.bg, text: e.text };
4784
+ }
4785
+ process_ansi(e) {
4786
+ let t = e.text.split(";");
4787
+ for (; t.length > 0; ) {
4788
+ let n = t.shift(), i = parseInt(n, 10);
4789
+ if (isNaN(i) || i === 0)
4790
+ this.fg = null, this.bg = null, this.bold = !1, this.faint = !1, this.italic = !1, this.underline = !1;
4791
+ else if (i === 1)
4792
+ this.bold = !0;
4793
+ else if (i === 2)
4794
+ this.faint = !0;
4795
+ else if (i === 3)
4796
+ this.italic = !0;
4797
+ else if (i === 4)
4798
+ this.underline = !0;
4799
+ else if (i === 21)
4800
+ this.bold = !1;
4801
+ else if (i === 22)
4802
+ this.faint = !1, this.bold = !1;
4803
+ else if (i === 23)
4804
+ this.italic = !1;
4805
+ else if (i === 24)
4806
+ this.underline = !1;
4807
+ else if (i === 39)
4808
+ this.fg = null;
4809
+ else if (i === 49)
4810
+ this.bg = null;
4811
+ else if (i >= 30 && i < 38)
4812
+ this.fg = this.ansi_colors[0][i - 30];
4813
+ else if (i >= 40 && i < 48)
4814
+ this.bg = this.ansi_colors[0][i - 40];
4815
+ else if (i >= 90 && i < 98)
4816
+ this.fg = this.ansi_colors[1][i - 90];
4817
+ else if (i >= 100 && i < 108)
4818
+ this.bg = this.ansi_colors[1][i - 100];
4819
+ else if ((i === 38 || i === 48) && t.length > 0) {
4820
+ let r = i === 38, o = t.shift();
4821
+ if (o === "5" && t.length > 0) {
4822
+ let l = parseInt(t.shift(), 10);
4823
+ l >= 0 && l <= 255 && (r ? this.fg = this.palette_256[l] : this.bg = this.palette_256[l]);
4824
+ }
4825
+ if (o === "2" && t.length > 2) {
4826
+ let l = parseInt(t.shift(), 10), a = parseInt(t.shift(), 10), c = parseInt(t.shift(), 10);
4827
+ if (l >= 0 && l <= 255 && a >= 0 && a <= 255 && c >= 0 && c <= 255) {
4828
+ let d = { rgb: [l, a, c], class_name: "truecolor" };
4829
+ r ? this.fg = d : this.bg = d;
4830
+ }
4831
+ }
4832
+ }
4833
+ }
4834
+ }
4835
+ transform_to_html(e) {
4836
+ let t = e.text;
4837
+ if (t.length === 0 || (t = this.escape_txt_for_html(t), !e.bold && !e.italic && !e.faint && !e.underline && e.fg === null && e.bg === null))
4838
+ return t;
4839
+ let n = [], i = [], r = e.fg, o = e.bg;
4840
+ e.bold && n.push(this._boldStyle), e.faint && n.push(this._faintStyle), e.italic && n.push(this._italicStyle), e.underline && n.push(this._underlineStyle), this._use_classes ? (r && (r.class_name !== "truecolor" ? i.push(`${r.class_name}-fg`) : n.push(`color:rgb(${r.rgb.join(",")})`)), o && (o.class_name !== "truecolor" ? i.push(`${o.class_name}-bg`) : n.push(`background-color:rgb(${o.rgb.join(",")})`))) : (r && n.push(`color:rgb(${r.rgb.join(",")})`), o && n.push(`background-color:rgb(${o.rgb})`));
4841
+ let l = "", a = "";
4842
+ return i.length && (l = ` class="${i.join(" ")}"`), n.length && (a = ` style="${n.join(";")}"`), `<span${a}${l}>${t}</span>`;
4843
+ }
4844
+ process_hyperlink(e) {
4845
+ let t = e.url.split(":");
4846
+ return t.length < 1 || !this._url_allowlist[t[0]] ? "" : `<a href="${this.escape_txt_for_html(e.url)}">${this.escape_txt_for_html(e.text)}</a>`;
4847
+ }
4848
+ }
4849
+ function Mt(s, ...e) {
4850
+ let t = s.raw[0], n = /^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, i = t.replace(n, "");
4851
+ return new RegExp(i);
4852
+ }
4853
+ function ti(s, ...e) {
4854
+ let t = s.raw[0], n = /^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, i = t.replace(n, "");
4855
+ return new RegExp(i, "g");
4856
+ }
4857
+ var Pt, Dt, xt;
4858
+ const Kt = new ei(), kt = it(Ft(), "workflow-reports");
4859
+ js(kt, { recursive: !0 });
4860
+ async function si(s, e) {
4507
4861
  try {
4508
- const t = st(ws, `${s.id}.json`);
4509
- await Os(
4862
+ const t = it(kt, `${s.id}.json`);
4863
+ await $s(
4510
4864
  t,
4511
4865
  JSON.stringify({ ...s, outputs: e }, null, 2),
4512
4866
  "utf8"
@@ -4516,36 +4870,86 @@ async function Yn(s, e) {
4516
4870
  console.error("Error writing report:", n);
4517
4871
  }
4518
4872
  }
4519
- async function Gn(s) {
4873
+ async function ni(s) {
4520
4874
  try {
4521
- return await import(st(ws, `${s}.json`));
4875
+ return await import(it(kt, `${s}.json`), { assert: { type: "json" } });
4522
4876
  } catch (e) {
4523
4877
  const t = e instanceof Error ? e.message : String(e);
4524
4878
  return console.error("Error reading report:", t), null;
4525
4879
  }
4526
4880
  }
4527
- const Wn = "/workspace", Hn = "dhi.io/alpine-base:3.23-alpine3.23-dev";
4528
- function Qn(s, e) {
4881
+ const ii = `<!DOCTYPE html>
4882
+ <html lang="en">
4883
+ <head>
4884
+ <meta charset="UTF-8">
4885
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
4886
+ <title>Workflow Report</title>
4887
+ <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
4888
+ </head>
4889
+ <body class="bg-gray-100 p-4">
4890
+ <div class="max-w-4xl mx-auto bg-white shadow-md rounded-lg p-6">
4891
+ <h1 class="text-2xl font-bold mb-4">Workflow Report</h1>
4892
+ <p class="text-red-500">Report not found.</p>
4893
+ </div>
4894
+ </body>
4895
+ </html>`;
4896
+ async function Rt(s) {
4897
+ return s ? `<!DOCTYPE html>
4898
+ <html lang="en">
4899
+ <head>
4900
+ <meta charset="UTF-8">
4901
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
4902
+ <title>Workflow Report - ${s.id}</title>
4903
+ <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
4904
+ </head>
4905
+ <body class="bg-gray-100 p-4">
4906
+ <div class="max-w-4xl mx-auto bg-white shadow-md rounded-lg p-6">
4907
+ <h1 class="text-2xl font-bold mb-4">Workflow Report - ${s.id}</h1>
4908
+ ${s.outputs.map(
4909
+ (t, n) => `
4910
+ <div class="mb-6">
4911
+ <h2 class="text-xl font-semibold mb-2">Step ${n + 1}: ${t.cmd} (${t.code})</h2>
4912
+ <div class="bg-gray-800 text-green-400 p-4 rounded mb-2 overflow-x-auto">
4913
+ <pre>${Kt.ansi_to_html(t.stdout)}</pre>
4914
+ </div>
4915
+ <div class="bg-gray-800 text-red-400 p-4 rounded overflow-x-auto">
4916
+ <pre>${Kt.ansi_to_html(t.stderr)}</pre>
4917
+ </div>
4918
+ </div>
4919
+ `
4920
+ ).join("")}
4921
+ <div class="mt-4">
4922
+ ${s.parentId ? `<a href="/reports/${s.parentId}" class="text-blue-500 hover:underline">View Parent Report</a>` : ""}
4923
+ ${s.children && s.children.length > 0 ? `<div class="mt-2">Child Reports:<ul>${s.children.map(
4924
+ (t) => `<li><a href="/reports/${t}" class="text-blue-500 hover:underline">${t}</a></li>`
4925
+ ).join("")}</ul></div>` : ""}
4926
+
4927
+ </div>
4928
+ </body>
4929
+ </html>` : ii;
4930
+ }
4931
+ const ri = "/workspace", oi = "dhi.io/alpine-base:3.23-alpine3.23-dev";
4932
+ function li(s, e) {
4529
4933
  if (typeof s.run != "string")
4530
4934
  throw new Error("Each workflow step must have a 'run' command string.");
4531
4935
  const t = e.workflow.defaults || {};
4532
- return s.image ||= t.image || Hn, s.volumes ||= t.volumes || {}, s.args ||= t.args || [], s.run = _e(s.run, { ...e, step: s }), s;
4936
+ return s.image ||= t.image || oi, s.volumes ||= t.volumes || {}, s.args ||= t.args || [], s.run = je(s.run, { ...e, step: s }), s;
4533
4937
  }
4534
- function Xn(s, e) {
4938
+ function ai(s, e) {
4535
4939
  return (s || []).flatMap(
4536
4940
  (t) => Object.entries(t).flatMap(([n, i]) => [
4537
4941
  `--${n}`,
4538
- _e(String(i), e)
4942
+ je(String(i), e)
4539
4943
  ])
4540
4944
  );
4541
4945
  }
4542
- function xn(s, e) {
4543
- return s["."] ||= Wn, Object.entries(s).flatMap(([t, n]) => [
4946
+ function ci(s, e) {
4947
+ return s["."] ||= ri, Object.entries(s).flatMap(([t, n]) => [
4544
4948
  "-v",
4545
4949
  `${t === "." ? e.workingDir : t}:${n}`
4546
4950
  ]);
4547
4951
  }
4548
- function zn(s) {
4952
+ function fi(s) {
4549
4953
  const { workflow: e, secrets: t } = s, n = {
4550
4954
  ...process.env,
4551
4955
  ...Object.fromEntries(
@@ -4557,12 +4961,12 @@ function zn(s) {
4557
4961
  if (typeof e.env != "object")
4558
4962
  throw new Error("Workflow env field must be an object.");
4559
4963
  for (const [i, r] of Object.entries(e.env))
4560
- n[i] = _e(r, s);
4964
+ n[i] = je(r, s);
4561
4965
  }
4562
4966
  Object.assign(s.env, n);
4563
4967
  }
4564
- function Zn(s, e) {
4565
- const t = Object.keys(s), n = Object.keys(e.on), i = n.find((a) => s[a]), r = i ? e.on[i] : null;
4968
+ function ui(s, e) {
4969
+ const t = Object.keys(s), n = Object.keys(e.on), i = n.find((l) => s[l]), r = i ? e.on[i] : null;
4566
4970
  if (!r)
4567
4971
  return console.log(
4568
4972
  `No workflow defined for event keys: ${t.join(", ")}, only accepting ${n.join(", ")}.`
@@ -4577,22 +4981,22 @@ function Zn(s, e) {
4577
4981
  event: o
4578
4982
  };
4579
4983
  }
4580
- async function ei(s, e) {
4984
+ async function hi(s, e) {
4581
4985
  typeof s == "string" && (s = { run: s });
4582
- const t = Qn(s, e), { args: n, image: i, volumes: r } = t, o = xn(r, e), a = Xn(n, e), l = r["."], c = [
4986
+ const t = li(s, e), { args: n, image: i, volumes: r } = t, o = ci(r, e), l = ai(n, e), a = r["."], c = [
4583
4987
  "run",
4584
4988
  "-i",
4585
4989
  "--rm",
4586
4990
  ...o,
4587
- ...a,
4991
+ ...l,
4588
4992
  "-w",
4589
- l,
4993
+ a,
4590
4994
  "--entrypoint",
4591
4995
  "sh",
4592
4996
  i
4593
4997
  ];
4594
4998
  return new Promise((d, u) => {
4595
- const f = jt("docker", c, {
4999
+ const f = Ut("docker", c, {
4596
5000
  env: e.env
4597
5001
  }), p = [], g = [];
4598
5002
  f.stdout?.on("data", (h) => {
@@ -4612,23 +5016,23 @@ exit $?;
4612
5016
  `), f.stdin?.end();
4613
5017
  });
4614
5018
  }
4615
- async function ks(s, e, t) {
4616
- const n = Is(), i = Zn(s, e);
5019
+ async function Is(s, e, t) {
5020
+ const n = Ps(), i = ui(s, e);
4617
5021
  if (!i)
4618
5022
  return { id: n, parentId: t, outputs: [] };
4619
- const { workflow: r, event: o } = i, a = Ls(o, r.mappings), l = await Jn(r.secrets), c = await _t(Ts(Bt(), "workflow")), d = Mt({
4620
- inputs: a,
4621
- secrets: l,
5023
+ const { workflow: r, event: o } = i, l = xs(o, r.mappings), a = await Zn(r.secrets), c = await Ls(Ms(Ft(), "workflow")), d = qt({
5024
+ inputs: l,
5025
+ secrets: a,
4622
5026
  workflow: r,
4623
5027
  env: {},
4624
5028
  outputs: [],
4625
5029
  workingDir: c
4626
5030
  });
4627
- zn(d);
5031
+ fi(d);
4628
5032
  const u = [];
4629
5033
  try {
4630
5034
  for (const f of r.steps ?? []) {
4631
- const p = await ei(f, d);
5035
+ const p = await hi(f, d);
4632
5036
  if (p.code !== 0)
4633
5037
  throw new Error(
4634
5038
  `Step failed with code ${p.code}.
@@ -4638,68 +5042,64 @@ stderr: ${p.stderr}`
4638
5042
  d.outputs.push(p);
4639
5043
  }
4640
5044
  for (const f of r.triggers ?? []) {
4641
- const p = await ti(f, e, t);
5045
+ const p = await di(f, e, t);
4642
5046
  p && u.push(p.id);
4643
5047
  }
4644
5048
  } catch (f) {
4645
5049
  const p = f instanceof Error ? f.message : String(f);
4646
5050
  console.error(`Error processing event: ${p}`), console.debug(JSON.stringify(o));
4647
5051
  } finally {
4648
- await As(d.workingDir, { recursive: !0, force: !0 });
5052
+ await Cs(d.workingDir, { recursive: !0, force: !0 });
4649
5053
  }
4650
- return await Yn({ id: n, parentId: t, children: u }, d.outputs), { id: n, parentId: t, children: u, outputs: d.outputs };
5054
+ return await si({ id: n, parentId: t, children: u }, d.outputs), { id: n, parentId: t, children: u, outputs: d.outputs };
4651
5055
  }
4652
- async function ti(s, e, t) {
4653
- if (!Es(s)) {
5056
+ async function di(s, e, t) {
5057
+ if (!Bs(s)) {
4654
5058
  console.warn(`Trigger file does not exist: ${s}`);
4655
5059
  return;
4656
5060
  }
4657
- const n = await tt(s, "utf8"), i = nt(JSON.parse(n));
4658
- return await ks(i, e, t);
5061
+ const n = await nt(s, "utf8"), i = rt(JSON.parse(n));
5062
+ return await Is(i, e, t);
4659
5063
  }
4660
- async function si(s) {
5064
+ async function pi(s) {
4661
5065
  if (s.daemon) {
4662
- const i = process.argv.slice(1).filter((a) => a !== "--daemon" && a !== "-d"), r = process.execArgv.concat(i), o = jt(process.execPath, r, {
5066
+ const i = process.argv.slice(1).filter((l) => l !== "--daemon" && l !== "-d"), r = process.execArgv.concat(i), o = Ut(process.execPath, r, {
4663
5067
  detached: !0,
4664
5068
  stdio: "ignore"
4665
5069
  });
4666
5070
  return console.log(o.pid), o.unref(), null;
4667
5071
  }
4668
- const e = await qn(s.configPath), t = Ns(async (i, r) => {
5072
+ const e = await Xn(s.configPath), t = vs(async (i, r) => {
4669
5073
  if (i.method === "GET" && i.url === "/health") {
4670
- x(r, 200, { status: "OK" });
5074
+ _e(r, 200, { status: "OK" });
4671
5075
  return;
4672
5076
  }
4673
5077
  if (i.method === "GET" && i.url?.startsWith("/logs/")) {
4674
- const o = i.url.split("/logs/")[1], a = await Gn(o);
4675
- a ? x(r, 200, {
4676
- exitCode: a.outputs.slice(-1)[0]?.code ?? null,
4677
- stdout: a.outputs.map((l) => l.stdout),
4678
- stderr: a.outputs.map((l) => l.stderr)
4679
- }) : x(r, 404, { error: "Report not found." });
5078
+ const o = i.url.split("/logs/")[1], l = await ni(o), a = await Rt(l);
5079
+ l ? (r.writeHead(200, { "Content-Type": "text/html" }), r.end(a)) : (r.writeHead(404, { "Content-Type": "text/html" }), r.end(Rt(null)));
4680
5080
  return;
4681
5081
  }
4682
5082
  if (i.method !== "POST") {
4683
- x(r, 405, { error: "Only POST webhooks are supported." });
5083
+ _e(r, 405, { error: "Only POST webhooks are supported." });
4684
5084
  return;
4685
5085
  }
4686
5086
  try {
4687
- const o = Buffer.concat(await i.toArray()).toString(), a = nt(JSON.parse(o || "{}")), l = await ks(a, e), c = (d) => new URL("/logs/" + d, `http://${i.headers.host}`);
4688
- x(r, 202, {
4689
- id: l.id,
4690
- logUrl: c(l.id).href,
4691
- parent: l.parentId ? {
4692
- id: l.parentId,
4693
- logUrl: l.parentId ? c(l.parentId).href : void 0
5087
+ const o = Buffer.concat(await i.toArray()).toString(), l = rt(JSON.parse(o || "{}")), a = await Is(l, e), c = (d) => new URL("/logs/" + d, `http://${i.headers.host}`);
5088
+ _e(r, 202, {
5089
+ id: a.id,
5090
+ logUrl: c(a.id).href,
5091
+ parent: a.parentId ? {
5092
+ id: a.parentId,
5093
+ logUrl: a.parentId ? c(a.parentId).href : void 0
4694
5094
  } : null,
4695
- children: l.children?.map((d) => ({
5095
+ children: a.children?.map((d) => ({
4696
5096
  id: d,
4697
5097
  logUrl: c(d).href
4698
5098
  })) || []
4699
5099
  });
4700
5100
  } catch (o) {
4701
- const a = o instanceof Error ? o.message : "Unknown error";
4702
- console.error("Error processing webhook:", o), x(r, 400, { error: a });
5101
+ const l = o instanceof Error ? o.message : "Unknown error";
5102
+ console.error("Error processing webhook:", o), _e(r, 400, { error: l });
4703
5103
  }
4704
5104
  });
4705
5105
  await new Promise((i, r) => {
@@ -4708,7 +5108,7 @@ async function si(s) {
4708
5108
  const n = t.address();
4709
5109
  return n && typeof n == "object" && console.log(`Started on http://${n.address}:${n.port}`), t;
4710
5110
  }
4711
- const ni = `on - daemonized webhook runner
5111
+ const mi = `on - daemonized webhook runner
4712
5112
 
4713
5113
  Usage:
4714
5114
  on --port <port> [--host <host>] [--config <path>]
@@ -4720,8 +5120,8 @@ Options:
4720
5120
  --config, -c Path to a YAML/JSON config file
4721
5121
  --help, -h Show this help message
4722
5122
  `;
4723
- function ii(s) {
4724
- const { values: e } = Ss({
5123
+ function gi(s) {
5124
+ const { values: e } = As({
4725
5125
  args: s,
4726
5126
  options: {
4727
5127
  port: { type: "string", short: "p" },
@@ -4733,31 +5133,31 @@ function ii(s) {
4733
5133
  allowPositionals: !1
4734
5134
  });
4735
5135
  if (e.help)
4736
- return console.log(ni), null;
5136
+ return console.log(mi), null;
4737
5137
  if (!e.port)
4738
5138
  throw new Error("Missing required option --port.");
4739
5139
  return {
4740
- port: $s(e.port),
5140
+ port: Ds(e.port),
4741
5141
  host: e.host,
4742
5142
  configPath: e.config,
4743
5143
  daemon: e.daemon
4744
5144
  };
4745
5145
  }
4746
- async function ri() {
5146
+ async function yi() {
4747
5147
  try {
4748
- const s = ii(process.argv.slice(2));
5148
+ const s = gi(process.argv.slice(2));
4749
5149
  if (!s) {
4750
5150
  process.exitCode = 0;
4751
5151
  return;
4752
5152
  }
4753
- await si(s);
5153
+ await pi(s);
4754
5154
  } catch (s) {
4755
5155
  const e = s instanceof Error ? s.message : String(s);
4756
5156
  console.error(`on: ${e}`), process.exitCode = 1;
4757
5157
  }
4758
5158
  }
4759
- ri();
5159
+ yi();
4760
5160
  export {
4761
- ri as main,
4762
- ii as parseCliOptions
5161
+ yi as main,
5162
+ gi as parseCliOptions
4763
5163
  };