UNPKG

@gitlab/ui

Version:
1,316 lines (1,314 loc) • 11.9 MB
#!/usr/bin/env node import { createRequire as __gl__createRequire } from 'node:module'; const require = __gl__createRequire(import.meta.url); var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __require = /* @__PURE__ */ ((x7) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x7, { get: (a5, b7) => (typeof require !== "undefined" ? require : a5)[b7] }) : x7)(function(x7) { if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x7 + '" is not supported'); }); var __esm = (fn9, res) => function __init() { return fn9 && (res = (0, fn9[__getOwnPropNames(fn9)[0]])(fn9 = 0)), res; }; var __commonJS = (cb2, mod) => function __require3() { return mod || (0, cb2[__getOwnPropNames(cb2)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to4, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key2 of __getOwnPropNames(from)) if (!__hasOwnProp.call(to4, key2) && key2 !== except) __defProp(to4, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable }); } return to4; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); // ../../node_modules/prettier/plugins/yaml.mjs var yaml_exports = {}; __export(yaml_exports, { __parsePrettierYamlConfig: () => sc, default: () => Ih, languages: () => Xr, options: () => zr, parsers: () => hr, printers: () => rc }); function Wi(t7) { if (typeof t7 == "string") return Me; if (Array.isArray(t7)) return ze; if (!t7) return; let { type: e7 } = t7; if (Lt.has(e7)) return e7; } function Gi(t7) { let e7 = t7 === null ? "null" : typeof t7; if (e7 !== "string" && e7 !== "object") return `Unexpected doc '${e7}', Expected it to be 'string' or 'object'.`; if (_e(t7)) throw new Error("doc is valid."); let n27 = Object.prototype.toString.call(t7); if (n27 !== "[object Object]") return `Unexpected doc '${n27}'.`; let r4 = Qi([...Lt].map((s) => `'${s}'`)); return `Unexpected doc.type '${t7.type}'. Expected it to be ${r4}.`; } function Ji(t7, e7) { if (typeof t7 == "string") return e7(t7); let n27 = /* @__PURE__ */ new Map(); return r4(t7); function r4(i) { if (n27.has(i)) return n27.get(i); let o5 = s(i); return n27.set(i, o5), o5; } function s(i) { switch (_e(i)) { case ze: return e7(i.map(r4)); case Pe: return e7({ ...i, parts: i.parts.map(r4) }); case ge: return e7({ ...i, breakContents: r4(i.breakContents), flatContents: r4(i.flatContents) }); case ke: { let { expandedStates: o5, contents: a5 } = i; return o5 ? (o5 = o5.map(r4), a5 = o5[0]) : a5 = r4(a5), e7({ ...i, contents: a5, expandedStates: o5 }); } case Ce: case et: case nt: case st: case Ie: return e7({ ...i, contents: r4(i.contents) }); case Me: case Ze: case tt: case rt: case Z: case ve: return e7(i); default: throw new mn(i); } } } function Er(t7, e7 = it) { return Ji(t7, (n27) => typeof n27 == "string" ? P(e7, n27.split(` `)) : n27); } function ot(t7, e7) { return de(e7), { type: Ce, contents: e7, n: t7 }; } function Re(t7, e7 = {}) { return de(t7), gn(e7.expandedStates, true), { type: ke, id: e7.id, contents: t7, break: !!e7.shouldBreak, expandedStates: e7.expandedStates }; } function dn(t7) { return ot(Number.NEGATIVE_INFINITY, t7); } function wr(t7) { return ot({ type: "root" }, t7); } function br(t7) { return ot(-1, t7); } function yn(t7, e7) { return Re(t7[0], { ...e7, expandedStates: t7 }); } function Tt(t7) { return Sr(t7), { type: Pe, parts: t7 }; } function at2(t7, e7 = "", n27 = {}) { return de(t7), e7 !== "" && de(e7), { type: ge, breakContents: t7, flatContents: e7, groupId: n27.groupId }; } function Nr(t7) { return de(t7), { type: Ie, contents: t7 }; } function P(t7, e7) { de(t7), gn(e7); let n27 = []; for (let r4 = 0; r4 < e7.length; r4++) r4 !== 0 && n27.push(t7), n27.push(e7[r4]); return n27; } function kt(t7) { return (e7, n27, r4) => { let s = !!(r4 != null && r4.backwards); if (n27 === false) return false; let { length: i } = e7, o5 = n27; for (; o5 >= 0 && o5 < i; ) { let a5 = e7.charAt(o5); if (t7 instanceof RegExp) { if (!t7.test(a5)) return o5; } else if (!t7.includes(a5)) return o5; s ? o5-- : o5++; } return o5 === -1 || o5 === i ? o5 : false; }; } function Zi(t7, e7, n27) { let r4 = !!(n27 != null && n27.backwards); if (e7 === false) return false; let s = t7.charAt(e7); if (r4) { if (t7.charAt(e7 - 1) === "\r" && s === ` `) return e7 - 2; if (s === ` ` || s === "\r" || s === "\u2028" || s === "\u2029") return e7 - 1; } else { if (s === "\r" && t7.charAt(e7 + 1) === ` `) return e7 + 2; if (s === ` ` || s === "\r" || s === "\u2028" || s === "\u2029") return e7 + 1; } return e7; } function eo(t7, e7) { let n27 = e7 - 1; n27 = En(t7, n27, { backwards: true }), n27 = Sn(t7, n27, { backwards: true }), n27 = En(t7, n27, { backwards: true }); let r4 = Sn(t7, n27, { backwards: true }); return n27 !== r4; } function Lr(t7, e7) { let { node: n27 } = t7; if (n27.type === "root" && e7.filepath && /(?:[/\\]|^)\.(?:prettier|stylelint|lintstaged)rc$/u.test(e7.filepath)) return async (r4) => { let s = await r4(e7.originalText, { parser: "json" }); return s ? [s, N] : void 0; }; } function lt(t7) { if (ct !== null && typeof ct.property) { let e7 = ct; return ct = lt.prototype = null, e7; } return ct = lt.prototype = t7 ?? /* @__PURE__ */ Object.create(null), new lt(); } function bn(t7) { return lt(t7); } function no(t7, e7 = "type") { bn(t7); function n27(r4) { let s = r4[e7], i = t7[s]; if (!Array.isArray(i)) throw Object.assign(new Error(`Missing visitor keys for '${s}'.`), { node: r4 }); return i; } return n27; } function xe(t7) { return t7.position.start.offset; } function Pr(t7) { return t7.position.end.offset; } function xr(t7) { return Rr.test(t7); } function Dr(t7) { return _r.test(t7); } function Yr(t7) { return vr.test(t7); } function $r(t7) { return `# @${Ir} ${t7}`; } function io(t7) { return Array.isArray(t7) && t7.length > 0; } function K(t7, e7) { return typeof (t7 == null ? void 0 : t7.type) == "string" && (!e7 || e7.includes(t7.type)); } function Nn(t7, e7, n27) { return e7("children" in t7 ? { ...t7, children: t7.children.map((r4) => Nn(r4, e7, t7)) } : t7, n27); } function Ye(t7, e7, n27) { Object.defineProperty(t7, e7, { get: n27, enumerable: false }); } function Fr(t7, e7) { let n27 = 0, r4 = e7.length; for (let s = t7.position.end.offset - 1; s < r4; s++) { let i = e7[s]; if (i === ` ` && n27++, n27 === 1 && /\S/u.test(i)) return false; if (n27 === 2) return true; } return false; } function Pt(t7) { let { node: e7 } = t7; switch (e7.type) { case "tag": case "anchor": case "comment": return false; } let n27 = t7.stack.length; for (let r4 = 1; r4 < n27; r4++) { let s = t7.stack[r4], i = t7.stack[r4 - 1]; if (Array.isArray(i) && typeof s == "number" && s !== i.length - 1) return false; } return true; } function It(t7) { return De(t7.children) ? It(x(false, t7.children, -1)) : t7; } function Br(t7) { return t7.value.trim() === "prettier-ignore"; } function qr(t7) { let { node: e7 } = t7; if (e7.type === "documentBody") { let n27 = t7.parent.head; return I(n27) && Br(x(false, n27.endComments, -1)); } return ee(e7) && Br(x(false, e7.leadingComments, -1)); } function $e(t7) { return !De(t7.children) && !oo(t7); } function oo(t7) { return ee(t7) || ie(t7) || On(t7) || V(t7) || I(t7); } function ee(t7) { return De(t7 == null ? void 0 : t7.leadingComments); } function ie(t7) { return De(t7 == null ? void 0 : t7.middleComments); } function On(t7) { return t7 == null ? void 0 : t7.indicatorComment; } function V(t7) { return t7 == null ? void 0 : t7.trailingComment; } function I(t7) { return De(t7 == null ? void 0 : t7.endComments); } function Ur(t7) { let e7 = [], n27; for (let r4 of t7.split(/( +)/u)) r4 !== " " ? n27 === " " ? e7.push(r4) : e7.push((e7.pop() || "") + r4) : n27 === void 0 && e7.unshift(""), n27 = r4; return n27 === " " && e7.push((e7.pop() || "") + " "), e7[0] === "" && (e7.shift(), e7.unshift(" " + (e7.shift() || ""))), e7; } function Kr(t7, e7, n27) { let r4 = e7.split(` `).map((s, i, o5) => i === 0 && i === o5.length - 1 ? s : i !== 0 && i !== o5.length - 1 ? s.trim() : i === 0 ? s.trimEnd() : s.trimStart()); return n27.proseWrap === "preserve" ? r4.map((s) => s.length === 0 ? [] : [s]) : r4.map((s) => s.length === 0 ? [] : Ur(s)).reduce((s, i, o5) => o5 !== 0 && r4[o5 - 1].length > 0 && i.length > 0 && !(t7 === "quoteDouble" && x(false, x(false, s, -1), -1).endsWith("\\")) ? [...s.slice(0, -1), [...x(false, s, -1), ...i]] : [...s, i], []).map((s) => n27.proseWrap === "never" ? [s.join(" ")] : s); } function Vr(t7, { parentIndent: e7, isLastDescendant: n27, options: r4 }) { let s = t7.position.start.line === t7.position.end.line ? "" : r4.originalText.slice(t7.position.start.offset, t7.position.end.offset).match(/^[^\n]*\n(.*)$/su)[1], i; if (t7.indent === null) { let c5 = s.match(/^(?<leadingSpace> *)[^\n\r ]/mu); i = c5 ? c5.groups.leadingSpace.length : Number.POSITIVE_INFINITY; } else i = t7.indent - 1 + e7; let o5 = s.split(` `).map((c5) => c5.slice(i)); if (r4.proseWrap === "preserve" || t7.type === "blockLiteral") return a5(o5.map((c5) => c5.length === 0 ? [] : [c5])); return a5(o5.map((c5) => c5.length === 0 ? [] : Ur(c5)).reduce((c5, l5, f5) => f5 !== 0 && o5[f5 - 1].length > 0 && l5.length > 0 && !/^\s/u.test(l5[0]) && !/^\s|\s$/u.test(x(false, c5, -1)) ? [...c5.slice(0, -1), [...x(false, c5, -1), ...l5]] : [...c5, l5], []).map((c5) => c5.reduce((l5, f5) => l5.length > 0 && /\s$/u.test(x(false, l5, -1)) ? [...l5.slice(0, -1), x(false, l5, -1) + " " + f5] : [...l5, f5], [])).map((c5) => r4.proseWrap === "never" ? [c5.join(" ")] : c5)); function a5(c5) { if (t7.chomping === "keep") return x(false, c5, -1).length === 0 ? c5.slice(0, -1) : c5; let l5 = 0; for (let f5 = c5.length - 1; f5 >= 0 && c5[f5].length === 0; f5--) l5++; return l5 === 0 ? c5 : l5 >= 2 && !n27 ? c5.slice(0, -(l5 - 1)) : c5.slice(0, -l5); } } function ft(t7) { if (!t7) return true; switch (t7.type) { case "plain": case "quoteDouble": case "quoteSingle": case "alias": case "flowMapping": case "flowSequence": return true; default: return false; } } function vt(t7, e7) { let { node: n27, root: r4 } = t7, s; return An.has(r4) ? s = An.get(r4) : (s = /* @__PURE__ */ new Set(), An.set(r4, s)), !s.has(n27.position.end.line) && (s.add(n27.position.end.line), Fr(n27, e7) && !Ln(t7.parent)) ? Ct : ""; } function Ln(t7) { return I(t7) && !K(t7, ["documentHead", "documentBody", "flowMapping", "flowSequence"]); } function v(t7, e7) { return ot(" ".repeat(t7), e7); } function ao(t7, e7, n27) { let { node: r4 } = t7, s = t7.ancestors.filter((l5) => l5.type === "sequence" || l5.type === "mapping").length, i = Pt(t7), o5 = [r4.type === "blockFolded" ? ">" : "|"]; r4.indent !== null && o5.push(r4.indent.toString()), r4.chomping !== "clip" && o5.push(r4.chomping === "keep" ? "+" : "-"), On(r4) && o5.push(" ", n27("indicatorComment")); let a5 = Vr(r4, { parentIndent: s, isLastDescendant: i, options: e7 }), c5 = []; for (let [l5, f5] of a5.entries()) l5 === 0 && c5.push(N), c5.push(Tt(P(ne, f5))), l5 !== a5.length - 1 ? c5.push(f5.length === 0 ? N : wr(it)) : r4.chomping === "keep" && i && c5.push(dn(f5.length === 0 ? N : it)); return r4.indent === null ? o5.push(br(v(e7.tabWidth, c5))) : o5.push(dn(v(r4.indent - 1 + s, c5))), o5; } function _t(t7, e7, n27) { let { node: r4 } = t7, s = r4.type === "flowMapping", i = s ? "{" : "[", o5 = s ? "}" : "]", a5 = Ct; s && r4.children.length > 0 && e7.bracketSpacing && (a5 = ne); let c5 = x(false, r4.children, -1), l5 = (c5 == null ? void 0 : c5.type) === "flowMappingItem" && $e(c5.key) && $e(c5.value); return [i, v(e7.tabWidth, [a5, co(t7, e7, n27), e7.trailingComma === "none" ? "" : at2(","), I(r4) ? [N, P(N, t7.map(n27, "endComments"))] : ""]), l5 ? "" : a5, o5]; } function co(t7, e7, n27) { return t7.map(({ isLast: r4, node: s, next: i }) => [n27(), r4 ? "" : [",", ne, s.position.start.line !== i.position.start.line ? vt(t7, e7.originalText) : ""]], "children"); } function lo(t7, e7, n27) { var M7; let { node: r4, parent: s } = t7, { key: i, value: o5 } = r4, a5 = $e(i), c5 = $e(o5); if (a5 && c5) return ": "; let l5 = n27("key"), f5 = fo(r4) ? " " : ""; if (c5) return r4.type === "flowMappingItem" && s.type === "flowMapping" ? l5 : r4.type === "mappingItem" && Tn(i.content, e7) && !V(i.content) && ((M7 = s.tag) == null ? void 0 : M7.value) !== "tag:yaml.org,2002:set" ? [l5, f5, ":"] : ["? ", v(2, l5)]; let m5 = n27("value"); if (a5) return [": ", v(2, m5)]; if (ee(o5) || !ft(i.content)) return ["? ", v(2, l5), N, ...t7.map(() => [n27(), N], "value", "leadingComments"), ": ", v(2, m5)]; if (uo(i.content) && !ee(i.content) && !ie(i.content) && !V(i.content) && !I(i) && !ee(o5.content) && !ie(o5.content) && !I(o5) && Tn(o5.content, e7)) return [l5, f5, ": ", m5]; let d7 = Symbol("mappingKey"), y5 = Re([at2("? "), Re(v(2, l5), { id: d7 })]), h5 = [N, ": ", v(2, m5)], g4 = [f5, ":"]; I(o5) && o5.content && K(o5.content, ["flowMapping", "flowSequence"]) && o5.content.children.length === 0 ? g4.push(" ") : ee(o5.content) || I(o5) && o5.content && !K(o5.content, ["mapping", "sequence"]) || s.type === "mapping" && V(i.content) && ft(o5.content) || K(o5.content, ["mapping", "sequence"]) && o5.content.tag === null && o5.content.anchor === null ? g4.push(N) : o5.content ? g4.push(ne) : V(o5) && g4.push(" "), g4.push(m5); let w7 = v(e7.tabWidth, g4); return Tn(i.content, e7) && !ee(i.content) && !ie(i.content) && !I(i) ? yn([[l5, w7]]) : yn([[y5, at2(h5, w7, { groupId: d7 })]]); } function Tn(t7, e7) { if (!t7) return true; switch (t7.type) { case "plain": case "quoteSingle": case "quoteDouble": break; case "alias": return true; default: return false; } if (e7.proseWrap === "preserve") return t7.position.start.line === t7.position.end.line; if (/\\$/mu.test(e7.originalText.slice(t7.position.start.offset, t7.position.end.offset))) return false; switch (e7.proseWrap) { case "never": return !t7.value.includes(` `); case "always": return !/[\n ]/u.test(t7.value); default: return false; } } function fo(t7) { var e7; return ((e7 = t7.key.content) == null ? void 0 : e7.type) === "alias"; } function uo(t7) { if (!t7) return true; switch (t7.type) { case "plain": case "quoteDouble": case "quoteSingle": return t7.position.start.line === t7.position.end.line; case "alias": return true; default: return false; } } function po(t7) { return Nn(t7, mo); } function mo(t7) { switch (t7.type) { case "document": Ye(t7, "head", () => t7.children[0]), Ye(t7, "body", () => t7.children[1]); break; case "documentBody": case "sequenceItem": case "flowSequenceItem": case "mappingKey": case "mappingValue": Ye(t7, "content", () => t7.children[0]); break; case "mappingItem": case "flowMappingItem": Ye(t7, "key", () => t7.children[0]), Ye(t7, "value", () => t7.children[1]); break; } return t7; } function ho(t7, e7, n27) { let { node: r4 } = t7, s = []; r4.type !== "mappingValue" && ee(r4) && s.push([P(N, t7.map(n27, "leadingComments")), N]); let { tag: i, anchor: o5 } = r4; i && s.push(n27("tag")), i && o5 && s.push(" "), o5 && s.push(n27("anchor")); let a5 = ""; return K(r4, ["mapping", "sequence", "comment", "directive", "mappingItem", "sequenceItem"]) && !Pt(t7) && (a5 = vt(t7, e7.originalText)), (i || o5) && (K(r4, ["sequence", "mapping"]) && !ie(r4) ? s.push(N) : s.push(" ")), ie(r4) && s.push([r4.middleComments.length === 1 ? "" : N, P(N, t7.map(n27, "middleComments")), N]), qr(t7) ? s.push(Er(e7.originalText.slice(r4.position.start.offset, r4.position.end.offset).trimEnd())) : s.push(Re(go(t7, e7, n27))), V(r4) && !K(r4, ["document", "documentHead"]) && s.push(Nr([r4.type === "mappingValue" && !r4.content ? "" : " ", t7.parent.type === "mappingKey" && t7.getParentNode(2).type === "mapping" && ft(r4) ? "" : Mt, n27("trailingComment")])), Ln(r4) && s.push(v(r4.type === "sequenceItem" ? 2 : 0, [N, P(N, t7.map(({ node: c5 }) => [Or(e7.originalText, xe(c5)) ? N : "", n27()], "endComments"))])), s.push(a5), s; } function go(t7, e7, n27) { let { node: r4 } = t7; switch (r4.type) { case "root": { let s = []; t7.each(({ node: o5, next: a5, isFirst: c5 }) => { c5 || s.push(N), s.push(n27()), Gr(o5, a5) ? (s.push(N, "..."), V(o5) && s.push(" ", n27("trailingComment"))) : a5 && !V(a5.head) && s.push(N, "---"); }, "children"); let i = It(r4); return (!K(i, ["blockLiteral", "blockFolded"]) || i.chomping !== "keep") && s.push(N), s; } case "document": { let s = []; return Eo(t7, e7) === "head" && ((r4.head.children.length > 0 || r4.head.endComments.length > 0) && s.push(n27("head")), V(r4.head) ? s.push(["---", " ", n27(["head", "trailingComment"])]) : s.push("---")), yo(r4) && s.push(n27("body")), P(N, s); } case "documentHead": return P(N, [...t7.map(n27, "children"), ...t7.map(n27, "endComments")]); case "documentBody": { let { children: s, endComments: i } = r4, o5 = ""; if (s.length > 0 && i.length > 0) { let a5 = It(r4); K(a5, ["blockFolded", "blockLiteral"]) ? a5.chomping !== "keep" && (o5 = [N, N]) : o5 = N; } return [P(N, t7.map(n27, "children")), o5, P(N, t7.map(n27, "endComments"))]; } case "directive": return ["%", P(" ", [r4.name, ...r4.parameters])]; case "comment": return ["#", r4.value]; case "alias": return ["*", r4.value]; case "tag": return e7.originalText.slice(r4.position.start.offset, r4.position.end.offset); case "anchor": return ["&", r4.value]; case "plain": return ut(r4.type, e7.originalText.slice(r4.position.start.offset, r4.position.end.offset), e7); case "quoteDouble": case "quoteSingle": { let s = "'", i = '"', o5 = e7.originalText.slice(r4.position.start.offset + 1, r4.position.end.offset - 1); if (r4.type === "quoteSingle" && o5.includes("\\") || r4.type === "quoteDouble" && /\\[^"]/u.test(o5)) { let c5 = r4.type === "quoteDouble" ? i : s; return [c5, ut(r4.type, o5, e7), c5]; } if (o5.includes(i)) return [s, ut(r4.type, r4.type === "quoteDouble" ? At(false, At(false, o5, String.raw`\"`, i), "'", s.repeat(2)) : o5, e7), s]; if (o5.includes(s)) return [i, ut(r4.type, r4.type === "quoteSingle" ? At(false, o5, "''", s) : o5, e7), i]; let a5 = e7.singleQuote ? s : i; return [a5, ut(r4.type, o5, e7), a5]; } case "blockFolded": case "blockLiteral": return jr(t7, e7, n27); case "mapping": case "sequence": return P(N, t7.map(n27, "children")); case "sequenceItem": return ["- ", v(2, r4.content ? n27("content") : "")]; case "mappingKey": case "mappingValue": return r4.content ? n27("content") : ""; case "mappingItem": case "flowMappingItem": return Wr(t7, e7, n27); case "flowMapping": return _t(t7, e7, n27); case "flowSequence": return _t(t7, e7, n27); case "flowSequenceItem": return n27("content"); default: throw new Ar(r4, "YAML"); } } function yo(t7) { return t7.body.children.length > 0 || I(t7.body); } function Gr(t7, e7) { return V(t7) || e7 && (e7.head.children.length > 0 || I(e7.head)); } function Eo(t7, e7) { let n27 = t7.node; if (t7.isFirst && /---(?:\s|$)/u.test(e7.originalText.slice(xe(n27), xe(n27) + 4)) || n27.head.children.length > 0 || I(n27.head) || V(n27.head)) return "head"; let r4 = t7.next; return Gr(n27, r4) ? false : r4 ? "root" : false; } function ut(t7, e7, n27) { let r4 = Kr(t7, e7, n27); return P(N, r4.map((s) => Tt(P(ne, s)))); } function Hr(t7, e7) { if (K(t7)) switch (t7.type) { case "comment": if (xr(t7.value)) return null; break; case "quoteDouble": case "quoteSingle": e7.type = "quote"; break; } } function B(t7, e7 = null) { "children" in t7 && t7.children.forEach((n27) => B(n27, t7)), "anchor" in t7 && t7.anchor && B(t7.anchor, t7), "tag" in t7 && t7.tag && B(t7.tag, t7), "leadingComments" in t7 && t7.leadingComments.forEach((n27) => B(n27, t7)), "middleComments" in t7 && t7.middleComments.forEach((n27) => B(n27, t7)), "indicatorComment" in t7 && t7.indicatorComment && B(t7.indicatorComment, t7), "trailingComment" in t7 && t7.trailingComment && B(t7.trailingComment, t7), "endComments" in t7 && t7.endComments.forEach((n27) => B(n27, t7)), Object.defineProperty(t7, "_parent", { value: e7, enumerable: false }); } function Ae(t7) { return `${t7.line}:${t7.column}`; } function qs(t7) { B(t7); let e7 = Fa(t7), n27 = t7.children.slice(); t7.comments.sort((r4, s) => r4.position.start.offset - s.position.end.offset).filter((r4) => !r4._parent).forEach((r4) => { for (; n27.length > 1 && r4.position.start.line > n27[0].position.end.line; ) n27.shift(); qa(r4, e7, n27[0]); }); } function Fa(t7) { let e7 = Array.from(new Array(t7.position.end.line), () => ({})); for (let n27 of t7.comments) e7[n27.position.start.line - 1].comment = n27; return Us(e7, t7), e7; } function Us(t7, e7) { if (e7.position.start.offset !== e7.position.end.offset) { if ("leadingComments" in e7) { let { start: n27 } = e7.position, { leadingAttachableNode: r4 } = t7[n27.line - 1]; (!r4 || n27.column < r4.position.start.column) && (t7[n27.line - 1].leadingAttachableNode = e7); } if ("trailingComment" in e7 && e7.position.end.column > 1 && e7.type !== "document" && e7.type !== "documentHead") { let { end: n27 } = e7.position, { trailingAttachableNode: r4 } = t7[n27.line - 1]; (!r4 || n27.column >= r4.position.end.column) && (t7[n27.line - 1].trailingAttachableNode = e7); } if (e7.type !== "root" && e7.type !== "document" && e7.type !== "documentHead" && e7.type !== "documentBody") { let { start: n27, end: r4 } = e7.position, s = [r4.line].concat(n27.line === r4.line ? [] : n27.line); for (let i of s) { let o5 = t7[i - 1].trailingNode; (!o5 || r4.column >= o5.position.end.column) && (t7[i - 1].trailingNode = e7); } } "children" in e7 && e7.children.forEach((n27) => { Us(t7, n27); }); } } function qa(t7, e7, n27) { let r4 = t7.position.start.line, { trailingAttachableNode: s } = e7[r4 - 1]; if (s) { if (s.trailingComment) throw new Error(`Unexpected multiple trailing comment at ${Ae(t7.position.start)}`); B(t7, s), s.trailingComment = t7; return; } for (let o5 = r4; o5 >= n27.position.start.line; o5--) { let { trailingNode: a5 } = e7[o5 - 1], c5; if (a5) c5 = a5; else if (o5 !== r4 && e7[o5 - 1].comment) c5 = e7[o5 - 1].comment._parent; else continue; if ((c5.type === "sequence" || c5.type === "mapping") && (c5 = c5.children[0]), c5.type === "mappingItem") { let [l5, f5] = c5.children; c5 = Ks(l5) ? l5 : f5; } for (; ; ) { if (Ua(c5, t7)) { B(t7, c5), c5.endComments.push(t7); return; } if (!c5._parent) break; c5 = c5._parent; } break; } for (let o5 = r4 + 1; o5 <= n27.position.end.line; o5++) { let { leadingAttachableNode: a5 } = e7[o5 - 1]; if (a5) { B(t7, a5), a5.leadingComments.push(t7); return; } } let i = n27.children[1]; B(t7, i), i.endComments.push(t7); } function Ua(t7, e7) { if (t7.position.start.offset < e7.position.start.offset && t7.position.end.offset > e7.position.end.offset) switch (t7.type) { case "flowMapping": case "flowSequence": return t7.children.length === 0 || e7.position.start.line > t7.children[t7.children.length - 1].position.end.line; } if (e7.position.end.offset < t7.position.end.offset) return false; switch (t7.type) { case "sequenceItem": return e7.position.start.column > t7.position.start.column; case "mappingKey": case "mappingValue": return e7.position.start.column > t7._parent.position.start.column && (t7.children.length === 0 || t7.children.length === 1 && t7.children[0].type !== "blockFolded" && t7.children[0].type !== "blockLiteral") && (t7.type === "mappingValue" || Ks(t7)); default: return false; } } function Ks(t7) { return t7.position.start !== t7.position.end && (t7.children.length === 0 || t7.position.start.offset !== t7.children[0].position.start.offset); } function b(t7, e7) { return { type: t7, position: e7 }; } function Vs(t7, e7, n27) { return { ...b("root", t7), children: e7, comments: n27 }; } function wt(t7) { switch (t7.type) { case "DOCUMENT": for (let e7 = t7.contents.length - 1; e7 >= 0; e7--) t7.contents[e7].type === "BLANK_LINE" ? t7.contents.splice(e7, 1) : wt(t7.contents[e7]); for (let e7 = t7.directives.length - 1; e7 >= 0; e7--) t7.directives[e7].type === "BLANK_LINE" && t7.directives.splice(e7, 1); break; case "FLOW_MAP": case "FLOW_SEQ": case "MAP": case "SEQ": for (let e7 = t7.items.length - 1; e7 >= 0; e7--) { let n27 = t7.items[e7]; "char" in n27 || (n27.type === "BLANK_LINE" ? t7.items.splice(e7, 1) : wt(n27)); } break; case "MAP_KEY": case "MAP_VALUE": case "SEQ_ITEM": t7.node && wt(t7.node); break; case "ALIAS": case "BLANK_LINE": case "BLOCK_FOLDED": case "BLOCK_LITERAL": case "COMMENT": case "DIRECTIVE": case "PLAIN": case "QUOTE_DOUBLE": case "QUOTE_SINGLE": break; default: throw new Error(`Unexpected node type ${JSON.stringify(t7.type)}`); } } function J(t7, e7) { return { start: t7, end: e7 }; } function nr(t7) { return { start: t7, end: t7 }; } function js(t7, e7) { return { ...b("anchor", t7), value: e7 }; } function Ge(t7, e7) { return { ...b("comment", t7), value: e7 }; } function Ws(t7, e7, n27) { return { anchor: e7, tag: t7, middleComments: n27 }; } function Qs(t7, e7) { return { ...b("tag", t7), value: e7 }; } function zt(t7, e7, n27 = () => false) { let r4 = t7.cstNode, s = [], i = null, o5 = null, a5 = null; for (let c5 of r4.props) { let l5 = e7.text[c5.origStart]; switch (l5) { case ue.Tag: i = i || c5, o5 = Qs(e7.transformRange(c5), t7.tag); break; case ue.Anchor: i = i || c5, a5 = js(e7.transformRange(c5), r4.anchor); break; case ue.Comment: { let f5 = Ge(e7.transformRange(c5), e7.text.slice(c5.origStart + 1, c5.origEnd)); e7.comments.push(f5), !n27(f5) && i && i.origEnd <= c5.origStart && c5.origEnd <= r4.valueRange.origStart && s.push(f5); break; } default: throw new Error(`Unexpected leading character ${JSON.stringify(l5)}`); } } return Ws(o5, a5, s); } function X() { return { leadingComments: [] }; } function pe(t7 = null) { return { trailingComment: t7 }; } function F() { return { ...X(), ...pe() }; } function Gs(t7, e7, n27) { return { ...b("alias", t7), ...F(), ...e7, value: n27 }; } function Hs(t7, e7) { let n27 = t7.cstNode; return Gs(e7.transformRange({ origStart: n27.valueRange.origStart - 1, origEnd: n27.valueRange.origEnd }), e7.transformContent(t7), n27.rawValue); } function Js(t7) { return { ...t7, type: "blockFolded" }; } function Xs(t7, e7, n27, r4, s, i) { return { ...b("blockValue", t7), ...X(), ...e7, chomping: n27, indent: r4, value: s, indicatorComment: i }; } function Zt(t7, e7) { let n27 = t7.cstNode, r4 = 1, s = n27.chomping === "CLIP" ? 0 : 1, o5 = n27.header.origEnd - n27.header.origStart - r4 - s !== 0, a5 = e7.transformRange({ origStart: n27.header.origStart, origEnd: n27.valueRange.origEnd }), c5 = null, l5 = zt(t7, e7, (f5) => { if (!(a5.start.offset < f5.position.start.offset && f5.position.end.offset < a5.end.offset)) return false; if (c5) throw new Error(`Unexpected multiple indicator comments at ${Ae(f5.position.start)}`); return c5 = f5, true; }); return Xs(a5, l5, rr[n27.chomping], o5 ? n27.blockIndent : null, n27.strValue, c5); } function zs(t7, e7) { return Js(Zt(t7, e7)); } function Zs(t7) { return { ...t7, type: "blockLiteral" }; } function ei(t7, e7) { return Zs(Zt(t7, e7)); } function ti(t7, e7) { return Ge(e7.transformRange(t7.range), t7.comment); } function ni(t7, e7, n27) { return { ...b("directive", t7), ...F(), name: e7, parameters: n27 }; } function He(t7, e7) { for (let n27 of t7.props) { let r4 = e7.text[n27.origStart]; switch (r4) { case ue.Comment: e7.comments.push(Ge(e7.transformRange(n27), e7.text.slice(n27.origStart + 1, n27.origEnd))); break; default: throw new Error(`Unexpected leading character ${JSON.stringify(r4)}`); } } } function ri(t7, e7) { return He(t7, e7), ni(e7.transformRange(t7.range), t7.name, t7.parameters); } function si(t7, e7, n27, r4) { return { ...b("document", t7), ...pe(r4), children: [e7, n27] }; } function q(t7 = []) { return { endComments: t7 }; } function ii(t7, e7, n27) { return { ...b("documentBody", t7), ...q(n27), children: e7 ? [e7] : [] }; } function U(t7) { return t7[t7.length - 1]; } function en(t7, e7) { let n27 = t7.match(e7); return n27 ? n27.index : -1; } function oi(t7, e7, n27) { let r4 = t7.cstNode, { comments: s, endComments: i, documentTrailingComment: o5, documentHeadTrailingComment: a5 } = Ka(r4, e7, n27), c5 = e7.transformNode(t7.contents), { position: l5, documentEndPoint: f5 } = Va(r4, c5, e7); return e7.comments.push(...s, ...i), { documentBody: ii(l5, c5, i), documentEndPoint: f5, documentTrailingComment: o5, documentHeadTrailingComment: a5 }; } function Ka(t7, e7, n27) { let r4 = [], s = [], i = [], o5 = [], a5 = false; for (let c5 = t7.contents.length - 1; c5 >= 0; c5--) { let l5 = t7.contents[c5]; if (l5.type === "COMMENT") { let f5 = e7.transformNode(l5); n27 && n27.line === f5.position.start.line ? o5.unshift(f5) : a5 ? r4.unshift(f5) : f5.position.start.offset >= t7.valueRange.origEnd ? i.unshift(f5) : r4.unshift(f5); } else a5 = true; } if (i.length > 1) throw new Error(`Unexpected multiple document trailing comments at ${Ae(i[1].position.start)}`); if (o5.length > 1) throw new Error(`Unexpected multiple documentHead trailing comments at ${Ae(o5[1].position.start)}`); return { comments: r4, endComments: s, documentTrailingComment: U(i) || null, documentHeadTrailingComment: U(o5) || null }; } function Va(t7, e7, n27) { let r4 = en(n27.text.slice(t7.valueRange.origEnd), /^\.\.\./), s = r4 === -1 ? t7.valueRange.origEnd : Math.max(0, t7.valueRange.origEnd - 1); n27.text[s - 1] === "\r" && s--; let i = n27.transformRange({ origStart: e7 !== null ? e7.position.start.offset : s, origEnd: s }), o5 = r4 === -1 ? i.end : n27.transformOffset(t7.valueRange.origEnd + 3); return { position: i, documentEndPoint: o5 }; } function ai(t7, e7, n27, r4) { return { ...b("documentHead", t7), ...q(n27), ...pe(r4), children: e7 }; } function ci(t7, e7) { let n27 = t7.cstNode, { directives: r4, comments: s, endComments: i } = ja(n27, e7), { position: o5, endMarkerPoint: a5 } = Wa(n27, r4, e7); return e7.comments.push(...s, ...i), { createDocumentHeadWithTrailingComment: (l5) => (l5 && e7.comments.push(l5), ai(o5, r4, i, l5)), documentHeadEndMarkerPoint: a5 }; } function ja(t7, e7) { let n27 = [], r4 = [], s = [], i = false; for (let o5 = t7.directives.length - 1; o5 >= 0; o5--) { let a5 = e7.transformNode(t7.directives[o5]); a5.type === "comment" ? i ? r4.unshift(a5) : s.unshift(a5) : (i = true, n27.unshift(a5)); } return { directives: n27, comments: r4, endComments: s }; } function Wa(t7, e7, n27) { let r4 = en(n27.text.slice(0, t7.valueRange.origStart), /---\s*$/); r4 > 0 && !/[\r\n]/.test(n27.text[r4 - 1]) && (r4 = -1); let s = r4 === -1 ? { origStart: t7.valueRange.origStart, origEnd: t7.valueRange.origStart } : { origStart: r4, origEnd: r4 + 3 }; return e7.length !== 0 && (s.origStart = e7[0].position.start.offset), { position: n27.transformRange(s), endMarkerPoint: r4 === -1 ? null : n27.transformOffset(r4) }; } function li(t7, e7) { let { createDocumentHeadWithTrailingComment: n27, documentHeadEndMarkerPoint: r4 } = ci(t7, e7), { documentBody: s, documentEndPoint: i, documentTrailingComment: o5, documentHeadTrailingComment: a5 } = oi(t7, e7, r4), c5 = n27(a5); return o5 && e7.comments.push(o5), si(J(c5.position.start, i), c5, s, o5); } function tn(t7, e7, n27) { return { ...b("flowCollection", t7), ...F(), ...q(), ...e7, children: n27 }; } function fi(t7, e7, n27) { return { ...tn(t7, e7, n27), type: "flowMapping" }; } function nn(t7, e7, n27) { return { ...b("flowMappingItem", t7), ...X(), children: [e7, n27] }; } function me(t7, e7) { let n27 = []; for (let r4 of t7) r4 && "type" in r4 && r4.type === "COMMENT" ? e7.comments.push(e7.transformNode(r4)) : n27.push(r4); return n27; } function rn(t7) { let [e7, n27] = ["?", ":"].map((r4) => { let s = t7.find((i) => "char" in i && i.char === r4); return s ? { origStart: s.origOffset, origEnd: s.origOffset + 1 } : null; }); return { additionalKeyRange: e7, additionalValueRange: n27 }; } function sn(t7, e7) { let n27 = e7; return (r4) => t7.slice(n27, n27 = r4); } function on(t7) { let e7 = [], n27 = sn(t7, 1), r4 = false; for (let s = 1; s < t7.length - 1; s++) { let i = t7[s]; if ("char" in i && i.char === ",") { e7.push(n27(s)), n27(s + 1), r4 = false; continue; } r4 = true; } return r4 && e7.push(n27(t7.length - 1)), e7; } function sr(t7, e7) { return { ...b("mappingKey", t7), ...pe(), ...q(), children: e7 ? [e7] : [] }; } function ir(t7, e7) { return { ...b("mappingValue", t7), ...F(), ...q(), children: e7 ? [e7] : [] }; } function Je(t7, e7, n27, r4, s) { let i = e7.transformNode(t7.key), o5 = e7.transformNode(t7.value), a5 = i || r4 ? sr(e7.transformRange({ origStart: r4 ? r4.origStart : i.position.start.offset, origEnd: i ? i.position.end.offset : r4.origStart + 1 }), i) : null, c5 = o5 || s ? ir(e7.transformRange({ origStart: s ? s.origStart : o5.position.start.offset, origEnd: o5 ? o5.position.end.offset : s.origStart + 1 }), o5) : null; return n27(J(a5 ? a5.position.start : c5.position.start, c5 ? c5.position.end : a5.position.end), a5 || sr(nr(c5.position.start), null), c5 || ir(nr(a5.position.end), null)); } function ui2(t7, e7) { let n27 = me(t7.cstNode.items, e7), r4 = on(n27), s = t7.items.map((a5, c5) => { let l5 = r4[c5], { additionalKeyRange: f5, additionalValueRange: m5 } = rn(l5); return Je(a5, e7, nn, f5, m5); }), i = n27[0], o5 = U(n27); return fi(e7.transformRange({ origStart: i.origOffset, origEnd: o5.origOffset + 1 }), e7.transformContent(t7), s); } function pi(t7, e7, n27) { return { ...tn(t7, e7, n27), type: "flowSequence" }; } function mi(t7, e7) { return { ...b("flowSequenceItem", t7), children: [e7] }; } function hi(t7, e7) { let n27 = me(t7.cstNode.items, e7), r4 = on(n27), s = t7.items.map((a5, c5) => { if (a5.type !== "PAIR") { let l5 = e7.transformNode(a5); return mi(J(l5.position.start, l5.position.end), l5); } else { let l5 = r4[c5], { additionalKeyRange: f5, additionalValueRange: m5 } = rn(l5); return Je(a5, e7, nn, f5, m5); } }), i = n27[0], o5 = U(n27); return pi(e7.transformRange({ origStart: i.origOffset, origEnd: o5.origOffset + 1 }), e7.transformContent(t7), s); } function gi(t7, e7, n27) { return { ...b("mapping", t7), ...X(), ...e7, children: n27 }; } function di(t7, e7, n27) { return { ...b("mappingItem", t7), ...X(), children: [e7, n27] }; } function yi(t7, e7) { let n27 = t7.cstNode; n27.items.filter((o5) => o5.type === "MAP_KEY" || o5.type === "MAP_VALUE").forEach((o5) => He(o5, e7)); let r4 = me(n27.items, e7), s = Qa(r4), i = t7.items.map((o5, a5) => { let c5 = s[a5], [l5, f5] = c5[0].type === "MAP_VALUE" ? [null, c5[0].range] : [c5[0].range, c5.length === 1 ? null : c5[1].range]; return Je(o5, e7, di, l5, f5); }); return gi(J(i[0].position.start, U(i).position.end), e7.transformContent(t7), i); } function Qa(t7) { let e7 = [], n27 = sn(t7, 0), r4 = false; for (let s = 0; s < t7.length; s++) { if (t7[s].type === "MAP_VALUE") { e7.push(n27(s + 1)), r4 = false; continue; } r4 && e7.push(n27(s)), r4 = true; } return r4 && e7.push(n27(1 / 0)), e7; } function Ei(t7, e7, n27) { return { ...b("plain", t7), ...F(), ...e7, value: n27 }; } function Si(t7, e7, n27) { for (let r4 = e7; r4 >= 0; r4--) if (n27.test(t7[r4])) return r4; return -1; } function wi(t7, e7) { let n27 = t7.cstNode; return Ei(e7.transformRange({ origStart: n27.valueRange.origStart, origEnd: Si(e7.text, n27.valueRange.origEnd - 1, /\S/) + 1 }), e7.transformContent(t7), n27.strValue); } function bi(t7) { return { ...t7, type: "quoteDouble" }; } function Ni(t7, e7, n27) { return { ...b("quoteValue", t7), ...e7, ...F(), value: n27 }; } function an(t7, e7) { let n27 = t7.cstNode; return Ni(e7.transformRange(n27.valueRange), e7.transformContent(t7), n27.strValue); } function Oi(t7, e7) { return bi(an(t7, e7)); } function Ai(t7) { return { ...t7, type: "quoteSingle" }; } function Li(t7, e7) { return Ai(an(t7, e7)); } function Ti(t7, e7, n27) { return { ...b("sequence", t7), ...X(), ...q(), ...e7, children: n27 }; } function Mi(t7, e7) { return { ...b("sequenceItem", t7), ...F(), ...q(), children: e7 ? [e7] : [] }; } function Ci(t7, e7) { let r4 = me(t7.cstNode.items, e7).map((s, i) => { He(s, e7); let o5 = e7.transformNode(t7.items[i]); return Mi(J(e7.transformOffset(s.valueRange.origStart), o5 === null ? e7.transformOffset(s.valueRange.origStart + 1) : o5.position.end), o5); }); return Ti(J(r4[0].position.start, U(r4).position.end), e7.transformContent(t7), r4); } function ki(t7, e7) { if (t7 === null || t7.type === void 0 && t7.value === null) return null; switch (t7.type) { case "ALIAS": return Hs(t7, e7); case "BLOCK_FOLDED": return zs(t7, e7); case "BLOCK_LITERAL": return ei(t7, e7); case "COMMENT": return ti(t7, e7); case "DIRECTIVE": return ri(t7, e7); case "DOCUMENT": return li(t7, e7); case "FLOW_MAP": return ui2(t7, e7); case "FLOW_SEQ": return hi(t7, e7); case "MAP": return yi(t7, e7); case "PLAIN": return wi(t7, e7); case "QUOTE_DOUBLE": return Oi(t7, e7); case "QUOTE_SINGLE": return Li(t7, e7); case "SEQ": return Ci(t7, e7); default: throw new Error(`Unexpected node type ${t7.type}`); } } function Ii(t7, e7, n27) { let r4 = new SyntaxError(t7); return r4.name = "YAMLSyntaxError", r4.source = e7, r4.position = n27, r4; } function vi(t7, e7) { let n27 = t7.source.range || t7.source.valueRange; return Ii(t7.message, e7.text, e7.transformRange(n27)); } function fr(t7) { if ("children" in t7) { if (t7.children.length === 1) { let e7 = t7.children[0]; if (e7.type === "plain" && e7.tag === null && e7.anchor === null && e7.value === "") return t7.children.splice(0, 1), t7; } t7.children.forEach(fr); } return t7; } function ur(t7, e7, n27, r4) { let s = e7(t7); return (i) => { r4(s, i) && n27(t7, s = i); }; } function pr(t7) { if (t7 === null || !("children" in t7)) return; let e7 = t7.children; if (e7.forEach(pr), t7.type === "document") { let [i, o5] = t7.children; i.position.start.offset === i.position.end.offset ? i.position.start = i.position.end = o5.position.start : o5.position.start.offset === o5.position.end.offset && (o5.position.start = o5.position.end = i.position.end); } let n27 = ur(t7.position, Ga, Ha, za), r4 = ur(t7.position, Ja, Xa, Za); "endComments" in t7 && t7.endComments.length !== 0 && (n27(t7.endComments[0].position.start), r4(U(t7.endComments).position.end)); let s = e7.filter((i) => i !== null); if (s.length !== 0) { let i = s[0], o5 = U(s); n27(i.position.start), r4(o5.position.end), "leadingComments" in i && i.leadingComments.length !== 0 && n27(i.leadingComments[0].position.start), "tag" in i && i.tag && n27(i.tag.position.start), "anchor" in i && i.anchor && n27(i.anchor.position.start), "trailingComment" in o5 && o5.trailingComment && r4(o5.trailingComment.position.end); } } function Ga(t7) { return t7.start; } function Ha(t7, e7) { t7.start = e7; } function Ja(t7) { return t7.end; } function Xa(t7, e7) { t7.end = e7; } function za(t7, e7) { return e7.offset < t7.offset; } function Za(t7, e7) { return e7.offset > t7.offset; } function _i(t7) { let e7 = mr.default.parseCST(t7), n27 = new Pi(e7, t7); n27.setOrigRanges(); let r4 = e7.map((i) => new mr.default.Document({ merge: false, keepCstNodes: true }).parse(i)); for (let i of r4) for (let o5 of i.errors) if (!(o5 instanceof Fs && o5.message === 'Map keys must be unique; "<<" is repeated')) throw vi(o5, n27); r4.forEach((i) => wt(i.cstNode)); let s = Vs(n27.transformRange({ origStart: 0, origEnd: t7.length }), r4.map((i) => n27.transformNode(i)), n27.comments); return qs(s), pr(s), fr(s), s; } function ec(t7, e7) { let n27 = new SyntaxError(t7 + " (" + e7.loc.start.line + ":" + e7.loc.start.column + ")"); return Object.assign(n27, e7); } function tc(t7) { try { let e7 = _i(t7); return delete e7.comments, e7; } catch (e7) { throw e7 != null && e7.position ? Ri(e7.message, { loc: e7.position, cause: e7 }) : e7; } } var Yi, Nt, $i, Bi, Fi, qi, dr, Ui, te, yr, Ki, cn, ln, fn, Te, Ot, un, Xe, oe, ns, qe, Gn, zn, Rs, Ys, tr, Bs, gr, Vi, At, Me, ze, Ze, et, Ce, tt, ke, Pe, ge, nt, Ie, rt, Z, st, ve, Lt, ji, x, _e, Qi, pn, mn, hn, de, gn, Sr, Mt, Xi, zi, ne, Ct, N, it, Bc, En, Fc, qc, Sn, Or, wn, Ar, Tr, ct, to, Mr, ro, Cr, so, kr, Ir, vr, _r, Rr, De, An, jr, Wr, Qr, So, Jr, Xr, Rt, wo, zr, hr, mr, H, sf, of, af, cf, lf, ff, uf, pf, mf, Fs, hf, gf, ue, rr, or, Le, bt, he, cr, lr, ar, Pi, Ri, nc, rc, xi, sc, Ih; var init_yaml = __esm({ "../../node_modules/prettier/plugins/yaml.mjs"() { Yi = Object.create; Nt = Object.defineProperty; $i = Object.getOwnPropertyDescriptor; Bi = Object.getOwnPropertyNames; Fi = Object.getPrototypeOf; qi = Object.prototype.hasOwnProperty; dr = (t7) => { throw TypeError(t7); }; Ui = (t7, e7, n27) => e7 in t7 ? Nt(t7, e7, { enumerable: true, configurable: true, writable: true, value: n27 }) : t7[e7] = n27; te = (t7, e7) => () => (e7 || t7((e7 = { exports: {} }).exports, e7), e7.exports); yr = (t7, e7) => { for (var n27 in e7) Nt(t7, n27, { get: e7[n27], enumerable: true }); }; Ki = (t7, e7, n27, r4) => { if (e7 && typeof e7 == "object" || typeof e7 == "function") for (let s of Bi(e7)) !qi.call(t7, s) && s !== n27 && Nt(t7, s, { get: () => e7[s], enumerable: !(r4 = $i(e7, s)) || r4.enumerable }); return t7; }; cn = (t7, e7, n27) => (n27 = t7 != null ? Yi(Fi(t7)) : {}, Ki(e7 || !t7 || !t7.__esModule ? Nt(n27, "default", { value: t7, enumerable: true }) : n27, t7)); ln = (t7, e7, n27) => Ui(t7, typeof e7 != "symbol" ? e7 + "" : e7, n27); fn = (t7, e7, n27) => e7.has(t7) || dr("Cannot " + n27); Te = (t7, e7, n27) => (fn(t7, e7, "read from private field"), n27 ? n27.call(t7) : e7.get(t7)); Ot = (t7, e7, n27) => e7.has(t7) ? dr("Cannot add the same private member more than once") : e7 instanceof WeakSet ? e7.add(t7) : e7.set(t7, n27); un = (t7, e7, n27, r4) => (fn(t7, e7, "write to private field"), r4 ? r4.call(t7, n27) : e7.set(t7, n27), n27); Xe = (t7, e7, n27) => (fn(t7, e7, "access private method"), n27); oe = te(($9) => { "use strict"; var re10 = { ANCHOR: "&", COMMENT: "#", TAG: "!", DIRECTIVES_END: "-", DOCUMENT_END: "." }, pt9 = { ALIAS: "ALIAS", BLANK_LINE: "BLANK_LINE", BLOCK_FOLDED: "BLOCK_FOLDED", BLOCK_LITERAL: "BLOCK_LITERAL", COMMENT: "COMMENT", DIRECTIVE: "DIRECTIVE", DOCUMENT: "DOCUMENT", FLOW_MAP: "FLOW_MAP", FLOW_SEQ: "FLOW_SEQ", MAP: "MAP", MAP_KEY: "MAP_KEY", MAP_VALUE: "MAP_VALUE", PLAIN: "PLAIN", QUOTE_DOUBLE: "QUOTE_DOUBLE", QUOTE_SINGLE: "QUOTE_SINGLE", SEQ: "SEQ", SEQ_ITEM: "SEQ_ITEM" }, bo4 = "tag:yaml.org,2002:", No3 = { MAP: "tag:yaml.org,2002:map", SEQ: "tag:yaml.org,2002:seq", STR: "tag:yaml.org,2002:str" }; function Zr7(t7) { let e7 = [0], n27 = t7.indexOf(` `); for (; n27 !== -1; ) n27 += 1, e7.push(n27), n27 = t7.indexOf(` `, n27); return e7; } function es7(t7) { let e7, n27; return typeof t7 == "string" ? (e7 = Zr7(t7), n27 = t7) : (Array.isArray(t7) && (t7 = t7[0]), t7 && t7.context && (t7.lineStarts || (t7.lineStarts = Zr7(t7.context.src)), e7 = t7.lineStarts, n27 = t7.context.src)), { lineStarts: e7, src: n27 }; } function Mn7(t7, e7) { if (typeof t7 != "number" || t7 < 0) return null; let { lineStarts: n27, src: r4 } = es7(e7); if (!n27 || !r4 || t7 > r4.length) return null; for (let i = 0; i < n27.length; ++i) { let o5 = n27[i]; if (t7 < o5) return { line: i, col: t7 - n27[i - 1] + 1 }; if (t7 === o5) return { line: i + 1, col: 1 }; } let s = n27.length; return { line: s, col: t7 - n27[s - 1] + 1 }; } function Oo4(t7, e7) { let { lineStarts: n27, src: r4 } = es7(e7); if (!n27 || !(t7 >= 1) || t7 > n27.length) return null; let s = n27[t7 - 1], i = n27[t7]; for (; i && i > s && r4[i - 1] === ` `; ) --i; return r4.slice(s, i); } function Ao3({ start: t7, end: e7 }, n27, r4 = 80) { let s = Oo4(t7.line, n27); if (!s) return null; let { col: i } = t7; if (s.length > r4) if (i <= r4 - 10) s = s.substr(0, r4 - 1) + "\u2026"; else { let f5 = Math.round(r4 / 2); s.length > i + f5 && (s = s.substr(0, i + f5 - 1) + "\u2026"), i -= s.length - r4, s = "\u2026" + s.substr(1 - r4); } let o5 = 1, a5 = ""; e7 && (e7.line === t7.line && i + (e7.col - t7.col) <= r4 + 1 ? o5 = e7.col - t7.col : (o5 = Math.min(s.length + 1, r4) - i, a5 = "\u2026")); let c5 = i > 1 ? " ".repeat(i - 1) : "", l5 = "^".repeat(o5); return `${s} ${c5}${l5}${a5}`; } var Be9 = class t7 { static copy(e7) { return new t7(e7.start, e7.end); } constructor(e7, n27) { this.start = e7, this.end = n27 || e7; } isEmpty() { return typeof this.start != "number" || !this.end || this.end <= this.start; } setOrigRange(e7, n27) { let { start: r4, end: s } = this; if (e7.length === 0 || s <= e7[0]) return this.origStart = r4, this.origEnd = s, n27; let i = n27; for (; i < e7.length && !(e7[i] > r4); ) ++i; this.origStart = r4 + i; let o5 = i; for (; i < e7.length && !(e7[i] >= s); ) ++i; return this.origEnd = s + i, o5; } }, se8 = class t7 { static addStringTerminator(e7, n27, r4) { if (r4[r4.length - 1] === ` `) return r4; let s = t7.endOfWhiteSpace(e7, n27); return s >= e7.length || e7[s] === ` ` ? r4 + ` ` : r4; } static atDocumentBoundary(e7, n27, r4) { let s = e7[n27]; if (!s) return true; let i = e7[n27 - 1]; if (i && i !== ` `) return false; if (r4) { if (s !== r4) return false; } else if (s !== re10.DIRECTIVES_END && s !== re10.DOCUMENT_END) return false; let o5 = e7[n27 + 1], a5 = e7[n27 + 2]; if (o5 !== s || a5 !