@brightsideoy/kama 0.1.0-alpha.85 → 0.1.0-alpha.87
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/assets/{index-BvcEh0__.css → index-Dgg7MfYy.css} +1 -1
- package/dist/assets/index-m96oHQ-x.js +1388 -0
- package/dist/index.html +2 -2
- package/dist/index.js +862 -857
- package/package.json +1 -1
- package/dist/assets/index-C5a8EyGj.js +0 -1388
package/dist/index.js
CHANGED
|
@@ -140,41 +140,41 @@ function T(e) {
|
|
|
140
140
|
}
|
|
141
141
|
return !1;
|
|
142
142
|
}
|
|
143
|
-
var E = (e) => (S(e) || w(e)) && !!e.anchor, D = Symbol("break visit"),
|
|
144
|
-
function
|
|
143
|
+
var E = (e) => (S(e) || w(e)) && !!e.anchor, D = Symbol("break visit"), O = Symbol("skip children"), k = Symbol("remove node");
|
|
144
|
+
function A(e, t) {
|
|
145
145
|
let n = ne(t);
|
|
146
|
-
y(e) ?
|
|
146
|
+
y(e) ? ee(null, e.contents, n, Object.freeze([e])) === k && (e.contents = null) : ee(null, e, n, Object.freeze([]));
|
|
147
147
|
}
|
|
148
|
-
|
|
149
|
-
function
|
|
148
|
+
A.BREAK = D, A.SKIP = O, A.REMOVE = k;
|
|
149
|
+
function ee(e, t, n, r) {
|
|
150
150
|
let i = re(e, t, n, r);
|
|
151
|
-
if (T(i) || x(i)) return ie(e, r, i),
|
|
151
|
+
if (T(i) || x(i)) return ie(e, r, i), ee(e, i, n, r);
|
|
152
152
|
if (typeof i != "symbol") {
|
|
153
153
|
if (w(t)) {
|
|
154
154
|
r = Object.freeze(r.concat(t));
|
|
155
155
|
for (let e = 0; e < t.items.length; ++e) {
|
|
156
|
-
let i =
|
|
156
|
+
let i = ee(e, t.items[e], n, r);
|
|
157
157
|
if (typeof i == "number") e = i - 1;
|
|
158
158
|
else if (i === D) return D;
|
|
159
|
-
else i ===
|
|
159
|
+
else i === k && (t.items.splice(e, 1), --e);
|
|
160
160
|
}
|
|
161
161
|
} else if (x(t)) {
|
|
162
162
|
r = Object.freeze(r.concat(t));
|
|
163
|
-
let e =
|
|
163
|
+
let e = ee("key", t.key, n, r);
|
|
164
164
|
if (e === D) return D;
|
|
165
|
-
e ===
|
|
166
|
-
let i =
|
|
165
|
+
e === k && (t.key = null);
|
|
166
|
+
let i = ee("value", t.value, n, r);
|
|
167
167
|
if (i === D) return D;
|
|
168
|
-
i ===
|
|
168
|
+
i === k && (t.value = null);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
return i;
|
|
172
172
|
}
|
|
173
|
-
async function
|
|
173
|
+
async function te(e, t) {
|
|
174
174
|
let n = ne(t);
|
|
175
|
-
y(e) ? await j(null, e.contents, n, Object.freeze([e])) ===
|
|
175
|
+
y(e) ? await j(null, e.contents, n, Object.freeze([e])) === k && (e.contents = null) : await j(null, e, n, Object.freeze([]));
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
te.BREAK = D, te.SKIP = O, te.REMOVE = k;
|
|
178
178
|
async function j(e, t, n, r) {
|
|
179
179
|
let i = await re(e, t, n, r);
|
|
180
180
|
if (T(i) || x(i)) return ie(e, r, i), j(e, i, n, r);
|
|
@@ -185,16 +185,16 @@ async function j(e, t, n, r) {
|
|
|
185
185
|
let i = await j(e, t.items[e], n, r);
|
|
186
186
|
if (typeof i == "number") e = i - 1;
|
|
187
187
|
else if (i === D) return D;
|
|
188
|
-
else i ===
|
|
188
|
+
else i === k && (t.items.splice(e, 1), --e);
|
|
189
189
|
}
|
|
190
190
|
} else if (x(t)) {
|
|
191
191
|
r = Object.freeze(r.concat(t));
|
|
192
192
|
let e = await j("key", t.key, n, r);
|
|
193
193
|
if (e === D) return D;
|
|
194
|
-
e ===
|
|
194
|
+
e === k && (t.key = null);
|
|
195
195
|
let i = await j("value", t.value, n, r);
|
|
196
196
|
if (i === D) return D;
|
|
197
|
-
i ===
|
|
197
|
+
i === k && (t.value = null);
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
return i;
|
|
@@ -311,7 +311,7 @@ var ae = {
|
|
|
311
311
|
let t = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [], n = Object.entries(this.tags), r;
|
|
312
312
|
if (e && n.length > 0 && T(e.contents)) {
|
|
313
313
|
let t = {};
|
|
314
|
-
|
|
314
|
+
A(e.contents, (e, n) => {
|
|
315
315
|
T(n) && n.tag && (t[n.tag] = !0);
|
|
316
316
|
}), r = Object.keys(t);
|
|
317
317
|
} else r = [];
|
|
@@ -334,7 +334,7 @@ function oe(e) {
|
|
|
334
334
|
}
|
|
335
335
|
function se(e) {
|
|
336
336
|
let t = /* @__PURE__ */ new Set();
|
|
337
|
-
return
|
|
337
|
+
return A(e, { Value(e, n) {
|
|
338
338
|
n.anchor && t.add(n.anchor);
|
|
339
339
|
} }), t;
|
|
340
340
|
}
|
|
@@ -439,7 +439,7 @@ var ue = class {
|
|
|
439
439
|
resolve(e, t) {
|
|
440
440
|
if (t?.maxAliasCount === 0) throw ReferenceError("Alias resolution is disabled");
|
|
441
441
|
let n;
|
|
442
|
-
t?.aliasResolveCache ? n = t.aliasResolveCache : (n = [],
|
|
442
|
+
t?.aliasResolveCache ? n = t.aliasResolveCache : (n = [], A(e, { Node: (e, t) => {
|
|
443
443
|
(v(t) || E(t)) && n.push(t);
|
|
444
444
|
} }), t && (t.aliasResolveCache = n));
|
|
445
445
|
let r;
|
|
@@ -509,8 +509,8 @@ var pe = (e) => !e || typeof e != "function" && typeof e != "object", I = class
|
|
|
509
509
|
I.BLOCK_FOLDED = "BLOCK_FOLDED", I.BLOCK_LITERAL = "BLOCK_LITERAL", I.PLAIN = "PLAIN", I.QUOTE_DOUBLE = "QUOTE_DOUBLE", I.QUOTE_SINGLE = "QUOTE_SINGLE";
|
|
510
510
|
//#endregion
|
|
511
511
|
//#region node_modules/yaml/browser/dist/doc/createNode.js
|
|
512
|
-
var
|
|
513
|
-
function
|
|
512
|
+
var L = "tag:yaml.org,2002:";
|
|
513
|
+
function me(e, t, n) {
|
|
514
514
|
if (t) {
|
|
515
515
|
let e = n.filter((e) => e.tag === t), r = e.find((e) => !e.format) ?? e[0];
|
|
516
516
|
if (!r) throw Error(`Tag ${t} not found`);
|
|
@@ -518,7 +518,7 @@ function he(e, t, n) {
|
|
|
518
518
|
}
|
|
519
519
|
return n.find((t) => t.identify?.(e) && !t.format);
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function R(e, t, n) {
|
|
522
522
|
if (y(e) && (e = e.contents), T(e)) return e;
|
|
523
523
|
if (x(e)) {
|
|
524
524
|
let t = n.schema[p].createNode?.(n.schema, null, n);
|
|
@@ -533,8 +533,8 @@ function L(e, t, n) {
|
|
|
533
533
|
node: null
|
|
534
534
|
}, s.set(e, c);
|
|
535
535
|
}
|
|
536
|
-
t?.startsWith("!!") && (t =
|
|
537
|
-
let l =
|
|
536
|
+
t?.startsWith("!!") && (t = L + t.slice(2));
|
|
537
|
+
let l = me(e, t, o.tags);
|
|
538
538
|
if (!l) {
|
|
539
539
|
if (e && typeof e.toJSON == "function" && (e = e.toJSON()), !e || typeof e != "object") {
|
|
540
540
|
let t = new I(e);
|
|
@@ -548,7 +548,7 @@ function L(e, t, n) {
|
|
|
548
548
|
}
|
|
549
549
|
//#endregion
|
|
550
550
|
//#region node_modules/yaml/browser/dist/nodes/Collection.js
|
|
551
|
-
function
|
|
551
|
+
function z(e, t, n) {
|
|
552
552
|
let r = n;
|
|
553
553
|
for (let e = t.length - 1; e >= 0; --e) {
|
|
554
554
|
let n = t[e];
|
|
@@ -557,7 +557,7 @@ function R(e, t, n) {
|
|
|
557
557
|
e[n] = r, r = e;
|
|
558
558
|
} else r = /* @__PURE__ */ new Map([[n, r]]);
|
|
559
559
|
}
|
|
560
|
-
return
|
|
560
|
+
return R(r, void 0, {
|
|
561
561
|
aliasDuplicateObjects: !1,
|
|
562
562
|
keepUndefined: !1,
|
|
563
563
|
onAnchor: () => {
|
|
@@ -567,7 +567,7 @@ function R(e, t, n) {
|
|
|
567
567
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
568
568
|
});
|
|
569
569
|
}
|
|
570
|
-
var
|
|
570
|
+
var he = (e) => e == null || typeof e == "object" && !!e[Symbol.iterator]().next().done, ge = class extends ue {
|
|
571
571
|
constructor(e, t) {
|
|
572
572
|
super(e), Object.defineProperty(this, "schema", {
|
|
573
573
|
value: t,
|
|
@@ -581,11 +581,11 @@ var ge = (e) => e == null || typeof e == "object" && !!e[Symbol.iterator]().next
|
|
|
581
581
|
return e && (t.schema = e), t.items = t.items.map((t) => T(t) || x(t) ? t.clone(e) : t), this.range && (t.range = this.range.slice()), t;
|
|
582
582
|
}
|
|
583
583
|
addIn(e, t) {
|
|
584
|
-
if (
|
|
584
|
+
if (he(e)) this.add(t);
|
|
585
585
|
else {
|
|
586
586
|
let [n, ...r] = e, i = this.get(n, !0);
|
|
587
587
|
if (w(i)) i.addIn(r, t);
|
|
588
|
-
else if (i === void 0 && this.schema) this.set(n,
|
|
588
|
+
else if (i === void 0 && this.schema) this.set(n, z(this.schema, r, t));
|
|
589
589
|
else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);
|
|
590
590
|
}
|
|
591
591
|
}
|
|
@@ -619,16 +619,16 @@ var ge = (e) => e == null || typeof e == "object" && !!e[Symbol.iterator]().next
|
|
|
619
619
|
else {
|
|
620
620
|
let e = this.get(n, !0);
|
|
621
621
|
if (w(e)) e.setIn(r, t);
|
|
622
|
-
else if (e === void 0 && this.schema) this.set(n,
|
|
622
|
+
else if (e === void 0 && this.schema) this.set(n, z(this.schema, r, t));
|
|
623
623
|
else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
},
|
|
627
|
-
function
|
|
626
|
+
}, _e = (e) => e.replace(/^(?!$)(?: $)?/gm, "#");
|
|
627
|
+
function B(e, t) {
|
|
628
628
|
return /^\n+$/.test(e) ? e.substring(1) : t ? e.replace(/^(?! *$)/gm, t) : e;
|
|
629
629
|
}
|
|
630
|
-
var
|
|
631
|
-
function
|
|
630
|
+
var ve = (e, t, n) => e.endsWith("\n") ? B(n, t) : n.includes("\n") ? "\n" + B(n, t) : (e.endsWith(" ") ? "" : " ") + n, ye = "flow", be = "block", xe = "quoted";
|
|
631
|
+
function Se(e, t, n = "flow", { indentAtStart: r, lineWidth: i = 80, minContentWidth: a = 20, onFold: o, onOverflow: s } = {}) {
|
|
632
632
|
if (!i || i < 0) return e;
|
|
633
633
|
i < a && (a = 0);
|
|
634
634
|
let c = Math.max(1 + a, 1 + i - t.length);
|
|
@@ -636,7 +636,7 @@ function Ce(e, t, n = "flow", { indentAtStart: r, lineWidth: i = 80, minContentW
|
|
|
636
636
|
let l = [], u = {}, d = i - t.length;
|
|
637
637
|
typeof r == "number" && (r > i - Math.max(2, a) ? l.push(0) : d = i - r);
|
|
638
638
|
let f, p, m = !1, h = -1, g = -1, _ = -1;
|
|
639
|
-
n === "block" && (h =
|
|
639
|
+
n === "block" && (h = Ce(e, h, t.length), h !== -1 && (d = h + c));
|
|
640
640
|
for (let r; r = e[h += 1];) {
|
|
641
641
|
if (n === "quoted" && r === "\\") {
|
|
642
642
|
switch (g = h, e[h + 1]) {
|
|
@@ -653,7 +653,7 @@ function Ce(e, t, n = "flow", { indentAtStart: r, lineWidth: i = 80, minContentW
|
|
|
653
653
|
}
|
|
654
654
|
_ = h;
|
|
655
655
|
}
|
|
656
|
-
if (r === "\n") n === "block" && (h =
|
|
656
|
+
if (r === "\n") n === "block" && (h = Ce(e, h, t.length)), d = h + t.length + c, f = void 0;
|
|
657
657
|
else {
|
|
658
658
|
if (r === " " && p && p !== " " && p !== "\n" && p !== " ") {
|
|
659
659
|
let t = e[h + 1];
|
|
@@ -680,7 +680,7 @@ function Ce(e, t, n = "flow", { indentAtStart: r, lineWidth: i = 80, minContentW
|
|
|
680
680
|
}
|
|
681
681
|
return v;
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function Ce(e, t, n) {
|
|
684
684
|
let r = t, i = t + 1, a = e[i];
|
|
685
685
|
for (; a === " " || a === " ";) if (t < i + n) a = e[++t];
|
|
686
686
|
else {
|
|
@@ -693,12 +693,12 @@ function we(e, t, n) {
|
|
|
693
693
|
}
|
|
694
694
|
//#endregion
|
|
695
695
|
//#region node_modules/yaml/browser/dist/stringify/stringifyString.js
|
|
696
|
-
var
|
|
696
|
+
var we = (e, t) => ({
|
|
697
697
|
indentAtStart: t ? e.indent.length : e.indentAtStart,
|
|
698
698
|
lineWidth: e.options.lineWidth,
|
|
699
699
|
minContentWidth: e.options.minContentWidth
|
|
700
|
-
}),
|
|
701
|
-
function
|
|
700
|
+
}), Te = (e) => /^(%|---|\.\.\.)/m.test(e);
|
|
701
|
+
function Ee(e, t, n) {
|
|
702
702
|
if (!t || t < 0) return !1;
|
|
703
703
|
let r = t - n, i = e.length;
|
|
704
704
|
if (i <= r) return !1;
|
|
@@ -708,10 +708,10 @@ function De(e, t, n) {
|
|
|
708
708
|
}
|
|
709
709
|
return !0;
|
|
710
710
|
}
|
|
711
|
-
function
|
|
711
|
+
function De(e, t) {
|
|
712
712
|
let n = JSON.stringify(e);
|
|
713
713
|
if (t.options.doubleQuotedAsJSON) return n;
|
|
714
|
-
let { implicitKey: r } = t, i = t.options.doubleQuotedMinMultiLineLength, a = t.indent || (
|
|
714
|
+
let { implicitKey: r } = t, i = t.options.doubleQuotedMinMultiLineLength, a = t.indent || (Te(e) ? " " : ""), o = "", s = 0;
|
|
715
715
|
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]) {
|
|
716
716
|
case "u":
|
|
717
717
|
{
|
|
@@ -756,32 +756,32 @@ function Oe(e, t) {
|
|
|
756
756
|
break;
|
|
757
757
|
default: e += 1;
|
|
758
758
|
}
|
|
759
|
-
return o = s ? o + n.slice(s) : n, r ? o :
|
|
759
|
+
return o = s ? o + n.slice(s) : n, r ? o : Se(o, a, xe, we(t, !1));
|
|
760
760
|
}
|
|
761
|
-
function
|
|
762
|
-
if (t.options.singleQuote === !1 || t.implicitKey && e.includes("\n") || /[ \t]\n|\n[ \t]/.test(e)) return
|
|
763
|
-
let n = t.indent || (
|
|
764
|
-
return t.implicitKey ? r :
|
|
761
|
+
function Oe(e, t) {
|
|
762
|
+
if (t.options.singleQuote === !1 || t.implicitKey && e.includes("\n") || /[ \t]\n|\n[ \t]/.test(e)) return De(e, t);
|
|
763
|
+
let n = t.indent || (Te(e) ? " " : ""), r = "'" + e.replace(/'/g, "''").replace(/\n+/g, `$&\n${n}`) + "'";
|
|
764
|
+
return t.implicitKey ? r : Se(r, n, ye, we(t, !1));
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function ke(e, t) {
|
|
767
767
|
let { singleQuote: n } = t.options, r;
|
|
768
|
-
if (n === !1) r =
|
|
768
|
+
if (n === !1) r = De;
|
|
769
769
|
else {
|
|
770
770
|
let t = e.includes("\""), i = e.includes("'");
|
|
771
|
-
r = t && !i ?
|
|
771
|
+
r = t && !i ? Oe : i && !t ? De : n ? Oe : De;
|
|
772
772
|
}
|
|
773
773
|
return r(e, t);
|
|
774
774
|
}
|
|
775
|
-
var
|
|
775
|
+
var Ae;
|
|
776
776
|
try {
|
|
777
|
-
|
|
777
|
+
Ae = /* @__PURE__ */ RegExp("(^|(?<!\n))\n+(?!\n|$)", "g");
|
|
778
778
|
} catch {
|
|
779
|
-
|
|
779
|
+
Ae = /\n+(?!\n|$)/g;
|
|
780
780
|
}
|
|
781
|
-
function
|
|
781
|
+
function je({ comment: e, type: t, value: n }, r, i, a) {
|
|
782
782
|
let { blockQuote: o, commentString: s, lineWidth: c } = r.options;
|
|
783
|
-
if (!o || /\n[\t ]+$/.test(n)) return
|
|
784
|
-
let l = r.indent || (r.forceBlockIndent ||
|
|
783
|
+
if (!o || /\n[\t ]+$/.test(n)) return ke(n, r);
|
|
784
|
+
let l = r.indent || (r.forceBlockIndent || Te(n) ? " " : ""), u = o === "literal" ? !0 : o === "folded" || t === I.BLOCK_FOLDED ? !1 : t === I.BLOCK_LITERAL || !Ee(n, c, l.length);
|
|
785
785
|
if (!n) return u ? "|\n" : ">\n";
|
|
786
786
|
let d, f;
|
|
787
787
|
for (f = n.length; f > 0; --f) {
|
|
@@ -789,7 +789,7 @@ function Me({ comment: e, type: t, value: n }, r, i, a) {
|
|
|
789
789
|
if (e !== "\n" && e !== " " && e !== " ") break;
|
|
790
790
|
}
|
|
791
791
|
let p = n.substring(f), m = p.indexOf("\n");
|
|
792
|
-
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(
|
|
792
|
+
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(Ae, `$&${l}`));
|
|
793
793
|
let h = !1, g, _ = -1;
|
|
794
794
|
for (g = 0; g < n.length; ++g) {
|
|
795
795
|
let e = n[g];
|
|
@@ -801,41 +801,41 @@ function Me({ comment: e, type: t, value: n }, r, i, a) {
|
|
|
801
801
|
v &&= (n = n.substring(v.length), v.replace(/\n+/g, `$&${l}`));
|
|
802
802
|
let y = (h ? l ? "2" : "1" : "") + d;
|
|
803
803
|
if (e && (y += " " + s(e.replace(/ ?[\r\n]+/g, " ")), i && i()), !u) {
|
|
804
|
-
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 =
|
|
804
|
+
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 = we(r, !0);
|
|
805
805
|
o !== "folded" && t !== I.BLOCK_FOLDED && (a.onOverflow = () => {
|
|
806
806
|
i = !0;
|
|
807
807
|
});
|
|
808
|
-
let s =
|
|
808
|
+
let s = Se(`${v}${e}${p}`, l, be, a);
|
|
809
809
|
if (!i) return `>${y}\n${l}${s}`;
|
|
810
810
|
}
|
|
811
811
|
return n = n.replace(/\n+/g, `$&${l}`), `|${y}\n${l}${v}${n}${p}`;
|
|
812
812
|
}
|
|
813
|
-
function
|
|
813
|
+
function Me(e, t, n, r) {
|
|
814
814
|
let { type: i, value: a } = e, { actualString: o, implicitKey: s, indent: c, indentStep: l, inFlow: u } = t;
|
|
815
|
-
if (s && a.includes("\n") || u && /[[\]{},]/.test(a)) return
|
|
816
|
-
if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a)) return s || u || !a.includes("\n") ?
|
|
817
|
-
if (!s && !u && i !== I.PLAIN && a.includes("\n")) return
|
|
818
|
-
if (
|
|
819
|
-
if (c === "") return t.forceBlockIndent = !0,
|
|
820
|
-
if (s && c === l) return
|
|
815
|
+
if (s && a.includes("\n") || u && /[[\]{},]/.test(a)) return ke(a, t);
|
|
816
|
+
if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a)) return s || u || !a.includes("\n") ? ke(a, t) : je(e, t, n, r);
|
|
817
|
+
if (!s && !u && i !== I.PLAIN && a.includes("\n")) return je(e, t, n, r);
|
|
818
|
+
if (Te(a)) {
|
|
819
|
+
if (c === "") return t.forceBlockIndent = !0, je(e, t, n, r);
|
|
820
|
+
if (s && c === l) return ke(a, t);
|
|
821
821
|
}
|
|
822
822
|
let d = a.replace(/\n+/g, `$&\n${c}`);
|
|
823
823
|
if (o) {
|
|
824
824
|
let e = (e) => e.default && e.tag !== "tag:yaml.org,2002:str" && e.test?.test(d), { compat: n, tags: r } = t.doc.schema;
|
|
825
|
-
if (r.some(e) || n?.some(e)) return
|
|
825
|
+
if (r.some(e) || n?.some(e)) return ke(a, t);
|
|
826
826
|
}
|
|
827
|
-
return s ? d :
|
|
827
|
+
return s ? d : Se(d, c, ye, we(t, !1));
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function Ne(e, t, n, r) {
|
|
830
830
|
let { implicitKey: i, inFlow: a } = t, o = typeof e.value == "string" ? e : Object.assign({}, e, { value: String(e.value) }), { type: s } = e;
|
|
831
831
|
s !== I.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value) && (s = I.QUOTE_DOUBLE);
|
|
832
832
|
let c = (e) => {
|
|
833
833
|
switch (e) {
|
|
834
834
|
case I.BLOCK_FOLDED:
|
|
835
|
-
case I.BLOCK_LITERAL: return i || a ?
|
|
836
|
-
case I.QUOTE_DOUBLE: return
|
|
837
|
-
case I.QUOTE_SINGLE: return
|
|
838
|
-
case I.PLAIN: return
|
|
835
|
+
case I.BLOCK_LITERAL: return i || a ? ke(o.value, t) : je(o, t, n, r);
|
|
836
|
+
case I.QUOTE_DOUBLE: return De(o.value, t);
|
|
837
|
+
case I.QUOTE_SINGLE: return Oe(o.value, t);
|
|
838
|
+
case I.PLAIN: return Me(o, t, n, r);
|
|
839
839
|
default: return null;
|
|
840
840
|
}
|
|
841
841
|
}, l = c(s);
|
|
@@ -847,10 +847,10 @@ function Pe(e, t, n, r) {
|
|
|
847
847
|
}
|
|
848
848
|
//#endregion
|
|
849
849
|
//#region node_modules/yaml/browser/dist/stringify/stringify.js
|
|
850
|
-
function
|
|
850
|
+
function Pe(e, t) {
|
|
851
851
|
let n = Object.assign({
|
|
852
852
|
blockQuote: !0,
|
|
853
|
-
commentString:
|
|
853
|
+
commentString: _e,
|
|
854
854
|
defaultKeyType: null,
|
|
855
855
|
defaultStringType: "PLAIN",
|
|
856
856
|
directives: null,
|
|
@@ -887,7 +887,7 @@ function Fe(e, t) {
|
|
|
887
887
|
options: n
|
|
888
888
|
};
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function Fe(e, t) {
|
|
891
891
|
if (t.tag) {
|
|
892
892
|
let n = e.filter((e) => e.tag === t.tag);
|
|
893
893
|
if (n.length > 0) return n.find((e) => e.format === t.format) ?? n[0];
|
|
@@ -908,14 +908,14 @@ function Ie(e, t) {
|
|
|
908
908
|
}
|
|
909
909
|
return n;
|
|
910
910
|
}
|
|
911
|
-
function
|
|
911
|
+
function Ie(e, t, { anchors: n, doc: r }) {
|
|
912
912
|
if (!r.directives) return "";
|
|
913
913
|
let i = [], a = (S(e) || w(e)) && e.anchor;
|
|
914
914
|
a && oe(a) && (n.add(a), i.push(`&${a}`));
|
|
915
915
|
let o = e.tag ?? (t.default ? null : t.tag);
|
|
916
916
|
return o && i.push(r.directives.tagString(o)), i.join(" ");
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function Le(e, t, n, r) {
|
|
919
919
|
if (x(e)) return e.toString(t, n, r);
|
|
920
920
|
if (v(e)) {
|
|
921
921
|
if (t.doc.directives) return e.toString(t);
|
|
@@ -923,15 +923,15 @@ function Re(e, t, n, r) {
|
|
|
923
923
|
t.resolvedAliases ? t.resolvedAliases.add(e) : t.resolvedAliases = /* @__PURE__ */ new Set([e]), e = e.resolve(t.doc);
|
|
924
924
|
}
|
|
925
925
|
let i, a = T(e) ? e : t.doc.createNode(e, { onTagObj: (e) => i = e });
|
|
926
|
-
i ??=
|
|
927
|
-
let o =
|
|
926
|
+
i ??= Fe(t.doc.schema.tags, a);
|
|
927
|
+
let o = Ie(a, i, t);
|
|
928
928
|
o.length > 0 && (t.indentAtStart = (t.indentAtStart ?? 0) + o.length + 1);
|
|
929
|
-
let s = typeof i.stringify == "function" ? i.stringify(a, t, n, r) : S(a) ?
|
|
929
|
+
let s = typeof i.stringify == "function" ? i.stringify(a, t, n, r) : S(a) ? Ne(a, t, n, r) : a.toString(t, n, r);
|
|
930
930
|
return o ? S(a) || s[0] === "{" || s[0] === "[" ? `${o} ${s}` : `${o}\n${t.indent}${s}` : s;
|
|
931
931
|
}
|
|
932
932
|
//#endregion
|
|
933
933
|
//#region node_modules/yaml/browser/dist/stringify/stringifyPair.js
|
|
934
|
-
function
|
|
934
|
+
function Re({ key: e, value: t }, n, r, i) {
|
|
935
935
|
let { allNullValues: a, doc: o, indent: s, indentStep: c, options: { commentString: l, indentSeq: u, simpleKeys: d } } = n, f = T(e) && e.comment || null;
|
|
936
936
|
if (d) {
|
|
937
937
|
if (f) throw Error("With simple keys, key nodes cannot have comments");
|
|
@@ -943,22 +943,22 @@ function ze({ key: e, value: t }, n, r, i) {
|
|
|
943
943
|
implicitKey: !p && (d || !a),
|
|
944
944
|
indent: s + c
|
|
945
945
|
});
|
|
946
|
-
let m = !1, h = !1, g =
|
|
946
|
+
let m = !1, h = !1, g = Le(e, n, () => m = !0, () => h = !0);
|
|
947
947
|
if (!p && !n.inFlow && g.length > 1024) {
|
|
948
948
|
if (d) throw Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
949
949
|
p = !0;
|
|
950
950
|
}
|
|
951
951
|
if (n.inFlow) {
|
|
952
952
|
if (a || t == null) return m && r && r(), g === "" ? "?" : p ? `? ${g}` : g;
|
|
953
|
-
} else if (a && !d || t == null && p) return g = `? ${g}`, f && !m ? g +=
|
|
954
|
-
m && (f = null), p ? (f && (g +=
|
|
953
|
+
} else if (a && !d || t == null && p) return g = `? ${g}`, f && !m ? g += ve(g, n.indent, l(f)) : h && i && i(), g;
|
|
954
|
+
m && (f = null), p ? (f && (g += ve(g, n.indent, l(f))), g = `? ${g}\n${s}:`) : (g = `${g}:`, f && (g += ve(g, n.indent, l(f))));
|
|
955
955
|
let _, v, y;
|
|
956
956
|
T(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 && S(t) && (n.indentAtStart = g.length + 1), h = !1, !u && c.length >= 2 && !n.inFlow && !p && C(t) && !t.flow && !t.tag && !t.anchor && (n.indent = n.indent.substring(2));
|
|
957
|
-
let b = !1, x =
|
|
957
|
+
let b = !1, x = Le(t, n, () => b = !0, () => h = !0), E = " ";
|
|
958
958
|
if (f || _ || v) {
|
|
959
959
|
if (E = _ ? "\n" : "", v) {
|
|
960
960
|
let e = l(v);
|
|
961
|
-
E += `\n${
|
|
961
|
+
E += `\n${B(e, n.indent)}`;
|
|
962
962
|
}
|
|
963
963
|
x === "" && !n.inFlow ? E === "\n" && y && (E = "\n\n") : E += `\n${n.indent}`;
|
|
964
964
|
} else if (!p && w(t)) {
|
|
@@ -972,31 +972,31 @@ function ze({ key: e, value: t }, n, r, i) {
|
|
|
972
972
|
t || (E = `\n${n.indent}`);
|
|
973
973
|
}
|
|
974
974
|
} else (x === "" || x[0] === "\n") && (E = "");
|
|
975
|
-
return g += E + x, n.inFlow ? b && r && r() : y && !b ? g +=
|
|
975
|
+
return g += E + x, n.inFlow ? b && r && r() : y && !b ? g += ve(g, n.indent, l(y)) : h && i && i(), g;
|
|
976
976
|
}
|
|
977
977
|
//#endregion
|
|
978
978
|
//#region node_modules/yaml/browser/dist/log.js
|
|
979
|
-
function
|
|
979
|
+
function ze(e, t) {
|
|
980
980
|
(e === "debug" || e === "warn") && console.warn(t);
|
|
981
981
|
}
|
|
982
982
|
//#endregion
|
|
983
983
|
//#region node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js
|
|
984
|
-
var
|
|
985
|
-
identify: (e) => e ===
|
|
984
|
+
var Be = "<<", V = {
|
|
985
|
+
identify: (e) => e === Be || typeof e == "symbol" && e.description === Be,
|
|
986
986
|
default: "key",
|
|
987
987
|
tag: "tag:yaml.org,2002:merge",
|
|
988
988
|
test: /^<<$/,
|
|
989
|
-
resolve: () => Object.assign(new I(Symbol(
|
|
990
|
-
stringify: () =>
|
|
991
|
-
},
|
|
992
|
-
function
|
|
993
|
-
let r =
|
|
994
|
-
if (C(r)) for (let n of r.items)
|
|
995
|
-
else if (Array.isArray(r)) for (let n of r)
|
|
996
|
-
else
|
|
989
|
+
resolve: () => Object.assign(new I(Symbol(Be)), { addToJSMap: He }),
|
|
990
|
+
stringify: () => Be
|
|
991
|
+
}, Ve = (e, t) => (V.identify(t) || S(t) && (!t.type || t.type === I.PLAIN) && V.identify(t.value)) && e?.doc.schema.tags.some((e) => e.tag === V.tag && e.default);
|
|
992
|
+
function He(e, t, n) {
|
|
993
|
+
let r = We(e, n);
|
|
994
|
+
if (C(r)) for (let n of r.items) Ue(e, t, n);
|
|
995
|
+
else if (Array.isArray(r)) for (let n of r) Ue(e, t, n);
|
|
996
|
+
else Ue(e, t, r);
|
|
997
997
|
}
|
|
998
|
-
function
|
|
999
|
-
let r =
|
|
998
|
+
function Ue(e, t, n) {
|
|
999
|
+
let r = We(e, n);
|
|
1000
1000
|
if (!b(r)) throw Error("Merge sources must be maps or map aliases");
|
|
1001
1001
|
let i = r.toJSON(null, e, Map);
|
|
1002
1002
|
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, {
|
|
@@ -1007,20 +1007,20 @@ function We(e, t, n) {
|
|
|
1007
1007
|
});
|
|
1008
1008
|
return t;
|
|
1009
1009
|
}
|
|
1010
|
-
function
|
|
1010
|
+
function We(e, t) {
|
|
1011
1011
|
return e && v(t) ? t.resolve(e.doc, e) : t;
|
|
1012
1012
|
}
|
|
1013
1013
|
//#endregion
|
|
1014
1014
|
//#region node_modules/yaml/browser/dist/nodes/addPairToJSMap.js
|
|
1015
|
-
function
|
|
1015
|
+
function Ge(e, t, { key: n, value: r }) {
|
|
1016
1016
|
if (T(n) && n.addToJSMap) n.addToJSMap(e, t, r);
|
|
1017
|
-
else if (
|
|
1017
|
+
else if (Ve(e, n)) He(e, t, r);
|
|
1018
1018
|
else {
|
|
1019
1019
|
let i = F(n, "", e);
|
|
1020
1020
|
if (t instanceof Map) t.set(i, F(r, i, e));
|
|
1021
1021
|
else if (t instanceof Set) t.add(i);
|
|
1022
1022
|
else {
|
|
1023
|
-
let a =
|
|
1023
|
+
let a = Ke(n, i, e), o = F(r, a, e);
|
|
1024
1024
|
a in t ? Object.defineProperty(t, a, {
|
|
1025
1025
|
value: o,
|
|
1026
1026
|
writable: !0,
|
|
@@ -1031,18 +1031,18 @@ function Ke(e, t, { key: n, value: r }) {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
return t;
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1034
|
+
function Ke(e, t, n) {
|
|
1035
1035
|
if (t === null) return "";
|
|
1036
1036
|
if (typeof t != "object") return String(t);
|
|
1037
1037
|
if (T(e) && n?.doc) {
|
|
1038
|
-
let t =
|
|
1038
|
+
let t = Pe(n.doc, {});
|
|
1039
1039
|
t.anchors = /* @__PURE__ */ new Set();
|
|
1040
1040
|
for (let e of n.anchors.keys()) t.anchors.add(e.anchor);
|
|
1041
1041
|
t.inFlow = !0, t.inStringifyKey = !0;
|
|
1042
1042
|
let r = e.toString(t);
|
|
1043
1043
|
if (!n.mapKeyWarned) {
|
|
1044
1044
|
let e = JSON.stringify(r);
|
|
1045
|
-
e.length > 40 && (e = e.substring(0, 36) + "...\""),
|
|
1045
|
+
e.length > 40 && (e = e.substring(0, 36) + "...\""), ze(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;
|
|
1046
1046
|
}
|
|
1047
1047
|
return r;
|
|
1048
1048
|
}
|
|
@@ -1050,10 +1050,10 @@ function qe(e, t, n) {
|
|
|
1050
1050
|
}
|
|
1051
1051
|
//#endregion
|
|
1052
1052
|
//#region node_modules/yaml/browser/dist/nodes/Pair.js
|
|
1053
|
-
function
|
|
1054
|
-
return new
|
|
1053
|
+
function qe(e, t, n) {
|
|
1054
|
+
return new H(R(e, void 0, n), R(t, void 0, n));
|
|
1055
1055
|
}
|
|
1056
|
-
var
|
|
1056
|
+
var H = class e {
|
|
1057
1057
|
constructor(e, t = null) {
|
|
1058
1058
|
Object.defineProperty(this, _, { value: m }), this.key = e, this.value = t;
|
|
1059
1059
|
}
|
|
@@ -1062,32 +1062,32 @@ var V = class e {
|
|
|
1062
1062
|
return T(n) && (n = n.clone(t)), T(r) && (r = r.clone(t)), new e(n, r);
|
|
1063
1063
|
}
|
|
1064
1064
|
toJSON(e, t) {
|
|
1065
|
-
return
|
|
1065
|
+
return Ge(t, t?.mapAsMap ? /* @__PURE__ */ new Map() : {}, this);
|
|
1066
1066
|
}
|
|
1067
1067
|
toString(e, t, n) {
|
|
1068
|
-
return e?.doc ?
|
|
1068
|
+
return e?.doc ? Re(this, e, t, n) : JSON.stringify(this);
|
|
1069
1069
|
}
|
|
1070
1070
|
};
|
|
1071
1071
|
//#endregion
|
|
1072
1072
|
//#region node_modules/yaml/browser/dist/stringify/stringifyCollection.js
|
|
1073
|
-
function
|
|
1074
|
-
return (t.inFlow ?? e.flow ?
|
|
1073
|
+
function Je(e, t, n) {
|
|
1074
|
+
return (t.inFlow ?? e.flow ? Xe : Ye)(e, t, n);
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1076
|
+
function Ye({ comment: e, items: t }, n, { blockItemPrefix: r, flowChars: i, itemIndent: a, onChompKeep: o, onComment: s }) {
|
|
1077
1077
|
let { indent: c, options: { commentString: l } } = n, u = Object.assign({}, n, {
|
|
1078
1078
|
indent: a,
|
|
1079
1079
|
type: null
|
|
1080
1080
|
}), d = !1, f = [];
|
|
1081
1081
|
for (let e = 0; e < t.length; ++e) {
|
|
1082
1082
|
let i = t[e], o = null;
|
|
1083
|
-
if (T(i)) !d && i.spaceBefore && f.push(""),
|
|
1083
|
+
if (T(i)) !d && i.spaceBefore && f.push(""), Ze(n, f, i.commentBefore, d), i.comment && (o = i.comment);
|
|
1084
1084
|
else if (x(i)) {
|
|
1085
1085
|
let e = T(i.key) ? i.key : null;
|
|
1086
|
-
e && (!d && e.spaceBefore && f.push(""),
|
|
1086
|
+
e && (!d && e.spaceBefore && f.push(""), Ze(n, f, e.commentBefore, d));
|
|
1087
1087
|
}
|
|
1088
1088
|
d = !1;
|
|
1089
|
-
let s =
|
|
1090
|
-
o && (s +=
|
|
1089
|
+
let s = Le(i, u, () => o = null, () => d = !0);
|
|
1090
|
+
o && (s += ve(s, a, l(o))), d && o && (d = !1), f.push(r + s);
|
|
1091
1091
|
}
|
|
1092
1092
|
let p;
|
|
1093
1093
|
if (f.length === 0) p = i.start + i.end;
|
|
@@ -1098,9 +1098,9 @@ function Xe({ comment: e, items: t }, n, { blockItemPrefix: r, flowChars: i, ite
|
|
|
1098
1098
|
p += t ? `\n${c}${t}` : "\n";
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
|
-
return e ? (p += "\n" +
|
|
1101
|
+
return e ? (p += "\n" + B(l(e), c), s && s()) : d && o && o(), p;
|
|
1102
1102
|
}
|
|
1103
|
-
function
|
|
1103
|
+
function Xe({ items: e }, t, { flowChars: n, itemIndent: r }) {
|
|
1104
1104
|
let { indent: i, indentStep: a, flowCollectionPadding: o, options: { commentString: s } } = t;
|
|
1105
1105
|
r += a;
|
|
1106
1106
|
let c = Object.assign({}, t, {
|
|
@@ -1110,16 +1110,16 @@ function Ze({ items: e }, t, { flowChars: n, itemIndent: r }) {
|
|
|
1110
1110
|
}), l = !1, u = 0, d = [];
|
|
1111
1111
|
for (let n = 0; n < e.length; ++n) {
|
|
1112
1112
|
let i = e[n], a = null;
|
|
1113
|
-
if (T(i)) i.spaceBefore && d.push(""),
|
|
1113
|
+
if (T(i)) i.spaceBefore && d.push(""), Ze(t, d, i.commentBefore, !1), i.comment && (a = i.comment);
|
|
1114
1114
|
else if (x(i)) {
|
|
1115
1115
|
let e = T(i.key) ? i.key : null;
|
|
1116
|
-
e && (e.spaceBefore && d.push(""),
|
|
1116
|
+
e && (e.spaceBefore && d.push(""), Ze(t, d, e.commentBefore, !1), e.comment && (l = !0));
|
|
1117
1117
|
let n = T(i.value) ? i.value : null;
|
|
1118
1118
|
n ? (n.comment && (a = n.comment), n.commentBefore && (l = !0)) : i.value == null && e?.comment && (a = e.comment);
|
|
1119
1119
|
}
|
|
1120
1120
|
a && (l = !0);
|
|
1121
|
-
let o =
|
|
1122
|
-
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 +=
|
|
1121
|
+
let o = Le(i, c, () => a = null);
|
|
1122
|
+
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 += ve(o, r, s(a))), d.push(o), u = d.length;
|
|
1123
1123
|
}
|
|
1124
1124
|
let { start: f, end: p } = n;
|
|
1125
1125
|
if (d.length === 0) return f + p;
|
|
@@ -1134,19 +1134,19 @@ function Ze({ items: e }, t, { flowChars: n, itemIndent: r }) {
|
|
|
1134
1134
|
}
|
|
1135
1135
|
return `${f}${o}${d.join(" ")}${o}${p}`;
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1137
|
+
function Ze({ indent: e, options: { commentString: t } }, n, r, i) {
|
|
1138
1138
|
if (r && i && (r = r.replace(/^\n+/, "")), r) {
|
|
1139
|
-
let i =
|
|
1139
|
+
let i = B(t(r), e);
|
|
1140
1140
|
n.push(i.trimStart());
|
|
1141
1141
|
}
|
|
1142
1142
|
}
|
|
1143
1143
|
//#endregion
|
|
1144
1144
|
//#region node_modules/yaml/browser/dist/nodes/YAMLMap.js
|
|
1145
|
-
function
|
|
1145
|
+
function Qe(e, t) {
|
|
1146
1146
|
let n = S(t) ? t.value : t;
|
|
1147
1147
|
for (let r of e) if (x(r) && (r.key === t || r.key === n || S(r.key) && r.key.value === n)) return r;
|
|
1148
1148
|
}
|
|
1149
|
-
var
|
|
1149
|
+
var U = class extends ge {
|
|
1150
1150
|
static get tagName() {
|
|
1151
1151
|
return "tag:yaml.org,2002:map";
|
|
1152
1152
|
}
|
|
@@ -1157,7 +1157,7 @@ var H = class extends _e {
|
|
|
1157
1157
|
let { keepUndefined: r, replacer: i } = n, a = new this(e), o = (e, o) => {
|
|
1158
1158
|
if (typeof i == "function") o = i.call(t, e, o);
|
|
1159
1159
|
else if (Array.isArray(i) && !i.includes(e)) return;
|
|
1160
|
-
(o !== void 0 || r) && a.items.push(
|
|
1160
|
+
(o !== void 0 || r) && a.items.push(qe(e, o, n));
|
|
1161
1161
|
};
|
|
1162
1162
|
if (t instanceof Map) for (let [e, n] of t) o(e, n);
|
|
1163
1163
|
else if (t && typeof t == "object") for (let e of Object.keys(t)) o(e, t[e]);
|
|
@@ -1165,8 +1165,8 @@ var H = class extends _e {
|
|
|
1165
1165
|
}
|
|
1166
1166
|
add(e, t) {
|
|
1167
1167
|
let n;
|
|
1168
|
-
n = x(e) ? e : !e || typeof e != "object" || !("key" in e) ? new
|
|
1169
|
-
let r =
|
|
1168
|
+
n = x(e) ? e : !e || typeof e != "object" || !("key" in e) ? new H(e, e?.value) : new H(e.key, e.value);
|
|
1169
|
+
let r = Qe(this.items, n.key), i = this.schema?.sortMapEntries;
|
|
1170
1170
|
if (r) {
|
|
1171
1171
|
if (!t) throw Error(`Key ${n.key} already set`);
|
|
1172
1172
|
S(r.value) && pe(n.value) ? r.value.value = n.value : r.value = n.value;
|
|
@@ -1176,29 +1176,29 @@ var H = class extends _e {
|
|
|
1176
1176
|
} else this.items.push(n);
|
|
1177
1177
|
}
|
|
1178
1178
|
delete(e) {
|
|
1179
|
-
let t =
|
|
1179
|
+
let t = Qe(this.items, e);
|
|
1180
1180
|
return t ? this.items.splice(this.items.indexOf(t), 1).length > 0 : !1;
|
|
1181
1181
|
}
|
|
1182
1182
|
get(e, t) {
|
|
1183
|
-
let n =
|
|
1183
|
+
let n = Qe(this.items, e)?.value;
|
|
1184
1184
|
return (!t && S(n) ? n.value : n) ?? void 0;
|
|
1185
1185
|
}
|
|
1186
1186
|
has(e) {
|
|
1187
|
-
return
|
|
1187
|
+
return !!Qe(this.items, e);
|
|
1188
1188
|
}
|
|
1189
1189
|
set(e, t) {
|
|
1190
|
-
this.add(new
|
|
1190
|
+
this.add(new H(e, t), !0);
|
|
1191
1191
|
}
|
|
1192
1192
|
toJSON(e, t, n) {
|
|
1193
1193
|
let r = n ? new n() : t?.mapAsMap ? /* @__PURE__ */ new Map() : {};
|
|
1194
1194
|
t?.onCreate && t.onCreate(r);
|
|
1195
|
-
for (let e of this.items)
|
|
1195
|
+
for (let e of this.items) Ge(t, r, e);
|
|
1196
1196
|
return r;
|
|
1197
1197
|
}
|
|
1198
1198
|
toString(e, t, n) {
|
|
1199
1199
|
if (!e) return JSON.stringify(this);
|
|
1200
1200
|
for (let e of this.items) if (!x(e)) throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);
|
|
1201
|
-
return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })),
|
|
1201
|
+
return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), Je(this, e, {
|
|
1202
1202
|
blockItemPrefix: "",
|
|
1203
1203
|
flowChars: {
|
|
1204
1204
|
start: "{",
|
|
@@ -1209,16 +1209,16 @@ var H = class extends _e {
|
|
|
1209
1209
|
onComment: t
|
|
1210
1210
|
});
|
|
1211
1211
|
}
|
|
1212
|
-
},
|
|
1212
|
+
}, $e = {
|
|
1213
1213
|
collection: "map",
|
|
1214
1214
|
default: !0,
|
|
1215
|
-
nodeClass:
|
|
1215
|
+
nodeClass: U,
|
|
1216
1216
|
tag: "tag:yaml.org,2002:map",
|
|
1217
1217
|
resolve(e, t) {
|
|
1218
1218
|
return b(e) || t("Expected a mapping for this tag"), e;
|
|
1219
1219
|
},
|
|
1220
|
-
createNode: (e, t, n) =>
|
|
1221
|
-
},
|
|
1220
|
+
createNode: (e, t, n) => U.from(e, t, n)
|
|
1221
|
+
}, W = class extends ge {
|
|
1222
1222
|
static get tagName() {
|
|
1223
1223
|
return "tag:yaml.org,2002:seq";
|
|
1224
1224
|
}
|
|
@@ -1229,21 +1229,21 @@ var H = class extends _e {
|
|
|
1229
1229
|
this.items.push(e);
|
|
1230
1230
|
}
|
|
1231
1231
|
delete(e) {
|
|
1232
|
-
let t =
|
|
1232
|
+
let t = et(e);
|
|
1233
1233
|
return typeof t == "number" && this.items.splice(t, 1).length > 0;
|
|
1234
1234
|
}
|
|
1235
1235
|
get(e, t) {
|
|
1236
|
-
let n =
|
|
1236
|
+
let n = et(e);
|
|
1237
1237
|
if (typeof n != "number") return;
|
|
1238
1238
|
let r = this.items[n];
|
|
1239
1239
|
return !t && S(r) ? r.value : r;
|
|
1240
1240
|
}
|
|
1241
1241
|
has(e) {
|
|
1242
|
-
let t =
|
|
1242
|
+
let t = et(e);
|
|
1243
1243
|
return typeof t == "number" && t < this.items.length;
|
|
1244
1244
|
}
|
|
1245
1245
|
set(e, t) {
|
|
1246
|
-
let n =
|
|
1246
|
+
let n = et(e);
|
|
1247
1247
|
if (typeof n != "number") throw Error(`Expected a valid index, not ${e}.`);
|
|
1248
1248
|
let r = this.items[n];
|
|
1249
1249
|
S(r) && pe(t) ? r.value = t : this.items[n] = t;
|
|
@@ -1256,7 +1256,7 @@ var H = class extends _e {
|
|
|
1256
1256
|
return n;
|
|
1257
1257
|
}
|
|
1258
1258
|
toString(e, t, n) {
|
|
1259
|
-
return e ?
|
|
1259
|
+
return e ? Je(this, e, {
|
|
1260
1260
|
blockItemPrefix: "- ",
|
|
1261
1261
|
flowChars: {
|
|
1262
1262
|
start: "[",
|
|
@@ -1276,56 +1276,56 @@ var H = class extends _e {
|
|
|
1276
1276
|
let n = t instanceof Set ? a : String(e++);
|
|
1277
1277
|
a = r.call(t, n, a);
|
|
1278
1278
|
}
|
|
1279
|
-
i.items.push(
|
|
1279
|
+
i.items.push(R(a, void 0, n));
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
1282
|
return i;
|
|
1283
1283
|
}
|
|
1284
1284
|
};
|
|
1285
|
-
function
|
|
1285
|
+
function et(e) {
|
|
1286
1286
|
let t = S(e) ? e.value : e;
|
|
1287
1287
|
return t && typeof t == "string" && (t = Number(t)), typeof t == "number" && Number.isInteger(t) && t >= 0 ? t : null;
|
|
1288
1288
|
}
|
|
1289
1289
|
//#endregion
|
|
1290
1290
|
//#region node_modules/yaml/browser/dist/schema/common/seq.js
|
|
1291
|
-
var
|
|
1291
|
+
var tt = {
|
|
1292
1292
|
collection: "seq",
|
|
1293
1293
|
default: !0,
|
|
1294
|
-
nodeClass:
|
|
1294
|
+
nodeClass: W,
|
|
1295
1295
|
tag: "tag:yaml.org,2002:seq",
|
|
1296
1296
|
resolve(e, t) {
|
|
1297
1297
|
return C(e) || t("Expected a sequence for this tag"), e;
|
|
1298
1298
|
},
|
|
1299
|
-
createNode: (e, t, n) =>
|
|
1300
|
-
},
|
|
1299
|
+
createNode: (e, t, n) => W.from(e, t, n)
|
|
1300
|
+
}, nt = {
|
|
1301
1301
|
identify: (e) => typeof e == "string",
|
|
1302
1302
|
default: !0,
|
|
1303
1303
|
tag: "tag:yaml.org,2002:str",
|
|
1304
1304
|
resolve: (e) => e,
|
|
1305
1305
|
stringify(e, t, n, r) {
|
|
1306
|
-
return t = Object.assign({ actualString: !0 }, t),
|
|
1306
|
+
return t = Object.assign({ actualString: !0 }, t), Ne(e, t, n, r);
|
|
1307
1307
|
}
|
|
1308
|
-
},
|
|
1308
|
+
}, rt = {
|
|
1309
1309
|
identify: (e) => e == null,
|
|
1310
1310
|
createNode: () => new I(null),
|
|
1311
1311
|
default: !0,
|
|
1312
1312
|
tag: "tag:yaml.org,2002:null",
|
|
1313
1313
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
|
1314
1314
|
resolve: () => new I(null),
|
|
1315
|
-
stringify: ({ source: e }, t) => typeof e == "string" &&
|
|
1316
|
-
},
|
|
1315
|
+
stringify: ({ source: e }, t) => typeof e == "string" && rt.test.test(e) ? e : t.options.nullStr
|
|
1316
|
+
}, it = {
|
|
1317
1317
|
identify: (e) => typeof e == "boolean",
|
|
1318
1318
|
default: !0,
|
|
1319
1319
|
tag: "tag:yaml.org,2002:bool",
|
|
1320
1320
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
|
1321
1321
|
resolve: (e) => new I(e[0] === "t" || e[0] === "T"),
|
|
1322
1322
|
stringify({ source: e, value: t }, n) {
|
|
1323
|
-
return e &&
|
|
1323
|
+
return e && it.test.test(e) && t === (e[0] === "t" || e[0] === "T") ? e : t ? n.options.trueStr : n.options.falseStr;
|
|
1324
1324
|
}
|
|
1325
1325
|
};
|
|
1326
1326
|
//#endregion
|
|
1327
1327
|
//#region node_modules/yaml/browser/dist/stringify/stringifyNumber.js
|
|
1328
|
-
function
|
|
1328
|
+
function G({ format: e, minFractionDigits: t, tag: n, value: r }) {
|
|
1329
1329
|
if (typeof r == "bigint") return String(r);
|
|
1330
1330
|
let i = typeof r == "number" ? r : Number(r);
|
|
1331
1331
|
if (!isFinite(i)) return isNaN(i) ? ".nan" : i < 0 ? "-.inf" : ".inf";
|
|
@@ -1340,14 +1340,14 @@ function W({ format: e, minFractionDigits: t, tag: n, value: r }) {
|
|
|
1340
1340
|
}
|
|
1341
1341
|
//#endregion
|
|
1342
1342
|
//#region node_modules/yaml/browser/dist/schema/core/float.js
|
|
1343
|
-
var
|
|
1343
|
+
var at = {
|
|
1344
1344
|
identify: (e) => typeof e == "number",
|
|
1345
1345
|
default: !0,
|
|
1346
1346
|
tag: "tag:yaml.org,2002:float",
|
|
1347
1347
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1348
1348
|
resolve: (e) => e.slice(-3).toLowerCase() === "nan" ? NaN : e[0] === "-" ? -Infinity : Infinity,
|
|
1349
|
-
stringify:
|
|
1350
|
-
},
|
|
1349
|
+
stringify: G
|
|
1350
|
+
}, ot = {
|
|
1351
1351
|
identify: (e) => typeof e == "number",
|
|
1352
1352
|
default: !0,
|
|
1353
1353
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1356,9 +1356,9 @@ var ot = {
|
|
|
1356
1356
|
resolve: (e) => parseFloat(e),
|
|
1357
1357
|
stringify(e) {
|
|
1358
1358
|
let t = Number(e.value);
|
|
1359
|
-
return isFinite(t) ? t.toExponential() :
|
|
1359
|
+
return isFinite(t) ? t.toExponential() : G(e);
|
|
1360
1360
|
}
|
|
1361
|
-
},
|
|
1361
|
+
}, st = {
|
|
1362
1362
|
identify: (e) => typeof e == "number",
|
|
1363
1363
|
default: !0,
|
|
1364
1364
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1367,60 +1367,60 @@ var ot = {
|
|
|
1367
1367
|
let t = new I(parseFloat(e)), n = e.indexOf(".");
|
|
1368
1368
|
return n !== -1 && e[e.length - 1] === "0" && (t.minFractionDigits = e.length - n - 1), t;
|
|
1369
1369
|
},
|
|
1370
|
-
stringify:
|
|
1371
|
-
},
|
|
1372
|
-
function
|
|
1370
|
+
stringify: G
|
|
1371
|
+
}, ct = (e) => typeof e == "bigint" || Number.isInteger(e), lt = (e, t, n, { intAsBigInt: r }) => r ? BigInt(e) : parseInt(e.substring(t), n);
|
|
1372
|
+
function ut(e, t, n) {
|
|
1373
1373
|
let { value: r } = e;
|
|
1374
|
-
return
|
|
1374
|
+
return ct(r) && r >= 0 ? n + r.toString(t) : G(e);
|
|
1375
1375
|
}
|
|
1376
|
-
var
|
|
1377
|
-
identify: (e) =>
|
|
1376
|
+
var dt = {
|
|
1377
|
+
identify: (e) => ct(e) && e >= 0,
|
|
1378
1378
|
default: !0,
|
|
1379
1379
|
tag: "tag:yaml.org,2002:int",
|
|
1380
1380
|
format: "OCT",
|
|
1381
1381
|
test: /^0o[0-7]+$/,
|
|
1382
|
-
resolve: (e, t, n) =>
|
|
1383
|
-
stringify: (e) =>
|
|
1384
|
-
},
|
|
1385
|
-
identify:
|
|
1382
|
+
resolve: (e, t, n) => lt(e, 2, 8, n),
|
|
1383
|
+
stringify: (e) => ut(e, 8, "0o")
|
|
1384
|
+
}, ft = {
|
|
1385
|
+
identify: ct,
|
|
1386
1386
|
default: !0,
|
|
1387
1387
|
tag: "tag:yaml.org,2002:int",
|
|
1388
1388
|
test: /^[-+]?[0-9]+$/,
|
|
1389
|
-
resolve: (e, t, n) =>
|
|
1390
|
-
stringify:
|
|
1391
|
-
},
|
|
1392
|
-
identify: (e) =>
|
|
1389
|
+
resolve: (e, t, n) => lt(e, 0, 10, n),
|
|
1390
|
+
stringify: G
|
|
1391
|
+
}, pt = {
|
|
1392
|
+
identify: (e) => ct(e) && e >= 0,
|
|
1393
1393
|
default: !0,
|
|
1394
1394
|
tag: "tag:yaml.org,2002:int",
|
|
1395
1395
|
format: "HEX",
|
|
1396
1396
|
test: /^0x[0-9a-fA-F]+$/,
|
|
1397
|
-
resolve: (e, t, n) =>
|
|
1398
|
-
stringify: (e) =>
|
|
1399
|
-
},
|
|
1400
|
-
|
|
1397
|
+
resolve: (e, t, n) => lt(e, 2, 16, n),
|
|
1398
|
+
stringify: (e) => ut(e, 16, "0x")
|
|
1399
|
+
}, mt = [
|
|
1400
|
+
$e,
|
|
1401
|
+
tt,
|
|
1401
1402
|
nt,
|
|
1402
1403
|
rt,
|
|
1403
1404
|
it,
|
|
1404
|
-
|
|
1405
|
+
dt,
|
|
1405
1406
|
ft,
|
|
1406
1407
|
pt,
|
|
1407
|
-
|
|
1408
|
+
at,
|
|
1408
1409
|
ot,
|
|
1409
|
-
st
|
|
1410
|
-
ct
|
|
1410
|
+
st
|
|
1411
1411
|
];
|
|
1412
1412
|
//#endregion
|
|
1413
1413
|
//#region node_modules/yaml/browser/dist/schema/json/schema.js
|
|
1414
|
-
function
|
|
1414
|
+
function ht(e) {
|
|
1415
1415
|
return typeof e == "bigint" || Number.isInteger(e);
|
|
1416
1416
|
}
|
|
1417
|
-
var
|
|
1417
|
+
var gt = ({ value: e }) => JSON.stringify(e), _t = [
|
|
1418
1418
|
{
|
|
1419
1419
|
identify: (e) => typeof e == "string",
|
|
1420
1420
|
default: !0,
|
|
1421
1421
|
tag: "tag:yaml.org,2002:str",
|
|
1422
1422
|
resolve: (e) => e,
|
|
1423
|
-
stringify:
|
|
1423
|
+
stringify: gt
|
|
1424
1424
|
},
|
|
1425
1425
|
{
|
|
1426
1426
|
identify: (e) => e == null,
|
|
@@ -1429,7 +1429,7 @@ var _t = ({ value: e }) => JSON.stringify(e), vt = [
|
|
|
1429
1429
|
tag: "tag:yaml.org,2002:null",
|
|
1430
1430
|
test: /^null$/,
|
|
1431
1431
|
resolve: () => null,
|
|
1432
|
-
stringify:
|
|
1432
|
+
stringify: gt
|
|
1433
1433
|
},
|
|
1434
1434
|
{
|
|
1435
1435
|
identify: (e) => typeof e == "boolean",
|
|
@@ -1437,15 +1437,15 @@ var _t = ({ value: e }) => JSON.stringify(e), vt = [
|
|
|
1437
1437
|
tag: "tag:yaml.org,2002:bool",
|
|
1438
1438
|
test: /^true$|^false$/,
|
|
1439
1439
|
resolve: (e) => e === "true",
|
|
1440
|
-
stringify:
|
|
1440
|
+
stringify: gt
|
|
1441
1441
|
},
|
|
1442
1442
|
{
|
|
1443
|
-
identify:
|
|
1443
|
+
identify: ht,
|
|
1444
1444
|
default: !0,
|
|
1445
1445
|
tag: "tag:yaml.org,2002:int",
|
|
1446
1446
|
test: /^-?(?:0|[1-9][0-9]*)$/,
|
|
1447
1447
|
resolve: (e, t, { intAsBigInt: n }) => n ? BigInt(e) : parseInt(e, 10),
|
|
1448
|
-
stringify: ({ value: e }) =>
|
|
1448
|
+
stringify: ({ value: e }) => ht(e) ? e.toString() : JSON.stringify(e)
|
|
1449
1449
|
},
|
|
1450
1450
|
{
|
|
1451
1451
|
identify: (e) => typeof e == "number",
|
|
@@ -1453,16 +1453,16 @@ var _t = ({ value: e }) => JSON.stringify(e), vt = [
|
|
|
1453
1453
|
tag: "tag:yaml.org,2002:float",
|
|
1454
1454
|
test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
|
|
1455
1455
|
resolve: (e) => parseFloat(e),
|
|
1456
|
-
stringify:
|
|
1456
|
+
stringify: gt
|
|
1457
1457
|
}
|
|
1458
|
-
],
|
|
1458
|
+
], vt = [$e, tt].concat(_t, {
|
|
1459
1459
|
default: !0,
|
|
1460
1460
|
tag: "",
|
|
1461
1461
|
test: /^/,
|
|
1462
1462
|
resolve(e, t) {
|
|
1463
1463
|
return t(`Unresolved plain scalar ${JSON.stringify(e)}`), e;
|
|
1464
1464
|
}
|
|
1465
|
-
}),
|
|
1465
|
+
}), yt = {
|
|
1466
1466
|
identify: (e) => e instanceof Uint8Array,
|
|
1467
1467
|
default: !1,
|
|
1468
1468
|
tag: "tag:yaml.org,2002:binary",
|
|
@@ -1487,7 +1487,7 @@ var _t = ({ value: e }) => JSON.stringify(e), vt = [
|
|
|
1487
1487
|
for (let t = 0, r = 0; t < n; ++t, r += e) i[t] = s.substr(r, e);
|
|
1488
1488
|
s = i.join(t === I.BLOCK_LITERAL ? "\n" : " ");
|
|
1489
1489
|
}
|
|
1490
|
-
return
|
|
1490
|
+
return Ne({
|
|
1491
1491
|
comment: e,
|
|
1492
1492
|
type: t,
|
|
1493
1493
|
value: s
|
|
@@ -1496,27 +1496,27 @@ var _t = ({ value: e }) => JSON.stringify(e), vt = [
|
|
|
1496
1496
|
};
|
|
1497
1497
|
//#endregion
|
|
1498
1498
|
//#region node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js
|
|
1499
|
-
function
|
|
1499
|
+
function bt(e, t) {
|
|
1500
1500
|
if (C(e)) for (let n = 0; n < e.items.length; ++n) {
|
|
1501
1501
|
let r = e.items[n];
|
|
1502
1502
|
if (!x(r)) {
|
|
1503
1503
|
if (b(r)) {
|
|
1504
1504
|
r.items.length > 1 && t("Each pair must have its own sequence indicator");
|
|
1505
|
-
let e = r.items[0] || new
|
|
1505
|
+
let e = r.items[0] || new H(new I(null));
|
|
1506
1506
|
if (r.commentBefore && (e.key.commentBefore = e.key.commentBefore ? `${r.commentBefore}\n${e.key.commentBefore}` : r.commentBefore), r.comment) {
|
|
1507
1507
|
let t = e.value ?? e.key;
|
|
1508
1508
|
t.comment = t.comment ? `${r.comment}\n${t.comment}` : r.comment;
|
|
1509
1509
|
}
|
|
1510
1510
|
r = e;
|
|
1511
1511
|
}
|
|
1512
|
-
e.items[n] = x(r) ? r : new
|
|
1512
|
+
e.items[n] = x(r) ? r : new H(r);
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
1515
1515
|
else t("Expected a sequence for this tag");
|
|
1516
1516
|
return e;
|
|
1517
1517
|
}
|
|
1518
|
-
function
|
|
1519
|
-
let { replacer: r } = n, i = new
|
|
1518
|
+
function xt(e, t, n) {
|
|
1519
|
+
let { replacer: r } = n, i = new W(e);
|
|
1520
1520
|
i.tag = "tag:yaml.org,2002:pairs";
|
|
1521
1521
|
let a = 0;
|
|
1522
1522
|
if (t && Symbol.iterator in Object(t)) for (let e of t) {
|
|
@@ -1530,19 +1530,19 @@ function St(e, t, n) {
|
|
|
1530
1530
|
if (t.length === 1) o = t[0], s = e[o];
|
|
1531
1531
|
else throw TypeError(`Expected tuple with one key, not ${t.length} keys`);
|
|
1532
1532
|
} else o = e;
|
|
1533
|
-
i.items.push(
|
|
1533
|
+
i.items.push(qe(o, s, n));
|
|
1534
1534
|
}
|
|
1535
1535
|
return i;
|
|
1536
1536
|
}
|
|
1537
|
-
var
|
|
1537
|
+
var St = {
|
|
1538
1538
|
collection: "seq",
|
|
1539
1539
|
default: !1,
|
|
1540
1540
|
tag: "tag:yaml.org,2002:pairs",
|
|
1541
|
-
resolve:
|
|
1542
|
-
createNode:
|
|
1543
|
-
},
|
|
1541
|
+
resolve: bt,
|
|
1542
|
+
createNode: xt
|
|
1543
|
+
}, Ct = class e extends W {
|
|
1544
1544
|
constructor() {
|
|
1545
|
-
super(), this.add =
|
|
1545
|
+
super(), this.add = U.prototype.add.bind(this), this.delete = U.prototype.delete.bind(this), this.get = U.prototype.get.bind(this), this.has = U.prototype.has.bind(this), this.set = U.prototype.set.bind(this), this.tag = e.tag;
|
|
1546
1546
|
}
|
|
1547
1547
|
toJSON(e, t) {
|
|
1548
1548
|
if (!t) return super.toJSON(e);
|
|
@@ -1556,51 +1556,51 @@ var Ct = {
|
|
|
1556
1556
|
return n;
|
|
1557
1557
|
}
|
|
1558
1558
|
static from(e, t, n) {
|
|
1559
|
-
let r =
|
|
1559
|
+
let r = xt(e, t, n), i = new this();
|
|
1560
1560
|
return i.items = r.items, i;
|
|
1561
1561
|
}
|
|
1562
1562
|
};
|
|
1563
|
-
|
|
1564
|
-
var
|
|
1563
|
+
Ct.tag = "tag:yaml.org,2002:omap";
|
|
1564
|
+
var wt = {
|
|
1565
1565
|
collection: "seq",
|
|
1566
1566
|
identify: (e) => e instanceof Map,
|
|
1567
|
-
nodeClass:
|
|
1567
|
+
nodeClass: Ct,
|
|
1568
1568
|
default: !1,
|
|
1569
1569
|
tag: "tag:yaml.org,2002:omap",
|
|
1570
1570
|
resolve(e, t) {
|
|
1571
|
-
let n =
|
|
1571
|
+
let n = bt(e, t), r = [];
|
|
1572
1572
|
for (let { key: e } of n.items) S(e) && (r.includes(e.value) ? t(`Ordered maps must not include duplicate keys: ${e.value}`) : r.push(e.value));
|
|
1573
|
-
return Object.assign(new
|
|
1573
|
+
return Object.assign(new Ct(), n);
|
|
1574
1574
|
},
|
|
1575
|
-
createNode: (e, t, n) =>
|
|
1575
|
+
createNode: (e, t, n) => Ct.from(e, t, n)
|
|
1576
1576
|
};
|
|
1577
1577
|
//#endregion
|
|
1578
1578
|
//#region node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js
|
|
1579
|
-
function
|
|
1580
|
-
return t && (e ?
|
|
1579
|
+
function Tt({ value: e, source: t }, n) {
|
|
1580
|
+
return t && (e ? Et : Dt).test.test(t) ? t : e ? n.options.trueStr : n.options.falseStr;
|
|
1581
1581
|
}
|
|
1582
|
-
var
|
|
1582
|
+
var Et = {
|
|
1583
1583
|
identify: (e) => e === !0,
|
|
1584
1584
|
default: !0,
|
|
1585
1585
|
tag: "tag:yaml.org,2002:bool",
|
|
1586
1586
|
test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
|
|
1587
1587
|
resolve: () => new I(!0),
|
|
1588
|
-
stringify:
|
|
1589
|
-
},
|
|
1588
|
+
stringify: Tt
|
|
1589
|
+
}, Dt = {
|
|
1590
1590
|
identify: (e) => e === !1,
|
|
1591
1591
|
default: !0,
|
|
1592
1592
|
tag: "tag:yaml.org,2002:bool",
|
|
1593
1593
|
test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
|
|
1594
1594
|
resolve: () => new I(!1),
|
|
1595
|
-
stringify:
|
|
1596
|
-
},
|
|
1595
|
+
stringify: Tt
|
|
1596
|
+
}, Ot = {
|
|
1597
1597
|
identify: (e) => typeof e == "number",
|
|
1598
1598
|
default: !0,
|
|
1599
1599
|
tag: "tag:yaml.org,2002:float",
|
|
1600
1600
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1601
1601
|
resolve: (e) => e.slice(-3).toLowerCase() === "nan" ? NaN : e[0] === "-" ? -Infinity : Infinity,
|
|
1602
|
-
stringify:
|
|
1603
|
-
},
|
|
1602
|
+
stringify: G
|
|
1603
|
+
}, kt = {
|
|
1604
1604
|
identify: (e) => typeof e == "number",
|
|
1605
1605
|
default: !0,
|
|
1606
1606
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1609,9 +1609,9 @@ var Dt = {
|
|
|
1609
1609
|
resolve: (e) => parseFloat(e.replace(/_/g, "")),
|
|
1610
1610
|
stringify(e) {
|
|
1611
1611
|
let t = Number(e.value);
|
|
1612
|
-
return isFinite(t) ? t.toExponential() :
|
|
1612
|
+
return isFinite(t) ? t.toExponential() : G(e);
|
|
1613
1613
|
}
|
|
1614
|
-
},
|
|
1614
|
+
}, At = {
|
|
1615
1615
|
identify: (e) => typeof e == "number",
|
|
1616
1616
|
default: !0,
|
|
1617
1617
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1624,9 +1624,9 @@ var Dt = {
|
|
|
1624
1624
|
}
|
|
1625
1625
|
return t;
|
|
1626
1626
|
},
|
|
1627
|
-
stringify:
|
|
1628
|
-
},
|
|
1629
|
-
function
|
|
1627
|
+
stringify: G
|
|
1628
|
+
}, jt = (e) => typeof e == "bigint" || Number.isInteger(e);
|
|
1629
|
+
function Mt(e, t, n, { intAsBigInt: r }) {
|
|
1630
1630
|
let i = e[0];
|
|
1631
1631
|
if ((i === "-" || i === "+") && (t += 1), e = e.substring(t).replace(/_/g, ""), r) {
|
|
1632
1632
|
switch (n) {
|
|
@@ -1644,61 +1644,61 @@ function Nt(e, t, n, { intAsBigInt: r }) {
|
|
|
1644
1644
|
let a = parseInt(e, n);
|
|
1645
1645
|
return i === "-" ? -1 * a : a;
|
|
1646
1646
|
}
|
|
1647
|
-
function
|
|
1647
|
+
function Nt(e, t, n) {
|
|
1648
1648
|
let { value: r } = e;
|
|
1649
|
-
if (
|
|
1649
|
+
if (jt(r)) {
|
|
1650
1650
|
let e = r.toString(t);
|
|
1651
1651
|
return r < 0 ? "-" + n + e.substr(1) : n + e;
|
|
1652
1652
|
}
|
|
1653
|
-
return
|
|
1653
|
+
return G(e);
|
|
1654
1654
|
}
|
|
1655
|
-
var
|
|
1656
|
-
identify:
|
|
1655
|
+
var Pt = {
|
|
1656
|
+
identify: jt,
|
|
1657
1657
|
default: !0,
|
|
1658
1658
|
tag: "tag:yaml.org,2002:int",
|
|
1659
1659
|
format: "BIN",
|
|
1660
1660
|
test: /^[-+]?0b[0-1_]+$/,
|
|
1661
|
-
resolve: (e, t, n) =>
|
|
1662
|
-
stringify: (e) =>
|
|
1663
|
-
},
|
|
1664
|
-
identify:
|
|
1661
|
+
resolve: (e, t, n) => Mt(e, 2, 2, n),
|
|
1662
|
+
stringify: (e) => Nt(e, 2, "0b")
|
|
1663
|
+
}, Ft = {
|
|
1664
|
+
identify: jt,
|
|
1665
1665
|
default: !0,
|
|
1666
1666
|
tag: "tag:yaml.org,2002:int",
|
|
1667
1667
|
format: "OCT",
|
|
1668
1668
|
test: /^[-+]?0[0-7_]+$/,
|
|
1669
|
-
resolve: (e, t, n) =>
|
|
1670
|
-
stringify: (e) =>
|
|
1671
|
-
},
|
|
1672
|
-
identify:
|
|
1669
|
+
resolve: (e, t, n) => Mt(e, 1, 8, n),
|
|
1670
|
+
stringify: (e) => Nt(e, 8, "0")
|
|
1671
|
+
}, It = {
|
|
1672
|
+
identify: jt,
|
|
1673
1673
|
default: !0,
|
|
1674
1674
|
tag: "tag:yaml.org,2002:int",
|
|
1675
1675
|
test: /^[-+]?[0-9][0-9_]*$/,
|
|
1676
|
-
resolve: (e, t, n) =>
|
|
1677
|
-
stringify:
|
|
1678
|
-
},
|
|
1679
|
-
identify:
|
|
1676
|
+
resolve: (e, t, n) => Mt(e, 0, 10, n),
|
|
1677
|
+
stringify: G
|
|
1678
|
+
}, Lt = {
|
|
1679
|
+
identify: jt,
|
|
1680
1680
|
default: !0,
|
|
1681
1681
|
tag: "tag:yaml.org,2002:int",
|
|
1682
1682
|
format: "HEX",
|
|
1683
1683
|
test: /^[-+]?0x[0-9a-fA-F_]+$/,
|
|
1684
|
-
resolve: (e, t, n) =>
|
|
1685
|
-
stringify: (e) =>
|
|
1686
|
-
},
|
|
1684
|
+
resolve: (e, t, n) => Mt(e, 2, 16, n),
|
|
1685
|
+
stringify: (e) => Nt(e, 16, "0x")
|
|
1686
|
+
}, Rt = class e extends U {
|
|
1687
1687
|
constructor(t) {
|
|
1688
1688
|
super(t), this.tag = e.tag;
|
|
1689
1689
|
}
|
|
1690
1690
|
add(e) {
|
|
1691
1691
|
let t;
|
|
1692
|
-
t = x(e) ? e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? new
|
|
1692
|
+
t = x(e) ? e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? new H(e.key, null) : new H(e, null), Qe(this.items, t.key) || this.items.push(t);
|
|
1693
1693
|
}
|
|
1694
1694
|
get(e, t) {
|
|
1695
|
-
let n =
|
|
1695
|
+
let n = Qe(this.items, e);
|
|
1696
1696
|
return !t && x(n) ? S(n.key) ? n.key.value : n.key : n;
|
|
1697
1697
|
}
|
|
1698
1698
|
set(e, t) {
|
|
1699
1699
|
if (typeof t != "boolean") throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);
|
|
1700
|
-
let n =
|
|
1701
|
-
n && !t ? this.items.splice(this.items.indexOf(n), 1) : !n && t && this.items.push(new
|
|
1700
|
+
let n = Qe(this.items, e);
|
|
1701
|
+
n && !t ? this.items.splice(this.items.indexOf(n), 1) : !n && t && this.items.push(new H(e));
|
|
1702
1702
|
}
|
|
1703
1703
|
toJSON(e, t) {
|
|
1704
1704
|
return super.toJSON(e, t, Set);
|
|
@@ -1710,21 +1710,21 @@ var Ft = {
|
|
|
1710
1710
|
}
|
|
1711
1711
|
static from(e, t, n) {
|
|
1712
1712
|
let { replacer: r } = n, i = new this(e);
|
|
1713
|
-
if (t && Symbol.iterator in Object(t)) for (let e of t) typeof r == "function" && (e = r.call(t, e, e)), i.items.push(
|
|
1713
|
+
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));
|
|
1714
1714
|
return i;
|
|
1715
1715
|
}
|
|
1716
1716
|
};
|
|
1717
|
-
|
|
1718
|
-
var
|
|
1717
|
+
Rt.tag = "tag:yaml.org,2002:set";
|
|
1718
|
+
var zt = {
|
|
1719
1719
|
collection: "map",
|
|
1720
1720
|
identify: (e) => e instanceof Set,
|
|
1721
|
-
nodeClass:
|
|
1721
|
+
nodeClass: Rt,
|
|
1722
1722
|
default: !1,
|
|
1723
1723
|
tag: "tag:yaml.org,2002:set",
|
|
1724
|
-
createNode: (e, t, n) =>
|
|
1724
|
+
createNode: (e, t, n) => Rt.from(e, t, n),
|
|
1725
1725
|
resolve(e, t) {
|
|
1726
1726
|
if (b(e)) {
|
|
1727
|
-
if (e.hasAllNullValues(!0)) return Object.assign(new
|
|
1727
|
+
if (e.hasAllNullValues(!0)) return Object.assign(new Rt(), e);
|
|
1728
1728
|
t("Set items must all have null values");
|
|
1729
1729
|
} else t("Expected a mapping for this tag");
|
|
1730
1730
|
return e;
|
|
@@ -1732,127 +1732,127 @@ var Bt = {
|
|
|
1732
1732
|
};
|
|
1733
1733
|
//#endregion
|
|
1734
1734
|
//#region node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js
|
|
1735
|
-
function
|
|
1735
|
+
function Bt(e, t) {
|
|
1736
1736
|
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));
|
|
1737
1737
|
return n === "-" ? i(-1) * a : a;
|
|
1738
1738
|
}
|
|
1739
|
-
function
|
|
1739
|
+
function Vt(e) {
|
|
1740
1740
|
let { value: t } = e, n = (e) => e;
|
|
1741
1741
|
if (typeof t == "bigint") n = (e) => BigInt(e);
|
|
1742
|
-
else if (isNaN(t) || !isFinite(t)) return
|
|
1742
|
+
else if (isNaN(t) || !isFinite(t)) return G(e);
|
|
1743
1743
|
let r = "";
|
|
1744
1744
|
t < 0 && (r = "-", t *= n(-1));
|
|
1745
1745
|
let i = n(60), a = [t % i];
|
|
1746
1746
|
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*$/, "");
|
|
1747
1747
|
}
|
|
1748
|
-
var
|
|
1748
|
+
var Ht = {
|
|
1749
1749
|
identify: (e) => typeof e == "bigint" || Number.isInteger(e),
|
|
1750
1750
|
default: !0,
|
|
1751
1751
|
tag: "tag:yaml.org,2002:int",
|
|
1752
1752
|
format: "TIME",
|
|
1753
1753
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
|
|
1754
|
-
resolve: (e, t, { intAsBigInt: n }) =>
|
|
1755
|
-
stringify:
|
|
1756
|
-
},
|
|
1754
|
+
resolve: (e, t, { intAsBigInt: n }) => Bt(e, n),
|
|
1755
|
+
stringify: Vt
|
|
1756
|
+
}, Ut = {
|
|
1757
1757
|
identify: (e) => typeof e == "number",
|
|
1758
1758
|
default: !0,
|
|
1759
1759
|
tag: "tag:yaml.org,2002:float",
|
|
1760
1760
|
format: "TIME",
|
|
1761
1761
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
|
|
1762
|
-
resolve: (e) =>
|
|
1763
|
-
stringify:
|
|
1764
|
-
},
|
|
1762
|
+
resolve: (e) => Bt(e, !1),
|
|
1763
|
+
stringify: Vt
|
|
1764
|
+
}, Wt = {
|
|
1765
1765
|
identify: (e) => e instanceof Date,
|
|
1766
1766
|
default: !0,
|
|
1767
1767
|
tag: "tag:yaml.org,2002:timestamp",
|
|
1768
1768
|
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})?))?)?$"),
|
|
1769
1769
|
resolve(e) {
|
|
1770
|
-
let t = e.match(
|
|
1770
|
+
let t = e.match(Wt.test);
|
|
1771
1771
|
if (!t) throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");
|
|
1772
1772
|
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];
|
|
1773
1773
|
if (u && u !== "Z") {
|
|
1774
|
-
let e =
|
|
1774
|
+
let e = Bt(u, !1);
|
|
1775
1775
|
Math.abs(e) < 30 && (e *= 60), l -= 6e4 * e;
|
|
1776
1776
|
}
|
|
1777
1777
|
return new Date(l);
|
|
1778
1778
|
},
|
|
1779
1779
|
stringify: ({ value: e }) => e?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? ""
|
|
1780
|
-
},
|
|
1781
|
-
|
|
1780
|
+
}, Gt = [
|
|
1781
|
+
$e,
|
|
1782
|
+
tt,
|
|
1782
1783
|
nt,
|
|
1783
1784
|
rt,
|
|
1784
|
-
|
|
1785
|
+
Et,
|
|
1785
1786
|
Dt,
|
|
1786
|
-
|
|
1787
|
+
Pt,
|
|
1787
1788
|
Ft,
|
|
1788
1789
|
It,
|
|
1789
1790
|
Lt,
|
|
1790
|
-
|
|
1791
|
+
Ot,
|
|
1791
1792
|
kt,
|
|
1792
1793
|
At,
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1794
|
+
yt,
|
|
1795
|
+
V,
|
|
1796
|
+
wt,
|
|
1797
|
+
St,
|
|
1798
|
+
zt,
|
|
1799
|
+
Ht,
|
|
1799
1800
|
Ut,
|
|
1800
|
-
Wt
|
|
1801
|
-
|
|
1802
|
-
],
|
|
1803
|
-
["core", ht],
|
|
1801
|
+
Wt
|
|
1802
|
+
], Kt = /* @__PURE__ */ new Map([
|
|
1803
|
+
["core", mt],
|
|
1804
1804
|
["failsafe", [
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1805
|
+
$e,
|
|
1806
|
+
tt,
|
|
1807
|
+
nt
|
|
1808
1808
|
]],
|
|
1809
|
-
["json",
|
|
1810
|
-
["yaml11",
|
|
1811
|
-
["yaml-1.1",
|
|
1812
|
-
]),
|
|
1813
|
-
binary:
|
|
1814
|
-
bool:
|
|
1815
|
-
float:
|
|
1816
|
-
floatExp:
|
|
1817
|
-
floatNaN:
|
|
1818
|
-
floatTime:
|
|
1819
|
-
int:
|
|
1820
|
-
intHex:
|
|
1821
|
-
intOct:
|
|
1822
|
-
intTime:
|
|
1823
|
-
map:
|
|
1824
|
-
merge:
|
|
1825
|
-
null:
|
|
1826
|
-
omap:
|
|
1827
|
-
pairs:
|
|
1828
|
-
seq:
|
|
1829
|
-
set:
|
|
1830
|
-
timestamp:
|
|
1831
|
-
},
|
|
1832
|
-
"tag:yaml.org,2002:binary":
|
|
1833
|
-
"tag:yaml.org,2002:merge":
|
|
1834
|
-
"tag:yaml.org,2002:omap":
|
|
1835
|
-
"tag:yaml.org,2002:pairs":
|
|
1836
|
-
"tag:yaml.org,2002:set":
|
|
1837
|
-
"tag:yaml.org,2002:timestamp":
|
|
1809
|
+
["json", vt],
|
|
1810
|
+
["yaml11", Gt],
|
|
1811
|
+
["yaml-1.1", Gt]
|
|
1812
|
+
]), qt = {
|
|
1813
|
+
binary: yt,
|
|
1814
|
+
bool: it,
|
|
1815
|
+
float: st,
|
|
1816
|
+
floatExp: ot,
|
|
1817
|
+
floatNaN: at,
|
|
1818
|
+
floatTime: Ut,
|
|
1819
|
+
int: ft,
|
|
1820
|
+
intHex: pt,
|
|
1821
|
+
intOct: dt,
|
|
1822
|
+
intTime: Ht,
|
|
1823
|
+
map: $e,
|
|
1824
|
+
merge: V,
|
|
1825
|
+
null: rt,
|
|
1826
|
+
omap: wt,
|
|
1827
|
+
pairs: St,
|
|
1828
|
+
seq: tt,
|
|
1829
|
+
set: zt,
|
|
1830
|
+
timestamp: Wt
|
|
1831
|
+
}, Jt = {
|
|
1832
|
+
"tag:yaml.org,2002:binary": yt,
|
|
1833
|
+
"tag:yaml.org,2002:merge": V,
|
|
1834
|
+
"tag:yaml.org,2002:omap": wt,
|
|
1835
|
+
"tag:yaml.org,2002:pairs": St,
|
|
1836
|
+
"tag:yaml.org,2002:set": zt,
|
|
1837
|
+
"tag:yaml.org,2002:timestamp": Wt
|
|
1838
1838
|
};
|
|
1839
|
-
function
|
|
1840
|
-
let r =
|
|
1841
|
-
if (r && !e) return n && !r.includes(
|
|
1839
|
+
function Yt(e, t, n) {
|
|
1840
|
+
let r = Kt.get(t);
|
|
1841
|
+
if (r && !e) return n && !r.includes(V) ? r.concat(V) : r.slice();
|
|
1842
1842
|
let i = r;
|
|
1843
1843
|
if (!i) {
|
|
1844
1844
|
if (Array.isArray(e)) i = [];
|
|
1845
1845
|
else {
|
|
1846
|
-
let e = Array.from(
|
|
1846
|
+
let e = Array.from(Kt.keys()).filter((e) => e !== "yaml11").map((e) => JSON.stringify(e)).join(", ");
|
|
1847
1847
|
throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`);
|
|
1848
1848
|
}
|
|
1849
1849
|
}
|
|
1850
1850
|
if (Array.isArray(e)) for (let t of e) i = i.concat(t);
|
|
1851
1851
|
else typeof e == "function" && (i = e(i.slice()));
|
|
1852
|
-
return n && (i = i.concat(
|
|
1853
|
-
let n = typeof t == "string" ?
|
|
1852
|
+
return n && (i = i.concat(V)), i.reduce((e, t) => {
|
|
1853
|
+
let n = typeof t == "string" ? qt[t] : t;
|
|
1854
1854
|
if (!n) {
|
|
1855
|
-
let e = JSON.stringify(t), n = Object.keys(
|
|
1855
|
+
let e = JSON.stringify(t), n = Object.keys(qt).map((e) => JSON.stringify(e)).join(", ");
|
|
1856
1856
|
throw Error(`Unknown custom tag ${e}; use one of ${n}`);
|
|
1857
1857
|
}
|
|
1858
1858
|
return e.includes(n) || e.push(n), e;
|
|
@@ -1860,9 +1860,9 @@ function Xt(e, t, n) {
|
|
|
1860
1860
|
}
|
|
1861
1861
|
//#endregion
|
|
1862
1862
|
//#region node_modules/yaml/browser/dist/schema/Schema.js
|
|
1863
|
-
var
|
|
1863
|
+
var Xt = (e, t) => e.key < t.key ? -1 : +(e.key > t.key), Zt = class e {
|
|
1864
1864
|
constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: r, schema: i, sortMapEntries: a, toStringDefaults: o }) {
|
|
1865
|
-
this.compat = Array.isArray(e) ?
|
|
1865
|
+
this.compat = Array.isArray(e) ? Yt(e, "compat") : e ? Yt(null, e) : null, this.name = typeof i == "string" && i || "core", this.knownTags = r ? Jt : {}, this.tags = Yt(t, this.name, n), this.toStringOptions = o ?? null, Object.defineProperty(this, p, { value: $e }), Object.defineProperty(this, h, { value: nt }), Object.defineProperty(this, g, { value: tt }), this.sortMapEntries = typeof a == "function" ? a : a === !0 ? Xt : null;
|
|
1866
1866
|
}
|
|
1867
1867
|
clone() {
|
|
1868
1868
|
let t = Object.create(e.prototype, Object.getOwnPropertyDescriptors(this));
|
|
@@ -1871,45 +1871,45 @@ var Zt = (e, t) => e.key < t.key ? -1 : +(e.key > t.key), Qt = class e {
|
|
|
1871
1871
|
};
|
|
1872
1872
|
//#endregion
|
|
1873
1873
|
//#region node_modules/yaml/browser/dist/stringify/stringifyDocument.js
|
|
1874
|
-
function
|
|
1874
|
+
function Qt(e, t) {
|
|
1875
1875
|
let n = [], r = t.directives === !0;
|
|
1876
1876
|
if (t.directives !== !1 && e.directives) {
|
|
1877
1877
|
let t = e.directives.toString(e);
|
|
1878
1878
|
t ? (n.push(t), r = !0) : e.directives.docStart && (r = !0);
|
|
1879
1879
|
}
|
|
1880
1880
|
r && n.push("---");
|
|
1881
|
-
let i =
|
|
1881
|
+
let i = Pe(e, t), { commentString: a } = i.options;
|
|
1882
1882
|
if (e.commentBefore) {
|
|
1883
1883
|
n.length !== 1 && n.unshift("");
|
|
1884
1884
|
let t = a(e.commentBefore);
|
|
1885
|
-
n.unshift(
|
|
1885
|
+
n.unshift(B(t, ""));
|
|
1886
1886
|
}
|
|
1887
1887
|
let o = !1, s = null;
|
|
1888
1888
|
if (e.contents) {
|
|
1889
1889
|
if (T(e.contents)) {
|
|
1890
1890
|
if (e.contents.spaceBefore && r && n.push(""), e.contents.commentBefore) {
|
|
1891
1891
|
let t = a(e.contents.commentBefore);
|
|
1892
|
-
n.push(
|
|
1892
|
+
n.push(B(t, ""));
|
|
1893
1893
|
}
|
|
1894
1894
|
i.forceBlockIndent = !!e.comment, s = e.contents.comment;
|
|
1895
1895
|
}
|
|
1896
|
-
let t = s ? void 0 : () => o = !0, c =
|
|
1897
|
-
s && (c +=
|
|
1898
|
-
} else n.push(
|
|
1896
|
+
let t = s ? void 0 : () => o = !0, c = Le(e.contents, i, () => s = null, t);
|
|
1897
|
+
s && (c += ve(c, "", a(s))), (c[0] === "|" || c[0] === ">") && n[n.length - 1] === "---" ? n[n.length - 1] = `--- ${c}` : n.push(c);
|
|
1898
|
+
} else n.push(Le(e.contents, i));
|
|
1899
1899
|
if (e.directives?.docEnd) {
|
|
1900
1900
|
if (e.comment) {
|
|
1901
1901
|
let t = a(e.comment);
|
|
1902
|
-
t.includes("\n") ? (n.push("..."), n.push(
|
|
1902
|
+
t.includes("\n") ? (n.push("..."), n.push(B(t, ""))) : n.push(`... ${t}`);
|
|
1903
1903
|
} else n.push("...");
|
|
1904
1904
|
} else {
|
|
1905
1905
|
let t = e.comment;
|
|
1906
|
-
t && o && (t = t.replace(/^\n+/, "")), t && ((!o || s) && n[n.length - 1] !== "" && n.push(""), n.push(
|
|
1906
|
+
t && o && (t = t.replace(/^\n+/, "")), t && ((!o || s) && n[n.length - 1] !== "" && n.push(""), n.push(B(a(t), "")));
|
|
1907
1907
|
}
|
|
1908
1908
|
return n.join("\n") + "\n";
|
|
1909
1909
|
}
|
|
1910
1910
|
//#endregion
|
|
1911
1911
|
//#region node_modules/yaml/browser/dist/doc/Document.js
|
|
1912
|
-
var
|
|
1912
|
+
var $t = class e {
|
|
1913
1913
|
constructor(e, t, n) {
|
|
1914
1914
|
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, _, { value: f });
|
|
1915
1915
|
let r = null;
|
|
@@ -1933,10 +1933,10 @@ var en = class e {
|
|
|
1933
1933
|
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 = T(this.contents) ? this.contents.clone(t.schema) : this.contents, this.range && (t.range = this.range.slice()), t;
|
|
1934
1934
|
}
|
|
1935
1935
|
add(e) {
|
|
1936
|
-
|
|
1936
|
+
en(this.contents) && this.contents.add(e);
|
|
1937
1937
|
}
|
|
1938
1938
|
addIn(e, t) {
|
|
1939
|
-
|
|
1939
|
+
en(this.contents) && this.contents.addIn(e, t);
|
|
1940
1940
|
}
|
|
1941
1941
|
createAlias(e, t) {
|
|
1942
1942
|
if (!e.anchor) {
|
|
@@ -1960,35 +1960,35 @@ var en = class e {
|
|
|
1960
1960
|
replacer: r,
|
|
1961
1961
|
schema: this.schema,
|
|
1962
1962
|
sourceObjects: f
|
|
1963
|
-
}, m =
|
|
1963
|
+
}, m = R(e, l, p);
|
|
1964
1964
|
return o && w(m) && (m.flow = !0), d(), m;
|
|
1965
1965
|
}
|
|
1966
1966
|
createPair(e, t, n = {}) {
|
|
1967
|
-
return new
|
|
1967
|
+
return new H(this.createNode(e, null, n), this.createNode(t, null, n));
|
|
1968
1968
|
}
|
|
1969
1969
|
delete(e) {
|
|
1970
|
-
return
|
|
1970
|
+
return en(this.contents) ? this.contents.delete(e) : !1;
|
|
1971
1971
|
}
|
|
1972
1972
|
deleteIn(e) {
|
|
1973
|
-
return
|
|
1973
|
+
return he(e) ? this.contents != null && (this.contents = null, !0) : en(this.contents) ? this.contents.deleteIn(e) : !1;
|
|
1974
1974
|
}
|
|
1975
1975
|
get(e, t) {
|
|
1976
1976
|
return w(this.contents) ? this.contents.get(e, t) : void 0;
|
|
1977
1977
|
}
|
|
1978
1978
|
getIn(e, t) {
|
|
1979
|
-
return
|
|
1979
|
+
return he(e) ? !t && S(this.contents) ? this.contents.value : this.contents : w(this.contents) ? this.contents.getIn(e, t) : void 0;
|
|
1980
1980
|
}
|
|
1981
1981
|
has(e) {
|
|
1982
1982
|
return w(this.contents) ? this.contents.has(e) : !1;
|
|
1983
1983
|
}
|
|
1984
1984
|
hasIn(e) {
|
|
1985
|
-
return
|
|
1985
|
+
return he(e) ? this.contents !== void 0 : w(this.contents) ? this.contents.hasIn(e) : !1;
|
|
1986
1986
|
}
|
|
1987
1987
|
set(e, t) {
|
|
1988
|
-
this.contents == null ? this.contents =
|
|
1988
|
+
this.contents == null ? this.contents = z(this.schema, [e], t) : en(this.contents) && this.contents.set(e, t);
|
|
1989
1989
|
}
|
|
1990
1990
|
setIn(e, t) {
|
|
1991
|
-
|
|
1991
|
+
he(e) ? this.contents = t : this.contents == null ? this.contents = z(this.schema, Array.from(e), t) : en(this.contents) && this.contents.setIn(e, t);
|
|
1992
1992
|
}
|
|
1993
1993
|
setSchema(e, t = {}) {
|
|
1994
1994
|
typeof e == "number" && (e = String(e));
|
|
@@ -2016,7 +2016,7 @@ var en = class e {
|
|
|
2016
2016
|
}
|
|
2017
2017
|
}
|
|
2018
2018
|
if (t.schema instanceof Object) this.schema = t.schema;
|
|
2019
|
-
else if (n) this.schema = new
|
|
2019
|
+
else if (n) this.schema = new Zt(Object.assign(n, t));
|
|
2020
2020
|
else throw Error("With a null YAML version, the { schema: Schema } option is required");
|
|
2021
2021
|
}
|
|
2022
2022
|
toJS({ json: e, jsonArg: t, mapAsMap: n, maxAliasCount: r, onAnchor: i, reviver: a } = {}) {
|
|
@@ -2045,28 +2045,28 @@ var en = class e {
|
|
|
2045
2045
|
let t = JSON.stringify(e.indent);
|
|
2046
2046
|
throw Error(`"indent" option must be a positive integer, not ${t}`);
|
|
2047
2047
|
}
|
|
2048
|
-
return
|
|
2048
|
+
return Qt(this, e);
|
|
2049
2049
|
}
|
|
2050
2050
|
};
|
|
2051
|
-
function
|
|
2051
|
+
function en(e) {
|
|
2052
2052
|
if (w(e)) return !0;
|
|
2053
2053
|
throw Error("Expected a YAML collection as document contents");
|
|
2054
2054
|
}
|
|
2055
2055
|
//#endregion
|
|
2056
2056
|
//#region node_modules/yaml/browser/dist/errors.js
|
|
2057
|
-
var
|
|
2057
|
+
var tn = class extends Error {
|
|
2058
2058
|
constructor(e, t, n, r) {
|
|
2059
2059
|
super(), this.name = e, this.code = n, this.message = r, this.pos = t;
|
|
2060
2060
|
}
|
|
2061
|
-
},
|
|
2061
|
+
}, nn = class extends tn {
|
|
2062
2062
|
constructor(e, t, n) {
|
|
2063
2063
|
super("YAMLParseError", e, t, n);
|
|
2064
2064
|
}
|
|
2065
|
-
},
|
|
2065
|
+
}, rn = class extends tn {
|
|
2066
2066
|
constructor(e, t, n) {
|
|
2067
2067
|
super("YAMLWarning", e, t, n);
|
|
2068
2068
|
}
|
|
2069
|
-
},
|
|
2069
|
+
}, an = (e, t) => (n) => {
|
|
2070
2070
|
if (n.pos[0] === -1) return;
|
|
2071
2071
|
n.linePos = n.pos.map((e) => t.linePos(e));
|
|
2072
2072
|
let { line: r, col: i } = n.linePos[0];
|
|
@@ -2089,7 +2089,7 @@ var nn = class extends Error {
|
|
|
2089
2089
|
};
|
|
2090
2090
|
//#endregion
|
|
2091
2091
|
//#region node_modules/yaml/browser/dist/compose/resolve-props.js
|
|
2092
|
-
function
|
|
2092
|
+
function on(e, { flow: t, indicator: n, next: r, offset: i, onError: a, parentIndent: o, startOnNewline: s }) {
|
|
2093
2093
|
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;
|
|
2094
2094
|
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) {
|
|
2095
2095
|
case "space":
|
|
@@ -2135,7 +2135,7 @@ function sn(e, { flow: t, indicator: n, next: r, offset: i, onError: a, parentIn
|
|
|
2135
2135
|
}
|
|
2136
2136
|
//#endregion
|
|
2137
2137
|
//#region node_modules/yaml/browser/dist/compose/util-contains-newline.js
|
|
2138
|
-
function
|
|
2138
|
+
function sn(e) {
|
|
2139
2139
|
if (!e) return null;
|
|
2140
2140
|
switch (e.type) {
|
|
2141
2141
|
case "alias":
|
|
@@ -2153,7 +2153,7 @@ function cn(e) {
|
|
|
2153
2153
|
if (t.sep) {
|
|
2154
2154
|
for (let e of t.sep) if (e.type === "newline") return !0;
|
|
2155
2155
|
}
|
|
2156
|
-
if (
|
|
2156
|
+
if (sn(t.key) || sn(t.value)) return !0;
|
|
2157
2157
|
}
|
|
2158
2158
|
return !1;
|
|
2159
2159
|
default: return !0;
|
|
@@ -2161,15 +2161,15 @@ function cn(e) {
|
|
|
2161
2161
|
}
|
|
2162
2162
|
//#endregion
|
|
2163
2163
|
//#region node_modules/yaml/browser/dist/compose/util-flow-indent-check.js
|
|
2164
|
-
function
|
|
2164
|
+
function cn(e, t, n) {
|
|
2165
2165
|
if (t?.type === "flow-collection") {
|
|
2166
2166
|
let r = t.end[0];
|
|
2167
|
-
r.indent === e && (r.source === "]" || r.source === "}") &&
|
|
2167
|
+
r.indent === e && (r.source === "]" || r.source === "}") && sn(t) && n(r, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
|
|
2168
2168
|
}
|
|
2169
2169
|
}
|
|
2170
2170
|
//#endregion
|
|
2171
2171
|
//#region node_modules/yaml/browser/dist/compose/util-map-includes.js
|
|
2172
|
-
function
|
|
2172
|
+
function ln(e, t, n) {
|
|
2173
2173
|
let { uniqueKeys: r } = e.options;
|
|
2174
2174
|
if (r === !1) return !1;
|
|
2175
2175
|
let i = typeof r == "function" ? r : (e, t) => e === t || S(e) && S(t) && e.value === t.value;
|
|
@@ -2177,13 +2177,13 @@ function un(e, t, n) {
|
|
|
2177
2177
|
}
|
|
2178
2178
|
//#endregion
|
|
2179
2179
|
//#region node_modules/yaml/browser/dist/compose/resolve-block-map.js
|
|
2180
|
-
var
|
|
2181
|
-
function
|
|
2182
|
-
let o = new ((a?.nodeClass) ??
|
|
2180
|
+
var un = "All mapping items must start at the same column";
|
|
2181
|
+
function dn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
2182
|
+
let o = new ((a?.nodeClass) ?? U)(n.schema);
|
|
2183
2183
|
n.atRoot &&= !1;
|
|
2184
2184
|
let s = r.offset, c = null;
|
|
2185
2185
|
for (let a of r.items) {
|
|
2186
|
-
let { start: l, key: u, sep: d, value: f } = a, p =
|
|
2186
|
+
let { start: l, key: u, sep: d, value: f } = a, p = on(l, {
|
|
2187
2187
|
indicator: "explicit-key-ind",
|
|
2188
2188
|
next: u ?? d?.[0],
|
|
2189
2189
|
offset: s,
|
|
@@ -2192,16 +2192,16 @@ function fn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2192
2192
|
startOnNewline: !0
|
|
2193
2193
|
}), m = !p.found;
|
|
2194
2194
|
if (m) {
|
|
2195
|
-
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",
|
|
2195
|
+
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) {
|
|
2196
2196
|
c = p.end, p.comment && (o.comment ? o.comment += "\n" + p.comment : o.comment = p.comment);
|
|
2197
2197
|
continue;
|
|
2198
2198
|
}
|
|
2199
|
-
(p.newlineAfterProp ||
|
|
2200
|
-
} else p.found?.indent !== r.indent && i(s, "BAD_INDENT",
|
|
2199
|
+
(p.newlineAfterProp || sn(u)) && i(u ?? l[l.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
2200
|
+
} else p.found?.indent !== r.indent && i(s, "BAD_INDENT", un);
|
|
2201
2201
|
n.atKey = !0;
|
|
2202
2202
|
let h = p.end, g = u ? e(n, u, p, i) : t(n, h, l, null, p, i);
|
|
2203
|
-
n.schema.compat &&
|
|
2204
|
-
let _ =
|
|
2203
|
+
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");
|
|
2204
|
+
let _ = on(d ?? [], {
|
|
2205
2205
|
indicator: "map-value-ind",
|
|
2206
2206
|
next: f,
|
|
2207
2207
|
offset: g.range[2],
|
|
@@ -2212,12 +2212,12 @@ function fn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2212
2212
|
if (s = _.end, _.found) {
|
|
2213
2213
|
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"));
|
|
2214
2214
|
let c = f ? e(n, f, _, i) : t(n, s, d, null, _, i);
|
|
2215
|
-
n.schema.compat &&
|
|
2216
|
-
let l = new
|
|
2215
|
+
n.schema.compat && cn(r.indent, f, i), s = c.range[2];
|
|
2216
|
+
let l = new H(g, c);
|
|
2217
2217
|
n.options.keepSourceTokens && (l.srcToken = a), o.items.push(l);
|
|
2218
2218
|
} else {
|
|
2219
2219
|
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);
|
|
2220
|
-
let e = new
|
|
2220
|
+
let e = new H(g);
|
|
2221
2221
|
n.options.keepSourceTokens && (e.srcToken = a), o.items.push(e);
|
|
2222
2222
|
}
|
|
2223
2223
|
}
|
|
@@ -2229,12 +2229,12 @@ function fn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2229
2229
|
}
|
|
2230
2230
|
//#endregion
|
|
2231
2231
|
//#region node_modules/yaml/browser/dist/compose/resolve-block-seq.js
|
|
2232
|
-
function
|
|
2233
|
-
let o = new ((a?.nodeClass) ??
|
|
2232
|
+
function fn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
2233
|
+
let o = new ((a?.nodeClass) ?? W)(n.schema);
|
|
2234
2234
|
n.atRoot &&= !1, n.atKey &&= !1;
|
|
2235
2235
|
let s = r.offset, c = null;
|
|
2236
2236
|
for (let { start: a, value: l } of r.items) {
|
|
2237
|
-
let u =
|
|
2237
|
+
let u = on(a, {
|
|
2238
2238
|
indicator: "seq-item-ind",
|
|
2239
2239
|
next: l,
|
|
2240
2240
|
offset: s,
|
|
@@ -2250,7 +2250,7 @@ function pn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2250
2250
|
}
|
|
2251
2251
|
}
|
|
2252
2252
|
let d = l ? e(n, l, u, i) : t(n, u.end, a, null, u, i);
|
|
2253
|
-
n.schema.compat &&
|
|
2253
|
+
n.schema.compat && cn(r.indent, l, i), s = d.range[2], o.items.push(d);
|
|
2254
2254
|
}
|
|
2255
2255
|
return o.range = [
|
|
2256
2256
|
r.offset,
|
|
@@ -2260,7 +2260,7 @@ function pn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2260
2260
|
}
|
|
2261
2261
|
//#endregion
|
|
2262
2262
|
//#region node_modules/yaml/browser/dist/compose/resolve-end.js
|
|
2263
|
-
function
|
|
2263
|
+
function pn(e, t, n, r) {
|
|
2264
2264
|
let i = "";
|
|
2265
2265
|
if (e) {
|
|
2266
2266
|
let a = !1, o = "";
|
|
@@ -2291,15 +2291,15 @@ function mn(e, t, n, r) {
|
|
|
2291
2291
|
}
|
|
2292
2292
|
//#endregion
|
|
2293
2293
|
//#region node_modules/yaml/browser/dist/compose/resolve-flow-collection.js
|
|
2294
|
-
var
|
|
2295
|
-
function
|
|
2296
|
-
let o = r.start.source === "{", s = o ? "flow map" : "flow sequence", c = new ((a?.nodeClass) ?? (o ?
|
|
2294
|
+
var mn = "Block collections are not allowed within flow collections", hn = (e) => e && (e.type === "block-map" || e.type === "block-seq");
|
|
2295
|
+
function gn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
2296
|
+
let o = r.start.source === "{", s = o ? "flow map" : "flow sequence", c = new ((a?.nodeClass) ?? (o ? U : W))(n.schema);
|
|
2297
2297
|
c.flow = !0;
|
|
2298
2298
|
let l = n.atRoot;
|
|
2299
2299
|
l && (n.atRoot = !1), n.atKey &&= !1;
|
|
2300
2300
|
let u = r.offset + r.start.source.length;
|
|
2301
2301
|
for (let a = 0; a < r.items.length; ++a) {
|
|
2302
|
-
let l = r.items[a], { start: d, key: f, sep: p, value: m } = l, h =
|
|
2302
|
+
let l = r.items[a], { start: d, key: f, sep: p, value: m } = l, h = on(d, {
|
|
2303
2303
|
flow: s,
|
|
2304
2304
|
indicator: "explicit-key-ind",
|
|
2305
2305
|
next: f ?? p?.[0],
|
|
@@ -2313,7 +2313,7 @@ function _n({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2313
2313
|
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;
|
|
2314
2314
|
continue;
|
|
2315
2315
|
}
|
|
2316
|
-
!o && n.options.strict &&
|
|
2316
|
+
!o && n.options.strict && sn(f) && i(f, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
|
|
2317
2317
|
}
|
|
2318
2318
|
if (a === 0) h.comma && i(h.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${s}`);
|
|
2319
2319
|
else if (h.comma || i(h.start, "MISSING_CHAR", `Missing , between ${s} items`), h.comment) {
|
|
@@ -2333,12 +2333,12 @@ function _n({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2333
2333
|
}
|
|
2334
2334
|
if (!o && !p && !h.found) {
|
|
2335
2335
|
let r = m ? e(n, m, h, i) : t(n, h.end, p, null, h, i);
|
|
2336
|
-
c.items.push(r), u = r.range[2],
|
|
2336
|
+
c.items.push(r), u = r.range[2], hn(m) && i(r.range, "BLOCK_IN_FLOW", mn);
|
|
2337
2337
|
} else {
|
|
2338
2338
|
n.atKey = !0;
|
|
2339
2339
|
let a = h.end, g = f ? e(n, f, h, i) : t(n, a, d, null, h, i);
|
|
2340
|
-
|
|
2341
|
-
let _ =
|
|
2340
|
+
hn(f) && i(g.range, "BLOCK_IN_FLOW", mn), n.atKey = !1;
|
|
2341
|
+
let _ = on(p ?? [], {
|
|
2342
2342
|
flow: s,
|
|
2343
2343
|
indicator: "map-value-ind",
|
|
2344
2344
|
next: m,
|
|
@@ -2360,13 +2360,13 @@ function _n({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2360
2360
|
}
|
|
2361
2361
|
} 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`));
|
|
2362
2362
|
let v = m ? e(n, m, _, i) : _.found ? t(n, _.end, p, null, _, i) : null;
|
|
2363
|
-
v ?
|
|
2364
|
-
let y = new
|
|
2363
|
+
v ? hn(m) && i(v.range, "BLOCK_IN_FLOW", mn) : _.comment && (g.comment ? g.comment += "\n" + _.comment : g.comment = _.comment);
|
|
2364
|
+
let y = new H(g, v);
|
|
2365
2365
|
if (n.options.keepSourceTokens && (y.srcToken = l), o) {
|
|
2366
2366
|
let e = c;
|
|
2367
|
-
|
|
2367
|
+
ln(n, e.items, g) && i(a, "DUPLICATE_KEY", "Map keys must be unique"), e.items.push(y);
|
|
2368
2368
|
} else {
|
|
2369
|
-
let e = new
|
|
2369
|
+
let e = new U(n.schema);
|
|
2370
2370
|
e.flow = !0, e.items.push(y);
|
|
2371
2371
|
let t = (v ?? g).range;
|
|
2372
2372
|
e.range = [
|
|
@@ -2385,7 +2385,7 @@ function _n({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2385
2385
|
i(u, l ? "MISSING_CHAR" : "BAD_INDENT", t), f && f.source.length !== 1 && p.unshift(f);
|
|
2386
2386
|
}
|
|
2387
2387
|
if (p.length > 0) {
|
|
2388
|
-
let e =
|
|
2388
|
+
let e = pn(p, m, n.options.strict, i);
|
|
2389
2389
|
e.comment && (c.comment ? c.comment += "\n" + e.comment : c.comment = e.comment), c.range = [
|
|
2390
2390
|
r.offset,
|
|
2391
2391
|
m,
|
|
@@ -2400,31 +2400,31 @@ function _n({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2400
2400
|
}
|
|
2401
2401
|
//#endregion
|
|
2402
2402
|
//#region node_modules/yaml/browser/dist/compose/compose-collection.js
|
|
2403
|
-
function
|
|
2404
|
-
let o = n.type === "block-map" ?
|
|
2403
|
+
function _n(e, t, n, r, i, a) {
|
|
2404
|
+
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;
|
|
2405
2405
|
return i === "!" || i === s.tagName ? (o.tag = s.tagName, o) : (i && (o.tag = i), o);
|
|
2406
2406
|
}
|
|
2407
|
-
function
|
|
2407
|
+
function vn(e, t, n, r, i) {
|
|
2408
2408
|
let a = r.tag, o = a ? t.directives.tagName(a.source, (e) => i(a, "TAG_RESOLVE_FAILED", e)) : null;
|
|
2409
2409
|
if (n.type === "block-seq") {
|
|
2410
2410
|
let { anchor: e, newlineAfterProp: t } = r, n = e && a ? e.offset > a.offset ? e : a : e ?? a;
|
|
2411
2411
|
n && (!t || t.offset < n.offset) && i(n, "MISSING_CHAR", "Missing newline after block sequence props");
|
|
2412
2412
|
}
|
|
2413
2413
|
let s = n.type === "block-map" ? "map" : n.type === "block-seq" ? "seq" : n.start.source === "{" ? "map" : "seq";
|
|
2414
|
-
if (!a || !o || o === "!" || o ===
|
|
2414
|
+
if (!a || !o || o === "!" || o === U.tagName && s === "map" || o === W.tagName && s === "seq") return _n(e, t, n, i, o);
|
|
2415
2415
|
let c = t.schema.tags.find((e) => e.tag === o && e.collection === s);
|
|
2416
2416
|
if (!c) {
|
|
2417
2417
|
let r = t.schema.knownTags[o];
|
|
2418
2418
|
if (r?.collection === s) t.schema.tags.push(Object.assign({}, r, { default: !1 })), c = r;
|
|
2419
|
-
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),
|
|
2419
|
+
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);
|
|
2420
2420
|
}
|
|
2421
|
-
let l =
|
|
2421
|
+
let l = _n(e, t, n, i, o, c), u = c.resolve?.(l, (e) => i(a, "TAG_RESOLVE_FAILED", e), t.options) ?? l, d = T(u) ? u : new I(u);
|
|
2422
2422
|
return d.range = l.range, d.tag = o, c?.format && (d.format = c.format), d;
|
|
2423
2423
|
}
|
|
2424
2424
|
//#endregion
|
|
2425
2425
|
//#region node_modules/yaml/browser/dist/compose/resolve-block-scalar.js
|
|
2426
|
-
function
|
|
2427
|
-
let r = t.offset, i =
|
|
2426
|
+
function yn(e, t, n) {
|
|
2427
|
+
let r = t.offset, i = bn(t, e.options.strict, n);
|
|
2428
2428
|
if (!i) return {
|
|
2429
2429
|
value: "",
|
|
2430
2430
|
type: null,
|
|
@@ -2435,7 +2435,7 @@ function bn(e, t, n) {
|
|
|
2435
2435
|
r
|
|
2436
2436
|
]
|
|
2437
2437
|
};
|
|
2438
|
-
let a = i.mode === ">" ? I.BLOCK_FOLDED : I.BLOCK_LITERAL, o = t.source ?
|
|
2438
|
+
let a = i.mode === ">" ? I.BLOCK_FOLDED : I.BLOCK_LITERAL, o = t.source ? xn(t.source) : [], s = o.length;
|
|
2439
2439
|
for (let e = o.length - 1; e >= 0; --e) {
|
|
2440
2440
|
let t = o[e][1];
|
|
2441
2441
|
if (t === "" || t === "\r") s = e;
|
|
@@ -2498,7 +2498,7 @@ function bn(e, t, n) {
|
|
|
2498
2498
|
]
|
|
2499
2499
|
};
|
|
2500
2500
|
}
|
|
2501
|
-
function
|
|
2501
|
+
function bn({ offset: e, props: t }, n, r) {
|
|
2502
2502
|
/* istanbul ignore if should not happen */
|
|
2503
2503
|
if (t[0].type !== "block-scalar-header") return r(t[0], "IMPOSSIBLE", "Block scalar header not found"), null;
|
|
2504
2504
|
let { source: i } = t[0], a = i[0], o = 0, s = "", c = -1;
|
|
@@ -2541,24 +2541,24 @@ function xn({ offset: e, props: t }, n, r) {
|
|
|
2541
2541
|
length: d
|
|
2542
2542
|
};
|
|
2543
2543
|
}
|
|
2544
|
-
function
|
|
2544
|
+
function xn(e) {
|
|
2545
2545
|
let t = e.split(/\n( *)/), n = t[0], r = n.match(/^( *)/), i = [r?.[1] ? [r[1], n.slice(r[1].length)] : ["", n]];
|
|
2546
2546
|
for (let e = 1; e < t.length; e += 2) i.push([t[e], t[e + 1]]);
|
|
2547
2547
|
return i;
|
|
2548
2548
|
}
|
|
2549
2549
|
//#endregion
|
|
2550
2550
|
//#region node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js
|
|
2551
|
-
function
|
|
2551
|
+
function Sn(e, t, n) {
|
|
2552
2552
|
let { offset: r, type: i, source: a, end: o } = e, s, c, l = (e, t, i) => n(r + e, t, i);
|
|
2553
2553
|
switch (i) {
|
|
2554
2554
|
case "scalar":
|
|
2555
|
-
s = I.PLAIN, c =
|
|
2555
|
+
s = I.PLAIN, c = Cn(a, l);
|
|
2556
2556
|
break;
|
|
2557
2557
|
case "single-quoted-scalar":
|
|
2558
|
-
s = I.QUOTE_SINGLE, c =
|
|
2558
|
+
s = I.QUOTE_SINGLE, c = wn(a, l);
|
|
2559
2559
|
break;
|
|
2560
2560
|
case "double-quoted-scalar":
|
|
2561
|
-
s = I.QUOTE_DOUBLE, c =
|
|
2561
|
+
s = I.QUOTE_DOUBLE, c = En(a, l);
|
|
2562
2562
|
break;
|
|
2563
2563
|
/* istanbul ignore next should not happen */
|
|
2564
2564
|
default: return n(e, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${i}`), {
|
|
@@ -2572,7 +2572,7 @@ function Cn(e, t, n) {
|
|
|
2572
2572
|
]
|
|
2573
2573
|
};
|
|
2574
2574
|
}
|
|
2575
|
-
let u = r + a.length, d =
|
|
2575
|
+
let u = r + a.length, d = pn(o, u, t, n);
|
|
2576
2576
|
return {
|
|
2577
2577
|
value: c,
|
|
2578
2578
|
type: s,
|
|
@@ -2584,7 +2584,7 @@ function Cn(e, t, n) {
|
|
|
2584
2584
|
]
|
|
2585
2585
|
};
|
|
2586
2586
|
}
|
|
2587
|
-
function
|
|
2587
|
+
function Cn(e, t) {
|
|
2588
2588
|
let n = "";
|
|
2589
2589
|
switch (e[0]) {
|
|
2590
2590
|
/* istanbul ignore next should not happen */
|
|
@@ -2604,12 +2604,12 @@ function wn(e, t) {
|
|
|
2604
2604
|
case "@":
|
|
2605
2605
|
case "`": n = `reserved character ${e[0]}`;
|
|
2606
2606
|
}
|
|
2607
|
-
return n && t(0, "BAD_SCALAR_START", `Plain value cannot start with ${n}`),
|
|
2607
|
+
return n && t(0, "BAD_SCALAR_START", `Plain value cannot start with ${n}`), Tn(e);
|
|
2608
2608
|
}
|
|
2609
|
-
function
|
|
2610
|
-
return (e[e.length - 1] !== "'" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing 'quote"),
|
|
2609
|
+
function wn(e, t) {
|
|
2610
|
+
return (e[e.length - 1] !== "'" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing 'quote"), Tn(e.slice(1, -1)).replace(/''/g, "'");
|
|
2611
2611
|
}
|
|
2612
|
-
function
|
|
2612
|
+
function Tn(e) {
|
|
2613
2613
|
let t, n;
|
|
2614
2614
|
try {
|
|
2615
2615
|
t = /* @__PURE__ */ RegExp("(.*?)(?<![ ])[ ]*\r?\n", "sy"), n = /* @__PURE__ */ RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n", "sy");
|
|
@@ -2623,22 +2623,22 @@ function En(e) {
|
|
|
2623
2623
|
let s = /[ \t]*(.*)/sy;
|
|
2624
2624
|
return s.lastIndex = o, r = s.exec(e), i + a + (r?.[1] ?? "");
|
|
2625
2625
|
}
|
|
2626
|
-
function
|
|
2626
|
+
function En(e, t) {
|
|
2627
2627
|
let n = "";
|
|
2628
2628
|
for (let r = 1; r < e.length - 1; ++r) {
|
|
2629
2629
|
let i = e[r];
|
|
2630
2630
|
if (i !== "\r" || e[r + 1] !== "\n") {
|
|
2631
2631
|
if (i === "\n") {
|
|
2632
|
-
let { fold: t, offset: i } =
|
|
2632
|
+
let { fold: t, offset: i } = Dn(e, r);
|
|
2633
2633
|
n += t, r = i;
|
|
2634
2634
|
} else if (i === "\\") {
|
|
2635
|
-
let i = e[++r], a =
|
|
2635
|
+
let i = e[++r], a = On[i];
|
|
2636
2636
|
if (a) n += a;
|
|
2637
2637
|
else if (i === "\n") for (i = e[r + 1]; i === " " || i === " ";) i = e[++r + 1];
|
|
2638
2638
|
else if (i === "\r" && e[r + 1] === "\n") for (i = e[++r + 1]; i === " " || i === " ";) i = e[++r + 1];
|
|
2639
2639
|
else if (i === "x" || i === "u" || i === "U") {
|
|
2640
2640
|
let a = i === "x" ? 2 : i === "u" ? 4 : 8;
|
|
2641
|
-
n +=
|
|
2641
|
+
n += kn(e, r + 1, a, t), r += a;
|
|
2642
2642
|
} else {
|
|
2643
2643
|
let i = e.substr(r - 1, 2);
|
|
2644
2644
|
t(r - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${i}`), n += i;
|
|
@@ -2652,7 +2652,7 @@ function Dn(e, t) {
|
|
|
2652
2652
|
}
|
|
2653
2653
|
return (e[e.length - 1] !== "\"" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing \"quote"), n;
|
|
2654
2654
|
}
|
|
2655
|
-
function
|
|
2655
|
+
function Dn(e, t) {
|
|
2656
2656
|
let n = "", r = e[t + 1];
|
|
2657
2657
|
for (; (r === " " || r === " " || r === "\n" || r === "\r") && (r !== "\r" || e[t + 2] === "\n");) r === "\n" && (n += "\n"), t += 1, r = e[t + 1];
|
|
2658
2658
|
return n ||= " ", {
|
|
@@ -2660,7 +2660,7 @@ function On(e, t) {
|
|
|
2660
2660
|
offset: t
|
|
2661
2661
|
};
|
|
2662
2662
|
}
|
|
2663
|
-
var
|
|
2663
|
+
var On = {
|
|
2664
2664
|
0: "\0",
|
|
2665
2665
|
a: "\x07",
|
|
2666
2666
|
b: "\b",
|
|
@@ -2680,7 +2680,7 @@ var kn = {
|
|
|
2680
2680
|
"\\": "\\",
|
|
2681
2681
|
" ": " "
|
|
2682
2682
|
};
|
|
2683
|
-
function
|
|
2683
|
+
function kn(e, t, n, r) {
|
|
2684
2684
|
let i = e.substr(t, n), a = i.length === n && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
|
|
2685
2685
|
try {
|
|
2686
2686
|
return String.fromCodePoint(a);
|
|
@@ -2691,9 +2691,9 @@ function An(e, t, n, r) {
|
|
|
2691
2691
|
}
|
|
2692
2692
|
//#endregion
|
|
2693
2693
|
//#region node_modules/yaml/browser/dist/compose/compose-scalar.js
|
|
2694
|
-
function
|
|
2695
|
-
let { value: i, type: a, comment: o, range: s } = t.type === "block-scalar" ?
|
|
2696
|
-
l = e.options.stringKeys && e.atKey ? e.schema[h] : c ?
|
|
2694
|
+
function An(e, t, n, r) {
|
|
2695
|
+
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;
|
|
2696
|
+
l = e.options.stringKeys && e.atKey ? e.schema[h] : c ? jn(e.schema, i, c, n, r) : t.type === "scalar" ? Mn(e, i, t, r) : e.schema[h];
|
|
2697
2697
|
let u;
|
|
2698
2698
|
try {
|
|
2699
2699
|
let a = l.resolve(i, (e) => r(n ?? t, "TAG_RESOLVE_FAILED", e), e.options);
|
|
@@ -2704,7 +2704,7 @@ function jn(e, t, n, r) {
|
|
|
2704
2704
|
}
|
|
2705
2705
|
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;
|
|
2706
2706
|
}
|
|
2707
|
-
function
|
|
2707
|
+
function jn(e, t, n, r, i) {
|
|
2708
2708
|
if (n === "!") return e[h];
|
|
2709
2709
|
let a = [];
|
|
2710
2710
|
for (let t of e.tags) if (!t.collection && t.tag === n) {
|
|
@@ -2718,7 +2718,7 @@ function Mn(e, t, n, r, i) {
|
|
|
2718
2718
|
test: void 0
|
|
2719
2719
|
})), o) : (i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${n}`, n !== "tag:yaml.org,2002:str"), e[h]);
|
|
2720
2720
|
}
|
|
2721
|
-
function
|
|
2721
|
+
function Mn({ atKey: e, directives: t, schema: n }, r, i, a) {
|
|
2722
2722
|
let o = n.tags.find((t) => (t.default === !0 || e && t.default === "key") && t.test?.test(r)) || n[h];
|
|
2723
2723
|
if (n.compat) {
|
|
2724
2724
|
let e = n.compat.find((e) => e.default && e.test?.test(r)) ?? n[h];
|
|
@@ -2728,7 +2728,7 @@ function Nn({ atKey: e, directives: t, schema: n }, r, i, a) {
|
|
|
2728
2728
|
}
|
|
2729
2729
|
//#endregion
|
|
2730
2730
|
//#region node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js
|
|
2731
|
-
function
|
|
2731
|
+
function Nn(e, t, n) {
|
|
2732
2732
|
if (t) {
|
|
2733
2733
|
n ??= t.length;
|
|
2734
2734
|
for (let r = n - 1; r >= 0; --r) {
|
|
@@ -2748,48 +2748,48 @@ function Pn(e, t, n) {
|
|
|
2748
2748
|
}
|
|
2749
2749
|
//#endregion
|
|
2750
2750
|
//#region node_modules/yaml/browser/dist/compose/compose-node.js
|
|
2751
|
-
var
|
|
2752
|
-
composeNode:
|
|
2753
|
-
composeEmptyNode:
|
|
2751
|
+
var Pn = {
|
|
2752
|
+
composeNode: Fn,
|
|
2753
|
+
composeEmptyNode: In
|
|
2754
2754
|
};
|
|
2755
|
-
function
|
|
2755
|
+
function Fn(e, t, n, r) {
|
|
2756
2756
|
let i = e.atKey, { spaceBefore: a, comment: o, anchor: s, tag: c } = n, l, u = !0;
|
|
2757
2757
|
switch (t.type) {
|
|
2758
2758
|
case "alias":
|
|
2759
|
-
l =
|
|
2759
|
+
l = Ln(e, t, r), (s || c) && r(t, "ALIAS_PROPS", "An alias node must not specify any properties");
|
|
2760
2760
|
break;
|
|
2761
2761
|
case "scalar":
|
|
2762
2762
|
case "single-quoted-scalar":
|
|
2763
2763
|
case "double-quoted-scalar":
|
|
2764
2764
|
case "block-scalar":
|
|
2765
|
-
l =
|
|
2765
|
+
l = An(e, t, c, r), s && (l.anchor = s.source.substring(1));
|
|
2766
2766
|
break;
|
|
2767
2767
|
case "block-map":
|
|
2768
2768
|
case "block-seq":
|
|
2769
2769
|
case "flow-collection":
|
|
2770
2770
|
try {
|
|
2771
|
-
l =
|
|
2771
|
+
l = vn(Pn, e, t, n, r), s && (l.anchor = s.source.substring(1));
|
|
2772
2772
|
} catch (e) {
|
|
2773
2773
|
r(t, "RESOURCE_EXHAUSTION", e instanceof Error ? e.message : String(e));
|
|
2774
2774
|
}
|
|
2775
2775
|
break;
|
|
2776
2776
|
default: r(t, "UNEXPECTED_TOKEN", t.type === "error" ? t.message : `Unsupported token (type: ${t.type})`), u = !1;
|
|
2777
2777
|
}
|
|
2778
|
-
return l ??=
|
|
2778
|
+
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 && (!S(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;
|
|
2779
2779
|
}
|
|
2780
|
-
function
|
|
2781
|
-
let u =
|
|
2780
|
+
function In(e, t, n, r, { spaceBefore: i, comment: a, anchor: o, tag: s, end: c }, l) {
|
|
2781
|
+
let u = An(e, {
|
|
2782
2782
|
type: "scalar",
|
|
2783
|
-
offset:
|
|
2783
|
+
offset: Nn(t, n, r),
|
|
2784
2784
|
indent: -1,
|
|
2785
2785
|
source: ""
|
|
2786
2786
|
}, s, l);
|
|
2787
2787
|
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;
|
|
2788
2788
|
}
|
|
2789
|
-
function
|
|
2789
|
+
function Ln({ options: e }, { offset: t, source: n, end: r }, i) {
|
|
2790
2790
|
let a = new de(n.substring(1));
|
|
2791
2791
|
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);
|
|
2792
|
-
let o = t + n.length, s =
|
|
2792
|
+
let o = t + n.length, s = pn(r, o, e.strict, i);
|
|
2793
2793
|
return a.range = [
|
|
2794
2794
|
t,
|
|
2795
2795
|
o,
|
|
@@ -2798,14 +2798,14 @@ function Rn({ options: e }, { offset: t, source: n, end: r }, i) {
|
|
|
2798
2798
|
}
|
|
2799
2799
|
//#endregion
|
|
2800
2800
|
//#region node_modules/yaml/browser/dist/compose/compose-doc.js
|
|
2801
|
-
function
|
|
2802
|
-
let s = new
|
|
2801
|
+
function Rn(e, t, { offset: n, start: r, value: i, end: a }, o) {
|
|
2802
|
+
let s = new $t(void 0, Object.assign({ _directives: t }, e)), c = {
|
|
2803
2803
|
atKey: !1,
|
|
2804
2804
|
atRoot: !0,
|
|
2805
2805
|
directives: s.directives,
|
|
2806
2806
|
options: s.options,
|
|
2807
2807
|
schema: s.schema
|
|
2808
|
-
}, l =
|
|
2808
|
+
}, l = on(r, {
|
|
2809
2809
|
indicator: "doc-start",
|
|
2810
2810
|
next: i ?? a?.[0],
|
|
2811
2811
|
offset: n,
|
|
@@ -2813,8 +2813,8 @@ function zn(e, t, { offset: n, start: r, value: i, end: a }, o) {
|
|
|
2813
2813
|
parentIndent: 0,
|
|
2814
2814
|
startOnNewline: !0
|
|
2815
2815
|
});
|
|
2816
|
-
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 ?
|
|
2817
|
-
let u = s.contents.range[2], d =
|
|
2816
|
+
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);
|
|
2817
|
+
let u = s.contents.range[2], d = pn(a, u, !1, o);
|
|
2818
2818
|
return d.comment && (s.comment = d.comment), s.range = [
|
|
2819
2819
|
n,
|
|
2820
2820
|
u,
|
|
@@ -2823,13 +2823,13 @@ function zn(e, t, { offset: n, start: r, value: i, end: a }, o) {
|
|
|
2823
2823
|
}
|
|
2824
2824
|
//#endregion
|
|
2825
2825
|
//#region node_modules/yaml/browser/dist/compose/composer.js
|
|
2826
|
-
function
|
|
2826
|
+
function zn(e) {
|
|
2827
2827
|
if (typeof e == "number") return [e, e + 1];
|
|
2828
2828
|
if (Array.isArray(e)) return e.length === 2 ? e : [e[0], e[1]];
|
|
2829
2829
|
let { offset: t, source: n } = e;
|
|
2830
2830
|
return [t, t + (typeof n == "string" ? n.length : 1)];
|
|
2831
2831
|
}
|
|
2832
|
-
function
|
|
2832
|
+
function Bn(e) {
|
|
2833
2833
|
let t = "", n = !1, r = !1;
|
|
2834
2834
|
for (let i = 0; i < e.length; ++i) {
|
|
2835
2835
|
let a = e[i];
|
|
@@ -2848,15 +2848,15 @@ function Vn(e) {
|
|
|
2848
2848
|
afterEmptyLine: r
|
|
2849
2849
|
};
|
|
2850
2850
|
}
|
|
2851
|
-
var
|
|
2851
|
+
var Vn = class {
|
|
2852
2852
|
constructor(e = {}) {
|
|
2853
2853
|
this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (e, t, n, r) => {
|
|
2854
|
-
let i =
|
|
2855
|
-
r ? this.warnings.push(new
|
|
2854
|
+
let i = zn(e);
|
|
2855
|
+
r ? this.warnings.push(new rn(i, t, n)) : this.errors.push(new nn(i, t, n));
|
|
2856
2856
|
}, this.directives = new N({ version: e.version || "1.2" }), this.options = e;
|
|
2857
2857
|
}
|
|
2858
2858
|
decorate(e, t) {
|
|
2859
|
-
let { comment: n, afterEmptyLine: r } =
|
|
2859
|
+
let { comment: n, afterEmptyLine: r } = Bn(this.prelude);
|
|
2860
2860
|
if (n) {
|
|
2861
2861
|
let i = e.contents;
|
|
2862
2862
|
if (t) e.comment = e.comment ? `${e.comment}\n${n}` : n;
|
|
@@ -2879,7 +2879,7 @@ var Hn = class {
|
|
|
2879
2879
|
}
|
|
2880
2880
|
streamInfo() {
|
|
2881
2881
|
return {
|
|
2882
|
-
comment:
|
|
2882
|
+
comment: Bn(this.prelude).comment,
|
|
2883
2883
|
directives: this.directives,
|
|
2884
2884
|
errors: this.errors,
|
|
2885
2885
|
warnings: this.warnings
|
|
@@ -2893,12 +2893,12 @@ var Hn = class {
|
|
|
2893
2893
|
switch (e.type) {
|
|
2894
2894
|
case "directive":
|
|
2895
2895
|
this.directives.add(e.source, (t, n, r) => {
|
|
2896
|
-
let i =
|
|
2896
|
+
let i = zn(e);
|
|
2897
2897
|
i[0] += t, this.onError(i, "BAD_DIRECTIVE", n, r);
|
|
2898
2898
|
}), this.prelude.push(e.source), this.atDirectives = !0;
|
|
2899
2899
|
break;
|
|
2900
2900
|
case "document": {
|
|
2901
|
-
let t =
|
|
2901
|
+
let t = Rn(this.options, this.directives, e, this.onError);
|
|
2902
2902
|
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;
|
|
2903
2903
|
break;
|
|
2904
2904
|
}
|
|
@@ -2909,17 +2909,17 @@ var Hn = class {
|
|
|
2909
2909
|
this.prelude.push(e.source);
|
|
2910
2910
|
break;
|
|
2911
2911
|
case "error": {
|
|
2912
|
-
let t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new
|
|
2912
|
+
let t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new nn(zn(e), "UNEXPECTED_TOKEN", t);
|
|
2913
2913
|
this.atDirectives || !this.doc ? this.errors.push(n) : this.doc.errors.push(n);
|
|
2914
2914
|
break;
|
|
2915
2915
|
}
|
|
2916
2916
|
case "doc-end": {
|
|
2917
2917
|
if (!this.doc) {
|
|
2918
|
-
this.errors.push(new
|
|
2918
|
+
this.errors.push(new nn(zn(e), "UNEXPECTED_TOKEN", "Unexpected doc-end without preceding document"));
|
|
2919
2919
|
break;
|
|
2920
2920
|
}
|
|
2921
2921
|
this.doc.directives.docEnd = !0;
|
|
2922
|
-
let t =
|
|
2922
|
+
let t = pn(e.end, e.offset + e.source.length, this.doc.options.strict, this.onError);
|
|
2923
2923
|
if (this.decorate(this.doc, !0), t.comment) {
|
|
2924
2924
|
let e = this.doc.comment;
|
|
2925
2925
|
this.doc.comment = e ? `${e}\n${t.comment}` : t.comment;
|
|
@@ -2927,13 +2927,13 @@ var Hn = class {
|
|
|
2927
2927
|
this.doc.range[2] = t.offset;
|
|
2928
2928
|
break;
|
|
2929
2929
|
}
|
|
2930
|
-
default: this.errors.push(new
|
|
2930
|
+
default: this.errors.push(new nn(zn(e), "UNEXPECTED_TOKEN", `Unsupported token ${e.type}`));
|
|
2931
2931
|
}
|
|
2932
2932
|
}
|
|
2933
2933
|
*end(e = !1, t = -1) {
|
|
2934
2934
|
if (this.doc) this.decorate(this.doc, !0), yield this.doc, this.doc = null;
|
|
2935
2935
|
else if (e) {
|
|
2936
|
-
let e = new
|
|
2936
|
+
let e = new $t(void 0, Object.assign({ _directives: this.directives }, this.options));
|
|
2937
2937
|
this.atDirectives && this.onError(t, "MISSING_CHAR", "Missing directives-end indicator line"), e.range = [
|
|
2938
2938
|
0,
|
|
2939
2939
|
t,
|
|
@@ -2944,24 +2944,24 @@ var Hn = class {
|
|
|
2944
2944
|
};
|
|
2945
2945
|
//#endregion
|
|
2946
2946
|
//#region node_modules/yaml/browser/dist/parse/cst-scalar.js
|
|
2947
|
-
function
|
|
2947
|
+
function Hn(e, t = !0, n) {
|
|
2948
2948
|
if (e) {
|
|
2949
2949
|
let r = (e, t, r) => {
|
|
2950
2950
|
let i = typeof e == "number" ? e : Array.isArray(e) ? e[0] : e.offset;
|
|
2951
2951
|
if (n) n(i, t, r);
|
|
2952
|
-
else throw new
|
|
2952
|
+
else throw new nn([i, i + 1], t, r);
|
|
2953
2953
|
};
|
|
2954
2954
|
switch (e.type) {
|
|
2955
2955
|
case "scalar":
|
|
2956
2956
|
case "single-quoted-scalar":
|
|
2957
|
-
case "double-quoted-scalar": return
|
|
2958
|
-
case "block-scalar": return
|
|
2957
|
+
case "double-quoted-scalar": return Sn(e, t, r);
|
|
2958
|
+
case "block-scalar": return yn({ options: { strict: t } }, e, r);
|
|
2959
2959
|
}
|
|
2960
2960
|
}
|
|
2961
2961
|
return null;
|
|
2962
2962
|
}
|
|
2963
|
-
function
|
|
2964
|
-
let { implicitKey: n = !1, indent: r, inFlow: i = !1, offset: a = -1, type: o = "PLAIN" } = t, s =
|
|
2963
|
+
function Un(e, t) {
|
|
2964
|
+
let { implicitKey: n = !1, indent: r, inFlow: i = !1, offset: a = -1, type: o = "PLAIN" } = t, s = Ne({
|
|
2965
2965
|
type: o,
|
|
2966
2966
|
value: e
|
|
2967
2967
|
}, {
|
|
@@ -2987,7 +2987,7 @@ function Wn(e, t) {
|
|
|
2987
2987
|
indent: r,
|
|
2988
2988
|
source: t
|
|
2989
2989
|
}];
|
|
2990
|
-
return
|
|
2990
|
+
return Kn(i, c) || i.push({
|
|
2991
2991
|
type: "newline",
|
|
2992
2992
|
offset: -1,
|
|
2993
2993
|
indent: r,
|
|
@@ -3023,7 +3023,7 @@ function Wn(e, t) {
|
|
|
3023
3023
|
};
|
|
3024
3024
|
}
|
|
3025
3025
|
}
|
|
3026
|
-
function
|
|
3026
|
+
function Wn(e, t, n = {}) {
|
|
3027
3027
|
let { afterKey: r = !1, implicitKey: i = !1, inFlow: a = !1, type: o } = n, s = "indent" in e ? e.indent : null;
|
|
3028
3028
|
if (r && typeof s == "number" && (s += 2), !o) switch (e.type) {
|
|
3029
3029
|
case "single-quoted-scalar":
|
|
@@ -3040,7 +3040,7 @@ function Gn(e, t, n = {}) {
|
|
|
3040
3040
|
}
|
|
3041
3041
|
default: o = "PLAIN";
|
|
3042
3042
|
}
|
|
3043
|
-
let c =
|
|
3043
|
+
let c = Ne({
|
|
3044
3044
|
type: o,
|
|
3045
3045
|
value: t
|
|
3046
3046
|
}, {
|
|
@@ -3055,18 +3055,18 @@ function Gn(e, t, n = {}) {
|
|
|
3055
3055
|
switch (c[0]) {
|
|
3056
3056
|
case "|":
|
|
3057
3057
|
case ">":
|
|
3058
|
-
|
|
3058
|
+
Gn(e, c);
|
|
3059
3059
|
break;
|
|
3060
3060
|
case "\"":
|
|
3061
|
-
|
|
3061
|
+
qn(e, c, "double-quoted-scalar");
|
|
3062
3062
|
break;
|
|
3063
3063
|
case "'":
|
|
3064
|
-
|
|
3064
|
+
qn(e, c, "single-quoted-scalar");
|
|
3065
3065
|
break;
|
|
3066
|
-
default:
|
|
3066
|
+
default: qn(e, c, "scalar");
|
|
3067
3067
|
}
|
|
3068
3068
|
}
|
|
3069
|
-
function
|
|
3069
|
+
function Gn(e, t) {
|
|
3070
3070
|
let n = t.indexOf("\n"), r = t.substring(0, n), i = t.substring(n + 1) + "\n";
|
|
3071
3071
|
if (e.type === "block-scalar") {
|
|
3072
3072
|
let t = e.props[0];
|
|
@@ -3079,7 +3079,7 @@ function Kn(e, t) {
|
|
|
3079
3079
|
indent: n,
|
|
3080
3080
|
source: r
|
|
3081
3081
|
}];
|
|
3082
|
-
|
|
3082
|
+
Kn(a, "end" in e ? e.end : void 0) || a.push({
|
|
3083
3083
|
type: "newline",
|
|
3084
3084
|
offset: -1,
|
|
3085
3085
|
indent: n,
|
|
@@ -3094,7 +3094,7 @@ function Kn(e, t) {
|
|
|
3094
3094
|
});
|
|
3095
3095
|
}
|
|
3096
3096
|
}
|
|
3097
|
-
function
|
|
3097
|
+
function Kn(e, t) {
|
|
3098
3098
|
if (t) for (let n of t) switch (n.type) {
|
|
3099
3099
|
case "space":
|
|
3100
3100
|
case "comment":
|
|
@@ -3104,7 +3104,7 @@ function qn(e, t) {
|
|
|
3104
3104
|
}
|
|
3105
3105
|
return !1;
|
|
3106
3106
|
}
|
|
3107
|
-
function
|
|
3107
|
+
function qn(e, t, n) {
|
|
3108
3108
|
switch (e.type) {
|
|
3109
3109
|
case "scalar":
|
|
3110
3110
|
case "double-quoted-scalar":
|
|
@@ -3151,28 +3151,28 @@ function Jn(e, t, n) {
|
|
|
3151
3151
|
}
|
|
3152
3152
|
//#endregion
|
|
3153
3153
|
//#region node_modules/yaml/browser/dist/parse/cst-stringify.js
|
|
3154
|
-
var
|
|
3155
|
-
function
|
|
3154
|
+
var Jn = (e) => "type" in e ? Yn(e) : Xn(e);
|
|
3155
|
+
function Yn(e) {
|
|
3156
3156
|
switch (e.type) {
|
|
3157
3157
|
case "block-scalar": {
|
|
3158
3158
|
let t = "";
|
|
3159
|
-
for (let n of e.props) t +=
|
|
3159
|
+
for (let n of e.props) t += Yn(n);
|
|
3160
3160
|
return t + e.source;
|
|
3161
3161
|
}
|
|
3162
3162
|
case "block-map":
|
|
3163
3163
|
case "block-seq": {
|
|
3164
3164
|
let t = "";
|
|
3165
|
-
for (let n of e.items) t +=
|
|
3165
|
+
for (let n of e.items) t += Xn(n);
|
|
3166
3166
|
return t;
|
|
3167
3167
|
}
|
|
3168
3168
|
case "flow-collection": {
|
|
3169
3169
|
let t = e.start.source;
|
|
3170
|
-
for (let n of e.items) t +=
|
|
3170
|
+
for (let n of e.items) t += Xn(n);
|
|
3171
3171
|
for (let n of e.end) t += n.source;
|
|
3172
3172
|
return t;
|
|
3173
3173
|
}
|
|
3174
3174
|
case "document": {
|
|
3175
|
-
let t =
|
|
3175
|
+
let t = Xn(e);
|
|
3176
3176
|
if (e.end) for (let n of e.end) t += n.source;
|
|
3177
3177
|
return t;
|
|
3178
3178
|
}
|
|
@@ -3183,22 +3183,22 @@ function Xn(e) {
|
|
|
3183
3183
|
}
|
|
3184
3184
|
}
|
|
3185
3185
|
}
|
|
3186
|
-
function
|
|
3186
|
+
function Xn({ start: e, key: t, sep: n, value: r }) {
|
|
3187
3187
|
let i = "";
|
|
3188
3188
|
for (let t of e) i += t.source;
|
|
3189
|
-
if (t && (i +=
|
|
3190
|
-
return r && (i +=
|
|
3189
|
+
if (t && (i += Yn(t)), n) for (let e of n) i += e.source;
|
|
3190
|
+
return r && (i += Yn(r)), i;
|
|
3191
3191
|
}
|
|
3192
3192
|
//#endregion
|
|
3193
3193
|
//#region node_modules/yaml/browser/dist/parse/cst-visit.js
|
|
3194
|
-
var
|
|
3195
|
-
function
|
|
3194
|
+
var Zn = Symbol("break visit"), Qn = Symbol("skip children"), $n = Symbol("remove item");
|
|
3195
|
+
function er(e, t) {
|
|
3196
3196
|
"type" in e && e.type === "document" && (e = {
|
|
3197
3197
|
start: e.start,
|
|
3198
3198
|
value: e.value
|
|
3199
|
-
}),
|
|
3199
|
+
}), tr(Object.freeze([]), e, t);
|
|
3200
3200
|
}
|
|
3201
|
-
|
|
3201
|
+
er.BREAK = Zn, er.SKIP = Qn, er.REMOVE = $n, er.itemAtPath = (e, t) => {
|
|
3202
3202
|
let n = e;
|
|
3203
3203
|
for (let [e, r] of t) {
|
|
3204
3204
|
let t = n?.[e];
|
|
@@ -3206,22 +3206,22 @@ tr.BREAK = Qn, tr.SKIP = $n, tr.REMOVE = er, tr.itemAtPath = (e, t) => {
|
|
|
3206
3206
|
else return;
|
|
3207
3207
|
}
|
|
3208
3208
|
return n;
|
|
3209
|
-
},
|
|
3210
|
-
let n =
|
|
3209
|
+
}, er.parentCollection = (e, t) => {
|
|
3210
|
+
let n = er.itemAtPath(e, t.slice(0, -1)), r = t[t.length - 1][0], i = n?.[r];
|
|
3211
3211
|
if (i && "items" in i) return i;
|
|
3212
3212
|
throw Error("Parent collection not found");
|
|
3213
3213
|
};
|
|
3214
|
-
function
|
|
3214
|
+
function tr(e, t, n) {
|
|
3215
3215
|
let r = n(t, e);
|
|
3216
3216
|
if (typeof r == "symbol") return r;
|
|
3217
3217
|
for (let i of ["key", "value"]) {
|
|
3218
3218
|
let a = t[i];
|
|
3219
3219
|
if (a && "items" in a) {
|
|
3220
3220
|
for (let t = 0; t < a.items.length; ++t) {
|
|
3221
|
-
let r =
|
|
3221
|
+
let r = tr(Object.freeze(e.concat([[i, t]])), a.items[t], n);
|
|
3222
3222
|
if (typeof r == "number") t = r - 1;
|
|
3223
|
-
else if (r ===
|
|
3224
|
-
else r ===
|
|
3223
|
+
else if (r === Zn) return Zn;
|
|
3224
|
+
else r === $n && (a.items.splice(t, 1), --t);
|
|
3225
3225
|
}
|
|
3226
3226
|
typeof r == "function" && i === "key" && (r = r(t, e));
|
|
3227
3227
|
}
|
|
@@ -3230,23 +3230,23 @@ function nr(e, t, n) {
|
|
|
3230
3230
|
}
|
|
3231
3231
|
//#endregion
|
|
3232
3232
|
//#region node_modules/yaml/browser/dist/parse/cst.js
|
|
3233
|
-
var
|
|
3233
|
+
var nr = /* @__PURE__ */ a({
|
|
3234
3234
|
BOM: () => "",
|
|
3235
3235
|
DOCUMENT: () => "",
|
|
3236
3236
|
FLOW_END: () => "",
|
|
3237
3237
|
SCALAR: () => "",
|
|
3238
|
-
createScalarToken: () =>
|
|
3239
|
-
isCollection: () =>
|
|
3240
|
-
isScalar: () =>
|
|
3241
|
-
prettyToken: () =>
|
|
3242
|
-
resolveAsScalar: () =>
|
|
3243
|
-
setScalarValue: () =>
|
|
3244
|
-
stringify: () =>
|
|
3245
|
-
tokenType: () =>
|
|
3246
|
-
visit: () =>
|
|
3247
|
-
}),
|
|
3238
|
+
createScalarToken: () => Un,
|
|
3239
|
+
isCollection: () => rr,
|
|
3240
|
+
isScalar: () => ir,
|
|
3241
|
+
prettyToken: () => ar,
|
|
3242
|
+
resolveAsScalar: () => Hn,
|
|
3243
|
+
setScalarValue: () => Wn,
|
|
3244
|
+
stringify: () => Jn,
|
|
3245
|
+
tokenType: () => or,
|
|
3246
|
+
visit: () => er
|
|
3247
|
+
}), rr = (e) => !!e && "items" in e, ir = (e) => !!e && (e.type === "scalar" || e.type === "single-quoted-scalar" || e.type === "double-quoted-scalar" || e.type === "block-scalar");
|
|
3248
3248
|
/* istanbul ignore next */
|
|
3249
|
-
function
|
|
3249
|
+
function ar(e) {
|
|
3250
3250
|
switch (e) {
|
|
3251
3251
|
case "": return "<BOM>";
|
|
3252
3252
|
case "": return "<DOC>";
|
|
@@ -3255,7 +3255,7 @@ function or(e) {
|
|
|
3255
3255
|
default: return JSON.stringify(e);
|
|
3256
3256
|
}
|
|
3257
3257
|
}
|
|
3258
|
-
function
|
|
3258
|
+
function or(e) {
|
|
3259
3259
|
switch (e) {
|
|
3260
3260
|
case "": return "byte-order-mark";
|
|
3261
3261
|
case "": return "doc-mode";
|
|
@@ -3292,7 +3292,7 @@ function sr(e) {
|
|
|
3292
3292
|
}
|
|
3293
3293
|
//#endregion
|
|
3294
3294
|
//#region node_modules/yaml/browser/dist/parse/lexer.js
|
|
3295
|
-
function
|
|
3295
|
+
function K(e) {
|
|
3296
3296
|
switch (e) {
|
|
3297
3297
|
case void 0:
|
|
3298
3298
|
case " ":
|
|
@@ -3302,7 +3302,7 @@ function G(e) {
|
|
|
3302
3302
|
default: return !1;
|
|
3303
3303
|
}
|
|
3304
3304
|
}
|
|
3305
|
-
var
|
|
3305
|
+
var sr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), cr = /* @__PURE__ */ new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), lr = /* @__PURE__ */ new Set(",[]{}"), ur = /* @__PURE__ */ new Set(" ,[]{}\n\r "), dr = (e) => !e || ur.has(e), fr = class {
|
|
3306
3306
|
constructor() {
|
|
3307
3307
|
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;
|
|
3308
3308
|
}
|
|
@@ -3336,7 +3336,7 @@ var cr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), lr = /* @__PURE__ */
|
|
|
3336
3336
|
}
|
|
3337
3337
|
if (t === "-" || t === ".") {
|
|
3338
3338
|
let t = this.buffer.substr(e, 3);
|
|
3339
|
-
if ((t === "---" || t === "...") &&
|
|
3339
|
+
if ((t === "---" || t === "...") && K(this.buffer[e + 3])) return -1;
|
|
3340
3340
|
}
|
|
3341
3341
|
return e;
|
|
3342
3342
|
}
|
|
@@ -3398,14 +3398,14 @@ var cr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), lr = /* @__PURE__ */
|
|
|
3398
3398
|
if (e === "-" || e === ".") {
|
|
3399
3399
|
if (!this.atEnd && !this.hasChars(4)) return this.setNext("line-start");
|
|
3400
3400
|
let e = this.peek(3);
|
|
3401
|
-
if ((e === "---" || e === "...") &&
|
|
3401
|
+
if ((e === "---" || e === "...") && K(this.charAt(3))) return yield* this.pushCount(3), this.indentValue = 0, this.indentNext = 0, e === "---" ? "doc" : "stream";
|
|
3402
3402
|
}
|
|
3403
|
-
return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !
|
|
3403
|
+
return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !K(this.charAt(1)) && (this.indentNext = this.indentValue), yield* this.parseBlockStart();
|
|
3404
3404
|
}
|
|
3405
3405
|
*parseBlockStart() {
|
|
3406
3406
|
let [e, t] = this.peek(2);
|
|
3407
3407
|
if (!t && !this.atEnd) return this.setNext("block-start");
|
|
3408
|
-
if ((e === "-" || e === "?" || e === ":") &&
|
|
3408
|
+
if ((e === "-" || e === "?" || e === ":") && K(t)) {
|
|
3409
3409
|
let e = (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0));
|
|
3410
3410
|
return this.indentNext = this.indentValue + 1, this.indentValue += e, "block-start";
|
|
3411
3411
|
}
|
|
@@ -3423,7 +3423,7 @@ var cr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), lr = /* @__PURE__ */
|
|
|
3423
3423
|
case "[": return yield* this.pushCount(1), this.flowKey = !1, this.flowLevel = 1, "flow";
|
|
3424
3424
|
case "}":
|
|
3425
3425
|
case "]": return yield* this.pushCount(1), "doc";
|
|
3426
|
-
case "*": return yield* this.pushUntil(
|
|
3426
|
+
case "*": return yield* this.pushUntil(dr), "doc";
|
|
3427
3427
|
case "\"":
|
|
3428
3428
|
case "'": return yield* this.parseQuotedScalar();
|
|
3429
3429
|
case "|":
|
|
@@ -3438,7 +3438,7 @@ var cr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), lr = /* @__PURE__ */
|
|
|
3438
3438
|
while (e + t > 0);
|
|
3439
3439
|
let r = this.getLine();
|
|
3440
3440
|
if (r === null) return this.setNext("flow");
|
|
3441
|
-
if ((n !== -1 && n < this.indentNext && r[0] !== "#" || n === 0 && (r.startsWith("---") || r.startsWith("...")) &&
|
|
3441
|
+
if ((n !== -1 && n < this.indentNext && r[0] !== "#" || n === 0 && (r.startsWith("---") || r.startsWith("...")) && K(r[3])) && (n !== this.indentNext - 1 || this.flowLevel !== 1 || r[0] !== "]" && r[0] !== "}")) return this.flowLevel = 0, yield "", yield* this.parseLineStart();
|
|
3442
3442
|
let i = 0;
|
|
3443
3443
|
for (; r[i] === ",";) i += yield* this.pushCount(1), i += yield* this.pushSpaces(!0), this.flowKey = !1;
|
|
3444
3444
|
switch (i += yield* this.pushIndicators(), r[i]) {
|
|
@@ -3448,12 +3448,12 @@ var cr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), lr = /* @__PURE__ */
|
|
|
3448
3448
|
case "[": return yield* this.pushCount(1), this.flowKey = !1, this.flowLevel += 1, "flow";
|
|
3449
3449
|
case "}":
|
|
3450
3450
|
case "]": return yield* this.pushCount(1), this.flowKey = !0, --this.flowLevel, this.flowLevel ? "flow" : "doc";
|
|
3451
|
-
case "*": return yield* this.pushUntil(
|
|
3451
|
+
case "*": return yield* this.pushUntil(dr), "flow";
|
|
3452
3452
|
case "\"":
|
|
3453
3453
|
case "'": return this.flowKey = !0, yield* this.parseQuotedScalar();
|
|
3454
3454
|
case ":": {
|
|
3455
3455
|
let e = this.charAt(1);
|
|
3456
|
-
if (this.flowKey ||
|
|
3456
|
+
if (this.flowKey || K(e) || e === ",") return this.flowKey = !1, yield* this.pushCount(1), yield* this.pushSpaces(!0), "flow";
|
|
3457
3457
|
}
|
|
3458
3458
|
default: return this.flowKey = !1, yield* this.parsePlainScalar();
|
|
3459
3459
|
}
|
|
@@ -3491,7 +3491,7 @@ var cr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), lr = /* @__PURE__ */
|
|
|
3491
3491
|
else if (t > "0" && t <= "9") this.blockScalarIndent = Number(t) - 1;
|
|
3492
3492
|
else if (t !== "-") break;
|
|
3493
3493
|
}
|
|
3494
|
-
return yield* this.pushUntil((e) =>
|
|
3494
|
+
return yield* this.pushUntil((e) => K(e) || e === "#");
|
|
3495
3495
|
}
|
|
3496
3496
|
*parseBlockScalar() {
|
|
3497
3497
|
let e = this.pos - 1, t = 0, n;
|
|
@@ -3541,18 +3541,18 @@ var cr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), lr = /* @__PURE__ */
|
|
|
3541
3541
|
let e = this.flowLevel > 0, t = this.pos - 1, n = this.pos - 1, r;
|
|
3542
3542
|
for (; r = this.buffer[++n];) if (r === ":") {
|
|
3543
3543
|
let r = this.buffer[n + 1];
|
|
3544
|
-
if (
|
|
3544
|
+
if (K(r) || e && lr.has(r)) break;
|
|
3545
3545
|
t = n;
|
|
3546
|
-
} else if (
|
|
3546
|
+
} else if (K(r)) {
|
|
3547
3547
|
let i = this.buffer[n + 1];
|
|
3548
|
-
if (r === "\r" && (i === "\n" ? (n += 1, r = "\n", i = this.buffer[n + 1]) : t = n), i === "#" || e &&
|
|
3548
|
+
if (r === "\r" && (i === "\n" ? (n += 1, r = "\n", i = this.buffer[n + 1]) : t = n), i === "#" || e && lr.has(i)) break;
|
|
3549
3549
|
if (r === "\n") {
|
|
3550
3550
|
let e = this.continueScalar(n + 1);
|
|
3551
3551
|
if (e === -1) break;
|
|
3552
3552
|
n = Math.max(n, e - 2);
|
|
3553
3553
|
}
|
|
3554
3554
|
} else {
|
|
3555
|
-
if (e &&
|
|
3555
|
+
if (e && lr.has(r)) break;
|
|
3556
3556
|
t = n;
|
|
3557
3557
|
}
|
|
3558
3558
|
return !r && !this.atEnd ? this.setNext("plain-scalar") : (yield "", yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
|
|
@@ -3572,13 +3572,13 @@ var cr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), lr = /* @__PURE__ */
|
|
|
3572
3572
|
e += yield* this.pushTag(), e += yield* this.pushSpaces(!0);
|
|
3573
3573
|
continue loop;
|
|
3574
3574
|
case "&":
|
|
3575
|
-
e += yield* this.pushUntil(
|
|
3575
|
+
e += yield* this.pushUntil(dr), e += yield* this.pushSpaces(!0);
|
|
3576
3576
|
continue loop;
|
|
3577
3577
|
case "-":
|
|
3578
3578
|
case "?":
|
|
3579
3579
|
case ":": {
|
|
3580
3580
|
let t = this.flowLevel > 0, n = this.charAt(1);
|
|
3581
|
-
if (
|
|
3581
|
+
if (K(n) || t && lr.has(n)) {
|
|
3582
3582
|
t ? this.flowKey &&= !1 : this.indentNext = this.indentValue + 1, e += yield* this.pushCount(1), e += yield* this.pushSpaces(!0);
|
|
3583
3583
|
continue loop;
|
|
3584
3584
|
}
|
|
@@ -3591,13 +3591,13 @@ var cr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), lr = /* @__PURE__ */
|
|
|
3591
3591
|
*pushTag() {
|
|
3592
3592
|
if (this.charAt(1) === "<") {
|
|
3593
3593
|
let e = this.pos + 2, t = this.buffer[e];
|
|
3594
|
-
for (; !
|
|
3594
|
+
for (; !K(t) && t !== ">";) t = this.buffer[++e];
|
|
3595
3595
|
return yield* this.pushToIndex(t === ">" ? e + 1 : e, !1);
|
|
3596
3596
|
}
|
|
3597
3597
|
{
|
|
3598
3598
|
let e = this.pos + 1, t = this.buffer[e];
|
|
3599
|
-
for (; t;) if (
|
|
3600
|
-
else if (t === "%" &&
|
|
3599
|
+
for (; t;) if (cr.has(t)) t = this.buffer[++e];
|
|
3600
|
+
else if (t === "%" && sr.has(this.buffer[e + 1]) && sr.has(this.buffer[e + 2])) t = this.buffer[e += 3];
|
|
3601
3601
|
else break;
|
|
3602
3602
|
return yield* this.pushToIndex(e, !1);
|
|
3603
3603
|
}
|
|
@@ -3619,7 +3619,7 @@ var cr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), lr = /* @__PURE__ */
|
|
|
3619
3619
|
for (; !e(n);) n = this.buffer[++t];
|
|
3620
3620
|
return yield* this.pushToIndex(t, !1);
|
|
3621
3621
|
}
|
|
3622
|
-
},
|
|
3622
|
+
}, pr = class {
|
|
3623
3623
|
constructor() {
|
|
3624
3624
|
this.lineStarts = [], this.addNewLine = (e) => this.lineStarts.push(e), this.linePos = (e) => {
|
|
3625
3625
|
let t = 0, n = this.lineStarts.length;
|
|
@@ -3645,11 +3645,11 @@ var cr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), lr = /* @__PURE__ */
|
|
|
3645
3645
|
};
|
|
3646
3646
|
//#endregion
|
|
3647
3647
|
//#region node_modules/yaml/browser/dist/parse/parser.js
|
|
3648
|
-
function
|
|
3648
|
+
function mr(e, t) {
|
|
3649
3649
|
for (let n = 0; n < e.length; ++n) if (e[n].type === t) return !0;
|
|
3650
3650
|
return !1;
|
|
3651
3651
|
}
|
|
3652
|
-
function
|
|
3652
|
+
function hr(e) {
|
|
3653
3653
|
for (let t = 0; t < e.length; ++t) switch (e[t].type) {
|
|
3654
3654
|
case "space":
|
|
3655
3655
|
case "comment":
|
|
@@ -3658,7 +3658,7 @@ function gr(e) {
|
|
|
3658
3658
|
}
|
|
3659
3659
|
return -1;
|
|
3660
3660
|
}
|
|
3661
|
-
function
|
|
3661
|
+
function gr(e) {
|
|
3662
3662
|
switch (e?.type) {
|
|
3663
3663
|
case "alias":
|
|
3664
3664
|
case "scalar":
|
|
@@ -3668,7 +3668,7 @@ function _r(e) {
|
|
|
3668
3668
|
default: return !1;
|
|
3669
3669
|
}
|
|
3670
3670
|
}
|
|
3671
|
-
function
|
|
3671
|
+
function _r(e) {
|
|
3672
3672
|
switch (e.type) {
|
|
3673
3673
|
case "document": return e.start;
|
|
3674
3674
|
case "block-map": {
|
|
@@ -3680,7 +3680,7 @@ function vr(e) {
|
|
|
3680
3680
|
default: return [];
|
|
3681
3681
|
}
|
|
3682
3682
|
}
|
|
3683
|
-
function
|
|
3683
|
+
function vr(e) {
|
|
3684
3684
|
if (e.length === 0) return [];
|
|
3685
3685
|
let t = e.length;
|
|
3686
3686
|
loop: for (; --t >= 0;) switch (e[t].type) {
|
|
@@ -3693,16 +3693,16 @@ function yr(e) {
|
|
|
3693
3693
|
for (; e[++t]?.type === "space";);
|
|
3694
3694
|
return e.splice(t, e.length);
|
|
3695
3695
|
}
|
|
3696
|
-
function
|
|
3696
|
+
function yr(e, t) {
|
|
3697
3697
|
if (t.length < 1e5) Array.prototype.push.apply(e, t);
|
|
3698
3698
|
else for (let n = 0; n < t.length; ++n) e.push(t[n]);
|
|
3699
3699
|
}
|
|
3700
|
-
function
|
|
3701
|
-
if (e.start.type === "flow-seq-start") for (let t of e.items) t.sep && !t.value && !
|
|
3700
|
+
function br(e) {
|
|
3701
|
+
if (e.start.type === "flow-seq-start") for (let t of e.items) t.sep && !t.value && !mr(t.start, "explicit-key-ind") && !mr(t.sep, "map-value-ind") && (t.key && (t.value = t.key), delete t.key, gr(t.value) ? t.value.end ? yr(t.value.end, t.sep) : t.value.end = t.sep : yr(t.start, t.sep), delete t.sep);
|
|
3702
3702
|
}
|
|
3703
|
-
var
|
|
3703
|
+
var xr = class {
|
|
3704
3704
|
constructor(e) {
|
|
3705
|
-
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new
|
|
3705
|
+
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new fr(), this.onNewLine = e;
|
|
3706
3706
|
}
|
|
3707
3707
|
*parse(e, t = !1) {
|
|
3708
3708
|
this.onNewLine && this.offset === 0 && this.onNewLine(0);
|
|
@@ -3714,7 +3714,7 @@ var Sr = class {
|
|
|
3714
3714
|
this.atScalar = !1, yield* this.step(), this.offset += e.length;
|
|
3715
3715
|
return;
|
|
3716
3716
|
}
|
|
3717
|
-
let t =
|
|
3717
|
+
let t = or(e);
|
|
3718
3718
|
if (!t) {
|
|
3719
3719
|
let t = `Not a YAML token: ${e}`;
|
|
3720
3720
|
yield* this.pop({
|
|
@@ -3797,7 +3797,7 @@ var Sr = class {
|
|
|
3797
3797
|
else if (this.stack.length === 0) yield t;
|
|
3798
3798
|
else {
|
|
3799
3799
|
let e = this.peek(1);
|
|
3800
|
-
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" &&
|
|
3800
|
+
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" && br(t), e.type) {
|
|
3801
3801
|
case "document":
|
|
3802
3802
|
e.value = t;
|
|
3803
3803
|
break;
|
|
@@ -3849,7 +3849,7 @@ var Sr = class {
|
|
|
3849
3849
|
}
|
|
3850
3850
|
if ((e.type === "document" || e.type === "block-map" || e.type === "block-seq") && (t.type === "block-map" || t.type === "block-seq")) {
|
|
3851
3851
|
let n = t.items[t.items.length - 1];
|
|
3852
|
-
n && !n.sep && !n.value && n.start.length > 0 &&
|
|
3852
|
+
n && !n.sep && !n.value && n.start.length > 0 && hr(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));
|
|
3853
3853
|
}
|
|
3854
3854
|
}
|
|
3855
3855
|
}
|
|
@@ -3890,7 +3890,7 @@ var Sr = class {
|
|
|
3890
3890
|
if (e.value) return yield* this.lineEnd(e);
|
|
3891
3891
|
switch (this.type) {
|
|
3892
3892
|
case "doc-start":
|
|
3893
|
-
|
|
3893
|
+
hr(e.start) === -1 ? e.start.push(this.sourceToken) : (yield* this.pop(), yield* this.step());
|
|
3894
3894
|
return;
|
|
3895
3895
|
case "anchor":
|
|
3896
3896
|
case "tag":
|
|
@@ -3910,7 +3910,7 @@ var Sr = class {
|
|
|
3910
3910
|
}
|
|
3911
3911
|
*scalar(e) {
|
|
3912
3912
|
if (this.type === "map-value-ind") {
|
|
3913
|
-
let t =
|
|
3913
|
+
let t = vr(_r(this.peek(2))), n;
|
|
3914
3914
|
e.end ? (n = e.end, n.push(this.sourceToken), delete e.end) : n = [this.sourceToken];
|
|
3915
3915
|
let r = {
|
|
3916
3916
|
type: "block-map",
|
|
@@ -3960,7 +3960,7 @@ var Sr = class {
|
|
|
3960
3960
|
if (this.atIndentedComment(t.start, e.indent)) {
|
|
3961
3961
|
let n = e.items[e.items.length - 2]?.value?.end;
|
|
3962
3962
|
if (Array.isArray(n)) {
|
|
3963
|
-
|
|
3963
|
+
yr(n, t.start), n.push(this.sourceToken), e.items.pop();
|
|
3964
3964
|
return;
|
|
3965
3965
|
}
|
|
3966
3966
|
}
|
|
@@ -4009,12 +4009,12 @@ var Sr = class {
|
|
|
4009
4009
|
case "map-value-ind":
|
|
4010
4010
|
if (t.explicitKey) {
|
|
4011
4011
|
if (!t.sep) {
|
|
4012
|
-
if (
|
|
4012
|
+
if (mr(t.start, "newline")) Object.assign(t, {
|
|
4013
4013
|
key: null,
|
|
4014
4014
|
sep: [this.sourceToken]
|
|
4015
4015
|
});
|
|
4016
4016
|
else {
|
|
4017
|
-
let e =
|
|
4017
|
+
let e = vr(t.start);
|
|
4018
4018
|
this.stack.push({
|
|
4019
4019
|
type: "block-map",
|
|
4020
4020
|
offset: this.offset,
|
|
@@ -4031,7 +4031,7 @@ var Sr = class {
|
|
|
4031
4031
|
key: null,
|
|
4032
4032
|
sep: [this.sourceToken]
|
|
4033
4033
|
});
|
|
4034
|
-
else if (
|
|
4034
|
+
else if (mr(t.sep, "map-value-ind")) this.stack.push({
|
|
4035
4035
|
type: "block-map",
|
|
4036
4036
|
offset: this.offset,
|
|
4037
4037
|
indent: this.indent,
|
|
@@ -4041,8 +4041,8 @@ var Sr = class {
|
|
|
4041
4041
|
sep: [this.sourceToken]
|
|
4042
4042
|
}]
|
|
4043
4043
|
});
|
|
4044
|
-
else if (
|
|
4045
|
-
let e =
|
|
4044
|
+
else if (gr(t.key) && !mr(t.sep, "newline")) {
|
|
4045
|
+
let e = vr(t.start), n = t.key, r = t.sep;
|
|
4046
4046
|
r.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
|
|
4047
4047
|
type: "block-map",
|
|
4048
4048
|
offset: this.offset,
|
|
@@ -4058,7 +4058,7 @@ var Sr = class {
|
|
|
4058
4058
|
start: i,
|
|
4059
4059
|
key: null,
|
|
4060
4060
|
sep: [this.sourceToken]
|
|
4061
|
-
}) :
|
|
4061
|
+
}) : mr(t.sep, "map-value-ind") ? this.stack.push({
|
|
4062
4062
|
type: "block-map",
|
|
4063
4063
|
offset: this.offset,
|
|
4064
4064
|
indent: this.indent,
|
|
@@ -4092,7 +4092,7 @@ var Sr = class {
|
|
|
4092
4092
|
let r = this.startBlockValue(e);
|
|
4093
4093
|
if (r) {
|
|
4094
4094
|
if (r.type === "block-seq") {
|
|
4095
|
-
if (!t.explicitKey && t.sep && !
|
|
4095
|
+
if (!t.explicitKey && t.sep && !mr(t.sep, "newline")) {
|
|
4096
4096
|
yield* this.pop({
|
|
4097
4097
|
type: "error",
|
|
4098
4098
|
offset: this.offset,
|
|
@@ -4126,7 +4126,7 @@ var Sr = class {
|
|
|
4126
4126
|
if (this.atIndentedComment(t.start, e.indent)) {
|
|
4127
4127
|
let n = e.items[e.items.length - 2]?.value?.end;
|
|
4128
4128
|
if (Array.isArray(n)) {
|
|
4129
|
-
|
|
4129
|
+
yr(n, t.start), n.push(this.sourceToken), e.items.pop();
|
|
4130
4130
|
return;
|
|
4131
4131
|
}
|
|
4132
4132
|
}
|
|
@@ -4140,7 +4140,7 @@ var Sr = class {
|
|
|
4140
4140
|
return;
|
|
4141
4141
|
case "seq-item-ind":
|
|
4142
4142
|
if (this.indent !== e.indent) break;
|
|
4143
|
-
t.value ||
|
|
4143
|
+
t.value || mr(t.start, "seq-item-ind") ? e.items.push({ start: [this.sourceToken] }) : t.start.push(this.sourceToken);
|
|
4144
4144
|
return;
|
|
4145
4145
|
}
|
|
4146
4146
|
if (this.indent > e.indent) {
|
|
@@ -4209,8 +4209,8 @@ var Sr = class {
|
|
|
4209
4209
|
let t = this.peek(2);
|
|
4210
4210
|
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();
|
|
4211
4211
|
else if (this.type === "map-value-ind" && t.type !== "flow-collection") {
|
|
4212
|
-
let n =
|
|
4213
|
-
|
|
4212
|
+
let n = vr(_r(t));
|
|
4213
|
+
br(e);
|
|
4214
4214
|
let r = e.end.splice(1, e.end.length);
|
|
4215
4215
|
r.push(this.sourceToken);
|
|
4216
4216
|
let i = {
|
|
@@ -4269,7 +4269,7 @@ var Sr = class {
|
|
|
4269
4269
|
};
|
|
4270
4270
|
case "explicit-key-ind": {
|
|
4271
4271
|
this.onKeyLine = !0;
|
|
4272
|
-
let t =
|
|
4272
|
+
let t = vr(_r(e));
|
|
4273
4273
|
return t.push(this.sourceToken), {
|
|
4274
4274
|
type: "block-map",
|
|
4275
4275
|
offset: this.offset,
|
|
@@ -4282,7 +4282,7 @@ var Sr = class {
|
|
|
4282
4282
|
}
|
|
4283
4283
|
case "map-value-ind": {
|
|
4284
4284
|
this.onKeyLine = !0;
|
|
4285
|
-
let t =
|
|
4285
|
+
let t = vr(_r(e));
|
|
4286
4286
|
return {
|
|
4287
4287
|
type: "block-map",
|
|
4288
4288
|
offset: this.offset,
|
|
@@ -4320,39 +4320,39 @@ var Sr = class {
|
|
|
4320
4320
|
};
|
|
4321
4321
|
//#endregion
|
|
4322
4322
|
//#region node_modules/yaml/browser/dist/public-api.js
|
|
4323
|
-
function
|
|
4323
|
+
function Sr(e) {
|
|
4324
4324
|
let t = e.prettyErrors !== !1;
|
|
4325
4325
|
return {
|
|
4326
|
-
lineCounter: e.lineCounter || t && new
|
|
4326
|
+
lineCounter: e.lineCounter || t && new pr() || null,
|
|
4327
4327
|
prettyErrors: t
|
|
4328
4328
|
};
|
|
4329
4329
|
}
|
|
4330
|
-
function
|
|
4331
|
-
let { lineCounter: n, prettyErrors: r } =
|
|
4332
|
-
if (r && n) for (let t of o) t.errors.forEach(
|
|
4330
|
+
function Cr(e, t = {}) {
|
|
4331
|
+
let { lineCounter: n, prettyErrors: r } = Sr(t), i = new xr(n?.addNewLine), a = new Vn(t), o = Array.from(a.compose(i.parse(e)));
|
|
4332
|
+
if (r && n) for (let t of o) t.errors.forEach(an(e, n)), t.warnings.forEach(an(e, n));
|
|
4333
4333
|
return o.length > 0 ? o : Object.assign([], { empty: !0 }, a.streamInfo());
|
|
4334
4334
|
}
|
|
4335
|
-
function
|
|
4336
|
-
let { lineCounter: n, prettyErrors: r } =
|
|
4335
|
+
function wr(e, t = {}) {
|
|
4336
|
+
let { lineCounter: n, prettyErrors: r } = Sr(t), i = new xr(n?.addNewLine), a = new Vn(t), o = null;
|
|
4337
4337
|
for (let t of a.compose(i.parse(e), !0, e.length)) if (!o) o = t;
|
|
4338
4338
|
else if (o.options.logLevel !== "silent") {
|
|
4339
|
-
o.errors.push(new
|
|
4339
|
+
o.errors.push(new nn(t.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
|
4340
4340
|
break;
|
|
4341
4341
|
}
|
|
4342
|
-
return r && n && (o.errors.forEach(
|
|
4342
|
+
return r && n && (o.errors.forEach(an(e, n)), o.warnings.forEach(an(e, n))), o;
|
|
4343
4343
|
}
|
|
4344
|
-
function
|
|
4344
|
+
function Tr(e, t, n) {
|
|
4345
4345
|
let r;
|
|
4346
4346
|
typeof t == "function" ? r = t : n === void 0 && t && typeof t == "object" && (n = t);
|
|
4347
|
-
let i =
|
|
4347
|
+
let i = wr(e, n);
|
|
4348
4348
|
if (!i) return null;
|
|
4349
|
-
if (i.warnings.forEach((e) =>
|
|
4349
|
+
if (i.warnings.forEach((e) => ze(i.options.logLevel, e)), i.errors.length > 0) {
|
|
4350
4350
|
if (i.options.logLevel !== "silent") throw i.errors[0];
|
|
4351
4351
|
i.errors = [];
|
|
4352
4352
|
}
|
|
4353
4353
|
return i.toJS(Object.assign({ reviver: r }, n));
|
|
4354
4354
|
}
|
|
4355
|
-
function
|
|
4355
|
+
function Er(e, t, n) {
|
|
4356
4356
|
let r = null;
|
|
4357
4357
|
if (typeof t == "function" || Array.isArray(t) ? r = t : n === void 0 && t && (n = t), typeof n == "string" && (n = n.length), typeof n == "number") {
|
|
4358
4358
|
let e = Math.round(n);
|
|
@@ -4362,26 +4362,26 @@ function Dr(e, t, n) {
|
|
|
4362
4362
|
let { keepUndefined: e } = n ?? t ?? {};
|
|
4363
4363
|
if (!e) return;
|
|
4364
4364
|
}
|
|
4365
|
-
return y(e) && !r ? e.toString(n) : new
|
|
4365
|
+
return y(e) && !r ? e.toString(n) : new $t(e, r, n).toString(n);
|
|
4366
4366
|
}
|
|
4367
4367
|
//#endregion
|
|
4368
4368
|
//#region node_modules/yaml/browser/index.js
|
|
4369
|
-
var
|
|
4369
|
+
var Dr = /* @__PURE__ */ a({
|
|
4370
4370
|
Alias: () => de,
|
|
4371
|
-
CST: () =>
|
|
4372
|
-
Composer: () =>
|
|
4373
|
-
Document: () =>
|
|
4374
|
-
Lexer: () =>
|
|
4375
|
-
LineCounter: () =>
|
|
4376
|
-
Pair: () =>
|
|
4377
|
-
Parser: () =>
|
|
4371
|
+
CST: () => nr,
|
|
4372
|
+
Composer: () => Vn,
|
|
4373
|
+
Document: () => $t,
|
|
4374
|
+
Lexer: () => fr,
|
|
4375
|
+
LineCounter: () => pr,
|
|
4376
|
+
Pair: () => H,
|
|
4377
|
+
Parser: () => xr,
|
|
4378
4378
|
Scalar: () => I,
|
|
4379
|
-
Schema: () =>
|
|
4380
|
-
YAMLError: () =>
|
|
4381
|
-
YAMLMap: () =>
|
|
4382
|
-
YAMLParseError: () =>
|
|
4383
|
-
YAMLSeq: () =>
|
|
4384
|
-
YAMLWarning: () =>
|
|
4379
|
+
Schema: () => Zt,
|
|
4380
|
+
YAMLError: () => tn,
|
|
4381
|
+
YAMLMap: () => U,
|
|
4382
|
+
YAMLParseError: () => nn,
|
|
4383
|
+
YAMLSeq: () => W,
|
|
4384
|
+
YAMLWarning: () => rn,
|
|
4385
4385
|
isAlias: () => v,
|
|
4386
4386
|
isCollection: () => w,
|
|
4387
4387
|
isDocument: () => y,
|
|
@@ -4390,13 +4390,13 @@ var Or = /* @__PURE__ */ a({
|
|
|
4390
4390
|
isPair: () => x,
|
|
4391
4391
|
isScalar: () => S,
|
|
4392
4392
|
isSeq: () => C,
|
|
4393
|
-
parse: () =>
|
|
4394
|
-
parseAllDocuments: () =>
|
|
4395
|
-
parseDocument: () =>
|
|
4396
|
-
stringify: () =>
|
|
4397
|
-
visit: () =>
|
|
4398
|
-
visitAsync: () =>
|
|
4399
|
-
}),
|
|
4393
|
+
parse: () => Tr,
|
|
4394
|
+
parseAllDocuments: () => Cr,
|
|
4395
|
+
parseDocument: () => wr,
|
|
4396
|
+
stringify: () => Er,
|
|
4397
|
+
visit: () => A,
|
|
4398
|
+
visitAsync: () => te
|
|
4399
|
+
}), Or = {
|
|
4400
4400
|
rawNodes: {
|
|
4401
4401
|
address: {
|
|
4402
4402
|
id: "address",
|
|
@@ -5981,7 +5981,7 @@ var Or = /* @__PURE__ */ a({
|
|
|
5981
5981
|
};
|
|
5982
5982
|
//#endregion
|
|
5983
5983
|
//#region server/db/dynamic-sync.ts
|
|
5984
|
-
async function
|
|
5984
|
+
async function kr(e, t) {
|
|
5985
5985
|
try {
|
|
5986
5986
|
let n = await e.prepare(`PRAGMA table_info("${t}")`).all(), r = Array.isArray(n) ? n : n?.results || [];
|
|
5987
5987
|
return new Set(r.map((e) => e.name));
|
|
@@ -5989,7 +5989,7 @@ async function Ar(e, t) {
|
|
|
5989
5989
|
return /* @__PURE__ */ new Set();
|
|
5990
5990
|
}
|
|
5991
5991
|
}
|
|
5992
|
-
var
|
|
5992
|
+
var Ar = {
|
|
5993
5993
|
content_schemas: "\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL,\n type TEXT UNIQUE NOT NULL,\n schemaJson TEXT NOT NULL,\n isSystem INTEGER DEFAULT 1,\n createdAt TEXT DEFAULT CURRENT_TIMESTAMP,\n updatedAt TEXT DEFAULT CURRENT_TIMESTAMP\n ",
|
|
5994
5994
|
users: "\n id TEXT PRIMARY KEY,\n email TEXT UNIQUE NOT NULL,\n name TEXT NOT NULL,\n globalRole TEXT DEFAULT 'editor',\n createdAt TEXT DEFAULT CURRENT_TIMESTAMP,\n updatedAt TEXT DEFAULT CURRENT_TIMESTAMP\n ",
|
|
5995
5995
|
user_accounts: "\n id TEXT PRIMARY KEY,\n userId TEXT NOT NULL,\n provider TEXT NOT NULL,\n providerAccountId TEXT NOT NULL,\n passwordHash TEXT NOT NULL,\n createdAt TEXT DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (userId) REFERENCES users(id) ON DELETE CASCADE,\n UNIQUE(provider, providerAccountId)\n ",
|
|
@@ -6004,14 +6004,14 @@ var jr = {
|
|
|
6004
6004
|
node_revisions: "\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n nodeId INTEGER NOT NULL,\n version INTEGER NOT NULL DEFAULT 1,\n snapshotJson TEXT NOT NULL,\n createdById TEXT,\n createdAt TEXT DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (nodeId) REFERENCES content_nodes(id) ON DELETE CASCADE,\n FOREIGN KEY (createdById) REFERENCES users(id) ON DELETE SET NULL\n ",
|
|
6005
6005
|
assets: "\n id TEXT PRIMARY KEY,\n filename TEXT NOT NULL,\n mimeType TEXT NOT NULL,\n sizeBytes INTEGER NOT NULL,\n storageKeyPrivate TEXT,\n cdnUrl TEXT,\n parentAssetId TEXT,\n cropCoordinatesJson TEXT,\n isSystemVariant INTEGER DEFAULT 0,\n dataJson TEXT DEFAULT '{}',\n createdById TEXT,\n createdAt TEXT DEFAULT CURRENT_TIMESTAMP,\n updatedAt TEXT DEFAULT CURRENT_TIMESTAMP,\n deletedAt TEXT,\n FOREIGN KEY (parentAssetId) REFERENCES assets(id) ON DELETE SET NULL,\n FOREIGN KEY (createdById) REFERENCES users(id) ON DELETE SET NULL\n ",
|
|
6006
6006
|
node_assets: "\n nodeId INTEGER NOT NULL,\n assetId TEXT NOT NULL,\n fieldKey TEXT NOT NULL,\n sortOrder INTEGER DEFAULT 0,\n PRIMARY KEY (nodeId, assetId, fieldKey),\n FOREIGN KEY (nodeId) REFERENCES content_nodes(id) ON DELETE CASCADE,\n FOREIGN KEY (assetId) REFERENCES assets(id) ON DELETE CASCADE\n "
|
|
6007
|
-
},
|
|
6008
|
-
async function
|
|
6007
|
+
}, jr = /* @__PURE__ */ "CREATE INDEX IF NOT EXISTS idx_tree_nodes_tree_parent ON tree_nodes(treeId, parentId);.CREATE INDEX IF NOT EXISTS idx_tree_nodes_contentId ON tree_nodes(contentId);.CREATE INDEX IF NOT EXISTS idx_content_nodes_slug_status ON content_nodes(slug, status);.CREATE INDEX IF NOT EXISTS idx_content_blocks_node ON content_blocks(contentId, isDraft);.CREATE INDEX IF NOT EXISTS idx_node_assets_nodeId ON node_assets(nodeId);.CREATE INDEX IF NOT EXISTS idx_node_assets_assetId ON node_assets(assetId);.CREATE INDEX IF NOT EXISTS idx_content_schemas_type ON content_schemas(type);.CREATE INDEX IF NOT EXISTS idx_sessions_user ON sessions(userId);.CREATE INDEX IF NOT EXISTS idx_sessions_expires ON sessions(expiresAt);.CREATE INDEX IF NOT EXISTS idx_channels_visibility ON channels(isHidden);.CREATE INDEX IF NOT EXISTS idx_trees_visibility ON trees(isHidden);.CREATE INDEX IF NOT EXISTS idx_content_nodes_visibility ON content_nodes(isHidden, status);.CREATE INDEX IF NOT EXISTS idx_content_nodes_slug ON content_nodes(slug);.CREATE INDEX IF NOT EXISTS idx_content_nodes_type ON content_nodes(contentType);.CREATE INDEX IF NOT EXISTS idx_content_nodes_deleted_updated ON content_nodes(deletedAt, updatedAt DESC);.CREATE INDEX IF NOT EXISTS idx_tree_nodes_hierarchy ON tree_nodes(treeId, parentId, sortOrder);.CREATE INDEX IF NOT EXISTS idx_tree_nodes_content ON tree_nodes(contentId, treeId);.CREATE INDEX IF NOT EXISTS idx_content_blocks_content ON content_blocks(contentId, isDraft, region, sortOrder);.CREATE INDEX IF NOT EXISTS idx_node_channels_channel ON node_channels(channelId, nodeId);.CREATE INDEX IF NOT EXISTS idx_node_channels_node ON node_channels(nodeId, channelId);.CREATE INDEX IF NOT EXISTS idx_node_assets_node_asset ON node_assets(nodeId, assetId);.CREATE INDEX IF NOT EXISTS idx_node_assets_asset_node ON node_assets(assetId, nodeId);.CREATE INDEX IF NOT EXISTS idx_node_revisions_node ON node_revisions(nodeId, version);.CREATE INDEX IF NOT EXISTS idx_assets_system_created ON assets(isSystemVariant, createdAt DESC);.CREATE INDEX IF NOT EXISTS idx_assets_system_mime ON assets(isSystemVariant, mimeType);.CREATE INDEX IF NOT EXISTS idx_assets_deleted ON assets(deletedAt);.CREATE INDEX IF NOT EXISTS idx_assets_parent ON assets(parentAssetId);".split(".");
|
|
6008
|
+
async function Mr(e, t) {
|
|
6009
6009
|
try {
|
|
6010
6010
|
await e.prepare("PRAGMA foreign_keys = ON;").run();
|
|
6011
6011
|
} catch {}
|
|
6012
|
-
for (let [t, n] of Object.entries(
|
|
6013
|
-
for (let [t] of Object.entries(
|
|
6014
|
-
let n = await
|
|
6012
|
+
for (let [t, n] of Object.entries(Ar)) await e.prepare(`CREATE TABLE IF NOT EXISTS "${t}" (${n});`).run();
|
|
6013
|
+
for (let [t] of Object.entries(Ar)) {
|
|
6014
|
+
let n = await kr(e, t);
|
|
6015
6015
|
if (n.size > 0) {
|
|
6016
6016
|
if (t === "content_nodes" && !n.has("disabledRegionsJson")) try {
|
|
6017
6017
|
await e.prepare("ALTER TABLE \"content_nodes\" ADD COLUMN disabledRegionsJson TEXT DEFAULT '{}';").run();
|
|
@@ -6026,12 +6026,12 @@ async function Nr(e, t) {
|
|
|
6026
6026
|
}
|
|
6027
6027
|
}
|
|
6028
6028
|
}
|
|
6029
|
-
for (let t of
|
|
6029
|
+
for (let t of jr) try {
|
|
6030
6030
|
await e.prepare(t).run();
|
|
6031
6031
|
} catch {}
|
|
6032
|
-
await
|
|
6032
|
+
await Nr(e, t || Or), await Pr(e);
|
|
6033
6033
|
}
|
|
6034
|
-
async function
|
|
6034
|
+
async function Nr(e, t) {
|
|
6035
6035
|
if (!t) return;
|
|
6036
6036
|
let n = t.rawNodes || {}, r = Object.entries(n);
|
|
6037
6037
|
for (let [t, n] of r) {
|
|
@@ -6048,7 +6048,7 @@ async function Pr(e, t) {
|
|
|
6048
6048
|
}
|
|
6049
6049
|
}
|
|
6050
6050
|
}
|
|
6051
|
-
async function
|
|
6051
|
+
async function Pr(e) {
|
|
6052
6052
|
try {
|
|
6053
6053
|
let t = await e.prepare("SELECT COUNT(*) as count FROM channels").get(), n = 1;
|
|
6054
6054
|
if (!t || t.count === 0) {
|
|
@@ -6069,7 +6069,7 @@ async function Fr(e) {
|
|
|
6069
6069
|
}
|
|
6070
6070
|
//#endregion
|
|
6071
6071
|
//#region server/middleware/media-static.ts
|
|
6072
|
-
function
|
|
6072
|
+
function Fr() {
|
|
6073
6073
|
return async (e, t) => {
|
|
6074
6074
|
if (e.env?.MEDIA_BUCKET) {
|
|
6075
6075
|
let t = e.req.path.replace(/^\/media\//, ""), n = await e.env.MEDIA_BUCKET.get(t, { onlyIf: e.req.raw.headers });
|
|
@@ -6100,18 +6100,18 @@ function Ir() {
|
|
|
6100
6100
|
}
|
|
6101
6101
|
//#endregion
|
|
6102
6102
|
//#region node_modules/lru-cache/dist/esm/browser/index.min.js
|
|
6103
|
-
var
|
|
6104
|
-
typeof
|
|
6105
|
-
},
|
|
6103
|
+
var Ir = { hasSubscribers: !1 }, q = Ir, Lr = Ir, Rr = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, zr = () => q.hasSubscribers || Lr.hasSubscribers, Br = /* @__PURE__ */ new Set(), Vr = typeof process == "object" && process ? process : {}, Hr = (e, t, n, r) => {
|
|
6104
|
+
typeof Vr.emitWarning == "function" ? Vr.emitWarning(e, t, n, r) : console.error(`[${n}] ${t}: ${e}`);
|
|
6105
|
+
}, Ur = (e) => !Br.has(e), Wr = (e) => !!e && e === Math.floor(e) && e > 0 && isFinite(e), Gr = (e) => Wr(e) ? e <= 256 ? Uint8Array : e <= 2 ** 16 ? Uint16Array : e <= 2 ** 32 ? Uint32Array : e <= 2 ** 53 - 1 ? Kr : null : null, Kr = class extends Array {
|
|
6106
6106
|
constructor(e) {
|
|
6107
6107
|
super(e), this.fill(0);
|
|
6108
6108
|
}
|
|
6109
|
-
},
|
|
6109
|
+
}, qr = class e {
|
|
6110
6110
|
heap;
|
|
6111
6111
|
length;
|
|
6112
6112
|
static #e = !1;
|
|
6113
6113
|
static create(t) {
|
|
6114
|
-
let n =
|
|
6114
|
+
let n = Gr(t);
|
|
6115
6115
|
if (!n) return [];
|
|
6116
6116
|
e.#e = !0;
|
|
6117
6117
|
let r = new e(t, n);
|
|
@@ -6127,7 +6127,7 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6127
6127
|
pop() {
|
|
6128
6128
|
return this.heap[--this.length];
|
|
6129
6129
|
}
|
|
6130
|
-
},
|
|
6130
|
+
}, Jr = class e {
|
|
6131
6131
|
#e;
|
|
6132
6132
|
#t;
|
|
6133
6133
|
#n;
|
|
@@ -6230,8 +6230,8 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6230
6230
|
constructor(t) {
|
|
6231
6231
|
let { max: n = 0, ttl: r, ttlResolution: i = 1, ttlAutopurge: a, updateAgeOnGet: o, updateAgeOnHas: s, allowStale: c, dispose: l, onInsert: u, disposeAfter: d, noDisposeOnSet: f, noUpdateTTL: p, maxSize: m = 0, maxEntrySize: h = 0, sizeCalculation: g, fetchMethod: _, memoMethod: v, noDeleteOnFetchRejection: y, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: x, allowStaleOnFetchAbort: S, ignoreFetchAbort: C, backgroundFetchSize: w = 1, perf: T } = t;
|
|
6232
6232
|
if (this.backgroundFetchSize = w, T !== void 0 && typeof T?.now != "function") throw TypeError("perf option must have a now() method if specified");
|
|
6233
|
-
if (this.#s = T ??
|
|
6234
|
-
let E = n ?
|
|
6233
|
+
if (this.#s = T ?? Rr, n !== 0 && !Wr(n)) throw TypeError("max option must be a nonnegative integer");
|
|
6234
|
+
let E = n ? Gr(n) : Array;
|
|
6235
6235
|
if (!E) throw Error("invalid max value: " + n);
|
|
6236
6236
|
if (this.#e = n, this.#t = m, this.maxEntrySize = h || this.#t, this.sizeCalculation = g, this.sizeCalculation) {
|
|
6237
6237
|
if (!this.#t && !this.maxEntrySize) throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
@@ -6239,26 +6239,26 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6239
6239
|
}
|
|
6240
6240
|
if (v !== void 0 && typeof v != "function") throw TypeError("memoMethod must be a function if defined");
|
|
6241
6241
|
if (this.#o = v, _ !== void 0 && typeof _ != "function") throw TypeError("fetchMethod must be a function if specified");
|
|
6242
|
-
if (this.#a = _, this.#w = !!_, this.#u = /* @__PURE__ */ new Map(), this.#d = Array.from({ length: n }).fill(void 0), this.#f = Array.from({ length: n }).fill(void 0), this.#p = new E(n), this.#m = new E(n), this.#h = 0, this.#g = 0, this.#_ =
|
|
6243
|
-
if (this.#t !== 0 && !
|
|
6244
|
-
if (!
|
|
6242
|
+
if (this.#a = _, this.#w = !!_, this.#u = /* @__PURE__ */ new Map(), this.#d = Array.from({ length: n }).fill(void 0), this.#f = Array.from({ length: n }).fill(void 0), this.#p = new E(n), this.#m = new E(n), this.#h = 0, this.#g = 0, this.#_ = qr.create(n), this.#c = 0, this.#l = 0, typeof l == "function" && (this.#n = l), typeof u == "function" && (this.#r = u), typeof d == "function" ? (this.#i = d, this.#v = []) : (this.#i = void 0, this.#v = void 0), this.#C = !!this.#n, this.#E = !!this.#r, this.#T = !!this.#i, this.noDisposeOnSet = !!f, this.noUpdateTTL = !!p, this.noDeleteOnFetchRejection = !!y, this.allowStaleOnFetchRejection = !!x, this.allowStaleOnFetchAbort = !!S, this.ignoreFetchAbort = !!C, this.maxEntrySize !== 0) {
|
|
6243
|
+
if (this.#t !== 0 && !Wr(this.#t)) throw TypeError("maxSize must be a positive integer if specified");
|
|
6244
|
+
if (!Wr(this.maxEntrySize)) throw TypeError("maxEntrySize must be a positive integer if specified");
|
|
6245
6245
|
this.#M();
|
|
6246
6246
|
}
|
|
6247
|
-
if (this.allowStale = !!c, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!s, this.ttlResolution =
|
|
6248
|
-
if (!
|
|
6247
|
+
if (this.allowStale = !!c, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!s, this.ttlResolution = Wr(i) || i === 0 ? i : 1, this.ttlAutopurge = !!a, this.ttl = r || 0, this.ttl) {
|
|
6248
|
+
if (!Wr(this.ttl)) throw TypeError("ttl must be a positive integer if specified");
|
|
6249
6249
|
this.#D();
|
|
6250
6250
|
}
|
|
6251
6251
|
if (this.#e === 0 && this.ttl === 0 && this.#t === 0) throw TypeError("At least one of max, maxSize, or ttl is required");
|
|
6252
6252
|
if (!this.ttlAutopurge && !this.#e && !this.#t) {
|
|
6253
6253
|
let t = "LRU_CACHE_UNBOUNDED";
|
|
6254
|
-
|
|
6254
|
+
Ur(t) && (Br.add(t), Hr("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", t, e));
|
|
6255
6255
|
}
|
|
6256
6256
|
}
|
|
6257
6257
|
getRemainingTTL(e) {
|
|
6258
6258
|
return this.#u.has(e) ? 1 / 0 : 0;
|
|
6259
6259
|
}
|
|
6260
6260
|
#D() {
|
|
6261
|
-
let e = new
|
|
6261
|
+
let e = new Kr(this.#e), t = new Kr(this.#e);
|
|
6262
6262
|
this.#x = e, this.#b = t;
|
|
6263
6263
|
let n = this.ttlAutopurge ? Array.from({ length: this.#e }) : void 0;
|
|
6264
6264
|
this.#S = n, this.#A = (n, i, a = this.#s.now()) => {
|
|
@@ -6308,15 +6308,15 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6308
6308
|
#A = () => {};
|
|
6309
6309
|
#j = () => !1;
|
|
6310
6310
|
#M() {
|
|
6311
|
-
let e = new
|
|
6311
|
+
let e = new Kr(this.#e);
|
|
6312
6312
|
this.#l = 0, this.#y = e, this.#N = (t) => {
|
|
6313
6313
|
this.#l -= e[t], e[t] = 0;
|
|
6314
6314
|
}, this.#F = (e, t, n, r) => {
|
|
6315
|
-
if (!
|
|
6315
|
+
if (!Wr(n)) {
|
|
6316
6316
|
if (this.#W(t)) return this.backgroundFetchSize;
|
|
6317
6317
|
if (r) {
|
|
6318
6318
|
if (typeof r != "function") throw TypeError("sizeCalculation must be a function");
|
|
6319
|
-
if (n = r(t, e), !
|
|
6319
|
+
if (n = r(t, e), !Wr(n)) throw TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
6320
6320
|
} else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
6321
6321
|
}
|
|
6322
6322
|
return n;
|
|
@@ -6432,10 +6432,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6432
6432
|
}
|
|
6433
6433
|
}
|
|
6434
6434
|
set(e, t, n = {}) {
|
|
6435
|
-
let { status: r =
|
|
6435
|
+
let { status: r = q.hasSubscribers ? {} : void 0 } = n;
|
|
6436
6436
|
n.status = r, r && (r.op = "set", r.key = e, t !== void 0 && (r.value = t), r.cache = this);
|
|
6437
6437
|
let i = this.#z(e, t, n);
|
|
6438
|
-
return r &&
|
|
6438
|
+
return r && q.hasSubscribers && q.publish(r), i;
|
|
6439
6439
|
}
|
|
6440
6440
|
#z(e, t, n, r) {
|
|
6441
6441
|
let { ttl: i = this.ttl, start: a, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: s = this.sizeCalculation, status: c } = n, l = this.#W(t);
|
|
@@ -6503,10 +6503,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6503
6503
|
])), this.#N(t), this.#S?.[t] && (clearTimeout(this.#S[t]), this.#S[t] = void 0), e && (this.#d[t] = void 0, this.#f[t] = void 0, this.#_.push(t)), this.#c === 1 ? (this.#h = this.#g = 0, this.#_.length = 0) : this.#h = this.#p[t], this.#u.delete(n), this.#c--, t;
|
|
6504
6504
|
}
|
|
6505
6505
|
has(e, t = {}) {
|
|
6506
|
-
let { status: n =
|
|
6506
|
+
let { status: n = q.hasSubscribers ? {} : void 0 } = t;
|
|
6507
6507
|
t.status = n, n && (n.op = "has", n.key = e, n.cache = this);
|
|
6508
6508
|
let r = this.#V(e, t);
|
|
6509
|
-
return
|
|
6509
|
+
return q.hasSubscribers && q.publish(n), r;
|
|
6510
6510
|
}
|
|
6511
6511
|
#V(e, t = {}) {
|
|
6512
6512
|
let { updateAgeOnHas: n = this.updateAgeOnHas, status: r } = t, i = this.#u.get(e);
|
|
@@ -6519,10 +6519,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6519
6519
|
return !1;
|
|
6520
6520
|
}
|
|
6521
6521
|
peek(e, t = {}) {
|
|
6522
|
-
let { status: n =
|
|
6522
|
+
let { status: n = zr() ? {} : void 0 } = t;
|
|
6523
6523
|
n && (n.op = "peek", n.key = e, n.cache = this), t.status = n;
|
|
6524
6524
|
let r = this.#H(e, t);
|
|
6525
|
-
return
|
|
6525
|
+
return q.hasSubscribers && q.publish(n), r;
|
|
6526
6526
|
}
|
|
6527
6527
|
#H(e, t) {
|
|
6528
6528
|
let { status: n, allowStale: r = this.allowStale } = t, i = this.#u.get(e);
|
|
@@ -6574,10 +6574,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6574
6574
|
return !!t && t instanceof Promise && t.hasOwnProperty("__staleWhileFetching") && t.__abortController instanceof AbortController;
|
|
6575
6575
|
}
|
|
6576
6576
|
fetch(e, t = {}) {
|
|
6577
|
-
let n =
|
|
6577
|
+
let n = Lr.hasSubscribers, { status: r = zr() ? {} : void 0 } = t;
|
|
6578
6578
|
t.status = r, r && t.context && (r.context = t.context);
|
|
6579
6579
|
let i = this.#G(e, t);
|
|
6580
|
-
return r && n && (r.trace = !0,
|
|
6580
|
+
return r && n && (r.trace = !0, Lr.tracePromise(() => i, r).catch(() => {})), i;
|
|
6581
6581
|
}
|
|
6582
6582
|
async #G(e, t = {}) {
|
|
6583
6583
|
let { allowStale: n = this.allowStale, updateAgeOnGet: r = this.updateAgeOnGet, noDeleteOnStaleGet: i = this.noDeleteOnStaleGet, ttl: a = this.ttl, noDisposeOnSet: o = this.noDisposeOnSet, size: s = 0, sizeCalculation: c = this.sizeCalculation, noUpdateTTL: l = this.noUpdateTTL, noDeleteOnFetchRejection: u = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: f = this.ignoreFetchAbort, allowStaleOnFetchAbort: p = this.allowStaleOnFetchAbort, context: m, forceRefresh: h = !1, status: g, signal: _ } = t;
|
|
@@ -6621,10 +6621,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6621
6621
|
}
|
|
6622
6622
|
}
|
|
6623
6623
|
forceFetch(e, t = {}) {
|
|
6624
|
-
let n =
|
|
6624
|
+
let n = Lr.hasSubscribers, { status: r = zr() ? {} : void 0 } = t;
|
|
6625
6625
|
t.status = r, r && t.context && (r.context = t.context);
|
|
6626
6626
|
let i = this.#K(e, t);
|
|
6627
|
-
return r && n && (r.trace = !0,
|
|
6627
|
+
return r && n && (r.trace = !0, Lr.tracePromise(() => i, r).catch(() => {})), i;
|
|
6628
6628
|
}
|
|
6629
6629
|
async #K(e, t = {}) {
|
|
6630
6630
|
let n = await this.#G(e, t);
|
|
@@ -6632,10 +6632,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6632
6632
|
return n;
|
|
6633
6633
|
}
|
|
6634
6634
|
memo(e, t = {}) {
|
|
6635
|
-
let { status: n =
|
|
6635
|
+
let { status: n = q.hasSubscribers ? {} : void 0 } = t;
|
|
6636
6636
|
t.status = n, n && (n.op = "memo", n.key = e, t.context && (n.context = t.context), n.cache = this);
|
|
6637
6637
|
let r = this.#q(e, t);
|
|
6638
|
-
return n && (n.value = r),
|
|
6638
|
+
return n && (n.value = r), q.hasSubscribers && q.publish(n), r;
|
|
6639
6639
|
}
|
|
6640
6640
|
#q(e, t = {}) {
|
|
6641
6641
|
let n = this.#o;
|
|
@@ -6651,10 +6651,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6651
6651
|
return i && (i.value = l), this.#z(e, l, o), l;
|
|
6652
6652
|
}
|
|
6653
6653
|
get(e, t = {}) {
|
|
6654
|
-
let { status: n =
|
|
6654
|
+
let { status: n = q.hasSubscribers ? {} : void 0 } = t;
|
|
6655
6655
|
t.status = n, n && (n.op = "get", n.key = e, n.cache = this);
|
|
6656
6656
|
let r = this.#J(e, t);
|
|
6657
|
-
return n && (r !== void 0 && (n.value = r),
|
|
6657
|
+
return n && (r !== void 0 && (n.value = r), q.hasSubscribers && q.publish(n)), r;
|
|
6658
6658
|
}
|
|
6659
6659
|
#J(e, t = {}) {
|
|
6660
6660
|
let { allowStale: n = this.allowStale, updateAgeOnGet: r = this.updateAgeOnGet, noDeleteOnStaleGet: i = this.noDeleteOnStaleGet, status: a } = t, o = this.#u.get(e);
|
|
@@ -6675,7 +6675,7 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6675
6675
|
return this.#Z(e, "delete");
|
|
6676
6676
|
}
|
|
6677
6677
|
#Z(e, t) {
|
|
6678
|
-
|
|
6678
|
+
q.hasSubscribers && q.publish({
|
|
6679
6679
|
op: "delete",
|
|
6680
6680
|
delete: t,
|
|
6681
6681
|
key: e,
|
|
@@ -6737,10 +6737,10 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6737
6737
|
for (; t = e?.shift();) this.#i?.(...t);
|
|
6738
6738
|
}
|
|
6739
6739
|
}
|
|
6740
|
-
},
|
|
6740
|
+
}, Yr = class {
|
|
6741
6741
|
cache;
|
|
6742
6742
|
constructor(e = 1e3, t = 3e5) {
|
|
6743
|
-
this.cache = new
|
|
6743
|
+
this.cache = new Jr({
|
|
6744
6744
|
max: e,
|
|
6745
6745
|
ttl: t
|
|
6746
6746
|
});
|
|
@@ -6759,7 +6759,7 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6759
6759
|
async clear() {
|
|
6760
6760
|
this.cache.clear();
|
|
6761
6761
|
}
|
|
6762
|
-
},
|
|
6762
|
+
}, Xr = class {
|
|
6763
6763
|
kv;
|
|
6764
6764
|
constructor(e) {
|
|
6765
6765
|
this.kv = e;
|
|
@@ -6776,21 +6776,21 @@ var Lr = { hasSubscribers: !1 }, K = Lr, Rr = Lr, zr = typeof performance == "ob
|
|
|
6776
6776
|
this.kv && await this.kv.delete(e);
|
|
6777
6777
|
}
|
|
6778
6778
|
async clear() {}
|
|
6779
|
-
},
|
|
6779
|
+
}, Zr = class {
|
|
6780
6780
|
async get() {
|
|
6781
6781
|
return null;
|
|
6782
6782
|
}
|
|
6783
6783
|
async set() {}
|
|
6784
6784
|
async delete() {}
|
|
6785
6785
|
async clear() {}
|
|
6786
|
-
},
|
|
6787
|
-
function
|
|
6786
|
+
}, Qr = null;
|
|
6787
|
+
function J(e) {
|
|
6788
6788
|
let t = process.env.CACHE_DRIVER || "lru";
|
|
6789
|
-
return t === "none" || t === "off" || t === "false" ? new
|
|
6789
|
+
return t === "none" || t === "off" || t === "false" ? new Zr() : e?.env?.CMS_CACHE_KV ? new Xr(e.env.CMS_CACHE_KV) : t === "lru" ? (Qr ||= new Yr(), Qr) : new Zr();
|
|
6790
6790
|
}
|
|
6791
6791
|
//#endregion
|
|
6792
6792
|
//#region server/storage/provider.ts
|
|
6793
|
-
function
|
|
6793
|
+
function $r(e) {
|
|
6794
6794
|
let t = e.split(".").pop()?.toLowerCase() || "bin";
|
|
6795
6795
|
return t = t.replace(/[^a-z0-9]/g, ""), [
|
|
6796
6796
|
"php",
|
|
@@ -6805,14 +6805,14 @@ function ei(e) {
|
|
|
6805
6805
|
"cjs"
|
|
6806
6806
|
].includes(t) ? "bin" : t;
|
|
6807
6807
|
}
|
|
6808
|
-
var
|
|
6808
|
+
var ei = class {
|
|
6809
6809
|
bucket;
|
|
6810
6810
|
publicDomain;
|
|
6811
6811
|
constructor(e, t) {
|
|
6812
6812
|
this.bucket = e, this.publicDomain = t;
|
|
6813
6813
|
}
|
|
6814
6814
|
async upload(e, t = "uploads") {
|
|
6815
|
-
let n =
|
|
6815
|
+
let n = $r(e.name), r = `${t}/${crypto.randomUUID().replace(/-/g, "")}.${n}`;
|
|
6816
6816
|
await this.bucket.put(r, e.stream(), { httpMetadata: { contentType: e.type } });
|
|
6817
6817
|
let i = r.replace(/^\//, ""), a = `/media/${i}`;
|
|
6818
6818
|
if (this.publicDomain && this.publicDomain.trim().length > 0) {
|
|
@@ -6827,7 +6827,7 @@ var ti = class {
|
|
|
6827
6827
|
async delete(e) {
|
|
6828
6828
|
await this.bucket.delete(e);
|
|
6829
6829
|
}
|
|
6830
|
-
},
|
|
6830
|
+
}, ti = class {
|
|
6831
6831
|
customStoragePath;
|
|
6832
6832
|
constructor(e) {
|
|
6833
6833
|
this.customStoragePath = e;
|
|
@@ -6845,7 +6845,7 @@ var ti = class {
|
|
|
6845
6845
|
), { pipeline: a } = await import(
|
|
6846
6846
|
/* @vite-ignore */
|
|
6847
6847
|
"node:stream/promises"
|
|
6848
|
-
), o =
|
|
6848
|
+
), o = $r(e.name), s = `${t}/${crypto.randomUUID().replace(/-/g, "")}.${o}`, c = this.customStoragePath || "./public/media", l = n.resolve(process.cwd(), c), u = n.join(l, s);
|
|
6849
6849
|
await i.mkdir(n.dirname(u), { recursive: !0 });
|
|
6850
6850
|
let d = r.createWriteStream(u);
|
|
6851
6851
|
return await a(e.stream(), d), {
|
|
@@ -6868,16 +6868,16 @@ var ti = class {
|
|
|
6868
6868
|
}
|
|
6869
6869
|
}
|
|
6870
6870
|
};
|
|
6871
|
-
function
|
|
6871
|
+
function ni(e) {
|
|
6872
6872
|
if (e.MEDIA_BUCKET) {
|
|
6873
6873
|
let t = e.CDN_DOMAIN || "cdn.yourdomain.com";
|
|
6874
|
-
return new
|
|
6874
|
+
return new ei(e.MEDIA_BUCKET, t);
|
|
6875
6875
|
}
|
|
6876
|
-
return new
|
|
6876
|
+
return new ti(e.LOCAL_MEDIA_PATH);
|
|
6877
6877
|
}
|
|
6878
6878
|
//#endregion
|
|
6879
6879
|
//#region server/utils/node-assets-interceptor.ts
|
|
6880
|
-
function
|
|
6880
|
+
function ri(e) {
|
|
6881
6881
|
if (!e || typeof e != "object") return {
|
|
6882
6882
|
cleanedData: e,
|
|
6883
6883
|
assetRefs: []
|
|
@@ -6936,7 +6936,7 @@ function ii(e) {
|
|
|
6936
6936
|
assetRefs: t
|
|
6937
6937
|
};
|
|
6938
6938
|
}
|
|
6939
|
-
async function
|
|
6939
|
+
async function ii(e, t, n) {
|
|
6940
6940
|
if (await e.prepare("DELETE FROM node_assets WHERE nodeId = ?").run(t), n.length === 0) return;
|
|
6941
6941
|
let r = /* @__PURE__ */ new Set();
|
|
6942
6942
|
for (let i of n) {
|
|
@@ -6946,23 +6946,23 @@ async function ai(e, t, n) {
|
|
|
6946
6946
|
}
|
|
6947
6947
|
//#endregion
|
|
6948
6948
|
//#region server/utils/asset-hydrator.ts
|
|
6949
|
-
function
|
|
6949
|
+
function ai(e) {
|
|
6950
6950
|
if (!e) return null;
|
|
6951
6951
|
if (typeof e == "string" && e.startsWith("ast_")) return e;
|
|
6952
6952
|
if (typeof e == "object" && e) {
|
|
6953
6953
|
if (typeof e.id == "string" && e.id.startsWith("ast_")) return e.id;
|
|
6954
|
-
if (typeof e.id == "object") return
|
|
6954
|
+
if (typeof e.id == "object") return ai(e.id);
|
|
6955
6955
|
}
|
|
6956
6956
|
return null;
|
|
6957
6957
|
}
|
|
6958
|
-
async function
|
|
6958
|
+
async function oi(e, t) {
|
|
6959
6959
|
if (!t || typeof t != "object") return t;
|
|
6960
6960
|
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
6961
6961
|
if (!e) return;
|
|
6962
|
-
let t =
|
|
6962
|
+
let t = ai(e);
|
|
6963
6963
|
if (t) {
|
|
6964
6964
|
if (n.add(t), typeof e == "object" && e.parentAssetId) {
|
|
6965
|
-
let t =
|
|
6965
|
+
let t = ai(e.parentAssetId);
|
|
6966
6966
|
t && n.add(t);
|
|
6967
6967
|
}
|
|
6968
6968
|
} else Array.isArray(e) ? e.forEach(r) : typeof e == "object" && Object.values(e).forEach(r);
|
|
@@ -6991,7 +6991,7 @@ async function si(e, t) {
|
|
|
6991
6991
|
AND (parentAssetId IN (${i}) OR ${Array.from(n).map(() => "filename LIKE ?").join(" OR ")})
|
|
6992
6992
|
`).all(...Array.from(n), ...Array.from(n).map((e) => `%${e}%`)), c = Array.isArray(s) ? s : s?.results || [], l = /* @__PURE__ */ new Map();
|
|
6993
6993
|
for (let e of c) {
|
|
6994
|
-
let t =
|
|
6994
|
+
let t = ai(e.parentAssetId) || Array.from(n).find((t) => e.filename.includes(t));
|
|
6995
6995
|
if (!t) continue;
|
|
6996
6996
|
let r = e.filename.match(/^crop_([a-z0-9]+)_/i), i = r ? r[1] : "standard", a = null;
|
|
6997
6997
|
if (e.cropCoordinatesJson) try {
|
|
@@ -7026,7 +7026,7 @@ async function si(e, t) {
|
|
|
7026
7026
|
id: e.id,
|
|
7027
7027
|
url: t,
|
|
7028
7028
|
originalUrl: n,
|
|
7029
|
-
parentAssetId:
|
|
7029
|
+
parentAssetId: ai(e.parentAssetId) || null,
|
|
7030
7030
|
cropCoordinates: r,
|
|
7031
7031
|
variants: i && Object.keys(i).length > 0 ? i : void 0,
|
|
7032
7032
|
filename: e.filename,
|
|
@@ -7038,7 +7038,7 @@ async function si(e, t) {
|
|
|
7038
7038
|
}
|
|
7039
7039
|
let d = (e) => {
|
|
7040
7040
|
if (!e) return e;
|
|
7041
|
-
let t =
|
|
7041
|
+
let t = ai(e);
|
|
7042
7042
|
if (t) {
|
|
7043
7043
|
let n = u.get(t) || {
|
|
7044
7044
|
id: t,
|
|
@@ -7048,7 +7048,7 @@ async function si(e, t) {
|
|
|
7048
7048
|
return {
|
|
7049
7049
|
...n,
|
|
7050
7050
|
id: t,
|
|
7051
|
-
parentAssetId: n.parentAssetId ?
|
|
7051
|
+
parentAssetId: n.parentAssetId ? ai(n.parentAssetId) : null,
|
|
7052
7052
|
url: typeof e == "object" && e.url && !e.url.startsWith("blob:") ? e.url : n.url,
|
|
7053
7053
|
originalUrl: typeof e == "object" && e.originalUrl && !e.originalUrl.startsWith("blob:") ? e.originalUrl : n.originalUrl,
|
|
7054
7054
|
cropCoordinates: i || n.cropCoordinates || null,
|
|
@@ -7068,7 +7068,7 @@ async function si(e, t) {
|
|
|
7068
7068
|
}
|
|
7069
7069
|
//#endregion
|
|
7070
7070
|
//#region src/schemas/definitions.ts
|
|
7071
|
-
function
|
|
7071
|
+
function Y(e = {}, t = {}) {
|
|
7072
7072
|
let n = {
|
|
7073
7073
|
...e,
|
|
7074
7074
|
...t
|
|
@@ -7086,7 +7086,7 @@ function J(e = {}, t = {}) {
|
|
|
7086
7086
|
...t.rules || {}
|
|
7087
7087
|
}, n;
|
|
7088
7088
|
}
|
|
7089
|
-
function
|
|
7089
|
+
function si() {
|
|
7090
7090
|
if (typeof process > "u" || !process?.versions?.node) return null;
|
|
7091
7091
|
try {
|
|
7092
7092
|
let e = (e) => {
|
|
@@ -7115,7 +7115,7 @@ function ci() {
|
|
|
7115
7115
|
for (let a of e(r)) {
|
|
7116
7116
|
let e = n.basename(a, n.extname(a));
|
|
7117
7117
|
try {
|
|
7118
|
-
i[e] =
|
|
7118
|
+
i[e] = Dr.parse(t.readFileSync(a, "utf-8"));
|
|
7119
7119
|
} catch (e) {
|
|
7120
7120
|
console.warn(`[CMS Schema] Failed to parse ${a}:`, e);
|
|
7121
7121
|
}
|
|
@@ -7125,7 +7125,7 @@ function ci() {
|
|
|
7125
7125
|
let i = e(n.dirname(r)), a = n.basename(r), o = i.find((e) => n.basename(e) === a || n.basename(e) === a.replace(/\.yaml$/, ".yml"));
|
|
7126
7126
|
if (!o) return null;
|
|
7127
7127
|
try {
|
|
7128
|
-
return
|
|
7128
|
+
return Dr.parse(t.readFileSync(o, "utf-8"));
|
|
7129
7129
|
} catch {
|
|
7130
7130
|
return null;
|
|
7131
7131
|
}
|
|
@@ -7153,12 +7153,12 @@ function ci() {
|
|
|
7153
7153
|
return null;
|
|
7154
7154
|
}
|
|
7155
7155
|
}
|
|
7156
|
-
function
|
|
7157
|
-
if (e && (Object.keys(e.rawNodes || {}).length > 0 || Object.keys(e.nodes || {}).length > 0)) return
|
|
7158
|
-
let t =
|
|
7159
|
-
return t && Object.keys(t.rawNodes).length > 0 ?
|
|
7156
|
+
function ci(e) {
|
|
7157
|
+
if (e && (Object.keys(e.rawNodes || {}).length > 0 || Object.keys(e.nodes || {}).length > 0)) return li(e);
|
|
7158
|
+
let t = si();
|
|
7159
|
+
return t && Object.keys(t.rawNodes).length > 0 ? li(t) : li(null);
|
|
7160
7160
|
}
|
|
7161
|
-
function
|
|
7161
|
+
function li(e) {
|
|
7162
7162
|
if (!e) return {
|
|
7163
7163
|
nodes: {},
|
|
7164
7164
|
trees: {},
|
|
@@ -7178,7 +7178,7 @@ function ui(e) {
|
|
|
7178
7178
|
let i = {};
|
|
7179
7179
|
if (!Array.isArray(e)) return typeof e == "object" && e ? (Object.entries(e).forEach(([e, t]) => {
|
|
7180
7180
|
let n = i[e] || m[e] || {};
|
|
7181
|
-
i[e] =
|
|
7181
|
+
i[e] = Y(n, t);
|
|
7182
7182
|
}), i) : {};
|
|
7183
7183
|
let a = (e) => {
|
|
7184
7184
|
let a = h[e] || h[`${e}-base`] || {};
|
|
@@ -7191,11 +7191,11 @@ function ui(e) {
|
|
|
7191
7191
|
fields: {}
|
|
7192
7192
|
}), Object.entries(s).forEach(([e, r]) => {
|
|
7193
7193
|
let i = n[t].fields[e] || {};
|
|
7194
|
-
n[t].fields[e] =
|
|
7194
|
+
n[t].fields[e] = Y(i, r);
|
|
7195
7195
|
});
|
|
7196
7196
|
} else Object.entries(s).forEach(([e, t]) => {
|
|
7197
7197
|
let n = i[e] || {};
|
|
7198
|
-
i[e] =
|
|
7198
|
+
i[e] = Y(n, t);
|
|
7199
7199
|
});
|
|
7200
7200
|
};
|
|
7201
7201
|
return e.forEach((e) => {
|
|
@@ -7203,7 +7203,7 @@ function ui(e) {
|
|
|
7203
7203
|
if (e.startsWith("fieldSet:")) a(e.replace("fieldSet:", "").trim());
|
|
7204
7204
|
else {
|
|
7205
7205
|
let t = i[e] || m[e] || {};
|
|
7206
|
-
i[e] =
|
|
7206
|
+
i[e] = Y(t, {
|
|
7207
7207
|
type: "text",
|
|
7208
7208
|
label: e
|
|
7209
7209
|
});
|
|
@@ -7213,7 +7213,7 @@ function ui(e) {
|
|
|
7213
7213
|
if (t === "fieldSet") a(String(n));
|
|
7214
7214
|
else {
|
|
7215
7215
|
let e = i[t] || m[t] || {};
|
|
7216
|
-
i[t] =
|
|
7216
|
+
i[t] = Y(e, typeof n == "object" && n ? n : {});
|
|
7217
7217
|
}
|
|
7218
7218
|
}
|
|
7219
7219
|
}), i;
|
|
@@ -7231,7 +7231,7 @@ function ui(e) {
|
|
|
7231
7231
|
let s = g(i.fields || i, a, n, t);
|
|
7232
7232
|
Object.entries(s).forEach(([e, t]) => {
|
|
7233
7233
|
let r = n[a].fields[e] || {};
|
|
7234
|
-
n[a].fields[e] =
|
|
7234
|
+
n[a].fields[e] = Y(r, t);
|
|
7235
7235
|
});
|
|
7236
7236
|
}
|
|
7237
7237
|
}), n) : (Object.entries(e).forEach(([e, r]) => {
|
|
@@ -7243,7 +7243,7 @@ function ui(e) {
|
|
|
7243
7243
|
let o = g(a, e, n, t);
|
|
7244
7244
|
Object.entries(o).forEach(([t, r]) => {
|
|
7245
7245
|
let i = n[e].fields[t] || {};
|
|
7246
|
-
n[e].fields[t] =
|
|
7246
|
+
n[e].fields[t] = Y(i, r);
|
|
7247
7247
|
});
|
|
7248
7248
|
}), n);
|
|
7249
7249
|
}, v = {};
|
|
@@ -7261,16 +7261,16 @@ function ui(e) {
|
|
|
7261
7261
|
fields: {}
|
|
7262
7262
|
}), Object.entries(o).forEach(([e, r]) => {
|
|
7263
7263
|
let i = n[t].fields[e] || {};
|
|
7264
|
-
n[t].fields[e] =
|
|
7264
|
+
n[t].fields[e] = Y(i, r);
|
|
7265
7265
|
});
|
|
7266
7266
|
} else Object.entries(o).forEach(([e, t]) => {
|
|
7267
7267
|
let n = r[e] || m[e] || {};
|
|
7268
|
-
r[e] =
|
|
7268
|
+
r[e] = Y(n, t);
|
|
7269
7269
|
});
|
|
7270
7270
|
}), Object.values(n).forEach((e) => {
|
|
7271
7271
|
Object.entries(e.fields).forEach(([e, t]) => {
|
|
7272
7272
|
let n = r[e] || {};
|
|
7273
|
-
r[e] =
|
|
7273
|
+
r[e] = Y(n, t);
|
|
7274
7274
|
});
|
|
7275
7275
|
}), Object.keys(n).length === 0 && Object.keys(r).length > 0 && (n.settings = {
|
|
7276
7276
|
label: t.label || "Settings",
|
|
@@ -7293,11 +7293,11 @@ function ui(e) {
|
|
|
7293
7293
|
Array.isArray(t.fieldSets) && t.fieldSets.forEach((e) => {
|
|
7294
7294
|
let t = h[e] || {}, i = t.fields || t, a = g(i, "settings", n);
|
|
7295
7295
|
Object.entries(a).forEach(([e, t]) => {
|
|
7296
|
-
r[e] =
|
|
7296
|
+
r[e] = Y(r[e] || {}, t);
|
|
7297
7297
|
});
|
|
7298
7298
|
}), Object.values(n).forEach((e) => {
|
|
7299
7299
|
Object.entries(e.fields).forEach(([e, t]) => {
|
|
7300
|
-
r[e] =
|
|
7300
|
+
r[e] = Y(r[e] || {}, t);
|
|
7301
7301
|
});
|
|
7302
7302
|
}), y[e] = {
|
|
7303
7303
|
...t,
|
|
@@ -7316,7 +7316,7 @@ function ui(e) {
|
|
|
7316
7316
|
Array.isArray(t.fieldSets) && t.fieldSets.forEach((e) => {
|
|
7317
7317
|
let t = h[e] || {}, r = t.fields || t, i = g(r);
|
|
7318
7318
|
Object.entries(i).forEach(([e, t]) => {
|
|
7319
|
-
n[e] =
|
|
7319
|
+
n[e] = Y(n[e] || {}, t);
|
|
7320
7320
|
});
|
|
7321
7321
|
}), b[e] = {
|
|
7322
7322
|
...t,
|
|
@@ -7365,7 +7365,7 @@ function ui(e) {
|
|
|
7365
7365
|
Array.isArray(f?.fieldSets) && f?.fieldSets.forEach((e) => {
|
|
7366
7366
|
let t = h[e] || {}, n = t.fields || t, r = g(n);
|
|
7367
7367
|
Object.entries(r).forEach(([e, t]) => {
|
|
7368
|
-
T[e] =
|
|
7368
|
+
T[e] = Y(T[e] || {}, t);
|
|
7369
7369
|
});
|
|
7370
7370
|
});
|
|
7371
7371
|
let E = f ? {
|
|
@@ -7375,10 +7375,10 @@ function ui(e) {
|
|
|
7375
7375
|
Array.isArray(p?.fieldSets) && p?.fieldSets.forEach((e) => {
|
|
7376
7376
|
let t = h[e] || {}, n = t.fields || t, r = g(n);
|
|
7377
7377
|
Object.entries(r).forEach(([e, t]) => {
|
|
7378
|
-
D[e] =
|
|
7378
|
+
D[e] = Y(D[e] || {}, t);
|
|
7379
7379
|
});
|
|
7380
7380
|
});
|
|
7381
|
-
let
|
|
7381
|
+
let O = p ? {
|
|
7382
7382
|
...p,
|
|
7383
7383
|
fields: D
|
|
7384
7384
|
} : null;
|
|
@@ -7392,12 +7392,12 @@ function ui(e) {
|
|
|
7392
7392
|
nodeTemplate: u || null,
|
|
7393
7393
|
treeTemplate: d || null,
|
|
7394
7394
|
channelTemplate: E,
|
|
7395
|
-
userTemplate:
|
|
7395
|
+
userTemplate: O
|
|
7396
7396
|
};
|
|
7397
7397
|
}
|
|
7398
7398
|
//#endregion
|
|
7399
7399
|
//#region server/services/cache-manager.ts
|
|
7400
|
-
var
|
|
7400
|
+
var X = class {
|
|
7401
7401
|
zoneId;
|
|
7402
7402
|
apiToken;
|
|
7403
7403
|
frontendUrl;
|
|
@@ -7406,7 +7406,13 @@ var Y = class {
|
|
|
7406
7406
|
this.env = e, this.zoneId = e.CLOUDFLARE_ZONE_ID, this.apiToken = e.CLOUDFLARE_API_TOKEN, this.frontendUrl = (e.PUBLIC_FRONTEND_URL || "https://kama.t3cloud.eu").replace(/\/+$/, "");
|
|
7407
7407
|
}
|
|
7408
7408
|
dispatch(e, t) {
|
|
7409
|
-
|
|
7409
|
+
try {
|
|
7410
|
+
if (e.executionCtx && typeof e.executionCtx.waitUntil == "function") {
|
|
7411
|
+
e.executionCtx.waitUntil(t);
|
|
7412
|
+
return;
|
|
7413
|
+
}
|
|
7414
|
+
} catch {}
|
|
7415
|
+
t.catch((e) => console.warn("[CacheManager Warn]:", e));
|
|
7410
7416
|
}
|
|
7411
7417
|
async callAstroPurge(e, t) {
|
|
7412
7418
|
let n = `${this.frontendUrl}/api/purge`, r = {
|
|
@@ -7425,7 +7431,7 @@ var Y = class {
|
|
|
7425
7431
|
}
|
|
7426
7432
|
async purgeInternalWorkerCache(e, t, n, r, i = "en") {
|
|
7427
7433
|
try {
|
|
7428
|
-
let a =
|
|
7434
|
+
let a = J(e);
|
|
7429
7435
|
if (n) {
|
|
7430
7436
|
let e = await t.prepare("SELECT treeId FROM tree_nodes WHERE contentId = ?").all(n), r = Array.isArray(e) ? e : e?.results || [];
|
|
7431
7437
|
for (let e of r) await a.delete(`tree:default:${e.treeId}`), await a.delete(`tree:all:${e.treeId}`);
|
|
@@ -7547,8 +7553,8 @@ var Y = class {
|
|
|
7547
7553
|
console.error("❌ [CacheManager] Dual Slug Purge CRASH:", e);
|
|
7548
7554
|
}
|
|
7549
7555
|
}
|
|
7550
|
-
},
|
|
7551
|
-
async function
|
|
7556
|
+
}, Z = new e();
|
|
7557
|
+
async function ui(e, t, n = []) {
|
|
7552
7558
|
let r = e.prepare(t);
|
|
7553
7559
|
if (typeof r.bind == "function") {
|
|
7554
7560
|
let e = await r.bind(...n).all();
|
|
@@ -7560,37 +7566,30 @@ async function di(e, t, n = []) {
|
|
|
7560
7566
|
}
|
|
7561
7567
|
return [];
|
|
7562
7568
|
}
|
|
7563
|
-
async function
|
|
7569
|
+
async function di(e, t, n = []) {
|
|
7564
7570
|
let r = e.prepare(t);
|
|
7565
7571
|
if (typeof r.bind == "function") return r.bind(...n).run();
|
|
7566
7572
|
if (typeof r.run == "function") return r.run(...n);
|
|
7567
7573
|
}
|
|
7568
|
-
async function
|
|
7574
|
+
async function fi(e, t) {
|
|
7569
7575
|
try {
|
|
7570
|
-
return (await
|
|
7576
|
+
return (await ui(e, "\n SELECT DISTINCT a.url\n FROM node_assets na\n JOIN assets a ON na.assetId = a.id\n WHERE na.nodeId = ? AND a.url IS NOT NULL AND a.url != ''\n ", [t])).map((e) => e.url).filter(Boolean);
|
|
7571
7577
|
} catch {
|
|
7572
7578
|
return [];
|
|
7573
7579
|
}
|
|
7574
7580
|
}
|
|
7575
|
-
|
|
7576
|
-
try {
|
|
7577
|
-
return (await di(e, "\n WITH RECURSIVE tree_path(treeNodeId, contentId, parentId) AS (\n SELECT id, contentId, parentId \n FROM tree_nodes \n WHERE contentId = ?\n UNION ALL\n SELECT tn.id, tn.contentId, tn.parentId\n FROM tree_nodes tn\n INNER JOIN tree_path tp ON tn.parentId = tp.treeNodeId\n )\n SELECT DISTINCT cn.slug\n FROM tree_path tp\n INNER JOIN content_nodes cn ON tp.contentId = cn.id\n WHERE cn.status = 'published' AND cn.slug IS NOT NULL AND cn.id != ?\n ", [t, t])).map((e) => e.slug).filter(Boolean);
|
|
7578
|
-
} catch (e) {
|
|
7579
|
-
return console.warn("[Cache] Failed to fetch descendant slugs:", e), [];
|
|
7580
|
-
}
|
|
7581
|
-
}
|
|
7582
|
-
function hi(e) {
|
|
7581
|
+
function pi(e) {
|
|
7583
7582
|
return !e || !e.trim() ? null : e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/[^a-z0-9\s-]/g, "").replace(/[\s-]+/g, "-").replace(/^-+|-+$/g, "") || null;
|
|
7584
7583
|
}
|
|
7585
|
-
function
|
|
7584
|
+
function mi(e) {
|
|
7586
7585
|
return +(e === !0 || e === 1 || e === "1" || e === "true");
|
|
7587
7586
|
}
|
|
7588
|
-
function
|
|
7587
|
+
function hi(e) {
|
|
7589
7588
|
if (e == null || e === "null" || e === "" || typeof e == "string" && e.startsWith("draft-")) return null;
|
|
7590
7589
|
let t = Number(e);
|
|
7591
7590
|
return isNaN(t) ? null : t;
|
|
7592
7591
|
}
|
|
7593
|
-
function
|
|
7592
|
+
function gi(e) {
|
|
7594
7593
|
let t = { ...e };
|
|
7595
7594
|
for (let e of [
|
|
7596
7595
|
"id",
|
|
@@ -7619,17 +7618,17 @@ function vi(e) {
|
|
|
7619
7618
|
]) delete t[e];
|
|
7620
7619
|
return t;
|
|
7621
7620
|
}
|
|
7622
|
-
function
|
|
7623
|
-
return e ? typeof e == "string" ? (e.startsWith("ast_") && t.add(e), t) : Array.isArray(e) ? (e.forEach((e) =>
|
|
7621
|
+
function _i(e, t = /* @__PURE__ */ new Set()) {
|
|
7622
|
+
return e ? typeof e == "string" ? (e.startsWith("ast_") && t.add(e), t) : Array.isArray(e) ? (e.forEach((e) => _i(e, t)), t) : (typeof e == "object" && Object.values(e).forEach((e) => _i(e, t)), t) : t;
|
|
7624
7623
|
}
|
|
7625
|
-
async function
|
|
7624
|
+
async function vi(e, t, n) {
|
|
7626
7625
|
for (let r of n) {
|
|
7627
|
-
let n = (await
|
|
7628
|
-
if (!n || (await
|
|
7626
|
+
let n = (await ui(e, "\n SELECT id, storageKeyPrivate, isSystemVariant, parentAssetId, filename\n FROM assets WHERE id = ?\n ", [r]))[0];
|
|
7627
|
+
if (!n || (await ui(e, "SELECT 1 FROM node_assets WHERE assetId = ? LIMIT 1", [n.id])).length > 0) continue;
|
|
7629
7628
|
let i = [n];
|
|
7630
7629
|
if (!n.isSystemVariant) {
|
|
7631
|
-
let t = await
|
|
7632
|
-
if (r.length > 0 && (await
|
|
7630
|
+
let t = await ui(e, "\n SELECT id, storageKeyPrivate, isSystemVariant, parentAssetId, filename\n FROM assets\n WHERE parentAssetId = ? OR (isSystemVariant = 1 AND filename LIKE ?)\n ", [n.id, `crop_%${String(n.filename || "").replace(/\.[^/.]+$/, "")}%`]), r = t.map((e) => e.id);
|
|
7631
|
+
if (r.length > 0 && (await ui(e, `SELECT DISTINCT assetId FROM node_assets WHERE assetId IN (${r.map(() => "?").join(",")})`, r)).length > 0) continue;
|
|
7633
7632
|
i = [n, ...t];
|
|
7634
7633
|
}
|
|
7635
7634
|
for (let e of i) if (e.storageKeyPrivate) try {
|
|
@@ -7638,10 +7637,10 @@ async function bi(e, t, n) {
|
|
|
7638
7637
|
console.warn(`[Asset Cleanup] Failed to delete ${e.storageKeyPrivate}:`, t);
|
|
7639
7638
|
}
|
|
7640
7639
|
let a = i.map((e) => e.id), o = a.map(() => "?").join(",");
|
|
7641
|
-
await
|
|
7640
|
+
await di(e, `DELETE FROM node_assets WHERE assetId IN (${o})`, a), await di(e, `DELETE FROM assets WHERE id IN (${o})`, a);
|
|
7642
7641
|
}
|
|
7643
7642
|
}
|
|
7644
|
-
async function
|
|
7643
|
+
async function yi(e, t, n) {
|
|
7645
7644
|
let r = {}, i = null;
|
|
7646
7645
|
if (t) {
|
|
7647
7646
|
let n = await e.prepare("\n WITH RECURSIVE ancestor_path(id, parentId, draftDataJson, dataJson, level) AS (\n SELECT t.id, t.parentId, c.draftDataJson, c.dataJson, 0\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n WHERE t.id = ?\n UNION ALL\n SELECT t.id, t.parentId, c.draftDataJson, c.dataJson, ap.level + 1\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n INNER JOIN ancestor_path ap ON t.id = ap.parentId\n )\n SELECT draftDataJson, dataJson FROM ancestor_path ORDER BY level ASC\n ").all(t), a = Array.isArray(n) ? n : n?.results || [];
|
|
@@ -7666,7 +7665,7 @@ async function xi(e, t, n) {
|
|
|
7666
7665
|
inheritedFields: r
|
|
7667
7666
|
};
|
|
7668
7667
|
}
|
|
7669
|
-
|
|
7668
|
+
Z.get("/", async (e) => {
|
|
7670
7669
|
let t = e.get("db"), n = e.req.query("id"), r = e.req.query("type"), i = e.req.query("q") || e.req.query("search"), a = e.req.query("channelId"), o = e.req.query("trashed") === "true", s = e.req.query("assetId"), c = e.req.query("sort") || "updatedAt", l = (e.req.query("order") || "DESC").toUpperCase() === "ASC" ? "ASC" : "DESC", u = e.req.query("limit"), d = e.req.query("offset"), f = Math.max(1, Math.min(100, parseInt(u || "50", 10))), p = Math.max(0, parseInt(d || "0", 10));
|
|
7671
7670
|
if (n) {
|
|
7672
7671
|
let r = Number(n);
|
|
@@ -7691,13 +7690,13 @@ X.get("/", async (e) => {
|
|
|
7691
7690
|
updatedAt: i.updatedAt
|
|
7692
7691
|
}, s = i.draftDataJson || i.dataJson;
|
|
7693
7692
|
if (s) try {
|
|
7694
|
-
let n = typeof s == "string" ? JSON.parse(s) : s, a = await t.prepare("SELECT id as treeNodeId, treeId, parentId FROM tree_nodes WHERE contentId = ? LIMIT 1").get(r), c =
|
|
7693
|
+
let n = typeof s == "string" ? JSON.parse(s) : s, a = await t.prepare("SELECT id as treeNodeId, treeId, parentId FROM tree_nodes WHERE contentId = ? LIMIT 1").get(r), c = li(e.env?.BUNDLED_DEFINITIONS).nodes?.[i.contentType] || {}, l = n.layoutId || null;
|
|
7695
7694
|
if (a) {
|
|
7696
|
-
let { resolvedLayoutId: e, inheritedFields: r } = await
|
|
7695
|
+
let { resolvedLayoutId: e, inheritedFields: r } = await yi(t, a.parentId, a.treeId);
|
|
7697
7696
|
(l === "inherit" || !l) && (l = e || c.defaultLayout || null);
|
|
7698
7697
|
for (let [e, t] of Object.entries(r)) (n[e] === void 0 || n[e] === null || n[e] === "") && t !== void 0 && (n[e] = t);
|
|
7699
7698
|
} else (l === "inherit" || !l) && (l = c.defaultLayout || null);
|
|
7700
|
-
let u = await
|
|
7699
|
+
let u = await oi(t, gi(n));
|
|
7701
7700
|
Object.assign(o, u), o.resolvedLayoutId = l;
|
|
7702
7701
|
} catch {}
|
|
7703
7702
|
let c = await t.prepare("SELECT channelId FROM node_channels WHERE nodeId = ?").all(r);
|
|
@@ -7707,7 +7706,7 @@ X.get("/", async (e) => {
|
|
|
7707
7706
|
let u = await t.prepare("\n SELECT * FROM content_blocks \n WHERE contentId = ? AND isDraft = 1 \n ORDER BY sortOrder ASC\n ").all(r), d = Array.isArray(u) ? u : u?.results || [], f = await Promise.all(d.map(async (e) => {
|
|
7708
7707
|
let n = {};
|
|
7709
7708
|
try {
|
|
7710
|
-
n = typeof e.dataJson == "string" ? JSON.parse(e.dataJson || "{}") : e.dataJson || {}, n && typeof n == "object" && (n = await
|
|
7709
|
+
n = typeof e.dataJson == "string" ? JSON.parse(e.dataJson || "{}") : e.dataJson || {}, n && typeof n == "object" && (n = await oi(t, n));
|
|
7711
7710
|
} catch {
|
|
7712
7711
|
n = {};
|
|
7713
7712
|
}
|
|
@@ -7785,7 +7784,7 @@ X.get("/", async (e) => {
|
|
|
7785
7784
|
`).all(...T), a = Array.isArray(i) ? i : a?.results || [];
|
|
7786
7785
|
for (let e of a) D[e.nodeId] || (D[e.nodeId] = []), D[e.nodeId].includes(e.label) || D[e.nodeId].push(e.label);
|
|
7787
7786
|
}
|
|
7788
|
-
let
|
|
7787
|
+
let O = await Promise.all(w.map(async (e) => {
|
|
7789
7788
|
let n = (e.status === "draft" || !e.status) && !!e.publishedAt, r = {
|
|
7790
7789
|
id: e.id,
|
|
7791
7790
|
title: e.title,
|
|
@@ -7807,34 +7806,34 @@ X.get("/", async (e) => {
|
|
|
7807
7806
|
assetCount: e.assetCount || 0
|
|
7808
7807
|
}, i = e.draftDataJson || e.dataJson;
|
|
7809
7808
|
if (i) try {
|
|
7810
|
-
let e = typeof i == "string" ? JSON.parse(i) : i, n = await
|
|
7809
|
+
let e = typeof i == "string" ? JSON.parse(i) : i, n = await oi(t, gi(e));
|
|
7811
7810
|
Object.assign(r, n);
|
|
7812
7811
|
} catch {}
|
|
7813
7812
|
return r;
|
|
7814
7813
|
}));
|
|
7815
7814
|
return e.json({
|
|
7816
|
-
items:
|
|
7815
|
+
items: O,
|
|
7817
7816
|
total: v,
|
|
7818
|
-
hasMore: p +
|
|
7817
|
+
hasMore: p + O.length < v,
|
|
7819
7818
|
offset: p,
|
|
7820
7819
|
limit: f
|
|
7821
7820
|
});
|
|
7822
|
-
}),
|
|
7823
|
-
let t = e.get("db"), n = await e.req.json(), r = n.node || n.activeNode || n, i = r.id || n.id, a = i != null && i !== "" && !isNaN(Number(i)) ? Number(i) : null, { title: o, slug: s, language: c, nodeType: l, contentType: u, isHidden: d, hidden: f, is_hidden: p, blocks: m, channels: h, trees: g, ..._ } = r, { cleanedData: v, assetRefs: y } =
|
|
7821
|
+
}), Z.post("/", async (e) => {
|
|
7822
|
+
let t = e.get("db"), n = await e.req.json(), r = n.node || n.activeNode || n, i = r.id || n.id, a = i != null && i !== "" && !isNaN(Number(i)) ? Number(i) : null, { title: o, slug: s, language: c, nodeType: l, contentType: u, isHidden: d, hidden: f, is_hidden: p, blocks: m, channels: h, trees: g, ..._ } = r, { cleanedData: v, assetRefs: y } = ri(gi(_)), b = mi(d === void 0 ? f === void 0 ? p : f : d), x = c || "en", S = l || u || "page", C = e.get("user")?.id || null, w = a, T = /* @__PURE__ */ new Set();
|
|
7824
7823
|
if (a) {
|
|
7825
7824
|
let e = await t.prepare("SELECT title, slug, language, contentType, draftDataJson, dataJson, publishedAt, status FROM content_nodes WHERE id = ?").get(a), n = e?.draftDataJson || e?.dataJson || "{}";
|
|
7826
7825
|
try {
|
|
7827
|
-
|
|
7826
|
+
_i(typeof n == "string" ? JSON.parse(n) : n, T);
|
|
7828
7827
|
} catch {}
|
|
7829
7828
|
if (m !== void 0) {
|
|
7830
7829
|
let e = await t.prepare("SELECT dataJson FROM content_blocks WHERE contentId = ? AND isDraft = 1").all(a);
|
|
7831
7830
|
(Array.isArray(e) ? e : e?.results || []).forEach((e) => {
|
|
7832
7831
|
try {
|
|
7833
|
-
|
|
7832
|
+
_i(typeof e.dataJson == "string" ? JSON.parse(e.dataJson) : e.dataJson, T);
|
|
7834
7833
|
} catch {}
|
|
7835
7834
|
});
|
|
7836
7835
|
}
|
|
7837
|
-
let r = o === void 0 ? e?.title || "Untitled" : o, i = s === void 0 ? e?.slug ?? null :
|
|
7836
|
+
let r = o === void 0 ? e?.title || "Untitled" : o, i = s === void 0 ? e?.slug ?? null : pi(s), c = S || e?.contentType || "page", l = x || e?.language || "en", u = e?.draftDataJson || e?.dataJson || "{}", d = {};
|
|
7838
7837
|
try {
|
|
7839
7838
|
d = JSON.parse(u);
|
|
7840
7839
|
} catch {}
|
|
@@ -7844,7 +7843,7 @@ X.get("/", async (e) => {
|
|
|
7844
7843
|
});
|
|
7845
7844
|
await t.prepare("\n UPDATE content_nodes \n SET title = ?, \n slug = ?, \n language = ?,\n contentType = ?, \n isHidden = ?, \n status = 'draft', \n draftDataJson = ?, \n updatedById = ?, \n updatedAt = CURRENT_TIMESTAMP\n WHERE id = ?\n ").run(r, i, l, c, b, f, C, a);
|
|
7846
7845
|
} else {
|
|
7847
|
-
let e = o || "Untitled", n =
|
|
7846
|
+
let e = o || "Untitled", n = pi(s), r = JSON.stringify(v), i = await t.prepare("\n INSERT INTO content_nodes (contentType, title, slug, language, isHidden, status, draftDataJson, dataJson, createdById, updatedById)\n VALUES (?, ?, ?, ?, ?, 'draft', ?, NULL, ?, ?)\n ").run(S, e, n, x, b, r, C, C);
|
|
7848
7847
|
w = Number(i.lastInsertRowid);
|
|
7849
7848
|
}
|
|
7850
7849
|
if (h !== void 0 && Array.isArray(h) && w) {
|
|
@@ -7856,24 +7855,25 @@ X.get("/", async (e) => {
|
|
|
7856
7855
|
}
|
|
7857
7856
|
}
|
|
7858
7857
|
if (g !== void 0 && Array.isArray(g) && w) {
|
|
7858
|
+
let e = await t.prepare("SELECT treeId, parentId, sortOrder FROM tree_nodes WHERE contentId = ?").all(w), n = Array.isArray(e) ? e : e?.results || [];
|
|
7859
7859
|
await t.prepare("DELETE FROM tree_nodes WHERE contentId = ?").run(w);
|
|
7860
|
-
let
|
|
7861
|
-
for (let
|
|
7862
|
-
let
|
|
7863
|
-
if (!
|
|
7864
|
-
|
|
7865
|
-
let
|
|
7866
|
-
|
|
7860
|
+
let r = /* @__PURE__ */ new Set(), i = [], a = [];
|
|
7861
|
+
for (let e of g) if (e && e.treeId) {
|
|
7862
|
+
let t = Number(e.treeId) || e.treeId;
|
|
7863
|
+
if (!r.has(t)) {
|
|
7864
|
+
r.add(t);
|
|
7865
|
+
let o = hi(e.parentId ?? e._draftParentId ?? null), s = n.find((e) => e.treeId === t), c = 0;
|
|
7866
|
+
typeof e.sortOrder == "number" ? c = e.sortOrder : s && typeof s.sortOrder == "number" && (c = s.sortOrder), i.push("(?, ?, ?, ?)"), a.push(t, w, o, c);
|
|
7867
7867
|
}
|
|
7868
7868
|
}
|
|
7869
|
-
|
|
7869
|
+
i.length > 0 && await t.prepare(`INSERT INTO tree_nodes (treeId, contentId, parentId, sortOrder) VALUES ${i.join(", ")}`).run(...a);
|
|
7870
7870
|
}
|
|
7871
7871
|
let E = [];
|
|
7872
7872
|
if (m !== void 0 && Array.isArray(m) && w) {
|
|
7873
7873
|
await t.prepare("DELETE FROM content_blocks WHERE contentId = ? AND isDraft = 1").run(w);
|
|
7874
7874
|
let e = [], n = [];
|
|
7875
7875
|
for (let t = 0; t < m.length; t++) {
|
|
7876
|
-
let r = m[t], i = r.componentId || r.elementType || "text-block", a = r.data || {}, o = String(r.blockId || a.blockId || r.instanceId || r.id || `block-${Date.now()}`), { cleanedData: s, assetRefs: c } =
|
|
7876
|
+
let r = m[t], i = r.componentId || r.elementType || "text-block", a = r.data || {}, o = String(r.blockId || a.blockId || r.instanceId || r.id || `block-${Date.now()}`), { cleanedData: s, assetRefs: c } = ri({
|
|
7877
7877
|
...a,
|
|
7878
7878
|
blockId: o,
|
|
7879
7879
|
_instanceId: o
|
|
@@ -7891,16 +7891,16 @@ X.get("/", async (e) => {
|
|
|
7891
7891
|
}
|
|
7892
7892
|
if (w) {
|
|
7893
7893
|
let n = [...y, ...E];
|
|
7894
|
-
await
|
|
7894
|
+
await ii(t, w, n);
|
|
7895
7895
|
let r = new Set(n.map((e) => e.assetId)), i = new Set([...T].filter((e) => !r.has(e)));
|
|
7896
|
-
i.size > 0 && await
|
|
7896
|
+
i.size > 0 && await vi(t, ni(e.env), i);
|
|
7897
7897
|
}
|
|
7898
|
-
return await
|
|
7898
|
+
return await J(e).clear(), e.json({
|
|
7899
7899
|
success: !0,
|
|
7900
7900
|
id: w,
|
|
7901
7901
|
status: "draft"
|
|
7902
7902
|
});
|
|
7903
|
-
}),
|
|
7903
|
+
}), Z.post("/publish", async (e) => {
|
|
7904
7904
|
let t = e.get("db"), n = await e.req.json(), r = n.id || n.nodeId;
|
|
7905
7905
|
if (!r || isNaN(Number(r))) return e.json({ error: "Node ID required for publishing" }, 400);
|
|
7906
7906
|
let i = Number(r), a = e.get("user")?.id || null, o = await t.prepare("SELECT * FROM content_nodes WHERE id = ?").get(i);
|
|
@@ -7933,59 +7933,59 @@ X.get("/", async (e) => {
|
|
|
7933
7933
|
},
|
|
7934
7934
|
blocks: g
|
|
7935
7935
|
};
|
|
7936
|
-
await t.prepare("\n INSERT INTO node_revisions (nodeId, version, snapshotJson, createdById)\n VALUES (?, ?, ?, ?)\n ").run(i, _, v.publishedAt, a), await
|
|
7937
|
-
let y = new
|
|
7936
|
+
await t.prepare("\n INSERT INTO node_revisions (nodeId, version, snapshotJson, createdById)\n VALUES (?, ?, ?, ?)\n ").run(i, _, v.publishedAt, a), await J(e).clear();
|
|
7937
|
+
let y = new X(e.env);
|
|
7938
7938
|
await y.purgeInternalWorkerCache(e, t, i, o.slug, o.language || "en");
|
|
7939
|
-
let b = await
|
|
7940
|
-
|
|
7941
|
-
return e.json({
|
|
7939
|
+
let b = await fi(t, i);
|
|
7940
|
+
return y.purgeSmart(e, t, i, o.slug, b, p), e.json({
|
|
7942
7941
|
success: !0,
|
|
7943
7942
|
id: i,
|
|
7944
7943
|
status: "published",
|
|
7945
7944
|
version: _,
|
|
7946
7945
|
publishedAt: v.publishedAt
|
|
7947
7946
|
});
|
|
7948
|
-
}),
|
|
7947
|
+
}), Z.delete("/", async (e) => {
|
|
7949
7948
|
let t = e.get("db"), n = e.req.query("id");
|
|
7950
7949
|
if (!n) return e.json({ error: "Node ID required" }, 400);
|
|
7951
7950
|
let r = Number(n), i = await t.prepare("SELECT slug, language, status FROM content_nodes WHERE id = ?").get(r);
|
|
7952
|
-
await t.prepare("UPDATE content_nodes SET deletedAt = CURRENT_TIMESTAMP WHERE id = ?").run(r), await
|
|
7953
|
-
let a = new
|
|
7951
|
+
await t.prepare("UPDATE content_nodes SET deletedAt = CURRENT_TIMESTAMP WHERE id = ?").run(r), await J(e).clear();
|
|
7952
|
+
let a = new X(e.env);
|
|
7954
7953
|
if (i && await a.purgeInternalWorkerCache(e, t, r, i.slug, i.language || "en"), i && i.status === "published") {
|
|
7955
|
-
let n = await
|
|
7956
|
-
a.purgeSmart(e, t, r, i.slug, n, !0);
|
|
7954
|
+
let n = await fi(t, r);
|
|
7955
|
+
i.slug && a.purgeAndWarmSlug(e, i.slug, n), a.purgeSmart(e, t, r, i.slug, n, !0);
|
|
7957
7956
|
}
|
|
7958
7957
|
return e.json({
|
|
7959
7958
|
success: !0,
|
|
7960
7959
|
deletedNodeId: r
|
|
7961
7960
|
});
|
|
7962
|
-
}),
|
|
7961
|
+
}), Z.post("/restore", async (e) => {
|
|
7963
7962
|
let t = e.get("db"), n = await e.req.json(), r = Number(n.id);
|
|
7964
7963
|
if (!r) return e.json({ error: "Node ID required" }, 400);
|
|
7965
7964
|
let i = await t.prepare("SELECT slug, language, status FROM content_nodes WHERE id = ?").get(r);
|
|
7966
|
-
|
|
7967
|
-
|
|
7965
|
+
if (!i) return e.json({ error: "Node not found" }, 404);
|
|
7966
|
+
await t.prepare("UPDATE content_nodes SET deletedAt = NULL WHERE id = ?").run(r), await J(e).clear();
|
|
7967
|
+
let a = new X(e.env);
|
|
7968
7968
|
if (i && await a.purgeInternalWorkerCache(e, t, r, i.slug, i.language || "en"), i && i.status === "published") {
|
|
7969
|
-
let n = await
|
|
7970
|
-
a.purgeSmart(e, t, r, i.slug, n, !0);
|
|
7969
|
+
let n = await fi(t, r);
|
|
7970
|
+
i.slug && a.purgeAndWarmSlug(e, i.slug, n), a.purgeSmart(e, t, r, i.slug, n, !0);
|
|
7971
7971
|
}
|
|
7972
7972
|
return e.json({
|
|
7973
7973
|
success: !0,
|
|
7974
7974
|
restoredNodeId: r
|
|
7975
7975
|
});
|
|
7976
|
-
}),
|
|
7976
|
+
}), Z.delete("/purge", async (e) => {
|
|
7977
7977
|
let t = e.get("db"), n = e.req.query("id");
|
|
7978
7978
|
if (!n) return e.json({ error: "Node ID required" }, 400);
|
|
7979
|
-
let r = Number(n), i = await t.prepare("SELECT slug, language, status FROM content_nodes WHERE id = ?").get(r), a = await
|
|
7980
|
-
return i && await o.purgeInternalWorkerCache(e, t, r, i.slug, i.language || "en"), await t.prepare("DELETE FROM node_channels WHERE nodeId = ?").run(r), await t.prepare("DELETE FROM tree_nodes WHERE contentId = ?").run(r), await t.prepare("DELETE FROM content_blocks WHERE contentId = ?").run(r), await t.prepare("DELETE FROM node_revisions WHERE nodeId = ?").run(r), await t.prepare("DELETE FROM node_assets WHERE nodeId = ?").run(r), await t.prepare("DELETE FROM content_nodes WHERE id = ?").run(r), await
|
|
7979
|
+
let r = Number(n), i = await t.prepare("SELECT slug, language, status FROM content_nodes WHERE id = ?").get(r), a = await fi(t, r), o = new X(e.env);
|
|
7980
|
+
return i && await o.purgeInternalWorkerCache(e, t, r, i.slug, i.language || "en"), await t.prepare("DELETE FROM node_channels WHERE nodeId = ?").run(r), await t.prepare("DELETE FROM tree_nodes WHERE contentId = ?").run(r), await t.prepare("DELETE FROM content_blocks WHERE contentId = ?").run(r), await t.prepare("DELETE FROM node_revisions WHERE nodeId = ?").run(r), await t.prepare("DELETE FROM node_assets WHERE nodeId = ?").run(r), await t.prepare("DELETE FROM content_nodes WHERE id = ?").run(r), await J(e).clear(), i && i.status === "published" && (i.slug && o.purgeAndWarmSlug(e, i.slug, a), o.purgeSmart(e, t, r, i.slug, a, !0)), e.json({
|
|
7981
7981
|
success: !0,
|
|
7982
7982
|
purgedNodeId: r
|
|
7983
7983
|
});
|
|
7984
7984
|
});
|
|
7985
7985
|
//#endregion
|
|
7986
7986
|
//#region server/routes/admin/trees.ts
|
|
7987
|
-
var
|
|
7988
|
-
function
|
|
7987
|
+
var bi = new e();
|
|
7988
|
+
function xi(e, t = null) {
|
|
7989
7989
|
let n = [];
|
|
7990
7990
|
for (let r = 0; r < e.length; r++) {
|
|
7991
7991
|
let i = e[r];
|
|
@@ -7997,19 +7997,28 @@ function Ci(e, t = null) {
|
|
|
7997
7997
|
id: o,
|
|
7998
7998
|
parentId: t,
|
|
7999
7999
|
sortOrder: r
|
|
8000
|
-
}), i.children && Array.isArray(i.children) && i.children.length > 0 && n.push(...
|
|
8000
|
+
}), i.children && Array.isArray(i.children) && i.children.length > 0 && n.push(...xi(i.children, o)));
|
|
8001
8001
|
}
|
|
8002
8002
|
return n;
|
|
8003
8003
|
}
|
|
8004
|
-
function
|
|
8004
|
+
function Si(e) {
|
|
8005
8005
|
if (e == null || e === "null" || e === "" || typeof e == "string" && e.startsWith("draft-")) return null;
|
|
8006
8006
|
let t = Number(e);
|
|
8007
8007
|
return isNaN(t) ? null : t;
|
|
8008
8008
|
}
|
|
8009
|
-
function
|
|
8009
|
+
function Ci(e) {
|
|
8010
8010
|
return +(e === !0 || e === 1 || e === "1" || e === "true");
|
|
8011
8011
|
}
|
|
8012
|
-
|
|
8012
|
+
function wi(e, t) {
|
|
8013
|
+
try {
|
|
8014
|
+
if (e.executionCtx && typeof e.executionCtx.waitUntil == "function") {
|
|
8015
|
+
e.executionCtx.waitUntil(t);
|
|
8016
|
+
return;
|
|
8017
|
+
}
|
|
8018
|
+
} catch {}
|
|
8019
|
+
t.catch((e) => console.error("[Tree bgTask Error]:", e));
|
|
8020
|
+
}
|
|
8021
|
+
bi.get("/tree.json", async (e) => {
|
|
8013
8022
|
try {
|
|
8014
8023
|
let t = e.get("db"), n = e.req.query("treeId") || "main-nav", r = e.req.query("preview") === "true", i = 1;
|
|
8015
8024
|
if (isNaN(Number(n))) {
|
|
@@ -8059,9 +8068,9 @@ Si.get("/tree.json", async (e) => {
|
|
|
8059
8068
|
} catch (t) {
|
|
8060
8069
|
return console.error("[CMS Tree API] GET Error:", t), e.json({ error: t.message || "Failed to fetch tree" }, 500);
|
|
8061
8070
|
}
|
|
8062
|
-
}),
|
|
8071
|
+
}), bi.post("/tree.json", async (e) => {
|
|
8063
8072
|
try {
|
|
8064
|
-
let t = e.get("db"), n = await e.req.json(), r = n.treeId ? String(n.treeId).trim() : "main-nav", i =
|
|
8073
|
+
let t = e.get("db"), n = await e.req.json(), r = n.treeId ? String(n.treeId).trim() : "main-nav", i = J(e), a = new X(e.env), o = 1;
|
|
8065
8074
|
if (isNaN(Number(r))) {
|
|
8066
8075
|
let e = await t.prepare("SELECT id FROM trees WHERE key = ?").get(r);
|
|
8067
8076
|
if (e && e.id) o = Number(e.id);
|
|
@@ -8071,7 +8080,7 @@ Si.get("/tree.json", async (e) => {
|
|
|
8071
8080
|
}
|
|
8072
8081
|
} else o = Number(r);
|
|
8073
8082
|
if (n.tree && Array.isArray(n.tree)) {
|
|
8074
|
-
let r =
|
|
8083
|
+
let r = xi(n.tree, null);
|
|
8075
8084
|
if (r.length > 0) for (let e = 0; e < r.length; e += 50) {
|
|
8076
8085
|
let n = r.slice(e, e + 50), i = n.map((e) => e.id), a = i.map(() => "?").join(","), s = "UPDATE tree_nodes SET \n";
|
|
8077
8086
|
s += "parentId = CASE id \n", n.forEach(() => {
|
|
@@ -8086,14 +8095,14 @@ Si.get("/tree.json", async (e) => {
|
|
|
8086
8095
|
c.push(e.id, e.sortOrder);
|
|
8087
8096
|
}), c.push(...i), c.push(o), await t.prepare(s).run(...c);
|
|
8088
8097
|
}
|
|
8089
|
-
return await i.clear(),
|
|
8098
|
+
return await i.clear(), wi(e, a.purgeGlobalCacheDirect(e, t)), e.json({
|
|
8090
8099
|
success: !0,
|
|
8091
8100
|
reorderedCount: r.length
|
|
8092
8101
|
});
|
|
8093
8102
|
}
|
|
8094
|
-
let { action: s, title: c, nodeType: l, parentId: u, contentId: d, nodeData: f = {}, pageData: p = {} } = n, m = Object.keys(f).length > 0 ? { ...f } : { ...p }, h =
|
|
8103
|
+
let { action: s, title: c, nodeType: l, parentId: u, contentId: d, nodeData: f = {}, pageData: p = {} } = n, m = Object.keys(f).length > 0 ? { ...f } : { ...p }, h = Ci(n.isHidden === void 0 ? m.isHidden === void 0 ? m.hidden : m.isHidden : n.isHidden);
|
|
8095
8104
|
delete m._isTreeDraft, delete m._draftParentId, delete m.isNew, delete m.nodeType, delete m.contentType, delete m.title, delete m.slug, delete m.hidden, delete m.is_hidden, delete m.isHidden, delete m.status;
|
|
8096
|
-
let g =
|
|
8105
|
+
let g = Si(u), _ = e.get("user")?.id || null;
|
|
8097
8106
|
if (s === "create") {
|
|
8098
8107
|
let r = m.slug || n.slug || c, s = r ? String(r).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") : null;
|
|
8099
8108
|
if (s) {
|
|
@@ -8125,7 +8134,7 @@ Si.get("/tree.json", async (e) => {
|
|
|
8125
8134
|
let e = b.map(() => "(?, ?)").join(", "), n = b.flatMap((e) => [f, e]);
|
|
8126
8135
|
await t.prepare(`INSERT OR IGNORE INTO node_channels (nodeId, channelId) VALUES ${e}`).run(...n);
|
|
8127
8136
|
}
|
|
8128
|
-
return await i.clear(),
|
|
8137
|
+
return await i.clear(), wi(e, a.purgeGlobalCacheDirect(e, t)), e.json({
|
|
8129
8138
|
success: !0,
|
|
8130
8139
|
id: f,
|
|
8131
8140
|
treeNodeId: v,
|
|
@@ -8163,14 +8172,14 @@ Si.get("/tree.json", async (e) => {
|
|
|
8163
8172
|
}
|
|
8164
8173
|
await t.prepare("DELETE FROM tree_nodes WHERE treeId = ? AND contentId = ?").run(o, d);
|
|
8165
8174
|
let r = await t.prepare("\n INSERT INTO tree_nodes (treeId, contentId, parentId, sortOrder)\n VALUES (?, ?, ?, 0)\n ").run(o, d, g), s = Number(r.lastInsertRowid);
|
|
8166
|
-
return await i.clear(),
|
|
8175
|
+
return await i.clear(), wi(e, a.purgeGlobalCacheDirect(e, t)), e.json({
|
|
8167
8176
|
success: !0,
|
|
8168
8177
|
treeNodeId: s
|
|
8169
8178
|
});
|
|
8170
8179
|
}
|
|
8171
8180
|
if (s === "detach") {
|
|
8172
8181
|
let r = n.treeNodeId || n.contentId;
|
|
8173
|
-
return r ? (await t.prepare("\n UPDATE tree_nodes \n SET parentId = (SELECT parentId FROM tree_nodes WHERE (id = ? OR contentId = ?) AND treeId = ?) \n WHERE parentId = ? AND treeId = ?\n ").run(r, r, o, r, o), await t.prepare("DELETE FROM tree_nodes WHERE (id = ? OR contentId = ?) AND treeId = ?").run(r, r, o), await i.clear(),
|
|
8182
|
+
return r ? (await t.prepare("\n UPDATE tree_nodes \n SET parentId = (SELECT parentId FROM tree_nodes WHERE (id = ? OR contentId = ?) AND treeId = ?) \n WHERE parentId = ? AND treeId = ?\n ").run(r, r, o, r, o), await t.prepare("DELETE FROM tree_nodes WHERE (id = ? OR contentId = ?) AND treeId = ?").run(r, r, o), await i.clear(), wi(e, a.purgeGlobalCacheDirect(e, t)), e.json({ success: !0 })) : e.json({ error: "treeNodeId or contentId required for detach" }, 400);
|
|
8174
8183
|
}
|
|
8175
8184
|
return e.json({ error: "Invalid payload or action" }, 400);
|
|
8176
8185
|
} catch (t) {
|
|
@@ -8179,7 +8188,7 @@ Si.get("/tree.json", async (e) => {
|
|
|
8179
8188
|
details: t.message
|
|
8180
8189
|
}, 500);
|
|
8181
8190
|
}
|
|
8182
|
-
}),
|
|
8191
|
+
}), bi.get("/trees.json", async (e) => {
|
|
8183
8192
|
try {
|
|
8184
8193
|
let t = e.get("db"), n = await t.prepare("SELECT * FROM trees ORDER BY LOWER(label) ASC").all(), r = Array.isArray(n) ? n : n?.results || [], i = await t.prepare("SELECT channelId, treeId FROM channel_trees").all(), a = (Array.isArray(i) ? i : i?.results || []).reduce((e, t) => {
|
|
8185
8194
|
let n = Number(t.treeId), r = Number(t.channelId);
|
|
@@ -8209,7 +8218,7 @@ Si.get("/tree.json", async (e) => {
|
|
|
8209
8218
|
} catch {
|
|
8210
8219
|
return e.json([]);
|
|
8211
8220
|
}
|
|
8212
|
-
}),
|
|
8221
|
+
}), bi.post("/trees.json", async (e) => {
|
|
8213
8222
|
try {
|
|
8214
8223
|
let t = e.get("db"), n = await e.req.json(), r = n.id, i = r != null && r !== "" && !isNaN(Number(r)) ? Number(r) : null, a = `tree-${Date.now().toString(36)}`, o = (n.key || n.slug || a).toLowerCase().replace(/[^a-z0-9_-]/g, "-"), s = n.label?.trim() || o, c = n.treeType !== void 0 && n.treeType !== null ? n.treeType : n.type ?? "site", l = n.channelId !== void 0 && n.channelId !== null && Number(n.channelId) || null, u = +(n.isHidden === !0 || n.isHidden === 1 || n.isHidden === "true"), d = e.get("user")?.id || null, f = { ...n };
|
|
8215
8224
|
if (delete f.id, delete f.key, delete f.label, delete f.treeType, delete f.type, delete f.channelId, delete f.channels, delete f.isHidden, delete f.createdById, delete f.updatedById, delete f.createdAt, delete f.updatedAt, await t.prepare("SELECT id FROM trees WHERE key = ? AND id != ? LIMIT 1").get(o, i ?? -1)) return e.json({
|
|
@@ -8234,9 +8243,7 @@ Si.get("/tree.json", async (e) => {
|
|
|
8234
8243
|
await t.prepare(`INSERT OR IGNORE INTO channel_trees (channelId, treeId, key) VALUES ${n}`).run(...r);
|
|
8235
8244
|
}
|
|
8236
8245
|
}
|
|
8237
|
-
await
|
|
8238
|
-
let m = new Y(e.env);
|
|
8239
|
-
return e.executionCtx && typeof e.executionCtx.waitUntil == "function" ? e.executionCtx.waitUntil(m.purgeGlobalCacheDirect(e, t)) : await m.purgeGlobalCacheDirect(e, t), e.json({
|
|
8246
|
+
return await J(e).clear(), wi(e, new X(e.env).purgeGlobalCacheDirect(e, t)), e.json({
|
|
8240
8247
|
success: !0,
|
|
8241
8248
|
id: p,
|
|
8242
8249
|
key: o,
|
|
@@ -8250,14 +8257,12 @@ Si.get("/tree.json", async (e) => {
|
|
|
8250
8257
|
} catch (t) {
|
|
8251
8258
|
return console.error("[API Trees] Error saving tree:", t), e.json({ error: t.message || "Failed to save tree" }, 500);
|
|
8252
8259
|
}
|
|
8253
|
-
}),
|
|
8260
|
+
}), bi.delete("/trees.json", async (e) => {
|
|
8254
8261
|
let t = e.get("db"), n = e.req.query("id");
|
|
8255
8262
|
if (!n) return e.json({ error: "Tree ID required" }, 400);
|
|
8256
8263
|
let r = Number(n);
|
|
8257
8264
|
try {
|
|
8258
|
-
await t.prepare("DELETE FROM trees WHERE id = ?").run(r), await t.prepare("DELETE FROM channel_trees WHERE treeId = ?").run(r), await t.prepare("DELETE FROM tree_nodes WHERE treeId = ?").run(r), await
|
|
8259
|
-
let n = new Y(e.env);
|
|
8260
|
-
return e.executionCtx && typeof e.executionCtx.waitUntil == "function" ? e.executionCtx.waitUntil(n.purgeGlobalCacheDirect(e, t)) : await n.purgeGlobalCacheDirect(e, t), e.json({
|
|
8265
|
+
return await t.prepare("DELETE FROM trees WHERE id = ?").run(r), await t.prepare("DELETE FROM channel_trees WHERE treeId = ?").run(r), await t.prepare("DELETE FROM tree_nodes WHERE treeId = ?").run(r), await J(e).clear(), wi(e, new X(e.env).purgeGlobalCacheDirect(e, t)), e.json({
|
|
8261
8266
|
success: !0,
|
|
8262
8267
|
deletedTreeId: r
|
|
8263
8268
|
});
|
|
@@ -8267,8 +8272,8 @@ Si.get("/tree.json", async (e) => {
|
|
|
8267
8272
|
});
|
|
8268
8273
|
//#endregion
|
|
8269
8274
|
//#region server/routes/admin/channels.ts
|
|
8270
|
-
var
|
|
8271
|
-
|
|
8275
|
+
var Ti = new e();
|
|
8276
|
+
Ti.get("/", async (e) => {
|
|
8272
8277
|
try {
|
|
8273
8278
|
let t = e.get("db"), n = await t.prepare("SELECT * FROM channels ORDER BY id ASC").all(), r = Array.isArray(n) ? n : n?.results || [], i = await t.prepare("SELECT channelId, treeId, key, metaJson FROM channel_trees").all(), a = ((Array.isArray(i) ? i : i?.results || []) || []).reduce((e, t) => {
|
|
8274
8279
|
e[t.channelId] || (e[t.channelId] = []);
|
|
@@ -8292,7 +8297,7 @@ Ei.get("/", async (e) => {
|
|
|
8292
8297
|
isHidden: !!e.isHidden,
|
|
8293
8298
|
trees: a[e.id] || []
|
|
8294
8299
|
};
|
|
8295
|
-
}), s = e.env?.BUNDLED_DEFINITIONS, c =
|
|
8300
|
+
}), s = e.env?.BUNDLED_DEFINITIONS, c = li(s)?.channelTemplate || {
|
|
8296
8301
|
label: "Channel Settings",
|
|
8297
8302
|
fields: {
|
|
8298
8303
|
key: {
|
|
@@ -8334,7 +8339,7 @@ Ei.get("/", async (e) => {
|
|
|
8334
8339
|
error: t.message
|
|
8335
8340
|
}, 500);
|
|
8336
8341
|
}
|
|
8337
|
-
}),
|
|
8342
|
+
}), Ti.post("/", async (e) => {
|
|
8338
8343
|
try {
|
|
8339
8344
|
let t = e.get("db"), n = await e.req.json(), r = n.id, i = r != null && r !== "" && !isNaN(Number(r)) ? Number(r) : null, { key: a, label: o, channelType: s = "website", domain: c = "localhost", baseUrl: l = "http://localhost:4321", defaultLanguage: u = "en", isHidden: d = !1, trees: f = [], createdById: p = null, updatedById: m = null, id: h, createdAt: g, updatedAt: _, ...v } = n, y = a?.trim() || "main", b = o?.trim() || "Untitled Channel", x = Array.isArray(f) ? f : [], S = JSON.stringify(v || {}), C = e.get("user")?.id || m || p || null;
|
|
8340
8345
|
if (await t.prepare("SELECT id FROM channels WHERE key = ? AND id != ? LIMIT 1").get(y, i ?? -1)) return e.json({
|
|
@@ -8361,8 +8366,8 @@ Ei.get("/", async (e) => {
|
|
|
8361
8366
|
VALUES ${e}
|
|
8362
8367
|
`).run(...n);
|
|
8363
8368
|
}
|
|
8364
|
-
await
|
|
8365
|
-
let E = new
|
|
8369
|
+
await J(e).clear();
|
|
8370
|
+
let E = new X(e.env);
|
|
8366
8371
|
return e.executionCtx && typeof e.executionCtx.waitUntil == "function" ? e.executionCtx.waitUntil(E.purgeGlobalCacheDirect(e, t)) : await E.purgeGlobalCacheDirect(e, t), e.json({
|
|
8367
8372
|
success: !0,
|
|
8368
8373
|
id: w
|
|
@@ -8373,13 +8378,13 @@ Ei.get("/", async (e) => {
|
|
|
8373
8378
|
details: t.message
|
|
8374
8379
|
}, 500);
|
|
8375
8380
|
}
|
|
8376
|
-
}),
|
|
8381
|
+
}), Ti.delete("/", async (e) => {
|
|
8377
8382
|
let t = e.get("db"), n = e.req.query("id");
|
|
8378
8383
|
if (!n) return e.json({ error: "Channel ID required" }, 400);
|
|
8379
8384
|
let r = Number(n);
|
|
8380
8385
|
try {
|
|
8381
|
-
await t.prepare("DELETE FROM channel_trees WHERE channelId = ?").run(r), await t.prepare("DELETE FROM node_channels WHERE channelId = ?").run(r), await t.prepare("DELETE FROM channels WHERE id = ?").run(r), await
|
|
8382
|
-
let n = new
|
|
8386
|
+
await t.prepare("DELETE FROM channel_trees WHERE channelId = ?").run(r), await t.prepare("DELETE FROM node_channels WHERE channelId = ?").run(r), await t.prepare("DELETE FROM channels WHERE id = ?").run(r), await J(e).clear();
|
|
8387
|
+
let n = new X(e.env);
|
|
8383
8388
|
return e.executionCtx && typeof e.executionCtx.waitUntil == "function" ? e.executionCtx.waitUntil(n.purgeGlobalCacheDirect(e, t)) : await n.purgeGlobalCacheDirect(e, t), e.json({
|
|
8384
8389
|
success: !0,
|
|
8385
8390
|
deletedSiteId: r
|
|
@@ -8393,10 +8398,10 @@ Ei.get("/", async (e) => {
|
|
|
8393
8398
|
});
|
|
8394
8399
|
//#endregion
|
|
8395
8400
|
//#region server/routes/admin/schemas.ts
|
|
8396
|
-
var
|
|
8401
|
+
var Ei = new e(), Di = null, Oi = (e) => {
|
|
8397
8402
|
try {
|
|
8398
|
-
if (!
|
|
8399
|
-
let t =
|
|
8403
|
+
if (!Di) {
|
|
8404
|
+
let t = ci(e.env?.BUNDLED_DEFINITIONS || Or), n = t.userTemplate || {
|
|
8400
8405
|
id: "userTemplate",
|
|
8401
8406
|
label: "User Account",
|
|
8402
8407
|
fields: {
|
|
@@ -8432,7 +8437,7 @@ var Di = new e(), Oi = null, ki = (e) => {
|
|
|
8432
8437
|
}
|
|
8433
8438
|
}
|
|
8434
8439
|
};
|
|
8435
|
-
|
|
8440
|
+
Di = {
|
|
8436
8441
|
channelTemplate: t.channelTemplate || null,
|
|
8437
8442
|
treeTemplate: t.treeTemplate || null,
|
|
8438
8443
|
userTemplate: n,
|
|
@@ -8444,7 +8449,7 @@ var Di = new e(), Oi = null, ki = (e) => {
|
|
|
8444
8449
|
blockLayouts: t.blockLayouts || {}
|
|
8445
8450
|
};
|
|
8446
8451
|
}
|
|
8447
|
-
return e.json(
|
|
8452
|
+
return e.json(Di, 200, { "Cache-Control": "public, max-age=300, stale-while-revalidate=86400" });
|
|
8448
8453
|
} catch (t) {
|
|
8449
8454
|
return console.error("[CMS API] Error loading schemas:", t), e.json({
|
|
8450
8455
|
error: "Failed to load schemas",
|
|
@@ -8452,10 +8457,10 @@ var Di = new e(), Oi = null, ki = (e) => {
|
|
|
8452
8457
|
}, 500);
|
|
8453
8458
|
}
|
|
8454
8459
|
};
|
|
8455
|
-
|
|
8460
|
+
Ei.get("/", Oi), Ei.get("/schemas.json", Oi);
|
|
8456
8461
|
//#endregion
|
|
8457
8462
|
//#region server/routes/admin/validation.ts
|
|
8458
|
-
var
|
|
8463
|
+
var ki = new e(), Ai = {
|
|
8459
8464
|
node: "content_nodes",
|
|
8460
8465
|
nodes: "content_nodes",
|
|
8461
8466
|
content_node: "content_nodes",
|
|
@@ -8467,7 +8472,7 @@ var Ai = new e(), ji = {
|
|
|
8467
8472
|
user: "users",
|
|
8468
8473
|
users: "users",
|
|
8469
8474
|
user_account: "user_accounts"
|
|
8470
|
-
},
|
|
8475
|
+
}, ji = {
|
|
8471
8476
|
content_nodes: [
|
|
8472
8477
|
"id",
|
|
8473
8478
|
"title",
|
|
@@ -8524,11 +8529,11 @@ var Ai = new e(), ji = {
|
|
|
8524
8529
|
"createdAt"
|
|
8525
8530
|
]
|
|
8526
8531
|
};
|
|
8527
|
-
|
|
8532
|
+
ki.post("/validate-unique", async (e) => {
|
|
8528
8533
|
try {
|
|
8529
8534
|
let t = e.get("db"), { entityType: n, field: r, value: i, excludeId: a } = await e.req.json();
|
|
8530
8535
|
if (!r || i == null || String(i).trim() === "") return e.json({ isUnique: !0 });
|
|
8531
|
-
let o =
|
|
8536
|
+
let o = Ai[n] || "content_nodes", s = r.replace(/[^a-zA-Z0-9_]/g, ""), c = (ji[o] || ji.content_nodes).includes(s), l = -1;
|
|
8532
8537
|
if (a != null && String(a).trim() !== "") {
|
|
8533
8538
|
let e = Number(a);
|
|
8534
8539
|
l = isNaN(e) ? String(a) : e;
|
|
@@ -8540,7 +8545,7 @@ Ai.post("/validate-unique", async (e) => {
|
|
|
8540
8545
|
} catch (t) {
|
|
8541
8546
|
return console.error("[API Validation] Error validating global uniqueness:", t), e.json({ error: "Failed to validate uniqueness" }, 500);
|
|
8542
8547
|
}
|
|
8543
|
-
}),
|
|
8548
|
+
}), ki.post("/validate-unique-sibling", async (e) => {
|
|
8544
8549
|
try {
|
|
8545
8550
|
let t = e.get("db"), { slug: n, treeId: r, parentId: i, excludeTreeNodeId: a } = await e.req.json();
|
|
8546
8551
|
if (!n || !String(n).trim() || !r) return e.json({ isUnique: !0 });
|
|
@@ -8567,8 +8572,8 @@ Ai.post("/validate-unique", async (e) => {
|
|
|
8567
8572
|
});
|
|
8568
8573
|
//#endregion
|
|
8569
8574
|
//#region server/routes/admin/stats.ts
|
|
8570
|
-
var
|
|
8571
|
-
|
|
8575
|
+
var Mi = new e();
|
|
8576
|
+
Mi.get("/", async (e) => {
|
|
8572
8577
|
try {
|
|
8573
8578
|
let t = e.get("db"), n = await t.prepare("\n SELECT \n COUNT(*) as total,\n SUM(CASE WHEN isHidden = 0 THEN 1 ELSE 0 END) as published,\n SUM(CASE WHEN isHidden = 1 THEN 1 ELSE 0 END) as hidden\n FROM content_nodes\n ").get(), r = Number(n?.total) || 0, i = Number(n?.published) || 0, a = Number(n?.hidden) || 0, o = await t.prepare("\n SELECT \n (SELECT COUNT(*) FROM channels) as totalChannels,\n (SELECT COUNT(*) FROM trees) as totalTrees,\n (SELECT COUNT(*) FROM users) as totalUsers\n ").get(), s = await t.prepare("\n SELECT contentType as type, COUNT(*) as count \n FROM content_nodes \n GROUP BY contentType \n ORDER BY count DESC\n ").all(), c = Array.isArray(s) ? s : s?.results || [], l = await t.prepare("\n SELECT id, title, slug, contentType, isHidden, status, updatedAt \n FROM content_nodes \n ORDER BY updatedAt DESC \n LIMIT 5\n ").all(), u = (Array.isArray(l) ? l : l?.results || []).map((e) => ({
|
|
8574
8579
|
...e,
|
|
@@ -8583,7 +8588,7 @@ Ni.get("/", async (e) => {
|
|
|
8583
8588
|
isHidden: !!e.isHidden,
|
|
8584
8589
|
channelNames: e.channelLabels ? e.channelLabels.split(",") : [],
|
|
8585
8590
|
treeNames: e.treeLabels ? e.treeLabels.split(",") : []
|
|
8586
|
-
})), p = e.env?.BUNDLED_DEFINITIONS, m =
|
|
8591
|
+
})), p = e.env?.BUNDLED_DEFINITIONS, m = ci(p), h = m.nodes || m.nodeSchemas || {}, g = c.map((e) => {
|
|
8587
8592
|
let t = e.type || "node", n = h[t]?.label || t.charAt(0).toUpperCase() + t.slice(1);
|
|
8588
8593
|
return {
|
|
8589
8594
|
type: t,
|
|
@@ -8611,7 +8616,7 @@ Ni.get("/", async (e) => {
|
|
|
8611
8616
|
});
|
|
8612
8617
|
//#endregion
|
|
8613
8618
|
//#region server/routes/admin/assets.ts
|
|
8614
|
-
var
|
|
8619
|
+
var Ni = new e();
|
|
8615
8620
|
async function Q(e, t, n = []) {
|
|
8616
8621
|
let r = e.prepare(t);
|
|
8617
8622
|
if (typeof r.bind == "function") {
|
|
@@ -8635,7 +8640,7 @@ function Fi(e, t, n) {
|
|
|
8635
8640
|
}
|
|
8636
8641
|
async function Ii(e, t, n) {
|
|
8637
8642
|
try {
|
|
8638
|
-
let r = new
|
|
8643
|
+
let r = new X(e.env), i = await Q(t, "\n SELECT cdnUrl, storageKeyPrivate\n FROM assets\n WHERE id = ? OR parentAssetId = ?\n ", [n, n]), a = [];
|
|
8639
8644
|
for (let t of i) {
|
|
8640
8645
|
let n = Fi(t.cdnUrl, t.storageKeyPrivate, e.env?.CDN_DOMAIN);
|
|
8641
8646
|
n && a.push(n);
|
|
@@ -8651,7 +8656,7 @@ async function Ii(e, t, n) {
|
|
|
8651
8656
|
console.warn("[Assets Router] Failed to purge edge cache for asset nodes:", e);
|
|
8652
8657
|
}
|
|
8653
8658
|
}
|
|
8654
|
-
|
|
8659
|
+
Ni.get("/", async (e) => {
|
|
8655
8660
|
try {
|
|
8656
8661
|
let t = u(e), { search: n = "", type: r = "all", page: i = "1", limit: a = "24", sort: o = "createdAt", order: s = "DESC", nodeId: c, channelId: l, trashed: d } = e.req.query(), f = Math.max(1, parseInt(i, 10) || 1), p = Math.max(1, Math.min(100, parseInt(a, 10) || 24)), m = (f - 1) * p, h = {
|
|
8657
8662
|
createdAt: "a.createdAt",
|
|
@@ -8742,9 +8747,9 @@ Z.get("/", async (e) => {
|
|
|
8742
8747
|
details: t.message || String(t)
|
|
8743
8748
|
}, 500);
|
|
8744
8749
|
}
|
|
8745
|
-
}),
|
|
8750
|
+
}), Ni.post("/upload", async (e) => {
|
|
8746
8751
|
try {
|
|
8747
|
-
let t = u(e), n =
|
|
8752
|
+
let t = u(e), n = ni(e.env), r = await e.req.parseBody(), i = r.file, a = r.isVariant === "true" || r.isVariant === "1" || r.temporary === "true", o = r.parentAssetId || r.parentAsset, s = typeof o == "string" && o.trim().length > 0 ? o.trim() : null;
|
|
8748
8753
|
s && (await Q(t, "SELECT id FROM assets WHERE id = ?", [s])).length === 0 && (s = null);
|
|
8749
8754
|
let c = r.cropCoordinates, l = null, d = null;
|
|
8750
8755
|
if (c) {
|
|
@@ -8795,7 +8800,7 @@ Z.get("/", async (e) => {
|
|
|
8795
8800
|
details: t.message || String(t)
|
|
8796
8801
|
}, 500);
|
|
8797
8802
|
}
|
|
8798
|
-
}),
|
|
8803
|
+
}), Ni.get("/:id/details", async (e) => {
|
|
8799
8804
|
try {
|
|
8800
8805
|
let t = u(e), n = e.req.param("id"), r = await Q(t, "SELECT * FROM assets WHERE id = ?", [n]);
|
|
8801
8806
|
if (!r || r.length === 0) return e.json({ error: "Asset not found" }, 404);
|
|
@@ -8853,7 +8858,7 @@ Z.get("/", async (e) => {
|
|
|
8853
8858
|
} catch (t) {
|
|
8854
8859
|
return console.error("❌ [Asset Details Error]:", t), e.json({ error: "Failed to load details" }, 500);
|
|
8855
8860
|
}
|
|
8856
|
-
}),
|
|
8861
|
+
}), Ni.put("/:id", async (e) => {
|
|
8857
8862
|
try {
|
|
8858
8863
|
let t = u(e), n = e.req.param("id"), r = await e.req.json(), i = await Q(t, "SELECT filename, dataJson FROM assets WHERE id = ?", [n]);
|
|
8859
8864
|
if (!i || i.length === 0) return e.json({ error: "Asset not found" }, 404);
|
|
@@ -8869,7 +8874,7 @@ Z.get("/", async (e) => {
|
|
|
8869
8874
|
} catch (t) {
|
|
8870
8875
|
return console.error("❌ [Asset Update Error]:", t), e.json({ error: "Failed to update asset" }, 500);
|
|
8871
8876
|
}
|
|
8872
|
-
}),
|
|
8877
|
+
}), Ni.delete("/:id", async (e) => {
|
|
8873
8878
|
try {
|
|
8874
8879
|
let t = u(e), n = e.req.param("id"), r = (await Q(t, "SELECT id, filename, isSystemVariant FROM assets WHERE id = ?", [n]))[0];
|
|
8875
8880
|
return r ? (await Ii(e, t, n), r.isSystemVariant ? await Pi(t, "UPDATE assets SET deletedAt = CURRENT_TIMESTAMP WHERE id = ?", [n]) : await Pi(t, "UPDATE assets\n SET deletedAt = CURRENT_TIMESTAMP\n WHERE id = ? OR parentAssetId = ? OR (isSystemVariant = 1 AND (filename LIKE ? OR filename LIKE ?))", [
|
|
@@ -8888,7 +8893,7 @@ Z.get("/", async (e) => {
|
|
|
8888
8893
|
details: t.message || String(t)
|
|
8889
8894
|
}, 500);
|
|
8890
8895
|
}
|
|
8891
|
-
}),
|
|
8896
|
+
}), Ni.post("/restore", async (e) => {
|
|
8892
8897
|
try {
|
|
8893
8898
|
let t = u(e), n = await e.req.json(), r = n.id || n.assetId;
|
|
8894
8899
|
if (!r) return e.json({ error: "Asset ID required" }, 400);
|
|
@@ -8909,9 +8914,9 @@ Z.get("/", async (e) => {
|
|
|
8909
8914
|
details: t.message
|
|
8910
8915
|
}, 500);
|
|
8911
8916
|
}
|
|
8912
|
-
}),
|
|
8917
|
+
}), Ni.delete("/purge/:id", async (e) => {
|
|
8913
8918
|
try {
|
|
8914
|
-
let t = u(e), n =
|
|
8919
|
+
let t = u(e), n = ni(e.env), r = e.req.param("id"), i = (await Q(t, "SELECT id, filename, storageKeyPrivate, isSystemVariant FROM assets WHERE id = ?", [r]))[0];
|
|
8915
8920
|
if (!i) return e.json({ error: "Asset not found" }, 404);
|
|
8916
8921
|
await Ii(e, t, r);
|
|
8917
8922
|
let a = [i];
|
|
@@ -9066,7 +9071,7 @@ async function Hi(e, t, n, r, i = !1, a) {
|
|
|
9066
9071
|
let o = a.hidden === !0 || a.hidden === 1 || a.hidden === "1" || a.hidden === "true", s = Bi(a.startShowingAt, a.stopShowingAt);
|
|
9067
9072
|
if (!i && (o || !s)) return null;
|
|
9068
9073
|
let c = t.elementType || t.componentId || "text-block", l = r.blocks?.[c]?.fields || r.elements?.[c]?.fields || r.components?.[c]?.fields || {}, u = String(a.blockId || a._instanceId || a.id || t.blockId || t.id), d = Ui(a, l);
|
|
9069
|
-
return d = await
|
|
9074
|
+
return d = await oi(e, d), d = Wi(d), d.blockId = u, {
|
|
9070
9075
|
region: t.region || n,
|
|
9071
9076
|
block: {
|
|
9072
9077
|
instanceId: t.id,
|
|
@@ -9319,12 +9324,12 @@ Li.get("/*", async (e) => {
|
|
|
9319
9324
|
if (!c) return e.json({ error: `Channel '${a}' not found` }, 404);
|
|
9320
9325
|
let l = c.status === "disabled" || c.status === "inactive" || c.isEnabled === 0 || c.isEnabled === !1;
|
|
9321
9326
|
if (!s && l) return e.json({ error: `Channel '${c.key || a}' is currently inactive` }, 404);
|
|
9322
|
-
let u = c.id, d = c.key || a, f =
|
|
9327
|
+
let u = c.id, d = c.key || a, f = J(e), p = `node:${u || d}:${o}:${i}`, m = e.req.header("x-bypass-cache") === "true";
|
|
9323
9328
|
if (!s && !m) {
|
|
9324
9329
|
let t = await f.get(p);
|
|
9325
9330
|
if (t) return e.header("X-Cache", "HIT"), e.json(t);
|
|
9326
9331
|
}
|
|
9327
|
-
let h =
|
|
9332
|
+
let h = li(e.env?.BUNDLED_DEFINITIONS), g = /^\d+$/.test(i), _ = null, v = null, y = e.req.query("treeId"), b = i.split("/"), x = b[b.length - 1], S = "/" + i.replace(/^\/+|\/+$/g, ""), C = `
|
|
9328
9333
|
SELECT
|
|
9329
9334
|
cn.*,
|
|
9330
9335
|
tn.id as treeNodeId,
|
|
@@ -9364,17 +9369,17 @@ Li.get("/*", async (e) => {
|
|
|
9364
9369
|
LIMIT 1
|
|
9365
9370
|
`).get(...e);
|
|
9366
9371
|
}
|
|
9367
|
-
let D = v?.treeId || y || "main-nav",
|
|
9372
|
+
let D = v?.treeId || y || "main-nav", O = v?.parentId || null, k = v?.treeNodeId ? await Zi(t, String(v.treeNodeId), String(D), n) : `/${(_.slug || "").replace(/^\/+|\/+$/g, "")}`, A = {
|
|
9368
9373
|
id: _.id,
|
|
9369
9374
|
title: _.title,
|
|
9370
9375
|
slug: _.slug,
|
|
9371
9376
|
language: _.language || o || "en",
|
|
9372
|
-
path:
|
|
9377
|
+
path: k === "" ? "/" : k,
|
|
9373
9378
|
nodeType: _.contentType,
|
|
9374
9379
|
createdAt: _.createdAt,
|
|
9375
9380
|
updatedAt: _.updatedAt
|
|
9376
|
-
},
|
|
9377
|
-
|
|
9381
|
+
}, ee = _.contentType || "node", te = h.nodes?.[ee] || Object.values(h.nodes || {})[0] || {}, j = { ...te.fields || {} };
|
|
9382
|
+
te.tabs && Object.values(te.tabs).forEach((e) => {
|
|
9378
9383
|
Object.assign(j, e.fields || {});
|
|
9379
9384
|
});
|
|
9380
9385
|
let ne = {}, re = null, ie = null, ae = !1, M = {}, N = s && _.draftDataJson ? _.draftDataJson : _.dataJson || _.draftDataJson;
|
|
@@ -9382,17 +9387,17 @@ Li.get("/*", async (e) => {
|
|
|
9382
9387
|
M = typeof N == "string" ? JSON.parse(N) : N;
|
|
9383
9388
|
} catch {}
|
|
9384
9389
|
M.disabledRegions && (ne = M.disabledRegions), ae = M.hidden === !0 || M.hidden === 1 || M.hidden === "1" || M.hidden === "true", re = M.startShowingAt || null, ie = M.stopShowingAt || null;
|
|
9385
|
-
let oe = M.layoutId, se = oe && oe !== "inherit", { resolvedLayoutId: ce, inheritedFields: le } = await Qi(t,
|
|
9390
|
+
let oe = M.layoutId, se = oe && oe !== "inherit", { resolvedLayoutId: ce, inheritedFields: le } = await Qi(t, O, D, s, j), P = se ? oe : ce || te.defaultLayout || null;
|
|
9386
9391
|
for (let [e, t] of Object.entries(le)) (M[e] === void 0 || M[e] === null || M[e] === "" || M[e] === "inherit") && t !== void 0 && (M[e] = t);
|
|
9387
|
-
let F = await
|
|
9392
|
+
let F = await oi(t, Ui(M, j));
|
|
9388
9393
|
F = Wi(F), F = await Gi(t, F, n);
|
|
9389
9394
|
let ue = Xi(F);
|
|
9390
|
-
delete F.socialImage, delete F.fbImage, delete F.xImage, delete F.whatsappImage, ue && (F.socialImages = ue),
|
|
9395
|
+
delete F.socialImage, delete F.fbImage, delete F.xImage, delete F.whatsappImage, ue && (F.socialImages = ue), A.slug = _.slug, A.title = _.title, Object.assign(A, F), A.layoutId = P;
|
|
9391
9396
|
let de = Number(_.isHidden) === 1 || ae, fe = !Bi(re, ie);
|
|
9392
9397
|
if (!s && (de || fe)) return e.json({ error: "Node is hidden or outside its scheduled publishing window" }, 404);
|
|
9393
9398
|
let pe = [];
|
|
9394
9399
|
if (v?.treeNodeId) {
|
|
9395
|
-
let e = await t.prepare("\n SELECT\n t.id as treeNodeId,\n t.contentId as id,\n c.title,\n c.slug,\n c.language,\n c.contentType as nodeType,\n c.isHidden,\n c.dataJson,\n c.draftDataJson\n FROM tree_nodes t\n INNER JOIN content_nodes c\n ON t.contentId = c.id\n WHERE t.parentId = ?\n AND t.treeId = ?\n ORDER BY t.sortOrder ASC\n ").all(v.treeNodeId, D), n = Array.isArray(e) ? e : e?.results || [], r =
|
|
9400
|
+
let e = await t.prepare("\n SELECT\n t.id as treeNodeId,\n t.contentId as id,\n c.title,\n c.slug,\n c.language,\n c.contentType as nodeType,\n c.isHidden,\n c.dataJson,\n c.draftDataJson\n FROM tree_nodes t\n INNER JOIN content_nodes c\n ON t.contentId = c.id\n WHERE t.parentId = ?\n AND t.treeId = ?\n ORDER BY t.sortOrder ASC\n ").all(v.treeNodeId, D), n = Array.isArray(e) ? e : e?.results || [], r = A.path === "/" ? "" : A.path;
|
|
9396
9401
|
pe = n.map((e) => {
|
|
9397
9402
|
let t = {}, n = s && e.draftDataJson ? e.draftDataJson : e.dataJson;
|
|
9398
9403
|
try {
|
|
@@ -9410,10 +9415,10 @@ Li.get("/*", async (e) => {
|
|
|
9410
9415
|
};
|
|
9411
9416
|
}).filter(Boolean);
|
|
9412
9417
|
}
|
|
9413
|
-
|
|
9414
|
-
let I = +!!s,
|
|
9415
|
-
|
|
9416
|
-
let
|
|
9418
|
+
A.children = pe;
|
|
9419
|
+
let I = +!!s, L = await t.prepare("\n SELECT *\n FROM content_blocks\n WHERE contentId = ?\n AND isDraft = ?\n ORDER BY sortOrder ASC\n ").all(_.id, I), me = Array.isArray(L) ? L : L?.results || [];
|
|
9420
|
+
me.length === 0 && !s && (L = await t.prepare("\n SELECT *\n FROM content_blocks\n WHERE contentId = ?\n ORDER BY sortOrder ASC\n ").all(_.id), me = Array.isArray(L) ? L : L?.results || []);
|
|
9421
|
+
let R = {}, z = {}, he = await Promise.all(me.map(async (e) => {
|
|
9417
9422
|
let r = e.region || "main", i = {};
|
|
9418
9423
|
try {
|
|
9419
9424
|
i = (typeof e.dataJson == "string" ? JSON.parse(e.dataJson) : e.dataJson) || {};
|
|
@@ -9421,7 +9426,7 @@ Li.get("/*", async (e) => {
|
|
|
9421
9426
|
let a = i.hidden === !0 || i.hidden === 1 || i.hidden === "1" || i.hidden === "true", o = Bi(i.startShowingAt, i.stopShowingAt);
|
|
9422
9427
|
if (!s && (a || !o)) return null;
|
|
9423
9428
|
let c = e.elementType || e.componentId || "text-block", l = h.blocks?.[c]?.fields || h.elements?.[c]?.fields || h.components?.[c]?.fields || {}, u = String(i.blockId || i._instanceId || i.id || e.blockId || e.id), d = Ui(i, l);
|
|
9424
|
-
return d = await
|
|
9429
|
+
return d = await oi(t, d), d = Wi(d), d = await Gi(t, d, n), d.blockId = u, {
|
|
9425
9430
|
region: r,
|
|
9426
9431
|
block: {
|
|
9427
9432
|
instanceId: e.id,
|
|
@@ -9431,8 +9436,8 @@ Li.get("/*", async (e) => {
|
|
|
9431
9436
|
}
|
|
9432
9437
|
};
|
|
9433
9438
|
}));
|
|
9434
|
-
for (let e of
|
|
9435
|
-
let
|
|
9439
|
+
for (let e of he) e && (R[e.region] || (R[e.region] = [], z[e.region] = { isInherited: !1 }), R[e.region].push(e.block));
|
|
9440
|
+
let ge = {
|
|
9436
9441
|
header: {
|
|
9437
9442
|
label: "Header",
|
|
9438
9443
|
inherit: "parent"
|
|
@@ -9443,31 +9448,31 @@ Li.get("/*", async (e) => {
|
|
|
9443
9448
|
},
|
|
9444
9449
|
...(P ? h.nodeLayouts?.[P] || h.layouts?.[P] : null)?.regions || { main: { label: "Content" } }
|
|
9445
9450
|
};
|
|
9446
|
-
for (let [e, r] of Object.entries(
|
|
9447
|
-
let i =
|
|
9448
|
-
if (
|
|
9449
|
-
let r = await Hi(t,
|
|
9450
|
-
if (r.blocks.length > 0 && (
|
|
9451
|
+
for (let [e, r] of Object.entries(ge)) {
|
|
9452
|
+
let i = R[e] && R[e].length > 0, a = !!ne[e];
|
|
9453
|
+
if (R[e] || (R[e] = [], z[e] = { isInherited: !1 }), (r?.inherit === "parent" || r?.inherit === !0 || r?.inherit === "true" || e === "header" || e === "footer") && !i && !a && O) {
|
|
9454
|
+
let r = await Hi(t, O, e, h, s, n);
|
|
9455
|
+
if (r.blocks.length > 0 && (R[e] = r.blocks, z[e] = {
|
|
9451
9456
|
isInherited: !0,
|
|
9452
9457
|
inheritedFromId: r.inheritedFromId,
|
|
9453
9458
|
inheritedFromTitle: r.inheritedFromTitle
|
|
9454
|
-
}, r.subRegions)) for (let [t, n] of Object.entries(r.subRegions)) t !== e && (
|
|
9459
|
+
}, r.subRegions)) for (let [t, n] of Object.entries(r.subRegions)) t !== e && (R[t] = n, z[t] = {
|
|
9455
9460
|
isInherited: !0,
|
|
9456
9461
|
inheritedFromId: r.inheritedFromId,
|
|
9457
9462
|
inheritedFromTitle: r.inheritedFromTitle
|
|
9458
9463
|
});
|
|
9459
9464
|
}
|
|
9460
9465
|
}
|
|
9461
|
-
await Promise.all(Object.keys(
|
|
9462
|
-
let
|
|
9466
|
+
await Promise.all(Object.keys(R).map((e) => Vi(t, R[e], u)));
|
|
9467
|
+
let _e = {
|
|
9463
9468
|
channelId: u || d,
|
|
9464
9469
|
treeId: D,
|
|
9465
|
-
language:
|
|
9466
|
-
node:
|
|
9467
|
-
content:
|
|
9468
|
-
regionMeta:
|
|
9470
|
+
language: A.language,
|
|
9471
|
+
node: A,
|
|
9472
|
+
content: R,
|
|
9473
|
+
regionMeta: z
|
|
9469
9474
|
};
|
|
9470
|
-
return !s && !m && (e.header("X-Cache", "MISS"), await ea(f, p,
|
|
9475
|
+
return !s && !m && (e.header("X-Cache", "MISS"), await ea(f, p, _e, $i(e))), e.json(_e);
|
|
9471
9476
|
} catch (t) {
|
|
9472
9477
|
console.error("[CMS Public API] Error fetching node by path:", t);
|
|
9473
9478
|
let n = e.env?.ENVIRONMENT === "development";
|
|
@@ -9509,7 +9514,7 @@ ta.get("/:treeParam", async (e) => {
|
|
|
9509
9514
|
if (!i && t) return e.json({ error: `Channel '${n.key || r}' is currently inactive` }, 404);
|
|
9510
9515
|
}
|
|
9511
9516
|
}
|
|
9512
|
-
let a =
|
|
9517
|
+
let a = J(e), o = `tree:${r}:${n}`, s = e.req.header("x-bypass-cache") === "true";
|
|
9513
9518
|
if (!i && !s) {
|
|
9514
9519
|
let t = await a.get(o);
|
|
9515
9520
|
if (t) return e.header("X-Cache", "HIT"), e.json(t);
|
|
@@ -9518,7 +9523,7 @@ ta.get("/:treeParam", async (e) => {
|
|
|
9518
9523
|
if (l && Number(l.isHidden) === 1 && !i) return e.json({ error: `Tree '${n}' is hidden` }, 404);
|
|
9519
9524
|
let u = l?.id || (c ? Number(n) : null), d = {};
|
|
9520
9525
|
if (l && l.dataJson) try {
|
|
9521
|
-
let t = typeof l.dataJson == "string" ? JSON.parse(l.dataJson) : l.dataJson, r = e.env?.BUNDLED_DEFINITIONS, i =
|
|
9526
|
+
let t = typeof l.dataJson == "string" ? JSON.parse(l.dataJson) : l.dataJson, r = e.env?.BUNDLED_DEFINITIONS, i = li(r), a = (i.trees?.[l.treeType || n] || i.trees?.site || {}).fields || {};
|
|
9522
9527
|
for (let [e, n] of Object.entries(t)) a[e]?.public === !0 && (d[e] = n);
|
|
9523
9528
|
} catch (e) {
|
|
9524
9529
|
console.warn("[CMS Public Tree API] Failed to parse tree dataJson", e);
|
|
@@ -9798,12 +9803,12 @@ $.use("*", o()), $.use("/media/*", o({
|
|
|
9798
9803
|
e.set("currentDomain", r);
|
|
9799
9804
|
let i = u(e);
|
|
9800
9805
|
if (e.set("db", i), !ca) try {
|
|
9801
|
-
await
|
|
9806
|
+
await Mr(i), ca = !0;
|
|
9802
9807
|
} catch (e) {
|
|
9803
9808
|
console.error("❌ [CMS Server] Failed to initialize system tables on cold start:", e);
|
|
9804
9809
|
}
|
|
9805
9810
|
await t();
|
|
9806
|
-
}), $.route("/media", ia), $.use("/media/*",
|
|
9811
|
+
}), $.route("/media", ia), $.use("/media/*", Fr()), $.route("/api/cms/nodes", Z), $.route("/api/cms/nodes.json", Z), $.route("/api/cms/formcsv", Z), $.route("/api/cms/formcsv.json", Z), $.route("/api/cms/stats", Mi), $.route("/api/cms/stats.json", Mi), $.route("/api/cms", bi), $.route("/api/cms/channels", Ti), $.route("/api/cms/channels.json", Ti), $.route("/api/cms/schemas", Ei), $.route("/api/cms/schemas.json", Ei), $.route("/api/cms", ki), $.route("/api/admin/assets", Ni), $.route("/api/v1/node", Li), $.route("/api/v1/page", Li), $.route("/api/v1/tree", ta), $.route("/api/v1/all-paths", oa), $.get("*", async (e) => {
|
|
9807
9812
|
if (e.env?.ASSETS) {
|
|
9808
9813
|
let t = await e.env.ASSETS.fetch(e.req.raw);
|
|
9809
9814
|
if (t.status === 404) {
|