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