@syncshio/kano-plugin-dsh 0.0.0-stage → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/entry.js ADDED
@@ -0,0 +1,4454 @@
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, openBlock as c, ref as l, renderList as u, shallowRef as d, toDisplayString as f, unref as p, watch as m, withCtx as h } from "vue";
2
+ import { Button as g, DataList as _, DataRow as v, EmptyState as y, PageShell as b, Select as x, buildLocalWebviewUrl as S, resolvePath as C } from "@syncshio/kano-plugin-sdk/host";
3
+ //#region node_modules/yaml/browser/dist/nodes/identity.js
4
+ var ee = Symbol.for("yaml.alias"), w = Symbol.for("yaml.document"), T = Symbol.for("yaml.map"), E = Symbol.for("yaml.pair"), D = Symbol.for("yaml.scalar"), O = Symbol.for("yaml.seq"), k = Symbol.for("yaml.node.type"), A = (e) => !!e && typeof e == "object" && e[k] === ee, te = (e) => !!e && typeof e == "object" && e[k] === w, j = (e) => !!e && typeof e == "object" && e[k] === T, M = (e) => !!e && typeof e == "object" && e[k] === E, N = (e) => !!e && typeof e == "object" && e[k] === D, P = (e) => !!e && typeof e == "object" && e[k] === O;
5
+ function F(e) {
6
+ if (e && typeof e == "object") switch (e[k]) {
7
+ case T:
8
+ case O: return !0;
9
+ }
10
+ return !1;
11
+ }
12
+ function I(e) {
13
+ if (e && typeof e == "object") switch (e[k]) {
14
+ case ee:
15
+ case T:
16
+ case D:
17
+ case O: return !0;
18
+ }
19
+ return !1;
20
+ }
21
+ var ne = (e) => (N(e) || F(e)) && !!e.anchor, L = Symbol("break visit"), re = Symbol("skip children"), ie = Symbol("remove node");
22
+ function R(e, t) {
23
+ let n = oe(t);
24
+ te(e) ? ae(null, e.contents, n, Object.freeze([e])) === ie && (e.contents = null) : ae(null, e, n, Object.freeze([]));
25
+ }
26
+ R.BREAK = L, R.SKIP = re, R.REMOVE = ie;
27
+ function ae(e, t, n, r) {
28
+ let i = se(e, t, n, r);
29
+ if (I(i) || M(i)) return ce(e, r, i), ae(e, i, n, r);
30
+ if (typeof i != "symbol") {
31
+ if (F(t)) {
32
+ r = Object.freeze(r.concat(t));
33
+ for (let e = 0; e < t.items.length; ++e) {
34
+ let i = ae(e, t.items[e], n, r);
35
+ if (typeof i == "number") e = i - 1;
36
+ else if (i === L) return L;
37
+ else i === ie && (t.items.splice(e, 1), --e);
38
+ }
39
+ } else if (M(t)) {
40
+ r = Object.freeze(r.concat(t));
41
+ let e = ae("key", t.key, n, r);
42
+ if (e === L) return L;
43
+ e === ie && (t.key = null);
44
+ let i = ae("value", t.value, n, r);
45
+ if (i === L) return L;
46
+ i === ie && (t.value = null);
47
+ }
48
+ }
49
+ return i;
50
+ }
51
+ function oe(e) {
52
+ return typeof e == "object" && (e.Collection || e.Node || e.Value) ? Object.assign({
53
+ Alias: e.Node,
54
+ Map: e.Node,
55
+ Scalar: e.Node,
56
+ Seq: e.Node
57
+ }, e.Value && {
58
+ Map: e.Value,
59
+ Scalar: e.Value,
60
+ Seq: e.Value
61
+ }, e.Collection && {
62
+ Map: e.Collection,
63
+ Seq: e.Collection
64
+ }, e) : e;
65
+ }
66
+ function se(e, t, n, r) {
67
+ if (typeof n == "function") return n(e, t, r);
68
+ if (j(t)) return n.Map?.(e, t, r);
69
+ if (P(t)) return n.Seq?.(e, t, r);
70
+ if (M(t)) return n.Pair?.(e, t, r);
71
+ if (N(t)) return n.Scalar?.(e, t, r);
72
+ if (A(t)) return n.Alias?.(e, t, r);
73
+ }
74
+ function ce(e, t, n) {
75
+ let r = t[t.length - 1];
76
+ if (F(r)) r.items[e] = n;
77
+ else if (M(r)) e === "key" ? r.key = n : r.value = n;
78
+ else if (te(r)) r.contents = n;
79
+ else {
80
+ let e = A(r) ? "alias" : "scalar";
81
+ throw Error(`Cannot replace node with ${e} parent`);
82
+ }
83
+ }
84
+ //#endregion
85
+ //#region node_modules/yaml/browser/dist/doc/directives.js
86
+ var le = {
87
+ "!": "%21",
88
+ ",": "%2C",
89
+ "[": "%5B",
90
+ "]": "%5D",
91
+ "{": "%7B",
92
+ "}": "%7D"
93
+ }, ue = (e) => e.replace(/[!,[\]{}]/g, (e) => le[e]), de = class e {
94
+ constructor(t, n) {
95
+ this.docStart = null, this.docEnd = !1, this.yaml = Object.assign({}, e.defaultYaml, t), this.tags = Object.assign({}, e.defaultTags, n);
96
+ }
97
+ clone() {
98
+ let t = new e(this.yaml, this.tags);
99
+ return t.docStart = this.docStart, t;
100
+ }
101
+ atDocument() {
102
+ let t = new e(this.yaml, this.tags);
103
+ switch (this.yaml.version) {
104
+ case "1.1":
105
+ this.atNextDocument = !0;
106
+ break;
107
+ case "1.2": this.atNextDocument = !1, this.yaml = {
108
+ explicit: e.defaultYaml.explicit,
109
+ version: "1.2"
110
+ }, this.tags = Object.assign({}, e.defaultTags);
111
+ }
112
+ return t;
113
+ }
114
+ add(t, n) {
115
+ this.atNextDocument &&= (this.yaml = {
116
+ explicit: e.defaultYaml.explicit,
117
+ version: "1.1"
118
+ }, this.tags = Object.assign({}, e.defaultTags), !1);
119
+ let r = t.trim().split(/[ \t]+/), i = r.shift();
120
+ switch (i) {
121
+ case "%TAG": {
122
+ if (r.length !== 2 && (n(0, "%TAG directive should contain exactly two parts"), r.length < 2)) return !1;
123
+ let [e, t] = r;
124
+ return this.tags[e] = t, !0;
125
+ }
126
+ case "%YAML": {
127
+ if (this.yaml.explicit = !0, r.length !== 1) return n(0, "%YAML directive should contain exactly one part"), !1;
128
+ let [e] = r;
129
+ if (e === "1.1" || e === "1.2") return this.yaml.version = e, !0;
130
+ {
131
+ let t = /^\d+\.\d+$/.test(e);
132
+ return n(6, `Unsupported YAML version ${e}`, t), !1;
133
+ }
134
+ }
135
+ default: return n(0, `Unknown directive ${i}`, !0), !1;
136
+ }
137
+ }
138
+ tagName(e, t) {
139
+ if (e === "!") return "!";
140
+ if (e[0] !== "!") return t(`Not a valid tag: ${e}`), null;
141
+ if (e[1] === "<") {
142
+ let n = e.slice(2, -1);
143
+ return n === "!" || n === "!!" ? (t(`Verbatim tags aren't resolved, so ${e} is invalid.`), null) : (e[e.length - 1] !== ">" && t("Verbatim tags must end with a >"), n);
144
+ }
145
+ let [, n, r] = e.match(/^(.*!)([^!]*)$/s);
146
+ r || t(`The ${e} tag has no suffix`);
147
+ let i = this.tags[n];
148
+ if (i) try {
149
+ return i + decodeURIComponent(r);
150
+ } catch (e) {
151
+ return t(String(e)), null;
152
+ }
153
+ return n === "!" ? e : (t(`Could not resolve tag: ${e}`), null);
154
+ }
155
+ tagString(e) {
156
+ for (let [t, n] of Object.entries(this.tags)) if (e.startsWith(n)) return t + ue(e.substring(n.length));
157
+ return e[0] === "!" ? e : `!<${e}>`;
158
+ }
159
+ toString(e) {
160
+ let t = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [], n = Object.entries(this.tags), r;
161
+ if (e && n.length > 0 && I(e.contents)) {
162
+ let t = {};
163
+ R(e.contents, (e, n) => {
164
+ I(n) && n.tag && (t[n.tag] = !0);
165
+ }), r = Object.keys(t);
166
+ } else r = [];
167
+ for (let [i, a] of n) (i !== "!!" || a !== "tag:yaml.org,2002:") && (!e || r.some((e) => e.startsWith(a))) && t.push(`%TAG ${i} ${a}`);
168
+ return t.join("\n");
169
+ }
170
+ };
171
+ de.defaultYaml = {
172
+ explicit: !1,
173
+ version: "1.2"
174
+ }, de.defaultTags = { "!!": "tag:yaml.org,2002:" };
175
+ //#endregion
176
+ //#region node_modules/yaml/browser/dist/doc/anchors.js
177
+ function fe(e) {
178
+ if (/[\x00-\x19\s,[\]{}]/.test(e)) {
179
+ let t = `Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;
180
+ throw Error(t);
181
+ }
182
+ return !0;
183
+ }
184
+ function pe(e) {
185
+ let t = /* @__PURE__ */ new Set();
186
+ return R(e, { Value(e, n) {
187
+ n.anchor && t.add(n.anchor);
188
+ } }), t;
189
+ }
190
+ function me(e, t) {
191
+ for (let n = 1;; ++n) {
192
+ let r = `${e}${n}`;
193
+ if (!t.has(r)) return r;
194
+ }
195
+ }
196
+ function he(e, t) {
197
+ let n = [], r = /* @__PURE__ */ new Map(), i = null;
198
+ return {
199
+ onAnchor: (r) => {
200
+ n.push(r), i ||= pe(e);
201
+ let a = me(t, i);
202
+ return i.add(a), a;
203
+ },
204
+ setAnchors: () => {
205
+ for (let e of n) {
206
+ let t = r.get(e);
207
+ if (typeof t == "object" && t.anchor && (N(t.node) || F(t.node))) t.node.anchor = t.anchor;
208
+ else {
209
+ let t = /* @__PURE__ */ Error("Failed to resolve repeated object (this should not happen)");
210
+ throw t.source = e, t;
211
+ }
212
+ }
213
+ },
214
+ sourceObjects: r
215
+ };
216
+ }
217
+ //#endregion
218
+ //#region node_modules/yaml/browser/dist/doc/applyReviver.js
219
+ function ge(e, t, n, r) {
220
+ if (r && typeof r == "object") {
221
+ if (Array.isArray(r)) for (let t = 0, n = r.length; t < n; ++t) {
222
+ let n = r[t], i = ge(e, r, String(t), n);
223
+ i === void 0 ? delete r[t] : i !== n && (r[t] = i);
224
+ }
225
+ else if (r instanceof Map) for (let t of Array.from(r.keys())) {
226
+ let n = r.get(t), i = ge(e, r, t, n);
227
+ i === void 0 ? r.delete(t) : i !== n && r.set(t, i);
228
+ }
229
+ else if (r instanceof Set) for (let t of Array.from(r)) {
230
+ let n = ge(e, r, t, t);
231
+ n === void 0 ? r.delete(t) : n !== t && (r.delete(t), r.add(n));
232
+ }
233
+ else for (let [t, n] of Object.entries(r)) {
234
+ let i = ge(e, r, t, n);
235
+ i === void 0 ? delete r[t] : i !== n && (r[t] = i);
236
+ }
237
+ }
238
+ return e.call(t, n, r);
239
+ }
240
+ //#endregion
241
+ //#region node_modules/yaml/browser/dist/nodes/toJS.js
242
+ function z(e, t, n) {
243
+ if (Array.isArray(e)) return e.map((e, t) => z(e, String(t), n));
244
+ if (e && typeof e.toJSON == "function") {
245
+ if (!n || !ne(e)) return e.toJSON(t, n);
246
+ let r = {
247
+ aliasCount: 0,
248
+ count: 1,
249
+ res: void 0
250
+ };
251
+ n.anchors.set(e, r), n.onCreate = (e) => {
252
+ r.res = e, delete n.onCreate;
253
+ };
254
+ let i = e.toJSON(t, n);
255
+ return n.onCreate && n.onCreate(i), i;
256
+ }
257
+ return typeof e == "bigint" && !n?.keep ? Number(e) : e;
258
+ }
259
+ //#endregion
260
+ //#region node_modules/yaml/browser/dist/nodes/Node.js
261
+ var _e = class {
262
+ constructor(e) {
263
+ Object.defineProperty(this, k, { value: e });
264
+ }
265
+ clone() {
266
+ let e = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
267
+ return this.range && (e.range = this.range.slice()), e;
268
+ }
269
+ toJS(e, { mapAsMap: t, maxAliasCount: n, onAnchor: r, reviver: i } = {}) {
270
+ if (!te(e)) throw TypeError("A document argument is required");
271
+ let a = {
272
+ anchors: /* @__PURE__ */ new Map(),
273
+ doc: e,
274
+ keep: !0,
275
+ mapAsMap: t === !0,
276
+ mapKeyWarned: !1,
277
+ maxAliasCount: typeof n == "number" ? n : 100
278
+ }, o = z(this, "", a);
279
+ if (typeof r == "function") for (let { count: e, res: t } of a.anchors.values()) r(t, e);
280
+ return typeof i == "function" ? ge(i, { "": o }, "", o) : o;
281
+ }
282
+ }, ve = class extends _e {
283
+ constructor(e) {
284
+ super(ee), this.source = e, Object.defineProperty(this, "tag", { set() {
285
+ throw Error("Alias nodes cannot have tags");
286
+ } });
287
+ }
288
+ resolve(e) {
289
+ let t;
290
+ return R(e, { Node: (e, n) => {
291
+ if (n === this) return R.BREAK;
292
+ n.anchor === this.source && (t = n);
293
+ } }), t;
294
+ }
295
+ toJSON(e, t) {
296
+ if (!t) return { source: this.source };
297
+ let { anchors: n, doc: r, maxAliasCount: i } = t, a = this.resolve(r);
298
+ if (!a) {
299
+ let e = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
300
+ throw ReferenceError(e);
301
+ }
302
+ let o = n.get(a);
303
+ /* istanbul ignore if */
304
+ if (o ||= (z(a, null, t), n.get(a)), !o || o.res === void 0) throw ReferenceError("This should not happen: Alias anchor was not resolved?");
305
+ if (i >= 0 && (o.count += 1, o.aliasCount === 0 && (o.aliasCount = ye(r, a, n)), o.count * o.aliasCount > i)) throw ReferenceError("Excessive alias count indicates a resource exhaustion attack");
306
+ return o.res;
307
+ }
308
+ toString(e, t, n) {
309
+ let r = `*${this.source}`;
310
+ if (e) {
311
+ if (fe(this.source), e.options.verifyAliasOrder && !e.anchors.has(this.source)) {
312
+ let e = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
313
+ throw Error(e);
314
+ }
315
+ if (e.implicitKey) return `${r} `;
316
+ }
317
+ return r;
318
+ }
319
+ };
320
+ function ye(e, t, n) {
321
+ if (A(t)) {
322
+ let r = t.resolve(e), i = n && r && n.get(r);
323
+ return i ? i.count * i.aliasCount : 0;
324
+ }
325
+ if (F(t)) {
326
+ let r = 0;
327
+ for (let i of t.items) {
328
+ let t = ye(e, i, n);
329
+ t > r && (r = t);
330
+ }
331
+ return r;
332
+ }
333
+ if (M(t)) {
334
+ let r = ye(e, t.key, n), i = ye(e, t.value, n);
335
+ return Math.max(r, i);
336
+ }
337
+ return 1;
338
+ }
339
+ //#endregion
340
+ //#region node_modules/yaml/browser/dist/nodes/Scalar.js
341
+ var be = (e) => !e || typeof e != "function" && typeof e != "object", B = class extends _e {
342
+ constructor(e) {
343
+ super(D), this.value = e;
344
+ }
345
+ toJSON(e, t) {
346
+ return t?.keep ? this.value : z(this.value, e, t);
347
+ }
348
+ toString() {
349
+ return String(this.value);
350
+ }
351
+ };
352
+ B.BLOCK_FOLDED = "BLOCK_FOLDED", B.BLOCK_LITERAL = "BLOCK_LITERAL", B.PLAIN = "PLAIN", B.QUOTE_DOUBLE = "QUOTE_DOUBLE", B.QUOTE_SINGLE = "QUOTE_SINGLE";
353
+ //#endregion
354
+ //#region node_modules/yaml/browser/dist/doc/createNode.js
355
+ var xe = "tag:yaml.org,2002:";
356
+ function Se(e, t, n) {
357
+ if (t) {
358
+ let e = n.filter((e) => e.tag === t), r = e.find((e) => !e.format) ?? e[0];
359
+ if (!r) throw Error(`Tag ${t} not found`);
360
+ return r;
361
+ }
362
+ return n.find((t) => t.identify?.(e) && !t.format);
363
+ }
364
+ function Ce(e, t, n) {
365
+ if (te(e) && (e = e.contents), I(e)) return e;
366
+ if (M(e)) {
367
+ let t = n.schema[T].createNode?.(n.schema, null, n);
368
+ return t.items.push(e), t;
369
+ }
370
+ (e instanceof String || e instanceof Number || e instanceof Boolean || typeof BigInt < "u" && e instanceof BigInt) && (e = e.valueOf());
371
+ let { aliasDuplicateObjects: r, onAnchor: i, onTagObj: a, schema: o, sourceObjects: s } = n, c;
372
+ if (r && e && typeof e == "object") {
373
+ if (c = s.get(e), c) return c.anchor || (c.anchor = i(e)), new ve(c.anchor);
374
+ c = {
375
+ anchor: null,
376
+ node: null
377
+ }, s.set(e, c);
378
+ }
379
+ t?.startsWith("!!") && (t = xe + t.slice(2));
380
+ let l = Se(e, t, o.tags);
381
+ if (!l) {
382
+ if (e && typeof e.toJSON == "function" && (e = e.toJSON()), !e || typeof e != "object") {
383
+ let t = new B(e);
384
+ return c && (c.node = t), t;
385
+ }
386
+ l = e instanceof Map ? o[T] : Symbol.iterator in Object(e) ? o[O] : o[T];
387
+ }
388
+ a && (a(l), delete n.onTagObj);
389
+ let u = l?.createNode ? l.createNode(n.schema, e, n) : typeof l?.nodeClass?.from == "function" ? l.nodeClass.from(n.schema, e, n) : new B(e);
390
+ return t ? u.tag = t : l.default || (u.tag = l.tag), c && (c.node = u), u;
391
+ }
392
+ //#endregion
393
+ //#region node_modules/yaml/browser/dist/nodes/Collection.js
394
+ function we(e, t, n) {
395
+ let r = n;
396
+ for (let e = t.length - 1; e >= 0; --e) {
397
+ let n = t[e];
398
+ if (typeof n == "number" && Number.isInteger(n) && n >= 0) {
399
+ let e = [];
400
+ e[n] = r, r = e;
401
+ } else r = /* @__PURE__ */ new Map([[n, r]]);
402
+ }
403
+ return Ce(r, void 0, {
404
+ aliasDuplicateObjects: !1,
405
+ keepUndefined: !1,
406
+ onAnchor: () => {
407
+ throw Error("This should not happen, please report a bug.");
408
+ },
409
+ schema: e,
410
+ sourceObjects: /* @__PURE__ */ new Map()
411
+ });
412
+ }
413
+ var Te = (e) => e == null || typeof e == "object" && !!e[Symbol.iterator]().next().done, Ee = class extends _e {
414
+ constructor(e, t) {
415
+ super(e), Object.defineProperty(this, "schema", {
416
+ value: t,
417
+ configurable: !0,
418
+ enumerable: !1,
419
+ writable: !0
420
+ });
421
+ }
422
+ clone(e) {
423
+ let t = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
424
+ return e && (t.schema = e), t.items = t.items.map((t) => I(t) || M(t) ? t.clone(e) : t), this.range && (t.range = this.range.slice()), t;
425
+ }
426
+ addIn(e, t) {
427
+ if (Te(e)) this.add(t);
428
+ else {
429
+ let [n, ...r] = e, i = this.get(n, !0);
430
+ if (F(i)) i.addIn(r, t);
431
+ else if (i === void 0 && this.schema) this.set(n, we(this.schema, r, t));
432
+ else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);
433
+ }
434
+ }
435
+ deleteIn(e) {
436
+ let [t, ...n] = e;
437
+ if (n.length === 0) return this.delete(t);
438
+ let r = this.get(t, !0);
439
+ if (F(r)) return r.deleteIn(n);
440
+ throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`);
441
+ }
442
+ getIn(e, t) {
443
+ let [n, ...r] = e, i = this.get(n, !0);
444
+ return r.length === 0 ? !t && N(i) ? i.value : i : F(i) ? i.getIn(r, t) : void 0;
445
+ }
446
+ hasAllNullValues(e) {
447
+ return this.items.every((t) => {
448
+ if (!M(t)) return !1;
449
+ let n = t.value;
450
+ return n == null || e && N(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
451
+ });
452
+ }
453
+ hasIn(e) {
454
+ let [t, ...n] = e;
455
+ if (n.length === 0) return this.has(t);
456
+ let r = this.get(t, !0);
457
+ return F(r) ? r.hasIn(n) : !1;
458
+ }
459
+ setIn(e, t) {
460
+ let [n, ...r] = e;
461
+ if (r.length === 0) this.set(n, t);
462
+ else {
463
+ let e = this.get(n, !0);
464
+ if (F(e)) e.setIn(r, t);
465
+ else if (e === void 0 && this.schema) this.set(n, we(this.schema, r, t));
466
+ else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);
467
+ }
468
+ }
469
+ };
470
+ Ee.maxFlowStringSingleLineLength = 60;
471
+ //#endregion
472
+ //#region node_modules/yaml/browser/dist/stringify/stringifyComment.js
473
+ var De = (e) => e.replace(/^(?!$)(?: $)?/gm, "#");
474
+ function V(e, t) {
475
+ return /^\n+$/.test(e) ? e.substring(1) : t ? e.replace(/^(?! *$)/gm, t) : e;
476
+ }
477
+ var H = (e, t, n) => e.endsWith("\n") ? V(n, t) : n.includes("\n") ? "\n" + V(n, t) : (e.endsWith(" ") ? "" : " ") + n, Oe = "flow", ke = "block", Ae = "quoted";
478
+ function je(e, t, n = "flow", { indentAtStart: r, lineWidth: i = 80, minContentWidth: a = 20, onFold: o, onOverflow: s } = {}) {
479
+ if (!i || i < 0) return e;
480
+ let c = Math.max(1 + a, 1 + i - t.length);
481
+ if (e.length <= c) return e;
482
+ let l = [], u = {}, d = i - t.length;
483
+ typeof r == "number" && (r > i - Math.max(2, a) ? l.push(0) : d = i - r);
484
+ let f, p, m = !1, h = -1, g = -1, _ = -1;
485
+ n === "block" && (h = Me(e, h, t.length), h !== -1 && (d = h + c));
486
+ for (let r; r = e[h += 1];) {
487
+ if (n === "quoted" && r === "\\") {
488
+ switch (g = h, e[h + 1]) {
489
+ case "x":
490
+ h += 3;
491
+ break;
492
+ case "u":
493
+ h += 5;
494
+ break;
495
+ case "U":
496
+ h += 9;
497
+ break;
498
+ default: h += 1;
499
+ }
500
+ _ = h;
501
+ }
502
+ if (r === "\n") n === "block" && (h = Me(e, h, t.length)), d = h + t.length + c, f = void 0;
503
+ else {
504
+ if (r === " " && p && p !== " " && p !== "\n" && p !== " ") {
505
+ let t = e[h + 1];
506
+ t && t !== " " && t !== "\n" && t !== " " && (f = h);
507
+ }
508
+ if (h >= d) {
509
+ if (f) l.push(f), d = f + c, f = void 0;
510
+ else if (n === "quoted") {
511
+ for (; p === " " || p === " ";) p = r, r = e[h += 1], m = !0;
512
+ let t = h > _ + 1 ? h - 2 : g - 1;
513
+ if (u[t]) return e;
514
+ l.push(t), u[t] = !0, d = t + c, f = void 0;
515
+ } else m = !0;
516
+ }
517
+ }
518
+ p = r;
519
+ }
520
+ if (m && s && s(), l.length === 0) return e;
521
+ o && o();
522
+ let v = e.slice(0, l[0]);
523
+ for (let r = 0; r < l.length; ++r) {
524
+ let i = l[r], a = l[r + 1] || e.length;
525
+ i === 0 ? v = `\n${t}${e.slice(0, a)}` : (n === "quoted" && u[i] && (v += `${e[i]}\\`), v += `\n${t}${e.slice(i + 1, a)}`);
526
+ }
527
+ return v;
528
+ }
529
+ function Me(e, t, n) {
530
+ let r = t, i = t + 1, a = e[i];
531
+ for (; a === " " || a === " ";) if (t < i + n) a = e[++t];
532
+ else {
533
+ do
534
+ a = e[++t];
535
+ while (a && a !== "\n");
536
+ r = t, i = t + 1, a = e[i];
537
+ }
538
+ return r;
539
+ }
540
+ //#endregion
541
+ //#region node_modules/yaml/browser/dist/stringify/stringifyString.js
542
+ var Ne = (e, t) => ({
543
+ indentAtStart: t ? e.indent.length : e.indentAtStart,
544
+ lineWidth: e.options.lineWidth,
545
+ minContentWidth: e.options.minContentWidth
546
+ }), Pe = (e) => /^(%|---|\.\.\.)/m.test(e);
547
+ function Fe(e, t, n) {
548
+ if (!t || t < 0) return !1;
549
+ let r = t - n, i = e.length;
550
+ if (i <= r) return !1;
551
+ for (let t = 0, n = 0; t < i; ++t) if (e[t] === "\n") {
552
+ if (t - n > r) return !0;
553
+ if (n = t + 1, i - n <= r) return !1;
554
+ }
555
+ return !0;
556
+ }
557
+ function Ie(e, t) {
558
+ let n = JSON.stringify(e);
559
+ if (t.options.doubleQuotedAsJSON) return n;
560
+ let { implicitKey: r } = t, i = t.options.doubleQuotedMinMultiLineLength, a = t.indent || (Pe(e) ? " " : ""), o = "", s = 0;
561
+ for (let e = 0, t = n[e]; t; t = n[++e]) if (t === " " && n[e + 1] === "\\" && n[e + 2] === "n" && (o += n.slice(s, e) + "\\ ", e += 1, s = e, t = "\\"), t === "\\") switch (n[e + 1]) {
562
+ case "u":
563
+ {
564
+ o += n.slice(s, e);
565
+ let t = n.substr(e + 2, 4);
566
+ switch (t) {
567
+ case "0000":
568
+ o += "\\0";
569
+ break;
570
+ case "0007":
571
+ o += "\\a";
572
+ break;
573
+ case "000b":
574
+ o += "\\v";
575
+ break;
576
+ case "001b":
577
+ o += "\\e";
578
+ break;
579
+ case "0085":
580
+ o += "\\N";
581
+ break;
582
+ case "00a0":
583
+ o += "\\_";
584
+ break;
585
+ case "2028":
586
+ o += "\\L";
587
+ break;
588
+ case "2029":
589
+ o += "\\P";
590
+ break;
591
+ default: t.substr(0, 2) === "00" ? o += "\\x" + t.substr(2) : o += n.substr(e, 6);
592
+ }
593
+ e += 5, s = e + 1;
594
+ }
595
+ break;
596
+ case "n":
597
+ if (r || n[e + 2] === "\"" || n.length < i) e += 1;
598
+ else {
599
+ for (o += n.slice(s, e) + "\n\n"; n[e + 2] === "\\" && n[e + 3] === "n" && n[e + 4] !== "\"";) o += "\n", e += 2;
600
+ o += a, n[e + 2] === " " && (o += "\\"), e += 1, s = e + 1;
601
+ }
602
+ break;
603
+ default: e += 1;
604
+ }
605
+ return o = s ? o + n.slice(s) : n, r ? o : je(o, a, Ae, Ne(t, !1));
606
+ }
607
+ function Le(e, t) {
608
+ if (t.options.singleQuote === !1 || t.implicitKey && e.includes("\n") || /[ \t]\n|\n[ \t]/.test(e)) return Ie(e, t);
609
+ let n = t.indent || (Pe(e) ? " " : ""), r = "'" + e.replace(/'/g, "''").replace(/\n+/g, `$&\n${n}`) + "'";
610
+ return t.implicitKey ? r : je(r, n, Oe, Ne(t, !1));
611
+ }
612
+ function U(e, t) {
613
+ let { singleQuote: n } = t.options, r;
614
+ if (n === !1) r = Ie;
615
+ else {
616
+ let t = e.includes("\""), i = e.includes("'");
617
+ r = t && !i ? Le : i && !t ? Ie : n ? Le : Ie;
618
+ }
619
+ return r(e, t);
620
+ }
621
+ var Re;
622
+ try {
623
+ Re = /* @__PURE__ */ RegExp("(^|(?<!\n))\n+(?!\n|$)", "g");
624
+ } catch {
625
+ Re = /\n+(?!\n|$)/g;
626
+ }
627
+ function ze({ comment: e, type: t, value: n }, r, i, a) {
628
+ let { blockQuote: o, commentString: s, lineWidth: c } = r.options;
629
+ if (!o || /\n[\t ]+$/.test(n) || /^\s*$/.test(n)) return U(n, r);
630
+ let l = r.indent || (r.forceBlockIndent || Pe(n) ? " " : ""), u = o === "literal" ? !0 : o === "folded" || t === B.BLOCK_FOLDED ? !1 : t === B.BLOCK_LITERAL || !Fe(n, c, l.length);
631
+ if (!n) return u ? "|\n" : ">\n";
632
+ let d, f;
633
+ for (f = n.length; f > 0; --f) {
634
+ let e = n[f - 1];
635
+ if (e !== "\n" && e !== " " && e !== " ") break;
636
+ }
637
+ let p = n.substring(f), m = p.indexOf("\n");
638
+ m === -1 ? d = "-" : n === p || m !== p.length - 1 ? (d = "+", a && a()) : d = "", p &&= (n = n.slice(0, -p.length), p[p.length - 1] === "\n" && (p = p.slice(0, -1)), p.replace(Re, `$&${l}`));
639
+ let h = !1, g, _ = -1;
640
+ for (g = 0; g < n.length; ++g) {
641
+ let e = n[g];
642
+ if (e === " ") h = !0;
643
+ else if (e === "\n") _ = g;
644
+ else break;
645
+ }
646
+ let v = n.substring(0, _ < g ? _ + 1 : g);
647
+ v &&= (n = n.substring(v.length), v.replace(/\n+/g, `$&${l}`));
648
+ let y = (u ? "|" : ">") + (h ? l ? "2" : "1" : "") + d;
649
+ if (e && (y += " " + s(e.replace(/ ?[\r\n]+/g, " ")), i && i()), u) return n = n.replace(/\n+/g, `$&${l}`), `${y}\n${l}${v}${n}${p}`;
650
+ n = n.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${l}`);
651
+ let b = je(`${v}${n}${p}`, l, ke, Ne(r, !0));
652
+ return `${y}\n${l}${b}`;
653
+ }
654
+ function Be(e, t, n, r) {
655
+ let { type: i, value: a } = e, { actualString: o, implicitKey: s, indent: c, indentStep: l, inFlow: u } = t;
656
+ if (s && a.includes("\n") || u && /[[\]{},]/.test(a)) return U(a, t);
657
+ if (!a || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a)) return s || u || !a.includes("\n") ? U(a, t) : ze(e, t, n, r);
658
+ if (!s && !u && i !== B.PLAIN && a.includes("\n")) return ze(e, t, n, r);
659
+ if (Pe(a)) {
660
+ if (c === "") return t.forceBlockIndent = !0, ze(e, t, n, r);
661
+ if (s && c === l) return U(a, t);
662
+ }
663
+ let d = a.replace(/\n+/g, `$&\n${c}`);
664
+ if (o) {
665
+ let e = (e) => e.default && e.tag !== "tag:yaml.org,2002:str" && e.test?.test(d), { compat: n, tags: r } = t.doc.schema;
666
+ if (r.some(e) || n?.some(e)) return U(a, t);
667
+ }
668
+ return s ? d : je(d, c, Oe, Ne(t, !1));
669
+ }
670
+ function Ve(e, t, n, r) {
671
+ let { implicitKey: i, inFlow: a } = t, o = typeof e.value == "string" ? e : Object.assign({}, e, { value: String(e.value) }), { type: s } = e;
672
+ s !== B.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value) && (s = B.QUOTE_DOUBLE);
673
+ let c = (e) => {
674
+ switch (e) {
675
+ case B.BLOCK_FOLDED:
676
+ case B.BLOCK_LITERAL: return i || a ? U(o.value, t) : ze(o, t, n, r);
677
+ case B.QUOTE_DOUBLE: return Ie(o.value, t);
678
+ case B.QUOTE_SINGLE: return Le(o.value, t);
679
+ case B.PLAIN: return Be(o, t, n, r);
680
+ default: return null;
681
+ }
682
+ }, l = c(s);
683
+ if (l === null) {
684
+ let { defaultKeyType: e, defaultStringType: n } = t.options, r = i && e || n;
685
+ if (l = c(r), l === null) throw Error(`Unsupported default string type ${r}`);
686
+ }
687
+ return l;
688
+ }
689
+ //#endregion
690
+ //#region node_modules/yaml/browser/dist/stringify/stringify.js
691
+ function He(e, t) {
692
+ let n = Object.assign({
693
+ blockQuote: !0,
694
+ commentString: De,
695
+ defaultKeyType: null,
696
+ defaultStringType: "PLAIN",
697
+ directives: null,
698
+ doubleQuotedAsJSON: !1,
699
+ doubleQuotedMinMultiLineLength: 40,
700
+ falseStr: "false",
701
+ flowCollectionPadding: !0,
702
+ indentSeq: !0,
703
+ lineWidth: 80,
704
+ minContentWidth: 20,
705
+ nullStr: "null",
706
+ simpleKeys: !1,
707
+ singleQuote: null,
708
+ trueStr: "true",
709
+ verifyAliasOrder: !0
710
+ }, e.schema.toStringOptions, t), r;
711
+ switch (n.collectionStyle) {
712
+ case "block":
713
+ r = !1;
714
+ break;
715
+ case "flow":
716
+ r = !0;
717
+ break;
718
+ default: r = null;
719
+ }
720
+ return {
721
+ anchors: /* @__PURE__ */ new Set(),
722
+ doc: e,
723
+ flowCollectionPadding: n.flowCollectionPadding ? " " : "",
724
+ indent: "",
725
+ indentStep: typeof n.indent == "number" ? " ".repeat(n.indent) : " ",
726
+ inFlow: r,
727
+ options: n
728
+ };
729
+ }
730
+ function Ue(e, t) {
731
+ if (t.tag) {
732
+ let n = e.filter((e) => e.tag === t.tag);
733
+ if (n.length > 0) return n.find((e) => e.format === t.format) ?? n[0];
734
+ }
735
+ let n, r;
736
+ if (N(t)) {
737
+ r = t.value;
738
+ let i = e.filter((e) => e.identify?.(r));
739
+ n = i.find((e) => e.format === t.format) ?? i.find((e) => !e.format);
740
+ } else r = t, n = e.find((e) => e.nodeClass && r instanceof e.nodeClass);
741
+ if (!n) {
742
+ let e = r?.constructor?.name ?? typeof r;
743
+ throw Error(`Tag not resolved for ${e} value`);
744
+ }
745
+ return n;
746
+ }
747
+ function We(e, t, { anchors: n, doc: r }) {
748
+ if (!r.directives) return "";
749
+ let i = [], a = (N(e) || F(e)) && e.anchor;
750
+ a && fe(a) && (n.add(a), i.push(`&${a}`));
751
+ let o = e.tag ? e.tag : t.default ? null : t.tag;
752
+ return o && i.push(r.directives.tagString(o)), i.join(" ");
753
+ }
754
+ function W(e, t, n, r) {
755
+ if (M(e)) return e.toString(t, n, r);
756
+ if (A(e)) {
757
+ if (t.doc.directives) return e.toString(t);
758
+ if (t.resolvedAliases?.has(e)) throw TypeError("Cannot stringify circular structure without alias nodes");
759
+ t.resolvedAliases ? t.resolvedAliases.add(e) : t.resolvedAliases = /* @__PURE__ */ new Set([e]), e = e.resolve(t.doc);
760
+ }
761
+ let i, a = I(e) ? e : t.doc.createNode(e, { onTagObj: (e) => i = e });
762
+ i ||= Ue(t.doc.schema.tags, a);
763
+ let o = We(a, i, t);
764
+ o.length > 0 && (t.indentAtStart = (t.indentAtStart ?? 0) + o.length + 1);
765
+ let s = typeof i.stringify == "function" ? i.stringify(a, t, n, r) : N(a) ? Ve(a, t, n, r) : a.toString(t, n, r);
766
+ return o ? N(a) || s[0] === "{" || s[0] === "[" ? `${o} ${s}` : `${o}\n${t.indent}${s}` : s;
767
+ }
768
+ //#endregion
769
+ //#region node_modules/yaml/browser/dist/stringify/stringifyPair.js
770
+ function Ge({ key: e, value: t }, n, r, i) {
771
+ let { allNullValues: a, doc: o, indent: s, indentStep: c, options: { commentString: l, indentSeq: u, simpleKeys: d } } = n, f = I(e) && e.comment || null;
772
+ if (d) {
773
+ if (f) throw Error("With simple keys, key nodes cannot have comments");
774
+ if (F(e) || !I(e) && typeof e == "object") throw Error("With simple keys, collection cannot be used as a key value");
775
+ }
776
+ let p = !d && (!e || f && t == null && !n.inFlow || F(e) || (N(e) ? e.type === B.BLOCK_FOLDED || e.type === B.BLOCK_LITERAL : typeof e == "object"));
777
+ n = Object.assign({}, n, {
778
+ allNullValues: !1,
779
+ implicitKey: !p && (d || !a),
780
+ indent: s + c
781
+ });
782
+ let m = !1, h = !1, g = W(e, n, () => m = !0, () => h = !0);
783
+ if (!p && !n.inFlow && g.length > 1024) {
784
+ if (d) throw Error("With simple keys, single line scalar must not span more than 1024 characters");
785
+ p = !0;
786
+ }
787
+ if (n.inFlow) {
788
+ if (a || t == null) return m && r && r(), g === "" ? "?" : p ? `? ${g}` : g;
789
+ } else if (a && !d || t == null && p) return g = `? ${g}`, f && !m ? g += H(g, n.indent, l(f)) : h && i && i(), g;
790
+ m && (f = null), p ? (f && (g += H(g, n.indent, l(f))), g = `? ${g}\n${s}:`) : (g = `${g}:`, f && (g += H(g, n.indent, l(f))));
791
+ let _, v, y;
792
+ I(t) ? (_ = !!t.spaceBefore, v = t.commentBefore, y = t.comment) : (_ = !1, v = null, y = null, t && typeof t == "object" && (t = o.createNode(t))), n.implicitKey = !1, !p && !f && N(t) && (n.indentAtStart = g.length + 1), h = !1, !u && c.length >= 2 && !n.inFlow && !p && P(t) && !t.flow && !t.tag && !t.anchor && (n.indent = n.indent.substring(2));
793
+ let b = !1, x = W(t, n, () => b = !0, () => h = !0), S = " ";
794
+ if (f || _ || v) {
795
+ if (S = _ ? "\n" : "", v) {
796
+ let e = l(v);
797
+ S += `\n${V(e, n.indent)}`;
798
+ }
799
+ x === "" && !n.inFlow ? S === "\n" && (S = "\n\n") : S += `\n${n.indent}`;
800
+ } else if (!p && F(t)) {
801
+ let e = x[0], r = x.indexOf("\n"), i = r !== -1, a = n.inFlow ?? t.flow ?? t.items.length === 0;
802
+ if (i || !a) {
803
+ let t = !1;
804
+ if (i && (e === "&" || e === "!")) {
805
+ let n = x.indexOf(" ");
806
+ e === "&" && n !== -1 && n < r && x[n + 1] === "!" && (n = x.indexOf(" ", n + 1)), (n === -1 || r < n) && (t = !0);
807
+ }
808
+ t || (S = `\n${n.indent}`);
809
+ }
810
+ } else (x === "" || x[0] === "\n") && (S = "");
811
+ return g += S + x, n.inFlow ? b && r && r() : y && !b ? g += H(g, n.indent, l(y)) : h && i && i(), g;
812
+ }
813
+ //#endregion
814
+ //#region node_modules/yaml/browser/dist/log.js
815
+ function Ke(e, t) {
816
+ (e === "debug" || e === "warn") && (typeof process < "u" && process.emitWarning ? process.emitWarning(t) : console.warn(t));
817
+ }
818
+ //#endregion
819
+ //#region node_modules/yaml/browser/dist/nodes/addPairToJSMap.js
820
+ var qe = "<<";
821
+ function Je(e, t, { key: n, value: r }) {
822
+ if (e?.doc.schema.merge && Ye(n)) {
823
+ if (r = A(r) ? r.resolve(e.doc) : r, P(r)) for (let n of r.items) Xe(e, t, n);
824
+ else if (Array.isArray(r)) for (let n of r) Xe(e, t, n);
825
+ else Xe(e, t, r);
826
+ } else {
827
+ let i = z(n, "", e);
828
+ if (t instanceof Map) t.set(i, z(r, i, e));
829
+ else if (t instanceof Set) t.add(i);
830
+ else {
831
+ let a = Ze(n, i, e), o = z(r, a, e);
832
+ a in t ? Object.defineProperty(t, a, {
833
+ value: o,
834
+ writable: !0,
835
+ enumerable: !0,
836
+ configurable: !0
837
+ }) : t[a] = o;
838
+ }
839
+ }
840
+ return t;
841
+ }
842
+ var Ye = (e) => e === qe || N(e) && e.value === qe && (!e.type || e.type === B.PLAIN);
843
+ function Xe(e, t, n) {
844
+ let r = e && A(n) ? n.resolve(e.doc) : n;
845
+ if (!j(r)) throw Error("Merge sources must be maps or map aliases");
846
+ let i = r.toJSON(null, e, Map);
847
+ for (let [e, n] of i) t instanceof Map ? t.has(e) || t.set(e, n) : t instanceof Set ? t.add(e) : Object.prototype.hasOwnProperty.call(t, e) || Object.defineProperty(t, e, {
848
+ value: n,
849
+ writable: !0,
850
+ enumerable: !0,
851
+ configurable: !0
852
+ });
853
+ return t;
854
+ }
855
+ function Ze(e, t, n) {
856
+ if (t === null) return "";
857
+ if (typeof t != "object") return String(t);
858
+ if (I(e) && n?.doc) {
859
+ let t = He(n.doc, {});
860
+ t.anchors = /* @__PURE__ */ new Set();
861
+ for (let e of n.anchors.keys()) t.anchors.add(e.anchor);
862
+ t.inFlow = !0, t.inStringifyKey = !0;
863
+ let r = e.toString(t);
864
+ if (!n.mapKeyWarned) {
865
+ let e = JSON.stringify(r);
866
+ e.length > 40 && (e = e.substring(0, 36) + "...\""), Ke(n.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`), n.mapKeyWarned = !0;
867
+ }
868
+ return r;
869
+ }
870
+ return JSON.stringify(t);
871
+ }
872
+ //#endregion
873
+ //#region node_modules/yaml/browser/dist/nodes/Pair.js
874
+ function Qe(e, t, n) {
875
+ return new G(Ce(e, void 0, n), Ce(t, void 0, n));
876
+ }
877
+ var G = class e {
878
+ constructor(e, t = null) {
879
+ Object.defineProperty(this, k, { value: E }), this.key = e, this.value = t;
880
+ }
881
+ clone(t) {
882
+ let { key: n, value: r } = this;
883
+ return I(n) && (n = n.clone(t)), I(r) && (r = r.clone(t)), new e(n, r);
884
+ }
885
+ toJSON(e, t) {
886
+ return Je(t, t?.mapAsMap ? /* @__PURE__ */ new Map() : {}, this);
887
+ }
888
+ toString(e, t, n) {
889
+ return e?.doc ? Ge(this, e, t, n) : JSON.stringify(this);
890
+ }
891
+ };
892
+ //#endregion
893
+ //#region node_modules/yaml/browser/dist/stringify/stringifyCollection.js
894
+ function $e(e, t, n) {
895
+ return (t.inFlow ?? e.flow ? tt : et)(e, t, n);
896
+ }
897
+ function et({ comment: e, items: t }, n, { blockItemPrefix: r, flowChars: i, itemIndent: a, onChompKeep: o, onComment: s }) {
898
+ let { indent: c, options: { commentString: l } } = n, u = Object.assign({}, n, {
899
+ indent: a,
900
+ type: null
901
+ }), d = !1, f = [];
902
+ for (let e = 0; e < t.length; ++e) {
903
+ let i = t[e], o = null;
904
+ if (I(i)) !d && i.spaceBefore && f.push(""), nt(n, f, i.commentBefore, d), i.comment && (o = i.comment);
905
+ else if (M(i)) {
906
+ let e = I(i.key) ? i.key : null;
907
+ e && (!d && e.spaceBefore && f.push(""), nt(n, f, e.commentBefore, d));
908
+ }
909
+ d = !1;
910
+ let s = W(i, u, () => o = null, () => d = !0);
911
+ o && (s += H(s, a, l(o))), d && o && (d = !1), f.push(r + s);
912
+ }
913
+ let p;
914
+ if (f.length === 0) p = i.start + i.end;
915
+ else {
916
+ p = f[0];
917
+ for (let e = 1; e < f.length; ++e) {
918
+ let t = f[e];
919
+ p += t ? `\n${c}${t}` : "\n";
920
+ }
921
+ }
922
+ return e ? (p += "\n" + V(l(e), c), s && s()) : d && o && o(), p;
923
+ }
924
+ function tt({ items: e }, t, { flowChars: n, itemIndent: r }) {
925
+ let { indent: i, indentStep: a, flowCollectionPadding: o, options: { commentString: s } } = t;
926
+ r += a;
927
+ let c = Object.assign({}, t, {
928
+ indent: r,
929
+ inFlow: !0,
930
+ type: null
931
+ }), l = !1, u = 0, d = [];
932
+ for (let n = 0; n < e.length; ++n) {
933
+ let i = e[n], a = null;
934
+ if (I(i)) i.spaceBefore && d.push(""), nt(t, d, i.commentBefore, !1), i.comment && (a = i.comment);
935
+ else if (M(i)) {
936
+ let e = I(i.key) ? i.key : null;
937
+ e && (e.spaceBefore && d.push(""), nt(t, d, e.commentBefore, !1), e.comment && (l = !0));
938
+ let n = I(i.value) ? i.value : null;
939
+ n ? (n.comment && (a = n.comment), n.commentBefore && (l = !0)) : i.value == null && e?.comment && (a = e.comment);
940
+ }
941
+ a && (l = !0);
942
+ let o = W(i, c, () => a = null);
943
+ n < e.length - 1 && (o += ","), a && (o += H(o, r, s(a))), !l && (d.length > u || o.includes("\n")) && (l = !0), d.push(o), u = d.length;
944
+ }
945
+ let { start: f, end: p } = n;
946
+ if (d.length === 0) return f + p;
947
+ if (!l) {
948
+ let e = d.reduce((e, t) => e + t.length + 2, 2);
949
+ l = t.options.lineWidth > 0 && e > t.options.lineWidth;
950
+ }
951
+ if (l) {
952
+ let e = f;
953
+ for (let t of d) e += t ? `\n${a}${i}${t}` : "\n";
954
+ return `${e}\n${i}${p}`;
955
+ }
956
+ return `${f}${o}${d.join(" ")}${o}${p}`;
957
+ }
958
+ function nt({ indent: e, options: { commentString: t } }, n, r, i) {
959
+ if (r && i && (r = r.replace(/^\n+/, "")), r) {
960
+ let i = V(t(r), e);
961
+ n.push(i.trimStart());
962
+ }
963
+ }
964
+ //#endregion
965
+ //#region node_modules/yaml/browser/dist/nodes/YAMLMap.js
966
+ function K(e, t) {
967
+ let n = N(t) ? t.value : t;
968
+ for (let r of e) if (M(r) && (r.key === t || r.key === n || N(r.key) && r.key.value === n)) return r;
969
+ }
970
+ var q = class extends Ee {
971
+ static get tagName() {
972
+ return "tag:yaml.org,2002:map";
973
+ }
974
+ constructor(e) {
975
+ super(T, e), this.items = [];
976
+ }
977
+ static from(e, t, n) {
978
+ let { keepUndefined: r, replacer: i } = n, a = new this(e), o = (e, o) => {
979
+ if (typeof i == "function") o = i.call(t, e, o);
980
+ else if (Array.isArray(i) && !i.includes(e)) return;
981
+ (o !== void 0 || r) && a.items.push(Qe(e, o, n));
982
+ };
983
+ if (t instanceof Map) for (let [e, n] of t) o(e, n);
984
+ else if (t && typeof t == "object") for (let e of Object.keys(t)) o(e, t[e]);
985
+ return typeof e.sortMapEntries == "function" && a.items.sort(e.sortMapEntries), a;
986
+ }
987
+ add(e, t) {
988
+ let n;
989
+ n = M(e) ? e : !e || typeof e != "object" || !("key" in e) ? new G(e, e?.value) : new G(e.key, e.value);
990
+ let r = K(this.items, n.key), i = this.schema?.sortMapEntries;
991
+ if (r) {
992
+ if (!t) throw Error(`Key ${n.key} already set`);
993
+ N(r.value) && be(n.value) ? r.value.value = n.value : r.value = n.value;
994
+ } else if (i) {
995
+ let e = this.items.findIndex((e) => i(n, e) < 0);
996
+ e === -1 ? this.items.push(n) : this.items.splice(e, 0, n);
997
+ } else this.items.push(n);
998
+ }
999
+ delete(e) {
1000
+ let t = K(this.items, e);
1001
+ return t ? this.items.splice(this.items.indexOf(t), 1).length > 0 : !1;
1002
+ }
1003
+ get(e, t) {
1004
+ let n = K(this.items, e)?.value;
1005
+ return (!t && N(n) ? n.value : n) ?? void 0;
1006
+ }
1007
+ has(e) {
1008
+ return !!K(this.items, e);
1009
+ }
1010
+ set(e, t) {
1011
+ this.add(new G(e, t), !0);
1012
+ }
1013
+ toJSON(e, t, n) {
1014
+ let r = n ? new n() : t?.mapAsMap ? /* @__PURE__ */ new Map() : {};
1015
+ t?.onCreate && t.onCreate(r);
1016
+ for (let e of this.items) Je(t, r, e);
1017
+ return r;
1018
+ }
1019
+ toString(e, t, n) {
1020
+ if (!e) return JSON.stringify(this);
1021
+ for (let e of this.items) if (!M(e)) throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);
1022
+ return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), $e(this, e, {
1023
+ blockItemPrefix: "",
1024
+ flowChars: {
1025
+ start: "{",
1026
+ end: "}"
1027
+ },
1028
+ itemIndent: e.indent || "",
1029
+ onChompKeep: n,
1030
+ onComment: t
1031
+ });
1032
+ }
1033
+ }, rt = {
1034
+ collection: "map",
1035
+ default: !0,
1036
+ nodeClass: q,
1037
+ tag: "tag:yaml.org,2002:map",
1038
+ resolve(e, t) {
1039
+ return j(e) || t("Expected a mapping for this tag"), e;
1040
+ },
1041
+ createNode: (e, t, n) => q.from(e, t, n)
1042
+ }, J = class extends Ee {
1043
+ static get tagName() {
1044
+ return "tag:yaml.org,2002:seq";
1045
+ }
1046
+ constructor(e) {
1047
+ super(O, e), this.items = [];
1048
+ }
1049
+ add(e) {
1050
+ this.items.push(e);
1051
+ }
1052
+ delete(e) {
1053
+ let t = it(e);
1054
+ return typeof t == "number" && this.items.splice(t, 1).length > 0;
1055
+ }
1056
+ get(e, t) {
1057
+ let n = it(e);
1058
+ if (typeof n != "number") return;
1059
+ let r = this.items[n];
1060
+ return !t && N(r) ? r.value : r;
1061
+ }
1062
+ has(e) {
1063
+ let t = it(e);
1064
+ return typeof t == "number" && t < this.items.length;
1065
+ }
1066
+ set(e, t) {
1067
+ let n = it(e);
1068
+ if (typeof n != "number") throw Error(`Expected a valid index, not ${e}.`);
1069
+ let r = this.items[n];
1070
+ N(r) && be(t) ? r.value = t : this.items[n] = t;
1071
+ }
1072
+ toJSON(e, t) {
1073
+ let n = [];
1074
+ t?.onCreate && t.onCreate(n);
1075
+ let r = 0;
1076
+ for (let e of this.items) n.push(z(e, String(r++), t));
1077
+ return n;
1078
+ }
1079
+ toString(e, t, n) {
1080
+ return e ? $e(this, e, {
1081
+ blockItemPrefix: "- ",
1082
+ flowChars: {
1083
+ start: "[",
1084
+ end: "]"
1085
+ },
1086
+ itemIndent: (e.indent || "") + " ",
1087
+ onChompKeep: n,
1088
+ onComment: t
1089
+ }) : JSON.stringify(this);
1090
+ }
1091
+ static from(e, t, n) {
1092
+ let { replacer: r } = n, i = new this(e);
1093
+ if (t && Symbol.iterator in Object(t)) {
1094
+ let e = 0;
1095
+ for (let a of t) {
1096
+ if (typeof r == "function") {
1097
+ let n = t instanceof Set ? a : String(e++);
1098
+ a = r.call(t, n, a);
1099
+ }
1100
+ i.items.push(Ce(a, void 0, n));
1101
+ }
1102
+ }
1103
+ return i;
1104
+ }
1105
+ };
1106
+ function it(e) {
1107
+ let t = N(e) ? e.value : e;
1108
+ return t && typeof t == "string" && (t = Number(t)), typeof t == "number" && Number.isInteger(t) && t >= 0 ? t : null;
1109
+ }
1110
+ //#endregion
1111
+ //#region node_modules/yaml/browser/dist/schema/common/seq.js
1112
+ var at = {
1113
+ collection: "seq",
1114
+ default: !0,
1115
+ nodeClass: J,
1116
+ tag: "tag:yaml.org,2002:seq",
1117
+ resolve(e, t) {
1118
+ return P(e) || t("Expected a sequence for this tag"), e;
1119
+ },
1120
+ createNode: (e, t, n) => J.from(e, t, n)
1121
+ }, ot = {
1122
+ identify: (e) => typeof e == "string",
1123
+ default: !0,
1124
+ tag: "tag:yaml.org,2002:str",
1125
+ resolve: (e) => e,
1126
+ stringify(e, t, n, r) {
1127
+ return t = Object.assign({ actualString: !0 }, t), Ve(e, t, n, r);
1128
+ }
1129
+ }, st = {
1130
+ identify: (e) => e == null,
1131
+ createNode: () => new B(null),
1132
+ default: !0,
1133
+ tag: "tag:yaml.org,2002:null",
1134
+ test: /^(?:~|[Nn]ull|NULL)?$/,
1135
+ resolve: () => new B(null),
1136
+ stringify: ({ source: e }, t) => typeof e == "string" && st.test.test(e) ? e : t.options.nullStr
1137
+ }, ct = {
1138
+ identify: (e) => typeof e == "boolean",
1139
+ default: !0,
1140
+ tag: "tag:yaml.org,2002:bool",
1141
+ test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
1142
+ resolve: (e) => new B(e[0] === "t" || e[0] === "T"),
1143
+ stringify({ source: e, value: t }, n) {
1144
+ return e && ct.test.test(e) && t === (e[0] === "t" || e[0] === "T") ? e : t ? n.options.trueStr : n.options.falseStr;
1145
+ }
1146
+ };
1147
+ //#endregion
1148
+ //#region node_modules/yaml/browser/dist/stringify/stringifyNumber.js
1149
+ function Y({ format: e, minFractionDigits: t, tag: n, value: r }) {
1150
+ if (typeof r == "bigint") return String(r);
1151
+ let i = typeof r == "number" ? r : Number(r);
1152
+ if (!isFinite(i)) return isNaN(i) ? ".nan" : i < 0 ? "-.inf" : ".inf";
1153
+ let a = JSON.stringify(r);
1154
+ if (!e && t && (!n || n === "tag:yaml.org,2002:float") && /^\d/.test(a)) {
1155
+ let e = a.indexOf(".");
1156
+ e < 0 && (e = a.length, a += ".");
1157
+ let n = t - (a.length - e - 1);
1158
+ for (; n-- > 0;) a += "0";
1159
+ }
1160
+ return a;
1161
+ }
1162
+ //#endregion
1163
+ //#region node_modules/yaml/browser/dist/schema/core/float.js
1164
+ var lt = {
1165
+ identify: (e) => typeof e == "number",
1166
+ default: !0,
1167
+ tag: "tag:yaml.org,2002:float",
1168
+ test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
1169
+ resolve: (e) => e.slice(-3).toLowerCase() === "nan" ? NaN : e[0] === "-" ? -Infinity : Infinity,
1170
+ stringify: Y
1171
+ }, ut = {
1172
+ identify: (e) => typeof e == "number",
1173
+ default: !0,
1174
+ tag: "tag:yaml.org,2002:float",
1175
+ format: "EXP",
1176
+ test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
1177
+ resolve: (e) => parseFloat(e),
1178
+ stringify(e) {
1179
+ let t = Number(e.value);
1180
+ return isFinite(t) ? t.toExponential() : Y(e);
1181
+ }
1182
+ }, dt = {
1183
+ identify: (e) => typeof e == "number",
1184
+ default: !0,
1185
+ tag: "tag:yaml.org,2002:float",
1186
+ test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
1187
+ resolve(e) {
1188
+ let t = new B(parseFloat(e)), n = e.indexOf(".");
1189
+ return n !== -1 && e[e.length - 1] === "0" && (t.minFractionDigits = e.length - n - 1), t;
1190
+ },
1191
+ stringify: Y
1192
+ }, ft = (e) => typeof e == "bigint" || Number.isInteger(e), pt = (e, t, n, { intAsBigInt: r }) => r ? BigInt(e) : parseInt(e.substring(t), n);
1193
+ function mt(e, t, n) {
1194
+ let { value: r } = e;
1195
+ return ft(r) && r >= 0 ? n + r.toString(t) : Y(e);
1196
+ }
1197
+ var ht = {
1198
+ identify: (e) => ft(e) && e >= 0,
1199
+ default: !0,
1200
+ tag: "tag:yaml.org,2002:int",
1201
+ format: "OCT",
1202
+ test: /^0o[0-7]+$/,
1203
+ resolve: (e, t, n) => pt(e, 2, 8, n),
1204
+ stringify: (e) => mt(e, 8, "0o")
1205
+ }, gt = {
1206
+ identify: ft,
1207
+ default: !0,
1208
+ tag: "tag:yaml.org,2002:int",
1209
+ test: /^[-+]?[0-9]+$/,
1210
+ resolve: (e, t, n) => pt(e, 0, 10, n),
1211
+ stringify: Y
1212
+ }, _t = {
1213
+ identify: (e) => ft(e) && e >= 0,
1214
+ default: !0,
1215
+ tag: "tag:yaml.org,2002:int",
1216
+ format: "HEX",
1217
+ test: /^0x[0-9a-fA-F]+$/,
1218
+ resolve: (e, t, n) => pt(e, 2, 16, n),
1219
+ stringify: (e) => mt(e, 16, "0x")
1220
+ }, vt = [
1221
+ rt,
1222
+ at,
1223
+ ot,
1224
+ st,
1225
+ ct,
1226
+ ht,
1227
+ gt,
1228
+ _t,
1229
+ lt,
1230
+ ut,
1231
+ dt
1232
+ ];
1233
+ //#endregion
1234
+ //#region node_modules/yaml/browser/dist/schema/json/schema.js
1235
+ function yt(e) {
1236
+ return typeof e == "bigint" || Number.isInteger(e);
1237
+ }
1238
+ var bt = ({ value: e }) => JSON.stringify(e), xt = [
1239
+ {
1240
+ identify: (e) => typeof e == "string",
1241
+ default: !0,
1242
+ tag: "tag:yaml.org,2002:str",
1243
+ resolve: (e) => e,
1244
+ stringify: bt
1245
+ },
1246
+ {
1247
+ identify: (e) => e == null,
1248
+ createNode: () => new B(null),
1249
+ default: !0,
1250
+ tag: "tag:yaml.org,2002:null",
1251
+ test: /^null$/,
1252
+ resolve: () => null,
1253
+ stringify: bt
1254
+ },
1255
+ {
1256
+ identify: (e) => typeof e == "boolean",
1257
+ default: !0,
1258
+ tag: "tag:yaml.org,2002:bool",
1259
+ test: /^true|false$/,
1260
+ resolve: (e) => e === "true",
1261
+ stringify: bt
1262
+ },
1263
+ {
1264
+ identify: yt,
1265
+ default: !0,
1266
+ tag: "tag:yaml.org,2002:int",
1267
+ test: /^-?(?:0|[1-9][0-9]*)$/,
1268
+ resolve: (e, t, { intAsBigInt: n }) => n ? BigInt(e) : parseInt(e, 10),
1269
+ stringify: ({ value: e }) => yt(e) ? e.toString() : JSON.stringify(e)
1270
+ },
1271
+ {
1272
+ identify: (e) => typeof e == "number",
1273
+ default: !0,
1274
+ tag: "tag:yaml.org,2002:float",
1275
+ test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
1276
+ resolve: (e) => parseFloat(e),
1277
+ stringify: bt
1278
+ }
1279
+ ], St = [rt, at].concat(xt, {
1280
+ default: !0,
1281
+ tag: "",
1282
+ test: /^/,
1283
+ resolve(e, t) {
1284
+ return t(`Unresolved plain scalar ${JSON.stringify(e)}`), e;
1285
+ }
1286
+ }), Ct = {
1287
+ identify: (e) => e instanceof Uint8Array,
1288
+ default: !1,
1289
+ tag: "tag:yaml.org,2002:binary",
1290
+ resolve(e, t) {
1291
+ if (typeof Buffer == "function") return Buffer.from(e, "base64");
1292
+ if (typeof atob == "function") {
1293
+ let t = atob(e.replace(/[\n\r]/g, "")), n = new Uint8Array(t.length);
1294
+ for (let e = 0; e < t.length; ++e) n[e] = t.charCodeAt(e);
1295
+ return n;
1296
+ }
1297
+ return t("This environment does not support reading binary tags; either Buffer or atob is required"), e;
1298
+ },
1299
+ stringify({ comment: e, type: t, value: n }, r, i, a) {
1300
+ let o = n, s;
1301
+ if (typeof Buffer == "function") s = o instanceof Buffer ? o.toString("base64") : Buffer.from(o.buffer).toString("base64");
1302
+ else if (typeof btoa == "function") {
1303
+ let e = "";
1304
+ for (let t = 0; t < o.length; ++t) e += String.fromCharCode(o[t]);
1305
+ s = btoa(e);
1306
+ } else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");
1307
+ if (t ||= B.BLOCK_LITERAL, t !== B.QUOTE_DOUBLE) {
1308
+ let e = Math.max(r.options.lineWidth - r.indent.length, r.options.minContentWidth), n = Math.ceil(s.length / e), i = Array(n);
1309
+ for (let t = 0, r = 0; t < n; ++t, r += e) i[t] = s.substr(r, e);
1310
+ s = i.join(t === B.BLOCK_LITERAL ? "\n" : " ");
1311
+ }
1312
+ return Ve({
1313
+ comment: e,
1314
+ type: t,
1315
+ value: s
1316
+ }, r, i, a);
1317
+ }
1318
+ };
1319
+ //#endregion
1320
+ //#region node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js
1321
+ function wt(e, t) {
1322
+ if (P(e)) for (let n = 0; n < e.items.length; ++n) {
1323
+ let r = e.items[n];
1324
+ if (!M(r)) {
1325
+ if (j(r)) {
1326
+ r.items.length > 1 && t("Each pair must have its own sequence indicator");
1327
+ let e = r.items[0] || new G(new B(null));
1328
+ if (r.commentBefore && (e.key.commentBefore = e.key.commentBefore ? `${r.commentBefore}\n${e.key.commentBefore}` : r.commentBefore), r.comment) {
1329
+ let t = e.value ?? e.key;
1330
+ t.comment = t.comment ? `${r.comment}\n${t.comment}` : r.comment;
1331
+ }
1332
+ r = e;
1333
+ }
1334
+ e.items[n] = M(r) ? r : new G(r);
1335
+ }
1336
+ }
1337
+ else t("Expected a sequence for this tag");
1338
+ return e;
1339
+ }
1340
+ function Tt(e, t, n) {
1341
+ let { replacer: r } = n, i = new J(e);
1342
+ i.tag = "tag:yaml.org,2002:pairs";
1343
+ let a = 0;
1344
+ if (t && Symbol.iterator in Object(t)) for (let e of t) {
1345
+ typeof r == "function" && (e = r.call(t, String(a++), e));
1346
+ let o, s;
1347
+ if (Array.isArray(e)) {
1348
+ if (e.length === 2) o = e[0], s = e[1];
1349
+ else throw TypeError(`Expected [key, value] tuple: ${e}`);
1350
+ } else if (e && e instanceof Object) {
1351
+ let t = Object.keys(e);
1352
+ if (t.length === 1) o = t[0], s = e[o];
1353
+ else throw TypeError(`Expected tuple with one key, not ${t.length} keys`);
1354
+ } else o = e;
1355
+ i.items.push(Qe(o, s, n));
1356
+ }
1357
+ return i;
1358
+ }
1359
+ var Et = {
1360
+ collection: "seq",
1361
+ default: !1,
1362
+ tag: "tag:yaml.org,2002:pairs",
1363
+ resolve: wt,
1364
+ createNode: Tt
1365
+ }, Dt = class e extends J {
1366
+ constructor() {
1367
+ super(), this.add = q.prototype.add.bind(this), this.delete = q.prototype.delete.bind(this), this.get = q.prototype.get.bind(this), this.has = q.prototype.has.bind(this), this.set = q.prototype.set.bind(this), this.tag = e.tag;
1368
+ }
1369
+ toJSON(e, t) {
1370
+ if (!t) return super.toJSON(e);
1371
+ let n = /* @__PURE__ */ new Map();
1372
+ t?.onCreate && t.onCreate(n);
1373
+ for (let e of this.items) {
1374
+ let r, i;
1375
+ if (M(e) ? (r = z(e.key, "", t), i = z(e.value, r, t)) : r = z(e, "", t), n.has(r)) throw Error("Ordered maps must not include duplicate keys");
1376
+ n.set(r, i);
1377
+ }
1378
+ return n;
1379
+ }
1380
+ static from(e, t, n) {
1381
+ let r = Tt(e, t, n), i = new this();
1382
+ return i.items = r.items, i;
1383
+ }
1384
+ };
1385
+ Dt.tag = "tag:yaml.org,2002:omap";
1386
+ var Ot = {
1387
+ collection: "seq",
1388
+ identify: (e) => e instanceof Map,
1389
+ nodeClass: Dt,
1390
+ default: !1,
1391
+ tag: "tag:yaml.org,2002:omap",
1392
+ resolve(e, t) {
1393
+ let n = wt(e, t), r = [];
1394
+ for (let { key: e } of n.items) N(e) && (r.includes(e.value) ? t(`Ordered maps must not include duplicate keys: ${e.value}`) : r.push(e.value));
1395
+ return Object.assign(new Dt(), n);
1396
+ },
1397
+ createNode: (e, t, n) => Dt.from(e, t, n)
1398
+ };
1399
+ //#endregion
1400
+ //#region node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js
1401
+ function kt({ value: e, source: t }, n) {
1402
+ return t && (e ? At : jt).test.test(t) ? t : e ? n.options.trueStr : n.options.falseStr;
1403
+ }
1404
+ var At = {
1405
+ identify: (e) => e === !0,
1406
+ default: !0,
1407
+ tag: "tag:yaml.org,2002:bool",
1408
+ test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
1409
+ resolve: () => new B(!0),
1410
+ stringify: kt
1411
+ }, jt = {
1412
+ identify: (e) => e === !1,
1413
+ default: !0,
1414
+ tag: "tag:yaml.org,2002:bool",
1415
+ test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
1416
+ resolve: () => new B(!1),
1417
+ stringify: kt
1418
+ }, Mt = {
1419
+ identify: (e) => typeof e == "number",
1420
+ default: !0,
1421
+ tag: "tag:yaml.org,2002:float",
1422
+ test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
1423
+ resolve: (e) => e.slice(-3).toLowerCase() === "nan" ? NaN : e[0] === "-" ? -Infinity : Infinity,
1424
+ stringify: Y
1425
+ }, Nt = {
1426
+ identify: (e) => typeof e == "number",
1427
+ default: !0,
1428
+ tag: "tag:yaml.org,2002:float",
1429
+ format: "EXP",
1430
+ test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
1431
+ resolve: (e) => parseFloat(e.replace(/_/g, "")),
1432
+ stringify(e) {
1433
+ let t = Number(e.value);
1434
+ return isFinite(t) ? t.toExponential() : Y(e);
1435
+ }
1436
+ }, Pt = {
1437
+ identify: (e) => typeof e == "number",
1438
+ default: !0,
1439
+ tag: "tag:yaml.org,2002:float",
1440
+ test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
1441
+ resolve(e) {
1442
+ let t = new B(parseFloat(e.replace(/_/g, ""))), n = e.indexOf(".");
1443
+ if (n !== -1) {
1444
+ let r = e.substring(n + 1).replace(/_/g, "");
1445
+ r[r.length - 1] === "0" && (t.minFractionDigits = r.length);
1446
+ }
1447
+ return t;
1448
+ },
1449
+ stringify: Y
1450
+ }, Ft = (e) => typeof e == "bigint" || Number.isInteger(e);
1451
+ function It(e, t, n, { intAsBigInt: r }) {
1452
+ let i = e[0];
1453
+ if ((i === "-" || i === "+") && (t += 1), e = e.substring(t).replace(/_/g, ""), r) {
1454
+ switch (n) {
1455
+ case 2:
1456
+ e = `0b${e}`;
1457
+ break;
1458
+ case 8:
1459
+ e = `0o${e}`;
1460
+ break;
1461
+ case 16: e = `0x${e}`;
1462
+ }
1463
+ let t = BigInt(e);
1464
+ return i === "-" ? BigInt(-1) * t : t;
1465
+ }
1466
+ let a = parseInt(e, n);
1467
+ return i === "-" ? -1 * a : a;
1468
+ }
1469
+ function Lt(e, t, n) {
1470
+ let { value: r } = e;
1471
+ if (Ft(r)) {
1472
+ let e = r.toString(t);
1473
+ return r < 0 ? "-" + n + e.substr(1) : n + e;
1474
+ }
1475
+ return Y(e);
1476
+ }
1477
+ var Rt = {
1478
+ identify: Ft,
1479
+ default: !0,
1480
+ tag: "tag:yaml.org,2002:int",
1481
+ format: "BIN",
1482
+ test: /^[-+]?0b[0-1_]+$/,
1483
+ resolve: (e, t, n) => It(e, 2, 2, n),
1484
+ stringify: (e) => Lt(e, 2, "0b")
1485
+ }, zt = {
1486
+ identify: Ft,
1487
+ default: !0,
1488
+ tag: "tag:yaml.org,2002:int",
1489
+ format: "OCT",
1490
+ test: /^[-+]?0[0-7_]+$/,
1491
+ resolve: (e, t, n) => It(e, 1, 8, n),
1492
+ stringify: (e) => Lt(e, 8, "0")
1493
+ }, Bt = {
1494
+ identify: Ft,
1495
+ default: !0,
1496
+ tag: "tag:yaml.org,2002:int",
1497
+ test: /^[-+]?[0-9][0-9_]*$/,
1498
+ resolve: (e, t, n) => It(e, 0, 10, n),
1499
+ stringify: Y
1500
+ }, Vt = {
1501
+ identify: Ft,
1502
+ default: !0,
1503
+ tag: "tag:yaml.org,2002:int",
1504
+ format: "HEX",
1505
+ test: /^[-+]?0x[0-9a-fA-F_]+$/,
1506
+ resolve: (e, t, n) => It(e, 2, 16, n),
1507
+ stringify: (e) => Lt(e, 16, "0x")
1508
+ }, Ht = class e extends q {
1509
+ constructor(t) {
1510
+ super(t), this.tag = e.tag;
1511
+ }
1512
+ add(e) {
1513
+ let t;
1514
+ t = M(e) ? e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? new G(e.key, null) : new G(e, null), K(this.items, t.key) || this.items.push(t);
1515
+ }
1516
+ get(e, t) {
1517
+ let n = K(this.items, e);
1518
+ return !t && M(n) ? N(n.key) ? n.key.value : n.key : n;
1519
+ }
1520
+ set(e, t) {
1521
+ if (typeof t != "boolean") throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);
1522
+ let n = K(this.items, e);
1523
+ n && !t ? this.items.splice(this.items.indexOf(n), 1) : !n && t && this.items.push(new G(e));
1524
+ }
1525
+ toJSON(e, t) {
1526
+ return super.toJSON(e, t, Set);
1527
+ }
1528
+ toString(e, t, n) {
1529
+ if (!e) return JSON.stringify(this);
1530
+ if (this.hasAllNullValues(!0)) return super.toString(Object.assign({}, e, { allNullValues: !0 }), t, n);
1531
+ throw Error("Set items must all have null values");
1532
+ }
1533
+ static from(e, t, n) {
1534
+ let { replacer: r } = n, i = new this(e);
1535
+ if (t && Symbol.iterator in Object(t)) for (let e of t) typeof r == "function" && (e = r.call(t, e, e)), i.items.push(Qe(e, null, n));
1536
+ return i;
1537
+ }
1538
+ };
1539
+ Ht.tag = "tag:yaml.org,2002:set";
1540
+ var Ut = {
1541
+ collection: "map",
1542
+ identify: (e) => e instanceof Set,
1543
+ nodeClass: Ht,
1544
+ default: !1,
1545
+ tag: "tag:yaml.org,2002:set",
1546
+ createNode: (e, t, n) => Ht.from(e, t, n),
1547
+ resolve(e, t) {
1548
+ if (j(e)) {
1549
+ if (e.hasAllNullValues(!0)) return Object.assign(new Ht(), e);
1550
+ t("Set items must all have null values");
1551
+ } else t("Expected a mapping for this tag");
1552
+ return e;
1553
+ }
1554
+ };
1555
+ //#endregion
1556
+ //#region node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js
1557
+ function Wt(e, t) {
1558
+ let n = e[0], r = n === "-" || n === "+" ? e.substring(1) : e, i = (e) => t ? BigInt(e) : Number(e), a = r.replace(/_/g, "").split(":").reduce((e, t) => e * i(60) + i(t), i(0));
1559
+ return n === "-" ? i(-1) * a : a;
1560
+ }
1561
+ function Gt(e) {
1562
+ let { value: t } = e, n = (e) => e;
1563
+ if (typeof t == "bigint") n = (e) => BigInt(e);
1564
+ else if (isNaN(t) || !isFinite(t)) return Y(e);
1565
+ let r = "";
1566
+ t < 0 && (r = "-", t *= n(-1));
1567
+ let i = n(60), a = [t % i];
1568
+ return t < 60 ? a.unshift(0) : (t = (t - a[0]) / i, a.unshift(t % i), t >= 60 && (t = (t - a[0]) / i, a.unshift(t))), r + a.map((e) => String(e).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
1569
+ }
1570
+ var Kt = {
1571
+ identify: (e) => typeof e == "bigint" || Number.isInteger(e),
1572
+ default: !0,
1573
+ tag: "tag:yaml.org,2002:int",
1574
+ format: "TIME",
1575
+ test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
1576
+ resolve: (e, t, { intAsBigInt: n }) => Wt(e, n),
1577
+ stringify: Gt
1578
+ }, qt = {
1579
+ identify: (e) => typeof e == "number",
1580
+ default: !0,
1581
+ tag: "tag:yaml.org,2002:float",
1582
+ format: "TIME",
1583
+ test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
1584
+ resolve: (e) => Wt(e, !1),
1585
+ stringify: Gt
1586
+ }, Jt = {
1587
+ identify: (e) => e instanceof Date,
1588
+ default: !0,
1589
+ tag: "tag:yaml.org,2002:timestamp",
1590
+ 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})?))?)?$"),
1591
+ resolve(e) {
1592
+ let t = e.match(Jt.test);
1593
+ if (!t) throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");
1594
+ let [, n, r, i, a, o, s] = t.map(Number), c = t[7] ? Number((t[7] + "00").substr(1, 3)) : 0, l = Date.UTC(n, r - 1, i, a || 0, o || 0, s || 0, c), u = t[8];
1595
+ if (u && u !== "Z") {
1596
+ let e = Wt(u, !1);
1597
+ Math.abs(e) < 30 && (e *= 60), l -= 6e4 * e;
1598
+ }
1599
+ return new Date(l);
1600
+ },
1601
+ stringify: ({ value: e }) => e.toISOString().replace(/((T00:00)?:00)?\.000Z$/, "")
1602
+ }, Yt = [
1603
+ rt,
1604
+ at,
1605
+ ot,
1606
+ st,
1607
+ At,
1608
+ jt,
1609
+ Rt,
1610
+ zt,
1611
+ Bt,
1612
+ Vt,
1613
+ Mt,
1614
+ Nt,
1615
+ Pt,
1616
+ Ct,
1617
+ Ot,
1618
+ Et,
1619
+ Ut,
1620
+ Kt,
1621
+ qt,
1622
+ Jt
1623
+ ], Xt = /* @__PURE__ */ new Map([
1624
+ ["core", vt],
1625
+ ["failsafe", [
1626
+ rt,
1627
+ at,
1628
+ ot
1629
+ ]],
1630
+ ["json", St],
1631
+ ["yaml11", Yt],
1632
+ ["yaml-1.1", Yt]
1633
+ ]), Zt = {
1634
+ binary: Ct,
1635
+ bool: ct,
1636
+ float: dt,
1637
+ floatExp: ut,
1638
+ floatNaN: lt,
1639
+ floatTime: qt,
1640
+ int: gt,
1641
+ intHex: _t,
1642
+ intOct: ht,
1643
+ intTime: Kt,
1644
+ map: rt,
1645
+ null: st,
1646
+ omap: Ot,
1647
+ pairs: Et,
1648
+ seq: at,
1649
+ set: Ut,
1650
+ timestamp: Jt
1651
+ }, Qt = {
1652
+ "tag:yaml.org,2002:binary": Ct,
1653
+ "tag:yaml.org,2002:omap": Ot,
1654
+ "tag:yaml.org,2002:pairs": Et,
1655
+ "tag:yaml.org,2002:set": Ut,
1656
+ "tag:yaml.org,2002:timestamp": Jt
1657
+ };
1658
+ function $t(e, t) {
1659
+ let n = Xt.get(t);
1660
+ if (!n) {
1661
+ if (Array.isArray(e)) n = [];
1662
+ else {
1663
+ let e = Array.from(Xt.keys()).filter((e) => e !== "yaml11").map((e) => JSON.stringify(e)).join(", ");
1664
+ throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`);
1665
+ }
1666
+ }
1667
+ if (Array.isArray(e)) for (let t of e) n = n.concat(t);
1668
+ else typeof e == "function" && (n = e(n.slice()));
1669
+ return n.map((e) => {
1670
+ if (typeof e != "string") return e;
1671
+ let t = Zt[e];
1672
+ if (t) return t;
1673
+ let n = Object.keys(Zt).map((e) => JSON.stringify(e)).join(", ");
1674
+ throw Error(`Unknown custom tag "${e}"; use one of ${n}`);
1675
+ });
1676
+ }
1677
+ //#endregion
1678
+ //#region node_modules/yaml/browser/dist/schema/Schema.js
1679
+ var en = (e, t) => e.key < t.key ? -1 : +(e.key > t.key), tn = class e {
1680
+ constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: r, schema: i, sortMapEntries: a, toStringDefaults: o }) {
1681
+ this.compat = Array.isArray(e) ? $t(e, "compat") : e ? $t(null, e) : null, this.merge = !!n, this.name = typeof i == "string" && i || "core", this.knownTags = r ? Qt : {}, this.tags = $t(t, this.name), this.toStringOptions = o ?? null, Object.defineProperty(this, T, { value: rt }), Object.defineProperty(this, D, { value: ot }), Object.defineProperty(this, O, { value: at }), this.sortMapEntries = typeof a == "function" ? a : a === !0 ? en : null;
1682
+ }
1683
+ clone() {
1684
+ let t = Object.create(e.prototype, Object.getOwnPropertyDescriptors(this));
1685
+ return t.tags = this.tags.slice(), t;
1686
+ }
1687
+ };
1688
+ //#endregion
1689
+ //#region node_modules/yaml/browser/dist/stringify/stringifyDocument.js
1690
+ function nn(e, t) {
1691
+ let n = [], r = t.directives === !0;
1692
+ if (t.directives !== !1 && e.directives) {
1693
+ let t = e.directives.toString(e);
1694
+ t ? (n.push(t), r = !0) : e.directives.docStart && (r = !0);
1695
+ }
1696
+ r && n.push("---");
1697
+ let i = He(e, t), { commentString: a } = i.options;
1698
+ if (e.commentBefore) {
1699
+ n.length !== 1 && n.unshift("");
1700
+ let t = a(e.commentBefore);
1701
+ n.unshift(V(t, ""));
1702
+ }
1703
+ let o = !1, s = null;
1704
+ if (e.contents) {
1705
+ if (I(e.contents)) {
1706
+ if (e.contents.spaceBefore && r && n.push(""), e.contents.commentBefore) {
1707
+ let t = a(e.contents.commentBefore);
1708
+ n.push(V(t, ""));
1709
+ }
1710
+ i.forceBlockIndent = !!e.comment, s = e.contents.comment;
1711
+ }
1712
+ let t = s ? void 0 : () => o = !0, c = W(e.contents, i, () => s = null, t);
1713
+ s && (c += H(c, "", a(s))), (c[0] === "|" || c[0] === ">") && n[n.length - 1] === "---" ? n[n.length - 1] = `--- ${c}` : n.push(c);
1714
+ } else n.push(W(e.contents, i));
1715
+ if (e.directives?.docEnd) {
1716
+ if (e.comment) {
1717
+ let t = a(e.comment);
1718
+ t.includes("\n") ? (n.push("..."), n.push(V(t, ""))) : n.push(`... ${t}`);
1719
+ } else n.push("...");
1720
+ } else {
1721
+ let t = e.comment;
1722
+ t && o && (t = t.replace(/^\n+/, "")), t && ((!o || s) && n[n.length - 1] !== "" && n.push(""), n.push(V(a(t), "")));
1723
+ }
1724
+ return n.join("\n") + "\n";
1725
+ }
1726
+ //#endregion
1727
+ //#region node_modules/yaml/browser/dist/doc/Document.js
1728
+ var rn = class e {
1729
+ constructor(e, t, n) {
1730
+ this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, k, { value: w });
1731
+ let r = null;
1732
+ typeof t == "function" || Array.isArray(t) ? r = t : n === void 0 && t && (n = t, t = void 0);
1733
+ let i = Object.assign({
1734
+ intAsBigInt: !1,
1735
+ keepSourceTokens: !1,
1736
+ logLevel: "warn",
1737
+ prettyErrors: !0,
1738
+ strict: !0,
1739
+ uniqueKeys: !0,
1740
+ version: "1.2"
1741
+ }, n);
1742
+ this.options = i;
1743
+ let { version: a } = i;
1744
+ n?._directives ? (this.directives = n._directives.atDocument(), this.directives.yaml.explicit && (a = this.directives.yaml.version)) : this.directives = new de({ version: a }), this.setSchema(a, n), this.contents = e === void 0 ? null : this.createNode(e, r, n);
1745
+ }
1746
+ clone() {
1747
+ let t = Object.create(e.prototype, { [k]: { value: w } });
1748
+ return t.commentBefore = this.commentBefore, t.comment = this.comment, t.errors = this.errors.slice(), t.warnings = this.warnings.slice(), t.options = Object.assign({}, this.options), this.directives && (t.directives = this.directives.clone()), t.schema = this.schema.clone(), t.contents = I(this.contents) ? this.contents.clone(t.schema) : this.contents, this.range && (t.range = this.range.slice()), t;
1749
+ }
1750
+ add(e) {
1751
+ an(this.contents) && this.contents.add(e);
1752
+ }
1753
+ addIn(e, t) {
1754
+ an(this.contents) && this.contents.addIn(e, t);
1755
+ }
1756
+ createAlias(e, t) {
1757
+ if (!e.anchor) {
1758
+ let n = pe(this);
1759
+ e.anchor = !t || n.has(t) ? me(t || "a", n) : t;
1760
+ }
1761
+ return new ve(e.anchor);
1762
+ }
1763
+ createNode(e, t, n) {
1764
+ let r;
1765
+ if (typeof t == "function") e = t.call({ "": e }, "", e), r = t;
1766
+ else if (Array.isArray(t)) {
1767
+ let e = t.filter((e) => typeof e == "number" || e instanceof String || e instanceof Number).map(String);
1768
+ e.length > 0 && (t = t.concat(e)), r = t;
1769
+ } else n === void 0 && t && (n = t, t = void 0);
1770
+ let { aliasDuplicateObjects: i, anchorPrefix: a, flow: o, keepUndefined: s, onTagObj: c, tag: l } = n ?? {}, { onAnchor: u, setAnchors: d, sourceObjects: f } = he(this, a || "a"), p = {
1771
+ aliasDuplicateObjects: i ?? !0,
1772
+ keepUndefined: s ?? !1,
1773
+ onAnchor: u,
1774
+ onTagObj: c,
1775
+ replacer: r,
1776
+ schema: this.schema,
1777
+ sourceObjects: f
1778
+ }, m = Ce(e, l, p);
1779
+ return o && F(m) && (m.flow = !0), d(), m;
1780
+ }
1781
+ createPair(e, t, n = {}) {
1782
+ return new G(this.createNode(e, null, n), this.createNode(t, null, n));
1783
+ }
1784
+ delete(e) {
1785
+ return an(this.contents) ? this.contents.delete(e) : !1;
1786
+ }
1787
+ deleteIn(e) {
1788
+ return Te(e) ? this.contents != null && (this.contents = null, !0) : an(this.contents) ? this.contents.deleteIn(e) : !1;
1789
+ }
1790
+ get(e, t) {
1791
+ return F(this.contents) ? this.contents.get(e, t) : void 0;
1792
+ }
1793
+ getIn(e, t) {
1794
+ return Te(e) ? !t && N(this.contents) ? this.contents.value : this.contents : F(this.contents) ? this.contents.getIn(e, t) : void 0;
1795
+ }
1796
+ has(e) {
1797
+ return F(this.contents) ? this.contents.has(e) : !1;
1798
+ }
1799
+ hasIn(e) {
1800
+ return Te(e) ? this.contents !== void 0 : F(this.contents) ? this.contents.hasIn(e) : !1;
1801
+ }
1802
+ set(e, t) {
1803
+ this.contents == null ? this.contents = we(this.schema, [e], t) : an(this.contents) && this.contents.set(e, t);
1804
+ }
1805
+ setIn(e, t) {
1806
+ Te(e) ? this.contents = t : this.contents == null ? this.contents = we(this.schema, Array.from(e), t) : an(this.contents) && this.contents.setIn(e, t);
1807
+ }
1808
+ setSchema(e, t = {}) {
1809
+ typeof e == "number" && (e = String(e));
1810
+ let n;
1811
+ switch (e) {
1812
+ case "1.1":
1813
+ this.directives ? this.directives.yaml.version = "1.1" : this.directives = new de({ version: "1.1" }), n = {
1814
+ merge: !0,
1815
+ resolveKnownTags: !1,
1816
+ schema: "yaml-1.1"
1817
+ };
1818
+ break;
1819
+ case "1.2":
1820
+ case "next":
1821
+ this.directives ? this.directives.yaml.version = e : this.directives = new de({ version: e }), n = {
1822
+ merge: !1,
1823
+ resolveKnownTags: !0,
1824
+ schema: "core"
1825
+ };
1826
+ break;
1827
+ case null:
1828
+ this.directives && delete this.directives, n = null;
1829
+ break;
1830
+ default: {
1831
+ let t = JSON.stringify(e);
1832
+ throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`);
1833
+ }
1834
+ }
1835
+ if (t.schema instanceof Object) this.schema = t.schema;
1836
+ else if (n) this.schema = new tn(Object.assign(n, t));
1837
+ else throw Error("With a null YAML version, the { schema: Schema } option is required");
1838
+ }
1839
+ toJS({ json: e, jsonArg: t, mapAsMap: n, maxAliasCount: r, onAnchor: i, reviver: a } = {}) {
1840
+ let o = {
1841
+ anchors: /* @__PURE__ */ new Map(),
1842
+ doc: this,
1843
+ keep: !e,
1844
+ mapAsMap: n === !0,
1845
+ mapKeyWarned: !1,
1846
+ maxAliasCount: typeof r == "number" ? r : 100
1847
+ }, s = z(this.contents, t ?? "", o);
1848
+ if (typeof i == "function") for (let { count: e, res: t } of o.anchors.values()) i(t, e);
1849
+ return typeof a == "function" ? ge(a, { "": s }, "", s) : s;
1850
+ }
1851
+ toJSON(e, t) {
1852
+ return this.toJS({
1853
+ json: !0,
1854
+ jsonArg: e,
1855
+ mapAsMap: !1,
1856
+ onAnchor: t
1857
+ });
1858
+ }
1859
+ toString(e = {}) {
1860
+ if (this.errors.length > 0) throw Error("Document with errors cannot be stringified");
1861
+ if ("indent" in e && (!Number.isInteger(e.indent) || Number(e.indent) <= 0)) {
1862
+ let t = JSON.stringify(e.indent);
1863
+ throw Error(`"indent" option must be a positive integer, not ${t}`);
1864
+ }
1865
+ return nn(this, e);
1866
+ }
1867
+ };
1868
+ function an(e) {
1869
+ if (F(e)) return !0;
1870
+ throw Error("Expected a YAML collection as document contents");
1871
+ }
1872
+ //#endregion
1873
+ //#region node_modules/yaml/browser/dist/errors.js
1874
+ var on = class extends Error {
1875
+ constructor(e, t, n, r) {
1876
+ super(), this.name = e, this.code = n, this.message = r, this.pos = t;
1877
+ }
1878
+ }, sn = class extends on {
1879
+ constructor(e, t, n) {
1880
+ super("YAMLParseError", e, t, n);
1881
+ }
1882
+ }, cn = class extends on {
1883
+ constructor(e, t, n) {
1884
+ super("YAMLWarning", e, t, n);
1885
+ }
1886
+ }, ln = (e, t) => (n) => {
1887
+ if (n.pos[0] === -1) return;
1888
+ n.linePos = n.pos.map((e) => t.linePos(e));
1889
+ let { line: r, col: i } = n.linePos[0];
1890
+ n.message += ` at line ${r}, column ${i}`;
1891
+ let a = i - 1, o = e.substring(t.lineStarts[r - 1], t.lineStarts[r]).replace(/[\n\r]+$/, "");
1892
+ if (a >= 60 && o.length > 80) {
1893
+ let e = Math.min(a - 39, o.length - 79);
1894
+ o = "…" + o.substring(e), a -= e - 1;
1895
+ }
1896
+ if (o.length > 80 && (o = o.substring(0, 79) + "…"), r > 1 && /^ *$/.test(o.substring(0, a))) {
1897
+ let n = e.substring(t.lineStarts[r - 2], t.lineStarts[r - 1]);
1898
+ n.length > 80 && (n = n.substring(0, 79) + "…\n"), o = n + o;
1899
+ }
1900
+ if (/[^ ]/.test(o)) {
1901
+ let e = 1, t = n.linePos[1];
1902
+ t && t.line === r && t.col > i && (e = Math.max(1, Math.min(t.col - i, 80 - a)));
1903
+ let s = " ".repeat(a) + "^".repeat(e);
1904
+ n.message += `:\n\n${o}\n${s}\n`;
1905
+ }
1906
+ };
1907
+ //#endregion
1908
+ //#region node_modules/yaml/browser/dist/compose/resolve-props.js
1909
+ function un(e, { flow: t, indicator: n, next: r, offset: i, onError: a, parentIndent: o, startOnNewline: s }) {
1910
+ let c = !1, l = s, u = s, d = "", f = "", p = !1, m = !1, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null;
1911
+ for (let i of e) switch (h &&= (i.type !== "space" && i.type !== "newline" && i.type !== "comma" && a(i.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), !1), g &&= (l && i.type !== "comment" && i.type !== "newline" && a(g, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), null), i.type) {
1912
+ case "space":
1913
+ !t && (n !== "doc-start" || r?.type !== "flow-collection") && i.source.includes(" ") && (g = i), u = !0;
1914
+ break;
1915
+ case "comment": {
1916
+ u || a(i, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
1917
+ let e = i.source.substring(1) || " ";
1918
+ d ? d += f + e : d = e, f = "", l = !1;
1919
+ break;
1920
+ }
1921
+ case "newline":
1922
+ l ? d ? d += i.source : c = !0 : f += i.source, l = !0, p = !0, (_ || v) && (m = !0), u = !0;
1923
+ break;
1924
+ case "anchor":
1925
+ _ && a(i, "MULTIPLE_ANCHORS", "A node can have at most one anchor"), i.source.endsWith(":") && a(i.offset + i.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", !0), _ = i, x === null && (x = i.offset), l = !1, u = !1, h = !0;
1926
+ break;
1927
+ case "tag":
1928
+ v && a(i, "MULTIPLE_TAGS", "A node can have at most one tag"), v = i, x === null && (x = i.offset), l = !1, u = !1, h = !0;
1929
+ break;
1930
+ case n:
1931
+ (_ || v) && a(i, "BAD_PROP_ORDER", `Anchors and tags must be after the ${i.source} indicator`), b && a(i, "UNEXPECTED_TOKEN", `Unexpected ${i.source} in ${t ?? "collection"}`), b = i, l = n === "seq-item-ind" || n === "explicit-key-ind", u = !1;
1932
+ break;
1933
+ case "comma": if (t) {
1934
+ y && a(i, "UNEXPECTED_TOKEN", `Unexpected , in ${t}`), y = i, l = !1, u = !1;
1935
+ break;
1936
+ }
1937
+ default: a(i, "UNEXPECTED_TOKEN", `Unexpected ${i.type} token`), l = !1, u = !1;
1938
+ }
1939
+ let S = e[e.length - 1], C = S ? S.offset + S.source.length : i;
1940
+ return h && r && r.type !== "space" && r.type !== "newline" && r.type !== "comma" && (r.type !== "scalar" || r.source !== "") && a(r.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), g && (l && g.indent <= o || r?.type === "block-map" || r?.type === "block-seq") && a(g, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), {
1941
+ comma: y,
1942
+ found: b,
1943
+ spaceBefore: c,
1944
+ comment: d,
1945
+ hasNewline: p,
1946
+ hasNewlineAfterProp: m,
1947
+ anchor: _,
1948
+ tag: v,
1949
+ end: C,
1950
+ start: x ?? C
1951
+ };
1952
+ }
1953
+ //#endregion
1954
+ //#region node_modules/yaml/browser/dist/compose/util-contains-newline.js
1955
+ function dn(e) {
1956
+ if (!e) return null;
1957
+ switch (e.type) {
1958
+ case "alias":
1959
+ case "scalar":
1960
+ case "double-quoted-scalar":
1961
+ case "single-quoted-scalar":
1962
+ if (e.source.includes("\n")) return !0;
1963
+ if (e.end) {
1964
+ for (let t of e.end) if (t.type === "newline") return !0;
1965
+ }
1966
+ return !1;
1967
+ case "flow-collection":
1968
+ for (let t of e.items) {
1969
+ for (let e of t.start) if (e.type === "newline") return !0;
1970
+ if (t.sep) {
1971
+ for (let e of t.sep) if (e.type === "newline") return !0;
1972
+ }
1973
+ if (dn(t.key) || dn(t.value)) return !0;
1974
+ }
1975
+ return !1;
1976
+ default: return !0;
1977
+ }
1978
+ }
1979
+ //#endregion
1980
+ //#region node_modules/yaml/browser/dist/compose/util-flow-indent-check.js
1981
+ function fn(e, t, n) {
1982
+ if (t?.type === "flow-collection") {
1983
+ let r = t.end[0];
1984
+ r.indent === e && (r.source === "]" || r.source === "}") && dn(t) && n(r, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
1985
+ }
1986
+ }
1987
+ //#endregion
1988
+ //#region node_modules/yaml/browser/dist/compose/util-map-includes.js
1989
+ function pn(e, t, n) {
1990
+ let { uniqueKeys: r } = e.options;
1991
+ if (r === !1) return !1;
1992
+ let i = typeof r == "function" ? r : (t, n) => t === n || N(t) && N(n) && t.value === n.value && !(t.value === "<<" && e.schema.merge);
1993
+ return t.some((e) => i(e.key, n));
1994
+ }
1995
+ //#endregion
1996
+ //#region node_modules/yaml/browser/dist/compose/resolve-block-map.js
1997
+ var mn = "All mapping items must start at the same column";
1998
+ function hn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
1999
+ let o = new ((a?.nodeClass) ?? q)(n.schema);
2000
+ n.atRoot &&= !1;
2001
+ let s = r.offset, c = null;
2002
+ for (let a of r.items) {
2003
+ let { start: l, key: u, sep: d, value: f } = a, p = un(l, {
2004
+ indicator: "explicit-key-ind",
2005
+ next: u ?? d?.[0],
2006
+ offset: s,
2007
+ onError: i,
2008
+ parentIndent: r.indent,
2009
+ startOnNewline: !0
2010
+ }), m = !p.found;
2011
+ if (m) {
2012
+ if (u && (u.type === "block-seq" ? i(s, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in u && u.indent !== r.indent && i(s, "BAD_INDENT", mn)), !p.anchor && !p.tag && !d) {
2013
+ c = p.end, p.comment && (o.comment ? o.comment += "\n" + p.comment : o.comment = p.comment);
2014
+ continue;
2015
+ }
2016
+ (p.hasNewlineAfterProp || dn(u)) && i(u ?? l[l.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
2017
+ } else p.found?.indent !== r.indent && i(s, "BAD_INDENT", mn);
2018
+ let h = p.end, g = u ? e(n, u, p, i) : t(n, h, l, null, p, i);
2019
+ n.schema.compat && fn(r.indent, u, i), pn(n, o.items, g) && i(h, "DUPLICATE_KEY", "Map keys must be unique");
2020
+ let _ = un(d ?? [], {
2021
+ indicator: "map-value-ind",
2022
+ next: f,
2023
+ offset: g.range[2],
2024
+ onError: i,
2025
+ parentIndent: r.indent,
2026
+ startOnNewline: !u || u.type === "block-scalar"
2027
+ });
2028
+ if (s = _.end, _.found) {
2029
+ m && (f?.type === "block-map" && !_.hasNewline && i(s, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), n.options.strict && p.start < _.found.offset - 1024 && i(g.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
2030
+ let c = f ? e(n, f, _, i) : t(n, s, d, null, _, i);
2031
+ n.schema.compat && fn(r.indent, f, i), s = c.range[2];
2032
+ let l = new G(g, c);
2033
+ n.options.keepSourceTokens && (l.srcToken = a), o.items.push(l);
2034
+ } else {
2035
+ m && i(g.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"), _.comment && (g.comment ? g.comment += "\n" + _.comment : g.comment = _.comment);
2036
+ let e = new G(g);
2037
+ n.options.keepSourceTokens && (e.srcToken = a), o.items.push(e);
2038
+ }
2039
+ }
2040
+ return c && c < s && i(c, "IMPOSSIBLE", "Map comment with trailing content"), o.range = [
2041
+ r.offset,
2042
+ s,
2043
+ c ?? s
2044
+ ], o;
2045
+ }
2046
+ //#endregion
2047
+ //#region node_modules/yaml/browser/dist/compose/resolve-block-seq.js
2048
+ function gn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
2049
+ let o = new ((a?.nodeClass) ?? J)(n.schema);
2050
+ n.atRoot &&= !1;
2051
+ let s = r.offset, c = null;
2052
+ for (let { start: a, value: l } of r.items) {
2053
+ let u = un(a, {
2054
+ indicator: "seq-item-ind",
2055
+ next: l,
2056
+ offset: s,
2057
+ onError: i,
2058
+ parentIndent: r.indent,
2059
+ startOnNewline: !0
2060
+ });
2061
+ if (!u.found) {
2062
+ if (u.anchor || u.tag || l) l && l.type === "block-seq" ? i(u.end, "BAD_INDENT", "All sequence items must start at the same column") : i(s, "MISSING_CHAR", "Sequence item without - indicator");
2063
+ else {
2064
+ c = u.end, u.comment && (o.comment = u.comment);
2065
+ continue;
2066
+ }
2067
+ }
2068
+ let d = l ? e(n, l, u, i) : t(n, u.end, a, null, u, i);
2069
+ n.schema.compat && fn(r.indent, l, i), s = d.range[2], o.items.push(d);
2070
+ }
2071
+ return o.range = [
2072
+ r.offset,
2073
+ s,
2074
+ c ?? s
2075
+ ], o;
2076
+ }
2077
+ //#endregion
2078
+ //#region node_modules/yaml/browser/dist/compose/resolve-end.js
2079
+ function _n(e, t, n, r) {
2080
+ let i = "";
2081
+ if (e) {
2082
+ let a = !1, o = "";
2083
+ for (let s of e) {
2084
+ let { source: e, type: c } = s;
2085
+ switch (c) {
2086
+ case "space":
2087
+ a = !0;
2088
+ break;
2089
+ case "comment": {
2090
+ n && !a && r(s, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
2091
+ let t = e.substring(1) || " ";
2092
+ i ? i += o + t : i = t, o = "";
2093
+ break;
2094
+ }
2095
+ case "newline":
2096
+ i && (o += e), a = !0;
2097
+ break;
2098
+ default: r(s, "UNEXPECTED_TOKEN", `Unexpected ${c} at node end`);
2099
+ }
2100
+ t += e.length;
2101
+ }
2102
+ }
2103
+ return {
2104
+ comment: i,
2105
+ offset: t
2106
+ };
2107
+ }
2108
+ //#endregion
2109
+ //#region node_modules/yaml/browser/dist/compose/resolve-flow-collection.js
2110
+ var vn = "Block collections are not allowed within flow collections", yn = (e) => e && (e.type === "block-map" || e.type === "block-seq");
2111
+ function bn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
2112
+ let o = r.start.source === "{", s = o ? "flow map" : "flow sequence", c = new ((a?.nodeClass) ?? (o ? q : J))(n.schema);
2113
+ c.flow = !0;
2114
+ let l = n.atRoot;
2115
+ l && (n.atRoot = !1);
2116
+ let u = r.offset + r.start.source.length;
2117
+ for (let a = 0; a < r.items.length; ++a) {
2118
+ let l = r.items[a], { start: d, key: f, sep: p, value: m } = l, h = un(d, {
2119
+ flow: s,
2120
+ indicator: "explicit-key-ind",
2121
+ next: f ?? p?.[0],
2122
+ offset: u,
2123
+ onError: i,
2124
+ parentIndent: r.indent,
2125
+ startOnNewline: !1
2126
+ });
2127
+ if (!h.found) {
2128
+ if (!h.anchor && !h.tag && !p && !m) {
2129
+ a === 0 && h.comma ? i(h.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${s}`) : a < r.items.length - 1 && i(h.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${s}`), h.comment && (c.comment ? c.comment += "\n" + h.comment : c.comment = h.comment), u = h.end;
2130
+ continue;
2131
+ }
2132
+ !o && n.options.strict && dn(f) && i(f, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
2133
+ }
2134
+ if (a === 0) h.comma && i(h.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${s}`);
2135
+ else if (h.comma || i(h.start, "MISSING_CHAR", `Missing , between ${s} items`), h.comment) {
2136
+ let e = "";
2137
+ loop: for (let t of d) switch (t.type) {
2138
+ case "comma":
2139
+ case "space": break;
2140
+ case "comment":
2141
+ e = t.source.substring(1);
2142
+ break loop;
2143
+ default: break loop;
2144
+ }
2145
+ if (e) {
2146
+ let t = c.items[c.items.length - 1];
2147
+ M(t) && (t = t.value ?? t.key), t.comment ? t.comment += "\n" + e : t.comment = e, h.comment = h.comment.substring(e.length + 1);
2148
+ }
2149
+ }
2150
+ if (!o && !p && !h.found) {
2151
+ let r = m ? e(n, m, h, i) : t(n, h.end, p, null, h, i);
2152
+ c.items.push(r), u = r.range[2], yn(m) && i(r.range, "BLOCK_IN_FLOW", vn);
2153
+ } else {
2154
+ let a = h.end, g = f ? e(n, f, h, i) : t(n, a, d, null, h, i);
2155
+ yn(f) && i(g.range, "BLOCK_IN_FLOW", vn);
2156
+ let _ = un(p ?? [], {
2157
+ flow: s,
2158
+ indicator: "map-value-ind",
2159
+ next: m,
2160
+ offset: g.range[2],
2161
+ onError: i,
2162
+ parentIndent: r.indent,
2163
+ startOnNewline: !1
2164
+ });
2165
+ if (_.found) {
2166
+ if (!o && !h.found && n.options.strict) {
2167
+ if (p) for (let e of p) {
2168
+ if (e === _.found) break;
2169
+ if (e.type === "newline") {
2170
+ i(e, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
2171
+ break;
2172
+ }
2173
+ }
2174
+ h.start < _.found.offset - 1024 && i(_.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
2175
+ }
2176
+ } else m && ("source" in m && m.source && m.source[0] === ":" ? i(m, "MISSING_CHAR", `Missing space after : in ${s}`) : i(_.start, "MISSING_CHAR", `Missing , or : between ${s} items`));
2177
+ let v = m ? e(n, m, _, i) : _.found ? t(n, _.end, p, null, _, i) : null;
2178
+ v ? yn(m) && i(v.range, "BLOCK_IN_FLOW", vn) : _.comment && (g.comment ? g.comment += "\n" + _.comment : g.comment = _.comment);
2179
+ let y = new G(g, v);
2180
+ if (n.options.keepSourceTokens && (y.srcToken = l), o) {
2181
+ let e = c;
2182
+ pn(n, e.items, g) && i(a, "DUPLICATE_KEY", "Map keys must be unique"), e.items.push(y);
2183
+ } else {
2184
+ let e = new q(n.schema);
2185
+ e.flow = !0, e.items.push(y), c.items.push(e);
2186
+ }
2187
+ u = v ? v.range[2] : _.end;
2188
+ }
2189
+ }
2190
+ let d = o ? "}" : "]", [f, ...p] = r.end, m = u;
2191
+ if (f && f.source === d) m = f.offset + f.source.length;
2192
+ else {
2193
+ let e = s[0].toUpperCase() + s.substring(1), t = l ? `${e} must end with a ${d}` : `${e} in block collection must be sufficiently indented and end with a ${d}`;
2194
+ i(u, l ? "MISSING_CHAR" : "BAD_INDENT", t), f && f.source.length !== 1 && p.unshift(f);
2195
+ }
2196
+ if (p.length > 0) {
2197
+ let e = _n(p, m, n.options.strict, i);
2198
+ e.comment && (c.comment ? c.comment += "\n" + e.comment : c.comment = e.comment), c.range = [
2199
+ r.offset,
2200
+ m,
2201
+ e.offset
2202
+ ];
2203
+ } else c.range = [
2204
+ r.offset,
2205
+ m,
2206
+ m
2207
+ ];
2208
+ return c;
2209
+ }
2210
+ //#endregion
2211
+ //#region node_modules/yaml/browser/dist/compose/compose-collection.js
2212
+ function xn(e, t, n, r, i, a) {
2213
+ let o = n.type === "block-map" ? hn(e, t, n, r, a) : n.type === "block-seq" ? gn(e, t, n, r, a) : bn(e, t, n, r, a), s = o.constructor;
2214
+ return i === "!" || i === s.tagName ? (o.tag = s.tagName, o) : (i && (o.tag = i), o);
2215
+ }
2216
+ function Sn(e, t, n, r, i) {
2217
+ let a = r ? t.directives.tagName(r.source, (e) => i(r, "TAG_RESOLVE_FAILED", e)) : null, o = n.type === "block-map" ? "map" : n.type === "block-seq" ? "seq" : n.start.source === "{" ? "map" : "seq";
2218
+ if (!r || !a || a === "!" || a === q.tagName && o === "map" || a === J.tagName && o === "seq" || !o) return xn(e, t, n, i, a);
2219
+ let s = t.schema.tags.find((e) => e.tag === a && e.collection === o);
2220
+ if (!s) {
2221
+ let c = t.schema.knownTags[a];
2222
+ if (c && c.collection === o) t.schema.tags.push(Object.assign({}, c, { default: !1 })), s = c;
2223
+ else return c?.collection ? i(r, "BAD_COLLECTION_TYPE", `${c.tag} used for ${o} collection, but expects ${c.collection}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${a}`, !0), xn(e, t, n, i, a);
2224
+ }
2225
+ let c = xn(e, t, n, i, a, s), l = s.resolve?.(c, (e) => i(r, "TAG_RESOLVE_FAILED", e), t.options) ?? c, u = I(l) ? l : new B(l);
2226
+ return u.range = c.range, u.tag = a, s?.format && (u.format = s.format), u;
2227
+ }
2228
+ //#endregion
2229
+ //#region node_modules/yaml/browser/dist/compose/resolve-block-scalar.js
2230
+ function Cn(e, t, n) {
2231
+ let r = t.offset, i = wn(t, e.options.strict, n);
2232
+ if (!i) return {
2233
+ value: "",
2234
+ type: null,
2235
+ comment: "",
2236
+ range: [
2237
+ r,
2238
+ r,
2239
+ r
2240
+ ]
2241
+ };
2242
+ let a = i.mode === ">" ? B.BLOCK_FOLDED : B.BLOCK_LITERAL, o = t.source ? Tn(t.source) : [], s = o.length;
2243
+ for (let e = o.length - 1; e >= 0; --e) {
2244
+ let t = o[e][1];
2245
+ if (t === "" || t === "\r") s = e;
2246
+ else break;
2247
+ }
2248
+ if (s === 0) {
2249
+ let e = i.chomp === "+" && o.length > 0 ? "\n".repeat(Math.max(1, o.length - 1)) : "", n = r + i.length;
2250
+ return t.source && (n += t.source.length), {
2251
+ value: e,
2252
+ type: a,
2253
+ comment: i.comment,
2254
+ range: [
2255
+ r,
2256
+ n,
2257
+ n
2258
+ ]
2259
+ };
2260
+ }
2261
+ let c = t.indent + i.indent, l = t.offset + i.length, u = 0;
2262
+ for (let t = 0; t < s; ++t) {
2263
+ let [r, a] = o[t];
2264
+ if (a === "" || a === "\r") i.indent === 0 && r.length > c && (c = r.length);
2265
+ else {
2266
+ r.length < c && n(l + r.length, "MISSING_CHAR", "Block scalars with more-indented leading empty lines must use an explicit indentation indicator"), i.indent === 0 && (c = r.length), u = t, c === 0 && !e.atRoot && n(l, "BAD_INDENT", "Block scalar values in collections must be indented");
2267
+ break;
2268
+ }
2269
+ l += r.length + a.length + 1;
2270
+ }
2271
+ for (let e = o.length - 1; e >= s; --e) o[e][0].length > c && (s = e + 1);
2272
+ let d = "", f = "", p = !1;
2273
+ for (let e = 0; e < u; ++e) d += o[e][0].slice(c) + "\n";
2274
+ for (let e = u; e < s; ++e) {
2275
+ let [t, r] = o[e];
2276
+ l += t.length + r.length + 1;
2277
+ let s = r[r.length - 1] === "\r";
2278
+ /* istanbul ignore if already caught in lexer */
2279
+ if (s && (r = r.slice(0, -1)), r && t.length < c) {
2280
+ let e = `Block scalar lines must not be less indented than their ${i.indent ? "explicit indentation indicator" : "first line"}`;
2281
+ n(l - r.length - (s ? 2 : 1), "BAD_INDENT", e), t = "";
2282
+ }
2283
+ a === B.BLOCK_LITERAL ? (d += f + t.slice(c) + r, f = "\n") : t.length > c || r[0] === " " ? (f === " " ? f = "\n" : !p && f === "\n" && (f = "\n\n"), d += f + t.slice(c) + r, f = "\n", p = !0) : r === "" ? f === "\n" ? d += "\n" : f = "\n" : (d += f + r, f = " ", p = !1);
2284
+ }
2285
+ switch (i.chomp) {
2286
+ case "-": break;
2287
+ case "+":
2288
+ for (let e = s; e < o.length; ++e) d += "\n" + o[e][0].slice(c);
2289
+ d[d.length - 1] !== "\n" && (d += "\n");
2290
+ break;
2291
+ default: d += "\n";
2292
+ }
2293
+ let m = r + i.length + t.source.length;
2294
+ return {
2295
+ value: d,
2296
+ type: a,
2297
+ comment: i.comment,
2298
+ range: [
2299
+ r,
2300
+ m,
2301
+ m
2302
+ ]
2303
+ };
2304
+ }
2305
+ function wn({ offset: e, props: t }, n, r) {
2306
+ /* istanbul ignore if should not happen */
2307
+ if (t[0].type !== "block-scalar-header") return r(t[0], "IMPOSSIBLE", "Block scalar header not found"), null;
2308
+ let { source: i } = t[0], a = i[0], o = 0, s = "", c = -1;
2309
+ for (let t = 1; t < i.length; ++t) {
2310
+ let n = i[t];
2311
+ if (!s && (n === "-" || n === "+")) s = n;
2312
+ else {
2313
+ let r = Number(n);
2314
+ !o && r ? o = r : c === -1 && (c = e + t);
2315
+ }
2316
+ }
2317
+ c !== -1 && r(c, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${i}`);
2318
+ let l = !1, u = "", d = i.length;
2319
+ for (let e = 1; e < t.length; ++e) {
2320
+ let i = t[e];
2321
+ switch (i.type) {
2322
+ case "space": l = !0;
2323
+ case "newline":
2324
+ d += i.source.length;
2325
+ break;
2326
+ case "comment":
2327
+ n && !l && r(i, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"), d += i.source.length, u = i.source.substring(1);
2328
+ break;
2329
+ case "error":
2330
+ r(i, "UNEXPECTED_TOKEN", i.message), d += i.source.length;
2331
+ break;
2332
+ /* istanbul ignore next should not happen */
2333
+ default: {
2334
+ r(i, "UNEXPECTED_TOKEN", `Unexpected token in block scalar header: ${i.type}`);
2335
+ let e = i.source;
2336
+ e && typeof e == "string" && (d += e.length);
2337
+ }
2338
+ }
2339
+ }
2340
+ return {
2341
+ mode: a,
2342
+ indent: o,
2343
+ chomp: s,
2344
+ comment: u,
2345
+ length: d
2346
+ };
2347
+ }
2348
+ function Tn(e) {
2349
+ let t = e.split(/\n( *)/), n = t[0], r = n.match(/^( *)/), i = [r?.[1] ? [r[1], n.slice(r[1].length)] : ["", n]];
2350
+ for (let e = 1; e < t.length; e += 2) i.push([t[e], t[e + 1]]);
2351
+ return i;
2352
+ }
2353
+ //#endregion
2354
+ //#region node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js
2355
+ function En(e, t, n) {
2356
+ let { offset: r, type: i, source: a, end: o } = e, s, c, l = (e, t, i) => n(r + e, t, i);
2357
+ switch (i) {
2358
+ case "scalar":
2359
+ s = B.PLAIN, c = Dn(a, l);
2360
+ break;
2361
+ case "single-quoted-scalar":
2362
+ s = B.QUOTE_SINGLE, c = On(a, l);
2363
+ break;
2364
+ case "double-quoted-scalar":
2365
+ s = B.QUOTE_DOUBLE, c = An(a, l);
2366
+ break;
2367
+ /* istanbul ignore next should not happen */
2368
+ default: return n(e, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${i}`), {
2369
+ value: "",
2370
+ type: null,
2371
+ comment: "",
2372
+ range: [
2373
+ r,
2374
+ r + a.length,
2375
+ r + a.length
2376
+ ]
2377
+ };
2378
+ }
2379
+ let u = r + a.length, d = _n(o, u, t, n);
2380
+ return {
2381
+ value: c,
2382
+ type: s,
2383
+ comment: d.comment,
2384
+ range: [
2385
+ r,
2386
+ u,
2387
+ d.offset
2388
+ ]
2389
+ };
2390
+ }
2391
+ function Dn(e, t) {
2392
+ let n = "";
2393
+ switch (e[0]) {
2394
+ /* istanbul ignore next should not happen */
2395
+ case " ":
2396
+ n = "a tab character";
2397
+ break;
2398
+ case ",":
2399
+ n = "flow indicator character ,";
2400
+ break;
2401
+ case "%":
2402
+ n = "directive indicator character %";
2403
+ break;
2404
+ case "|":
2405
+ case ">":
2406
+ n = `block scalar indicator ${e[0]}`;
2407
+ break;
2408
+ case "@":
2409
+ case "`": n = `reserved character ${e[0]}`;
2410
+ }
2411
+ return n && t(0, "BAD_SCALAR_START", `Plain value cannot start with ${n}`), kn(e);
2412
+ }
2413
+ function On(e, t) {
2414
+ return (e[e.length - 1] !== "'" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing 'quote"), kn(e.slice(1, -1)).replace(/''/g, "'");
2415
+ }
2416
+ function kn(e) {
2417
+ let t, n;
2418
+ try {
2419
+ t = /* @__PURE__ */ RegExp("(.*?)(?<![ ])[ ]*\r?\n", "sy"), n = /* @__PURE__ */ RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n", "sy");
2420
+ } catch {
2421
+ t = /(.*?)[ \t]*\r?\n/sy, n = /[ \t]*(.*?)[ \t]*\r?\n/sy;
2422
+ }
2423
+ let r = t.exec(e);
2424
+ if (!r) return e;
2425
+ let i = r[1], a = " ", o = t.lastIndex;
2426
+ for (n.lastIndex = o; r = n.exec(e);) r[1] === "" ? a === "\n" ? i += a : a = "\n" : (i += a + r[1], a = " "), o = n.lastIndex;
2427
+ let s = /[ \t]*(.*)/sy;
2428
+ return s.lastIndex = o, r = s.exec(e), i + a + (r?.[1] ?? "");
2429
+ }
2430
+ function An(e, t) {
2431
+ let n = "";
2432
+ for (let r = 1; r < e.length - 1; ++r) {
2433
+ let i = e[r];
2434
+ if (i !== "\r" || e[r + 1] !== "\n") {
2435
+ if (i === "\n") {
2436
+ let { fold: t, offset: i } = jn(e, r);
2437
+ n += t, r = i;
2438
+ } else if (i === "\\") {
2439
+ let i = e[++r], a = Mn[i];
2440
+ if (a) n += a;
2441
+ else if (i === "\n") for (i = e[r + 1]; i === " " || i === " ";) i = e[++r + 1];
2442
+ else if (i === "\r" && e[r + 1] === "\n") for (i = e[++r + 1]; i === " " || i === " ";) i = e[++r + 1];
2443
+ else if (i === "x" || i === "u" || i === "U") {
2444
+ let a = {
2445
+ x: 2,
2446
+ u: 4,
2447
+ U: 8
2448
+ }[i];
2449
+ n += Nn(e, r + 1, a, t), r += a;
2450
+ } else {
2451
+ let i = e.substr(r - 1, 2);
2452
+ t(r - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${i}`), n += i;
2453
+ }
2454
+ } else if (i === " " || i === " ") {
2455
+ let t = r, a = e[r + 1];
2456
+ for (; a === " " || a === " ";) a = e[++r + 1];
2457
+ a !== "\n" && (a !== "\r" || e[r + 2] !== "\n") && (n += r > t ? e.slice(t, r + 1) : i);
2458
+ } else n += i;
2459
+ }
2460
+ }
2461
+ return (e[e.length - 1] !== "\"" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing \"quote"), n;
2462
+ }
2463
+ function jn(e, t) {
2464
+ let n = "", r = e[t + 1];
2465
+ for (; (r === " " || r === " " || r === "\n" || r === "\r") && (r !== "\r" || e[t + 2] === "\n");) r === "\n" && (n += "\n"), t += 1, r = e[t + 1];
2466
+ return n ||= " ", {
2467
+ fold: n,
2468
+ offset: t
2469
+ };
2470
+ }
2471
+ var Mn = {
2472
+ 0: "\0",
2473
+ a: "\x07",
2474
+ b: "\b",
2475
+ e: "\x1B",
2476
+ f: "\f",
2477
+ n: "\n",
2478
+ r: "\r",
2479
+ t: " ",
2480
+ v: "\v",
2481
+ N: "…",
2482
+ _: "\xA0",
2483
+ L: "\u2028",
2484
+ P: "\u2029",
2485
+ " ": " ",
2486
+ "\"": "\"",
2487
+ "/": "/",
2488
+ "\\": "\\",
2489
+ " ": " "
2490
+ };
2491
+ function Nn(e, t, n, r) {
2492
+ let i = e.substr(t, n), a = i.length === n && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
2493
+ if (isNaN(a)) {
2494
+ let i = e.substr(t - 2, n + 2);
2495
+ return r(t - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${i}`), i;
2496
+ }
2497
+ return String.fromCodePoint(a);
2498
+ }
2499
+ //#endregion
2500
+ //#region node_modules/yaml/browser/dist/compose/compose-scalar.js
2501
+ function Pn(e, t, n, r) {
2502
+ let { value: i, type: a, comment: o, range: s } = t.type === "block-scalar" ? Cn(e, t, r) : En(t, e.options.strict, r), c = n ? e.directives.tagName(n.source, (e) => r(n, "TAG_RESOLVE_FAILED", e)) : null, l = n && c ? Fn(e.schema, i, c, n, r) : t.type === "scalar" ? In(e, i, t, r) : e.schema[D], u;
2503
+ try {
2504
+ let a = l.resolve(i, (e) => r(n ?? t, "TAG_RESOLVE_FAILED", e), e.options);
2505
+ u = N(a) ? a : new B(a);
2506
+ } catch (e) {
2507
+ let a = e instanceof Error ? e.message : String(e);
2508
+ r(n ?? t, "TAG_RESOLVE_FAILED", a), u = new B(i);
2509
+ }
2510
+ return u.range = s, u.source = i, a && (u.type = a), c && (u.tag = c), l.format && (u.format = l.format), o && (u.comment = o), u;
2511
+ }
2512
+ function Fn(e, t, n, r, i) {
2513
+ if (n === "!") return e[D];
2514
+ let a = [];
2515
+ for (let t of e.tags) if (!t.collection && t.tag === n) {
2516
+ if (t.default && t.test) a.push(t);
2517
+ else return t;
2518
+ }
2519
+ for (let e of a) if (e.test?.test(t)) return e;
2520
+ let o = e.knownTags[n];
2521
+ return o && !o.collection ? (e.tags.push(Object.assign({}, o, {
2522
+ default: !1,
2523
+ test: void 0
2524
+ })), o) : (i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${n}`, n !== "tag:yaml.org,2002:str"), e[D]);
2525
+ }
2526
+ function In({ directives: e, schema: t }, n, r, i) {
2527
+ let a = t.tags.find((e) => e.default && e.test?.test(n)) || t[D];
2528
+ if (t.compat) {
2529
+ let o = t.compat.find((e) => e.default && e.test?.test(n)) ?? t[D];
2530
+ a.tag !== o.tag && i(r, "TAG_RESOLVE_FAILED", `Value may be parsed as either ${e.tagString(a.tag)} or ${e.tagString(o.tag)}`, !0);
2531
+ }
2532
+ return a;
2533
+ }
2534
+ //#endregion
2535
+ //#region node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js
2536
+ function Ln(e, t, n) {
2537
+ if (t) {
2538
+ n === null && (n = t.length);
2539
+ for (let r = n - 1; r >= 0; --r) {
2540
+ let n = t[r];
2541
+ switch (n.type) {
2542
+ case "space":
2543
+ case "comment":
2544
+ case "newline":
2545
+ e -= n.source.length;
2546
+ continue;
2547
+ }
2548
+ for (n = t[++r]; n?.type === "space";) e += n.source.length, n = t[++r];
2549
+ break;
2550
+ }
2551
+ }
2552
+ return e;
2553
+ }
2554
+ //#endregion
2555
+ //#region node_modules/yaml/browser/dist/compose/compose-node.js
2556
+ var Rn = {
2557
+ composeNode: zn,
2558
+ composeEmptyNode: Bn
2559
+ };
2560
+ function zn(e, t, n, r) {
2561
+ let { spaceBefore: i, comment: a, anchor: o, tag: s } = n, c, l = !0;
2562
+ switch (t.type) {
2563
+ case "alias":
2564
+ c = Vn(e, t, r), (o || s) && r(t, "ALIAS_PROPS", "An alias node must not specify any properties");
2565
+ break;
2566
+ case "scalar":
2567
+ case "single-quoted-scalar":
2568
+ case "double-quoted-scalar":
2569
+ case "block-scalar":
2570
+ c = Pn(e, t, s, r), o && (c.anchor = o.source.substring(1));
2571
+ break;
2572
+ case "block-map":
2573
+ case "block-seq":
2574
+ case "flow-collection":
2575
+ c = Sn(Rn, e, t, s, r), o && (c.anchor = o.source.substring(1));
2576
+ break;
2577
+ default: r(t, "UNEXPECTED_TOKEN", t.type === "error" ? t.message : `Unsupported token (type: ${t.type})`), c = Bn(e, t.offset, void 0, null, n, r), l = !1;
2578
+ }
2579
+ return o && c.anchor === "" && r(o, "BAD_ALIAS", "Anchor cannot be an empty string"), i && (c.spaceBefore = !0), a && (t.type === "scalar" && t.source === "" ? c.comment = a : c.commentBefore = a), e.options.keepSourceTokens && l && (c.srcToken = t), c;
2580
+ }
2581
+ function Bn(e, t, n, r, { spaceBefore: i, comment: a, anchor: o, tag: s, end: c }, l) {
2582
+ let u = Pn(e, {
2583
+ type: "scalar",
2584
+ offset: Ln(t, n, r),
2585
+ indent: -1,
2586
+ source: ""
2587
+ }, s, l);
2588
+ return o && (u.anchor = o.source.substring(1), u.anchor === "" && l(o, "BAD_ALIAS", "Anchor cannot be an empty string")), i && (u.spaceBefore = !0), a && (u.comment = a, u.range[2] = c), u;
2589
+ }
2590
+ function Vn({ options: e }, { offset: t, source: n, end: r }, i) {
2591
+ let a = new ve(n.substring(1));
2592
+ a.source === "" && i(t, "BAD_ALIAS", "Alias cannot be an empty string"), a.source.endsWith(":") && i(t + n.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", !0);
2593
+ let o = t + n.length, s = _n(r, o, e.strict, i);
2594
+ return a.range = [
2595
+ t,
2596
+ o,
2597
+ s.offset
2598
+ ], s.comment && (a.comment = s.comment), a;
2599
+ }
2600
+ //#endregion
2601
+ //#region node_modules/yaml/browser/dist/compose/compose-doc.js
2602
+ function Hn(e, t, { offset: n, start: r, value: i, end: a }, o) {
2603
+ let s = new rn(void 0, Object.assign({ _directives: t }, e)), c = {
2604
+ atRoot: !0,
2605
+ directives: s.directives,
2606
+ options: s.options,
2607
+ schema: s.schema
2608
+ }, l = un(r, {
2609
+ indicator: "doc-start",
2610
+ next: i ?? a?.[0],
2611
+ offset: n,
2612
+ onError: o,
2613
+ parentIndent: 0,
2614
+ startOnNewline: !0
2615
+ });
2616
+ l.found && (s.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !l.hasNewline && o(l.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), s.contents = i ? zn(c, i, l, o) : Bn(c, l.end, r, null, l, o);
2617
+ let u = s.contents.range[2], d = _n(a, u, !1, o);
2618
+ return d.comment && (s.comment = d.comment), s.range = [
2619
+ n,
2620
+ u,
2621
+ d.offset
2622
+ ], s;
2623
+ }
2624
+ //#endregion
2625
+ //#region node_modules/yaml/browser/dist/compose/composer.js
2626
+ function Un(e) {
2627
+ if (typeof e == "number") return [e, e + 1];
2628
+ if (Array.isArray(e)) return e.length === 2 ? e : [e[0], e[1]];
2629
+ let { offset: t, source: n } = e;
2630
+ return [t, t + (typeof n == "string" ? n.length : 1)];
2631
+ }
2632
+ function Wn(e) {
2633
+ let t = "", n = !1, r = !1;
2634
+ for (let i = 0; i < e.length; ++i) {
2635
+ let a = e[i];
2636
+ switch (a[0]) {
2637
+ case "#":
2638
+ t += (t === "" ? "" : r ? "\n\n" : "\n") + (a.substring(1) || " "), n = !0, r = !1;
2639
+ break;
2640
+ case "%":
2641
+ e[i + 1]?.[0] !== "#" && (i += 1), n = !1;
2642
+ break;
2643
+ default: n || (r = !0), n = !1;
2644
+ }
2645
+ }
2646
+ return {
2647
+ comment: t,
2648
+ afterEmptyLine: r
2649
+ };
2650
+ }
2651
+ var Gn = class {
2652
+ constructor(e = {}) {
2653
+ this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (e, t, n, r) => {
2654
+ let i = Un(e);
2655
+ r ? this.warnings.push(new cn(i, t, n)) : this.errors.push(new sn(i, t, n));
2656
+ }, this.directives = new de({ version: e.version || "1.2" }), this.options = e;
2657
+ }
2658
+ decorate(e, t) {
2659
+ let { comment: n, afterEmptyLine: r } = Wn(this.prelude);
2660
+ if (n) {
2661
+ let i = e.contents;
2662
+ if (t) e.comment = e.comment ? `${e.comment}\n${n}` : n;
2663
+ else if (r || e.directives.docStart || !i) e.commentBefore = n;
2664
+ else if (F(i) && !i.flow && i.items.length > 0) {
2665
+ let e = i.items[0];
2666
+ M(e) && (e = e.key);
2667
+ let t = e.commentBefore;
2668
+ e.commentBefore = t ? `${n}\n${t}` : n;
2669
+ } else {
2670
+ let e = i.commentBefore;
2671
+ i.commentBefore = e ? `${n}\n${e}` : n;
2672
+ }
2673
+ }
2674
+ t ? (Array.prototype.push.apply(e.errors, this.errors), Array.prototype.push.apply(e.warnings, this.warnings)) : (e.errors = this.errors, e.warnings = this.warnings), this.prelude = [], this.errors = [], this.warnings = [];
2675
+ }
2676
+ streamInfo() {
2677
+ return {
2678
+ comment: Wn(this.prelude).comment,
2679
+ directives: this.directives,
2680
+ errors: this.errors,
2681
+ warnings: this.warnings
2682
+ };
2683
+ }
2684
+ *compose(e, t = !1, n = -1) {
2685
+ for (let t of e) yield* this.next(t);
2686
+ yield* this.end(t, n);
2687
+ }
2688
+ *next(e) {
2689
+ switch (e.type) {
2690
+ case "directive":
2691
+ this.directives.add(e.source, (t, n, r) => {
2692
+ let i = Un(e);
2693
+ i[0] += t, this.onError(i, "BAD_DIRECTIVE", n, r);
2694
+ }), this.prelude.push(e.source), this.atDirectives = !0;
2695
+ break;
2696
+ case "document": {
2697
+ let t = Hn(this.options, this.directives, e, this.onError);
2698
+ this.atDirectives && !t.directives.docStart && this.onError(e, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"), this.decorate(t, !1), this.doc && (yield this.doc), this.doc = t, this.atDirectives = !1;
2699
+ break;
2700
+ }
2701
+ case "byte-order-mark":
2702
+ case "space": break;
2703
+ case "comment":
2704
+ case "newline":
2705
+ this.prelude.push(e.source);
2706
+ break;
2707
+ case "error": {
2708
+ let t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new sn(Un(e), "UNEXPECTED_TOKEN", t);
2709
+ this.atDirectives || !this.doc ? this.errors.push(n) : this.doc.errors.push(n);
2710
+ break;
2711
+ }
2712
+ case "doc-end": {
2713
+ if (!this.doc) {
2714
+ this.errors.push(new sn(Un(e), "UNEXPECTED_TOKEN", "Unexpected doc-end without preceding document"));
2715
+ break;
2716
+ }
2717
+ this.doc.directives.docEnd = !0;
2718
+ let t = _n(e.end, e.offset + e.source.length, this.doc.options.strict, this.onError);
2719
+ if (this.decorate(this.doc, !0), t.comment) {
2720
+ let e = this.doc.comment;
2721
+ this.doc.comment = e ? `${e}\n${t.comment}` : t.comment;
2722
+ }
2723
+ this.doc.range[2] = t.offset;
2724
+ break;
2725
+ }
2726
+ default: this.errors.push(new sn(Un(e), "UNEXPECTED_TOKEN", `Unsupported token ${e.type}`));
2727
+ }
2728
+ }
2729
+ *end(e = !1, t = -1) {
2730
+ if (this.doc) this.decorate(this.doc, !0), yield this.doc, this.doc = null;
2731
+ else if (e) {
2732
+ let e = new rn(void 0, Object.assign({ _directives: this.directives }, this.options));
2733
+ this.atDirectives && this.onError(t, "MISSING_CHAR", "Missing directives-end indicator line"), e.range = [
2734
+ 0,
2735
+ t,
2736
+ t
2737
+ ], this.decorate(e, !1), yield e;
2738
+ }
2739
+ }
2740
+ }, Kn = Symbol("break visit"), qn = Symbol("skip children"), Jn = Symbol("remove item");
2741
+ function Yn(e, t) {
2742
+ "type" in e && e.type === "document" && (e = {
2743
+ start: e.start,
2744
+ value: e.value
2745
+ }), Xn(Object.freeze([]), e, t);
2746
+ }
2747
+ Yn.BREAK = Kn, Yn.SKIP = qn, Yn.REMOVE = Jn, Yn.itemAtPath = (e, t) => {
2748
+ let n = e;
2749
+ for (let [e, r] of t) {
2750
+ let t = n?.[e];
2751
+ if (t && "items" in t) n = t.items[r];
2752
+ else return;
2753
+ }
2754
+ return n;
2755
+ }, Yn.parentCollection = (e, t) => {
2756
+ let n = Yn.itemAtPath(e, t.slice(0, -1)), r = t[t.length - 1][0], i = n?.[r];
2757
+ if (i && "items" in i) return i;
2758
+ throw Error("Parent collection not found");
2759
+ };
2760
+ function Xn(e, t, n) {
2761
+ let r = n(t, e);
2762
+ if (typeof r == "symbol") return r;
2763
+ for (let i of ["key", "value"]) {
2764
+ let a = t[i];
2765
+ if (a && "items" in a) {
2766
+ for (let t = 0; t < a.items.length; ++t) {
2767
+ let r = Xn(Object.freeze(e.concat([[i, t]])), a.items[t], n);
2768
+ if (typeof r == "number") t = r - 1;
2769
+ else if (r === Kn) return Kn;
2770
+ else r === Jn && (a.items.splice(t, 1), --t);
2771
+ }
2772
+ typeof r == "function" && i === "key" && (r = r(t, e));
2773
+ }
2774
+ }
2775
+ return typeof r == "function" ? r(t, e) : r;
2776
+ }
2777
+ function Zn(e) {
2778
+ switch (e) {
2779
+ case "": return "byte-order-mark";
2780
+ case "": return "doc-mode";
2781
+ case "": return "flow-error-end";
2782
+ case "": return "scalar";
2783
+ case "---": return "doc-start";
2784
+ case "...": return "doc-end";
2785
+ case "":
2786
+ case "\n":
2787
+ case "\r\n": return "newline";
2788
+ case "-": return "seq-item-ind";
2789
+ case "?": return "explicit-key-ind";
2790
+ case ":": return "map-value-ind";
2791
+ case "{": return "flow-map-start";
2792
+ case "}": return "flow-map-end";
2793
+ case "[": return "flow-seq-start";
2794
+ case "]": return "flow-seq-end";
2795
+ case ",": return "comma";
2796
+ }
2797
+ switch (e[0]) {
2798
+ case " ":
2799
+ case " ": return "space";
2800
+ case "#": return "comment";
2801
+ case "%": return "directive-line";
2802
+ case "*": return "alias";
2803
+ case "&": return "anchor";
2804
+ case "!": return "tag";
2805
+ case "'": return "single-quoted-scalar";
2806
+ case "\"": return "double-quoted-scalar";
2807
+ case "|":
2808
+ case ">": return "block-scalar-header";
2809
+ }
2810
+ return null;
2811
+ }
2812
+ //#endregion
2813
+ //#region node_modules/yaml/browser/dist/parse/lexer.js
2814
+ function X(e) {
2815
+ switch (e) {
2816
+ case void 0:
2817
+ case " ":
2818
+ case "\n":
2819
+ case "\r":
2820
+ case " ": return !0;
2821
+ default: return !1;
2822
+ }
2823
+ }
2824
+ var Qn = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), $n = /* @__PURE__ */ new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), er = /* @__PURE__ */ new Set(",[]{}"), tr = /* @__PURE__ */ new Set(" ,[]{}\n\r "), nr = (e) => !e || tr.has(e), rr = class {
2825
+ constructor() {
2826
+ this.atEnd = !1, this.blockScalarIndent = -1, this.blockScalarKeep = !1, this.buffer = "", this.flowKey = !1, this.flowLevel = 0, this.indentNext = 0, this.indentValue = 0, this.lineEndPos = null, this.next = null, this.pos = 0;
2827
+ }
2828
+ *lex(e, t = !1) {
2829
+ if (e) {
2830
+ if (typeof e != "string") throw TypeError("source is not a string");
2831
+ this.buffer = this.buffer ? this.buffer + e : e, this.lineEndPos = null;
2832
+ }
2833
+ this.atEnd = !t;
2834
+ let n = this.next ?? "stream";
2835
+ for (; n && (t || this.hasChars(1));) n = yield* this.parseNext(n);
2836
+ }
2837
+ atLineEnd() {
2838
+ let e = this.pos, t = this.buffer[e];
2839
+ for (; t === " " || t === " ";) t = this.buffer[++e];
2840
+ return !t || t === "#" || t === "\n" || t === "\r" && this.buffer[e + 1] === "\n";
2841
+ }
2842
+ charAt(e) {
2843
+ return this.buffer[this.pos + e];
2844
+ }
2845
+ continueScalar(e) {
2846
+ let t = this.buffer[e];
2847
+ if (this.indentNext > 0) {
2848
+ let n = 0;
2849
+ for (; t === " ";) t = this.buffer[++n + e];
2850
+ if (t === "\r") {
2851
+ let t = this.buffer[n + e + 1];
2852
+ if (t === "\n" || !t && !this.atEnd) return e + n + 1;
2853
+ }
2854
+ return t === "\n" || n >= this.indentNext || !t && !this.atEnd ? e + n : -1;
2855
+ }
2856
+ if (t === "-" || t === ".") {
2857
+ let t = this.buffer.substr(e, 3);
2858
+ if ((t === "---" || t === "...") && X(this.buffer[e + 3])) return -1;
2859
+ }
2860
+ return e;
2861
+ }
2862
+ getLine() {
2863
+ let e = this.lineEndPos;
2864
+ return (typeof e != "number" || e !== -1 && e < this.pos) && (e = this.buffer.indexOf("\n", this.pos), this.lineEndPos = e), e === -1 ? this.atEnd ? this.buffer.substring(this.pos) : null : (this.buffer[e - 1] === "\r" && --e, this.buffer.substring(this.pos, e));
2865
+ }
2866
+ hasChars(e) {
2867
+ return this.pos + e <= this.buffer.length;
2868
+ }
2869
+ setNext(e) {
2870
+ return this.buffer = this.buffer.substring(this.pos), this.pos = 0, this.lineEndPos = null, this.next = e, null;
2871
+ }
2872
+ peek(e) {
2873
+ return this.buffer.substr(this.pos, e);
2874
+ }
2875
+ *parseNext(e) {
2876
+ switch (e) {
2877
+ case "stream": return yield* this.parseStream();
2878
+ case "line-start": return yield* this.parseLineStart();
2879
+ case "block-start": return yield* this.parseBlockStart();
2880
+ case "doc": return yield* this.parseDocument();
2881
+ case "flow": return yield* this.parseFlowCollection();
2882
+ case "quoted-scalar": return yield* this.parseQuotedScalar();
2883
+ case "block-scalar": return yield* this.parseBlockScalar();
2884
+ case "plain-scalar": return yield* this.parsePlainScalar();
2885
+ }
2886
+ }
2887
+ *parseStream() {
2888
+ let e = this.getLine();
2889
+ if (e === null) return this.setNext("stream");
2890
+ if (e[0] === "" && (yield* this.pushCount(1), e = e.substring(1)), e[0] === "%") {
2891
+ let t = e.length, n = e.indexOf("#");
2892
+ for (; n !== -1;) {
2893
+ let r = e[n - 1];
2894
+ if (r === " " || r === " ") {
2895
+ t = n - 1;
2896
+ break;
2897
+ }
2898
+ n = e.indexOf("#", n + 1);
2899
+ }
2900
+ for (;;) {
2901
+ let n = e[t - 1];
2902
+ if (n === " " || n === " ") --t;
2903
+ else break;
2904
+ }
2905
+ let r = (yield* this.pushCount(t)) + (yield* this.pushSpaces(!0));
2906
+ return yield* this.pushCount(e.length - r), this.pushNewline(), "stream";
2907
+ }
2908
+ if (this.atLineEnd()) {
2909
+ let t = yield* this.pushSpaces(!0);
2910
+ return yield* this.pushCount(e.length - t), yield* this.pushNewline(), "stream";
2911
+ }
2912
+ return yield "", yield* this.parseLineStart();
2913
+ }
2914
+ *parseLineStart() {
2915
+ let e = this.charAt(0);
2916
+ if (!e && !this.atEnd) return this.setNext("line-start");
2917
+ if (e === "-" || e === ".") {
2918
+ if (!this.atEnd && !this.hasChars(4)) return this.setNext("line-start");
2919
+ let e = this.peek(3);
2920
+ if (e === "---" && X(this.charAt(3))) return yield* this.pushCount(3), this.indentValue = 0, this.indentNext = 0, "doc";
2921
+ if (e === "..." && X(this.charAt(3))) return yield* this.pushCount(3), "stream";
2922
+ }
2923
+ return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !X(this.charAt(1)) && (this.indentNext = this.indentValue), yield* this.parseBlockStart();
2924
+ }
2925
+ *parseBlockStart() {
2926
+ let [e, t] = this.peek(2);
2927
+ if (!t && !this.atEnd) return this.setNext("block-start");
2928
+ if ((e === "-" || e === "?" || e === ":") && X(t)) {
2929
+ let e = (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0));
2930
+ return this.indentNext = this.indentValue + 1, this.indentValue += e, yield* this.parseBlockStart();
2931
+ }
2932
+ return "doc";
2933
+ }
2934
+ *parseDocument() {
2935
+ yield* this.pushSpaces(!0);
2936
+ let e = this.getLine();
2937
+ if (e === null) return this.setNext("doc");
2938
+ let t = yield* this.pushIndicators();
2939
+ switch (e[t]) {
2940
+ case "#": yield* this.pushCount(e.length - t);
2941
+ case void 0: return yield* this.pushNewline(), yield* this.parseLineStart();
2942
+ case "{":
2943
+ case "[": return yield* this.pushCount(1), this.flowKey = !1, this.flowLevel = 1, "flow";
2944
+ case "}":
2945
+ case "]": return yield* this.pushCount(1), "doc";
2946
+ case "*": return yield* this.pushUntil(nr), "doc";
2947
+ case "\"":
2948
+ case "'": return yield* this.parseQuotedScalar();
2949
+ case "|":
2950
+ case ">": return t += yield* this.parseBlockScalarHeader(), t += yield* this.pushSpaces(!0), yield* this.pushCount(e.length - t), yield* this.pushNewline(), yield* this.parseBlockScalar();
2951
+ default: return yield* this.parsePlainScalar();
2952
+ }
2953
+ }
2954
+ *parseFlowCollection() {
2955
+ let e, t, n = -1;
2956
+ do
2957
+ e = yield* this.pushNewline(), e > 0 ? (t = yield* this.pushSpaces(!1), this.indentValue = n = t) : t = 0, t += yield* this.pushSpaces(!0);
2958
+ while (e + t > 0);
2959
+ let r = this.getLine();
2960
+ if (r === null) return this.setNext("flow");
2961
+ if ((n !== -1 && n < this.indentNext && r[0] !== "#" || n === 0 && (r.startsWith("---") || r.startsWith("...")) && X(r[3])) && (n !== this.indentNext - 1 || this.flowLevel !== 1 || r[0] !== "]" && r[0] !== "}")) return this.flowLevel = 0, yield "", yield* this.parseLineStart();
2962
+ let i = 0;
2963
+ for (; r[i] === ",";) i += yield* this.pushCount(1), i += yield* this.pushSpaces(!0), this.flowKey = !1;
2964
+ switch (i += yield* this.pushIndicators(), r[i]) {
2965
+ case void 0: return "flow";
2966
+ case "#": return yield* this.pushCount(r.length - i), "flow";
2967
+ case "{":
2968
+ case "[": return yield* this.pushCount(1), this.flowKey = !1, this.flowLevel += 1, "flow";
2969
+ case "}":
2970
+ case "]": return yield* this.pushCount(1), this.flowKey = !0, --this.flowLevel, this.flowLevel ? "flow" : "doc";
2971
+ case "*": return yield* this.pushUntil(nr), "flow";
2972
+ case "\"":
2973
+ case "'": return this.flowKey = !0, yield* this.parseQuotedScalar();
2974
+ case ":": {
2975
+ let e = this.charAt(1);
2976
+ if (this.flowKey || X(e) || e === ",") return this.flowKey = !1, yield* this.pushCount(1), yield* this.pushSpaces(!0), "flow";
2977
+ }
2978
+ default: return this.flowKey = !1, yield* this.parsePlainScalar();
2979
+ }
2980
+ }
2981
+ *parseQuotedScalar() {
2982
+ let e = this.charAt(0), t = this.buffer.indexOf(e, this.pos + 1);
2983
+ if (e === "'") for (; t !== -1 && this.buffer[t + 1] === "'";) t = this.buffer.indexOf("'", t + 2);
2984
+ else for (; t !== -1;) {
2985
+ let e = 0;
2986
+ for (; this.buffer[t - 1 - e] === "\\";) e += 1;
2987
+ if (e % 2 == 0) break;
2988
+ t = this.buffer.indexOf("\"", t + 1);
2989
+ }
2990
+ let n = this.buffer.substring(0, t), r = n.indexOf("\n", this.pos);
2991
+ if (r !== -1) {
2992
+ for (; r !== -1;) {
2993
+ let e = this.continueScalar(r + 1);
2994
+ if (e === -1) break;
2995
+ r = n.indexOf("\n", e);
2996
+ }
2997
+ r !== -1 && (t = r - (n[r - 1] === "\r" ? 2 : 1));
2998
+ }
2999
+ if (t === -1) {
3000
+ if (!this.atEnd) return this.setNext("quoted-scalar");
3001
+ t = this.buffer.length;
3002
+ }
3003
+ return yield* this.pushToIndex(t + 1, !1), this.flowLevel ? "flow" : "doc";
3004
+ }
3005
+ *parseBlockScalarHeader() {
3006
+ this.blockScalarIndent = -1, this.blockScalarKeep = !1;
3007
+ let e = this.pos;
3008
+ for (;;) {
3009
+ let t = this.buffer[++e];
3010
+ if (t === "+") this.blockScalarKeep = !0;
3011
+ else if (t > "0" && t <= "9") this.blockScalarIndent = Number(t) - 1;
3012
+ else if (t !== "-") break;
3013
+ }
3014
+ return yield* this.pushUntil((e) => X(e) || e === "#");
3015
+ }
3016
+ *parseBlockScalar() {
3017
+ let e = this.pos - 1, t = 0, n;
3018
+ loop: for (let r = this.pos; n = this.buffer[r]; ++r) switch (n) {
3019
+ case " ":
3020
+ t += 1;
3021
+ break;
3022
+ case "\n":
3023
+ e = r, t = 0;
3024
+ break;
3025
+ case "\r": {
3026
+ let e = this.buffer[r + 1];
3027
+ if (!e && !this.atEnd) return this.setNext("block-scalar");
3028
+ if (e === "\n") break;
3029
+ }
3030
+ default: break loop;
3031
+ }
3032
+ if (!n && !this.atEnd) return this.setNext("block-scalar");
3033
+ if (t >= this.indentNext) {
3034
+ this.indentNext = this.blockScalarIndent === -1 ? t : this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);
3035
+ do {
3036
+ let t = this.continueScalar(e + 1);
3037
+ if (t === -1) break;
3038
+ e = this.buffer.indexOf("\n", t);
3039
+ } while (e !== -1);
3040
+ if (e === -1) {
3041
+ if (!this.atEnd) return this.setNext("block-scalar");
3042
+ e = this.buffer.length;
3043
+ }
3044
+ }
3045
+ let r = e + 1;
3046
+ for (n = this.buffer[r]; n === " ";) n = this.buffer[++r];
3047
+ if (n === " ") {
3048
+ for (; n === " " || n === " " || n === "\r" || n === "\n";) n = this.buffer[++r];
3049
+ e = r - 1;
3050
+ } else if (!this.blockScalarKeep) do {
3051
+ let n = e - 1, r = this.buffer[n];
3052
+ r === "\r" && (r = this.buffer[--n]);
3053
+ let i = n;
3054
+ for (; r === " ";) r = this.buffer[--n];
3055
+ if (r === "\n" && n >= this.pos && n + 1 + t > i) e = n;
3056
+ else break;
3057
+ } while (1);
3058
+ return yield "", yield* this.pushToIndex(e + 1, !0), yield* this.parseLineStart();
3059
+ }
3060
+ *parsePlainScalar() {
3061
+ let e = this.flowLevel > 0, t = this.pos - 1, n = this.pos - 1, r;
3062
+ for (; r = this.buffer[++n];) if (r === ":") {
3063
+ let r = this.buffer[n + 1];
3064
+ if (X(r) || e && er.has(r)) break;
3065
+ t = n;
3066
+ } else if (X(r)) {
3067
+ let i = this.buffer[n + 1];
3068
+ if (r === "\r" && (i === "\n" ? (n += 1, r = "\n", i = this.buffer[n + 1]) : t = n), i === "#" || e && er.has(i)) break;
3069
+ if (r === "\n") {
3070
+ let e = this.continueScalar(n + 1);
3071
+ if (e === -1) break;
3072
+ n = Math.max(n, e - 2);
3073
+ }
3074
+ } else {
3075
+ if (e && er.has(r)) break;
3076
+ t = n;
3077
+ }
3078
+ return !r && !this.atEnd ? this.setNext("plain-scalar") : (yield "", yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
3079
+ }
3080
+ *pushCount(e) {
3081
+ return e > 0 ? (yield this.buffer.substr(this.pos, e), this.pos += e, e) : 0;
3082
+ }
3083
+ *pushToIndex(e, t) {
3084
+ let n = this.buffer.slice(this.pos, e);
3085
+ return n ? (yield n, this.pos += n.length, n.length) : (t && (yield ""), 0);
3086
+ }
3087
+ *pushIndicators() {
3088
+ switch (this.charAt(0)) {
3089
+ case "!": return (yield* this.pushTag()) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
3090
+ case "&": return (yield* this.pushUntil(nr)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
3091
+ case "-":
3092
+ case "?":
3093
+ case ":": {
3094
+ let e = this.flowLevel > 0, t = this.charAt(1);
3095
+ if (X(t) || e && er.has(t)) return e ? this.flowKey &&= !1 : this.indentNext = this.indentValue + 1, (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0)) + (yield* this.pushIndicators());
3096
+ }
3097
+ }
3098
+ return 0;
3099
+ }
3100
+ *pushTag() {
3101
+ if (this.charAt(1) === "<") {
3102
+ let e = this.pos + 2, t = this.buffer[e];
3103
+ for (; !X(t) && t !== ">";) t = this.buffer[++e];
3104
+ return yield* this.pushToIndex(t === ">" ? e + 1 : e, !1);
3105
+ }
3106
+ {
3107
+ let e = this.pos + 1, t = this.buffer[e];
3108
+ for (; t;) if ($n.has(t)) t = this.buffer[++e];
3109
+ else if (t === "%" && Qn.has(this.buffer[e + 1]) && Qn.has(this.buffer[e + 2])) t = this.buffer[e += 3];
3110
+ else break;
3111
+ return yield* this.pushToIndex(e, !1);
3112
+ }
3113
+ }
3114
+ *pushNewline() {
3115
+ let e = this.buffer[this.pos];
3116
+ return e === "\n" ? yield* this.pushCount(1) : e === "\r" && this.charAt(1) === "\n" ? yield* this.pushCount(2) : 0;
3117
+ }
3118
+ *pushSpaces(e) {
3119
+ let t = this.pos - 1, n;
3120
+ do
3121
+ n = this.buffer[++t];
3122
+ while (n === " " || e && n === " ");
3123
+ let r = t - this.pos;
3124
+ return r > 0 && (yield this.buffer.substr(this.pos, r), this.pos = t), r;
3125
+ }
3126
+ *pushUntil(e) {
3127
+ let t = this.pos, n = this.buffer[t];
3128
+ for (; !e(n);) n = this.buffer[++t];
3129
+ return yield* this.pushToIndex(t, !1);
3130
+ }
3131
+ }, ir = class {
3132
+ constructor() {
3133
+ this.lineStarts = [], this.addNewLine = (e) => this.lineStarts.push(e), this.linePos = (e) => {
3134
+ let t = 0, n = this.lineStarts.length;
3135
+ for (; t < n;) {
3136
+ let r = t + n >> 1;
3137
+ this.lineStarts[r] < e ? t = r + 1 : n = r;
3138
+ }
3139
+ if (this.lineStarts[t] === e) return {
3140
+ line: t + 1,
3141
+ col: 1
3142
+ };
3143
+ if (t === 0) return {
3144
+ line: 0,
3145
+ col: e
3146
+ };
3147
+ let r = this.lineStarts[t - 1];
3148
+ return {
3149
+ line: t,
3150
+ col: e - r + 1
3151
+ };
3152
+ };
3153
+ }
3154
+ };
3155
+ //#endregion
3156
+ //#region node_modules/yaml/browser/dist/parse/parser.js
3157
+ function Z(e, t) {
3158
+ for (let n = 0; n < e.length; ++n) if (e[n].type === t) return !0;
3159
+ return !1;
3160
+ }
3161
+ function ar(e) {
3162
+ for (let t = 0; t < e.length; ++t) switch (e[t].type) {
3163
+ case "space":
3164
+ case "comment":
3165
+ case "newline": break;
3166
+ default: return t;
3167
+ }
3168
+ return -1;
3169
+ }
3170
+ function or(e) {
3171
+ switch (e?.type) {
3172
+ case "alias":
3173
+ case "scalar":
3174
+ case "single-quoted-scalar":
3175
+ case "double-quoted-scalar":
3176
+ case "flow-collection": return !0;
3177
+ default: return !1;
3178
+ }
3179
+ }
3180
+ function sr(e) {
3181
+ switch (e.type) {
3182
+ case "document": return e.start;
3183
+ case "block-map": {
3184
+ let t = e.items[e.items.length - 1];
3185
+ return t.sep ?? t.start;
3186
+ }
3187
+ case "block-seq": return e.items[e.items.length - 1].start;
3188
+ /* istanbul ignore next should not happen */
3189
+ default: return [];
3190
+ }
3191
+ }
3192
+ function Q(e) {
3193
+ if (e.length === 0) return [];
3194
+ let t = e.length;
3195
+ loop: for (; --t >= 0;) switch (e[t].type) {
3196
+ case "doc-start":
3197
+ case "explicit-key-ind":
3198
+ case "map-value-ind":
3199
+ case "seq-item-ind":
3200
+ case "newline": break loop;
3201
+ }
3202
+ for (; e[++t]?.type === "space";);
3203
+ return e.splice(t, e.length);
3204
+ }
3205
+ function cr(e) {
3206
+ if (e.start.type === "flow-seq-start") for (let t of e.items) t.sep && !t.value && !Z(t.start, "explicit-key-ind") && !Z(t.sep, "map-value-ind") && (t.key && (t.value = t.key), delete t.key, or(t.value) ? t.value.end ? Array.prototype.push.apply(t.value.end, t.sep) : t.value.end = t.sep : Array.prototype.push.apply(t.start, t.sep), delete t.sep);
3207
+ }
3208
+ var lr = class {
3209
+ constructor(e) {
3210
+ this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new rr(), this.onNewLine = e;
3211
+ }
3212
+ *parse(e, t = !1) {
3213
+ this.onNewLine && this.offset === 0 && this.onNewLine(0);
3214
+ for (let n of this.lexer.lex(e, t)) yield* this.next(n);
3215
+ t || (yield* this.end());
3216
+ }
3217
+ *next(e) {
3218
+ if (this.source = e, this.atScalar) {
3219
+ this.atScalar = !1, yield* this.step(), this.offset += e.length;
3220
+ return;
3221
+ }
3222
+ let t = Zn(e);
3223
+ if (!t) {
3224
+ let t = `Not a YAML token: ${e}`;
3225
+ yield* this.pop({
3226
+ type: "error",
3227
+ offset: this.offset,
3228
+ message: t,
3229
+ source: e
3230
+ }), this.offset += e.length;
3231
+ } else if (t === "scalar") this.atNewLine = !1, this.atScalar = !0, this.type = "scalar";
3232
+ else {
3233
+ switch (this.type = t, yield* this.step(), t) {
3234
+ case "newline":
3235
+ this.atNewLine = !0, this.indent = 0, this.onNewLine && this.onNewLine(this.offset + e.length);
3236
+ break;
3237
+ case "space":
3238
+ this.atNewLine && e[0] === " " && (this.indent += e.length);
3239
+ break;
3240
+ case "explicit-key-ind":
3241
+ case "map-value-ind":
3242
+ case "seq-item-ind":
3243
+ this.atNewLine && (this.indent += e.length);
3244
+ break;
3245
+ case "doc-mode":
3246
+ case "flow-error-end": return;
3247
+ default: this.atNewLine = !1;
3248
+ }
3249
+ this.offset += e.length;
3250
+ }
3251
+ }
3252
+ *end() {
3253
+ for (; this.stack.length > 0;) yield* this.pop();
3254
+ }
3255
+ get sourceToken() {
3256
+ return {
3257
+ type: this.type,
3258
+ offset: this.offset,
3259
+ indent: this.indent,
3260
+ source: this.source
3261
+ };
3262
+ }
3263
+ *step() {
3264
+ let e = this.peek(1);
3265
+ if (this.type === "doc-end" && (!e || e.type !== "doc-end")) {
3266
+ for (; this.stack.length > 0;) yield* this.pop();
3267
+ this.stack.push({
3268
+ type: "doc-end",
3269
+ offset: this.offset,
3270
+ source: this.source
3271
+ });
3272
+ return;
3273
+ }
3274
+ if (!e) return yield* this.stream();
3275
+ switch (e.type) {
3276
+ case "document": return yield* this.document(e);
3277
+ case "alias":
3278
+ case "scalar":
3279
+ case "single-quoted-scalar":
3280
+ case "double-quoted-scalar": return yield* this.scalar(e);
3281
+ case "block-scalar": return yield* this.blockScalar(e);
3282
+ case "block-map": return yield* this.blockMap(e);
3283
+ case "block-seq": return yield* this.blockSequence(e);
3284
+ case "flow-collection": return yield* this.flowCollection(e);
3285
+ case "doc-end": return yield* this.documentEnd(e);
3286
+ }
3287
+ /* istanbul ignore next should not happen */
3288
+ yield* this.pop();
3289
+ }
3290
+ peek(e) {
3291
+ return this.stack[this.stack.length - e];
3292
+ }
3293
+ *pop(e) {
3294
+ let t = e ?? this.stack.pop();
3295
+ /* istanbul ignore if should not happen */
3296
+ if (!t) yield {
3297
+ type: "error",
3298
+ offset: this.offset,
3299
+ source: "",
3300
+ message: "Tried to pop an empty stack"
3301
+ };
3302
+ else if (this.stack.length === 0) yield t;
3303
+ else {
3304
+ let e = this.peek(1);
3305
+ switch (t.type === "block-scalar" ? t.indent = "indent" in e ? e.indent : 0 : t.type === "flow-collection" && e.type === "document" && (t.indent = 0), t.type === "flow-collection" && cr(t), e.type) {
3306
+ case "document":
3307
+ e.value = t;
3308
+ break;
3309
+ case "block-scalar":
3310
+ e.props.push(t);
3311
+ break;
3312
+ case "block-map": {
3313
+ let n = e.items[e.items.length - 1];
3314
+ if (n.value) {
3315
+ e.items.push({
3316
+ start: [],
3317
+ key: t,
3318
+ sep: []
3319
+ }), this.onKeyLine = !0;
3320
+ return;
3321
+ }
3322
+ if (n.sep) n.value = t;
3323
+ else {
3324
+ Object.assign(n, {
3325
+ key: t,
3326
+ sep: []
3327
+ }), this.onKeyLine = !n.explicitKey;
3328
+ return;
3329
+ }
3330
+ break;
3331
+ }
3332
+ case "block-seq": {
3333
+ let n = e.items[e.items.length - 1];
3334
+ n.value ? e.items.push({
3335
+ start: [],
3336
+ value: t
3337
+ }) : n.value = t;
3338
+ break;
3339
+ }
3340
+ case "flow-collection": {
3341
+ let n = e.items[e.items.length - 1];
3342
+ !n || n.value ? e.items.push({
3343
+ start: [],
3344
+ key: t,
3345
+ sep: []
3346
+ }) : n.sep ? n.value = t : Object.assign(n, {
3347
+ key: t,
3348
+ sep: []
3349
+ });
3350
+ return;
3351
+ }
3352
+ /* istanbul ignore next should not happen */
3353
+ default: yield* this.pop(), yield* this.pop(t);
3354
+ }
3355
+ if ((e.type === "document" || e.type === "block-map" || e.type === "block-seq") && (t.type === "block-map" || t.type === "block-seq")) {
3356
+ let n = t.items[t.items.length - 1];
3357
+ n && !n.sep && !n.value && n.start.length > 0 && ar(n.start) === -1 && (t.indent === 0 || n.start.every((e) => e.type !== "comment" || e.indent < t.indent)) && (e.type === "document" ? e.end = n.start : e.items.push({ start: n.start }), t.items.splice(-1, 1));
3358
+ }
3359
+ }
3360
+ }
3361
+ *stream() {
3362
+ switch (this.type) {
3363
+ case "directive-line":
3364
+ yield {
3365
+ type: "directive",
3366
+ offset: this.offset,
3367
+ source: this.source
3368
+ };
3369
+ return;
3370
+ case "byte-order-mark":
3371
+ case "space":
3372
+ case "comment":
3373
+ case "newline":
3374
+ yield this.sourceToken;
3375
+ return;
3376
+ case "doc-mode":
3377
+ case "doc-start": {
3378
+ let e = {
3379
+ type: "document",
3380
+ offset: this.offset,
3381
+ start: []
3382
+ };
3383
+ this.type === "doc-start" && e.start.push(this.sourceToken), this.stack.push(e);
3384
+ return;
3385
+ }
3386
+ }
3387
+ yield {
3388
+ type: "error",
3389
+ offset: this.offset,
3390
+ message: `Unexpected ${this.type} token in YAML stream`,
3391
+ source: this.source
3392
+ };
3393
+ }
3394
+ *document(e) {
3395
+ if (e.value) return yield* this.lineEnd(e);
3396
+ switch (this.type) {
3397
+ case "doc-start":
3398
+ ar(e.start) === -1 ? e.start.push(this.sourceToken) : (yield* this.pop(), yield* this.step());
3399
+ return;
3400
+ case "anchor":
3401
+ case "tag":
3402
+ case "space":
3403
+ case "comment":
3404
+ case "newline":
3405
+ e.start.push(this.sourceToken);
3406
+ return;
3407
+ }
3408
+ let t = this.startBlockValue(e);
3409
+ t ? this.stack.push(t) : yield {
3410
+ type: "error",
3411
+ offset: this.offset,
3412
+ message: `Unexpected ${this.type} token in YAML document`,
3413
+ source: this.source
3414
+ };
3415
+ }
3416
+ *scalar(e) {
3417
+ if (this.type === "map-value-ind") {
3418
+ let t = Q(sr(this.peek(2))), n;
3419
+ e.end ? (n = e.end, n.push(this.sourceToken), delete e.end) : n = [this.sourceToken];
3420
+ let r = {
3421
+ type: "block-map",
3422
+ offset: e.offset,
3423
+ indent: e.indent,
3424
+ items: [{
3425
+ start: t,
3426
+ key: e,
3427
+ sep: n
3428
+ }]
3429
+ };
3430
+ this.onKeyLine = !0, this.stack[this.stack.length - 1] = r;
3431
+ } else yield* this.lineEnd(e);
3432
+ }
3433
+ *blockScalar(e) {
3434
+ switch (this.type) {
3435
+ case "space":
3436
+ case "comment":
3437
+ case "newline":
3438
+ e.props.push(this.sourceToken);
3439
+ return;
3440
+ case "scalar":
3441
+ if (e.source = this.source, this.atNewLine = !0, this.indent = 0, this.onNewLine) {
3442
+ let e = this.source.indexOf("\n") + 1;
3443
+ for (; e !== 0;) this.onNewLine(this.offset + e), e = this.source.indexOf("\n", e) + 1;
3444
+ }
3445
+ yield* this.pop();
3446
+ break;
3447
+ /* istanbul ignore next should not happen */
3448
+ default: yield* this.pop(), yield* this.step();
3449
+ }
3450
+ }
3451
+ *blockMap(e) {
3452
+ let t = e.items[e.items.length - 1];
3453
+ switch (this.type) {
3454
+ case "newline":
3455
+ if (this.onKeyLine = !1, t.value) {
3456
+ let n = "end" in t.value ? t.value.end : void 0;
3457
+ (Array.isArray(n) ? n[n.length - 1] : void 0)?.type === "comment" ? n?.push(this.sourceToken) : e.items.push({ start: [this.sourceToken] });
3458
+ } else t.sep ? t.sep.push(this.sourceToken) : t.start.push(this.sourceToken);
3459
+ return;
3460
+ case "space":
3461
+ case "comment":
3462
+ if (t.value) e.items.push({ start: [this.sourceToken] });
3463
+ else if (t.sep) t.sep.push(this.sourceToken);
3464
+ else {
3465
+ if (this.atIndentedComment(t.start, e.indent)) {
3466
+ let n = e.items[e.items.length - 2]?.value?.end;
3467
+ if (Array.isArray(n)) {
3468
+ Array.prototype.push.apply(n, t.start), n.push(this.sourceToken), e.items.pop();
3469
+ return;
3470
+ }
3471
+ }
3472
+ t.start.push(this.sourceToken);
3473
+ }
3474
+ return;
3475
+ }
3476
+ if (this.indent >= e.indent) {
3477
+ let n = !this.onKeyLine && this.indent === e.indent, r = n && (t.sep || t.explicitKey) && this.type !== "seq-item-ind", i = [];
3478
+ if (r && t.sep && !t.value) {
3479
+ let n = [];
3480
+ for (let r = 0; r < t.sep.length; ++r) {
3481
+ let i = t.sep[r];
3482
+ switch (i.type) {
3483
+ case "newline":
3484
+ n.push(r);
3485
+ break;
3486
+ case "space": break;
3487
+ case "comment":
3488
+ i.indent > e.indent && (n.length = 0);
3489
+ break;
3490
+ default: n.length = 0;
3491
+ }
3492
+ }
3493
+ n.length >= 2 && (i = t.sep.splice(n[1]));
3494
+ }
3495
+ switch (this.type) {
3496
+ case "anchor":
3497
+ case "tag":
3498
+ r || t.value ? (i.push(this.sourceToken), e.items.push({ start: i }), this.onKeyLine = !0) : t.sep ? t.sep.push(this.sourceToken) : t.start.push(this.sourceToken);
3499
+ return;
3500
+ case "explicit-key-ind":
3501
+ !t.sep && !t.explicitKey ? (t.start.push(this.sourceToken), t.explicitKey = !0) : r || t.value ? (i.push(this.sourceToken), e.items.push({
3502
+ start: i,
3503
+ explicitKey: !0
3504
+ })) : this.stack.push({
3505
+ type: "block-map",
3506
+ offset: this.offset,
3507
+ indent: this.indent,
3508
+ items: [{
3509
+ start: [this.sourceToken],
3510
+ explicitKey: !0
3511
+ }]
3512
+ }), this.onKeyLine = !0;
3513
+ return;
3514
+ case "map-value-ind":
3515
+ if (t.explicitKey) {
3516
+ if (!t.sep) {
3517
+ if (Z(t.start, "newline")) Object.assign(t, {
3518
+ key: null,
3519
+ sep: [this.sourceToken]
3520
+ });
3521
+ else {
3522
+ let e = Q(t.start);
3523
+ this.stack.push({
3524
+ type: "block-map",
3525
+ offset: this.offset,
3526
+ indent: this.indent,
3527
+ items: [{
3528
+ start: e,
3529
+ key: null,
3530
+ sep: [this.sourceToken]
3531
+ }]
3532
+ });
3533
+ }
3534
+ } else if (t.value) e.items.push({
3535
+ start: [],
3536
+ key: null,
3537
+ sep: [this.sourceToken]
3538
+ });
3539
+ else if (Z(t.sep, "map-value-ind")) this.stack.push({
3540
+ type: "block-map",
3541
+ offset: this.offset,
3542
+ indent: this.indent,
3543
+ items: [{
3544
+ start: i,
3545
+ key: null,
3546
+ sep: [this.sourceToken]
3547
+ }]
3548
+ });
3549
+ else if (or(t.key) && !Z(t.sep, "newline")) {
3550
+ let e = Q(t.start), n = t.key, r = t.sep;
3551
+ r.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
3552
+ type: "block-map",
3553
+ offset: this.offset,
3554
+ indent: this.indent,
3555
+ items: [{
3556
+ start: e,
3557
+ key: n,
3558
+ sep: r
3559
+ }]
3560
+ });
3561
+ } else i.length > 0 ? t.sep = t.sep.concat(i, this.sourceToken) : t.sep.push(this.sourceToken);
3562
+ } else t.sep ? t.value || r ? e.items.push({
3563
+ start: i,
3564
+ key: null,
3565
+ sep: [this.sourceToken]
3566
+ }) : Z(t.sep, "map-value-ind") ? this.stack.push({
3567
+ type: "block-map",
3568
+ offset: this.offset,
3569
+ indent: this.indent,
3570
+ items: [{
3571
+ start: [],
3572
+ key: null,
3573
+ sep: [this.sourceToken]
3574
+ }]
3575
+ }) : t.sep.push(this.sourceToken) : Object.assign(t, {
3576
+ key: null,
3577
+ sep: [this.sourceToken]
3578
+ });
3579
+ this.onKeyLine = !0;
3580
+ return;
3581
+ case "alias":
3582
+ case "scalar":
3583
+ case "single-quoted-scalar":
3584
+ case "double-quoted-scalar": {
3585
+ let n = this.flowScalar(this.type);
3586
+ r || t.value ? (e.items.push({
3587
+ start: i,
3588
+ key: n,
3589
+ sep: []
3590
+ }), this.onKeyLine = !0) : t.sep ? this.stack.push(n) : (Object.assign(t, {
3591
+ key: n,
3592
+ sep: []
3593
+ }), this.onKeyLine = !0);
3594
+ return;
3595
+ }
3596
+ default: {
3597
+ let t = this.startBlockValue(e);
3598
+ if (t) {
3599
+ n && t.type !== "block-seq" && e.items.push({ start: i }), this.stack.push(t);
3600
+ return;
3601
+ }
3602
+ }
3603
+ }
3604
+ }
3605
+ yield* this.pop(), yield* this.step();
3606
+ }
3607
+ *blockSequence(e) {
3608
+ let t = e.items[e.items.length - 1];
3609
+ switch (this.type) {
3610
+ case "newline":
3611
+ if (t.value) {
3612
+ let n = "end" in t.value ? t.value.end : void 0;
3613
+ (Array.isArray(n) ? n[n.length - 1] : void 0)?.type === "comment" ? n?.push(this.sourceToken) : e.items.push({ start: [this.sourceToken] });
3614
+ } else t.start.push(this.sourceToken);
3615
+ return;
3616
+ case "space":
3617
+ case "comment":
3618
+ if (t.value) e.items.push({ start: [this.sourceToken] });
3619
+ else {
3620
+ if (this.atIndentedComment(t.start, e.indent)) {
3621
+ let n = e.items[e.items.length - 2]?.value?.end;
3622
+ if (Array.isArray(n)) {
3623
+ Array.prototype.push.apply(n, t.start), n.push(this.sourceToken), e.items.pop();
3624
+ return;
3625
+ }
3626
+ }
3627
+ t.start.push(this.sourceToken);
3628
+ }
3629
+ return;
3630
+ case "anchor":
3631
+ case "tag":
3632
+ if (t.value || this.indent <= e.indent) break;
3633
+ t.start.push(this.sourceToken);
3634
+ return;
3635
+ case "seq-item-ind":
3636
+ if (this.indent !== e.indent) break;
3637
+ t.value || Z(t.start, "seq-item-ind") ? e.items.push({ start: [this.sourceToken] }) : t.start.push(this.sourceToken);
3638
+ return;
3639
+ }
3640
+ if (this.indent > e.indent) {
3641
+ let t = this.startBlockValue(e);
3642
+ if (t) {
3643
+ this.stack.push(t);
3644
+ return;
3645
+ }
3646
+ }
3647
+ yield* this.pop(), yield* this.step();
3648
+ }
3649
+ *flowCollection(e) {
3650
+ let t = e.items[e.items.length - 1];
3651
+ if (this.type === "flow-error-end") {
3652
+ let e;
3653
+ do
3654
+ yield* this.pop(), e = this.peek(1);
3655
+ while (e && e.type === "flow-collection");
3656
+ } else if (e.end.length === 0) {
3657
+ switch (this.type) {
3658
+ case "comma":
3659
+ case "explicit-key-ind":
3660
+ !t || t.sep ? e.items.push({ start: [this.sourceToken] }) : t.start.push(this.sourceToken);
3661
+ return;
3662
+ case "map-value-ind":
3663
+ !t || t.value ? e.items.push({
3664
+ start: [],
3665
+ key: null,
3666
+ sep: [this.sourceToken]
3667
+ }) : t.sep ? t.sep.push(this.sourceToken) : Object.assign(t, {
3668
+ key: null,
3669
+ sep: [this.sourceToken]
3670
+ });
3671
+ return;
3672
+ case "space":
3673
+ case "comment":
3674
+ case "newline":
3675
+ case "anchor":
3676
+ case "tag":
3677
+ !t || t.value ? e.items.push({ start: [this.sourceToken] }) : t.sep ? t.sep.push(this.sourceToken) : t.start.push(this.sourceToken);
3678
+ return;
3679
+ case "alias":
3680
+ case "scalar":
3681
+ case "single-quoted-scalar":
3682
+ case "double-quoted-scalar": {
3683
+ let n = this.flowScalar(this.type);
3684
+ !t || t.value ? e.items.push({
3685
+ start: [],
3686
+ key: n,
3687
+ sep: []
3688
+ }) : t.sep ? this.stack.push(n) : Object.assign(t, {
3689
+ key: n,
3690
+ sep: []
3691
+ });
3692
+ return;
3693
+ }
3694
+ case "flow-map-end":
3695
+ case "flow-seq-end":
3696
+ e.end.push(this.sourceToken);
3697
+ return;
3698
+ }
3699
+ let n = this.startBlockValue(e);
3700
+ /* istanbul ignore else should not happen */
3701
+ n ? this.stack.push(n) : (yield* this.pop(), yield* this.step());
3702
+ } else {
3703
+ let t = this.peek(2);
3704
+ if (t.type === "block-map" && (this.type === "map-value-ind" && t.indent === e.indent || this.type === "newline" && !t.items[t.items.length - 1].sep)) yield* this.pop(), yield* this.step();
3705
+ else if (this.type === "map-value-ind" && t.type !== "flow-collection") {
3706
+ let n = Q(sr(t));
3707
+ cr(e);
3708
+ let r = e.end.splice(1, e.end.length);
3709
+ r.push(this.sourceToken);
3710
+ let i = {
3711
+ type: "block-map",
3712
+ offset: e.offset,
3713
+ indent: e.indent,
3714
+ items: [{
3715
+ start: n,
3716
+ key: e,
3717
+ sep: r
3718
+ }]
3719
+ };
3720
+ this.onKeyLine = !0, this.stack[this.stack.length - 1] = i;
3721
+ } else yield* this.lineEnd(e);
3722
+ }
3723
+ }
3724
+ flowScalar(e) {
3725
+ if (this.onNewLine) {
3726
+ let e = this.source.indexOf("\n") + 1;
3727
+ for (; e !== 0;) this.onNewLine(this.offset + e), e = this.source.indexOf("\n", e) + 1;
3728
+ }
3729
+ return {
3730
+ type: e,
3731
+ offset: this.offset,
3732
+ indent: this.indent,
3733
+ source: this.source
3734
+ };
3735
+ }
3736
+ startBlockValue(e) {
3737
+ switch (this.type) {
3738
+ case "alias":
3739
+ case "scalar":
3740
+ case "single-quoted-scalar":
3741
+ case "double-quoted-scalar": return this.flowScalar(this.type);
3742
+ case "block-scalar-header": return {
3743
+ type: "block-scalar",
3744
+ offset: this.offset,
3745
+ indent: this.indent,
3746
+ props: [this.sourceToken],
3747
+ source: ""
3748
+ };
3749
+ case "flow-map-start":
3750
+ case "flow-seq-start": return {
3751
+ type: "flow-collection",
3752
+ offset: this.offset,
3753
+ indent: this.indent,
3754
+ start: this.sourceToken,
3755
+ items: [],
3756
+ end: []
3757
+ };
3758
+ case "seq-item-ind": return {
3759
+ type: "block-seq",
3760
+ offset: this.offset,
3761
+ indent: this.indent,
3762
+ items: [{ start: [this.sourceToken] }]
3763
+ };
3764
+ case "explicit-key-ind": {
3765
+ this.onKeyLine = !0;
3766
+ let t = Q(sr(e));
3767
+ return t.push(this.sourceToken), {
3768
+ type: "block-map",
3769
+ offset: this.offset,
3770
+ indent: this.indent,
3771
+ items: [{
3772
+ start: t,
3773
+ explicitKey: !0
3774
+ }]
3775
+ };
3776
+ }
3777
+ case "map-value-ind": {
3778
+ this.onKeyLine = !0;
3779
+ let t = Q(sr(e));
3780
+ return {
3781
+ type: "block-map",
3782
+ offset: this.offset,
3783
+ indent: this.indent,
3784
+ items: [{
3785
+ start: t,
3786
+ key: null,
3787
+ sep: [this.sourceToken]
3788
+ }]
3789
+ };
3790
+ }
3791
+ }
3792
+ return null;
3793
+ }
3794
+ atIndentedComment(e, t) {
3795
+ return this.type !== "comment" || this.indent <= t ? !1 : e.every((e) => e.type === "newline" || e.type === "space");
3796
+ }
3797
+ *documentEnd(e) {
3798
+ this.type !== "doc-mode" && (e.end ? e.end.push(this.sourceToken) : e.end = [this.sourceToken], this.type === "newline" && (yield* this.pop()));
3799
+ }
3800
+ *lineEnd(e) {
3801
+ switch (this.type) {
3802
+ case "comma":
3803
+ case "doc-start":
3804
+ case "doc-end":
3805
+ case "flow-seq-end":
3806
+ case "flow-map-end":
3807
+ case "map-value-ind":
3808
+ yield* this.pop(), yield* this.step();
3809
+ break;
3810
+ case "newline": this.onKeyLine = !1;
3811
+ default: e.end ? e.end.push(this.sourceToken) : e.end = [this.sourceToken], this.type === "newline" && (yield* this.pop());
3812
+ }
3813
+ }
3814
+ };
3815
+ //#endregion
3816
+ //#region node_modules/yaml/browser/dist/public-api.js
3817
+ function ur(e) {
3818
+ let t = e.prettyErrors !== !1;
3819
+ return {
3820
+ lineCounter: e.lineCounter || t && new ir() || null,
3821
+ prettyErrors: t
3822
+ };
3823
+ }
3824
+ function dr(e, t = {}) {
3825
+ let { lineCounter: n, prettyErrors: r } = ur(t), i = new lr(n?.addNewLine), a = new Gn(t), o = null;
3826
+ for (let t of a.compose(i.parse(e), !0, e.length)) if (!o) o = t;
3827
+ else if (o.options.logLevel !== "silent") {
3828
+ o.errors.push(new sn(t.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
3829
+ break;
3830
+ }
3831
+ return r && n && (o.errors.forEach(ln(e, n)), o.warnings.forEach(ln(e, n))), o;
3832
+ }
3833
+ //#endregion
3834
+ //#region packages/plugins/dsh/endpoint-auth.ts
3835
+ function fr(e) {
3836
+ return "kano-" + e.replace(/[^a-z0-9]/gu, (e) => "-" + e.codePointAt(0).toString(16) + "-");
3837
+ }
3838
+ function pr(e) {
3839
+ return fr(e).replaceAll("-", "_").toUpperCase() + "_API_KEY";
3840
+ }
3841
+ function mr(e, t, n, r) {
3842
+ let i = "Bearer kano-local", a = pr(n), o = [...t, "apiKeyEnv"], s = [...t, "headers"], c = e.getIn(o), l = e.getIn(s, !0);
3843
+ if (l !== void 0 && !j(l)) throw Error("dsh 提供方的 headers 不是有效的映射");
3844
+ let u = j(l) ? l.items.map((e) => String(e.key)).find((e) => e.toLowerCase() === "authorization") : void 0, d = [...s, u || "Authorization"];
3845
+ if (r) {
3846
+ if (c && c !== a || u && e.getIn(d) !== i) throw Error("该提供方已有手动配置的认证,请在 dsh 模型设置中更新,以保留原有凭据。");
3847
+ u && e.deleteIn(d), e.setIn(o, a);
3848
+ } else c === a && e.deleteIn(o), !e.getIn(o) && !u && e.setIn(d, i);
3849
+ }
3850
+ async function hr(e, t, n, r) {
3851
+ let i;
3852
+ try {
3853
+ i = new URL(t.webUrl || "");
3854
+ let e = new URL(S({
3855
+ host: t.params.host,
3856
+ port: t.params.port,
3857
+ defaultPort: 3080
3858
+ }));
3859
+ if (t.status !== "running" || i.origin !== e.origin || i.pathname !== "/" || !i.searchParams.get("token")) throw Error();
3860
+ } catch {
3861
+ throw Error("请先启动 dsh 并等待其 WebUI 就绪,以便保存模型访问凭据。");
3862
+ }
3863
+ let a;
3864
+ try {
3865
+ let t = await e.get(i.href, {
3866
+ no_redirect: !0,
3867
+ timeout: 10
3868
+ }), n = Object.entries(t.headers).find(([e]) => e.toLowerCase() === "set-cookie")?.[1];
3869
+ t.status_code >= 300 && t.status_code < 400 && (a = n?.split(";")[0]);
3870
+ } catch {}
3871
+ if (!a) throw Error("无法取得 dsh 登录会话,请重新启动 dsh 后再试。");
3872
+ try {
3873
+ let t = await e.postJson(i.origin + "/api/credentials/set", {
3874
+ type: "client-request",
3875
+ rpcId: crypto.randomUUID(),
3876
+ method: "credentials/set",
3877
+ payload: { args: {
3878
+ ref: pr(n),
3879
+ value: r
3880
+ } }
3881
+ }, {
3882
+ headers: {
3883
+ Origin: i.origin,
3884
+ Cookie: a
3885
+ },
3886
+ no_redirect: !0,
3887
+ timeout: 10
3888
+ });
3889
+ if (t.status_code === 200 && JSON.parse(t.body)?.result?.ok === !0) return;
3890
+ } catch {}
3891
+ throw Error("dsh 未能保存模型凭据,请检查其凭据存储及同名只读环境变量。");
3892
+ }
3893
+ //#endregion
3894
+ //#region packages/plugins/dsh/params.ts
3895
+ var gr = [
3896
+ {
3897
+ id: "server",
3898
+ label: "服务",
3899
+ order: 1
3900
+ },
3901
+ {
3902
+ id: "runtime",
3903
+ label: "运行环境",
3904
+ order: 2
3905
+ },
3906
+ {
3907
+ id: "advanced",
3908
+ label: "高级参数",
3909
+ order: 3,
3910
+ collapsed: !0
3911
+ }
3912
+ ];
3913
+ function _r(e) {
3914
+ return /^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(e) && ![
3915
+ "node_modules",
3916
+ "desktop",
3917
+ "headless",
3918
+ "sdk",
3919
+ "sdk-minimal",
3920
+ "acp"
3921
+ ].includes(e);
3922
+ }
3923
+ var vr = [
3924
+ {
3925
+ id: "profile",
3926
+ label: "Web 配置名称",
3927
+ type: "string",
3928
+ default: "web",
3929
+ group: "advanced",
3930
+ required: !0,
3931
+ cli: "--profile",
3932
+ description: "默认 web。自定义配置必须已存在且包含 Web 应用;模型和 API 密钥在 dsh 的 Settings → Models 中配置。",
3933
+ validate: (e) => _r(String(e)) ? null : "请填写 web 或自定义 Web 配置名称"
3934
+ },
3935
+ {
3936
+ id: "patches",
3937
+ label: "配置补丁",
3938
+ type: "text",
3939
+ default: "",
3940
+ group: "advanced",
3941
+ cli: {
3942
+ arg: "--patch",
3943
+ format: "repeat",
3944
+ split: "lines",
3945
+ resolvePath: !0,
3946
+ when: "set"
3947
+ },
3948
+ description: "每行一个 Cordis 配置补丁文件,按顺序合并;相对路径以应用目录为基准。"
3949
+ },
3950
+ {
3951
+ id: "dataDir",
3952
+ label: "配置与会话目录",
3953
+ type: "path",
3954
+ pathKind: "directory",
3955
+ default: ".kano/dsh",
3956
+ group: "runtime",
3957
+ required: !0,
3958
+ env: {
3959
+ name: "DSH_HOME",
3960
+ format: "path"
3961
+ },
3962
+ description: "保存 dsh 配置、会话和凭据。工作目录在 dsh WebUI 中选择。"
3963
+ },
3964
+ {
3965
+ id: "host",
3966
+ label: "监听地址",
3967
+ type: "string",
3968
+ default: "127.0.0.1",
3969
+ required: !0,
3970
+ group: "server",
3971
+ cli: "--host",
3972
+ description: "默认仅本机访问。保留 dsh 自身对监听地址和可信主机的限制。",
3973
+ validate: (e) => String(e).trim() === "0.0.0.0" ? "dsh 不支持监听 0.0.0.0,请指定具体地址" : null
3974
+ },
3975
+ {
3976
+ id: "port",
3977
+ label: "端口",
3978
+ type: "port",
3979
+ default: 3080,
3980
+ min: 1,
3981
+ max: 65535,
3982
+ integer: !0,
3983
+ group: "server",
3984
+ cli: "--port"
3985
+ },
3986
+ {
3987
+ id: "noOpen",
3988
+ label: "不打开外部浏览器",
3989
+ type: "boolean",
3990
+ default: !0,
3991
+ group: "server",
3992
+ cli: "--no-open",
3993
+ description: "启动后可直接使用 Kano 的 WebUI 页面。"
3994
+ },
3995
+ {
3996
+ id: "trustedHosts",
3997
+ label: "额外可信主机",
3998
+ type: "text",
3999
+ default: "",
4000
+ group: "advanced",
4001
+ cli: {
4002
+ arg: "--trusted-host",
4003
+ format: "repeat",
4004
+ split: "lines",
4005
+ when: "set"
4006
+ },
4007
+ description: "可选,每行一个 host:port,用于访问 dsh 的明确主机地址。默认使用 dsh 的本机信任规则。"
4008
+ },
4009
+ {
4010
+ id: "nodeOptions",
4011
+ label: "Node 选项",
4012
+ type: "string",
4013
+ default: "",
4014
+ group: "advanced",
4015
+ env: "NODE_OPTIONS",
4016
+ placeholder: "--max-old-space-size=4096",
4017
+ description: "通过 NODE_OPTIONS 传递,例如限制 Node 堆内存。"
4018
+ },
4019
+ {
4020
+ id: "extraArgs",
4021
+ label: "额外 Web 参数",
4022
+ type: "text",
4023
+ default: "",
4024
+ group: "advanced",
4025
+ description: "传递给 dsh Web 应用的额外参数;不能覆盖上面已经配置的选项。"
4026
+ }
4027
+ ];
4028
+ //#endregion
4029
+ //#region packages/plugins/dsh/local-models.ts
4030
+ function yr(e) {
4031
+ if (e.contents ||= e.createNode([]), !P(e.contents)) throw Error("dsh 配置补丁需要使用 YAML 列表");
4032
+ let t = e.contents.items, n = t.findLastIndex((e) => j(e) && e.get("id") === "llm-pi-ai");
4033
+ return n < 0 && (n = t.length, e.contents.add(e.createNode({ id: "llm-pi-ai" }))), [n, "config"];
4034
+ }
4035
+ function br(e, t, n, r, i, a = !1, o = !1) {
4036
+ let s = dr(e);
4037
+ if (s.errors.length || !o && s.contents && !j(s.contents)) throw Error("dsh 设置不是有效的 YAML 映射");
4038
+ let c = [
4039
+ ...o ? yr(s) : ["llm-pi-ai"],
4040
+ "providers",
4041
+ fr(t)
4042
+ ];
4043
+ for (let e = 1; e <= c.length; e++) {
4044
+ let t = s.getIn(c.slice(0, e), !0);
4045
+ if (t !== void 0 && !j(t)) throw Error("dsh 提供方配置格式无效");
4046
+ }
4047
+ mr(s, c, t, a);
4048
+ for (let [e, t] of Object.entries({
4049
+ displayName: i,
4050
+ api: "openai-completions",
4051
+ baseURL: n,
4052
+ models: r.map((e) => ({ id: e }))
4053
+ })) s.setIn([...c, e], t);
4054
+ return s.toString();
4055
+ }
4056
+ async function xr({ fs: e, http: t }, n, r) {
4057
+ let i = await t.get(r.baseURL + "/models", {
4058
+ headers: r.apiKey ? { Authorization: "Bearer " + r.apiKey } : void 0,
4059
+ no_redirect: !0,
4060
+ timeout: 10
4061
+ });
4062
+ if (i.status_code !== 200) throw Error("模型服务返回 HTTP " + i.status_code);
4063
+ let a;
4064
+ try {
4065
+ a = JSON.parse(i.body)?.data;
4066
+ } catch {
4067
+ throw Error("模型服务未返回有效的模型列表");
4068
+ }
4069
+ let o = Array.isArray(a) ? a.map((e) => e?.id).filter((e) => typeof e == "string" && !!e) : [];
4070
+ if (!o.length) throw Error("该端点未返回可用模型");
4071
+ let s = C(n.path, String(n.params.dataDir || ".kano/dsh")), c = await e.exists(C(n.path, "node_modules/@deepseek-ai/dsh-config-editor/package.json")), l = String(n.params.profile || "web");
4072
+ if (c && !_r(l)) throw Error("请检查 dsh 的 Web 配置名称");
4073
+ let u = c ? C(s, `profiles/${l}`) : s, d = C(u, c ? "cordis.patch.yml" : "settings.yaml"), f = await e.exists(d) ? await e.readTextFile(d) : void 0, p = (e) => br(e, r.id, r.baseURL, o, r.name, !!r.apiKey, c), m = p(f?.content || "");
4074
+ if (r.apiKey && await hr(t, n, r.id, r.apiKey), !f) {
4075
+ await e.mkdir(u);
4076
+ try {
4077
+ await e.createFile(d);
4078
+ } catch (t) {
4079
+ if (!await e.exists(d)) throw t;
4080
+ }
4081
+ f = await e.readTextFile(d), m = p(f.content);
4082
+ }
4083
+ await e.saveTextFile(d, m, f.version);
4084
+ }
4085
+ //#endregion
4086
+ //#region packages/plugins/dsh/LocalModelsPage.vue?vue&type=script&setup=true&lang.ts
4087
+ var Sr = {
4088
+ key: 0,
4089
+ role: "alert",
4090
+ class: "mb-3 break-words text-sm text-danger"
4091
+ }, Cr = { class: "kano-field-label break-words" }, wr = { class: "break-all font-mono text-xs text-text-secondary" }, Tr = {
4092
+ key: 0,
4093
+ class: "kano-field-hint"
4094
+ }, Er = /* @__PURE__ */ s({
4095
+ __name: "LocalModelsPage",
4096
+ props: {
4097
+ app: {},
4098
+ api: {}
4099
+ },
4100
+ setup(s) {
4101
+ let S = s, C = d([]);
4102
+ m(() => S.api, (e, t, n) => {
4103
+ n(e.services.watch("kano:llm-endpoints", (e) => {
4104
+ C.value = e;
4105
+ }).dispose);
4106
+ }, { immediate: !0 });
4107
+ let ee = t(() => C.value.flatMap((e) => e.list().filter((e) => e.status === "running").map((t) => ({
4108
+ ...t,
4109
+ key: e.providerId + ":" + t.id,
4110
+ provider: e
4111
+ })))), w = l(""), T = l(""), E = t(() => S.api.apps.list("llamacpp").filter((e) => e.status === "stopped" || e.status === "error")), D = l(""), O = t(() => E.value.find((e) => e.id === D.value) ?? E.value[0]), k = l(!1);
4112
+ async function A() {
4113
+ let e = O.value;
4114
+ if (!e || k.value) return;
4115
+ let { api: t } = S;
4116
+ k.value = !0;
4117
+ try {
4118
+ await t.apps.openTab(e.id, "launch-control"), await t.apps.start(e.id);
4119
+ } catch (n) {
4120
+ t.ui.toast.exception("启动 " + e.name + " 失败", n);
4121
+ } finally {
4122
+ k.value = !1;
4123
+ }
4124
+ }
4125
+ async function te(e) {
4126
+ if (w.value) return;
4127
+ let { api: t, app: n } = S;
4128
+ w.value = e.key, T.value = "";
4129
+ try {
4130
+ let r = e.requiresApiKey ? await e.provider.getApiKey?.(e.id) : void 0, i = e.provider.list().find((t) => t.id === e.id);
4131
+ if (i?.status !== "running" || i.baseURL !== e.baseURL || i.requiresApiKey !== e.requiresApiKey) throw Error("端点配置已变化,请重新选择。");
4132
+ if (i.requiresApiKey && !r) throw Error("端点需要凭据,请在提供方配置 API 密钥。");
4133
+ await xr(t, n, {
4134
+ ...i,
4135
+ id: e.key,
4136
+ apiKey: r ?? ""
4137
+ }), t.ui.toast.success("已填入 dsh 模型设置");
4138
+ } catch (e) {
4139
+ T.value = e instanceof Error ? e.message : String(e);
4140
+ } finally {
4141
+ w.value = "";
4142
+ }
4143
+ }
4144
+ return (t, s) => (c(), n(p(b), {
4145
+ title: "模型端点",
4146
+ "max-width": "prose"
4147
+ }, {
4148
+ default: h(() => [T.value ? (c(), i("p", Sr, f(T.value), 1)) : r("", !0), ee.value.length ? (c(), n(p(_), {
4149
+ key: 2,
4150
+ "aria-label": "运行中的推理端点"
4151
+ }, {
4152
+ default: h(() => [(c(!0), i(e, null, u(ee.value, (e) => (c(), n(p(v), {
4153
+ key: e.key,
4154
+ "always-show-actions": ""
4155
+ }, {
4156
+ actions: h(() => [o(p(g), {
4157
+ size: "small",
4158
+ class: "shrink-0",
4159
+ label: e.requiresApiKey ? "保存凭据并填入" : "填入 dsh",
4160
+ severity: "secondary",
4161
+ loading: w.value === e.key,
4162
+ disabled: !!w.value,
4163
+ onClick: (t) => te(e)
4164
+ }, null, 8, [
4165
+ "label",
4166
+ "loading",
4167
+ "disabled",
4168
+ "onClick"
4169
+ ])]),
4170
+ default: h(() => [
4171
+ a("h2", Cr, f(e.name), 1),
4172
+ a("p", wr, f(e.baseURL), 1),
4173
+ e.requiresApiKey ? (c(), i("p", Tr, " API 密钥将保存到当前执行机器的 dsh 凭据库。 ")) : r("", !0)
4174
+ ]),
4175
+ _: 2
4176
+ }, 1024))), 128))]),
4177
+ _: 1
4178
+ })) : (c(), n(p(y), {
4179
+ key: 1,
4180
+ icon: "i-lucide-network",
4181
+ title: "当前执行端没有运行中的模型端点"
4182
+ }, {
4183
+ default: h(() => [O.value ? (c(), i(e, { key: 0 }, [E.value.length > 1 ? (c(), n(p(x), {
4184
+ key: 0,
4185
+ "model-value": O.value.id,
4186
+ options: E.value,
4187
+ "option-label": "name",
4188
+ "option-value": "id",
4189
+ "aria-label": "要启动的 llama.cpp 实例",
4190
+ class: "kano-select-adaptive",
4191
+ disabled: k.value,
4192
+ "onUpdate:modelValue": s[0] ||= (e) => D.value = String(e)
4193
+ }, null, 8, [
4194
+ "model-value",
4195
+ "options",
4196
+ "disabled"
4197
+ ])) : r("", !0), o(p(g), {
4198
+ label: "前往并启动 llama.cpp",
4199
+ icon: "i-lucide-play",
4200
+ loading: k.value,
4201
+ disabled: k.value,
4202
+ onClick: A
4203
+ }, null, 8, ["loading", "disabled"])], 64)) : r("", !0)]),
4204
+ _: 1
4205
+ }))]),
4206
+ _: 1
4207
+ }));
4208
+ }
4209
+ }), Dr = {
4210
+ RefreshHostCapabilities: "refresh-host-capabilities",
4211
+ OpenPythonSettings: "open-python-settings",
4212
+ OpenLaunchSettings: "open-launch-settings",
4213
+ OpenVersionManagement: "open-version-management",
4214
+ OpenExtensionManagement: "open-extension-management",
4215
+ ApplyLaunchParam: "apply-launch-param",
4216
+ ApplyBackendSelection: "apply-backend-selection",
4217
+ OpenUrl: "open-url"
4218
+ };
4219
+ //#endregion
4220
+ //#region ../kano-plugin-sdk/src/helpers/define-plugin.ts
4221
+ function Or(e) {
4222
+ return e;
4223
+ }
4224
+ //#endregion
4225
+ //#region ../kano-plugin-sdk/src/versions.ts
4226
+ var kr = /* @__PURE__ */ new Set([
4227
+ "",
4228
+ "*",
4229
+ "x",
4230
+ "X"
4231
+ ]);
4232
+ function Ar(e) {
4233
+ let t = e.trim().replace(/^v/i, "").split("+")[0], [n, r = ""] = t.split("-", 2), i = n.split(".");
4234
+ return !/^\d+(?:\.\d+){0,2}(?:-[0-9A-Za-z.-]+)?$/.test(t) || i.length > 3 || i.some((e) => e !== "" && !/^\d+$/.test(e)) ? null : {
4235
+ major: Number(i[0] ?? 0),
4236
+ minor: Number(i[1] ?? 0),
4237
+ patch: Number(i[2] ?? 0),
4238
+ prerelease: r
4239
+ };
4240
+ }
4241
+ function $(e, t) {
4242
+ for (let n of [
4243
+ "major",
4244
+ "minor",
4245
+ "patch"
4246
+ ]) {
4247
+ if (e[n] > t[n]) return 1;
4248
+ if (e[n] < t[n]) return -1;
4249
+ }
4250
+ if (e.prerelease === t.prerelease) return 0;
4251
+ if (!e.prerelease) return 1;
4252
+ if (!t.prerelease) return -1;
4253
+ let n = e.prerelease.split("."), r = t.prerelease.split(".");
4254
+ for (let e = 0; e < Math.max(n.length, r.length); e++) {
4255
+ if (n[e] === r[e]) continue;
4256
+ if (n[e] === void 0) return -1;
4257
+ if (r[e] === void 0) return 1;
4258
+ let t = /^\d+$/.test(n[e]), i = /^\d+$/.test(r[e]);
4259
+ return t && i ? Number(n[e]) - Number(r[e]) : t === i ? n[e] < r[e] ? -1 : 1 : t ? -1 : 1;
4260
+ }
4261
+ return 0;
4262
+ }
4263
+ function jr(e) {
4264
+ return {
4265
+ major: e.major + 1,
4266
+ minor: 0,
4267
+ patch: 0,
4268
+ prerelease: ""
4269
+ };
4270
+ }
4271
+ function Mr(e) {
4272
+ return {
4273
+ major: e.major,
4274
+ minor: e.minor + 1,
4275
+ patch: 0,
4276
+ prerelease: ""
4277
+ };
4278
+ }
4279
+ function Nr(e) {
4280
+ return {
4281
+ major: e.major,
4282
+ minor: e.minor,
4283
+ patch: e.patch + 1,
4284
+ prerelease: ""
4285
+ };
4286
+ }
4287
+ function Pr(e, t, n) {
4288
+ let r = $(e, n);
4289
+ switch (t) {
4290
+ case ">": return r > 0;
4291
+ case ">=": return r >= 0;
4292
+ case "<": return r < 0;
4293
+ case "<=": return r <= 0;
4294
+ default: return r === 0;
4295
+ }
4296
+ }
4297
+ function Fr(e, t) {
4298
+ let n = t.major > 0 ? jr(t) : t.minor > 0 ? Mr(t) : Nr(t);
4299
+ return $(e, t) >= 0 && $(e, n) < 0;
4300
+ }
4301
+ function Ir(e, t) {
4302
+ let n = Mr(t);
4303
+ return $(e, t) >= 0 && $(e, n) < 0;
4304
+ }
4305
+ function Lr(e, t) {
4306
+ let n = t.trim().replace(/^v/i, "").split("."), r = n.findIndex((e) => e === "*" || /^x$/i.test(e));
4307
+ if (r === -1) return !1;
4308
+ let i = Ar(n.map((e) => e === "*" || /^x$/i.test(e) ? "0" : e).join("."));
4309
+ if (!i) return !1;
4310
+ let a = r === 0 ? null : r === 1 ? jr(i) : Mr(i);
4311
+ return $(e, i) >= 0 && (!a || $(e, a) < 0);
4312
+ }
4313
+ function Rr(e, t) {
4314
+ let n = t.trim();
4315
+ if (kr.has(n)) return !0;
4316
+ if (n.includes("*") || /(^|\.)x(\.|$)/i.test(n)) return Lr(e, n);
4317
+ let r = n.match(/^(\^|~)(.+)$/);
4318
+ if (r) {
4319
+ let t = Ar(r[2]);
4320
+ return t ? r[1] === "^" ? Fr(e, t) : Ir(e, t) : !1;
4321
+ }
4322
+ let i = n.match(/^(>=|<=|>|<|=)?\s*(.+)$/);
4323
+ if (!i) return !1;
4324
+ let a = Ar(i[2]);
4325
+ return a ? Pr(e, i[1] ?? "=", a) : !1;
4326
+ }
4327
+ function zr(e, t) {
4328
+ let n = Ar(e);
4329
+ return n ? t.split("||").map((e) => e.trim()).some((e) => e.split(/\s+/).every((e) => Rr(n, e))) : !1;
4330
+ }
4331
+ //#endregion
4332
+ //#region packages/plugins/dsh/launch.ts
4333
+ var Br = "node_modules/@deepseek-ai/dsh/package.json";
4334
+ function Vr(e) {
4335
+ return S({
4336
+ host: e.host,
4337
+ port: e.port,
4338
+ defaultPort: 3080
4339
+ });
4340
+ }
4341
+ function Hr(e, t) {
4342
+ let n = /^dsh web:\s+(https?:\/\/\S+)/.exec(e.trim());
4343
+ if (!n) return null;
4344
+ try {
4345
+ let e = new URL(n[1]), r = new URL(Vr(t)), i = new URL(Vr({ port: t.port }));
4346
+ return ![r.origin, i.origin].includes(e.origin) || e.pathname !== "/" || !e.searchParams.get("token") ? null : (r.search = e.search, r.href);
4347
+ } catch {
4348
+ return null;
4349
+ }
4350
+ }
4351
+ //#endregion
4352
+ //#region packages/plugins/dsh/index.ts
4353
+ var Ur = Or({
4354
+ id: "dsh",
4355
+ app: {
4356
+ tabs: [{
4357
+ id: "dsh-local-models",
4358
+ label: "模型端点",
4359
+ icon: "i-lucide-network",
4360
+ order: 15,
4361
+ component: Er
4362
+ }],
4363
+ icon: "i-lucide-terminal",
4364
+ color: "#64748b",
4365
+ identifiers: [{
4366
+ type: "file",
4367
+ pattern: Br,
4368
+ weight: 50
4369
+ }],
4370
+ launchProvider: {
4371
+ entry: {
4372
+ type: "node",
4373
+ script: "node_modules/@deepseek-ai/dsh/lib/bin.js"
4374
+ },
4375
+ dependencies: !1,
4376
+ groups: gr,
4377
+ params: vr,
4378
+ extraArgs: {
4379
+ param: "extraArgs",
4380
+ target: "argv"
4381
+ },
4382
+ ownedArgs: [
4383
+ "--help",
4384
+ "-h",
4385
+ "--version",
4386
+ "-V",
4387
+ "--dump-config",
4388
+ "--dump-default-config",
4389
+ "--from-default-profile",
4390
+ "--open"
4391
+ ],
4392
+ getWebViewUrl: Vr,
4393
+ strategy: {
4394
+ requirements: {},
4395
+ async preflight(e, t) {
4396
+ let n = await t.launch.checkPaths([...String(e.params.patches ?? "").split(/\r?\n/).map((e) => e.trim()).filter(Boolean).map((t, n) => ({
4397
+ id: `dsh-patch-${n}`,
4398
+ paths: [C(e.app.path, t)],
4399
+ successMessage: `配置补丁已找到:${t}`,
4400
+ failureMessage: `配置补丁不存在:${t}`,
4401
+ actions: [{
4402
+ id: Dr.OpenLaunchSettings,
4403
+ label: "启动参数"
4404
+ }]
4405
+ }))]), r = e.runtime.node?.version;
4406
+ if (r) {
4407
+ let i = await t.fs.readTextFile(C(e.app.path, Br)), a = JSON.parse(i.content).engines?.node ?? "^22.19.0 || >=24.0.0", o = zr(r, a);
4408
+ n.push({
4409
+ id: "dsh-node-version",
4410
+ stage: "runtime",
4411
+ passed: o,
4412
+ severity: o ? "info" : "error",
4413
+ message: o ? `Node ${r}` : `当前 dsh 需要 Node ${a},已选择 ${r}`,
4414
+ actions: o ? void 0 : [{
4415
+ id: Dr.OpenLaunchSettings,
4416
+ label: "启动参数"
4417
+ }]
4418
+ });
4419
+ }
4420
+ let i = new URL(Vr(e.params));
4421
+ return n.push(...await t.launch.checkHttpPort(Number(i.port), "dsh-port", i.hostname.replace(/^\[|\]$/g, ""))), n;
4422
+ }
4423
+ }
4424
+ },
4425
+ versionProvider: {
4426
+ kind: "npm",
4427
+ packageName: "@deepseek-ai/dsh"
4428
+ },
4429
+ webview: {
4430
+ urlTemplate: "http://127.0.0.1:{port}",
4431
+ defaultPort: 3080,
4432
+ portParamId: "port",
4433
+ autoOpen: !1,
4434
+ getReadyUrlFromLog: Hr
4435
+ },
4436
+ actions: [{
4437
+ id: "webui",
4438
+ label: "WebUI",
4439
+ icon: "i-lucide-globe",
4440
+ kind: "tab",
4441
+ target: "webview",
4442
+ order: 1
4443
+ }, {
4444
+ id: "settings",
4445
+ label: "启动参数",
4446
+ icon: "i-lucide-settings",
4447
+ kind: "tab",
4448
+ target: "settings",
4449
+ order: 2
4450
+ }]
4451
+ }
4452
+ });
4453
+ //#endregion
4454
+ export { Ur as default };