@rexeus/typeweaver 0.0.1

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.
@@ -0,0 +1,4156 @@
1
+ var Ti = Object.create;
2
+ var tn = Object.defineProperty;
3
+ var Ci = Object.getOwnPropertyDescriptor;
4
+ var Mi = Object.getOwnPropertyNames;
5
+ var ki = Object.getPrototypeOf, vi = Object.prototype.hasOwnProperty;
6
+ var te = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports), rr = (t, e) => {
7
+ for (var n in e) tn(t, n, { get: e[n], enumerable: true });
8
+ }, Ii = (t, e, n, r) => {
9
+ if (e && typeof e == "object" || typeof e == "function") for (let s of Mi(e)) !vi.call(t, s) && s !== n && tn(t, s, { get: () => e[s], enumerable: !(r = Ci(e, s)) || r.enumerable });
10
+ return t;
11
+ };
12
+ var sr = (t, e, n) => (n = t != null ? Ti(ki(t)) : {}, Ii(tn(n, "default", { value: t, enumerable: true }) , t));
13
+ var le = te((U) => {
14
+ var re = { ANCHOR: "&", COMMENT: "#", TAG: "!", DIRECTIVES_END: "-", DOCUMENT_END: "." }, lt = { ALIAS: "ALIAS", BLANK_LINE: "BLANK_LINE", BLOCK_FOLDED: "BLOCK_FOLDED", BLOCK_LITERAL: "BLOCK_LITERAL", COMMENT: "COMMENT", DIRECTIVE: "DIRECTIVE", DOCUMENT: "DOCUMENT", FLOW_MAP: "FLOW_MAP", FLOW_SEQ: "FLOW_SEQ", MAP: "MAP", MAP_KEY: "MAP_KEY", MAP_VALUE: "MAP_VALUE", PLAIN: "PLAIN", QUOTE_DOUBLE: "QUOTE_DOUBLE", QUOTE_SINGLE: "QUOTE_SINGLE", SEQ: "SEQ", SEQ_ITEM: "SEQ_ITEM" }, Ao = "tag:yaml.org,2002:", To = { MAP: "tag:yaml.org,2002:map", SEQ: "tag:yaml.org,2002:seq", STR: "tag:yaml.org,2002:str" };
15
+ function Ps(t) {
16
+ let e = [0], n = t.indexOf(`
17
+ `);
18
+ for (; n !== -1; ) n += 1, e.push(n), n = t.indexOf(`
19
+ `, n);
20
+ return e;
21
+ }
22
+ function _s(t) {
23
+ let e, n;
24
+ return typeof t == "string" ? (e = Ps(t), n = t) : (Array.isArray(t) && (t = t[0]), t && t.context && (t.lineStarts || (t.lineStarts = Ps(t.context.src)), e = t.lineStarts, n = t.context.src)), { lineStarts: e, src: n };
25
+ }
26
+ function Tn(t, e) {
27
+ if (typeof t != "number" || t < 0) return null;
28
+ let { lineStarts: n, src: r } = _s(e);
29
+ if (!n || !r || t > r.length) return null;
30
+ for (let i = 0; i < n.length; ++i) {
31
+ let o = n[i];
32
+ if (t < o) return { line: i, col: t - n[i - 1] + 1 };
33
+ if (t === o) return { line: i + 1, col: 1 };
34
+ }
35
+ let s = n.length;
36
+ return { line: s, col: t - n[s - 1] + 1 };
37
+ }
38
+ function Co(t, e) {
39
+ let { lineStarts: n, src: r } = _s(e);
40
+ if (!n || !(t >= 1) || t > n.length) return null;
41
+ let s = n[t - 1], i = n[t];
42
+ for (; i && i > s && r[i - 1] === `
43
+ `; ) --i;
44
+ return r.slice(s, i);
45
+ }
46
+ function Mo({ start: t, end: e }, n, r = 80) {
47
+ let s = Co(t.line, n);
48
+ if (!s) return null;
49
+ let { col: i } = t;
50
+ if (s.length > r) if (i <= r - 10) s = s.substr(0, r - 1) + "\u2026";
51
+ else {
52
+ let f = Math.round(r / 2);
53
+ s.length > i + f && (s = s.substr(0, i + f - 1) + "\u2026"), i -= s.length - r, s = "\u2026" + s.substr(1 - r);
54
+ }
55
+ let o = 1, a = "";
56
+ e && (e.line === t.line && i + (e.col - t.col) <= r + 1 ? o = e.col - t.col : (o = Math.min(s.length + 1, r) - i, a = "\u2026"));
57
+ let c = i > 1 ? " ".repeat(i - 1) : "", l = "^".repeat(o);
58
+ return `${s}
59
+ ${c}${l}${a}`;
60
+ }
61
+ var Be = class t {
62
+ static copy(e) {
63
+ return new t(e.start, e.end);
64
+ }
65
+ constructor(e, n) {
66
+ this.start = e, this.end = n || e;
67
+ }
68
+ isEmpty() {
69
+ return typeof this.start != "number" || !this.end || this.end <= this.start;
70
+ }
71
+ setOrigRange(e, n) {
72
+ let { start: r, end: s } = this;
73
+ if (e.length === 0 || s <= e[0]) return this.origStart = r, this.origEnd = s, n;
74
+ let i = n;
75
+ for (; i < e.length && !(e[i] > r); ) ++i;
76
+ this.origStart = r + i;
77
+ let o = i;
78
+ for (; i < e.length && !(e[i] >= s); ) ++i;
79
+ return this.origEnd = s + i, o;
80
+ }
81
+ }, se = class t {
82
+ static addStringTerminator(e, n, r) {
83
+ if (r[r.length - 1] === `
84
+ `) return r;
85
+ let s = t.endOfWhiteSpace(e, n);
86
+ return s >= e.length || e[s] === `
87
+ ` ? r + `
88
+ ` : r;
89
+ }
90
+ static atDocumentBoundary(e, n, r) {
91
+ let s = e[n];
92
+ if (!s) return true;
93
+ let i = e[n - 1];
94
+ if (i && i !== `
95
+ `) return false;
96
+ if (r) {
97
+ if (s !== r) return false;
98
+ } else if (s !== re.DIRECTIVES_END && s !== re.DOCUMENT_END) return false;
99
+ let o = e[n + 1], a = e[n + 2];
100
+ if (o !== s || a !== s) return false;
101
+ let c = e[n + 3];
102
+ return !c || c === `
103
+ ` || c === " " || c === " ";
104
+ }
105
+ static endOfIdentifier(e, n) {
106
+ let r = e[n], s = r === "<", i = s ? [`
107
+ `, " ", " ", ">"] : [`
108
+ `, " ", " ", "[", "]", "{", "}", ","];
109
+ for (; r && i.indexOf(r) === -1; ) r = e[n += 1];
110
+ return s && r === ">" && (n += 1), n;
111
+ }
112
+ static endOfIndent(e, n) {
113
+ let r = e[n];
114
+ for (; r === " "; ) r = e[n += 1];
115
+ return n;
116
+ }
117
+ static endOfLine(e, n) {
118
+ let r = e[n];
119
+ for (; r && r !== `
120
+ `; ) r = e[n += 1];
121
+ return n;
122
+ }
123
+ static endOfWhiteSpace(e, n) {
124
+ let r = e[n];
125
+ for (; r === " " || r === " "; ) r = e[n += 1];
126
+ return n;
127
+ }
128
+ static startOfLine(e, n) {
129
+ let r = e[n - 1];
130
+ if (r === `
131
+ `) return n;
132
+ for (; r && r !== `
133
+ `; ) r = e[n -= 1];
134
+ return n + 1;
135
+ }
136
+ static endOfBlockIndent(e, n, r) {
137
+ let s = t.endOfIndent(e, r);
138
+ if (s > r + n) return s;
139
+ {
140
+ let i = t.endOfWhiteSpace(e, s), o = e[i];
141
+ if (!o || o === `
142
+ `) return i;
143
+ }
144
+ return null;
145
+ }
146
+ static atBlank(e, n, r) {
147
+ let s = e[n];
148
+ return s === `
149
+ ` || s === " " || s === " " || r && !s;
150
+ }
151
+ static nextNodeIsIndented(e, n, r) {
152
+ return !e || n < 0 ? false : n > 0 ? true : r && e === "-";
153
+ }
154
+ static normalizeOffset(e, n) {
155
+ let r = e[n];
156
+ return r ? r !== `
157
+ ` && e[n - 1] === `
158
+ ` ? n - 1 : t.endOfWhiteSpace(e, n) : n;
159
+ }
160
+ static foldNewline(e, n, r) {
161
+ let s = 0, i = false, o = "", a = e[n + 1];
162
+ for (; a === " " || a === " " || a === `
163
+ `; ) {
164
+ switch (a) {
165
+ case `
166
+ `:
167
+ s = 0, n += 1, o += `
168
+ `;
169
+ break;
170
+ case " ":
171
+ s <= r && (i = true), n = t.endOfWhiteSpace(e, n + 2) - 1;
172
+ break;
173
+ case " ":
174
+ s += 1, n += 1;
175
+ break;
176
+ }
177
+ a = e[n + 1];
178
+ }
179
+ return o || (o = " "), a && s <= r && (i = true), { fold: o, offset: n, error: i };
180
+ }
181
+ constructor(e, n, r) {
182
+ Object.defineProperty(this, "context", { value: r || null, writable: true }), this.error = null, this.range = null, this.valueRange = null, this.props = n || [], this.type = e, this.value = null;
183
+ }
184
+ getPropValue(e, n, r) {
185
+ if (!this.context) return null;
186
+ let { src: s } = this.context, i = this.props[e];
187
+ return i && s[i.start] === n ? s.slice(i.start + (r ? 1 : 0), i.end) : null;
188
+ }
189
+ get anchor() {
190
+ for (let e = 0; e < this.props.length; ++e) {
191
+ let n = this.getPropValue(e, re.ANCHOR, true);
192
+ if (n != null) return n;
193
+ }
194
+ return null;
195
+ }
196
+ get comment() {
197
+ let e = [];
198
+ for (let n = 0; n < this.props.length; ++n) {
199
+ let r = this.getPropValue(n, re.COMMENT, true);
200
+ r != null && e.push(r);
201
+ }
202
+ return e.length > 0 ? e.join(`
203
+ `) : null;
204
+ }
205
+ commentHasRequiredWhitespace(e) {
206
+ let { src: n } = this.context;
207
+ if (this.header && e === this.header.end || !this.valueRange) return false;
208
+ let { end: r } = this.valueRange;
209
+ return e !== r || t.atBlank(n, r - 1);
210
+ }
211
+ get hasComment() {
212
+ if (this.context) {
213
+ let { src: e } = this.context;
214
+ for (let n = 0; n < this.props.length; ++n) if (e[this.props[n].start] === re.COMMENT) return true;
215
+ }
216
+ return false;
217
+ }
218
+ get hasProps() {
219
+ if (this.context) {
220
+ let { src: e } = this.context;
221
+ for (let n = 0; n < this.props.length; ++n) if (e[this.props[n].start] !== re.COMMENT) return true;
222
+ }
223
+ return false;
224
+ }
225
+ get includesTrailingLines() {
226
+ return false;
227
+ }
228
+ get jsonLike() {
229
+ return [lt.FLOW_MAP, lt.FLOW_SEQ, lt.QUOTE_DOUBLE, lt.QUOTE_SINGLE].indexOf(this.type) !== -1;
230
+ }
231
+ get rangeAsLinePos() {
232
+ if (!this.range || !this.context) return;
233
+ let e = Tn(this.range.start, this.context.root);
234
+ if (!e) return;
235
+ let n = Tn(this.range.end, this.context.root);
236
+ return { start: e, end: n };
237
+ }
238
+ get rawValue() {
239
+ if (!this.valueRange || !this.context) return null;
240
+ let { start: e, end: n } = this.valueRange;
241
+ return this.context.src.slice(e, n);
242
+ }
243
+ get tag() {
244
+ for (let e = 0; e < this.props.length; ++e) {
245
+ let n = this.getPropValue(e, re.TAG, false);
246
+ if (n != null) {
247
+ if (n[1] === "<") return { verbatim: n.slice(2, -1) };
248
+ {
249
+ let [r, s, i] = n.match(/^(.*!)([^!]*)$/);
250
+ return { handle: s, suffix: i };
251
+ }
252
+ }
253
+ }
254
+ return null;
255
+ }
256
+ get valueRangeContainsNewline() {
257
+ if (!this.valueRange || !this.context) return false;
258
+ let { start: e, end: n } = this.valueRange, { src: r } = this.context;
259
+ for (let s = e; s < n; ++s) if (r[s] === `
260
+ `) return true;
261
+ return false;
262
+ }
263
+ parseComment(e) {
264
+ let { src: n } = this.context;
265
+ if (n[e] === re.COMMENT) {
266
+ let r = t.endOfLine(n, e + 1), s = new Be(e, r);
267
+ return this.props.push(s), r;
268
+ }
269
+ return e;
270
+ }
271
+ setOrigRanges(e, n) {
272
+ return this.range && (n = this.range.setOrigRange(e, n)), this.valueRange && this.valueRange.setOrigRange(e, n), this.props.forEach((r) => r.setOrigRange(e, n)), n;
273
+ }
274
+ toString() {
275
+ let { context: { src: e }, range: n, value: r } = this;
276
+ if (r != null) return r;
277
+ let s = e.slice(n.start, n.end);
278
+ return t.addStringTerminator(e, n.end, s);
279
+ }
280
+ }, ye = class extends Error {
281
+ constructor(e, n, r) {
282
+ if (!r || !(n instanceof se)) throw new Error(`Invalid arguments for new ${e}`);
283
+ super(), this.name = e, this.message = r, this.source = n;
284
+ }
285
+ makePretty() {
286
+ if (!this.source) return;
287
+ this.nodeType = this.source.type;
288
+ let e = this.source.context && this.source.context.root;
289
+ if (typeof this.offset == "number") {
290
+ this.range = new Be(this.offset, this.offset + 1);
291
+ let n = e && Tn(this.offset, e);
292
+ if (n) {
293
+ let r = { line: n.line, col: n.col + 1 };
294
+ this.linePos = { start: n, end: r };
295
+ }
296
+ delete this.offset;
297
+ } else this.range = this.source.range, this.linePos = this.source.rangeAsLinePos;
298
+ if (this.linePos) {
299
+ let { line: n, col: r } = this.linePos.start;
300
+ this.message += ` at line ${n}, column ${r}`;
301
+ let s = e && Mo(this.linePos, e);
302
+ s && (this.message += `:
303
+
304
+ ${s}
305
+ `);
306
+ }
307
+ delete this.source;
308
+ }
309
+ }, Cn = class extends ye {
310
+ constructor(e, n) {
311
+ super("YAMLReferenceError", e, n);
312
+ }
313
+ }, ft = class extends ye {
314
+ constructor(e, n) {
315
+ super("YAMLSemanticError", e, n);
316
+ }
317
+ }, Mn = class extends ye {
318
+ constructor(e, n) {
319
+ super("YAMLSyntaxError", e, n);
320
+ }
321
+ }, kn = class extends ye {
322
+ constructor(e, n) {
323
+ super("YAMLWarning", e, n);
324
+ }
325
+ };
326
+ function ko(t, e, n) {
327
+ return e in t ? Object.defineProperty(t, e, { value: n, enumerable: true, configurable: true, writable: true }) : t[e] = n, t;
328
+ }
329
+ var vn = class t extends se {
330
+ static endOfLine(e, n, r) {
331
+ let s = e[n], i = n;
332
+ for (; s && s !== `
333
+ ` && !(r && (s === "[" || s === "]" || s === "{" || s === "}" || s === ",")); ) {
334
+ let o = e[i + 1];
335
+ if (s === ":" && (!o || o === `
336
+ ` || o === " " || o === " " || r && o === ",") || (s === " " || s === " ") && o === "#") break;
337
+ i += 1, s = o;
338
+ }
339
+ return i;
340
+ }
341
+ get strValue() {
342
+ if (!this.valueRange || !this.context) return null;
343
+ let { start: e, end: n } = this.valueRange, { src: r } = this.context, s = r[n - 1];
344
+ for (; e < n && (s === `
345
+ ` || s === " " || s === " "); ) s = r[--n - 1];
346
+ let i = "";
347
+ for (let a = e; a < n; ++a) {
348
+ let c = r[a];
349
+ if (c === `
350
+ `) {
351
+ let { fold: l, offset: f } = se.foldNewline(r, a, -1);
352
+ i += l, a = f;
353
+ } else if (c === " " || c === " ") {
354
+ let l = a, f = r[a + 1];
355
+ for (; a < n && (f === " " || f === " "); ) a += 1, f = r[a + 1];
356
+ f !== `
357
+ ` && (i += a > l ? r.slice(l, a + 1) : c);
358
+ } else i += c;
359
+ }
360
+ let o = r[e];
361
+ switch (o) {
362
+ case " ": {
363
+ let a = "Plain value cannot start with a tab character";
364
+ return { errors: [new ft(this, a)], str: i };
365
+ }
366
+ case "@":
367
+ case "`": {
368
+ let a = `Plain value cannot start with reserved character ${o}`;
369
+ return { errors: [new ft(this, a)], str: i };
370
+ }
371
+ default:
372
+ return i;
373
+ }
374
+ }
375
+ parseBlockValue(e) {
376
+ let { indent: n, inFlow: r, src: s } = this.context, i = e, o = e;
377
+ for (let a = s[i]; a === `
378
+ ` && !se.atDocumentBoundary(s, i + 1); a = s[i]) {
379
+ let c = se.endOfBlockIndent(s, n, i + 1);
380
+ if (c === null || s[c] === "#") break;
381
+ s[c] === `
382
+ ` ? i = c : (o = t.endOfLine(s, c, r), i = o);
383
+ }
384
+ return this.valueRange.isEmpty() && (this.valueRange.start = e), this.valueRange.end = o, o;
385
+ }
386
+ parse(e, n) {
387
+ this.context = e;
388
+ let { inFlow: r, src: s } = e, i = n, o = s[i];
389
+ return o && o !== "#" && o !== `
390
+ ` && (i = t.endOfLine(s, n, r)), this.valueRange = new Be(n, i), i = se.endOfWhiteSpace(s, i), i = this.parseComment(i), (!this.hasComment || this.valueRange.isEmpty()) && (i = this.parseBlockValue(i)), i;
391
+ }
392
+ };
393
+ U.Char = re;
394
+ U.Node = se;
395
+ U.PlainValue = vn;
396
+ U.Range = Be;
397
+ U.Type = lt;
398
+ U.YAMLError = ye;
399
+ U.YAMLReferenceError = Cn;
400
+ U.YAMLSemanticError = ft;
401
+ U.YAMLSyntaxError = Mn;
402
+ U.YAMLWarning = kn;
403
+ U._defineProperty = ko;
404
+ U.defaultTagPrefix = Ao;
405
+ U.defaultTags = To;
406
+ });
407
+ var Rs = te((xs) => {
408
+ var u = le(), Se = class extends u.Node {
409
+ constructor() {
410
+ super(u.Type.BLANK_LINE);
411
+ }
412
+ get includesTrailingLines() {
413
+ return true;
414
+ }
415
+ parse(e, n) {
416
+ return this.context = e, this.range = new u.Range(n, n + 1), n + 1;
417
+ }
418
+ }, ut = class extends u.Node {
419
+ constructor(e, n) {
420
+ super(e, n), this.node = null;
421
+ }
422
+ get includesTrailingLines() {
423
+ return !!this.node && this.node.includesTrailingLines;
424
+ }
425
+ parse(e, n) {
426
+ this.context = e;
427
+ let { parseNode: r, src: s } = e, { atLineStart: i, lineStart: o } = e;
428
+ !i && this.type === u.Type.SEQ_ITEM && (this.error = new u.YAMLSemanticError(this, "Sequence items must not have preceding content on the same line"));
429
+ let a = i ? n - o : e.indent, c = u.Node.endOfWhiteSpace(s, n + 1), l = s[c], f = l === "#", m = [], d = null;
430
+ for (; l === `
431
+ ` || l === "#"; ) {
432
+ if (l === "#") {
433
+ let h = u.Node.endOfLine(s, c + 1);
434
+ m.push(new u.Range(c, h)), c = h;
435
+ } else {
436
+ i = true, o = c + 1;
437
+ let h = u.Node.endOfWhiteSpace(s, o);
438
+ s[h] === `
439
+ ` && m.length === 0 && (d = new Se(), o = d.parse({ src: s }, o)), c = u.Node.endOfIndent(s, o);
440
+ }
441
+ l = s[c];
442
+ }
443
+ if (u.Node.nextNodeIsIndented(l, c - (o + a), this.type !== u.Type.SEQ_ITEM) ? this.node = r({ atLineStart: i, inCollection: false, indent: a, lineStart: o, parent: this }, c) : l && o > n + 1 && (c = o - 1), this.node) {
444
+ if (d) {
445
+ let h = e.parent.items || e.parent.contents;
446
+ h && h.push(d);
447
+ }
448
+ m.length && Array.prototype.push.apply(this.props, m), c = this.node.range.end;
449
+ } else if (f) {
450
+ let h = m[0];
451
+ this.props.push(h), c = h.end;
452
+ } else c = u.Node.endOfLine(s, n + 1);
453
+ let y = this.node ? this.node.valueRange.end : c;
454
+ return this.valueRange = new u.Range(n, y), c;
455
+ }
456
+ setOrigRanges(e, n) {
457
+ return n = super.setOrigRanges(e, n), this.node ? this.node.setOrigRanges(e, n) : n;
458
+ }
459
+ toString() {
460
+ let { context: { src: e }, node: n, range: r, value: s } = this;
461
+ if (s != null) return s;
462
+ let i = n ? e.slice(r.start, n.range.start) + String(n) : e.slice(r.start, r.end);
463
+ return u.Node.addStringTerminator(e, r.end, i);
464
+ }
465
+ }, Ee = class extends u.Node {
466
+ constructor() {
467
+ super(u.Type.COMMENT);
468
+ }
469
+ parse(e, n) {
470
+ this.context = e;
471
+ let r = this.parseComment(n);
472
+ return this.range = new u.Range(n, r), r;
473
+ }
474
+ };
475
+ function In(t) {
476
+ let e = t;
477
+ for (; e instanceof ut; ) e = e.node;
478
+ if (!(e instanceof $t)) return null;
479
+ let n = e.items.length, r = -1;
480
+ for (let o = n - 1; o >= 0; --o) {
481
+ let a = e.items[o];
482
+ if (a.type === u.Type.COMMENT) {
483
+ let { indent: c, lineStart: l } = a.context;
484
+ if (c > 0 && a.range.start >= l + c) break;
485
+ r = o;
486
+ } else if (a.type === u.Type.BLANK_LINE) r = o;
487
+ else break;
488
+ }
489
+ if (r === -1) return null;
490
+ let s = e.items.splice(r, n - r), i = s[0].range.start;
491
+ for (; e.range.end = i, e.valueRange && e.valueRange.end > i && (e.valueRange.end = i), e !== t; ) e = e.context.parent;
492
+ return s;
493
+ }
494
+ var $t = class t extends u.Node {
495
+ static nextContentHasIndent(e, n, r) {
496
+ let s = u.Node.endOfLine(e, n) + 1;
497
+ n = u.Node.endOfWhiteSpace(e, s);
498
+ let i = e[n];
499
+ return i ? n >= s + r ? true : i !== "#" && i !== `
500
+ ` ? false : t.nextContentHasIndent(e, n, r) : false;
501
+ }
502
+ constructor(e) {
503
+ super(e.type === u.Type.SEQ_ITEM ? u.Type.SEQ : u.Type.MAP);
504
+ for (let r = e.props.length - 1; r >= 0; --r) if (e.props[r].start < e.context.lineStart) {
505
+ this.props = e.props.slice(0, r + 1), e.props = e.props.slice(r + 1);
506
+ let s = e.props[0] || e.valueRange;
507
+ e.range.start = s.start;
508
+ break;
509
+ }
510
+ this.items = [e];
511
+ let n = In(e);
512
+ n && Array.prototype.push.apply(this.items, n);
513
+ }
514
+ get includesTrailingLines() {
515
+ return this.items.length > 0;
516
+ }
517
+ parse(e, n) {
518
+ this.context = e;
519
+ let { parseNode: r, src: s } = e, i = u.Node.startOfLine(s, n), o = this.items[0];
520
+ o.context.parent = this, this.valueRange = u.Range.copy(o.valueRange);
521
+ let a = o.range.start - o.context.lineStart, c = n;
522
+ c = u.Node.normalizeOffset(s, c);
523
+ let l = s[c], f = u.Node.endOfWhiteSpace(s, i) === c, m = false;
524
+ for (; l; ) {
525
+ for (; l === `
526
+ ` || l === "#"; ) {
527
+ if (f && l === `
528
+ ` && !m) {
529
+ let h = new Se();
530
+ if (c = h.parse({ src: s }, c), this.valueRange.end = c, c >= s.length) {
531
+ l = null;
532
+ break;
533
+ }
534
+ this.items.push(h), c -= 1;
535
+ } else if (l === "#") {
536
+ if (c < i + a && !t.nextContentHasIndent(s, c, a)) return c;
537
+ let h = new Ee();
538
+ if (c = h.parse({ indent: a, lineStart: i, src: s }, c), this.items.push(h), this.valueRange.end = c, c >= s.length) {
539
+ l = null;
540
+ break;
541
+ }
542
+ }
543
+ if (i = c + 1, c = u.Node.endOfIndent(s, i), u.Node.atBlank(s, c)) {
544
+ let h = u.Node.endOfWhiteSpace(s, c), g = s[h];
545
+ (!g || g === `
546
+ ` || g === "#") && (c = h);
547
+ }
548
+ l = s[c], f = true;
549
+ }
550
+ if (!l) break;
551
+ if (c !== i + a && (f || l !== ":")) {
552
+ if (c < i + a) {
553
+ i > n && (c = i);
554
+ break;
555
+ } else if (!this.error) {
556
+ let h = "All collection items must start at the same column";
557
+ this.error = new u.YAMLSyntaxError(this, h);
558
+ }
559
+ }
560
+ if (o.type === u.Type.SEQ_ITEM) {
561
+ if (l !== "-") {
562
+ i > n && (c = i);
563
+ break;
564
+ }
565
+ } else if (l === "-" && !this.error) {
566
+ let h = s[c + 1];
567
+ if (!h || h === `
568
+ ` || h === " " || h === " ") {
569
+ let g = "A collection cannot be both a mapping and a sequence";
570
+ this.error = new u.YAMLSyntaxError(this, g);
571
+ }
572
+ }
573
+ let d = r({ atLineStart: f, inCollection: true, indent: a, lineStart: i, parent: this }, c);
574
+ if (!d) return c;
575
+ if (this.items.push(d), this.valueRange.end = d.valueRange.end, c = u.Node.normalizeOffset(s, d.range.end), l = s[c], f = false, m = d.includesTrailingLines, l) {
576
+ let h = c - 1, g = s[h];
577
+ for (; g === " " || g === " "; ) g = s[--h];
578
+ g === `
579
+ ` && (i = h + 1, f = true);
580
+ }
581
+ let y = In(d);
582
+ y && Array.prototype.push.apply(this.items, y);
583
+ }
584
+ return c;
585
+ }
586
+ setOrigRanges(e, n) {
587
+ return n = super.setOrigRanges(e, n), this.items.forEach((r) => {
588
+ n = r.setOrigRanges(e, n);
589
+ }), n;
590
+ }
591
+ toString() {
592
+ let { context: { src: e }, items: n, range: r, value: s } = this;
593
+ if (s != null) return s;
594
+ let i = e.slice(r.start, n[0].range.start) + String(n[0]);
595
+ for (let o = 1; o < n.length; ++o) {
596
+ let a = n[o], { atLineStart: c, indent: l } = a.context;
597
+ if (c) for (let f = 0; f < l; ++f) i += " ";
598
+ i += String(a);
599
+ }
600
+ return u.Node.addStringTerminator(e, r.end, i);
601
+ }
602
+ }, Pn = class extends u.Node {
603
+ constructor() {
604
+ super(u.Type.DIRECTIVE), this.name = null;
605
+ }
606
+ get parameters() {
607
+ let e = this.rawValue;
608
+ return e ? e.trim().split(/[ \t]+/) : [];
609
+ }
610
+ parseName(e) {
611
+ let { src: n } = this.context, r = e, s = n[r];
612
+ for (; s && s !== `
613
+ ` && s !== " " && s !== " "; ) s = n[r += 1];
614
+ return this.name = n.slice(e, r), r;
615
+ }
616
+ parseParameters(e) {
617
+ let { src: n } = this.context, r = e, s = n[r];
618
+ for (; s && s !== `
619
+ ` && s !== "#"; ) s = n[r += 1];
620
+ return this.valueRange = new u.Range(e, r), r;
621
+ }
622
+ parse(e, n) {
623
+ this.context = e;
624
+ let r = this.parseName(n + 1);
625
+ return r = this.parseParameters(r), r = this.parseComment(r), this.range = new u.Range(n, r), r;
626
+ }
627
+ }, _n = class t extends u.Node {
628
+ static startCommentOrEndBlankLine(e, n) {
629
+ let r = u.Node.endOfWhiteSpace(e, n), s = e[r];
630
+ return s === "#" || s === `
631
+ ` ? r : n;
632
+ }
633
+ constructor() {
634
+ super(u.Type.DOCUMENT), this.directives = null, this.contents = null, this.directivesEndMarker = null, this.documentEndMarker = null;
635
+ }
636
+ parseDirectives(e) {
637
+ let { src: n } = this.context;
638
+ this.directives = [];
639
+ let r = true, s = false, i = e;
640
+ for (; !u.Node.atDocumentBoundary(n, i, u.Char.DIRECTIVES_END); ) switch (i = t.startCommentOrEndBlankLine(n, i), n[i]) {
641
+ case `
642
+ `:
643
+ if (r) {
644
+ let o = new Se();
645
+ i = o.parse({ src: n }, i), i < n.length && this.directives.push(o);
646
+ } else i += 1, r = true;
647
+ break;
648
+ case "#":
649
+ {
650
+ let o = new Ee();
651
+ i = o.parse({ src: n }, i), this.directives.push(o), r = false;
652
+ }
653
+ break;
654
+ case "%":
655
+ {
656
+ let o = new Pn();
657
+ i = o.parse({ parent: this, src: n }, i), this.directives.push(o), s = true, r = false;
658
+ }
659
+ break;
660
+ default:
661
+ return s ? this.error = new u.YAMLSemanticError(this, "Missing directives-end indicator line") : this.directives.length > 0 && (this.contents = this.directives, this.directives = []), i;
662
+ }
663
+ return n[i] ? (this.directivesEndMarker = new u.Range(i, i + 3), i + 3) : (s ? this.error = new u.YAMLSemanticError(this, "Missing directives-end indicator line") : this.directives.length > 0 && (this.contents = this.directives, this.directives = []), i);
664
+ }
665
+ parseContents(e) {
666
+ let { parseNode: n, src: r } = this.context;
667
+ this.contents || (this.contents = []);
668
+ let s = e;
669
+ for (; r[s - 1] === "-"; ) s -= 1;
670
+ let i = u.Node.endOfWhiteSpace(r, e), o = s === e;
671
+ for (this.valueRange = new u.Range(i); !u.Node.atDocumentBoundary(r, i, u.Char.DOCUMENT_END); ) {
672
+ switch (r[i]) {
673
+ case `
674
+ `:
675
+ if (o) {
676
+ let a = new Se();
677
+ i = a.parse({ src: r }, i), i < r.length && this.contents.push(a);
678
+ } else i += 1, o = true;
679
+ s = i;
680
+ break;
681
+ case "#":
682
+ {
683
+ let a = new Ee();
684
+ i = a.parse({ src: r }, i), this.contents.push(a), o = false;
685
+ }
686
+ break;
687
+ default: {
688
+ let a = u.Node.endOfIndent(r, i), l = n({ atLineStart: o, indent: -1, inFlow: false, inCollection: false, lineStart: s, parent: this }, a);
689
+ if (!l) return this.valueRange.end = a;
690
+ this.contents.push(l), i = l.range.end, o = false;
691
+ let f = In(l);
692
+ f && Array.prototype.push.apply(this.contents, f);
693
+ }
694
+ }
695
+ i = t.startCommentOrEndBlankLine(r, i);
696
+ }
697
+ if (this.valueRange.end = i, r[i] && (this.documentEndMarker = new u.Range(i, i + 3), i += 3, r[i])) {
698
+ if (i = u.Node.endOfWhiteSpace(r, i), r[i] === "#") {
699
+ let a = new Ee();
700
+ i = a.parse({ src: r }, i), this.contents.push(a);
701
+ }
702
+ switch (r[i]) {
703
+ case `
704
+ `:
705
+ i += 1;
706
+ break;
707
+ case void 0:
708
+ break;
709
+ default:
710
+ this.error = new u.YAMLSyntaxError(this, "Document end marker line cannot have a non-comment suffix");
711
+ }
712
+ }
713
+ return i;
714
+ }
715
+ parse(e, n) {
716
+ e.root = this, this.context = e;
717
+ let { src: r } = e, s = r.charCodeAt(n) === 65279 ? n + 1 : n;
718
+ return s = this.parseDirectives(s), s = this.parseContents(s), s;
719
+ }
720
+ setOrigRanges(e, n) {
721
+ return n = super.setOrigRanges(e, n), this.directives.forEach((r) => {
722
+ n = r.setOrigRanges(e, n);
723
+ }), this.directivesEndMarker && (n = this.directivesEndMarker.setOrigRange(e, n)), this.contents.forEach((r) => {
724
+ n = r.setOrigRanges(e, n);
725
+ }), this.documentEndMarker && (n = this.documentEndMarker.setOrigRange(e, n)), n;
726
+ }
727
+ toString() {
728
+ let { contents: e, directives: n, value: r } = this;
729
+ if (r != null) return r;
730
+ let s = n.join("");
731
+ return e.length > 0 && ((n.length > 0 || e[0].type === u.Type.COMMENT) && (s += `---
732
+ `), s += e.join("")), s[s.length - 1] !== `
733
+ ` && (s += `
734
+ `), s;
735
+ }
736
+ }, xn = class extends u.Node {
737
+ parse(e, n) {
738
+ this.context = e;
739
+ let { src: r } = e, s = u.Node.endOfIdentifier(r, n + 1);
740
+ return this.valueRange = new u.Range(n + 1, s), s = u.Node.endOfWhiteSpace(r, s), s = this.parseComment(s), s;
741
+ }
742
+ }, fe = { CLIP: "CLIP", KEEP: "KEEP", STRIP: "STRIP" }, Rn = class extends u.Node {
743
+ constructor(e, n) {
744
+ super(e, n), this.blockIndent = null, this.chomping = fe.CLIP, this.header = null;
745
+ }
746
+ get includesTrailingLines() {
747
+ return this.chomping === fe.KEEP;
748
+ }
749
+ get strValue() {
750
+ if (!this.valueRange || !this.context) return null;
751
+ let { start: e, end: n } = this.valueRange, { indent: r, src: s } = this.context;
752
+ if (this.valueRange.isEmpty()) return "";
753
+ let i = null, o = s[n - 1];
754
+ for (; o === `
755
+ ` || o === " " || o === " "; ) {
756
+ if (n -= 1, n <= e) {
757
+ if (this.chomping === fe.KEEP) break;
758
+ return "";
759
+ }
760
+ o === `
761
+ ` && (i = n), o = s[n - 1];
762
+ }
763
+ let a = n + 1;
764
+ i && (this.chomping === fe.KEEP ? (a = i, n = this.valueRange.end) : n = i);
765
+ let c = r + this.blockIndent, l = this.type === u.Type.BLOCK_FOLDED, f = true, m = "", d = "", y = false;
766
+ for (let h = e; h < n; ++h) {
767
+ for (let w = 0; w < c && s[h] === " "; ++w) h += 1;
768
+ let g = s[h];
769
+ if (g === `
770
+ `) d === `
771
+ ` ? m += `
772
+ ` : d = `
773
+ `;
774
+ else {
775
+ let w = u.Node.endOfLine(s, h), C = s.slice(h, w);
776
+ h = w, l && (g === " " || g === " ") && h < a ? (d === " " ? d = `
777
+ ` : !y && !f && d === `
778
+ ` && (d = `
779
+
780
+ `), m += d + C, d = w < n && s[w] || "", y = true) : (m += d + C, d = l && h < a ? " " : `
781
+ `, y = false), f && C !== "" && (f = false);
782
+ }
783
+ }
784
+ return this.chomping === fe.STRIP ? m : m + `
785
+ `;
786
+ }
787
+ parseBlockHeader(e) {
788
+ let { src: n } = this.context, r = e + 1, s = "";
789
+ for (; ; ) {
790
+ let i = n[r];
791
+ switch (i) {
792
+ case "-":
793
+ this.chomping = fe.STRIP;
794
+ break;
795
+ case "+":
796
+ this.chomping = fe.KEEP;
797
+ break;
798
+ case "0":
799
+ case "1":
800
+ case "2":
801
+ case "3":
802
+ case "4":
803
+ case "5":
804
+ case "6":
805
+ case "7":
806
+ case "8":
807
+ case "9":
808
+ s += i;
809
+ break;
810
+ default:
811
+ return this.blockIndent = Number(s) || null, this.header = new u.Range(e, r), r;
812
+ }
813
+ r += 1;
814
+ }
815
+ }
816
+ parseBlockValue(e) {
817
+ let { indent: n, src: r } = this.context, s = !!this.blockIndent, i = e, o = e, a = 1;
818
+ for (let c = r[i]; c === `
819
+ ` && (i += 1, !u.Node.atDocumentBoundary(r, i)); c = r[i]) {
820
+ let l = u.Node.endOfBlockIndent(r, n, i);
821
+ if (l === null) break;
822
+ let f = r[l], m = l - (i + n);
823
+ if (this.blockIndent) {
824
+ if (f && f !== `
825
+ ` && m < this.blockIndent) {
826
+ if (r[l] === "#") break;
827
+ if (!this.error) {
828
+ let y = `Block scalars must not be less indented than their ${s ? "explicit indentation indicator" : "first line"}`;
829
+ this.error = new u.YAMLSemanticError(this, y);
830
+ }
831
+ }
832
+ } else if (r[l] !== `
833
+ `) {
834
+ if (m < a) {
835
+ let d = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator";
836
+ this.error = new u.YAMLSemanticError(this, d);
837
+ }
838
+ this.blockIndent = m;
839
+ } else m > a && (a = m);
840
+ r[l] === `
841
+ ` ? i = l : i = o = u.Node.endOfLine(r, l);
842
+ }
843
+ return this.chomping !== fe.KEEP && (i = r[o] ? o + 1 : o), this.valueRange = new u.Range(e + 1, i), i;
844
+ }
845
+ parse(e, n) {
846
+ this.context = e;
847
+ let { src: r } = e, s = this.parseBlockHeader(n);
848
+ return s = u.Node.endOfWhiteSpace(r, s), s = this.parseComment(s), s = this.parseBlockValue(s), s;
849
+ }
850
+ setOrigRanges(e, n) {
851
+ return n = super.setOrigRanges(e, n), this.header ? this.header.setOrigRange(e, n) : n;
852
+ }
853
+ }, Dn = class extends u.Node {
854
+ constructor(e, n) {
855
+ super(e, n), this.items = null;
856
+ }
857
+ prevNodeIsJsonLike(e = this.items.length) {
858
+ let n = this.items[e - 1];
859
+ return !!n && (n.jsonLike || n.type === u.Type.COMMENT && this.prevNodeIsJsonLike(e - 1));
860
+ }
861
+ parse(e, n) {
862
+ this.context = e;
863
+ let { parseNode: r, src: s } = e, { indent: i, lineStart: o } = e, a = s[n];
864
+ this.items = [{ char: a, offset: n }];
865
+ let c = u.Node.endOfWhiteSpace(s, n + 1);
866
+ for (a = s[c]; a && a !== "]" && a !== "}"; ) {
867
+ switch (a) {
868
+ case `
869
+ `:
870
+ {
871
+ o = c + 1;
872
+ let l = u.Node.endOfWhiteSpace(s, o);
873
+ if (s[l] === `
874
+ `) {
875
+ let f = new Se();
876
+ o = f.parse({ src: s }, o), this.items.push(f);
877
+ }
878
+ if (c = u.Node.endOfIndent(s, o), c <= o + i && (a = s[c], c < o + i || a !== "]" && a !== "}")) {
879
+ let f = "Insufficient indentation in flow collection";
880
+ this.error = new u.YAMLSemanticError(this, f);
881
+ }
882
+ }
883
+ break;
884
+ case ",":
885
+ this.items.push({ char: a, offset: c }), c += 1;
886
+ break;
887
+ case "#":
888
+ {
889
+ let l = new Ee();
890
+ c = l.parse({ src: s }, c), this.items.push(l);
891
+ }
892
+ break;
893
+ case "?":
894
+ case ":": {
895
+ let l = s[c + 1];
896
+ if (l === `
897
+ ` || l === " " || l === " " || l === "," || a === ":" && this.prevNodeIsJsonLike()) {
898
+ this.items.push({ char: a, offset: c }), c += 1;
899
+ break;
900
+ }
901
+ }
902
+ default: {
903
+ let l = r({ atLineStart: false, inCollection: false, inFlow: true, indent: -1, lineStart: o, parent: this }, c);
904
+ if (!l) return this.valueRange = new u.Range(n, c), c;
905
+ this.items.push(l), c = u.Node.normalizeOffset(s, l.range.end);
906
+ }
907
+ }
908
+ c = u.Node.endOfWhiteSpace(s, c), a = s[c];
909
+ }
910
+ return this.valueRange = new u.Range(n, c + 1), a && (this.items.push({ char: a, offset: c }), c = u.Node.endOfWhiteSpace(s, c + 1), c = this.parseComment(c)), c;
911
+ }
912
+ setOrigRanges(e, n) {
913
+ return n = super.setOrigRanges(e, n), this.items.forEach((r) => {
914
+ if (r instanceof u.Node) n = r.setOrigRanges(e, n);
915
+ else if (e.length === 0) r.origOffset = r.offset;
916
+ else {
917
+ let s = n;
918
+ for (; s < e.length && !(e[s] > r.offset); ) ++s;
919
+ r.origOffset = r.offset + s, n = s;
920
+ }
921
+ }), n;
922
+ }
923
+ toString() {
924
+ let { context: { src: e }, items: n, range: r, value: s } = this;
925
+ if (s != null) return s;
926
+ let i = n.filter((c) => c instanceof u.Node), o = "", a = r.start;
927
+ return i.forEach((c) => {
928
+ let l = e.slice(a, c.range.start);
929
+ a = c.range.end, o += l + String(c), o[o.length - 1] === `
930
+ ` && e[a - 1] !== `
931
+ ` && e[a] === `
932
+ ` && (a += 1);
933
+ }), o += e.slice(a, r.end), u.Node.addStringTerminator(e, r.end, o);
934
+ }
935
+ }, Yn = class t extends u.Node {
936
+ static endOfQuote(e, n) {
937
+ let r = e[n];
938
+ for (; r && r !== '"'; ) n += r === "\\" ? 2 : 1, r = e[n];
939
+ return n + 1;
940
+ }
941
+ get strValue() {
942
+ if (!this.valueRange || !this.context) return null;
943
+ let e = [], { start: n, end: r } = this.valueRange, { indent: s, src: i } = this.context;
944
+ i[r - 1] !== '"' && e.push(new u.YAMLSyntaxError(this, 'Missing closing "quote'));
945
+ let o = "";
946
+ for (let a = n + 1; a < r - 1; ++a) {
947
+ let c = i[a];
948
+ if (c === `
949
+ `) {
950
+ u.Node.atDocumentBoundary(i, a + 1) && e.push(new u.YAMLSemanticError(this, "Document boundary indicators are not allowed within string values"));
951
+ let { fold: l, offset: f, error: m } = u.Node.foldNewline(i, a, s);
952
+ o += l, a = f, m && e.push(new u.YAMLSemanticError(this, "Multi-line double-quoted string needs to be sufficiently indented"));
953
+ } else if (c === "\\") switch (a += 1, i[a]) {
954
+ case "0":
955
+ o += "\0";
956
+ break;
957
+ case "a":
958
+ o += "\x07";
959
+ break;
960
+ case "b":
961
+ o += "\b";
962
+ break;
963
+ case "e":
964
+ o += "\x1B";
965
+ break;
966
+ case "f":
967
+ o += "\f";
968
+ break;
969
+ case "n":
970
+ o += `
971
+ `;
972
+ break;
973
+ case "r":
974
+ o += "\r";
975
+ break;
976
+ case "t":
977
+ o += " ";
978
+ break;
979
+ case "v":
980
+ o += "\v";
981
+ break;
982
+ case "N":
983
+ o += "\x85";
984
+ break;
985
+ case "_":
986
+ o += "\xA0";
987
+ break;
988
+ case "L":
989
+ o += "\u2028";
990
+ break;
991
+ case "P":
992
+ o += "\u2029";
993
+ break;
994
+ case " ":
995
+ o += " ";
996
+ break;
997
+ case '"':
998
+ o += '"';
999
+ break;
1000
+ case "/":
1001
+ o += "/";
1002
+ break;
1003
+ case "\\":
1004
+ o += "\\";
1005
+ break;
1006
+ case " ":
1007
+ o += " ";
1008
+ break;
1009
+ case "x":
1010
+ o += this.parseCharCode(a + 1, 2, e), a += 2;
1011
+ break;
1012
+ case "u":
1013
+ o += this.parseCharCode(a + 1, 4, e), a += 4;
1014
+ break;
1015
+ case "U":
1016
+ o += this.parseCharCode(a + 1, 8, e), a += 8;
1017
+ break;
1018
+ case `
1019
+ `:
1020
+ for (; i[a + 1] === " " || i[a + 1] === " "; ) a += 1;
1021
+ break;
1022
+ default:
1023
+ e.push(new u.YAMLSyntaxError(this, `Invalid escape sequence ${i.substr(a - 1, 2)}`)), o += "\\" + i[a];
1024
+ }
1025
+ else if (c === " " || c === " ") {
1026
+ let l = a, f = i[a + 1];
1027
+ for (; f === " " || f === " "; ) a += 1, f = i[a + 1];
1028
+ f !== `
1029
+ ` && (o += a > l ? i.slice(l, a + 1) : c);
1030
+ } else o += c;
1031
+ }
1032
+ return e.length > 0 ? { errors: e, str: o } : o;
1033
+ }
1034
+ parseCharCode(e, n, r) {
1035
+ let { src: s } = this.context, i = s.substr(e, n), a = i.length === n && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
1036
+ return isNaN(a) ? (r.push(new u.YAMLSyntaxError(this, `Invalid escape sequence ${s.substr(e - 2, n + 2)}`)), s.substr(e - 2, n + 2)) : String.fromCodePoint(a);
1037
+ }
1038
+ parse(e, n) {
1039
+ this.context = e;
1040
+ let { src: r } = e, s = t.endOfQuote(r, n + 1);
1041
+ return this.valueRange = new u.Range(n, s), s = u.Node.endOfWhiteSpace(r, s), s = this.parseComment(s), s;
1042
+ }
1043
+ }, $n = class t extends u.Node {
1044
+ static endOfQuote(e, n) {
1045
+ let r = e[n];
1046
+ for (; r; ) if (r === "'") {
1047
+ if (e[n + 1] !== "'") break;
1048
+ r = e[n += 2];
1049
+ } else r = e[n += 1];
1050
+ return n + 1;
1051
+ }
1052
+ get strValue() {
1053
+ if (!this.valueRange || !this.context) return null;
1054
+ let e = [], { start: n, end: r } = this.valueRange, { indent: s, src: i } = this.context;
1055
+ i[r - 1] !== "'" && e.push(new u.YAMLSyntaxError(this, "Missing closing 'quote"));
1056
+ let o = "";
1057
+ for (let a = n + 1; a < r - 1; ++a) {
1058
+ let c = i[a];
1059
+ if (c === `
1060
+ `) {
1061
+ u.Node.atDocumentBoundary(i, a + 1) && e.push(new u.YAMLSemanticError(this, "Document boundary indicators are not allowed within string values"));
1062
+ let { fold: l, offset: f, error: m } = u.Node.foldNewline(i, a, s);
1063
+ o += l, a = f, m && e.push(new u.YAMLSemanticError(this, "Multi-line single-quoted string needs to be sufficiently indented"));
1064
+ } else if (c === "'") o += c, a += 1, i[a] !== "'" && e.push(new u.YAMLSyntaxError(this, "Unescaped single quote? This should not happen."));
1065
+ else if (c === " " || c === " ") {
1066
+ let l = a, f = i[a + 1];
1067
+ for (; f === " " || f === " "; ) a += 1, f = i[a + 1];
1068
+ f !== `
1069
+ ` && (o += a > l ? i.slice(l, a + 1) : c);
1070
+ } else o += c;
1071
+ }
1072
+ return e.length > 0 ? { errors: e, str: o } : o;
1073
+ }
1074
+ parse(e, n) {
1075
+ this.context = e;
1076
+ let { src: r } = e, s = t.endOfQuote(r, n + 1);
1077
+ return this.valueRange = new u.Range(n, s), s = u.Node.endOfWhiteSpace(r, s), s = this.parseComment(s), s;
1078
+ }
1079
+ };
1080
+ function vo(t, e) {
1081
+ switch (t) {
1082
+ case u.Type.ALIAS:
1083
+ return new xn(t, e);
1084
+ case u.Type.BLOCK_FOLDED:
1085
+ case u.Type.BLOCK_LITERAL:
1086
+ return new Rn(t, e);
1087
+ case u.Type.FLOW_MAP:
1088
+ case u.Type.FLOW_SEQ:
1089
+ return new Dn(t, e);
1090
+ case u.Type.MAP_KEY:
1091
+ case u.Type.MAP_VALUE:
1092
+ case u.Type.SEQ_ITEM:
1093
+ return new ut(t, e);
1094
+ case u.Type.COMMENT:
1095
+ case u.Type.PLAIN:
1096
+ return new u.PlainValue(t, e);
1097
+ case u.Type.QUOTE_DOUBLE:
1098
+ return new Yn(t, e);
1099
+ case u.Type.QUOTE_SINGLE:
1100
+ return new $n(t, e);
1101
+ default:
1102
+ return null;
1103
+ }
1104
+ }
1105
+ var Bn = class t {
1106
+ static parseType(e, n, r) {
1107
+ switch (e[n]) {
1108
+ case "*":
1109
+ return u.Type.ALIAS;
1110
+ case ">":
1111
+ return u.Type.BLOCK_FOLDED;
1112
+ case "|":
1113
+ return u.Type.BLOCK_LITERAL;
1114
+ case "{":
1115
+ return u.Type.FLOW_MAP;
1116
+ case "[":
1117
+ return u.Type.FLOW_SEQ;
1118
+ case "?":
1119
+ return !r && u.Node.atBlank(e, n + 1, true) ? u.Type.MAP_KEY : u.Type.PLAIN;
1120
+ case ":":
1121
+ return !r && u.Node.atBlank(e, n + 1, true) ? u.Type.MAP_VALUE : u.Type.PLAIN;
1122
+ case "-":
1123
+ return !r && u.Node.atBlank(e, n + 1, true) ? u.Type.SEQ_ITEM : u.Type.PLAIN;
1124
+ case '"':
1125
+ return u.Type.QUOTE_DOUBLE;
1126
+ case "'":
1127
+ return u.Type.QUOTE_SINGLE;
1128
+ default:
1129
+ return u.Type.PLAIN;
1130
+ }
1131
+ }
1132
+ constructor(e = {}, { atLineStart: n, inCollection: r, inFlow: s, indent: i, lineStart: o, parent: a } = {}) {
1133
+ u._defineProperty(this, "parseNode", (c, l) => {
1134
+ if (u.Node.atDocumentBoundary(this.src, l)) return null;
1135
+ let f = new t(this, c), { props: m, type: d, valueStart: y } = f.parseProps(l), h = vo(d, m), g = h.parse(f, y);
1136
+ if (h.range = new u.Range(l, g), g <= l && (h.error = new Error("Node#parse consumed no characters"), h.error.parseEnd = g, h.error.source = h, h.range.end = l + 1), f.nodeStartsCollection(h)) {
1137
+ !h.error && !f.atLineStart && f.parent.type === u.Type.DOCUMENT && (h.error = new u.YAMLSyntaxError(h, "Block collection must not have preceding content here (e.g. directives-end indicator)"));
1138
+ let w = new $t(h);
1139
+ return g = w.parse(new t(f), g), w.range = new u.Range(l, g), w;
1140
+ }
1141
+ return h;
1142
+ }), this.atLineStart = n ?? (e.atLineStart || false), this.inCollection = r ?? (e.inCollection || false), this.inFlow = s ?? (e.inFlow || false), this.indent = i ?? e.indent, this.lineStart = o ?? e.lineStart, this.parent = a ?? (e.parent || {}), this.root = e.root, this.src = e.src;
1143
+ }
1144
+ nodeStartsCollection(e) {
1145
+ let { inCollection: n, inFlow: r, src: s } = this;
1146
+ if (n || r) return false;
1147
+ if (e instanceof ut) return true;
1148
+ let i = e.range.end;
1149
+ return s[i] === `
1150
+ ` || s[i - 1] === `
1151
+ ` ? false : (i = u.Node.endOfWhiteSpace(s, i), s[i] === ":");
1152
+ }
1153
+ parseProps(e) {
1154
+ let { inFlow: n, parent: r, src: s } = this, i = [], o = false;
1155
+ e = this.atLineStart ? u.Node.endOfIndent(s, e) : u.Node.endOfWhiteSpace(s, e);
1156
+ let a = s[e];
1157
+ for (; a === u.Char.ANCHOR || a === u.Char.COMMENT || a === u.Char.TAG || a === `
1158
+ `; ) {
1159
+ if (a === `
1160
+ `) {
1161
+ let l = e, f;
1162
+ do
1163
+ f = l + 1, l = u.Node.endOfIndent(s, f);
1164
+ while (s[l] === `
1165
+ `);
1166
+ let m = l - (f + this.indent), d = r.type === u.Type.SEQ_ITEM && r.context.atLineStart;
1167
+ if (s[l] !== "#" && !u.Node.nextNodeIsIndented(s[l], m, !d)) break;
1168
+ this.atLineStart = true, this.lineStart = f, o = false, e = l;
1169
+ } else if (a === u.Char.COMMENT) {
1170
+ let l = u.Node.endOfLine(s, e + 1);
1171
+ i.push(new u.Range(e, l)), e = l;
1172
+ } else {
1173
+ let l = u.Node.endOfIdentifier(s, e + 1);
1174
+ a === u.Char.TAG && s[l] === "," && /^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(s.slice(e + 1, l + 13)) && (l = u.Node.endOfIdentifier(s, l + 5)), i.push(new u.Range(e, l)), o = true, e = u.Node.endOfWhiteSpace(s, l);
1175
+ }
1176
+ a = s[e];
1177
+ }
1178
+ o && a === ":" && u.Node.atBlank(s, e + 1, true) && (e -= 1);
1179
+ let c = t.parseType(s, e, n);
1180
+ return { props: i, type: c, valueStart: e };
1181
+ }
1182
+ };
1183
+ function Io(t) {
1184
+ let e = [];
1185
+ t.indexOf("\r") !== -1 && (t = t.replace(/\r\n?/g, (s, i) => (s.length > 1 && e.push(i), `
1186
+ `)));
1187
+ let n = [], r = 0;
1188
+ do {
1189
+ let s = new _n(), i = new Bn({ src: t });
1190
+ r = s.parse(i, r), n.push(s);
1191
+ } while (r < t.length);
1192
+ return n.setOrigRanges = () => {
1193
+ if (e.length === 0) return false;
1194
+ for (let i = 1; i < e.length; ++i) e[i] -= i;
1195
+ let s = 0;
1196
+ for (let i = 0; i < n.length; ++i) s = n[i].setOrigRanges(e, s);
1197
+ return e.splice(0, e.length), true;
1198
+ }, n.toString = () => n.join(`...
1199
+ `), n;
1200
+ }
1201
+ xs.parse = Io;
1202
+ });
1203
+ var qe = te((k) => {
1204
+ var p = le();
1205
+ function Po(t, e, n) {
1206
+ return n ? `#${n.replace(/[\s\S]^/gm, `$&${e}#`)}
1207
+ ${e}${t}` : t;
1208
+ }
1209
+ function Fe(t, e, n) {
1210
+ return n ? n.indexOf(`
1211
+ `) === -1 ? `${t} #${n}` : `${t}
1212
+ ` + n.replace(/^/gm, `${e || ""}#`) : t;
1213
+ }
1214
+ var W = class {
1215
+ };
1216
+ function ue(t, e, n) {
1217
+ if (Array.isArray(t)) return t.map((r, s) => ue(r, String(s), n));
1218
+ if (t && typeof t.toJSON == "function") {
1219
+ let r = n && n.anchors && n.anchors.get(t);
1220
+ r && (n.onCreate = (i) => {
1221
+ r.res = i, delete n.onCreate;
1222
+ });
1223
+ let s = t.toJSON(e, n);
1224
+ return r && n.onCreate && n.onCreate(s), s;
1225
+ }
1226
+ return (!n || !n.keep) && typeof t == "bigint" ? Number(t) : t;
1227
+ }
1228
+ var P = class extends W {
1229
+ constructor(e) {
1230
+ super(), this.value = e;
1231
+ }
1232
+ toJSON(e, n) {
1233
+ return n && n.keep ? this.value : ue(this.value, e, n);
1234
+ }
1235
+ toString() {
1236
+ return String(this.value);
1237
+ }
1238
+ };
1239
+ function Ds(t, e, n) {
1240
+ let r = n;
1241
+ for (let s = e.length - 1; s >= 0; --s) {
1242
+ let i = e[s];
1243
+ if (Number.isInteger(i) && i >= 0) {
1244
+ let o = [];
1245
+ o[i] = r, r = o;
1246
+ } else {
1247
+ let o = {};
1248
+ Object.defineProperty(o, i, { value: r, writable: true, enumerable: true, configurable: true }), r = o;
1249
+ }
1250
+ }
1251
+ return t.createNode(r, false);
1252
+ }
1253
+ var Bs = (t) => t == null || typeof t == "object" && t[Symbol.iterator]().next().done, j = class t extends W {
1254
+ constructor(e) {
1255
+ super(), p._defineProperty(this, "items", []), this.schema = e;
1256
+ }
1257
+ addIn(e, n) {
1258
+ if (Bs(e)) this.add(n);
1259
+ else {
1260
+ let [r, ...s] = e, i = this.get(r, true);
1261
+ if (i instanceof t) i.addIn(s, n);
1262
+ else if (i === void 0 && this.schema) this.set(r, Ds(this.schema, s, n));
1263
+ else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`);
1264
+ }
1265
+ }
1266
+ deleteIn([e, ...n]) {
1267
+ if (n.length === 0) return this.delete(e);
1268
+ let r = this.get(e, true);
1269
+ if (r instanceof t) return r.deleteIn(n);
1270
+ throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`);
1271
+ }
1272
+ getIn([e, ...n], r) {
1273
+ let s = this.get(e, true);
1274
+ return n.length === 0 ? !r && s instanceof P ? s.value : s : s instanceof t ? s.getIn(n, r) : void 0;
1275
+ }
1276
+ hasAllNullValues() {
1277
+ return this.items.every((e) => {
1278
+ if (!e || e.type !== "PAIR") return false;
1279
+ let n = e.value;
1280
+ return n == null || n instanceof P && n.value == null && !n.commentBefore && !n.comment && !n.tag;
1281
+ });
1282
+ }
1283
+ hasIn([e, ...n]) {
1284
+ if (n.length === 0) return this.has(e);
1285
+ let r = this.get(e, true);
1286
+ return r instanceof t ? r.hasIn(n) : false;
1287
+ }
1288
+ setIn([e, ...n], r) {
1289
+ if (n.length === 0) this.set(e, r);
1290
+ else {
1291
+ let s = this.get(e, true);
1292
+ if (s instanceof t) s.setIn(n, r);
1293
+ else if (s === void 0 && this.schema) this.set(e, Ds(this.schema, n, r));
1294
+ else throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`);
1295
+ }
1296
+ }
1297
+ toJSON() {
1298
+ return null;
1299
+ }
1300
+ toString(e, { blockItem: n, flowChars: r, isMap: s, itemIndent: i }, o, a) {
1301
+ let { indent: c, indentStep: l, stringify: f } = e, m = this.type === p.Type.FLOW_MAP || this.type === p.Type.FLOW_SEQ || e.inFlow;
1302
+ m && (i += l);
1303
+ let d = s && this.hasAllNullValues();
1304
+ e = Object.assign({}, e, { allNullValues: d, indent: i, inFlow: m, type: null });
1305
+ let y = false, h = false, g = this.items.reduce((C, L, M) => {
1306
+ let A;
1307
+ L && (!y && L.spaceBefore && C.push({ type: "comment", str: "" }), L.commentBefore && L.commentBefore.match(/^.*$/gm).forEach((Ai) => {
1308
+ C.push({ type: "comment", str: `#${Ai}` });
1309
+ }), L.comment && (A = L.comment), m && (!y && L.spaceBefore || L.commentBefore || L.comment || L.key && (L.key.commentBefore || L.key.comment) || L.value && (L.value.commentBefore || L.value.comment)) && (h = true)), y = false;
1310
+ let _ = f(L, e, () => A = null, () => y = true);
1311
+ return m && !h && _.includes(`
1312
+ `) && (h = true), m && M < this.items.length - 1 && (_ += ","), _ = Fe(_, i, A), y && (A || m) && (y = false), C.push({ type: "item", str: _ }), C;
1313
+ }, []), w;
1314
+ if (g.length === 0) w = r.start + r.end;
1315
+ else if (m) {
1316
+ let { start: C, end: L } = r, M = g.map((A) => A.str);
1317
+ if (h || M.reduce((A, _) => A + _.length + 2, 2) > t.maxFlowStringSingleLineLength) {
1318
+ w = C;
1319
+ for (let A of M) w += A ? `
1320
+ ${l}${c}${A}` : `
1321
+ `;
1322
+ w += `
1323
+ ${c}${L}`;
1324
+ } else w = `${C} ${M.join(" ")} ${L}`;
1325
+ } else {
1326
+ let C = g.map(n);
1327
+ w = C.shift();
1328
+ for (let L of C) w += L ? `
1329
+ ${c}${L}` : `
1330
+ `;
1331
+ }
1332
+ return this.comment ? (w += `
1333
+ ` + this.comment.replace(/^/gm, `${c}#`), o && o()) : y && a && a(), w;
1334
+ }
1335
+ };
1336
+ p._defineProperty(j, "maxFlowStringSingleLineLength", 60);
1337
+ function Bt(t) {
1338
+ let e = t instanceof P ? t.value : t;
1339
+ return e && typeof e == "string" && (e = Number(e)), Number.isInteger(e) && e >= 0 ? e : null;
1340
+ }
1341
+ var pe = class extends j {
1342
+ add(e) {
1343
+ this.items.push(e);
1344
+ }
1345
+ delete(e) {
1346
+ let n = Bt(e);
1347
+ return typeof n != "number" ? false : this.items.splice(n, 1).length > 0;
1348
+ }
1349
+ get(e, n) {
1350
+ let r = Bt(e);
1351
+ if (typeof r != "number") return;
1352
+ let s = this.items[r];
1353
+ return !n && s instanceof P ? s.value : s;
1354
+ }
1355
+ has(e) {
1356
+ let n = Bt(e);
1357
+ return typeof n == "number" && n < this.items.length;
1358
+ }
1359
+ set(e, n) {
1360
+ let r = Bt(e);
1361
+ if (typeof r != "number") throw new Error(`Expected a valid index, not ${e}.`);
1362
+ this.items[r] = n;
1363
+ }
1364
+ toJSON(e, n) {
1365
+ let r = [];
1366
+ n && n.onCreate && n.onCreate(r);
1367
+ let s = 0;
1368
+ for (let i of this.items) r.push(ue(i, String(s++), n));
1369
+ return r;
1370
+ }
1371
+ toString(e, n, r) {
1372
+ return e ? super.toString(e, { blockItem: (s) => s.type === "comment" ? s.str : `- ${s.str}`, flowChars: { start: "[", end: "]" }, isMap: false, itemIndent: (e.indent || "") + " " }, n, r) : JSON.stringify(this);
1373
+ }
1374
+ }, _o = (t, e, n) => e === null ? "" : typeof e != "object" ? String(e) : t instanceof W && n && n.doc ? t.toString({ anchors: /* @__PURE__ */ Object.create(null), doc: n.doc, indent: "", indentStep: n.indentStep, inFlow: true, inStringifyKey: true, stringify: n.stringify }) : JSON.stringify(e), T = class t extends W {
1375
+ constructor(e, n = null) {
1376
+ super(), this.key = e, this.value = n, this.type = t.Type.PAIR;
1377
+ }
1378
+ get commentBefore() {
1379
+ return this.key instanceof W ? this.key.commentBefore : void 0;
1380
+ }
1381
+ set commentBefore(e) {
1382
+ if (this.key == null && (this.key = new P(null)), this.key instanceof W) this.key.commentBefore = e;
1383
+ else {
1384
+ let n = "Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";
1385
+ throw new Error(n);
1386
+ }
1387
+ }
1388
+ addToJSMap(e, n) {
1389
+ let r = ue(this.key, "", e);
1390
+ if (n instanceof Map) {
1391
+ let s = ue(this.value, r, e);
1392
+ n.set(r, s);
1393
+ } else if (n instanceof Set) n.add(r);
1394
+ else {
1395
+ let s = _o(this.key, r, e), i = ue(this.value, s, e);
1396
+ s in n ? Object.defineProperty(n, s, { value: i, writable: true, enumerable: true, configurable: true }) : n[s] = i;
1397
+ }
1398
+ return n;
1399
+ }
1400
+ toJSON(e, n) {
1401
+ let r = n && n.mapAsMap ? /* @__PURE__ */ new Map() : {};
1402
+ return this.addToJSMap(n, r);
1403
+ }
1404
+ toString(e, n, r) {
1405
+ if (!e || !e.doc) return JSON.stringify(this);
1406
+ let { indent: s, indentSeq: i, simpleKeys: o } = e.doc.options, { key: a, value: c } = this, l = a instanceof W && a.comment;
1407
+ if (o) {
1408
+ if (l) throw new Error("With simple keys, key nodes cannot have comments");
1409
+ if (a instanceof j) {
1410
+ let _ = "With simple keys, collection cannot be used as a key value";
1411
+ throw new Error(_);
1412
+ }
1413
+ }
1414
+ let f = !o && (!a || l || (a instanceof W ? a instanceof j || a.type === p.Type.BLOCK_FOLDED || a.type === p.Type.BLOCK_LITERAL : typeof a == "object")), { doc: m, indent: d, indentStep: y, stringify: h } = e;
1415
+ e = Object.assign({}, e, { implicitKey: !f, indent: d + y });
1416
+ let g = false, w = h(a, e, () => l = null, () => g = true);
1417
+ if (w = Fe(w, e.indent, l), !f && w.length > 1024) {
1418
+ if (o) throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
1419
+ f = true;
1420
+ }
1421
+ if (e.allNullValues && !o) return this.comment ? (w = Fe(w, e.indent, this.comment), n && n()) : g && !l && r && r(), e.inFlow && !f ? w : `? ${w}`;
1422
+ w = f ? `? ${w}
1423
+ ${d}:` : `${w}:`, this.comment && (w = Fe(w, e.indent, this.comment), n && n());
1424
+ let C = "", L = null;
1425
+ if (c instanceof W) {
1426
+ if (c.spaceBefore && (C = `
1427
+ `), c.commentBefore) {
1428
+ let _ = c.commentBefore.replace(/^/gm, `${e.indent}#`);
1429
+ C += `
1430
+ ${_}`;
1431
+ }
1432
+ L = c.comment;
1433
+ } else c && typeof c == "object" && (c = m.schema.createNode(c, true));
1434
+ e.implicitKey = false, !f && !this.comment && c instanceof P && (e.indentAtStart = w.length + 1), g = false, !i && s >= 2 && !e.inFlow && !f && c instanceof pe && c.type !== p.Type.FLOW_SEQ && !c.tag && !m.anchors.getName(c) && (e.indent = e.indent.substr(2));
1435
+ let M = h(c, e, () => L = null, () => g = true), A = " ";
1436
+ return C || this.comment ? A = `${C}
1437
+ ${e.indent}` : !f && c instanceof j ? (!(M[0] === "[" || M[0] === "{") || M.includes(`
1438
+ `)) && (A = `
1439
+ ${e.indent}`) : M[0] === `
1440
+ ` && (A = ""), g && !L && r && r(), Fe(w + A + M, e.indent, L);
1441
+ }
1442
+ };
1443
+ p._defineProperty(T, "Type", { PAIR: "PAIR", MERGE_PAIR: "MERGE_PAIR" });
1444
+ var Ft = (t, e) => {
1445
+ if (t instanceof be) {
1446
+ let n = e.get(t.source);
1447
+ return n.count * n.aliasCount;
1448
+ } else if (t instanceof j) {
1449
+ let n = 0;
1450
+ for (let r of t.items) {
1451
+ let s = Ft(r, e);
1452
+ s > n && (n = s);
1453
+ }
1454
+ return n;
1455
+ } else if (t instanceof T) {
1456
+ let n = Ft(t.key, e), r = Ft(t.value, e);
1457
+ return Math.max(n, r);
1458
+ }
1459
+ return 1;
1460
+ }, be = class t extends W {
1461
+ static stringify({ range: e, source: n }, { anchors: r, doc: s, implicitKey: i, inStringifyKey: o }) {
1462
+ let a = Object.keys(r).find((l) => r[l] === n);
1463
+ if (!a && o && (a = s.anchors.getName(n) || s.anchors.newName()), a) return `*${a}${i ? " " : ""}`;
1464
+ let c = s.anchors.getName(n) ? "Alias node must be after source node" : "Source node not found for alias node";
1465
+ throw new Error(`${c} [${e}]`);
1466
+ }
1467
+ constructor(e) {
1468
+ super(), this.source = e, this.type = p.Type.ALIAS;
1469
+ }
1470
+ set tag(e) {
1471
+ throw new Error("Alias nodes cannot have tags");
1472
+ }
1473
+ toJSON(e, n) {
1474
+ if (!n) return ue(this.source, e, n);
1475
+ let { anchors: r, maxAliasCount: s } = n, i = r.get(this.source);
1476
+ if (!i || i.res === void 0) {
1477
+ let o = "This should not happen: Alias anchor was not resolved?";
1478
+ throw this.cstNode ? new p.YAMLReferenceError(this.cstNode, o) : new ReferenceError(o);
1479
+ }
1480
+ if (s >= 0 && (i.count += 1, i.aliasCount === 0 && (i.aliasCount = Ft(this.source, r)), i.count * i.aliasCount > s)) {
1481
+ let o = "Excessive alias count indicates a resource exhaustion attack";
1482
+ throw this.cstNode ? new p.YAMLReferenceError(this.cstNode, o) : new ReferenceError(o);
1483
+ }
1484
+ return i.res;
1485
+ }
1486
+ toString(e) {
1487
+ return t.stringify(this, e);
1488
+ }
1489
+ };
1490
+ p._defineProperty(be, "default", true);
1491
+ function pt(t, e) {
1492
+ let n = e instanceof P ? e.value : e;
1493
+ for (let r of t) if (r instanceof T && (r.key === e || r.key === n || r.key && r.key.value === n)) return r;
1494
+ }
1495
+ var mt = class extends j {
1496
+ add(e, n) {
1497
+ e ? e instanceof T || (e = new T(e.key || e, e.value)) : e = new T(e);
1498
+ let r = pt(this.items, e.key), s = this.schema && this.schema.sortMapEntries;
1499
+ if (r) if (n) r.value = e.value;
1500
+ else throw new Error(`Key ${e.key} already set`);
1501
+ else if (s) {
1502
+ let i = this.items.findIndex((o) => s(e, o) < 0);
1503
+ i === -1 ? this.items.push(e) : this.items.splice(i, 0, e);
1504
+ } else this.items.push(e);
1505
+ }
1506
+ delete(e) {
1507
+ let n = pt(this.items, e);
1508
+ return n ? this.items.splice(this.items.indexOf(n), 1).length > 0 : false;
1509
+ }
1510
+ get(e, n) {
1511
+ let r = pt(this.items, e), s = r && r.value;
1512
+ return !n && s instanceof P ? s.value : s;
1513
+ }
1514
+ has(e) {
1515
+ return !!pt(this.items, e);
1516
+ }
1517
+ set(e, n) {
1518
+ this.add(new T(e, n), true);
1519
+ }
1520
+ toJSON(e, n, r) {
1521
+ let s = r ? new r() : n && n.mapAsMap ? /* @__PURE__ */ new Map() : {};
1522
+ n && n.onCreate && n.onCreate(s);
1523
+ for (let i of this.items) i.addToJSMap(n, s);
1524
+ return s;
1525
+ }
1526
+ toString(e, n, r) {
1527
+ if (!e) return JSON.stringify(this);
1528
+ for (let s of this.items) if (!(s instanceof T)) throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);
1529
+ return super.toString(e, { blockItem: (s) => s.str, flowChars: { start: "{", end: "}" }, isMap: true, itemIndent: e.indent || "" }, n, r);
1530
+ }
1531
+ }, Fs = "<<", Kt = class extends T {
1532
+ constructor(e) {
1533
+ if (e instanceof T) {
1534
+ let n = e.value;
1535
+ n instanceof pe || (n = new pe(), n.items.push(e.value), n.range = e.value.range), super(e.key, n), this.range = e.range;
1536
+ } else super(new P(Fs), new pe());
1537
+ this.type = T.Type.MERGE_PAIR;
1538
+ }
1539
+ addToJSMap(e, n) {
1540
+ for (let { source: r } of this.value.items) {
1541
+ if (!(r instanceof mt)) throw new Error("Merge sources must be maps");
1542
+ let s = r.toJSON(null, e, Map);
1543
+ for (let [i, o] of s) n instanceof Map ? n.has(i) || n.set(i, o) : n instanceof Set ? n.add(i) : Object.prototype.hasOwnProperty.call(n, i) || Object.defineProperty(n, i, { value: o, writable: true, enumerable: true, configurable: true });
1544
+ }
1545
+ return n;
1546
+ }
1547
+ toString(e, n) {
1548
+ let r = this.value;
1549
+ if (r.items.length > 1) return super.toString(e, n);
1550
+ this.value = r.items[0];
1551
+ let s = super.toString(e, n);
1552
+ return this.value = r, s;
1553
+ }
1554
+ }, xo = { defaultType: p.Type.BLOCK_LITERAL, lineWidth: 76 }, Ro = { trueStr: "true", falseStr: "false" }, Do = { asBigInt: false }, Yo = { nullStr: "null" }, Ne = { defaultType: p.Type.PLAIN, doubleQuoted: { jsonEncoding: false, minMultiLineLength: 40 }, fold: { lineWidth: 80, minContentWidth: 20 } };
1555
+ function qn(t, e, n) {
1556
+ for (let { format: r, test: s, resolve: i } of e) if (s) {
1557
+ let o = t.match(s);
1558
+ if (o) {
1559
+ let a = i.apply(null, o);
1560
+ return a instanceof P || (a = new P(a)), r && (a.format = r), a;
1561
+ }
1562
+ }
1563
+ return n && (t = n(t)), new P(t);
1564
+ }
1565
+ var qs = "flow", Fn = "block", qt = "quoted", Ys = (t, e) => {
1566
+ let n = t[e + 1];
1567
+ for (; n === " " || n === " "; ) {
1568
+ do
1569
+ n = t[e += 1];
1570
+ while (n && n !== `
1571
+ `);
1572
+ n = t[e + 1];
1573
+ }
1574
+ return e;
1575
+ };
1576
+ function Vt(t, e, n, { indentAtStart: r, lineWidth: s = 80, minContentWidth: i = 20, onFold: o, onOverflow: a }) {
1577
+ if (!s || s < 0) return t;
1578
+ let c = Math.max(1 + i, 1 + s - e.length);
1579
+ if (t.length <= c) return t;
1580
+ let l = [], f = {}, m = s - e.length;
1581
+ typeof r == "number" && (r > s - Math.max(2, i) ? l.push(0) : m = s - r);
1582
+ let d, y, h = false, g = -1, w = -1, C = -1;
1583
+ n === Fn && (g = Ys(t, g), g !== -1 && (m = g + c));
1584
+ for (let M; M = t[g += 1]; ) {
1585
+ if (n === qt && M === "\\") {
1586
+ switch (w = g, t[g + 1]) {
1587
+ case "x":
1588
+ g += 3;
1589
+ break;
1590
+ case "u":
1591
+ g += 5;
1592
+ break;
1593
+ case "U":
1594
+ g += 9;
1595
+ break;
1596
+ default:
1597
+ g += 1;
1598
+ }
1599
+ C = g;
1600
+ }
1601
+ if (M === `
1602
+ `) n === Fn && (g = Ys(t, g)), m = g + c, d = void 0;
1603
+ else {
1604
+ if (M === " " && y && y !== " " && y !== `
1605
+ ` && y !== " ") {
1606
+ let A = t[g + 1];
1607
+ A && A !== " " && A !== `
1608
+ ` && A !== " " && (d = g);
1609
+ }
1610
+ if (g >= m) if (d) l.push(d), m = d + c, d = void 0;
1611
+ else if (n === qt) {
1612
+ for (; y === " " || y === " "; ) y = M, M = t[g += 1], h = true;
1613
+ let A = g > C + 1 ? g - 2 : w - 1;
1614
+ if (f[A]) return t;
1615
+ l.push(A), f[A] = true, m = A + c, d = void 0;
1616
+ } else h = true;
1617
+ }
1618
+ y = M;
1619
+ }
1620
+ if (h && a && a(), l.length === 0) return t;
1621
+ o && o();
1622
+ let L = t.slice(0, l[0]);
1623
+ for (let M = 0; M < l.length; ++M) {
1624
+ let A = l[M], _ = l[M + 1] || t.length;
1625
+ A === 0 ? L = `
1626
+ ${e}${t.slice(0, _)}` : (n === qt && f[A] && (L += `${t[A]}\\`), L += `
1627
+ ${e}${t.slice(A + 1, _)}`);
1628
+ }
1629
+ return L;
1630
+ }
1631
+ var Un = ({ indentAtStart: t }) => t ? Object.assign({ indentAtStart: t }, Ne.fold) : Ne.fold, Wt = (t) => /^(%|---|\.\.\.)/m.test(t);
1632
+ function $o(t, e, n) {
1633
+ if (!e || e < 0) return false;
1634
+ let r = e - n, s = t.length;
1635
+ if (s <= r) return false;
1636
+ for (let i = 0, o = 0; i < s; ++i) if (t[i] === `
1637
+ `) {
1638
+ if (i - o > r) return true;
1639
+ if (o = i + 1, s - o <= r) return false;
1640
+ }
1641
+ return true;
1642
+ }
1643
+ function we(t, e) {
1644
+ let { implicitKey: n } = e, { jsonEncoding: r, minMultiLineLength: s } = Ne.doubleQuoted, i = JSON.stringify(t);
1645
+ if (r) return i;
1646
+ let o = e.indent || (Wt(t) ? " " : ""), a = "", c = 0;
1647
+ for (let l = 0, f = i[l]; f; f = i[++l]) if (f === " " && i[l + 1] === "\\" && i[l + 2] === "n" && (a += i.slice(c, l) + "\\ ", l += 1, c = l, f = "\\"), f === "\\") switch (i[l + 1]) {
1648
+ case "u":
1649
+ {
1650
+ a += i.slice(c, l);
1651
+ let m = i.substr(l + 2, 4);
1652
+ switch (m) {
1653
+ case "0000":
1654
+ a += "\\0";
1655
+ break;
1656
+ case "0007":
1657
+ a += "\\a";
1658
+ break;
1659
+ case "000b":
1660
+ a += "\\v";
1661
+ break;
1662
+ case "001b":
1663
+ a += "\\e";
1664
+ break;
1665
+ case "0085":
1666
+ a += "\\N";
1667
+ break;
1668
+ case "00a0":
1669
+ a += "\\_";
1670
+ break;
1671
+ case "2028":
1672
+ a += "\\L";
1673
+ break;
1674
+ case "2029":
1675
+ a += "\\P";
1676
+ break;
1677
+ default:
1678
+ m.substr(0, 2) === "00" ? a += "\\x" + m.substr(2) : a += i.substr(l, 6);
1679
+ }
1680
+ l += 5, c = l + 1;
1681
+ }
1682
+ break;
1683
+ case "n":
1684
+ if (n || i[l + 2] === '"' || i.length < s) l += 1;
1685
+ else {
1686
+ for (a += i.slice(c, l) + `
1687
+
1688
+ `; i[l + 2] === "\\" && i[l + 3] === "n" && i[l + 4] !== '"'; ) a += `
1689
+ `, l += 2;
1690
+ a += o, i[l + 2] === " " && (a += "\\"), l += 1, c = l + 1;
1691
+ }
1692
+ break;
1693
+ default:
1694
+ l += 1;
1695
+ }
1696
+ return a = c ? a + i.slice(c) : i, n ? a : Vt(a, o, qt, Un(e));
1697
+ }
1698
+ function Us(t, e) {
1699
+ if (e.implicitKey) {
1700
+ if (/\n/.test(t)) return we(t, e);
1701
+ } else if (/[ \t]\n|\n[ \t]/.test(t)) return we(t, e);
1702
+ let n = e.indent || (Wt(t) ? " " : ""), r = "'" + t.replace(/'/g, "''").replace(/\n+/g, `$&
1703
+ ${n}`) + "'";
1704
+ return e.implicitKey ? r : Vt(r, n, qs, Un(e));
1705
+ }
1706
+ function Ut({ comment: t, type: e, value: n }, r, s, i) {
1707
+ if (/\n[\t ]+$/.test(n) || /^\s*$/.test(n)) return we(n, r);
1708
+ let o = r.indent || (r.forceBlockIndent || Wt(n) ? " " : ""), a = o ? "2" : "1", c = e === p.Type.BLOCK_FOLDED ? false : e === p.Type.BLOCK_LITERAL ? true : !$o(n, Ne.fold.lineWidth, o.length), l = c ? "|" : ">";
1709
+ if (!n) return l + `
1710
+ `;
1711
+ let f = "", m = "";
1712
+ if (n = n.replace(/[\n\t ]*$/, (y) => {
1713
+ let h = y.indexOf(`
1714
+ `);
1715
+ return h === -1 ? l += "-" : (n === y || h !== y.length - 1) && (l += "+", i && i()), m = y.replace(/\n$/, ""), "";
1716
+ }).replace(/^[\n ]*/, (y) => {
1717
+ y.indexOf(" ") !== -1 && (l += a);
1718
+ let h = y.match(/ +$/);
1719
+ return h ? (f = y.slice(0, -h[0].length), h[0]) : (f = y, "");
1720
+ }), m && (m = m.replace(/\n+(?!\n|$)/g, `$&${o}`)), f && (f = f.replace(/\n+/g, `$&${o}`)), t && (l += " #" + t.replace(/ ?[\r\n]+/g, " "), s && s()), !n) return `${l}${a}
1721
+ ${o}${m}`;
1722
+ if (c) return n = n.replace(/\n+/g, `$&${o}`), `${l}
1723
+ ${o}${f}${n}${m}`;
1724
+ n = n.replace(/\n+/g, `
1725
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${o}`);
1726
+ let d = Vt(`${f}${n}${m}`, o, Fn, Ne.fold);
1727
+ return `${l}
1728
+ ${o}${d}`;
1729
+ }
1730
+ function Bo(t, e, n, r) {
1731
+ let { comment: s, type: i, value: o } = t, { actualString: a, implicitKey: c, indent: l, inFlow: f } = e;
1732
+ if (c && /[\n[\]{},]/.test(o) || f && /[[\]{},]/.test(o)) return we(o, e);
1733
+ if (!o || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o)) return c || f || o.indexOf(`
1734
+ `) === -1 ? o.indexOf('"') !== -1 && o.indexOf("'") === -1 ? Us(o, e) : we(o, e) : Ut(t, e, n, r);
1735
+ if (!c && !f && i !== p.Type.PLAIN && o.indexOf(`
1736
+ `) !== -1) return Ut(t, e, n, r);
1737
+ if (l === "" && Wt(o)) return e.forceBlockIndent = true, Ut(t, e, n, r);
1738
+ let m = o.replace(/\n+/g, `$&
1739
+ ${l}`);
1740
+ if (a) {
1741
+ let { tags: y } = e.doc.schema;
1742
+ if (typeof qn(m, y, y.scalarFallback).value != "string") return we(o, e);
1743
+ }
1744
+ let d = c ? m : Vt(m, l, qs, Un(e));
1745
+ return s && !f && (d.indexOf(`
1746
+ `) !== -1 || s.indexOf(`
1747
+ `) !== -1) ? (n && n(), Po(d, l, s)) : d;
1748
+ }
1749
+ function Fo(t, e, n, r) {
1750
+ let { defaultType: s } = Ne, { implicitKey: i, inFlow: o } = e, { type: a, value: c } = t;
1751
+ typeof c != "string" && (c = String(c), t = Object.assign({}, t, { value: c }));
1752
+ let l = (m) => {
1753
+ switch (m) {
1754
+ case p.Type.BLOCK_FOLDED:
1755
+ case p.Type.BLOCK_LITERAL:
1756
+ return Ut(t, e, n, r);
1757
+ case p.Type.QUOTE_DOUBLE:
1758
+ return we(c, e);
1759
+ case p.Type.QUOTE_SINGLE:
1760
+ return Us(c, e);
1761
+ case p.Type.PLAIN:
1762
+ return Bo(t, e, n, r);
1763
+ default:
1764
+ return null;
1765
+ }
1766
+ };
1767
+ (a !== p.Type.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(c) || (i || o) && (a === p.Type.BLOCK_FOLDED || a === p.Type.BLOCK_LITERAL)) && (a = p.Type.QUOTE_DOUBLE);
1768
+ let f = l(a);
1769
+ if (f === null && (f = l(s), f === null)) throw new Error(`Unsupported default string type ${s}`);
1770
+ return f;
1771
+ }
1772
+ function qo({ format: t, minFractionDigits: e, tag: n, value: r }) {
1773
+ if (typeof r == "bigint") return String(r);
1774
+ if (!isFinite(r)) return isNaN(r) ? ".nan" : r < 0 ? "-.inf" : ".inf";
1775
+ let s = JSON.stringify(r);
1776
+ if (!t && e && (!n || n === "tag:yaml.org,2002:float") && /^\d/.test(s)) {
1777
+ let i = s.indexOf(".");
1778
+ i < 0 && (i = s.length, s += ".");
1779
+ let o = e - (s.length - i - 1);
1780
+ for (; o-- > 0; ) s += "0";
1781
+ }
1782
+ return s;
1783
+ }
1784
+ function Ks(t, e) {
1785
+ let n, r;
1786
+ switch (e.type) {
1787
+ case p.Type.FLOW_MAP:
1788
+ n = "}", r = "flow map";
1789
+ break;
1790
+ case p.Type.FLOW_SEQ:
1791
+ n = "]", r = "flow sequence";
1792
+ break;
1793
+ default:
1794
+ t.push(new p.YAMLSemanticError(e, "Not a flow collection!?"));
1795
+ return;
1796
+ }
1797
+ let s;
1798
+ for (let i = e.items.length - 1; i >= 0; --i) {
1799
+ let o = e.items[i];
1800
+ if (!o || o.type !== p.Type.COMMENT) {
1801
+ s = o;
1802
+ break;
1803
+ }
1804
+ }
1805
+ if (s && s.char !== n) {
1806
+ let i = `Expected ${r} to end with ${n}`, o;
1807
+ typeof s.offset == "number" ? (o = new p.YAMLSemanticError(e, i), o.offset = s.offset + 1) : (o = new p.YAMLSemanticError(s, i), s.range && s.range.end && (o.offset = s.range.end - s.range.start)), t.push(o);
1808
+ }
1809
+ }
1810
+ function Vs(t, e) {
1811
+ let n = e.context.src[e.range.start - 1];
1812
+ if (n !== `
1813
+ ` && n !== " " && n !== " ") {
1814
+ let r = "Comments must be separated from other tokens by white space characters";
1815
+ t.push(new p.YAMLSemanticError(e, r));
1816
+ }
1817
+ }
1818
+ function Ws(t, e) {
1819
+ let n = String(e), r = n.substr(0, 8) + "..." + n.substr(-8);
1820
+ return new p.YAMLSemanticError(t, `The "${r}" key is too long`);
1821
+ }
1822
+ function js(t, e) {
1823
+ for (let { afterKey: n, before: r, comment: s } of e) {
1824
+ let i = t.items[r];
1825
+ i ? (n && i.value && (i = i.value), s === void 0 ? (n || !i.commentBefore) && (i.spaceBefore = true) : i.commentBefore ? i.commentBefore += `
1826
+ ` + s : i.commentBefore = s) : s !== void 0 && (t.comment ? t.comment += `
1827
+ ` + s : t.comment = s);
1828
+ }
1829
+ }
1830
+ function Kn(t, e) {
1831
+ let n = e.strValue;
1832
+ return n ? typeof n == "string" ? n : (n.errors.forEach((r) => {
1833
+ r.source || (r.source = e), t.errors.push(r);
1834
+ }), n.str) : "";
1835
+ }
1836
+ function Uo(t, e) {
1837
+ let { handle: n, suffix: r } = e.tag, s = t.tagPrefixes.find((i) => i.handle === n);
1838
+ if (!s) {
1839
+ let i = t.getDefaults().tagPrefixes;
1840
+ if (i && (s = i.find((o) => o.handle === n)), !s) throw new p.YAMLSemanticError(e, `The ${n} tag handle is non-default and was not declared.`);
1841
+ }
1842
+ if (!r) throw new p.YAMLSemanticError(e, `The ${n} tag has no suffix.`);
1843
+ if (n === "!" && (t.version || t.options.version) === "1.0") {
1844
+ if (r[0] === "^") return t.warnings.push(new p.YAMLWarning(e, "YAML 1.0 ^ tag expansion is not supported")), r;
1845
+ if (/[:/]/.test(r)) {
1846
+ let i = r.match(/^([a-z0-9-]+)\/(.*)/i);
1847
+ return i ? `tag:${i[1]}.yaml.org,2002:${i[2]}` : `tag:${r}`;
1848
+ }
1849
+ }
1850
+ return s.prefix + decodeURIComponent(r);
1851
+ }
1852
+ function Ko(t, e) {
1853
+ let { tag: n, type: r } = e, s = false;
1854
+ if (n) {
1855
+ let { handle: i, suffix: o, verbatim: a } = n;
1856
+ if (a) {
1857
+ if (a !== "!" && a !== "!!") return a;
1858
+ let c = `Verbatim tags aren't resolved, so ${a} is invalid.`;
1859
+ t.errors.push(new p.YAMLSemanticError(e, c));
1860
+ } else if (i === "!" && !o) s = true;
1861
+ else try {
1862
+ return Uo(t, e);
1863
+ } catch (c) {
1864
+ t.errors.push(c);
1865
+ }
1866
+ }
1867
+ switch (r) {
1868
+ case p.Type.BLOCK_FOLDED:
1869
+ case p.Type.BLOCK_LITERAL:
1870
+ case p.Type.QUOTE_DOUBLE:
1871
+ case p.Type.QUOTE_SINGLE:
1872
+ return p.defaultTags.STR;
1873
+ case p.Type.FLOW_MAP:
1874
+ case p.Type.MAP:
1875
+ return p.defaultTags.MAP;
1876
+ case p.Type.FLOW_SEQ:
1877
+ case p.Type.SEQ:
1878
+ return p.defaultTags.SEQ;
1879
+ case p.Type.PLAIN:
1880
+ return s ? p.defaultTags.STR : null;
1881
+ default:
1882
+ return null;
1883
+ }
1884
+ }
1885
+ function $s(t, e, n) {
1886
+ let { tags: r } = t.schema, s = [];
1887
+ for (let o of r) if (o.tag === n) if (o.test) s.push(o);
1888
+ else {
1889
+ let a = o.resolve(t, e);
1890
+ return a instanceof j ? a : new P(a);
1891
+ }
1892
+ let i = Kn(t, e);
1893
+ return typeof i == "string" && s.length > 0 ? qn(i, s, r.scalarFallback) : null;
1894
+ }
1895
+ function Vo({ type: t }) {
1896
+ switch (t) {
1897
+ case p.Type.FLOW_MAP:
1898
+ case p.Type.MAP:
1899
+ return p.defaultTags.MAP;
1900
+ case p.Type.FLOW_SEQ:
1901
+ case p.Type.SEQ:
1902
+ return p.defaultTags.SEQ;
1903
+ default:
1904
+ return p.defaultTags.STR;
1905
+ }
1906
+ }
1907
+ function Wo(t, e, n) {
1908
+ try {
1909
+ let r = $s(t, e, n);
1910
+ if (r) return n && e.tag && (r.tag = n), r;
1911
+ } catch (r) {
1912
+ return r.source || (r.source = e), t.errors.push(r), null;
1913
+ }
1914
+ try {
1915
+ let r = Vo(e);
1916
+ if (!r) throw new Error(`The tag ${n} is unavailable`);
1917
+ let s = `The tag ${n} is unavailable, falling back to ${r}`;
1918
+ t.warnings.push(new p.YAMLWarning(e, s));
1919
+ let i = $s(t, e, r);
1920
+ return i.tag = n, i;
1921
+ } catch (r) {
1922
+ let s = new p.YAMLReferenceError(e, r.message);
1923
+ return s.stack = r.stack, t.errors.push(s), null;
1924
+ }
1925
+ }
1926
+ var jo = (t) => {
1927
+ if (!t) return false;
1928
+ let { type: e } = t;
1929
+ return e === p.Type.MAP_KEY || e === p.Type.MAP_VALUE || e === p.Type.SEQ_ITEM;
1930
+ };
1931
+ function Qo(t, e) {
1932
+ let n = { before: [], after: [] }, r = false, s = false, i = jo(e.context.parent) ? e.context.parent.props.concat(e.props) : e.props;
1933
+ for (let { start: o, end: a } of i) switch (e.context.src[o]) {
1934
+ case p.Char.COMMENT: {
1935
+ if (!e.commentHasRequiredWhitespace(o)) {
1936
+ let m = "Comments must be separated from other tokens by white space characters";
1937
+ t.push(new p.YAMLSemanticError(e, m));
1938
+ }
1939
+ let { header: c, valueRange: l } = e;
1940
+ (l && (o > l.start || c && o > c.start) ? n.after : n.before).push(e.context.src.slice(o + 1, a));
1941
+ break;
1942
+ }
1943
+ case p.Char.ANCHOR:
1944
+ if (r) {
1945
+ let c = "A node can have at most one anchor";
1946
+ t.push(new p.YAMLSemanticError(e, c));
1947
+ }
1948
+ r = true;
1949
+ break;
1950
+ case p.Char.TAG:
1951
+ if (s) {
1952
+ let c = "A node can have at most one tag";
1953
+ t.push(new p.YAMLSemanticError(e, c));
1954
+ }
1955
+ s = true;
1956
+ break;
1957
+ }
1958
+ return { comments: n, hasAnchor: r, hasTag: s };
1959
+ }
1960
+ function Jo(t, e) {
1961
+ let { anchors: n, errors: r, schema: s } = t;
1962
+ if (e.type === p.Type.ALIAS) {
1963
+ let o = e.rawValue, a = n.getNode(o);
1964
+ if (!a) {
1965
+ let l = `Aliased anchor not found: ${o}`;
1966
+ return r.push(new p.YAMLReferenceError(e, l)), null;
1967
+ }
1968
+ let c = new be(a);
1969
+ return n._cstAliases.push(c), c;
1970
+ }
1971
+ let i = Ko(t, e);
1972
+ if (i) return Wo(t, e, i);
1973
+ if (e.type !== p.Type.PLAIN) {
1974
+ let o = `Failed to resolve ${e.type} node here`;
1975
+ return r.push(new p.YAMLSyntaxError(e, o)), null;
1976
+ }
1977
+ try {
1978
+ let o = Kn(t, e);
1979
+ return qn(o, s.tags, s.tags.scalarFallback);
1980
+ } catch (o) {
1981
+ return o.source || (o.source = e), r.push(o), null;
1982
+ }
1983
+ }
1984
+ function me(t, e) {
1985
+ if (!e) return null;
1986
+ e.error && t.errors.push(e.error);
1987
+ let { comments: n, hasAnchor: r, hasTag: s } = Qo(t.errors, e);
1988
+ if (r) {
1989
+ let { anchors: o } = t, a = e.anchor, c = o.getNode(a);
1990
+ c && (o.map[o.newName(a)] = c), o.map[a] = e;
1991
+ }
1992
+ if (e.type === p.Type.ALIAS && (r || s)) {
1993
+ let o = "An alias node must not specify any properties";
1994
+ t.errors.push(new p.YAMLSemanticError(e, o));
1995
+ }
1996
+ let i = Jo(t, e);
1997
+ if (i) {
1998
+ i.range = [e.range.start, e.range.end], t.options.keepCstNodes && (i.cstNode = e), t.options.keepNodeTypes && (i.type = e.type);
1999
+ let o = n.before.join(`
2000
+ `);
2001
+ o && (i.commentBefore = i.commentBefore ? `${i.commentBefore}
2002
+ ${o}` : o);
2003
+ let a = n.after.join(`
2004
+ `);
2005
+ a && (i.comment = i.comment ? `${i.comment}
2006
+ ${a}` : a);
2007
+ }
2008
+ return e.resolved = i;
2009
+ }
2010
+ function Go(t, e) {
2011
+ if (e.type !== p.Type.MAP && e.type !== p.Type.FLOW_MAP) {
2012
+ let o = `A ${e.type} node cannot be resolved as a mapping`;
2013
+ return t.errors.push(new p.YAMLSyntaxError(e, o)), null;
2014
+ }
2015
+ let { comments: n, items: r } = e.type === p.Type.FLOW_MAP ? Zo(t, e) : zo(t, e), s = new mt();
2016
+ s.items = r, js(s, n);
2017
+ let i = false;
2018
+ for (let o = 0; o < r.length; ++o) {
2019
+ let { key: a } = r[o];
2020
+ if (a instanceof j && (i = true), t.schema.merge && a && a.value === Fs) {
2021
+ r[o] = new Kt(r[o]);
2022
+ let c = r[o].value.items, l = null;
2023
+ c.some((f) => {
2024
+ if (f instanceof be) {
2025
+ let { type: m } = f.source;
2026
+ return m === p.Type.MAP || m === p.Type.FLOW_MAP ? false : l = "Merge nodes aliases can only point to maps";
2027
+ }
2028
+ return l = "Merge nodes can only have Alias nodes as values";
2029
+ }), l && t.errors.push(new p.YAMLSemanticError(e, l));
2030
+ } else for (let c = o + 1; c < r.length; ++c) {
2031
+ let { key: l } = r[c];
2032
+ if (a === l || a && l && Object.prototype.hasOwnProperty.call(a, "value") && a.value === l.value) {
2033
+ let f = `Map keys must be unique; "${a}" is repeated`;
2034
+ t.errors.push(new p.YAMLSemanticError(e, f));
2035
+ break;
2036
+ }
2037
+ }
2038
+ }
2039
+ if (i && !t.options.mapAsMap) {
2040
+ let o = "Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";
2041
+ t.warnings.push(new p.YAMLWarning(e, o));
2042
+ }
2043
+ return e.resolved = s, s;
2044
+ }
2045
+ var Ho = ({ context: { lineStart: t, node: e, src: n }, props: r }) => {
2046
+ if (r.length === 0) return false;
2047
+ let { start: s } = r[0];
2048
+ if (e && s > e.valueRange.start || n[s] !== p.Char.COMMENT) return false;
2049
+ for (let i = t; i < s; ++i) if (n[i] === `
2050
+ `) return false;
2051
+ return true;
2052
+ };
2053
+ function Xo(t, e) {
2054
+ if (!Ho(t)) return;
2055
+ let n = t.getPropValue(0, p.Char.COMMENT, true), r = false, s = e.value.commentBefore;
2056
+ if (s && s.startsWith(n)) e.value.commentBefore = s.substr(n.length + 1), r = true;
2057
+ else {
2058
+ let i = e.value.comment;
2059
+ !t.node && i && i.startsWith(n) && (e.value.comment = i.substr(n.length + 1), r = true);
2060
+ }
2061
+ r && (e.comment = n);
2062
+ }
2063
+ function zo(t, e) {
2064
+ let n = [], r = [], s, i = null;
2065
+ for (let o = 0; o < e.items.length; ++o) {
2066
+ let a = e.items[o];
2067
+ switch (a.type) {
2068
+ case p.Type.BLANK_LINE:
2069
+ n.push({ afterKey: !!s, before: r.length });
2070
+ break;
2071
+ case p.Type.COMMENT:
2072
+ n.push({ afterKey: !!s, before: r.length, comment: a.comment });
2073
+ break;
2074
+ case p.Type.MAP_KEY:
2075
+ s !== void 0 && r.push(new T(s)), a.error && t.errors.push(a.error), s = me(t, a.node), i = null;
2076
+ break;
2077
+ case p.Type.MAP_VALUE:
2078
+ {
2079
+ if (s === void 0 && (s = null), a.error && t.errors.push(a.error), !a.context.atLineStart && a.node && a.node.type === p.Type.MAP && !a.node.context.atLineStart) {
2080
+ let f = "Nested mappings are not allowed in compact mappings";
2081
+ t.errors.push(new p.YAMLSemanticError(a.node, f));
2082
+ }
2083
+ let c = a.node;
2084
+ if (!c && a.props.length > 0) {
2085
+ c = new p.PlainValue(p.Type.PLAIN, []), c.context = { parent: a, src: a.context.src };
2086
+ let f = a.range.start + 1;
2087
+ if (c.range = { start: f, end: f }, c.valueRange = { start: f, end: f }, typeof a.range.origStart == "number") {
2088
+ let m = a.range.origStart + 1;
2089
+ c.range.origStart = c.range.origEnd = m, c.valueRange.origStart = c.valueRange.origEnd = m;
2090
+ }
2091
+ }
2092
+ let l = new T(s, me(t, c));
2093
+ Xo(a, l), r.push(l), s && typeof i == "number" && a.range.start > i + 1024 && t.errors.push(Ws(e, s)), s = void 0, i = null;
2094
+ }
2095
+ break;
2096
+ default:
2097
+ s !== void 0 && r.push(new T(s)), s = me(t, a), i = a.range.start, a.error && t.errors.push(a.error);
2098
+ e: for (let c = o + 1; ; ++c) {
2099
+ let l = e.items[c];
2100
+ switch (l && l.type) {
2101
+ case p.Type.BLANK_LINE:
2102
+ case p.Type.COMMENT:
2103
+ continue e;
2104
+ case p.Type.MAP_VALUE:
2105
+ break e;
2106
+ default: {
2107
+ let f = "Implicit map keys need to be followed by map values";
2108
+ t.errors.push(new p.YAMLSemanticError(a, f));
2109
+ break e;
2110
+ }
2111
+ }
2112
+ }
2113
+ if (a.valueRangeContainsNewline) {
2114
+ let c = "Implicit map keys need to be on a single line";
2115
+ t.errors.push(new p.YAMLSemanticError(a, c));
2116
+ }
2117
+ }
2118
+ }
2119
+ return s !== void 0 && r.push(new T(s)), { comments: n, items: r };
2120
+ }
2121
+ function Zo(t, e) {
2122
+ let n = [], r = [], s, i = false, o = "{";
2123
+ for (let a = 0; a < e.items.length; ++a) {
2124
+ let c = e.items[a];
2125
+ if (typeof c.char == "string") {
2126
+ let { char: l, offset: f } = c;
2127
+ if (l === "?" && s === void 0 && !i) {
2128
+ i = true, o = ":";
2129
+ continue;
2130
+ }
2131
+ if (l === ":") {
2132
+ if (s === void 0 && (s = null), o === ":") {
2133
+ o = ",";
2134
+ continue;
2135
+ }
2136
+ } else if (i && (s === void 0 && l !== "," && (s = null), i = false), s !== void 0 && (r.push(new T(s)), s = void 0, l === ",")) {
2137
+ o = ":";
2138
+ continue;
2139
+ }
2140
+ if (l === "}") {
2141
+ if (a === e.items.length - 1) continue;
2142
+ } else if (l === o) {
2143
+ o = ":";
2144
+ continue;
2145
+ }
2146
+ let m = `Flow map contains an unexpected ${l}`, d = new p.YAMLSyntaxError(e, m);
2147
+ d.offset = f, t.errors.push(d);
2148
+ } else c.type === p.Type.BLANK_LINE ? n.push({ afterKey: !!s, before: r.length }) : c.type === p.Type.COMMENT ? (Vs(t.errors, c), n.push({ afterKey: !!s, before: r.length, comment: c.comment })) : s === void 0 ? (o === "," && t.errors.push(new p.YAMLSemanticError(c, "Separator , missing in flow map")), s = me(t, c)) : (o !== "," && t.errors.push(new p.YAMLSemanticError(c, "Indicator : missing in flow map entry")), r.push(new T(s, me(t, c))), s = void 0, i = false);
2149
+ }
2150
+ return Ks(t.errors, e), s !== void 0 && r.push(new T(s)), { comments: n, items: r };
2151
+ }
2152
+ function ea(t, e) {
2153
+ if (e.type !== p.Type.SEQ && e.type !== p.Type.FLOW_SEQ) {
2154
+ let i = `A ${e.type} node cannot be resolved as a sequence`;
2155
+ return t.errors.push(new p.YAMLSyntaxError(e, i)), null;
2156
+ }
2157
+ let { comments: n, items: r } = e.type === p.Type.FLOW_SEQ ? na(t, e) : ta(t, e), s = new pe();
2158
+ if (s.items = r, js(s, n), !t.options.mapAsMap && r.some((i) => i instanceof T && i.key instanceof j)) {
2159
+ let i = "Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";
2160
+ t.warnings.push(new p.YAMLWarning(e, i));
2161
+ }
2162
+ return e.resolved = s, s;
2163
+ }
2164
+ function ta(t, e) {
2165
+ let n = [], r = [];
2166
+ for (let s = 0; s < e.items.length; ++s) {
2167
+ let i = e.items[s];
2168
+ switch (i.type) {
2169
+ case p.Type.BLANK_LINE:
2170
+ n.push({ before: r.length });
2171
+ break;
2172
+ case p.Type.COMMENT:
2173
+ n.push({ comment: i.comment, before: r.length });
2174
+ break;
2175
+ case p.Type.SEQ_ITEM:
2176
+ if (i.error && t.errors.push(i.error), r.push(me(t, i.node)), i.hasProps) {
2177
+ let o = "Sequence items cannot have tags or anchors before the - indicator";
2178
+ t.errors.push(new p.YAMLSemanticError(i, o));
2179
+ }
2180
+ break;
2181
+ default:
2182
+ i.error && t.errors.push(i.error), t.errors.push(new p.YAMLSyntaxError(i, `Unexpected ${i.type} node in sequence`));
2183
+ }
2184
+ }
2185
+ return { comments: n, items: r };
2186
+ }
2187
+ function na(t, e) {
2188
+ let n = [], r = [], s = false, i, o = null, a = "[", c = null;
2189
+ for (let l = 0; l < e.items.length; ++l) {
2190
+ let f = e.items[l];
2191
+ if (typeof f.char == "string") {
2192
+ let { char: m, offset: d } = f;
2193
+ if (m !== ":" && (s || i !== void 0) && (s && i === void 0 && (i = a ? r.pop() : null), r.push(new T(i)), s = false, i = void 0, o = null), m === a) a = null;
2194
+ else if (!a && m === "?") s = true;
2195
+ else if (a !== "[" && m === ":" && i === void 0) {
2196
+ if (a === ",") {
2197
+ if (i = r.pop(), i instanceof T) {
2198
+ let y = "Chaining flow sequence pairs is invalid", h = new p.YAMLSemanticError(e, y);
2199
+ h.offset = d, t.errors.push(h);
2200
+ }
2201
+ if (!s && typeof o == "number") {
2202
+ let y = f.range ? f.range.start : f.offset;
2203
+ y > o + 1024 && t.errors.push(Ws(e, i));
2204
+ let { src: h } = c.context;
2205
+ for (let g = o; g < y; ++g) if (h[g] === `
2206
+ `) {
2207
+ let w = "Implicit keys of flow sequence pairs need to be on a single line";
2208
+ t.errors.push(new p.YAMLSemanticError(c, w));
2209
+ break;
2210
+ }
2211
+ }
2212
+ } else i = null;
2213
+ o = null, s = false, a = null;
2214
+ } else if (a === "[" || m !== "]" || l < e.items.length - 1) {
2215
+ let y = `Flow sequence contains an unexpected ${m}`, h = new p.YAMLSyntaxError(e, y);
2216
+ h.offset = d, t.errors.push(h);
2217
+ }
2218
+ } else if (f.type === p.Type.BLANK_LINE) n.push({ before: r.length });
2219
+ else if (f.type === p.Type.COMMENT) Vs(t.errors, f), n.push({ comment: f.comment, before: r.length });
2220
+ else {
2221
+ if (a) {
2222
+ let d = `Expected a ${a} in flow sequence`;
2223
+ t.errors.push(new p.YAMLSemanticError(f, d));
2224
+ }
2225
+ let m = me(t, f);
2226
+ i === void 0 ? (r.push(m), c = f) : (r.push(new T(i, m)), i = void 0), o = f.range.start, a = ",";
2227
+ }
2228
+ }
2229
+ return Ks(t.errors, e), i !== void 0 && r.push(new T(i)), { comments: n, items: r };
2230
+ }
2231
+ k.Alias = be;
2232
+ k.Collection = j;
2233
+ k.Merge = Kt;
2234
+ k.Node = W;
2235
+ k.Pair = T;
2236
+ k.Scalar = P;
2237
+ k.YAMLMap = mt;
2238
+ k.YAMLSeq = pe;
2239
+ k.addComment = Fe;
2240
+ k.binaryOptions = xo;
2241
+ k.boolOptions = Ro;
2242
+ k.findPair = pt;
2243
+ k.intOptions = Do;
2244
+ k.isEmptyPath = Bs;
2245
+ k.nullOptions = Yo;
2246
+ k.resolveMap = Go;
2247
+ k.resolveNode = me;
2248
+ k.resolveSeq = ea;
2249
+ k.resolveString = Kn;
2250
+ k.strOptions = Ne;
2251
+ k.stringifyNumber = qo;
2252
+ k.stringifyString = Fo;
2253
+ k.toJSON = ue;
2254
+ });
2255
+ var Qn = te((z) => {
2256
+ var Q = le(), O = qe(), ra = { identify: (t) => t instanceof Uint8Array, default: false, tag: "tag:yaml.org,2002:binary", resolve: (t, e) => {
2257
+ let n = O.resolveString(t, e);
2258
+ if (typeof Buffer == "function") return Buffer.from(n, "base64");
2259
+ if (typeof atob == "function") {
2260
+ let r = atob(n.replace(/[\n\r]/g, "")), s = new Uint8Array(r.length);
2261
+ for (let i = 0; i < r.length; ++i) s[i] = r.charCodeAt(i);
2262
+ return s;
2263
+ } else {
2264
+ let r = "This environment does not support reading binary tags; either Buffer or atob is required";
2265
+ return t.errors.push(new Q.YAMLReferenceError(e, r)), null;
2266
+ }
2267
+ }, options: O.binaryOptions, stringify: ({ comment: t, type: e, value: n }, r, s, i) => {
2268
+ let o;
2269
+ if (typeof Buffer == "function") o = n instanceof Buffer ? n.toString("base64") : Buffer.from(n.buffer).toString("base64");
2270
+ else if (typeof btoa == "function") {
2271
+ let a = "";
2272
+ for (let c = 0; c < n.length; ++c) a += String.fromCharCode(n[c]);
2273
+ o = btoa(a);
2274
+ } else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
2275
+ if (e || (e = O.binaryOptions.defaultType), e === Q.Type.QUOTE_DOUBLE) n = o;
2276
+ else {
2277
+ let { lineWidth: a } = O.binaryOptions, c = Math.ceil(o.length / a), l = new Array(c);
2278
+ for (let f = 0, m = 0; f < c; ++f, m += a) l[f] = o.substr(m, a);
2279
+ n = l.join(e === Q.Type.BLOCK_LITERAL ? `
2280
+ ` : " ");
2281
+ }
2282
+ return O.stringifyString({ comment: t, type: e, value: n }, r, s, i);
2283
+ } };
2284
+ function Js(t, e) {
2285
+ let n = O.resolveSeq(t, e);
2286
+ for (let r = 0; r < n.items.length; ++r) {
2287
+ let s = n.items[r];
2288
+ if (!(s instanceof O.Pair)) {
2289
+ if (s instanceof O.YAMLMap) {
2290
+ if (s.items.length > 1) {
2291
+ let o = "Each pair must have its own sequence indicator";
2292
+ throw new Q.YAMLSemanticError(e, o);
2293
+ }
2294
+ let i = s.items[0] || new O.Pair();
2295
+ s.commentBefore && (i.commentBefore = i.commentBefore ? `${s.commentBefore}
2296
+ ${i.commentBefore}` : s.commentBefore), s.comment && (i.comment = i.comment ? `${s.comment}
2297
+ ${i.comment}` : s.comment), s = i;
2298
+ }
2299
+ n.items[r] = s instanceof O.Pair ? s : new O.Pair(s);
2300
+ }
2301
+ }
2302
+ return n;
2303
+ }
2304
+ function Gs(t, e, n) {
2305
+ let r = new O.YAMLSeq(t);
2306
+ r.tag = "tag:yaml.org,2002:pairs";
2307
+ for (let s of e) {
2308
+ let i, o;
2309
+ if (Array.isArray(s)) if (s.length === 2) i = s[0], o = s[1];
2310
+ else throw new TypeError(`Expected [key, value] tuple: ${s}`);
2311
+ else if (s && s instanceof Object) {
2312
+ let c = Object.keys(s);
2313
+ if (c.length === 1) i = c[0], o = s[i];
2314
+ else throw new TypeError(`Expected { key: value } tuple: ${s}`);
2315
+ } else i = s;
2316
+ let a = t.createPair(i, o, n);
2317
+ r.items.push(a);
2318
+ }
2319
+ return r;
2320
+ }
2321
+ var sa = { default: false, tag: "tag:yaml.org,2002:pairs", resolve: Js, createNode: Gs }, Ue = class t extends O.YAMLSeq {
2322
+ constructor() {
2323
+ super(), Q._defineProperty(this, "add", O.YAMLMap.prototype.add.bind(this)), Q._defineProperty(this, "delete", O.YAMLMap.prototype.delete.bind(this)), Q._defineProperty(this, "get", O.YAMLMap.prototype.get.bind(this)), Q._defineProperty(this, "has", O.YAMLMap.prototype.has.bind(this)), Q._defineProperty(this, "set", O.YAMLMap.prototype.set.bind(this)), this.tag = t.tag;
2324
+ }
2325
+ toJSON(e, n) {
2326
+ let r = /* @__PURE__ */ new Map();
2327
+ n && n.onCreate && n.onCreate(r);
2328
+ for (let s of this.items) {
2329
+ let i, o;
2330
+ if (s instanceof O.Pair ? (i = O.toJSON(s.key, "", n), o = O.toJSON(s.value, i, n)) : i = O.toJSON(s, "", n), r.has(i)) throw new Error("Ordered maps must not include duplicate keys");
2331
+ r.set(i, o);
2332
+ }
2333
+ return r;
2334
+ }
2335
+ };
2336
+ Q._defineProperty(Ue, "tag", "tag:yaml.org,2002:omap");
2337
+ function ia(t, e) {
2338
+ let n = Js(t, e), r = [];
2339
+ for (let { key: s } of n.items) if (s instanceof O.Scalar) if (r.includes(s.value)) {
2340
+ let i = "Ordered maps must not include duplicate keys";
2341
+ throw new Q.YAMLSemanticError(e, i);
2342
+ } else r.push(s.value);
2343
+ return Object.assign(new Ue(), n);
2344
+ }
2345
+ function oa(t, e, n) {
2346
+ let r = Gs(t, e, n), s = new Ue();
2347
+ return s.items = r.items, s;
2348
+ }
2349
+ var aa = { identify: (t) => t instanceof Map, nodeClass: Ue, default: false, tag: "tag:yaml.org,2002:omap", resolve: ia, createNode: oa }, Ke = class t extends O.YAMLMap {
2350
+ constructor() {
2351
+ super(), this.tag = t.tag;
2352
+ }
2353
+ add(e) {
2354
+ let n = e instanceof O.Pair ? e : new O.Pair(e);
2355
+ O.findPair(this.items, n.key) || this.items.push(n);
2356
+ }
2357
+ get(e, n) {
2358
+ let r = O.findPair(this.items, e);
2359
+ return !n && r instanceof O.Pair ? r.key instanceof O.Scalar ? r.key.value : r.key : r;
2360
+ }
2361
+ set(e, n) {
2362
+ if (typeof n != "boolean") throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);
2363
+ let r = O.findPair(this.items, e);
2364
+ r && !n ? this.items.splice(this.items.indexOf(r), 1) : !r && n && this.items.push(new O.Pair(e));
2365
+ }
2366
+ toJSON(e, n) {
2367
+ return super.toJSON(e, n, Set);
2368
+ }
2369
+ toString(e, n, r) {
2370
+ if (!e) return JSON.stringify(this);
2371
+ if (this.hasAllNullValues()) return super.toString(e, n, r);
2372
+ throw new Error("Set items must all have null values");
2373
+ }
2374
+ };
2375
+ Q._defineProperty(Ke, "tag", "tag:yaml.org,2002:set");
2376
+ function ca(t, e) {
2377
+ let n = O.resolveMap(t, e);
2378
+ if (!n.hasAllNullValues()) throw new Q.YAMLSemanticError(e, "Set items must all have null values");
2379
+ return Object.assign(new Ke(), n);
2380
+ }
2381
+ function la(t, e, n) {
2382
+ let r = new Ke();
2383
+ for (let s of e) r.items.push(t.createPair(s, null, n));
2384
+ return r;
2385
+ }
2386
+ var fa = { identify: (t) => t instanceof Set, nodeClass: Ke, default: false, tag: "tag:yaml.org,2002:set", resolve: ca, createNode: la }, Vn = (t, e) => {
2387
+ let n = e.split(":").reduce((r, s) => r * 60 + Number(s), 0);
2388
+ return t === "-" ? -n : n;
2389
+ }, Hs = ({ value: t }) => {
2390
+ if (isNaN(t) || !isFinite(t)) return O.stringifyNumber(t);
2391
+ let e = "";
2392
+ t < 0 && (e = "-", t = Math.abs(t));
2393
+ let n = [t % 60];
2394
+ return t < 60 ? n.unshift(0) : (t = Math.round((t - n[0]) / 60), n.unshift(t % 60), t >= 60 && (t = Math.round((t - n[0]) / 60), n.unshift(t))), e + n.map((r) => r < 10 ? "0" + String(r) : String(r)).join(":").replace(/000000\d*$/, "");
2395
+ }, ua = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:int", format: "TIME", test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/, resolve: (t, e, n) => Vn(e, n.replace(/_/g, "")), stringify: Hs }, pa = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", format: "TIME", test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/, resolve: (t, e, n) => Vn(e, n.replace(/_/g, "")), stringify: Hs }, ma = { identify: (t) => t instanceof Date, default: true, tag: "tag:yaml.org,2002:timestamp", test: RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"), resolve: (t, e, n, r, s, i, o, a, c) => {
2396
+ a && (a = (a + "00").substr(1, 3));
2397
+ let l = Date.UTC(e, n - 1, r, s || 0, i || 0, o || 0, a || 0);
2398
+ if (c && c !== "Z") {
2399
+ let f = Vn(c[0], c.slice(1));
2400
+ Math.abs(f) < 30 && (f *= 60), l -= 6e4 * f;
2401
+ }
2402
+ return new Date(l);
2403
+ }, stringify: ({ value: t }) => t.toISOString().replace(/((T00:00)?:00)?\.000Z$/, "") };
2404
+ function Wn(t) {
2405
+ let e = {};
2406
+ return t ? typeof YAML_SILENCE_DEPRECATION_WARNINGS < "u" ? !YAML_SILENCE_DEPRECATION_WARNINGS : !e.YAML_SILENCE_DEPRECATION_WARNINGS : typeof YAML_SILENCE_WARNINGS < "u" ? !YAML_SILENCE_WARNINGS : !e.YAML_SILENCE_WARNINGS;
2407
+ }
2408
+ function jn(t, e) {
2409
+ Wn(false) && console.warn(e ? `${e}: ${t}` : t);
2410
+ }
2411
+ function ha(t) {
2412
+ if (Wn(true)) {
2413
+ let e = t.replace(/.*yaml[/\\]/i, "").replace(/\.js$/, "").replace(/\\/g, "/");
2414
+ jn(`The endpoint 'yaml/${e}' will be removed in a future release.`, "DeprecationWarning");
2415
+ }
2416
+ }
2417
+ var Qs = {};
2418
+ function ga(t, e) {
2419
+ if (!Qs[t] && Wn(true)) {
2420
+ Qs[t] = true;
2421
+ let n = `The option '${t}' will be removed in a future release`;
2422
+ n += e ? `, use '${e}' instead.` : ".", jn(n, "DeprecationWarning");
2423
+ }
2424
+ }
2425
+ z.binary = ra;
2426
+ z.floatTime = pa;
2427
+ z.intTime = ua;
2428
+ z.omap = aa;
2429
+ z.pairs = sa;
2430
+ z.set = fa;
2431
+ z.timestamp = ma;
2432
+ z.warn = jn;
2433
+ z.warnFileDeprecation = ha;
2434
+ z.warnOptionDeprecation = ga;
2435
+ });
2436
+ var Xn = te((li) => {
2437
+ var Jt = le(), E = qe(), D = Qn();
2438
+ function da(t, e, n) {
2439
+ let r = new E.YAMLMap(t);
2440
+ if (e instanceof Map) for (let [s, i] of e) r.items.push(t.createPair(s, i, n));
2441
+ else if (e && typeof e == "object") for (let s of Object.keys(e)) r.items.push(t.createPair(s, e[s], n));
2442
+ return typeof t.sortMapEntries == "function" && r.items.sort(t.sortMapEntries), r;
2443
+ }
2444
+ var gt = { createNode: da, default: true, nodeClass: E.YAMLMap, tag: "tag:yaml.org,2002:map", resolve: E.resolveMap };
2445
+ function ya(t, e, n) {
2446
+ let r = new E.YAMLSeq(t);
2447
+ if (e && e[Symbol.iterator]) for (let s of e) {
2448
+ let i = t.createNode(s, n.wrapScalars, null, n);
2449
+ r.items.push(i);
2450
+ }
2451
+ return r;
2452
+ }
2453
+ var Gt = { createNode: ya, default: true, nodeClass: E.YAMLSeq, tag: "tag:yaml.org,2002:seq", resolve: E.resolveSeq }, Ea = { identify: (t) => typeof t == "string", default: true, tag: "tag:yaml.org,2002:str", resolve: E.resolveString, stringify(t, e, n, r) {
2454
+ return e = Object.assign({ actualString: true }, e), E.stringifyString(t, e, n, r);
2455
+ }, options: E.strOptions }, Gn = [gt, Gt, Ea], Ht = (t) => typeof t == "bigint" || Number.isInteger(t), Hn = (t, e, n) => E.intOptions.asBigInt ? BigInt(t) : parseInt(e, n);
2456
+ function Zs(t, e, n) {
2457
+ let { value: r } = t;
2458
+ return Ht(r) && r >= 0 ? n + r.toString(e) : E.stringifyNumber(t);
2459
+ }
2460
+ var ei = { identify: (t) => t == null, createNode: (t, e, n) => n.wrapScalars ? new E.Scalar(null) : null, default: true, tag: "tag:yaml.org,2002:null", test: /^(?:~|[Nn]ull|NULL)?$/, resolve: () => null, options: E.nullOptions, stringify: () => E.nullOptions.nullStr }, ti = { identify: (t) => typeof t == "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/, resolve: (t) => t[0] === "t" || t[0] === "T", options: E.boolOptions, stringify: ({ value: t }) => t ? E.boolOptions.trueStr : E.boolOptions.falseStr }, ni = { identify: (t) => Ht(t) && t >= 0, default: true, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^0o([0-7]+)$/, resolve: (t, e) => Hn(t, e, 8), options: E.intOptions, stringify: (t) => Zs(t, 8, "0o") }, ri = { identify: Ht, default: true, tag: "tag:yaml.org,2002:int", test: /^[-+]?[0-9]+$/, resolve: (t) => Hn(t, t, 10), options: E.intOptions, stringify: E.stringifyNumber }, si = { identify: (t) => Ht(t) && t >= 0, default: true, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^0x([0-9a-fA-F]+)$/, resolve: (t, e) => Hn(t, e, 16), options: E.intOptions, stringify: (t) => Zs(t, 16, "0x") }, ii = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^(?:[-+]?\.inf|(\.nan))$/i, resolve: (t, e) => e ? NaN : t[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, stringify: E.stringifyNumber }, oi = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", format: "EXP", test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/, resolve: (t) => parseFloat(t), stringify: ({ value: t }) => Number(t).toExponential() }, ai = { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/, resolve(t, e, n) {
2461
+ let r = e || n, s = new E.Scalar(parseFloat(t));
2462
+ return r && r[r.length - 1] === "0" && (s.minFractionDigits = r.length), s;
2463
+ }, stringify: E.stringifyNumber }, Sa = Gn.concat([ei, ti, ni, ri, si, ii, oi, ai]), Xs = (t) => typeof t == "bigint" || Number.isInteger(t), jt = ({ value: t }) => JSON.stringify(t), ci = [gt, Gt, { identify: (t) => typeof t == "string", default: true, tag: "tag:yaml.org,2002:str", resolve: E.resolveString, stringify: jt }, { identify: (t) => t == null, createNode: (t, e, n) => n.wrapScalars ? new E.Scalar(null) : null, default: true, tag: "tag:yaml.org,2002:null", test: /^null$/, resolve: () => null, stringify: jt }, { identify: (t) => typeof t == "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^true|false$/, resolve: (t) => t === "true", stringify: jt }, { identify: Xs, default: true, tag: "tag:yaml.org,2002:int", test: /^-?(?:0|[1-9][0-9]*)$/, resolve: (t) => E.intOptions.asBigInt ? BigInt(t) : parseInt(t, 10), stringify: ({ value: t }) => Xs(t) ? t.toString() : JSON.stringify(t) }, { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/, resolve: (t) => parseFloat(t), stringify: jt }];
2464
+ ci.scalarFallback = (t) => {
2465
+ throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(t)}`);
2466
+ };
2467
+ var zs = ({ value: t }) => t ? E.boolOptions.trueStr : E.boolOptions.falseStr, ht = (t) => typeof t == "bigint" || Number.isInteger(t);
2468
+ function Qt(t, e, n) {
2469
+ let r = e.replace(/_/g, "");
2470
+ if (E.intOptions.asBigInt) {
2471
+ switch (n) {
2472
+ case 2:
2473
+ r = `0b${r}`;
2474
+ break;
2475
+ case 8:
2476
+ r = `0o${r}`;
2477
+ break;
2478
+ case 16:
2479
+ r = `0x${r}`;
2480
+ break;
2481
+ }
2482
+ let i = BigInt(r);
2483
+ return t === "-" ? BigInt(-1) * i : i;
2484
+ }
2485
+ let s = parseInt(r, n);
2486
+ return t === "-" ? -1 * s : s;
2487
+ }
2488
+ function Jn(t, e, n) {
2489
+ let { value: r } = t;
2490
+ if (ht(r)) {
2491
+ let s = r.toString(e);
2492
+ return r < 0 ? "-" + n + s.substr(1) : n + s;
2493
+ }
2494
+ return E.stringifyNumber(t);
2495
+ }
2496
+ var wa = Gn.concat([{ identify: (t) => t == null, createNode: (t, e, n) => n.wrapScalars ? new E.Scalar(null) : null, default: true, tag: "tag:yaml.org,2002:null", test: /^(?:~|[Nn]ull|NULL)?$/, resolve: () => null, options: E.nullOptions, stringify: () => E.nullOptions.nullStr }, { identify: (t) => typeof t == "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/, resolve: () => true, options: E.boolOptions, stringify: zs }, { identify: (t) => typeof t == "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i, resolve: () => false, options: E.boolOptions, stringify: zs }, { identify: ht, default: true, tag: "tag:yaml.org,2002:int", format: "BIN", test: /^([-+]?)0b([0-1_]+)$/, resolve: (t, e, n) => Qt(e, n, 2), stringify: (t) => Jn(t, 2, "0b") }, { identify: ht, default: true, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^([-+]?)0([0-7_]+)$/, resolve: (t, e, n) => Qt(e, n, 8), stringify: (t) => Jn(t, 8, "0") }, { identify: ht, default: true, tag: "tag:yaml.org,2002:int", test: /^([-+]?)([0-9][0-9_]*)$/, resolve: (t, e, n) => Qt(e, n, 10), stringify: E.stringifyNumber }, { identify: ht, default: true, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^([-+]?)0x([0-9a-fA-F_]+)$/, resolve: (t, e, n) => Qt(e, n, 16), stringify: (t) => Jn(t, 16, "0x") }, { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^(?:[-+]?\.inf|(\.nan))$/i, resolve: (t, e) => e ? NaN : t[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, stringify: E.stringifyNumber }, { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", format: "EXP", test: /^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/, resolve: (t) => parseFloat(t.replace(/_/g, "")), stringify: ({ value: t }) => Number(t).toExponential() }, { identify: (t) => typeof t == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/, resolve(t, e) {
2497
+ let n = new E.Scalar(parseFloat(t.replace(/_/g, "")));
2498
+ if (e) {
2499
+ let r = e.replace(/_/g, "");
2500
+ r[r.length - 1] === "0" && (n.minFractionDigits = r.length);
2501
+ }
2502
+ return n;
2503
+ }, stringify: E.stringifyNumber }], D.binary, D.omap, D.pairs, D.set, D.intTime, D.floatTime, D.timestamp), ba = { core: Sa, failsafe: Gn, json: ci, yaml11: wa }, Na = { binary: D.binary, bool: ti, float: ai, floatExp: oi, floatNaN: ii, floatTime: D.floatTime, int: ri, intHex: si, intOct: ni, intTime: D.intTime, map: gt, null: ei, omap: D.omap, pairs: D.pairs, seq: Gt, set: D.set, timestamp: D.timestamp };
2504
+ function Oa(t, e, n) {
2505
+ if (e) {
2506
+ let r = n.filter((i) => i.tag === e), s = r.find((i) => !i.format) || r[0];
2507
+ if (!s) throw new Error(`Tag ${e} not found`);
2508
+ return s;
2509
+ }
2510
+ return n.find((r) => (r.identify && r.identify(t) || r.class && t instanceof r.class) && !r.format);
2511
+ }
2512
+ function La(t, e, n) {
2513
+ if (t instanceof E.Node) return t;
2514
+ let { defaultPrefix: r, onTagObj: s, prevObjects: i, schema: o, wrapScalars: a } = n;
2515
+ e && e.startsWith("!!") && (e = r + e.slice(2));
2516
+ let c = Oa(t, e, o.tags);
2517
+ if (!c) {
2518
+ if (typeof t.toJSON == "function" && (t = t.toJSON()), !t || typeof t != "object") return a ? new E.Scalar(t) : t;
2519
+ c = t instanceof Map ? gt : t[Symbol.iterator] ? Gt : gt;
2520
+ }
2521
+ s && (s(c), delete n.onTagObj);
2522
+ let l = { value: void 0, node: void 0 };
2523
+ if (t && typeof t == "object" && i) {
2524
+ let f = i.get(t);
2525
+ if (f) {
2526
+ let m = new E.Alias(f);
2527
+ return n.aliasNodes.push(m), m;
2528
+ }
2529
+ l.value = t, i.set(t, l);
2530
+ }
2531
+ return l.node = c.createNode ? c.createNode(n.schema, t, n) : a ? new E.Scalar(t) : t, e && l.node instanceof E.Node && (l.node.tag = e), l.node;
2532
+ }
2533
+ function Aa(t, e, n, r) {
2534
+ let s = t[r.replace(/\W/g, "")];
2535
+ if (!s) {
2536
+ let i = Object.keys(t).map((o) => JSON.stringify(o)).join(", ");
2537
+ throw new Error(`Unknown schema "${r}"; use one of ${i}`);
2538
+ }
2539
+ if (Array.isArray(n)) for (let i of n) s = s.concat(i);
2540
+ else typeof n == "function" && (s = n(s.slice()));
2541
+ for (let i = 0; i < s.length; ++i) {
2542
+ let o = s[i];
2543
+ if (typeof o == "string") {
2544
+ let a = e[o];
2545
+ if (!a) {
2546
+ let c = Object.keys(e).map((l) => JSON.stringify(l)).join(", ");
2547
+ throw new Error(`Unknown custom tag "${o}"; use one of ${c}`);
2548
+ }
2549
+ s[i] = a;
2550
+ }
2551
+ }
2552
+ return s;
2553
+ }
2554
+ var Ta = (t, e) => t.key < e.key ? -1 : t.key > e.key ? 1 : 0, dt = class t {
2555
+ constructor({ customTags: e, merge: n, schema: r, sortMapEntries: s, tags: i }) {
2556
+ this.merge = !!n, this.name = r, this.sortMapEntries = s === true ? Ta : s || null, !e && i && D.warnOptionDeprecation("tags", "customTags"), this.tags = Aa(ba, Na, e || i, r);
2557
+ }
2558
+ createNode(e, n, r, s) {
2559
+ let i = { defaultPrefix: t.defaultPrefix, schema: this, wrapScalars: n }, o = s ? Object.assign(s, i) : i;
2560
+ return La(e, r, o);
2561
+ }
2562
+ createPair(e, n, r) {
2563
+ r || (r = { wrapScalars: true });
2564
+ let s = this.createNode(e, r.wrapScalars, null, r), i = this.createNode(n, r.wrapScalars, null, r);
2565
+ return new E.Pair(s, i);
2566
+ }
2567
+ };
2568
+ Jt._defineProperty(dt, "defaultPrefix", Jt.defaultTagPrefix);
2569
+ Jt._defineProperty(dt, "defaultTags", Jt.defaultTags);
2570
+ li.Schema = dt;
2571
+ });
2572
+ var mi = te((en) => {
2573
+ var Y = le(), S = qe(), fi = Xn(), Ca = { anchorPrefix: "a", customTags: null, indent: 2, indentSeq: true, keepCstNodes: false, keepNodeTypes: true, keepBlobsInJSON: true, mapAsMap: false, maxAliasCount: 100, prettyErrors: false, simpleKeys: false, version: "1.2" }, Ma = { get binary() {
2574
+ return S.binaryOptions;
2575
+ }, set binary(t) {
2576
+ Object.assign(S.binaryOptions, t);
2577
+ }, get bool() {
2578
+ return S.boolOptions;
2579
+ }, set bool(t) {
2580
+ Object.assign(S.boolOptions, t);
2581
+ }, get int() {
2582
+ return S.intOptions;
2583
+ }, set int(t) {
2584
+ Object.assign(S.intOptions, t);
2585
+ }, get null() {
2586
+ return S.nullOptions;
2587
+ }, set null(t) {
2588
+ Object.assign(S.nullOptions, t);
2589
+ }, get str() {
2590
+ return S.strOptions;
2591
+ }, set str(t) {
2592
+ Object.assign(S.strOptions, t);
2593
+ } }, pi = { "1.0": { schema: "yaml-1.1", merge: true, tagPrefixes: [{ handle: "!", prefix: Y.defaultTagPrefix }, { handle: "!!", prefix: "tag:private.yaml.org,2002:" }] }, 1.1: { schema: "yaml-1.1", merge: true, tagPrefixes: [{ handle: "!", prefix: "!" }, { handle: "!!", prefix: Y.defaultTagPrefix }] }, 1.2: { schema: "core", merge: false, tagPrefixes: [{ handle: "!", prefix: "!" }, { handle: "!!", prefix: Y.defaultTagPrefix }] } };
2594
+ function ui(t, e) {
2595
+ if ((t.version || t.options.version) === "1.0") {
2596
+ let s = e.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);
2597
+ if (s) return "!" + s[1];
2598
+ let i = e.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);
2599
+ return i ? `!${i[1]}/${i[2]}` : `!${e.replace(/^tag:/, "")}`;
2600
+ }
2601
+ let n = t.tagPrefixes.find((s) => e.indexOf(s.prefix) === 0);
2602
+ if (!n) {
2603
+ let s = t.getDefaults().tagPrefixes;
2604
+ n = s && s.find((i) => e.indexOf(i.prefix) === 0);
2605
+ }
2606
+ if (!n) return e[0] === "!" ? e : `!<${e}>`;
2607
+ let r = e.substr(n.prefix.length).replace(/[!,[\]{}]/g, (s) => ({ "!": "%21", ",": "%2C", "[": "%5B", "]": "%5D", "{": "%7B", "}": "%7D" })[s]);
2608
+ return n.handle + r;
2609
+ }
2610
+ function ka(t, e) {
2611
+ if (e instanceof S.Alias) return S.Alias;
2612
+ if (e.tag) {
2613
+ let s = t.filter((i) => i.tag === e.tag);
2614
+ if (s.length > 0) return s.find((i) => i.format === e.format) || s[0];
2615
+ }
2616
+ let n, r;
2617
+ if (e instanceof S.Scalar) {
2618
+ r = e.value;
2619
+ let s = t.filter((i) => i.identify && i.identify(r) || i.class && r instanceof i.class);
2620
+ n = s.find((i) => i.format === e.format) || s.find((i) => !i.format);
2621
+ } else r = e, n = t.find((s) => s.nodeClass && r instanceof s.nodeClass);
2622
+ if (!n) {
2623
+ let s = r && r.constructor ? r.constructor.name : typeof r;
2624
+ throw new Error(`Tag not resolved for ${s} value`);
2625
+ }
2626
+ return n;
2627
+ }
2628
+ function va(t, e, { anchors: n, doc: r }) {
2629
+ let s = [], i = r.anchors.getName(t);
2630
+ return i && (n[i] = t, s.push(`&${i}`)), t.tag ? s.push(ui(r, t.tag)) : e.default || s.push(ui(r, e.tag)), s.join(" ");
2631
+ }
2632
+ function Xt(t, e, n, r) {
2633
+ let { anchors: s, schema: i } = e.doc, o;
2634
+ if (!(t instanceof S.Node)) {
2635
+ let l = { aliasNodes: [], onTagObj: (f) => o = f, prevObjects: /* @__PURE__ */ new Map() };
2636
+ t = i.createNode(t, true, null, l);
2637
+ for (let f of l.aliasNodes) {
2638
+ f.source = f.source.node;
2639
+ let m = s.getName(f.source);
2640
+ m || (m = s.newName(), s.map[m] = f.source);
2641
+ }
2642
+ }
2643
+ if (t instanceof S.Pair) return t.toString(e, n, r);
2644
+ o || (o = ka(i.tags, t));
2645
+ let a = va(t, o, e);
2646
+ a.length > 0 && (e.indentAtStart = (e.indentAtStart || 0) + a.length + 1);
2647
+ let c = typeof o.stringify == "function" ? o.stringify(t, e, n, r) : t instanceof S.Scalar ? S.stringifyString(t, e, n, r) : t.toString(e, n, r);
2648
+ return a ? t instanceof S.Scalar || c[0] === "{" || c[0] === "[" ? `${a} ${c}` : `${a}
2649
+ ${e.indent}${c}` : c;
2650
+ }
2651
+ var zn = class t {
2652
+ static validAnchorNode(e) {
2653
+ return e instanceof S.Scalar || e instanceof S.YAMLSeq || e instanceof S.YAMLMap;
2654
+ }
2655
+ constructor(e) {
2656
+ Y._defineProperty(this, "map", /* @__PURE__ */ Object.create(null)), this.prefix = e;
2657
+ }
2658
+ createAlias(e, n) {
2659
+ return this.setAnchor(e, n), new S.Alias(e);
2660
+ }
2661
+ createMergePair(...e) {
2662
+ let n = new S.Merge();
2663
+ return n.value.items = e.map((r) => {
2664
+ if (r instanceof S.Alias) {
2665
+ if (r.source instanceof S.YAMLMap) return r;
2666
+ } else if (r instanceof S.YAMLMap) return this.createAlias(r);
2667
+ throw new Error("Merge sources must be Map nodes or their Aliases");
2668
+ }), n;
2669
+ }
2670
+ getName(e) {
2671
+ let { map: n } = this;
2672
+ return Object.keys(n).find((r) => n[r] === e);
2673
+ }
2674
+ getNames() {
2675
+ return Object.keys(this.map);
2676
+ }
2677
+ getNode(e) {
2678
+ return this.map[e];
2679
+ }
2680
+ newName(e) {
2681
+ e || (e = this.prefix);
2682
+ let n = Object.keys(this.map);
2683
+ for (let r = 1; ; ++r) {
2684
+ let s = `${e}${r}`;
2685
+ if (!n.includes(s)) return s;
2686
+ }
2687
+ }
2688
+ resolveNodes() {
2689
+ let { map: e, _cstAliases: n } = this;
2690
+ Object.keys(e).forEach((r) => {
2691
+ e[r] = e[r].resolved;
2692
+ }), n.forEach((r) => {
2693
+ r.source = r.source.resolved;
2694
+ }), delete this._cstAliases;
2695
+ }
2696
+ setAnchor(e, n) {
2697
+ if (e != null && !t.validAnchorNode(e)) throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");
2698
+ if (n && /[\x00-\x19\s,[\]{}]/.test(n)) throw new Error("Anchor names must not contain whitespace or control characters");
2699
+ let { map: r } = this, s = e && Object.keys(r).find((i) => r[i] === e);
2700
+ if (s) if (n) s !== n && (delete r[s], r[n] = e);
2701
+ else return s;
2702
+ else {
2703
+ if (!n) {
2704
+ if (!e) return null;
2705
+ n = this.newName();
2706
+ }
2707
+ r[n] = e;
2708
+ }
2709
+ return n;
2710
+ }
2711
+ }, zt = (t, e) => {
2712
+ if (t && typeof t == "object") {
2713
+ let { tag: n } = t;
2714
+ t instanceof S.Collection ? (n && (e[n] = true), t.items.forEach((r) => zt(r, e))) : t instanceof S.Pair ? (zt(t.key, e), zt(t.value, e)) : t instanceof S.Scalar && n && (e[n] = true);
2715
+ }
2716
+ return e;
2717
+ }, Ia = (t) => Object.keys(zt(t, {}));
2718
+ function Pa(t, e) {
2719
+ let n = { before: [], after: [] }, r, s = false;
2720
+ for (let i of e) if (i.valueRange) {
2721
+ if (r !== void 0) {
2722
+ let a = "Document contains trailing content not separated by a ... or --- line";
2723
+ t.errors.push(new Y.YAMLSyntaxError(i, a));
2724
+ break;
2725
+ }
2726
+ let o = S.resolveNode(t, i);
2727
+ s && (o.spaceBefore = true, s = false), r = o;
2728
+ } else i.comment !== null ? (r === void 0 ? n.before : n.after).push(i.comment) : i.type === Y.Type.BLANK_LINE && (s = true, r === void 0 && n.before.length > 0 && !t.commentBefore && (t.commentBefore = n.before.join(`
2729
+ `), n.before = []));
2730
+ if (t.contents = r || null, !r) t.comment = n.before.concat(n.after).join(`
2731
+ `) || null;
2732
+ else {
2733
+ let i = n.before.join(`
2734
+ `);
2735
+ if (i) {
2736
+ let o = r instanceof S.Collection && r.items[0] ? r.items[0] : r;
2737
+ o.commentBefore = o.commentBefore ? `${i}
2738
+ ${o.commentBefore}` : i;
2739
+ }
2740
+ t.comment = n.after.join(`
2741
+ `) || null;
2742
+ }
2743
+ }
2744
+ function _a({ tagPrefixes: t }, e) {
2745
+ let [n, r] = e.parameters;
2746
+ if (!n || !r) {
2747
+ let s = "Insufficient parameters given for %TAG directive";
2748
+ throw new Y.YAMLSemanticError(e, s);
2749
+ }
2750
+ if (t.some((s) => s.handle === n)) {
2751
+ let s = "The %TAG directive must only be given at most once per handle in the same document.";
2752
+ throw new Y.YAMLSemanticError(e, s);
2753
+ }
2754
+ return { handle: n, prefix: r };
2755
+ }
2756
+ function xa(t, e) {
2757
+ let [n] = e.parameters;
2758
+ if (e.name === "YAML:1.0" && (n = "1.0"), !n) {
2759
+ let r = "Insufficient parameters given for %YAML directive";
2760
+ throw new Y.YAMLSemanticError(e, r);
2761
+ }
2762
+ if (!pi[n]) {
2763
+ let s = `Document will be parsed as YAML ${t.version || t.options.version} rather than YAML ${n}`;
2764
+ t.warnings.push(new Y.YAMLWarning(e, s));
2765
+ }
2766
+ return n;
2767
+ }
2768
+ function Ra(t, e, n) {
2769
+ let r = [], s = false;
2770
+ for (let i of e) {
2771
+ let { comment: o, name: a } = i;
2772
+ switch (a) {
2773
+ case "TAG":
2774
+ try {
2775
+ t.tagPrefixes.push(_a(t, i));
2776
+ } catch (c) {
2777
+ t.errors.push(c);
2778
+ }
2779
+ s = true;
2780
+ break;
2781
+ case "YAML":
2782
+ case "YAML:1.0":
2783
+ if (t.version) {
2784
+ let c = "The %YAML directive must only be given at most once per document.";
2785
+ t.errors.push(new Y.YAMLSemanticError(i, c));
2786
+ }
2787
+ try {
2788
+ t.version = xa(t, i);
2789
+ } catch (c) {
2790
+ t.errors.push(c);
2791
+ }
2792
+ s = true;
2793
+ break;
2794
+ default:
2795
+ if (a) {
2796
+ let c = `YAML only supports %TAG and %YAML directives, and not %${a}`;
2797
+ t.warnings.push(new Y.YAMLWarning(i, c));
2798
+ }
2799
+ }
2800
+ o && r.push(o);
2801
+ }
2802
+ if (n && !s && (t.version || n.version || t.options.version) === "1.1") {
2803
+ let i = ({ handle: o, prefix: a }) => ({ handle: o, prefix: a });
2804
+ t.tagPrefixes = n.tagPrefixes.map(i), t.version = n.version;
2805
+ }
2806
+ t.commentBefore = r.join(`
2807
+ `) || null;
2808
+ }
2809
+ function Ve(t) {
2810
+ if (t instanceof S.Collection) return true;
2811
+ throw new Error("Expected a YAML collection as document contents");
2812
+ }
2813
+ var Zt = class t {
2814
+ constructor(e) {
2815
+ this.anchors = new zn(e.anchorPrefix), this.commentBefore = null, this.comment = null, this.contents = null, this.directivesEndMarker = null, this.errors = [], this.options = e, this.schema = null, this.tagPrefixes = [], this.version = null, this.warnings = [];
2816
+ }
2817
+ add(e) {
2818
+ return Ve(this.contents), this.contents.add(e);
2819
+ }
2820
+ addIn(e, n) {
2821
+ Ve(this.contents), this.contents.addIn(e, n);
2822
+ }
2823
+ delete(e) {
2824
+ return Ve(this.contents), this.contents.delete(e);
2825
+ }
2826
+ deleteIn(e) {
2827
+ return S.isEmptyPath(e) ? this.contents == null ? false : (this.contents = null, true) : (Ve(this.contents), this.contents.deleteIn(e));
2828
+ }
2829
+ getDefaults() {
2830
+ return t.defaults[this.version] || t.defaults[this.options.version] || {};
2831
+ }
2832
+ get(e, n) {
2833
+ return this.contents instanceof S.Collection ? this.contents.get(e, n) : void 0;
2834
+ }
2835
+ getIn(e, n) {
2836
+ return S.isEmptyPath(e) ? !n && this.contents instanceof S.Scalar ? this.contents.value : this.contents : this.contents instanceof S.Collection ? this.contents.getIn(e, n) : void 0;
2837
+ }
2838
+ has(e) {
2839
+ return this.contents instanceof S.Collection ? this.contents.has(e) : false;
2840
+ }
2841
+ hasIn(e) {
2842
+ return S.isEmptyPath(e) ? this.contents !== void 0 : this.contents instanceof S.Collection ? this.contents.hasIn(e) : false;
2843
+ }
2844
+ set(e, n) {
2845
+ Ve(this.contents), this.contents.set(e, n);
2846
+ }
2847
+ setIn(e, n) {
2848
+ S.isEmptyPath(e) ? this.contents = n : (Ve(this.contents), this.contents.setIn(e, n));
2849
+ }
2850
+ setSchema(e, n) {
2851
+ if (!e && !n && this.schema) return;
2852
+ typeof e == "number" && (e = e.toFixed(1)), e === "1.0" || e === "1.1" || e === "1.2" ? (this.version ? this.version = e : this.options.version = e, delete this.options.schema) : e && typeof e == "string" && (this.options.schema = e), Array.isArray(n) && (this.options.customTags = n);
2853
+ let r = Object.assign({}, this.getDefaults(), this.options);
2854
+ this.schema = new fi.Schema(r);
2855
+ }
2856
+ parse(e, n) {
2857
+ this.options.keepCstNodes && (this.cstNode = e), this.options.keepNodeTypes && (this.type = "DOCUMENT");
2858
+ let { directives: r = [], contents: s = [], directivesEndMarker: i, error: o, valueRange: a } = e;
2859
+ if (o && (o.source || (o.source = this), this.errors.push(o)), Ra(this, r, n), i && (this.directivesEndMarker = true), this.range = a ? [a.start, a.end] : null, this.setSchema(), this.anchors._cstAliases = [], Pa(this, s), this.anchors.resolveNodes(), this.options.prettyErrors) {
2860
+ for (let c of this.errors) c instanceof Y.YAMLError && c.makePretty();
2861
+ for (let c of this.warnings) c instanceof Y.YAMLError && c.makePretty();
2862
+ }
2863
+ return this;
2864
+ }
2865
+ listNonDefaultTags() {
2866
+ return Ia(this.contents).filter((e) => e.indexOf(fi.Schema.defaultPrefix) !== 0);
2867
+ }
2868
+ setTagPrefix(e, n) {
2869
+ if (e[0] !== "!" || e[e.length - 1] !== "!") throw new Error("Handle must start and end with !");
2870
+ if (n) {
2871
+ let r = this.tagPrefixes.find((s) => s.handle === e);
2872
+ r ? r.prefix = n : this.tagPrefixes.push({ handle: e, prefix: n });
2873
+ } else this.tagPrefixes = this.tagPrefixes.filter((r) => r.handle !== e);
2874
+ }
2875
+ toJSON(e, n) {
2876
+ let { keepBlobsInJSON: r, mapAsMap: s, maxAliasCount: i } = this.options, o = r && (typeof e != "string" || !(this.contents instanceof S.Scalar)), a = { doc: this, indentStep: " ", keep: o, mapAsMap: o && !!s, maxAliasCount: i, stringify: Xt }, c = Object.keys(this.anchors.map);
2877
+ c.length > 0 && (a.anchors = new Map(c.map((f) => [this.anchors.map[f], { alias: [], aliasCount: 0, count: 1 }])));
2878
+ let l = S.toJSON(this.contents, e, a);
2879
+ if (typeof n == "function" && a.anchors) for (let { count: f, res: m } of a.anchors.values()) n(m, f);
2880
+ return l;
2881
+ }
2882
+ toString() {
2883
+ if (this.errors.length > 0) throw new Error("Document with errors cannot be stringified");
2884
+ let e = this.options.indent;
2885
+ if (!Number.isInteger(e) || e <= 0) {
2886
+ let c = JSON.stringify(e);
2887
+ throw new Error(`"indent" option must be a positive integer, not ${c}`);
2888
+ }
2889
+ this.setSchema();
2890
+ let n = [], r = false;
2891
+ if (this.version) {
2892
+ let c = "%YAML 1.2";
2893
+ this.schema.name === "yaml-1.1" && (this.version === "1.0" ? c = "%YAML:1.0" : this.version === "1.1" && (c = "%YAML 1.1")), n.push(c), r = true;
2894
+ }
2895
+ let s = this.listNonDefaultTags();
2896
+ this.tagPrefixes.forEach(({ handle: c, prefix: l }) => {
2897
+ s.some((f) => f.indexOf(l) === 0) && (n.push(`%TAG ${c} ${l}`), r = true);
2898
+ }), (r || this.directivesEndMarker) && n.push("---"), this.commentBefore && ((r || !this.directivesEndMarker) && n.unshift(""), n.unshift(this.commentBefore.replace(/^/gm, "#")));
2899
+ let i = { anchors: /* @__PURE__ */ Object.create(null), doc: this, indent: "", indentStep: " ".repeat(e), stringify: Xt }, o = false, a = null;
2900
+ if (this.contents) {
2901
+ this.contents instanceof S.Node && (this.contents.spaceBefore && (r || this.directivesEndMarker) && n.push(""), this.contents.commentBefore && n.push(this.contents.commentBefore.replace(/^/gm, "#")), i.forceBlockIndent = !!this.comment, a = this.contents.comment);
2902
+ let c = a ? null : () => o = true, l = Xt(this.contents, i, () => a = null, c);
2903
+ n.push(S.addComment(l, "", a));
2904
+ } else this.contents !== void 0 && n.push(Xt(this.contents, i));
2905
+ return this.comment && ((!o || a) && n[n.length - 1] !== "" && n.push(""), n.push(this.comment.replace(/^/gm, "#"))), n.join(`
2906
+ `) + `
2907
+ `;
2908
+ }
2909
+ };
2910
+ Y._defineProperty(Zt, "defaults", pi);
2911
+ en.Document = Zt;
2912
+ en.defaultOptions = Ca;
2913
+ en.scalarOptions = Ma;
2914
+ });
2915
+ var di = te((gi) => {
2916
+ var Zn = Rs(), Oe = mi(), Da = Xn(), Ya = le(), $a = Qn();
2917
+ qe();
2918
+ function Ba(t, e = true, n) {
2919
+ n === void 0 && typeof e == "string" && (n = e, e = true);
2920
+ let r = Object.assign({}, Oe.Document.defaults[Oe.defaultOptions.version], Oe.defaultOptions);
2921
+ return new Da.Schema(r).createNode(t, e, n);
2922
+ }
2923
+ var We = class extends Oe.Document {
2924
+ constructor(e) {
2925
+ super(Object.assign({}, Oe.defaultOptions, e));
2926
+ }
2927
+ };
2928
+ function Fa(t, e) {
2929
+ let n = [], r;
2930
+ for (let s of Zn.parse(t)) {
2931
+ let i = new We(e);
2932
+ i.parse(s, r), n.push(i), r = i;
2933
+ }
2934
+ return n;
2935
+ }
2936
+ function hi(t, e) {
2937
+ let n = Zn.parse(t), r = new We(e).parse(n[0]);
2938
+ if (n.length > 1) {
2939
+ let s = "Source contains multiple documents; please use YAML.parseAllDocuments()";
2940
+ r.errors.unshift(new Ya.YAMLSemanticError(n[1], s));
2941
+ }
2942
+ return r;
2943
+ }
2944
+ function qa(t, e) {
2945
+ let n = hi(t, e);
2946
+ if (n.warnings.forEach((r) => $a.warn(r)), n.errors.length > 0) throw n.errors[0];
2947
+ return n.toJSON();
2948
+ }
2949
+ function Ua(t, e) {
2950
+ let n = new We(e);
2951
+ return n.contents = t, String(n);
2952
+ }
2953
+ var Ka = { createNode: Ba, defaultOptions: Oe.defaultOptions, Document: We, parse: qa, parseAllDocuments: Fa, parseCST: Zn.parse, parseDocument: hi, scalarOptions: Oe.scalarOptions, stringify: Ua };
2954
+ gi.YAML = Ka;
2955
+ });
2956
+ var Ei = te((qm, yi) => {
2957
+ yi.exports = di().YAML;
2958
+ });
2959
+ var Si = te((J) => {
2960
+ var je = qe(), Qe = le();
2961
+ J.findPair = je.findPair;
2962
+ J.parseMap = je.resolveMap;
2963
+ J.parseSeq = je.resolveSeq;
2964
+ J.stringifyNumber = je.stringifyNumber;
2965
+ J.stringifyString = je.stringifyString;
2966
+ J.toJSON = je.toJSON;
2967
+ J.Type = Qe.Type;
2968
+ J.YAMLError = Qe.YAMLError;
2969
+ J.YAMLReferenceError = Qe.YAMLReferenceError;
2970
+ J.YAMLSemanticError = Qe.YAMLSemanticError;
2971
+ J.YAMLSyntaxError = Qe.YAMLSyntaxError;
2972
+ J.YAMLWarning = Qe.YAMLWarning;
2973
+ });
2974
+ var nr = {};
2975
+ rr(nr, { languages: () => _r, options: () => xr, parsers: () => tr, printers: () => Ha });
2976
+ var Pi = (t, e, n, r) => {
2977
+ if (!(t && e == null)) return e.replaceAll ? e.replaceAll(n, r) : n.global ? e.replace(n, r) : e.split(n).join(r);
2978
+ }, yt = Pi;
2979
+ var Le = "string", Je = "array", Ge = "cursor", He = "indent", Ae = "align", Xe = "trim", Te = "group", Ce = "fill", he = "if-break", ze = "indent-if-break", Me = "line-suffix", Ze = "line-suffix-boundary", Z = "line", et = "label", ke = "break-parent", Et = /* @__PURE__ */ new Set([Ge, He, Ae, Xe, Te, Ce, he, ze, Me, Ze, Z, et, ke]);
2980
+ var _i = (t, e, n) => {
2981
+ if (!(t && e == null)) return Array.isArray(e) || typeof e == "string" ? e[n < 0 ? e.length + n : n] : e.at(n);
2982
+ }, x = _i;
2983
+ function xi(t) {
2984
+ if (typeof t == "string") return Le;
2985
+ if (Array.isArray(t)) return Je;
2986
+ if (!t) return;
2987
+ let { type: e } = t;
2988
+ if (Et.has(e)) return e;
2989
+ }
2990
+ var ve = xi;
2991
+ var Ri = (t) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(t);
2992
+ function Di(t) {
2993
+ let e = t === null ? "null" : typeof t;
2994
+ if (e !== "string" && e !== "object") return `Unexpected doc '${e}',
2995
+ Expected it to be 'string' or 'object'.`;
2996
+ if (ve(t)) throw new Error("doc is valid.");
2997
+ let n = Object.prototype.toString.call(t);
2998
+ if (n !== "[object Object]") return `Unexpected doc '${n}'.`;
2999
+ let r = Ri([...Et].map((s) => `'${s}'`));
3000
+ return `Unexpected doc.type '${t.type}'.
3001
+ Expected it to be ${r}.`;
3002
+ }
3003
+ var nn = class extends Error {
3004
+ name = "InvalidDocError";
3005
+ constructor(e) {
3006
+ super(Di(e)), this.doc = e;
3007
+ }
3008
+ }, rn = nn;
3009
+ function $i(t, e) {
3010
+ if (typeof t == "string") return e(t);
3011
+ let n = /* @__PURE__ */ new Map();
3012
+ return r(t);
3013
+ function r(i) {
3014
+ if (n.has(i)) return n.get(i);
3015
+ let o = s(i);
3016
+ return n.set(i, o), o;
3017
+ }
3018
+ function s(i) {
3019
+ switch (ve(i)) {
3020
+ case Je:
3021
+ return e(i.map(r));
3022
+ case Ce:
3023
+ return e({ ...i, parts: i.parts.map(r) });
3024
+ case he:
3025
+ return e({ ...i, breakContents: r(i.breakContents), flatContents: r(i.flatContents) });
3026
+ case Te: {
3027
+ let { expandedStates: o, contents: a } = i;
3028
+ return o ? (o = o.map(r), a = o[0]) : a = r(a), e({ ...i, contents: a, expandedStates: o });
3029
+ }
3030
+ case Ae:
3031
+ case He:
3032
+ case ze:
3033
+ case et:
3034
+ case Me:
3035
+ return e({ ...i, contents: r(i.contents) });
3036
+ case Le:
3037
+ case Ge:
3038
+ case Xe:
3039
+ case Ze:
3040
+ case Z:
3041
+ case ke:
3042
+ return e(i);
3043
+ default:
3044
+ throw new rn(i);
3045
+ }
3046
+ }
3047
+ }
3048
+ function ir(t, e = tt) {
3049
+ return $i(t, (n) => typeof n == "string" ? v(e, n.split(`
3050
+ `)) : n);
3051
+ }
3052
+ var sn = () => {
3053
+ }, on = sn;
3054
+ function nt(t, e) {
3055
+ return { type: Ae, contents: e, n: t };
3056
+ }
3057
+ function Ie(t, e = {}) {
3058
+ return on(e.expandedStates), { type: Te, id: e.id, contents: t, break: !!e.shouldBreak, expandedStates: e.expandedStates };
3059
+ }
3060
+ function an(t) {
3061
+ return nt(Number.NEGATIVE_INFINITY, t);
3062
+ }
3063
+ function ar(t) {
3064
+ return nt({ type: "root" }, t);
3065
+ }
3066
+ function cr(t) {
3067
+ return nt(-1, t);
3068
+ }
3069
+ function cn(t, e) {
3070
+ return Ie(t[0], { ...e, expandedStates: t });
3071
+ }
3072
+ function St(t) {
3073
+ return { type: Ce, parts: t };
3074
+ }
3075
+ function rt(t, e = "", n = {}) {
3076
+ return { type: he, breakContents: t, flatContents: e, groupId: n.groupId };
3077
+ }
3078
+ function lr(t) {
3079
+ return { type: Me, contents: t };
3080
+ }
3081
+ var wt = { type: ke };
3082
+ var Bi = { type: Z, hard: true }, Fi = { type: Z, hard: true, literal: true }, ne = { type: Z }, bt = { type: Z, soft: true }, N = [Bi, wt], tt = [Fi, wt];
3083
+ function v(t, e) {
3084
+ let n = [];
3085
+ for (let r = 0; r < e.length; r++) r !== 0 && n.push(t), n.push(e[r]);
3086
+ return n;
3087
+ }
3088
+ function Nt(t) {
3089
+ return (e, n, r) => {
3090
+ let s = !!(r != null && r.backwards);
3091
+ if (n === false) return false;
3092
+ let { length: i } = e, o = n;
3093
+ for (; o >= 0 && o < i; ) {
3094
+ let a = e.charAt(o);
3095
+ if (t instanceof RegExp) {
3096
+ if (!t.test(a)) return o;
3097
+ } else if (!t.includes(a)) return o;
3098
+ s ? o-- : o++;
3099
+ }
3100
+ return o === -1 || o === i ? o : false;
3101
+ };
3102
+ }
3103
+ var ln = Nt(" ");
3104
+ function qi(t, e, n) {
3105
+ let r = !!(n != null && n.backwards);
3106
+ if (e === false) return false;
3107
+ let s = t.charAt(e);
3108
+ if (r) {
3109
+ if (t.charAt(e - 1) === "\r" && s === `
3110
+ `) return e - 2;
3111
+ if (s === `
3112
+ ` || s === "\r" || s === "\u2028" || s === "\u2029") return e - 1;
3113
+ } else {
3114
+ if (s === "\r" && t.charAt(e + 1) === `
3115
+ `) return e + 2;
3116
+ if (s === `
3117
+ ` || s === "\r" || s === "\u2028" || s === "\u2029") return e + 1;
3118
+ }
3119
+ return e;
3120
+ }
3121
+ var fn = qi;
3122
+ function Ui(t, e) {
3123
+ let n = e - 1;
3124
+ n = ln(t, n, { backwards: true }), n = fn(t, n, { backwards: true }), n = ln(t, n, { backwards: true });
3125
+ let r = fn(t, n, { backwards: true });
3126
+ return n !== r;
3127
+ }
3128
+ var fr = Ui;
3129
+ var un = class extends Error {
3130
+ name = "UnexpectedNodeError";
3131
+ constructor(e, n, r = "type") {
3132
+ super(`Unexpected ${n} node ${r}: ${JSON.stringify(e[r])}.`), this.node = e;
3133
+ }
3134
+ }, ur = un;
3135
+ function pr(t, e) {
3136
+ let { node: n } = t;
3137
+ if (n.type === "root" && e.filepath && /(?:[/\\]|^)\.(?:prettier|stylelint|lintstaged)rc$/u.test(e.filepath)) return async (r) => {
3138
+ let s = await r(e.originalText, { parser: "json" });
3139
+ return s ? [s, N] : void 0;
3140
+ };
3141
+ }
3142
+ pr.getVisitorKeys = () => [];
3143
+ var mr = pr;
3144
+ var st = null;
3145
+ function it(t) {
3146
+ if (st !== null && typeof st.property) {
3147
+ let e = st;
3148
+ return st = it.prototype = null, e;
3149
+ }
3150
+ return st = it.prototype = t ?? /* @__PURE__ */ Object.create(null), new it();
3151
+ }
3152
+ var Ki = 10;
3153
+ for (let t = 0; t <= Ki; t++) it();
3154
+ function pn(t) {
3155
+ return it(t);
3156
+ }
3157
+ function Vi(t, e = "type") {
3158
+ pn(t);
3159
+ function n(r) {
3160
+ let s = r[e], i = t[s];
3161
+ if (!Array.isArray(i)) throw Object.assign(new Error(`Missing visitor keys for '${s}'.`), { node: r });
3162
+ return i;
3163
+ }
3164
+ return n;
3165
+ }
3166
+ var hr = Vi;
3167
+ var Wi = Object.fromEntries(Object.entries({ root: ["children"], document: ["head", "body", "children"], documentHead: ["children"], documentBody: ["children"], directive: [], alias: [], blockLiteral: [], blockFolded: ["children"], plain: ["children"], quoteSingle: [], quoteDouble: [], mapping: ["children"], mappingItem: ["key", "value", "children"], mappingKey: ["content", "children"], mappingValue: ["content", "children"], sequence: ["children"], sequenceItem: ["content", "children"], flowMapping: ["children"], flowMappingItem: ["key", "value", "children"], flowSequence: ["children"], flowSequenceItem: ["content", "children"], comment: [], tag: [], anchor: [] }).map(([t, e]) => [t, [...e, "anchor", "tag", "indicatorComment", "leadingComments", "middleComments", "trailingComment", "endComments"]])), gr = Wi;
3168
+ var ji = hr(gr), dr = ji;
3169
+ function Pe(t) {
3170
+ return t.position.start.offset;
3171
+ }
3172
+ function yr(t) {
3173
+ return t.position.end.offset;
3174
+ }
3175
+ function Er(t) {
3176
+ return /^\s*@(?:prettier|format)\s*$/u.test(t);
3177
+ }
3178
+ function Sr(t) {
3179
+ return /^\s*#[^\S\n]*@(?:prettier|format)\s*?(?:\n|$)/u.test(t);
3180
+ }
3181
+ function wr(t) {
3182
+ return `# @format
3183
+
3184
+ ${t}`;
3185
+ }
3186
+ function Qi(t) {
3187
+ return Array.isArray(t) && t.length > 0;
3188
+ }
3189
+ var _e = Qi;
3190
+ function H(t, e) {
3191
+ return typeof (t == null ? void 0 : t.type) == "string" && (!e || e.includes(t.type));
3192
+ }
3193
+ function mn(t, e, n) {
3194
+ return e("children" in t ? { ...t, children: t.children.map((r) => mn(r, e, t)) } : t, n);
3195
+ }
3196
+ function xe(t, e, n) {
3197
+ Object.defineProperty(t, e, { get: n, enumerable: false });
3198
+ }
3199
+ function Nr(t, e) {
3200
+ let n = 0, r = e.length;
3201
+ for (let s = t.position.end.offset - 1; s < r; s++) {
3202
+ let i = e[s];
3203
+ if (i === `
3204
+ ` && n++, n === 1 && /\S/u.test(i)) return false;
3205
+ if (n === 2) return true;
3206
+ }
3207
+ return false;
3208
+ }
3209
+ function Ot(t) {
3210
+ let { node: e } = t;
3211
+ switch (e.type) {
3212
+ case "tag":
3213
+ case "anchor":
3214
+ case "comment":
3215
+ return false;
3216
+ }
3217
+ let n = t.stack.length;
3218
+ for (let r = 1; r < n; r++) {
3219
+ let s = t.stack[r], i = t.stack[r - 1];
3220
+ if (Array.isArray(i) && typeof s == "number" && s !== i.length - 1) return false;
3221
+ }
3222
+ return true;
3223
+ }
3224
+ function Lt(t) {
3225
+ return _e(t.children) ? Lt(x(false, t.children, -1)) : t;
3226
+ }
3227
+ function br(t) {
3228
+ return t.value.trim() === "prettier-ignore";
3229
+ }
3230
+ function Or(t) {
3231
+ let { node: e } = t;
3232
+ if (e.type === "documentBody") {
3233
+ let n = t.parent.head;
3234
+ return R(n) && br(x(false, n.endComments, -1));
3235
+ }
3236
+ return ee(e) && br(x(false, e.leadingComments, -1));
3237
+ }
3238
+ function Re(t) {
3239
+ return !_e(t.children) && !Ji(t);
3240
+ }
3241
+ function Ji(t) {
3242
+ return ee(t) || ie(t) || hn(t) || K(t) || R(t);
3243
+ }
3244
+ function ee(t) {
3245
+ return _e(t == null ? void 0 : t.leadingComments);
3246
+ }
3247
+ function ie(t) {
3248
+ return _e(t == null ? void 0 : t.middleComments);
3249
+ }
3250
+ function hn(t) {
3251
+ return t == null ? void 0 : t.indicatorComment;
3252
+ }
3253
+ function K(t) {
3254
+ return t == null ? void 0 : t.trailingComment;
3255
+ }
3256
+ function R(t) {
3257
+ return _e(t == null ? void 0 : t.endComments);
3258
+ }
3259
+ function Lr(t) {
3260
+ let e = [], n;
3261
+ for (let r of t.split(/( +)/u)) r !== " " ? n === " " ? e.push(r) : e.push((e.pop() || "") + r) : n === void 0 && e.unshift(""), n = r;
3262
+ return n === " " && e.push((e.pop() || "") + " "), e[0] === "" && (e.shift(), e.unshift(" " + (e.shift() || ""))), e;
3263
+ }
3264
+ function Ar(t, e, n) {
3265
+ let r = e.split(`
3266
+ `).map((s, i, o) => i === 0 && i === o.length - 1 ? s : i !== 0 && i !== o.length - 1 ? s.trim() : i === 0 ? s.trimEnd() : s.trimStart());
3267
+ return n.proseWrap === "preserve" ? r.map((s) => s.length === 0 ? [] : [s]) : r.map((s) => s.length === 0 ? [] : Lr(s)).reduce((s, i, o) => o !== 0 && r[o - 1].length > 0 && i.length > 0 && !(t === "quoteDouble" && x(false, x(false, s, -1), -1).endsWith("\\")) ? [...s.slice(0, -1), [...x(false, s, -1), ...i]] : [...s, i], []).map((s) => n.proseWrap === "never" ? [s.join(" ")] : s);
3268
+ }
3269
+ function Tr(t, { parentIndent: e, isLastDescendant: n, options: r }) {
3270
+ let s = t.position.start.line === t.position.end.line ? "" : r.originalText.slice(t.position.start.offset, t.position.end.offset).match(/^[^\n]*\n(.*)$/su)[1], i;
3271
+ if (t.indent === null) {
3272
+ let c = s.match(/^(?<leadingSpace> *)[^\n\r ]/mu);
3273
+ i = c ? c.groups.leadingSpace.length : Number.POSITIVE_INFINITY;
3274
+ } else i = t.indent - 1 + e;
3275
+ let o = s.split(`
3276
+ `).map((c) => c.slice(i));
3277
+ if (r.proseWrap === "preserve" || t.type === "blockLiteral") return a(o.map((c) => c.length === 0 ? [] : [c]));
3278
+ return a(o.map((c) => c.length === 0 ? [] : Lr(c)).reduce((c, l, f) => f !== 0 && o[f - 1].length > 0 && l.length > 0 && !/^\s/u.test(l[0]) && !/^\s|\s$/u.test(x(false, c, -1)) ? [...c.slice(0, -1), [...x(false, c, -1), ...l]] : [...c, l], []).map((c) => c.reduce((l, f) => l.length > 0 && /\s$/u.test(x(false, l, -1)) ? [...l.slice(0, -1), x(false, l, -1) + " " + f] : [...l, f], [])).map((c) => r.proseWrap === "never" ? [c.join(" ")] : c));
3279
+ function a(c) {
3280
+ if (t.chomping === "keep") return x(false, c, -1).length === 0 ? c.slice(0, -1) : c;
3281
+ let l = 0;
3282
+ for (let f = c.length - 1; f >= 0 && c[f].length === 0; f--) l++;
3283
+ return l === 0 ? c : l >= 2 && !n ? c.slice(0, -(l - 1)) : c.slice(0, -l);
3284
+ }
3285
+ }
3286
+ function ot(t) {
3287
+ if (!t) return true;
3288
+ switch (t.type) {
3289
+ case "plain":
3290
+ case "quoteDouble":
3291
+ case "quoteSingle":
3292
+ case "alias":
3293
+ case "flowMapping":
3294
+ case "flowSequence":
3295
+ return true;
3296
+ default:
3297
+ return false;
3298
+ }
3299
+ }
3300
+ var gn = /* @__PURE__ */ new WeakMap();
3301
+ function At(t, e) {
3302
+ let { node: n, root: r } = t, s;
3303
+ return gn.has(r) ? s = gn.get(r) : (s = /* @__PURE__ */ new Set(), gn.set(r, s)), !s.has(n.position.end.line) && (s.add(n.position.end.line), Nr(n, e) && !dn(t.parent)) ? bt : "";
3304
+ }
3305
+ function dn(t) {
3306
+ return R(t) && !H(t, ["documentHead", "documentBody", "flowMapping", "flowSequence"]);
3307
+ }
3308
+ function I(t, e) {
3309
+ return nt(" ".repeat(t), e);
3310
+ }
3311
+ function Gi(t, e, n) {
3312
+ let { node: r } = t, s = t.ancestors.filter((l) => l.type === "sequence" || l.type === "mapping").length, i = Ot(t), o = [r.type === "blockFolded" ? ">" : "|"];
3313
+ r.indent !== null && o.push(r.indent.toString()), r.chomping !== "clip" && o.push(r.chomping === "keep" ? "+" : "-"), hn(r) && o.push(" ", e("indicatorComment"));
3314
+ let a = Tr(r, { parentIndent: s, isLastDescendant: i, options: n }), c = [];
3315
+ for (let [l, f] of a.entries()) l === 0 && c.push(N), c.push(St(v(ne, f))), l !== a.length - 1 ? c.push(f.length === 0 ? N : ar(tt)) : r.chomping === "keep" && i && c.push(an(f.length === 0 ? N : tt));
3316
+ return r.indent === null ? o.push(cr(I(n.tabWidth, c))) : o.push(an(I(r.indent - 1 + s, c))), o;
3317
+ }
3318
+ var Cr = Gi;
3319
+ function Tt(t, e, n) {
3320
+ let { node: r } = t, s = r.type === "flowMapping", i = s ? "{" : "[", o = s ? "}" : "]", a = bt;
3321
+ s && r.children.length > 0 && n.bracketSpacing && (a = ne);
3322
+ let c = x(false, r.children, -1), l = (c == null ? void 0 : c.type) === "flowMappingItem" && Re(c.key) && Re(c.value);
3323
+ return [i, I(n.tabWidth, [a, Hi(t, e, n), n.trailingComma === "none" ? "" : rt(","), R(r) ? [N, v(N, t.map(e, "endComments"))] : ""]), l ? "" : a, o];
3324
+ }
3325
+ function Hi(t, e, n) {
3326
+ return t.map(({ isLast: r, node: s, next: i }) => [e(), r ? "" : [",", ne, s.position.start.line !== i.position.start.line ? At(t, n.originalText) : ""]], "children");
3327
+ }
3328
+ function Xi(t, e, n) {
3329
+ var C;
3330
+ let { node: r, parent: s } = t, { key: i, value: o } = r, a = Re(i), c = Re(o);
3331
+ if (a && c) return ": ";
3332
+ let l = e("key"), f = zi(r) ? " " : "";
3333
+ if (c) return r.type === "flowMappingItem" && s.type === "flowMapping" ? l : r.type === "mappingItem" && yn(i.content, n) && !K(i.content) && ((C = s.tag) == null ? void 0 : C.value) !== "tag:yaml.org,2002:set" ? [l, f, ":"] : ["? ", I(2, l)];
3334
+ let m = e("value");
3335
+ if (a) return [": ", I(2, m)];
3336
+ if (ee(o) || !ot(i.content)) return ["? ", I(2, l), N, ...t.map(() => [e(), N], "value", "leadingComments"), ": ", I(2, m)];
3337
+ if (Zi(i.content) && !ee(i.content) && !ie(i.content) && !K(i.content) && !R(i) && !ee(o.content) && !ie(o.content) && !R(o) && yn(o.content, n)) return [l, f, ": ", m];
3338
+ let d = Symbol("mappingKey"), y = Ie([rt("? "), Ie(I(2, l), { id: d })]), h = [N, ": ", I(2, m)], g = [f, ":"];
3339
+ ee(o.content) || R(o) && o.content && !H(o.content, ["mapping", "sequence"]) || s.type === "mapping" && K(i.content) && ot(o.content) || H(o.content, ["mapping", "sequence"]) && o.content.tag === null && o.content.anchor === null ? g.push(N) : o.content ? g.push(ne) : K(o) && g.push(" "), g.push(m);
3340
+ let w = I(n.tabWidth, g);
3341
+ return yn(i.content, n) && !ee(i.content) && !ie(i.content) && !R(i) ? cn([[l, w]]) : cn([[y, rt(h, w, { groupId: d })]]);
3342
+ }
3343
+ function yn(t, e) {
3344
+ if (!t) return true;
3345
+ switch (t.type) {
3346
+ case "plain":
3347
+ case "quoteSingle":
3348
+ case "quoteDouble":
3349
+ break;
3350
+ case "alias":
3351
+ return true;
3352
+ default:
3353
+ return false;
3354
+ }
3355
+ if (e.proseWrap === "preserve") return t.position.start.line === t.position.end.line;
3356
+ if (/\\$/mu.test(e.originalText.slice(t.position.start.offset, t.position.end.offset))) return false;
3357
+ switch (e.proseWrap) {
3358
+ case "never":
3359
+ return !t.value.includes(`
3360
+ `);
3361
+ case "always":
3362
+ return !/[\n ]/u.test(t.value);
3363
+ default:
3364
+ return false;
3365
+ }
3366
+ }
3367
+ function zi(t) {
3368
+ var e;
3369
+ return ((e = t.key.content) == null ? void 0 : e.type) === "alias";
3370
+ }
3371
+ function Zi(t) {
3372
+ if (!t) return true;
3373
+ switch (t.type) {
3374
+ case "plain":
3375
+ case "quoteDouble":
3376
+ case "quoteSingle":
3377
+ return t.position.start.line === t.position.end.line;
3378
+ case "alias":
3379
+ return true;
3380
+ default:
3381
+ return false;
3382
+ }
3383
+ }
3384
+ var Mr = Xi;
3385
+ function eo(t) {
3386
+ return mn(t, to);
3387
+ }
3388
+ function to(t) {
3389
+ switch (t.type) {
3390
+ case "document":
3391
+ xe(t, "head", () => t.children[0]), xe(t, "body", () => t.children[1]);
3392
+ break;
3393
+ case "documentBody":
3394
+ case "sequenceItem":
3395
+ case "flowSequenceItem":
3396
+ case "mappingKey":
3397
+ case "mappingValue":
3398
+ xe(t, "content", () => t.children[0]);
3399
+ break;
3400
+ case "mappingItem":
3401
+ case "flowMappingItem":
3402
+ xe(t, "key", () => t.children[0]), xe(t, "value", () => t.children[1]);
3403
+ break;
3404
+ }
3405
+ return t;
3406
+ }
3407
+ var kr = eo;
3408
+ function no(t, e, n) {
3409
+ let { node: r } = t, s = [];
3410
+ r.type !== "mappingValue" && ee(r) && s.push([v(N, t.map(n, "leadingComments")), N]);
3411
+ let { tag: i, anchor: o } = r;
3412
+ i && s.push(n("tag")), i && o && s.push(" "), o && s.push(n("anchor"));
3413
+ let a = "";
3414
+ return H(r, ["mapping", "sequence", "comment", "directive", "mappingItem", "sequenceItem"]) && !Ot(t) && (a = At(t, e.originalText)), (i || o) && (H(r, ["sequence", "mapping"]) && !ie(r) ? s.push(N) : s.push(" ")), ie(r) && s.push([r.middleComments.length === 1 ? "" : N, v(N, t.map(n, "middleComments")), N]), Or(t) ? s.push(ir(e.originalText.slice(r.position.start.offset, r.position.end.offset).trimEnd())) : s.push(Ie(ro(t, e, n))), K(r) && !H(r, ["document", "documentHead"]) && s.push(lr([r.type === "mappingValue" && !r.content ? "" : " ", t.parent.type === "mappingKey" && t.getParentNode(2).type === "mapping" && ot(r) ? "" : wt, n("trailingComment")])), dn(r) && s.push(I(r.type === "sequenceItem" ? 2 : 0, [N, v(N, t.map(({ node: c }) => [fr(e.originalText, Pe(c)) ? N : "", n()], "endComments"))])), s.push(a), s;
3415
+ }
3416
+ function ro(t, e, n) {
3417
+ let { node: r } = t;
3418
+ switch (r.type) {
3419
+ case "root": {
3420
+ let s = [];
3421
+ t.each(({ node: o, next: a, isFirst: c }) => {
3422
+ c || s.push(N), s.push(n()), vr(o, a) ? (s.push(N, "..."), K(o) && s.push(" ", n("trailingComment"))) : a && !K(a.head) && s.push(N, "---");
3423
+ }, "children");
3424
+ let i = Lt(r);
3425
+ return (!H(i, ["blockLiteral", "blockFolded"]) || i.chomping !== "keep") && s.push(N), s;
3426
+ }
3427
+ case "document": {
3428
+ let s = [];
3429
+ return io(t, e) === "head" && ((r.head.children.length > 0 || r.head.endComments.length > 0) && s.push(n("head")), K(r.head) ? s.push(["---", " ", n(["head", "trailingComment"])]) : s.push("---")), so(r) && s.push(n("body")), v(N, s);
3430
+ }
3431
+ case "documentHead":
3432
+ return v(N, [...t.map(n, "children"), ...t.map(n, "endComments")]);
3433
+ case "documentBody": {
3434
+ let { children: s, endComments: i } = r, o = "";
3435
+ if (s.length > 0 && i.length > 0) {
3436
+ let a = Lt(r);
3437
+ H(a, ["blockFolded", "blockLiteral"]) ? a.chomping !== "keep" && (o = [N, N]) : o = N;
3438
+ }
3439
+ return [v(N, t.map(n, "children")), o, v(N, t.map(n, "endComments"))];
3440
+ }
3441
+ case "directive":
3442
+ return ["%", v(" ", [r.name, ...r.parameters])];
3443
+ case "comment":
3444
+ return ["#", r.value];
3445
+ case "alias":
3446
+ return ["*", r.value];
3447
+ case "tag":
3448
+ return e.originalText.slice(r.position.start.offset, r.position.end.offset);
3449
+ case "anchor":
3450
+ return ["&", r.value];
3451
+ case "plain":
3452
+ return at(r.type, e.originalText.slice(r.position.start.offset, r.position.end.offset), e);
3453
+ case "quoteDouble":
3454
+ case "quoteSingle": {
3455
+ let s = "'", i = '"', o = e.originalText.slice(r.position.start.offset + 1, r.position.end.offset - 1);
3456
+ if (r.type === "quoteSingle" && o.includes("\\") || r.type === "quoteDouble" && /\\[^"]/u.test(o)) {
3457
+ let c = r.type === "quoteDouble" ? i : s;
3458
+ return [c, at(r.type, o, e), c];
3459
+ }
3460
+ if (o.includes(i)) return [s, at(r.type, r.type === "quoteDouble" ? yt(false, yt(false, o, String.raw`\"`, i), "'", s.repeat(2)) : o, e), s];
3461
+ if (o.includes(s)) return [i, at(r.type, r.type === "quoteSingle" ? yt(false, o, "''", s) : o, e), i];
3462
+ let a = e.singleQuote ? s : i;
3463
+ return [a, at(r.type, o, e), a];
3464
+ }
3465
+ case "blockFolded":
3466
+ case "blockLiteral":
3467
+ return Cr(t, n, e);
3468
+ case "mapping":
3469
+ case "sequence":
3470
+ return v(N, t.map(n, "children"));
3471
+ case "sequenceItem":
3472
+ return ["- ", I(2, r.content ? n("content") : "")];
3473
+ case "mappingKey":
3474
+ case "mappingValue":
3475
+ return r.content ? n("content") : "";
3476
+ case "mappingItem":
3477
+ case "flowMappingItem":
3478
+ return Mr(t, n, e);
3479
+ case "flowMapping":
3480
+ return Tt(t, n, e);
3481
+ case "flowSequence":
3482
+ return Tt(t, n, e);
3483
+ case "flowSequenceItem":
3484
+ return n("content");
3485
+ default:
3486
+ throw new ur(r, "YAML");
3487
+ }
3488
+ }
3489
+ function so(t) {
3490
+ return t.body.children.length > 0 || R(t.body);
3491
+ }
3492
+ function vr(t, e) {
3493
+ return K(t) || e && (e.head.children.length > 0 || R(e.head));
3494
+ }
3495
+ function io(t, e) {
3496
+ let n = t.node;
3497
+ if (t.isFirst && /---(?:\s|$)/u.test(e.originalText.slice(Pe(n), Pe(n) + 4)) || n.head.children.length > 0 || R(n.head) || K(n.head)) return "head";
3498
+ let r = t.next;
3499
+ return vr(n, r) ? false : r ? "root" : false;
3500
+ }
3501
+ function at(t, e, n) {
3502
+ let r = Ar(t, e, n);
3503
+ return v(N, r.map((s) => St(v(ne, s))));
3504
+ }
3505
+ function Ir(t, e) {
3506
+ if (H(t)) switch (t.type) {
3507
+ case "comment":
3508
+ if (Er(t.value)) return null;
3509
+ break;
3510
+ case "quoteDouble":
3511
+ case "quoteSingle":
3512
+ e.type = "quote";
3513
+ break;
3514
+ }
3515
+ }
3516
+ Ir.ignoredProperties = /* @__PURE__ */ new Set(["position"]);
3517
+ var oo = { preprocess: kr, embed: mr, print: no, massageAstNode: Ir, insertPragma: wr, getVisitorKeys: dr }, Pr = oo;
3518
+ var _r = [{ linguistLanguageId: 407, name: "YAML", type: "data", color: "#cb171e", tmScope: "source.yaml", aliases: ["yml"], extensions: [".yml", ".mir", ".reek", ".rviz", ".sublime-syntax", ".syntax", ".yaml", ".yaml-tmlanguage", ".yaml.sed", ".yml.mysql"], filenames: [".clang-format", ".clang-tidy", ".gemrc", "CITATION.cff", "glide.lock", ".prettierrc", ".stylelintrc", ".lintstagedrc"], aceMode: "yaml", codemirrorMode: "yaml", codemirrorMimeType: "text/x-yaml", parsers: ["yaml"], vscodeLanguageIds: ["yaml", "ansible", "dockercompose", "github-actions-workflow", "home-assistant"] }];
3519
+ var Ct = { bracketSpacing: { category: "Common", type: "boolean", default: true, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, singleQuote: { category: "Common", type: "boolean", default: false, description: "Use single quotes instead of double quotes." }, proseWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap prose.", choices: [{ value: "always", description: "Wrap prose if it exceeds the print width." }, { value: "never", description: "Do not wrap prose." }, { value: "preserve", description: "Wrap prose as-is." }] }};
3520
+ var ao = { bracketSpacing: Ct.bracketSpacing, singleQuote: Ct.singleQuote, proseWrap: Ct.proseWrap }, xr = ao;
3521
+ var tr = {};
3522
+ rr(tr, { yaml: () => Ga });
3523
+ var Mt = `
3524
+ `, Rr = "\r", Dr = function() {
3525
+ function t(e) {
3526
+ this.length = e.length;
3527
+ for (var n = [0], r = 0; r < e.length; ) switch (e[r]) {
3528
+ case Mt:
3529
+ r += Mt.length, n.push(r);
3530
+ break;
3531
+ case Rr:
3532
+ r += Rr.length, e[r] === Mt && (r += Mt.length), n.push(r);
3533
+ break;
3534
+ default:
3535
+ r++;
3536
+ break;
3537
+ }
3538
+ this.offsets = n;
3539
+ }
3540
+ return t.prototype.locationForIndex = function(e) {
3541
+ if (e < 0 || e > this.length) return null;
3542
+ for (var n = 0, r = this.offsets; r[n + 1] <= e; ) n++;
3543
+ var s = e - r[n];
3544
+ return { line: n, column: s };
3545
+ }, t.prototype.indexForLocation = function(e) {
3546
+ var n = e.line, r = e.column;
3547
+ return n < 0 || n >= this.offsets.length || r < 0 || r > this.lengthOfLine(n) ? null : this.offsets[n] + r;
3548
+ }, t.prototype.lengthOfLine = function(e) {
3549
+ var n = this.offsets[e], r = e === this.offsets.length - 1 ? this.length : this.offsets[e + 1];
3550
+ return r - n;
3551
+ }, t;
3552
+ }();
3553
+ function $(t, e = null) {
3554
+ "children" in t && t.children.forEach((n) => $(n, t)), "anchor" in t && t.anchor && $(t.anchor, t), "tag" in t && t.tag && $(t.tag, t), "leadingComments" in t && t.leadingComments.forEach((n) => $(n, t)), "middleComments" in t && t.middleComments.forEach((n) => $(n, t)), "indicatorComment" in t && t.indicatorComment && $(t.indicatorComment, t), "trailingComment" in t && t.trailingComment && $(t.trailingComment, t), "endComments" in t && t.endComments.forEach((n) => $(n, t)), Object.defineProperty(t, "_parent", { value: e, enumerable: false });
3555
+ }
3556
+ function de(t) {
3557
+ return `${t.line}:${t.column}`;
3558
+ }
3559
+ function Yr(t) {
3560
+ $(t);
3561
+ let e = co(t), n = t.children.slice();
3562
+ t.comments.sort((r, s) => r.position.start.offset - s.position.end.offset).filter((r) => !r._parent).forEach((r) => {
3563
+ for (; n.length > 1 && r.position.start.line > n[0].position.end.line; ) n.shift();
3564
+ lo(r, e, n[0]);
3565
+ });
3566
+ }
3567
+ function co(t) {
3568
+ let e = Array.from(new Array(t.position.end.line), () => ({}));
3569
+ for (let n of t.comments) e[n.position.start.line - 1].comment = n;
3570
+ return $r(e, t), e;
3571
+ }
3572
+ function $r(t, e) {
3573
+ if (e.position.start.offset !== e.position.end.offset) {
3574
+ if ("leadingComments" in e) {
3575
+ let { start: n } = e.position, { leadingAttachableNode: r } = t[n.line - 1];
3576
+ (!r || n.column < r.position.start.column) && (t[n.line - 1].leadingAttachableNode = e);
3577
+ }
3578
+ if ("trailingComment" in e && e.position.end.column > 1 && e.type !== "document" && e.type !== "documentHead") {
3579
+ let { end: n } = e.position, { trailingAttachableNode: r } = t[n.line - 1];
3580
+ (!r || n.column >= r.position.end.column) && (t[n.line - 1].trailingAttachableNode = e);
3581
+ }
3582
+ if (e.type !== "root" && e.type !== "document" && e.type !== "documentHead" && e.type !== "documentBody") {
3583
+ let { start: n, end: r } = e.position, s = [r.line].concat(n.line === r.line ? [] : n.line);
3584
+ for (let i of s) {
3585
+ let o = t[i - 1].trailingNode;
3586
+ (!o || r.column >= o.position.end.column) && (t[i - 1].trailingNode = e);
3587
+ }
3588
+ }
3589
+ "children" in e && e.children.forEach((n) => {
3590
+ $r(t, n);
3591
+ });
3592
+ }
3593
+ }
3594
+ function lo(t, e, n) {
3595
+ let r = t.position.start.line, { trailingAttachableNode: s } = e[r - 1];
3596
+ if (s) {
3597
+ if (s.trailingComment) throw new Error(`Unexpected multiple trailing comment at ${de(t.position.start)}`);
3598
+ $(t, s), s.trailingComment = t;
3599
+ return;
3600
+ }
3601
+ for (let o = r; o >= n.position.start.line; o--) {
3602
+ let { trailingNode: a } = e[o - 1], c;
3603
+ if (a) c = a;
3604
+ else if (o !== r && e[o - 1].comment) c = e[o - 1].comment._parent;
3605
+ else continue;
3606
+ if ((c.type === "sequence" || c.type === "mapping") && (c = c.children[0]), c.type === "mappingItem") {
3607
+ let [l, f] = c.children;
3608
+ c = Br(l) ? l : f;
3609
+ }
3610
+ for (; ; ) {
3611
+ if (fo(c, t)) {
3612
+ $(t, c), c.endComments.push(t);
3613
+ return;
3614
+ }
3615
+ if (!c._parent) break;
3616
+ c = c._parent;
3617
+ }
3618
+ break;
3619
+ }
3620
+ for (let o = r + 1; o <= n.position.end.line; o++) {
3621
+ let { leadingAttachableNode: a } = e[o - 1];
3622
+ if (a) {
3623
+ $(t, a), a.leadingComments.push(t);
3624
+ return;
3625
+ }
3626
+ }
3627
+ let i = n.children[1];
3628
+ $(t, i), i.endComments.push(t);
3629
+ }
3630
+ function fo(t, e) {
3631
+ if (t.position.start.offset < e.position.start.offset && t.position.end.offset > e.position.end.offset) switch (t.type) {
3632
+ case "flowMapping":
3633
+ case "flowSequence":
3634
+ return t.children.length === 0 || e.position.start.line > t.children[t.children.length - 1].position.end.line;
3635
+ }
3636
+ if (e.position.end.offset < t.position.end.offset) return false;
3637
+ switch (t.type) {
3638
+ case "sequenceItem":
3639
+ return e.position.start.column > t.position.start.column;
3640
+ case "mappingKey":
3641
+ case "mappingValue":
3642
+ return e.position.start.column > t._parent.position.start.column && (t.children.length === 0 || t.children.length === 1 && t.children[0].type !== "blockFolded" && t.children[0].type !== "blockLiteral") && (t.type === "mappingValue" || Br(t));
3643
+ default:
3644
+ return false;
3645
+ }
3646
+ }
3647
+ function Br(t) {
3648
+ return t.position.start !== t.position.end && (t.children.length === 0 || t.position.start.offset !== t.children[0].position.start.offset);
3649
+ }
3650
+ function b(t, e) {
3651
+ return { type: t, position: e };
3652
+ }
3653
+ function Fr(t, e, n) {
3654
+ return { ...b("root", t), children: e, comments: n };
3655
+ }
3656
+ function ct(t) {
3657
+ switch (t.type) {
3658
+ case "DOCUMENT":
3659
+ for (let e = t.contents.length - 1; e >= 0; e--) t.contents[e].type === "BLANK_LINE" ? t.contents.splice(e, 1) : ct(t.contents[e]);
3660
+ for (let e = t.directives.length - 1; e >= 0; e--) t.directives[e].type === "BLANK_LINE" && t.directives.splice(e, 1);
3661
+ break;
3662
+ case "FLOW_MAP":
3663
+ case "FLOW_SEQ":
3664
+ case "MAP":
3665
+ case "SEQ":
3666
+ for (let e = t.items.length - 1; e >= 0; e--) {
3667
+ let n = t.items[e];
3668
+ "char" in n || (n.type === "BLANK_LINE" ? t.items.splice(e, 1) : ct(n));
3669
+ }
3670
+ break;
3671
+ case "MAP_KEY":
3672
+ case "MAP_VALUE":
3673
+ case "SEQ_ITEM":
3674
+ t.node && ct(t.node);
3675
+ break;
3676
+ case "ALIAS":
3677
+ case "BLANK_LINE":
3678
+ case "BLOCK_FOLDED":
3679
+ case "BLOCK_LITERAL":
3680
+ case "COMMENT":
3681
+ case "DIRECTIVE":
3682
+ case "PLAIN":
3683
+ case "QUOTE_DOUBLE":
3684
+ case "QUOTE_SINGLE":
3685
+ break;
3686
+ default:
3687
+ throw new Error(`Unexpected node type ${JSON.stringify(t.type)}`);
3688
+ }
3689
+ }
3690
+ function X() {
3691
+ return { leadingComments: [] };
3692
+ }
3693
+ function oe(t = null) {
3694
+ return { trailingComment: t };
3695
+ }
3696
+ function B() {
3697
+ return { ...X(), ...oe() };
3698
+ }
3699
+ function qr(t, e, n) {
3700
+ return { ...b("alias", t), ...B(), ...e, value: n };
3701
+ }
3702
+ function Ur(t, e) {
3703
+ let n = t.cstNode;
3704
+ return qr(e.transformRange({ origStart: n.valueRange.origStart - 1, origEnd: n.valueRange.origEnd }), e.transformContent(t), n.rawValue);
3705
+ }
3706
+ function Kr(t) {
3707
+ return { ...t, type: "blockFolded" };
3708
+ }
3709
+ function Vr(t, e, n, r, s, i) {
3710
+ return { ...b("blockValue", t), ...X(), ...e, chomping: n, indent: r, value: s, indicatorComment: i };
3711
+ }
3712
+ var ae;
3713
+ (function(t) {
3714
+ t.Tag = "!", t.Anchor = "&", t.Comment = "#";
3715
+ })(ae || (ae = {}));
3716
+ function Wr(t, e) {
3717
+ return { ...b("anchor", t), value: e };
3718
+ }
3719
+ function De(t, e) {
3720
+ return { ...b("comment", t), value: e };
3721
+ }
3722
+ function jr(t, e, n) {
3723
+ return { anchor: e, tag: t, middleComments: n };
3724
+ }
3725
+ function Qr(t, e) {
3726
+ return { ...b("tag", t), value: e };
3727
+ }
3728
+ function kt(t, e, n = () => false) {
3729
+ let r = t.cstNode, s = [], i = null, o = null, a = null;
3730
+ for (let c of r.props) {
3731
+ let l = e.text[c.origStart];
3732
+ switch (l) {
3733
+ case ae.Tag:
3734
+ i = i || c, o = Qr(e.transformRange(c), t.tag);
3735
+ break;
3736
+ case ae.Anchor:
3737
+ i = i || c, a = Wr(e.transformRange(c), r.anchor);
3738
+ break;
3739
+ case ae.Comment: {
3740
+ let f = De(e.transformRange(c), e.text.slice(c.origStart + 1, c.origEnd));
3741
+ e.comments.push(f), !n(f) && i && i.origEnd <= c.origStart && c.origEnd <= r.valueRange.origStart && s.push(f);
3742
+ break;
3743
+ }
3744
+ default:
3745
+ throw new Error(`Unexpected leading character ${JSON.stringify(l)}`);
3746
+ }
3747
+ }
3748
+ return jr(o, a, s);
3749
+ }
3750
+ var En;
3751
+ (function(t) {
3752
+ t.CLIP = "clip", t.STRIP = "strip", t.KEEP = "keep";
3753
+ })(En || (En = {}));
3754
+ function vt(t, e) {
3755
+ let n = t.cstNode, r = 1, s = n.chomping === "CLIP" ? 0 : 1, o = n.header.origEnd - n.header.origStart - r - s !== 0, a = e.transformRange({ origStart: n.header.origStart, origEnd: n.valueRange.origEnd }), c = null, l = kt(t, e, (f) => {
3756
+ if (!(a.start.offset < f.position.start.offset && f.position.end.offset < a.end.offset)) return false;
3757
+ if (c) throw new Error(`Unexpected multiple indicator comments at ${de(f.position.start)}`);
3758
+ return c = f, true;
3759
+ });
3760
+ return Vr(a, l, En[n.chomping], o ? n.blockIndent : null, n.strValue, c);
3761
+ }
3762
+ function Jr(t, e) {
3763
+ return Kr(vt(t, e));
3764
+ }
3765
+ function Gr(t) {
3766
+ return { ...t, type: "blockLiteral" };
3767
+ }
3768
+ function Hr(t, e) {
3769
+ return Gr(vt(t, e));
3770
+ }
3771
+ function Xr(t, e) {
3772
+ return De(e.transformRange(t.range), t.comment);
3773
+ }
3774
+ function zr(t, e, n) {
3775
+ return { ...b("directive", t), ...B(), name: e, parameters: n };
3776
+ }
3777
+ function Ye(t, e) {
3778
+ for (let n of t.props) {
3779
+ let r = e.text[n.origStart];
3780
+ switch (r) {
3781
+ case ae.Comment:
3782
+ e.comments.push(De(e.transformRange(n), e.text.slice(n.origStart + 1, n.origEnd)));
3783
+ break;
3784
+ default:
3785
+ throw new Error(`Unexpected leading character ${JSON.stringify(r)}`);
3786
+ }
3787
+ }
3788
+ }
3789
+ function Zr(t, e) {
3790
+ return Ye(t, e), zr(e.transformRange(t.range), t.name, t.parameters);
3791
+ }
3792
+ function es(t, e, n, r) {
3793
+ return { ...b("document", t), ...oe(r), children: [e, n] };
3794
+ }
3795
+ function V(t, e) {
3796
+ return { start: t, end: e };
3797
+ }
3798
+ function Sn(t) {
3799
+ return { start: t, end: t };
3800
+ }
3801
+ function F(t = []) {
3802
+ return { endComments: t };
3803
+ }
3804
+ function ts(t, e, n) {
3805
+ return { ...b("documentBody", t), ...F(n), children: e ? [e] : [] };
3806
+ }
3807
+ function q(t) {
3808
+ return t[t.length - 1];
3809
+ }
3810
+ function It(t, e) {
3811
+ let n = t.match(e);
3812
+ return n ? n.index : -1;
3813
+ }
3814
+ function ns(t, e, n) {
3815
+ let r = t.cstNode, { comments: s, endComments: i, documentTrailingComment: o, documentHeadTrailingComment: a } = uo(r, e, n), c = e.transformNode(t.contents), { position: l, documentEndPoint: f } = po(r, c, e);
3816
+ return e.comments.push(...s, ...i), { documentBody: ts(l, c, i), documentEndPoint: f, documentTrailingComment: o, documentHeadTrailingComment: a };
3817
+ }
3818
+ function uo(t, e, n) {
3819
+ let r = [], s = [], i = [], o = [], a = false;
3820
+ for (let c = t.contents.length - 1; c >= 0; c--) {
3821
+ let l = t.contents[c];
3822
+ if (l.type === "COMMENT") {
3823
+ let f = e.transformNode(l);
3824
+ n && n.line === f.position.start.line ? o.unshift(f) : a ? r.unshift(f) : f.position.start.offset >= t.valueRange.origEnd ? i.unshift(f) : r.unshift(f);
3825
+ } else a = true;
3826
+ }
3827
+ if (i.length > 1) throw new Error(`Unexpected multiple document trailing comments at ${de(i[1].position.start)}`);
3828
+ if (o.length > 1) throw new Error(`Unexpected multiple documentHead trailing comments at ${de(o[1].position.start)}`);
3829
+ return { comments: r, endComments: s, documentTrailingComment: q(i) || null, documentHeadTrailingComment: q(o) || null };
3830
+ }
3831
+ function po(t, e, n) {
3832
+ let r = It(n.text.slice(t.valueRange.origEnd), /^\.\.\./), s = r === -1 ? t.valueRange.origEnd : Math.max(0, t.valueRange.origEnd - 1);
3833
+ n.text[s - 1] === "\r" && s--;
3834
+ let i = n.transformRange({ origStart: e !== null ? e.position.start.offset : s, origEnd: s }), o = r === -1 ? i.end : n.transformOffset(t.valueRange.origEnd + 3);
3835
+ return { position: i, documentEndPoint: o };
3836
+ }
3837
+ function rs(t, e, n, r) {
3838
+ return { ...b("documentHead", t), ...F(n), ...oe(r), children: e };
3839
+ }
3840
+ function ss(t, e) {
3841
+ let n = t.cstNode, { directives: r, comments: s, endComments: i } = mo(n, e), { position: o, endMarkerPoint: a } = ho(n, r, e);
3842
+ return e.comments.push(...s, ...i), { createDocumentHeadWithTrailingComment: (l) => (l && e.comments.push(l), rs(o, r, i, l)), documentHeadEndMarkerPoint: a };
3843
+ }
3844
+ function mo(t, e) {
3845
+ let n = [], r = [], s = [], i = false;
3846
+ for (let o = t.directives.length - 1; o >= 0; o--) {
3847
+ let a = e.transformNode(t.directives[o]);
3848
+ a.type === "comment" ? i ? r.unshift(a) : s.unshift(a) : (i = true, n.unshift(a));
3849
+ }
3850
+ return { directives: n, comments: r, endComments: s };
3851
+ }
3852
+ function ho(t, e, n) {
3853
+ let r = It(n.text.slice(0, t.valueRange.origStart), /---\s*$/);
3854
+ r > 0 && !/[\r\n]/.test(n.text[r - 1]) && (r = -1);
3855
+ let s = r === -1 ? { origStart: t.valueRange.origStart, origEnd: t.valueRange.origStart } : { origStart: r, origEnd: r + 3 };
3856
+ return e.length !== 0 && (s.origStart = e[0].position.start.offset), { position: n.transformRange(s), endMarkerPoint: r === -1 ? null : n.transformOffset(r) };
3857
+ }
3858
+ function is(t, e) {
3859
+ let { createDocumentHeadWithTrailingComment: n, documentHeadEndMarkerPoint: r } = ss(t, e), { documentBody: s, documentEndPoint: i, documentTrailingComment: o, documentHeadTrailingComment: a } = ns(t, e, r), c = n(a);
3860
+ return o && e.comments.push(o), es(V(c.position.start, i), c, s, o);
3861
+ }
3862
+ function Pt(t, e, n) {
3863
+ return { ...b("flowCollection", t), ...B(), ...F(), ...e, children: n };
3864
+ }
3865
+ function os(t, e, n) {
3866
+ return { ...Pt(t, e, n), type: "flowMapping" };
3867
+ }
3868
+ function _t(t, e, n) {
3869
+ return { ...b("flowMappingItem", t), ...X(), children: [e, n] };
3870
+ }
3871
+ function ce(t, e) {
3872
+ let n = [];
3873
+ for (let r of t) r && "type" in r && r.type === "COMMENT" ? e.comments.push(e.transformNode(r)) : n.push(r);
3874
+ return n;
3875
+ }
3876
+ function xt(t) {
3877
+ let [e, n] = ["?", ":"].map((r) => {
3878
+ let s = t.find((i) => "char" in i && i.char === r);
3879
+ return s ? { origStart: s.origOffset, origEnd: s.origOffset + 1 } : null;
3880
+ });
3881
+ return { additionalKeyRange: e, additionalValueRange: n };
3882
+ }
3883
+ function Rt(t, e) {
3884
+ let n = e;
3885
+ return (r) => t.slice(n, n = r);
3886
+ }
3887
+ function Dt(t) {
3888
+ let e = [], n = Rt(t, 1), r = false;
3889
+ for (let s = 1; s < t.length - 1; s++) {
3890
+ let i = t[s];
3891
+ if ("char" in i && i.char === ",") {
3892
+ e.push(n(s)), n(s + 1), r = false;
3893
+ continue;
3894
+ }
3895
+ r = true;
3896
+ }
3897
+ return r && e.push(n(t.length - 1)), e;
3898
+ }
3899
+ function wn(t, e) {
3900
+ return { ...b("mappingKey", t), ...oe(), ...F(), children: e ? [e] : [] };
3901
+ }
3902
+ function bn(t, e) {
3903
+ return { ...b("mappingValue", t), ...B(), ...F(), children: e ? [e] : [] };
3904
+ }
3905
+ function $e(t, e, n, r, s) {
3906
+ let i = e.transformNode(t.key), o = e.transformNode(t.value), a = i || r ? wn(e.transformRange({ origStart: r ? r.origStart : i.position.start.offset, origEnd: i ? i.position.end.offset : r.origStart + 1 }), i) : null, c = o || s ? bn(e.transformRange({ origStart: s ? s.origStart : o.position.start.offset, origEnd: o ? o.position.end.offset : s.origStart + 1 }), o) : null;
3907
+ return n(V(a ? a.position.start : c.position.start, c ? c.position.end : a.position.end), a || wn(Sn(c.position.start), null), c || bn(Sn(a.position.end), null));
3908
+ }
3909
+ function as(t, e) {
3910
+ let n = ce(t.cstNode.items, e), r = Dt(n), s = t.items.map((a, c) => {
3911
+ let l = r[c], { additionalKeyRange: f, additionalValueRange: m } = xt(l);
3912
+ return $e(a, e, _t, f, m);
3913
+ }), i = n[0], o = q(n);
3914
+ return os(e.transformRange({ origStart: i.origOffset, origEnd: o.origOffset + 1 }), e.transformContent(t), s);
3915
+ }
3916
+ function cs(t, e, n) {
3917
+ return { ...Pt(t, e, n), type: "flowSequence" };
3918
+ }
3919
+ function ls(t, e) {
3920
+ return { ...b("flowSequenceItem", t), children: [e] };
3921
+ }
3922
+ function fs(t, e) {
3923
+ let n = ce(t.cstNode.items, e), r = Dt(n), s = t.items.map((a, c) => {
3924
+ if (a.type !== "PAIR") {
3925
+ let l = e.transformNode(a);
3926
+ return ls(V(l.position.start, l.position.end), l);
3927
+ } else {
3928
+ let l = r[c], { additionalKeyRange: f, additionalValueRange: m } = xt(l);
3929
+ return $e(a, e, _t, f, m);
3930
+ }
3931
+ }), i = n[0], o = q(n);
3932
+ return cs(e.transformRange({ origStart: i.origOffset, origEnd: o.origOffset + 1 }), e.transformContent(t), s);
3933
+ }
3934
+ function us(t, e, n) {
3935
+ return { ...b("mapping", t), ...X(), ...e, children: n };
3936
+ }
3937
+ function ps(t, e, n) {
3938
+ return { ...b("mappingItem", t), ...X(), children: [e, n] };
3939
+ }
3940
+ function ms(t, e) {
3941
+ let n = t.cstNode;
3942
+ n.items.filter((o) => o.type === "MAP_KEY" || o.type === "MAP_VALUE").forEach((o) => Ye(o, e));
3943
+ let r = ce(n.items, e), s = go(r), i = t.items.map((o, a) => {
3944
+ let c = s[a], [l, f] = c[0].type === "MAP_VALUE" ? [null, c[0].range] : [c[0].range, c.length === 1 ? null : c[1].range];
3945
+ return $e(o, e, ps, l, f);
3946
+ });
3947
+ return us(V(i[0].position.start, q(i).position.end), e.transformContent(t), i);
3948
+ }
3949
+ function go(t) {
3950
+ let e = [], n = Rt(t, 0), r = false;
3951
+ for (let s = 0; s < t.length; s++) {
3952
+ if (t[s].type === "MAP_VALUE") {
3953
+ e.push(n(s + 1)), r = false;
3954
+ continue;
3955
+ }
3956
+ r && e.push(n(s)), r = true;
3957
+ }
3958
+ return r && e.push(n(1 / 0)), e;
3959
+ }
3960
+ function hs(t, e, n) {
3961
+ return { ...b("plain", t), ...B(), ...e, value: n };
3962
+ }
3963
+ function gs(t, e, n) {
3964
+ for (let r = e; r >= 0; r--) if (n.test(t[r])) return r;
3965
+ return -1;
3966
+ }
3967
+ function ds(t, e) {
3968
+ let n = t.cstNode;
3969
+ return hs(e.transformRange({ origStart: n.valueRange.origStart, origEnd: gs(e.text, n.valueRange.origEnd - 1, /\S/) + 1 }), e.transformContent(t), n.strValue);
3970
+ }
3971
+ function ys(t) {
3972
+ return { ...t, type: "quoteDouble" };
3973
+ }
3974
+ function Es(t, e, n) {
3975
+ return { ...b("quoteValue", t), ...e, ...B(), value: n };
3976
+ }
3977
+ function Yt(t, e) {
3978
+ let n = t.cstNode;
3979
+ return Es(e.transformRange(n.valueRange), e.transformContent(t), n.strValue);
3980
+ }
3981
+ function Ss(t, e) {
3982
+ return ys(Yt(t, e));
3983
+ }
3984
+ function ws(t) {
3985
+ return { ...t, type: "quoteSingle" };
3986
+ }
3987
+ function bs(t, e) {
3988
+ return ws(Yt(t, e));
3989
+ }
3990
+ function Ns(t, e, n) {
3991
+ return { ...b("sequence", t), ...X(), ...F(), ...e, children: n };
3992
+ }
3993
+ function Os(t, e) {
3994
+ return { ...b("sequenceItem", t), ...B(), ...F(), children: e ? [e] : [] };
3995
+ }
3996
+ function Ls(t, e) {
3997
+ let r = ce(t.cstNode.items, e).map((s, i) => {
3998
+ Ye(s, e);
3999
+ let o = e.transformNode(t.items[i]);
4000
+ return Os(V(e.transformOffset(s.valueRange.origStart), o === null ? e.transformOffset(s.valueRange.origStart + 1) : o.position.end), o);
4001
+ });
4002
+ return Ns(V(r[0].position.start, q(r).position.end), e.transformContent(t), r);
4003
+ }
4004
+ function As(t, e) {
4005
+ if (t === null || t.type === void 0 && t.value === null) return null;
4006
+ switch (t.type) {
4007
+ case "ALIAS":
4008
+ return Ur(t, e);
4009
+ case "BLOCK_FOLDED":
4010
+ return Jr(t, e);
4011
+ case "BLOCK_LITERAL":
4012
+ return Hr(t, e);
4013
+ case "COMMENT":
4014
+ return Xr(t, e);
4015
+ case "DIRECTIVE":
4016
+ return Zr(t, e);
4017
+ case "DOCUMENT":
4018
+ return is(t, e);
4019
+ case "FLOW_MAP":
4020
+ return as(t, e);
4021
+ case "FLOW_SEQ":
4022
+ return fs(t, e);
4023
+ case "MAP":
4024
+ return ms(t, e);
4025
+ case "PLAIN":
4026
+ return ds(t, e);
4027
+ case "QUOTE_DOUBLE":
4028
+ return Ss(t, e);
4029
+ case "QUOTE_SINGLE":
4030
+ return bs(t, e);
4031
+ case "SEQ":
4032
+ return Ls(t, e);
4033
+ default:
4034
+ throw new Error(`Unexpected node type ${t.type}`);
4035
+ }
4036
+ }
4037
+ function Ts(t, e, n) {
4038
+ let r = new SyntaxError(t);
4039
+ return r.name = "YAMLSyntaxError", r.source = e, r.position = n, r;
4040
+ }
4041
+ function Cs(t, e) {
4042
+ let n = t.source.range || t.source.valueRange;
4043
+ return Ts(t.message, e.text, e.transformRange(n));
4044
+ }
4045
+ function Ms(t, e, n) {
4046
+ return { offset: t, line: e, column: n };
4047
+ }
4048
+ function ks(t, e) {
4049
+ t < 0 ? t = 0 : t > e.text.length && (t = e.text.length);
4050
+ let n = e.locator.locationForIndex(t);
4051
+ return Ms(t, n.line + 1, n.column + 1);
4052
+ }
4053
+ function vs(t, e) {
4054
+ return V(e.transformOffset(t.origStart), e.transformOffset(t.origEnd));
4055
+ }
4056
+ function Is(t) {
4057
+ if (!t.setOrigRanges()) {
4058
+ let e = (n) => {
4059
+ if (yo(n)) return n.origStart = n.start, n.origEnd = n.end, true;
4060
+ if (Eo(n)) return n.origOffset = n.offset, true;
4061
+ };
4062
+ t.forEach((n) => Nn(n, e));
4063
+ }
4064
+ }
4065
+ function Nn(t, e) {
4066
+ if (!(!t || typeof t != "object") && e(t) !== true) for (let n of Object.keys(t)) {
4067
+ if (n === "context" || n === "error") continue;
4068
+ let r = t[n];
4069
+ Array.isArray(r) ? r.forEach((s) => Nn(s, e)) : Nn(r, e);
4070
+ }
4071
+ }
4072
+ function yo(t) {
4073
+ return typeof t.start == "number";
4074
+ }
4075
+ function Eo(t) {
4076
+ return typeof t.offset == "number";
4077
+ }
4078
+ function On(t) {
4079
+ if ("children" in t) {
4080
+ if (t.children.length === 1) {
4081
+ let e = t.children[0];
4082
+ if (e.type === "plain" && e.tag === null && e.anchor === null && e.value === "") return t.children.splice(0, 1), t;
4083
+ }
4084
+ t.children.forEach(On);
4085
+ }
4086
+ return t;
4087
+ }
4088
+ function Ln(t, e, n, r) {
4089
+ let s = e(t);
4090
+ return (i) => {
4091
+ r(s, i) && n(t, s = i);
4092
+ };
4093
+ }
4094
+ function An(t) {
4095
+ if (t === null || !("children" in t)) return;
4096
+ let e = t.children;
4097
+ if (e.forEach(An), t.type === "document") {
4098
+ let [i, o] = t.children;
4099
+ i.position.start.offset === i.position.end.offset ? i.position.start = i.position.end = o.position.start : o.position.start.offset === o.position.end.offset && (o.position.start = o.position.end = i.position.end);
4100
+ }
4101
+ let n = Ln(t.position, So, wo, Oo), r = Ln(t.position, bo, No, Lo);
4102
+ "endComments" in t && t.endComments.length !== 0 && (n(t.endComments[0].position.start), r(q(t.endComments).position.end));
4103
+ let s = e.filter((i) => i !== null);
4104
+ if (s.length !== 0) {
4105
+ let i = s[0], o = q(s);
4106
+ n(i.position.start), r(o.position.end), "leadingComments" in i && i.leadingComments.length !== 0 && n(i.leadingComments[0].position.start), "tag" in i && i.tag && n(i.tag.position.start), "anchor" in i && i.anchor && n(i.anchor.position.start), "trailingComment" in o && o.trailingComment && r(o.trailingComment.position.end);
4107
+ }
4108
+ }
4109
+ function So(t) {
4110
+ return t.start;
4111
+ }
4112
+ function wo(t, e) {
4113
+ t.start = e;
4114
+ }
4115
+ function bo(t) {
4116
+ return t.end;
4117
+ }
4118
+ function No(t, e) {
4119
+ t.end = e;
4120
+ }
4121
+ function Oo(t, e) {
4122
+ return e.offset < t.offset;
4123
+ }
4124
+ function Lo(t, e) {
4125
+ return e.offset > t.offset;
4126
+ }
4127
+ var wi = sr(Ei());
4128
+ var G = sr(Si()); G.default.findPair; G.default.toJSON; G.default.parseMap; G.default.parseSeq; G.default.stringifyNumber; G.default.stringifyString; G.default.Type; G.default.YAMLError; G.default.YAMLReferenceError; var er = G.default.YAMLSemanticError; G.default.YAMLSyntaxError; G.default.YAMLWarning;
4129
+ var { Document: bi, parseCST: Ni } = wi.default;
4130
+ function Oi(t) {
4131
+ let e = Ni(t);
4132
+ Is(e);
4133
+ let n = e.map((a) => new bi({ merge: false, keepCstNodes: true }).parse(a)), r = new Dr(t), s = [], i = { text: t, locator: r, comments: s, transformOffset: (a) => ks(a, i), transformRange: (a) => vs(a, i), transformNode: (a) => As(a, i), transformContent: (a) => kt(a, i) };
4134
+ for (let a of n) for (let c of a.errors) if (!(c instanceof er && c.message === 'Map keys must be unique; "<<" is repeated')) throw Cs(c, i);
4135
+ n.forEach((a) => ct(a.cstNode));
4136
+ let o = Fr(i.transformRange({ origStart: 0, origEnd: i.text.length }), n.map(i.transformNode), s);
4137
+ return Yr(o), An(o), On(o), o;
4138
+ }
4139
+ function Qa(t, e) {
4140
+ let n = new SyntaxError(t + " (" + e.loc.start.line + ":" + e.loc.start.column + ")");
4141
+ return Object.assign(n, e);
4142
+ }
4143
+ var Li = Qa;
4144
+ function Ja(t) {
4145
+ try {
4146
+ let e = Oi(t);
4147
+ return delete e.comments, e;
4148
+ } catch (e) {
4149
+ throw e != null && e.position ? Li(e.message, { loc: e.position, cause: e }) : e;
4150
+ }
4151
+ }
4152
+ var Ga = { astFormat: "yaml", parse: Ja, hasPragma: Sr, locStart: Pe, locEnd: yr };
4153
+ var Ha = { yaml: Pr };
4154
+ var Oh = nr;
4155
+
4156
+ export { Oh as default, _r as languages, xr as options, tr as parsers, Ha as printers };