typerighter 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of typerighter might be problematic. Click here for more details.
- package/dist/app-C-qfoH4a.js +373 -0
- package/dist/brand-CG1fQshq.js +5 -0
- package/dist/{cli-CDd4TNg1.js → cli-mg9QpUrf.js} +159 -132
- package/dist/cli.js +1 -1
- package/dist/client/app/index.d.ts +12 -3
- package/dist/client/app/index.d.ts.map +1 -1
- package/dist/client/app/router.d.ts +6 -2
- package/dist/client/app/router.d.ts.map +1 -1
- package/dist/client/theme-default.js +541 -417
- package/dist/client.js +1 -1
- package/dist/es-CG8rP6j5.js +22524 -0
- package/dist/index.js +2 -2
- package/dist/{init-Bfnl0t1B.js → init-BSgCv7vy.js} +664 -654
- package/dist/node/build/index.d.ts.map +1 -1
- package/dist/node/build/prerender.d.ts +2 -0
- package/dist/node/build/prerender.d.ts.map +1 -1
- package/dist/node/plugin/vite/index.d.ts.map +1 -1
- package/dist/shared/utils/field.d.ts +2 -0
- package/dist/shared/utils/field.d.ts.map +1 -0
- package/dist/shared/utils/index.d.ts +1 -0
- package/dist/shared/utils/index.d.ts.map +1 -1
- package/dist/shared/utils/url.d.ts +5 -0
- package/dist/shared/utils/url.d.ts.map +1 -1
- package/dist/shared-BIdsxcZ2.js +265 -0
- package/dist/shared.js +2 -0
- package/dist/typerighter.css +1 -1
- package/dist/vite-8CV23ALg.js +10704 -0
- package/dist/vite.js +1 -1
- package/package.json +7 -3
- package/dist/app-Bf0aLzaG.js +0 -370
- package/dist/brand-BfamszbH.js +0 -12
- package/dist/client/app/composables/useUrl.d.ts +0 -6
- package/dist/client/app/composables/useUrl.d.ts.map +0 -1
- package/dist/constants-DJbUAb1-.js +0 -32189
- package/dist/es-ClqUVRJn.js +0 -705
- package/dist/shared-CpPZZ8IH.js +0 -196
- package/dist/vite-DnP-_NzR.js +0 -326
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { s as e, z as t } from "./shared-BIdsxcZ2.js";
|
|
2
|
+
import { i as n, r } from "./vite-8CV23ALg.js";
|
|
3
|
+
import { a as i, i as a, n as o, r as s, t as c } from "./brand-CG1fQshq.js";
|
|
4
|
+
import l from "node:path";
|
|
5
5
|
import "node:fs";
|
|
6
|
-
import
|
|
7
|
-
import { styleText as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
6
|
+
import u from "node:fs/promises";
|
|
7
|
+
import { styleText as d } from "node:util";
|
|
8
|
+
import f, { stdin as p, stdout as m } from "node:process";
|
|
9
|
+
import h from "node:readline";
|
|
10
10
|
import "node:tty";
|
|
11
11
|
//#region ../../node_modules/.pnpm/js-yaml@5.2.3/node_modules/js-yaml/dist/js-yaml.mjs
|
|
12
|
-
var
|
|
13
|
-
function
|
|
12
|
+
var g = Symbol("NOT_RESOLVED"), _ = Symbol("MERGE_KEY");
|
|
13
|
+
function v(e, t) {
|
|
14
14
|
return {
|
|
15
15
|
tagName: e,
|
|
16
16
|
nodeKind: "scalar",
|
|
@@ -23,7 +23,7 @@ function m(e, t) {
|
|
|
23
23
|
representTagName: t.representTagName ?? null
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function y(e, t) {
|
|
27
27
|
let n = t.finalize === void 0;
|
|
28
28
|
return {
|
|
29
29
|
tagName: e,
|
|
@@ -39,7 +39,7 @@ function h(e, t) {
|
|
|
39
39
|
representTagName: t.representTagName ?? null
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function b(e, t) {
|
|
43
43
|
let n = t.finalize === void 0;
|
|
44
44
|
return {
|
|
45
45
|
tagName: e,
|
|
@@ -58,16 +58,16 @@ function g(e, t) {
|
|
|
58
58
|
representTagName: t.representTagName ?? null
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
var
|
|
61
|
+
var x = v("tag:yaml.org,2002:str", {
|
|
62
62
|
resolve: (e) => e,
|
|
63
63
|
identify: (e) => typeof e == "string"
|
|
64
|
-
}),
|
|
64
|
+
}), S = [
|
|
65
65
|
"",
|
|
66
66
|
"~",
|
|
67
67
|
"null",
|
|
68
68
|
"Null",
|
|
69
69
|
"NULL"
|
|
70
|
-
],
|
|
70
|
+
], ee = v("tag:yaml.org,2002:null", {
|
|
71
71
|
implicit: !0,
|
|
72
72
|
implicitFirstChars: [
|
|
73
73
|
"",
|
|
@@ -75,22 +75,22 @@ var _ = m("tag:yaml.org,2002:str", {
|
|
|
75
75
|
"n",
|
|
76
76
|
"N"
|
|
77
77
|
],
|
|
78
|
-
resolve: (e) =>
|
|
78
|
+
resolve: (e) => S.indexOf(e) === -1 ? g : null,
|
|
79
79
|
identify: (e) => e === null,
|
|
80
80
|
represent: () => "null"
|
|
81
|
-
}),
|
|
81
|
+
}), te = v("tag:yaml.org,2002:null", {
|
|
82
82
|
implicit: !0,
|
|
83
83
|
implicitFirstChars: ["n"],
|
|
84
|
-
resolve: (e, t) => e === "null" || t && e === "" ? null :
|
|
84
|
+
resolve: (e, t) => e === "null" || t && e === "" ? null : g,
|
|
85
85
|
identify: (e) => e === null,
|
|
86
86
|
represent: () => "null"
|
|
87
|
-
}),
|
|
87
|
+
}), ne = [
|
|
88
88
|
"",
|
|
89
89
|
"~",
|
|
90
90
|
"null",
|
|
91
91
|
"Null",
|
|
92
92
|
"NULL"
|
|
93
|
-
],
|
|
93
|
+
], re = v("tag:yaml.org,2002:null", {
|
|
94
94
|
implicit: !0,
|
|
95
95
|
implicitFirstChars: [
|
|
96
96
|
"",
|
|
@@ -98,18 +98,18 @@ var _ = m("tag:yaml.org,2002:str", {
|
|
|
98
98
|
"n",
|
|
99
99
|
"N"
|
|
100
100
|
],
|
|
101
|
-
resolve: (e) =>
|
|
101
|
+
resolve: (e) => ne.indexOf(e) === -1 ? g : null,
|
|
102
102
|
identify: (e) => e === null,
|
|
103
103
|
represent: () => "null"
|
|
104
|
-
}),
|
|
104
|
+
}), ie = [
|
|
105
105
|
"true",
|
|
106
106
|
"True",
|
|
107
107
|
"TRUE"
|
|
108
|
-
],
|
|
108
|
+
], ae = [
|
|
109
109
|
"false",
|
|
110
110
|
"False",
|
|
111
111
|
"FALSE"
|
|
112
|
-
],
|
|
112
|
+
], oe = v("tag:yaml.org,2002:bool", {
|
|
113
113
|
implicit: !0,
|
|
114
114
|
implicitFirstChars: [
|
|
115
115
|
"t",
|
|
@@ -117,16 +117,16 @@ var _ = m("tag:yaml.org,2002:str", {
|
|
|
117
117
|
"f",
|
|
118
118
|
"F"
|
|
119
119
|
],
|
|
120
|
-
resolve: (e) =>
|
|
120
|
+
resolve: (e) => ie.indexOf(e) !== -1 || ae.indexOf(e) === -1 && g,
|
|
121
121
|
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
122
122
|
represent: (e) => e ? "true" : "false"
|
|
123
|
-
}),
|
|
123
|
+
}), se = ["true"], ce = ["false"], le = v("tag:yaml.org,2002:bool", {
|
|
124
124
|
implicit: !0,
|
|
125
125
|
implicitFirstChars: ["t", "f"],
|
|
126
|
-
resolve: (e) =>
|
|
126
|
+
resolve: (e) => se.indexOf(e) !== -1 || ce.indexOf(e) === -1 && g,
|
|
127
127
|
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
128
128
|
represent: (e) => e ? "true" : "false"
|
|
129
|
-
}),
|
|
129
|
+
}), ue = [
|
|
130
130
|
"true",
|
|
131
131
|
"True",
|
|
132
132
|
"TRUE",
|
|
@@ -138,7 +138,7 @@ var _ = m("tag:yaml.org,2002:str", {
|
|
|
138
138
|
"on",
|
|
139
139
|
"On",
|
|
140
140
|
"ON"
|
|
141
|
-
],
|
|
141
|
+
], de = [
|
|
142
142
|
"false",
|
|
143
143
|
"False",
|
|
144
144
|
"FALSE",
|
|
@@ -150,7 +150,7 @@ var _ = m("tag:yaml.org,2002:str", {
|
|
|
150
150
|
"off",
|
|
151
151
|
"Off",
|
|
152
152
|
"OFF"
|
|
153
|
-
],
|
|
153
|
+
], fe = v("tag:yaml.org,2002:bool", {
|
|
154
154
|
implicit: !0,
|
|
155
155
|
implicitFirstChars: [
|
|
156
156
|
"y",
|
|
@@ -164,51 +164,51 @@ var _ = m("tag:yaml.org,2002:str", {
|
|
|
164
164
|
"o",
|
|
165
165
|
"O"
|
|
166
166
|
],
|
|
167
|
-
resolve: (e) =>
|
|
167
|
+
resolve: (e) => ue.indexOf(e) !== -1 || de.indexOf(e) === -1 && g,
|
|
168
168
|
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
169
169
|
represent: (e) => e ? "true" : "false"
|
|
170
|
-
}),
|
|
171
|
-
function
|
|
170
|
+
}), pe = /* @__PURE__ */ RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"), me = /* @__PURE__ */ RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
171
|
+
function he(e) {
|
|
172
172
|
let t = e, n = 1;
|
|
173
173
|
return (t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b") ? n * parseInt(t.slice(2), 2) : t.startsWith("0o") ? n * parseInt(t.slice(2), 8) : t.startsWith("0x") ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function ge(e, t) {
|
|
176
176
|
if (t) {
|
|
177
|
-
if (!
|
|
178
|
-
} else if (!
|
|
179
|
-
let n =
|
|
180
|
-
return Number.isFinite(n) ? n :
|
|
177
|
+
if (!me.test(e)) return g;
|
|
178
|
+
} else if (!pe.test(e)) return g;
|
|
179
|
+
let n = he(e);
|
|
180
|
+
return Number.isFinite(n) ? n : g;
|
|
181
181
|
}
|
|
182
|
-
var
|
|
182
|
+
var _e = v("tag:yaml.org,2002:int", {
|
|
183
183
|
implicit: !0,
|
|
184
184
|
implicitFirstChars: [
|
|
185
185
|
"-",
|
|
186
186
|
"+",
|
|
187
187
|
..."0123456789"
|
|
188
188
|
],
|
|
189
|
-
resolve:
|
|
189
|
+
resolve: ge,
|
|
190
190
|
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
191
191
|
represent: (e) => e.toString(10)
|
|
192
|
-
}),
|
|
193
|
-
function
|
|
192
|
+
}), ve = /* @__PURE__ */ RegExp("^-?(?:0|[1-9][0-9]*)$"), ye = /* @__PURE__ */ RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
193
|
+
function be(e) {
|
|
194
194
|
let t = e, n = 1;
|
|
195
195
|
return (t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b") ? n * parseInt(t.slice(2), 2) : t.startsWith("0o") ? n * parseInt(t.slice(2), 8) : t.startsWith("0x") ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function xe(e, t) {
|
|
198
198
|
if (t) {
|
|
199
|
-
if (!
|
|
200
|
-
} else if (!
|
|
201
|
-
let n =
|
|
202
|
-
return Number.isFinite(n) ? n :
|
|
199
|
+
if (!ye.test(e)) return g;
|
|
200
|
+
} else if (!ve.test(e)) return g;
|
|
201
|
+
let n = be(e);
|
|
202
|
+
return Number.isFinite(n) ? n : g;
|
|
203
203
|
}
|
|
204
|
-
var
|
|
204
|
+
var Se = v("tag:yaml.org,2002:int", {
|
|
205
205
|
implicit: !0,
|
|
206
206
|
implicitFirstChars: ["-", ..."0123456789"],
|
|
207
|
-
resolve:
|
|
207
|
+
resolve: xe,
|
|
208
208
|
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
209
209
|
represent: (e) => e.toString(10)
|
|
210
|
-
}),
|
|
211
|
-
function
|
|
210
|
+
}), Ce = /* @__PURE__ */ RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");
|
|
211
|
+
function we(e) {
|
|
212
212
|
let t = e.replace(/_/g, ""), n = 1;
|
|
213
213
|
if ((t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b")) return n * parseInt(t.slice(2), 2);
|
|
214
214
|
if (t.startsWith("0x")) return n * parseInt(t.slice(2), 16);
|
|
@@ -219,31 +219,31 @@ function be(e) {
|
|
|
219
219
|
}
|
|
220
220
|
return t !== "0" && t[0] === "0" ? n * parseInt(t, 8) : n * parseInt(t, 10);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
if (!
|
|
224
|
-
let t =
|
|
225
|
-
return Number.isFinite(t) ? t :
|
|
222
|
+
function Te(e) {
|
|
223
|
+
if (!Ce.test(e)) return g;
|
|
224
|
+
let t = we(e);
|
|
225
|
+
return Number.isFinite(t) ? t : g;
|
|
226
226
|
}
|
|
227
|
-
var
|
|
227
|
+
var Ee = v("tag:yaml.org,2002:int", {
|
|
228
228
|
implicit: !0,
|
|
229
229
|
implicitFirstChars: [
|
|
230
230
|
"-",
|
|
231
231
|
"+",
|
|
232
232
|
..."0123456789"
|
|
233
233
|
],
|
|
234
|
-
resolve:
|
|
234
|
+
resolve: Te,
|
|
235
235
|
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
236
236
|
represent: (e) => e.toString(10)
|
|
237
|
-
}),
|
|
238
|
-
function
|
|
239
|
-
if (!
|
|
237
|
+
}), De = /* @__PURE__ */ RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), Oe = /* @__PURE__ */ RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
238
|
+
function ke(e) {
|
|
239
|
+
if (!De.test(e)) return g;
|
|
240
240
|
let t = e.toLowerCase(), n = t[0] === "-" ? -1 : 1;
|
|
241
241
|
if ("+-".includes(t[0]) && (t = t.slice(1)), t === ".inf") return n === 1 ? Infinity : -Infinity;
|
|
242
242
|
if (t === ".nan") return NaN;
|
|
243
243
|
let r = n * parseFloat(t);
|
|
244
|
-
return Number.isFinite(r) ||
|
|
244
|
+
return Number.isFinite(r) || Oe.test(e) ? r : g;
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function Ae(e) {
|
|
247
247
|
if (isNaN(e)) return ".nan";
|
|
248
248
|
if (e === Infinity) return ".inf";
|
|
249
249
|
if (e === -Infinity) return "-.inf";
|
|
@@ -251,7 +251,7 @@ function Ee(e) {
|
|
|
251
251
|
let t = e.toString(10);
|
|
252
252
|
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
253
253
|
}
|
|
254
|
-
var
|
|
254
|
+
var je = v("tag:yaml.org,2002:float", {
|
|
255
255
|
implicit: !0,
|
|
256
256
|
implicitFirstChars: [
|
|
257
257
|
"-",
|
|
@@ -259,24 +259,24 @@ var De = m("tag:yaml.org,2002:float", {
|
|
|
259
259
|
".",
|
|
260
260
|
..."0123456789"
|
|
261
261
|
],
|
|
262
|
-
resolve:
|
|
262
|
+
resolve: ke,
|
|
263
263
|
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
264
|
-
represent:
|
|
265
|
-
}),
|
|
266
|
-
function
|
|
264
|
+
represent: Ae
|
|
265
|
+
}), Me = /* @__PURE__ */ RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"), Ne = /* @__PURE__ */ RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
266
|
+
function Pe(e, t) {
|
|
267
267
|
if (t) {
|
|
268
|
-
if (!
|
|
268
|
+
if (!Ne.test(e)) return g;
|
|
269
269
|
let t = e.toLowerCase(), n = t[0] === "-" ? -1 : 1;
|
|
270
270
|
if ("+-".includes(t[0]) && (t = t.slice(1)), t === ".inf") return n === 1 ? Infinity : -Infinity;
|
|
271
271
|
if (t === ".nan") return NaN;
|
|
272
272
|
let r = n * parseFloat(t);
|
|
273
|
-
return Number.isFinite(r) ? r :
|
|
273
|
+
return Number.isFinite(r) ? r : g;
|
|
274
274
|
}
|
|
275
|
-
if (!
|
|
275
|
+
if (!Me.test(e)) return g;
|
|
276
276
|
let n = Number(e);
|
|
277
|
-
return Number.isFinite(n) ? n :
|
|
277
|
+
return Number.isFinite(n) ? n : g;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function Fe(e) {
|
|
280
280
|
if (isNaN(e)) return ".nan";
|
|
281
281
|
if (e === Infinity) return ".inf";
|
|
282
282
|
if (e === -Infinity) return "-.inf";
|
|
@@ -284,15 +284,15 @@ function je(e) {
|
|
|
284
284
|
let t = e.toString(10);
|
|
285
285
|
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
286
286
|
}
|
|
287
|
-
var
|
|
287
|
+
var Ie = v("tag:yaml.org,2002:float", {
|
|
288
288
|
implicit: !0,
|
|
289
289
|
implicitFirstChars: ["-", ..."0123456789"],
|
|
290
|
-
resolve:
|
|
290
|
+
resolve: Pe,
|
|
291
291
|
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
292
|
-
represent:
|
|
293
|
-
}),
|
|
294
|
-
function
|
|
295
|
-
if (!
|
|
292
|
+
represent: Fe
|
|
293
|
+
}), Le = /* @__PURE__ */ RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), Re = /* @__PURE__ */ RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
294
|
+
function ze(e) {
|
|
295
|
+
if (!Le.test(e)) return g;
|
|
296
296
|
let t = e.toLowerCase().replace(/_/g, ""), n = t[0] === "-" ? -1 : 1;
|
|
297
297
|
if ("+-".includes(t[0]) && (t = t.slice(1)), t === ".inf") return n === 1 ? Infinity : -Infinity;
|
|
298
298
|
if (t === ".nan") return NaN;
|
|
@@ -301,9 +301,9 @@ function Fe(e) {
|
|
|
301
301
|
for (let e of t.split(":")) r = r * 60 + Number(e);
|
|
302
302
|
r *= n;
|
|
303
303
|
} else r = n * parseFloat(t);
|
|
304
|
-
return Number.isFinite(r) ||
|
|
304
|
+
return Number.isFinite(r) || Re.test(e) ? r : g;
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function Be(e) {
|
|
307
307
|
if (isNaN(e)) return ".nan";
|
|
308
308
|
if (e === Infinity) return ".inf";
|
|
309
309
|
if (e === -Infinity) return "-.inf";
|
|
@@ -311,7 +311,7 @@ function Ie(e) {
|
|
|
311
311
|
let t = e.toString(10);
|
|
312
312
|
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
313
313
|
}
|
|
314
|
-
var
|
|
314
|
+
var Ve = v("tag:yaml.org,2002:float", {
|
|
315
315
|
implicit: !0,
|
|
316
316
|
implicitFirstChars: [
|
|
317
317
|
"-",
|
|
@@ -319,84 +319,84 @@ var Le = m("tag:yaml.org,2002:float", {
|
|
|
319
319
|
".",
|
|
320
320
|
..."0123456789"
|
|
321
321
|
],
|
|
322
|
-
resolve:
|
|
322
|
+
resolve: ze,
|
|
323
323
|
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
324
|
-
represent:
|
|
325
|
-
}),
|
|
324
|
+
represent: Be
|
|
325
|
+
}), He = v("tag:yaml.org,2002:merge", {
|
|
326
326
|
implicit: !0,
|
|
327
327
|
implicitFirstChars: ["<"],
|
|
328
|
-
resolve: (e, t) => e === "<<" || t && e === "" ?
|
|
329
|
-
}),
|
|
330
|
-
function
|
|
328
|
+
resolve: (e, t) => e === "<<" || t && e === "" ? _ : g
|
|
329
|
+
}), Ue = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
330
|
+
function We(e) {
|
|
331
331
|
let t = e.replace(/\s/g, "");
|
|
332
|
-
if (t.length % 4 != 0 || !
|
|
332
|
+
if (t.length % 4 != 0 || !Ue.test(t)) return g;
|
|
333
333
|
let n = atob(t), r = new Uint8Array(n.length);
|
|
334
334
|
for (let e = 0; e < n.length; e++) r[e] = n.charCodeAt(e);
|
|
335
335
|
return r;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function Ge(e) {
|
|
338
338
|
let t = "";
|
|
339
339
|
for (let n = 0; n < e.length; n++) t += String.fromCharCode(e[n]);
|
|
340
340
|
return btoa(t);
|
|
341
341
|
}
|
|
342
|
-
var
|
|
343
|
-
resolve:
|
|
342
|
+
var Ke = v("tag:yaml.org,2002:binary", {
|
|
343
|
+
resolve: We,
|
|
344
344
|
identify: (e) => Object.prototype.toString.call(e) === "[object Uint8Array]",
|
|
345
|
-
represent:
|
|
346
|
-
}),
|
|
347
|
-
function
|
|
345
|
+
represent: Ge
|
|
346
|
+
}), qe = /* @__PURE__ */ RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"), Je = /* @__PURE__ */ RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
|
|
347
|
+
function Ye(e, t, n, r = 0, i = 0, a = 0, o = 0) {
|
|
348
348
|
let s = new Date(Date.UTC(e, t, n, r, i, a, o));
|
|
349
349
|
return s.setUTCFullYear(e, t, n), s;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
352
|
-
let t =
|
|
353
|
-
if (t === null && (t =
|
|
351
|
+
function Xe(e) {
|
|
352
|
+
let t = qe.exec(e);
|
|
353
|
+
if (t === null && (t = Je.exec(e)), t === null) return g;
|
|
354
354
|
let n = +t[1], r = t[2] - 1, i = +t[3];
|
|
355
355
|
if (!t[4]) {
|
|
356
|
-
let e =
|
|
357
|
-
return e.getUTCFullYear() !== n || e.getUTCMonth() !== r || e.getUTCDate() !== i ?
|
|
356
|
+
let e = Ye(n, r, i);
|
|
357
|
+
return e.getUTCFullYear() !== n || e.getUTCMonth() !== r || e.getUTCDate() !== i ? g : e;
|
|
358
358
|
}
|
|
359
359
|
let a = +t[4], o = +t[5], s = +t[6], c = 0;
|
|
360
|
-
if (a > 23 || o > 59 || s > 59) return
|
|
360
|
+
if (a > 23 || o > 59 || s > 59) return g;
|
|
361
361
|
if (t[7]) {
|
|
362
362
|
let e = t[7].slice(0, 3);
|
|
363
363
|
for (; e.length < 3;) e += "0";
|
|
364
364
|
c = +e;
|
|
365
365
|
}
|
|
366
|
-
let l =
|
|
367
|
-
if (l.getUTCFullYear() !== n || l.getUTCMonth() !== r || l.getUTCDate() !== i) return
|
|
366
|
+
let l = Ye(n, r, i, a, o, s, c);
|
|
367
|
+
if (l.getUTCFullYear() !== n || l.getUTCMonth() !== r || l.getUTCDate() !== i) return g;
|
|
368
368
|
if (t[9]) {
|
|
369
369
|
let e = +t[10], n = +(t[11] || 0);
|
|
370
|
-
if (e > 23 || n > 59) return
|
|
370
|
+
if (e > 23 || n > 59) return g;
|
|
371
371
|
let r = (e * 60 + n) * 6e4;
|
|
372
372
|
l.setTime(l.getTime() - (t[9] === "-" ? -r : r));
|
|
373
373
|
}
|
|
374
374
|
return l;
|
|
375
375
|
}
|
|
376
|
-
var
|
|
376
|
+
var Ze = v("tag:yaml.org,2002:timestamp", {
|
|
377
377
|
implicit: !0,
|
|
378
378
|
implicitFirstChars: [..."0123456789"],
|
|
379
|
-
resolve:
|
|
379
|
+
resolve: Xe,
|
|
380
380
|
identify: (e) => e instanceof Date,
|
|
381
381
|
represent: (e) => e.toISOString()
|
|
382
|
-
}),
|
|
382
|
+
}), Qe = y("tag:yaml.org,2002:seq", {
|
|
383
383
|
create: () => [],
|
|
384
384
|
addItem: (e, t) => {
|
|
385
385
|
e.push(t);
|
|
386
386
|
},
|
|
387
387
|
identify: Array.isArray
|
|
388
388
|
});
|
|
389
|
-
function
|
|
389
|
+
function $e(e) {
|
|
390
390
|
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
391
391
|
let t = Object.getPrototypeOf(e);
|
|
392
392
|
return t === null || t === Object.prototype;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function et(e, t) {
|
|
395
395
|
let n = {};
|
|
396
396
|
for (let r of t) e[r] !== void 0 && (n[r] = e[r]);
|
|
397
397
|
return n;
|
|
398
398
|
}
|
|
399
|
-
var
|
|
399
|
+
var tt = y("tag:yaml.org,2002:omap", {
|
|
400
400
|
create: () => ({
|
|
401
401
|
list: [],
|
|
402
402
|
seen: /* @__PURE__ */ new Set()
|
|
@@ -406,7 +406,7 @@ var Xe = h("tag:yaml.org,2002:omap", {
|
|
|
406
406
|
if (t instanceof Map) {
|
|
407
407
|
if (t.size !== 1) return "cannot resolve an ordered map item";
|
|
408
408
|
n = t.keys().next().value;
|
|
409
|
-
} else if (
|
|
409
|
+
} else if ($e(t)) {
|
|
410
410
|
let e = Object.keys(t);
|
|
411
411
|
if (e.length !== 1) return "cannot resolve an ordered map item";
|
|
412
412
|
n = e[0];
|
|
@@ -414,7 +414,7 @@ var Xe = h("tag:yaml.org,2002:omap", {
|
|
|
414
414
|
return e.seen.has(n) ? "duplicate key in ordered map" : (e.seen.add(n), e.list.push(t), "");
|
|
415
415
|
},
|
|
416
416
|
finalize: (e) => e.list
|
|
417
|
-
}),
|
|
417
|
+
}), nt = y("tag:yaml.org,2002:pairs", {
|
|
418
418
|
create: () => [],
|
|
419
419
|
addItem: (e, t) => {
|
|
420
420
|
if (t instanceof Map) return t.size === 1 ? (e.push(t.entries().next().value), "") : "cannot resolve a pairs item";
|
|
@@ -422,9 +422,9 @@ var Xe = h("tag:yaml.org,2002:omap", {
|
|
|
422
422
|
let n = t, r = Object.keys(n);
|
|
423
423
|
return r.length === 1 ? (e.push([r[0], n[r[0]]]), "") : "cannot resolve a pairs item";
|
|
424
424
|
}
|
|
425
|
-
}),
|
|
425
|
+
}), rt = b("tag:yaml.org,2002:map", {
|
|
426
426
|
create: () => ({}),
|
|
427
|
-
identify:
|
|
427
|
+
identify: $e,
|
|
428
428
|
represent: (e) => {
|
|
429
429
|
let t = /* @__PURE__ */ new Map();
|
|
430
430
|
for (let n of Object.keys(e)) t.set(n, e[n]);
|
|
@@ -446,7 +446,7 @@ var Xe = h("tag:yaml.org,2002:omap", {
|
|
|
446
446
|
let n = String(t);
|
|
447
447
|
return Object.prototype.hasOwnProperty.call(e, n) ? e[n] : null;
|
|
448
448
|
}
|
|
449
|
-
}),
|
|
449
|
+
}), it = b("tag:yaml.org,2002:set", {
|
|
450
450
|
create: () => /* @__PURE__ */ new Set(),
|
|
451
451
|
identify: (e) => e instanceof Set,
|
|
452
452
|
represent: (e) => {
|
|
@@ -459,21 +459,21 @@ var Xe = h("tag:yaml.org,2002:omap", {
|
|
|
459
459
|
keys: (e) => e.keys(),
|
|
460
460
|
get: () => null
|
|
461
461
|
});
|
|
462
|
-
function
|
|
462
|
+
function at() {
|
|
463
463
|
return {
|
|
464
464
|
scalar: Object.create(null),
|
|
465
465
|
sequence: Object.create(null),
|
|
466
466
|
mapping: Object.create(null)
|
|
467
467
|
};
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function ot() {
|
|
470
470
|
return {
|
|
471
471
|
scalar: [],
|
|
472
472
|
sequence: [],
|
|
473
473
|
mapping: []
|
|
474
474
|
};
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function st(e) {
|
|
477
477
|
let t = [];
|
|
478
478
|
for (let n of e) {
|
|
479
479
|
let e = t.length;
|
|
@@ -488,7 +488,7 @@ function nt(e) {
|
|
|
488
488
|
}
|
|
489
489
|
return t;
|
|
490
490
|
}
|
|
491
|
-
var
|
|
491
|
+
var C = class e {
|
|
492
492
|
tags;
|
|
493
493
|
implicitScalarTags;
|
|
494
494
|
implicitScalarByFirstChar;
|
|
@@ -499,7 +499,7 @@ var w = class e {
|
|
|
499
499
|
exact;
|
|
500
500
|
prefix;
|
|
501
501
|
constructor(e) {
|
|
502
|
-
let t =
|
|
502
|
+
let t = st(e), n = [], r = at(), i = ot();
|
|
503
503
|
for (let e of t) {
|
|
504
504
|
if (e.nodeKind === "scalar" && e.implicit) {
|
|
505
505
|
if (e.matchByTagPrefix) throw Error("Implicit scalar tags cannot match by tag prefix");
|
|
@@ -530,44 +530,44 @@ var w = class e {
|
|
|
530
530
|
for (let e of t) n = n.concat(e);
|
|
531
531
|
return new e([...this.tags, ...n]);
|
|
532
532
|
}
|
|
533
|
-
},
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
]);
|
|
538
|
-
new w([
|
|
539
|
-
...rt.tags,
|
|
540
|
-
b,
|
|
541
|
-
ae,
|
|
542
|
-
ve,
|
|
543
|
-
Me
|
|
533
|
+
}, ct = new C([
|
|
534
|
+
x,
|
|
535
|
+
Qe,
|
|
536
|
+
rt
|
|
544
537
|
]);
|
|
545
|
-
|
|
546
|
-
...
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
pe,
|
|
550
|
-
De
|
|
551
|
-
]), at = new w([
|
|
552
|
-
...rt.tags,
|
|
553
|
-
S,
|
|
554
|
-
ce,
|
|
538
|
+
new C([
|
|
539
|
+
...ct.tags,
|
|
540
|
+
te,
|
|
541
|
+
le,
|
|
555
542
|
Se,
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
543
|
+
Ie
|
|
544
|
+
]);
|
|
545
|
+
var lt = new C([
|
|
546
|
+
...ct.tags,
|
|
547
|
+
ee,
|
|
548
|
+
oe,
|
|
549
|
+
_e,
|
|
550
|
+
je
|
|
551
|
+
]), ut = new C([
|
|
552
|
+
...ct.tags,
|
|
553
|
+
re,
|
|
554
|
+
fe,
|
|
555
|
+
Ee,
|
|
556
|
+
Ve,
|
|
561
557
|
Ze,
|
|
562
|
-
|
|
558
|
+
He,
|
|
559
|
+
Ke,
|
|
560
|
+
tt,
|
|
561
|
+
nt,
|
|
562
|
+
it
|
|
563
563
|
]);
|
|
564
|
-
|
|
564
|
+
b("tag:yaml.org,2002:map", {
|
|
565
565
|
create: () => /* @__PURE__ */ new Map(),
|
|
566
566
|
addPair: (e, t, n) => (e.set(t, n), ""),
|
|
567
567
|
has: (e, t) => e.has(t),
|
|
568
568
|
keys: (e) => e.keys(),
|
|
569
569
|
get: (e, t) => e.get(t),
|
|
570
|
-
identify: (e) => e instanceof Map ||
|
|
570
|
+
identify: (e) => e instanceof Map || $e(e),
|
|
571
571
|
represent: (e) => {
|
|
572
572
|
if (e instanceof Map) return e;
|
|
573
573
|
let t = /* @__PURE__ */ new Map(), n = e;
|
|
@@ -575,7 +575,7 @@ g("tag:yaml.org,2002:map", {
|
|
|
575
575
|
return t;
|
|
576
576
|
}
|
|
577
577
|
});
|
|
578
|
-
function
|
|
578
|
+
function dt(e) {
|
|
579
579
|
if (Array.isArray(e)) {
|
|
580
580
|
let t = Array.prototype.slice.call(e);
|
|
581
581
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -586,16 +586,16 @@ function ot(e) {
|
|
|
586
586
|
}
|
|
587
587
|
return typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" ? "[object Object]" : String(e);
|
|
588
588
|
}
|
|
589
|
-
|
|
589
|
+
b("tag:yaml.org,2002:map", {
|
|
590
590
|
create: () => ({}),
|
|
591
|
-
identify:
|
|
591
|
+
identify: $e,
|
|
592
592
|
represent: (e) => {
|
|
593
593
|
let t = /* @__PURE__ */ new Map();
|
|
594
594
|
for (let n of Object.keys(e)) t.set(n, e[n]);
|
|
595
595
|
return t;
|
|
596
596
|
},
|
|
597
597
|
addPair: (e, t, n) => {
|
|
598
|
-
let r =
|
|
598
|
+
let r = dt(t);
|
|
599
599
|
return r === null ? "nested arrays are not supported inside keys" : (r === "__proto__" ? Object.defineProperty(e, r, {
|
|
600
600
|
value: n,
|
|
601
601
|
enumerable: !0,
|
|
@@ -604,7 +604,7 @@ g("tag:yaml.org,2002:map", {
|
|
|
604
604
|
}) : e[r] = n, "");
|
|
605
605
|
},
|
|
606
606
|
has: (e, t) => {
|
|
607
|
-
let n =
|
|
607
|
+
let n = dt(t);
|
|
608
608
|
return n !== null && Object.prototype.hasOwnProperty.call(e, n);
|
|
609
609
|
},
|
|
610
610
|
keys: (e) => Object.keys(e),
|
|
@@ -613,58 +613,58 @@ g("tag:yaml.org,2002:map", {
|
|
|
613
613
|
return Object.prototype.hasOwnProperty.call(e, n) ? e[n] : null;
|
|
614
614
|
}
|
|
615
615
|
});
|
|
616
|
-
var
|
|
616
|
+
var ft = {
|
|
617
617
|
maxLength: 79,
|
|
618
618
|
indent: 1,
|
|
619
619
|
linesBefore: 3,
|
|
620
620
|
linesAfter: 2
|
|
621
621
|
};
|
|
622
|
-
function
|
|
622
|
+
function pt(e, t, n, r, i) {
|
|
623
623
|
let a = "", o = "", s = Math.floor(i / 2) - 1;
|
|
624
624
|
return r - t > s && (a = " ... ", t = r - s + a.length), n - r > s && (o = " ...", n = r + s - o.length), {
|
|
625
625
|
str: a + e.slice(t, n).replace(/\t/g, "→") + o,
|
|
626
626
|
pos: r - t + a.length
|
|
627
627
|
};
|
|
628
628
|
}
|
|
629
|
-
function
|
|
629
|
+
function mt(e, t) {
|
|
630
630
|
return " ".repeat(Math.max(t - e.length, 0)) + e;
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function ht(e, t) {
|
|
633
633
|
if (!e.buffer) return null;
|
|
634
634
|
let n = {
|
|
635
|
-
...
|
|
635
|
+
...ft,
|
|
636
636
|
...t
|
|
637
637
|
}, r = /\r?\n|\r|\0/g, i = [0], a = [], o, s = -1;
|
|
638
638
|
for (; o = r.exec(e.buffer);) a.push(o.index), i.push(o.index + o[0].length), e.position <= o.index && s < 0 && (s = i.length - 2);
|
|
639
639
|
s < 0 && (s = i.length - 1);
|
|
640
640
|
let c = "", l = Math.min(e.line + n.linesAfter, a.length).toString().length, u = n.maxLength - (n.indent + l + 3);
|
|
641
641
|
for (let t = 1; t <= n.linesBefore && !(s - t < 0); t++) {
|
|
642
|
-
let r =
|
|
643
|
-
c = `${" ".repeat(n.indent)}${
|
|
642
|
+
let r = pt(e.buffer, i[s - t], a[s - t], e.position - (i[s] - i[s - t]), u);
|
|
643
|
+
c = `${" ".repeat(n.indent)}${mt((e.line - t + 1).toString(), l)} | ${r.str}\n${c}`;
|
|
644
644
|
}
|
|
645
|
-
let d =
|
|
646
|
-
c += `${" ".repeat(n.indent)}${
|
|
645
|
+
let d = pt(e.buffer, i[s], a[s], e.position, u);
|
|
646
|
+
c += `${" ".repeat(n.indent)}${mt((e.line + 1).toString(), l)} | ${d.str}\n`, c += `${"-".repeat(n.indent + l + 3 + d.pos)}^\n`;
|
|
647
647
|
for (let t = 1; t <= n.linesAfter && !(s + t >= a.length); t++) {
|
|
648
|
-
let r =
|
|
649
|
-
c += `${" ".repeat(n.indent)}${
|
|
648
|
+
let r = pt(e.buffer, i[s + t], a[s + t], e.position - (i[s] - i[s + t]), u);
|
|
649
|
+
c += `${" ".repeat(n.indent)}${mt((e.line + t + 1).toString(), l)} | ${r.str}\n`;
|
|
650
650
|
}
|
|
651
651
|
return c.replace(/\n$/, "");
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function gt(e, t) {
|
|
654
654
|
let n = "";
|
|
655
655
|
return e.mark ? (e.mark.name && (n += `in "${e.mark.name}" `), n += `(${e.mark.line + 1}:${e.mark.column + 1})`, !t && e.mark.snippet && (n += `\n\n${e.mark.snippet}`), `${e.reason} ${n}`) : e.reason;
|
|
656
656
|
}
|
|
657
|
-
var
|
|
657
|
+
var w = class extends Error {
|
|
658
658
|
reason;
|
|
659
659
|
mark;
|
|
660
660
|
constructor(e, t) {
|
|
661
|
-
super(), this.name = "YAMLException", this.reason = e, this.mark = t, this.message =
|
|
661
|
+
super(), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = gt(this, !1), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
662
662
|
}
|
|
663
663
|
toString(e) {
|
|
664
|
-
return `${this.name}: ${
|
|
664
|
+
return `${this.name}: ${gt(this, e)}`;
|
|
665
665
|
}
|
|
666
666
|
};
|
|
667
|
-
function
|
|
667
|
+
function _t(e, t, n, r = "") {
|
|
668
668
|
let i = 0, a = 0;
|
|
669
669
|
for (let n = 0; n < t; n++) {
|
|
670
670
|
let t = e.charCodeAt(n);
|
|
@@ -677,10 +677,10 @@ function pt(e, t, n, r = "") {
|
|
|
677
677
|
line: i,
|
|
678
678
|
column: t - a
|
|
679
679
|
};
|
|
680
|
-
throw o.snippet =
|
|
680
|
+
throw o.snippet = ht(o), new w(n, o);
|
|
681
681
|
}
|
|
682
|
-
var
|
|
683
|
-
function
|
|
682
|
+
var vt = -1;
|
|
683
|
+
function yt(e) {
|
|
684
684
|
switch (e) {
|
|
685
685
|
case 48: return "\0";
|
|
686
686
|
case 97: return "\x07";
|
|
@@ -703,18 +703,18 @@ function ht(e) {
|
|
|
703
703
|
default: return "";
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
|
-
var
|
|
707
|
-
for (let e = 0; e < 256; e++)
|
|
708
|
-
function
|
|
706
|
+
var bt = Array(256), xt = Array(256);
|
|
707
|
+
for (let e = 0; e < 256; e++) bt[e] = +!!yt(e), xt[e] = yt(e);
|
|
708
|
+
function St(e) {
|
|
709
709
|
return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode((e - 65536 >> 10) + 55296, (e - 65536 & 1023) + 56320);
|
|
710
710
|
}
|
|
711
|
-
function
|
|
711
|
+
function Ct(e) {
|
|
712
712
|
return e >= 48 && e <= 57 ? e - 48 : (e | 32) - 97 + 10;
|
|
713
713
|
}
|
|
714
|
-
function
|
|
714
|
+
function wt(e) {
|
|
715
715
|
return e === 120 ? 2 : e === 117 ? 4 : 8;
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function Tt(e, t, n) {
|
|
718
718
|
let r = 0;
|
|
719
719
|
for (; t < n;) {
|
|
720
720
|
let n = e.charCodeAt(t);
|
|
@@ -728,62 +728,62 @@ function xt(e, t, n) {
|
|
|
728
728
|
breaks: r
|
|
729
729
|
};
|
|
730
730
|
}
|
|
731
|
-
function
|
|
731
|
+
function Et(e) {
|
|
732
732
|
return e === 1 ? " " : "\n".repeat(e - 1);
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function Dt(e, t, n) {
|
|
735
735
|
let r = "", i = t, a = t, o = t;
|
|
736
736
|
for (; i < n;) {
|
|
737
737
|
let t = e.charCodeAt(i);
|
|
738
738
|
if (t === 10 || t === 13) {
|
|
739
739
|
r += e.slice(a, o);
|
|
740
|
-
let t =
|
|
741
|
-
r +=
|
|
740
|
+
let t = Tt(e, i, n);
|
|
741
|
+
r += Et(t.breaks), i = a = o = t.position;
|
|
742
742
|
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
743
743
|
}
|
|
744
744
|
return r + e.slice(a, o);
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function Ot(e, t, n) {
|
|
747
747
|
let r = "", i = t, a = t, o = t;
|
|
748
748
|
for (; i < n;) {
|
|
749
749
|
let t = e.charCodeAt(i);
|
|
750
750
|
if (t === 39) r += e.slice(a, i) + "'", i += 2, a = o = i;
|
|
751
751
|
else if (t === 10 || t === 13) {
|
|
752
752
|
r += e.slice(a, o);
|
|
753
|
-
let t =
|
|
754
|
-
r +=
|
|
753
|
+
let t = Tt(e, i, n);
|
|
754
|
+
r += Et(t.breaks), i = a = o = t.position;
|
|
755
755
|
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
756
756
|
}
|
|
757
757
|
return r + e.slice(a, n);
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function kt(e, t, n) {
|
|
760
760
|
let r = "", i = t, a = t, o = t;
|
|
761
761
|
for (; i < n;) {
|
|
762
762
|
let t = e.charCodeAt(i);
|
|
763
763
|
if (t === 92) {
|
|
764
764
|
r += e.slice(a, i), i++;
|
|
765
765
|
let t = e.charCodeAt(i);
|
|
766
|
-
if (t === 10 || t === 13) i =
|
|
767
|
-
else if (t < 256 &&
|
|
766
|
+
if (t === 10 || t === 13) i = Tt(e, i, n).position;
|
|
767
|
+
else if (t < 256 && bt[t]) r += xt[t], i++;
|
|
768
768
|
else {
|
|
769
|
-
let n =
|
|
769
|
+
let n = wt(t), a = 0;
|
|
770
770
|
for (; n > 0; n--) {
|
|
771
771
|
i++;
|
|
772
|
-
let t =
|
|
772
|
+
let t = Ct(e.charCodeAt(i));
|
|
773
773
|
a = (a << 4) + t;
|
|
774
774
|
}
|
|
775
|
-
r +=
|
|
775
|
+
r += St(a), i++;
|
|
776
776
|
}
|
|
777
777
|
a = o = i;
|
|
778
778
|
} else if (t === 10 || t === 13) {
|
|
779
779
|
r += e.slice(a, o);
|
|
780
|
-
let t =
|
|
781
|
-
r +=
|
|
780
|
+
let t = Tt(e, i, n);
|
|
781
|
+
r += Et(t.breaks), i = a = o = t.position;
|
|
782
782
|
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
783
783
|
}
|
|
784
784
|
return r + e.slice(a, n);
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function At(e, t, n, r, i, a) {
|
|
787
787
|
let o = r < 0 ? 0 : r, s = e.slice(t, n).replace(/\r\n?/g, "\n"), c = s === "" ? [] : (s.endsWith("\n") ? s.slice(0, -1) : s).split("\n"), l = "", u = !1, d = 0, f = !1;
|
|
788
788
|
for (let e of c) {
|
|
789
789
|
let t = 0;
|
|
@@ -797,79 +797,79 @@ function Et(e, t, n, r, i, a) {
|
|
|
797
797
|
}
|
|
798
798
|
return i === 3 ? l += "\n".repeat(u ? 1 + d : d) : i !== 2 && u && (l += "\n"), l;
|
|
799
799
|
}
|
|
800
|
-
function
|
|
801
|
-
if (t.valueStart ===
|
|
800
|
+
function jt(e, t) {
|
|
801
|
+
if (t.valueStart === vt) return "";
|
|
802
802
|
let { valueStart: n, valueEnd: r } = t;
|
|
803
803
|
if (t.fast) return e.slice(n, r);
|
|
804
804
|
switch (t.style) {
|
|
805
|
-
case 2: return
|
|
806
|
-
case 3: return
|
|
807
|
-
case 4: return
|
|
808
|
-
case 5: return
|
|
809
|
-
default: return
|
|
805
|
+
case 2: return Ot(e, n, r);
|
|
806
|
+
case 3: return kt(e, n, r);
|
|
807
|
+
case 4: return At(e, n, r, t.indent, t.chomping, !1);
|
|
808
|
+
case 5: return At(e, n, r, t.indent, t.chomping, !0);
|
|
809
|
+
default: return Dt(e, n, r);
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
|
-
var
|
|
812
|
+
var Mt = Object.assign(Object.create(null), {
|
|
813
813
|
"!": "!",
|
|
814
814
|
"!!": "tag:yaml.org,2002:"
|
|
815
815
|
});
|
|
816
|
-
function
|
|
816
|
+
function Nt(e, t) {
|
|
817
817
|
if (e.startsWith("!<") && e.endsWith(">")) return decodeURIComponent(e.slice(2, -1));
|
|
818
|
-
let n = e.indexOf("!", 1), r = n === -1 ? "!" : e.slice(0, n + 1), i = t?.[r] ??
|
|
818
|
+
let n = e.indexOf("!", 1), r = n === -1 ? "!" : e.slice(0, n + 1), i = t?.[r] ?? Mt[r] ?? r;
|
|
819
819
|
return decodeURIComponent(i) + decodeURIComponent(e.slice(r.length));
|
|
820
820
|
}
|
|
821
|
-
var T = -1,
|
|
821
|
+
var T = -1, Pt = {
|
|
822
822
|
filename: "",
|
|
823
|
-
schema:
|
|
823
|
+
schema: lt,
|
|
824
824
|
json: !1,
|
|
825
825
|
maxTotalMergeKeys: 1e4,
|
|
826
826
|
maxAliases: -1
|
|
827
827
|
};
|
|
828
|
-
function
|
|
828
|
+
function Ft(e) {
|
|
829
829
|
return "tagStart" in e && e.tagStart !== T ? e.tagStart : "anchorStart" in e && e.anchorStart !== T ? e.anchorStart : "valueStart" in e && e.valueStart !== T ? e.valueStart : "start" in e ? e.start : 0;
|
|
830
830
|
}
|
|
831
831
|
function E(e, t) {
|
|
832
|
-
|
|
832
|
+
_t(e.source, e.position, t, e.filename);
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function It(e, t, n, r) {
|
|
835
835
|
try {
|
|
836
836
|
return n.finalize(r);
|
|
837
837
|
} catch (n) {
|
|
838
|
-
if (n instanceof
|
|
839
|
-
|
|
838
|
+
if (n instanceof w) throw n;
|
|
839
|
+
_t(e.source, t, n instanceof Error ? n.message : String(n), e.filename);
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function Lt(e, t, n) {
|
|
843
843
|
let r = e[n];
|
|
844
844
|
if (r) return r;
|
|
845
845
|
for (let e of t) if (n.startsWith(e.tagName)) return e;
|
|
846
846
|
}
|
|
847
|
-
function
|
|
848
|
-
let a =
|
|
847
|
+
function Rt(e, t, n, r, i) {
|
|
848
|
+
let a = Lt(t, n, r);
|
|
849
849
|
if (a) return a;
|
|
850
850
|
E(e, `unknown ${i} tag !<${r}>`);
|
|
851
851
|
}
|
|
852
|
-
function
|
|
853
|
-
let n =
|
|
852
|
+
function zt(e, t) {
|
|
853
|
+
let n = jt(e.source, t), r = t.tagStart === T ? "" : e.source.slice(t.tagStart, t.tagEnd), i = e.schema.defaultScalarTag;
|
|
854
854
|
if (r !== "") {
|
|
855
855
|
if (r === "!") return {
|
|
856
856
|
value: n,
|
|
857
857
|
tag: i
|
|
858
858
|
};
|
|
859
|
-
let t =
|
|
859
|
+
let t = Nt(r, e.tagHandlers), a = Lt(e.schema.exact.scalar, e.schema.prefix.scalar, t);
|
|
860
860
|
if (a) {
|
|
861
861
|
let r = a.resolve(n, !0, t);
|
|
862
|
-
return r ===
|
|
862
|
+
return r === g && E(e, `cannot resolve a node with !<${t}> explicit tag`), {
|
|
863
863
|
value: r,
|
|
864
864
|
tag: a
|
|
865
865
|
};
|
|
866
866
|
}
|
|
867
|
-
let o =
|
|
867
|
+
let o = Lt(e.schema.exact.mapping, e.schema.prefix.mapping, t) ?? Lt(e.schema.exact.sequence, e.schema.prefix.sequence, t);
|
|
868
868
|
if (o) {
|
|
869
869
|
n !== "" && E(e, `cannot resolve a node with !<${t}> explicit tag`);
|
|
870
870
|
let r = o.create(t);
|
|
871
871
|
return {
|
|
872
|
-
value: o.carrierIsResult ? r :
|
|
872
|
+
value: o.carrierIsResult ? r : It(e, e.position, o, r),
|
|
873
873
|
tag: o
|
|
874
874
|
};
|
|
875
875
|
}
|
|
@@ -879,7 +879,7 @@ function Ft(e, t) {
|
|
|
879
879
|
let t = e.schema.implicitScalarByFirstChar.get(n.charAt(0)) ?? e.schema.implicitScalarAnyFirstChar;
|
|
880
880
|
for (let e of t) {
|
|
881
881
|
let t = e.resolve(n, !1, e.tagName);
|
|
882
|
-
if (t !==
|
|
882
|
+
if (t !== g) return {
|
|
883
883
|
value: t,
|
|
884
884
|
tag: e
|
|
885
885
|
};
|
|
@@ -890,50 +890,50 @@ function Ft(e, t) {
|
|
|
890
890
|
tag: i
|
|
891
891
|
};
|
|
892
892
|
}
|
|
893
|
-
function
|
|
894
|
-
let o = t.tagStart === T ? "" : e.source.slice(t.tagStart, t.tagEnd), s = o === "" || o === "!" ? i :
|
|
893
|
+
function Bt(e, t, n, r, i, a) {
|
|
894
|
+
let o = t.tagStart === T ? "" : e.source.slice(t.tagStart, t.tagEnd), s = o === "" || o === "!" ? i : Nt(o, e.tagHandlers);
|
|
895
895
|
return {
|
|
896
896
|
tagName: s,
|
|
897
|
-
tag:
|
|
897
|
+
tag: Rt(e, n, r, s, a)
|
|
898
898
|
};
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function Vt(e) {
|
|
901
901
|
return e.nodeKind === "mapping";
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function Ht(e, t, n, r) {
|
|
904
904
|
for (let i of r.keys(n)) {
|
|
905
905
|
if (e.maxTotalMergeKeys !== -1 && ++e.totalMergeKeys > e.maxTotalMergeKeys && E(e, `merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`), t.tag.has(t.value, i)) continue;
|
|
906
906
|
let a = t.tag.addPair(t.value, i, r.get(n, i));
|
|
907
907
|
a && E(e, a), (t.overridable ??= /* @__PURE__ */ new Set()).add(i);
|
|
908
908
|
}
|
|
909
909
|
}
|
|
910
|
-
function
|
|
911
|
-
if (e.position = t.keyPosition,
|
|
912
|
-
else if (r.nodeKind === "sequence" && Array.isArray(n)) for (let r of n)
|
|
910
|
+
function Ut(e, t, n, r) {
|
|
911
|
+
if (e.position = t.keyPosition, Vt(r)) Ht(e, t, n, r);
|
|
912
|
+
else if (r.nodeKind === "sequence" && Array.isArray(n)) for (let r of n) Ht(e, t, r, t.tag);
|
|
913
913
|
else E(e, "cannot merge mappings; the provided source object is unacceptable");
|
|
914
914
|
}
|
|
915
|
-
function
|
|
916
|
-
if (e.position = t.keyPosition, n ===
|
|
917
|
-
|
|
915
|
+
function Wt(e, t, n, r, i) {
|
|
916
|
+
if (e.position = t.keyPosition, n === _) {
|
|
917
|
+
Ut(e, t, r, i);
|
|
918
918
|
return;
|
|
919
919
|
}
|
|
920
920
|
!e.json && t.tag.has(t.value, n) && !t.overridable?.has(n) && E(e, "duplicated mapping key");
|
|
921
921
|
let a = t.tag.addPair(t.value, n, r);
|
|
922
922
|
a && E(e, a), t.overridable?.delete(n);
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function Gt(e, t, n) {
|
|
925
925
|
let r = e.frames[e.frames.length - 1];
|
|
926
926
|
if (r.kind === "document") r.value = t, r.hasValue = !0;
|
|
927
927
|
else if (r.kind === "sequence") {
|
|
928
|
-
r.merge && (
|
|
928
|
+
r.merge && (Vt(n) || E(e, "cannot merge mappings; the provided source object is unacceptable"));
|
|
929
929
|
let i = r.tag.addItem(r.value, t, r.index++);
|
|
930
930
|
i && E(e, i);
|
|
931
931
|
} else if (r.hasKey) {
|
|
932
932
|
let i = r.key;
|
|
933
|
-
r.key = void 0, r.hasKey = !1,
|
|
933
|
+
r.key = void 0, r.hasKey = !1, Wt(e, r, i, t, n);
|
|
934
934
|
} else r.key = t, r.keyPosition = e.position, r.hasKey = !0;
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function Kt(e, t, n, r, i) {
|
|
937
937
|
if (t.anchorStart !== T) {
|
|
938
938
|
let a = {
|
|
939
939
|
value: n,
|
|
@@ -944,9 +944,9 @@ function Ht(e, t, n, r, i) {
|
|
|
944
944
|
}
|
|
945
945
|
return null;
|
|
946
946
|
}
|
|
947
|
-
function
|
|
947
|
+
function qt(e, t) {
|
|
948
948
|
let n = {
|
|
949
|
-
...
|
|
949
|
+
...Pt,
|
|
950
950
|
...t,
|
|
951
951
|
events: e,
|
|
952
952
|
documents: [],
|
|
@@ -960,7 +960,7 @@ function Ut(e, t) {
|
|
|
960
960
|
};
|
|
961
961
|
for (; n.eventIndex < n.events.length;) {
|
|
962
962
|
let e = n.events[n.eventIndex++];
|
|
963
|
-
switch (n.position =
|
|
963
|
+
switch (n.position = Ft(e), e.type) {
|
|
964
964
|
case 1:
|
|
965
965
|
n.anchors = /* @__PURE__ */ new Map(), n.aliasCount = 0, n.tagHandlers = Object.create(null);
|
|
966
966
|
for (let t of e.directives) t.kind === "tag" && (n.tagHandlers[t.handle] = t.prefix);
|
|
@@ -972,12 +972,12 @@ function Ut(e, t) {
|
|
|
972
972
|
});
|
|
973
973
|
break;
|
|
974
974
|
case 4: {
|
|
975
|
-
let { value: t, tag: r } =
|
|
976
|
-
|
|
975
|
+
let { value: t, tag: r } = zt(n, e);
|
|
976
|
+
Kt(n, e, t, r, !0), Gt(n, t, r);
|
|
977
977
|
break;
|
|
978
978
|
}
|
|
979
979
|
case 2: {
|
|
980
|
-
let t =
|
|
980
|
+
let t = Bt(n, e, n.schema.exact.sequence, n.schema.prefix.sequence, "tag:yaml.org,2002:seq", "sequence"), r = t.tag.create(t.tagName), i = Kt(n, e, r, t.tag, t.tag.carrierIsResult), a = n.frames[n.frames.length - 1], o = a !== void 0 && a.kind === "mapping" && a.hasKey && a.key === _;
|
|
981
981
|
n.frames.push({
|
|
982
982
|
kind: "sequence",
|
|
983
983
|
position: n.position,
|
|
@@ -990,7 +990,7 @@ function Ut(e, t) {
|
|
|
990
990
|
break;
|
|
991
991
|
}
|
|
992
992
|
case 3: {
|
|
993
|
-
let t =
|
|
993
|
+
let t = Bt(n, e, n.schema.exact.mapping, n.schema.prefix.mapping, "tag:yaml.org,2002:map", "mapping"), r = t.tag.create(t.tagName), i = Kt(n, e, r, t.tag, t.tag.carrierIsResult);
|
|
994
994
|
n.frames.push({
|
|
995
995
|
kind: "mapping",
|
|
996
996
|
position: n.position,
|
|
@@ -1007,15 +1007,15 @@ function Ut(e, t) {
|
|
|
1007
1007
|
case 5: {
|
|
1008
1008
|
n.maxAliases !== -1 && ++n.aliasCount > n.maxAliases && E(n, `aliases exceeded maxAliases (${n.maxAliases})`);
|
|
1009
1009
|
let t = n.source.slice(e.anchorStart, e.anchorEnd), r = n.anchors.get(t);
|
|
1010
|
-
r || E(n, `unidentified alias "${t}"`), r.isValueFinal || E(n, `recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`),
|
|
1010
|
+
r || E(n, `unidentified alias "${t}"`), r.isValueFinal || E(n, `recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`), Gt(n, r.value, r.tag);
|
|
1011
1011
|
break;
|
|
1012
1012
|
}
|
|
1013
1013
|
case 6: {
|
|
1014
1014
|
let e = n.frames.pop();
|
|
1015
1015
|
if (e.kind === "mapping" && e.hasKey && (n.position = e.keyPosition, E(n, "incomplete mapping pair in event stream")), e.kind === "document") n.documents.push(e.value);
|
|
1016
1016
|
else {
|
|
1017
|
-
let t = e.tag.carrierIsResult ? e.value :
|
|
1018
|
-
e.anchor && (e.anchor.value = t, e.anchor.isValueFinal = !0),
|
|
1017
|
+
let t = e.tag.carrierIsResult ? e.value : It(n, e.position, e.tag, e.value);
|
|
1018
|
+
e.anchor && (e.anchor.value = t, e.anchor.isValueFinal = !0), Gt(n, t, e.tag);
|
|
1019
1019
|
}
|
|
1020
1020
|
break;
|
|
1021
1021
|
}
|
|
@@ -1023,11 +1023,11 @@ function Ut(e, t) {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
return n.documents;
|
|
1025
1025
|
}
|
|
1026
|
-
var D = -1,
|
|
1026
|
+
var D = -1, Jt = Object.prototype.hasOwnProperty, O = 1, Yt = 2, Xt = 3, Zt = 4, Qt = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, $t = /[,\[\]{}]/, en = /^(?:!|!!|![0-9A-Za-z-]+!)$/, tn = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`, nn = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`, rn = RegExp(`^(?:${tn})*$`), an = RegExp(`^(?:${nn})+$`), on = RegExp(`^(?:!(?:${tn})*|${nn}(?:${tn})*)$`), sn = {
|
|
1027
1027
|
filename: "",
|
|
1028
1028
|
maxDepth: 100
|
|
1029
1029
|
};
|
|
1030
|
-
function
|
|
1030
|
+
function cn(e, t, n) {
|
|
1031
1031
|
e.events.push({
|
|
1032
1032
|
type: 1,
|
|
1033
1033
|
explicitStart: t,
|
|
@@ -1035,7 +1035,7 @@ function nn(e, t, n) {
|
|
|
1035
1035
|
directives: e.directives
|
|
1036
1036
|
});
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function ln(e, t, n, r, i, a, o) {
|
|
1039
1039
|
e.events.push({
|
|
1040
1040
|
type: 2,
|
|
1041
1041
|
start: t,
|
|
@@ -1046,7 +1046,7 @@ function rn(e, t, n, r, i, a, o) {
|
|
|
1046
1046
|
style: o
|
|
1047
1047
|
});
|
|
1048
1048
|
}
|
|
1049
|
-
function
|
|
1049
|
+
function un(e, t, n, r, i, a, o) {
|
|
1050
1050
|
e.events.push({
|
|
1051
1051
|
type: 3,
|
|
1052
1052
|
start: t,
|
|
@@ -1057,7 +1057,7 @@ function an(e, t, n, r, i, a, o) {
|
|
|
1057
1057
|
style: o
|
|
1058
1058
|
});
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1060
|
+
function dn(e, t) {
|
|
1061
1061
|
e.events.splice(t.eventsLength, 0, {
|
|
1062
1062
|
type: 3,
|
|
1063
1063
|
start: t.position,
|
|
@@ -1068,7 +1068,7 @@ function on(e, t) {
|
|
|
1068
1068
|
style: 2
|
|
1069
1069
|
});
|
|
1070
1070
|
}
|
|
1071
|
-
function
|
|
1071
|
+
function k(e, t, n, r, i, a, o, s, c = 1, l = -1, u = !1) {
|
|
1072
1072
|
e.events.push({
|
|
1073
1073
|
type: 4,
|
|
1074
1074
|
valueStart: t,
|
|
@@ -1083,20 +1083,20 @@ function A(e, t, n, r, i, a, o, s, c = 1, l = -1, u = !1) {
|
|
|
1083
1083
|
fast: u
|
|
1084
1084
|
});
|
|
1085
1085
|
}
|
|
1086
|
-
function
|
|
1086
|
+
function fn(e, t, n) {
|
|
1087
1087
|
e.events.push({
|
|
1088
1088
|
type: 5,
|
|
1089
1089
|
anchorStart: t,
|
|
1090
1090
|
anchorEnd: n
|
|
1091
1091
|
});
|
|
1092
1092
|
}
|
|
1093
|
-
function
|
|
1093
|
+
function A(e) {
|
|
1094
1094
|
e.events.push({ type: 6 });
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1097
|
-
|
|
1096
|
+
function j(e) {
|
|
1097
|
+
k(e, D, D, D, D, D, D, 1);
|
|
1098
1098
|
}
|
|
1099
|
-
function
|
|
1099
|
+
function pn() {
|
|
1100
1100
|
return {
|
|
1101
1101
|
anchorStart: D,
|
|
1102
1102
|
anchorEnd: D,
|
|
@@ -1104,7 +1104,7 @@ function cn() {
|
|
|
1104
1104
|
tagEnd: D
|
|
1105
1105
|
};
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function M(e) {
|
|
1108
1108
|
return {
|
|
1109
1109
|
position: e.position,
|
|
1110
1110
|
line: e.line,
|
|
@@ -1114,104 +1114,104 @@ function N(e) {
|
|
|
1114
1114
|
eventsLength: e.events.length
|
|
1115
1115
|
};
|
|
1116
1116
|
}
|
|
1117
|
-
function
|
|
1117
|
+
function N(e, t) {
|
|
1118
1118
|
e.position = t.position, e.line = t.line, e.lineStart = t.lineStart, e.lineIndent = t.lineIndent, e.firstTabInLine = t.firstTabInLine, e.events.length = t.eventsLength;
|
|
1119
1119
|
}
|
|
1120
|
-
function
|
|
1121
|
-
|
|
1120
|
+
function P(e, t) {
|
|
1121
|
+
_t(e.input.slice(0, e.length), e.position, t, e.filename);
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function F(e) {
|
|
1124
1124
|
return e === 10 || e === 13;
|
|
1125
1125
|
}
|
|
1126
|
-
function
|
|
1126
|
+
function I(e) {
|
|
1127
1127
|
return e === 9 || e === 32;
|
|
1128
1128
|
}
|
|
1129
|
+
function L(e) {
|
|
1130
|
+
return I(e) || F(e);
|
|
1131
|
+
}
|
|
1129
1132
|
function R(e) {
|
|
1130
|
-
return
|
|
1133
|
+
return e === 0 || L(e);
|
|
1131
1134
|
}
|
|
1132
1135
|
function z(e) {
|
|
1133
|
-
return e === 0 || R(e);
|
|
1134
|
-
}
|
|
1135
|
-
function B(e) {
|
|
1136
1136
|
return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
|
|
1137
1137
|
}
|
|
1138
|
-
function
|
|
1138
|
+
function mn(e) {
|
|
1139
1139
|
return e >= 48 && e <= 57 ? e - 48 : -1;
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1141
|
+
function hn(e) {
|
|
1142
1142
|
if (e >= 48 && e <= 57) return e - 48;
|
|
1143
1143
|
let t = e | 32;
|
|
1144
1144
|
return t >= 97 && t <= 102 ? t - 97 + 10 : -1;
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1146
|
+
function gn(e) {
|
|
1147
1147
|
return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
|
|
1148
1148
|
}
|
|
1149
|
-
function
|
|
1149
|
+
function _n(e) {
|
|
1150
1150
|
return e === 48 || e === 97 || e === 98 || e === 116 || e === 9 || e === 110 || e === 118 || e === 102 || e === 114 || e === 101 || e === 32 || e === 34 || e === 47 || e === 92 || e === 78 || e === 95 || e === 76 || e === 80;
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function vn(e) {
|
|
1153
1153
|
e.input.charCodeAt(e.position) === 10 ? e.position++ : (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++), e.line++, e.lineStart = e.position, e.lineIndent = 0, e.firstTabInLine = -1;
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1156
|
-
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart ||
|
|
1155
|
+
function B(e, t) {
|
|
1156
|
+
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart || L(e.input.charCodeAt(e.position - 1));
|
|
1157
1157
|
for (; r !== 0;) {
|
|
1158
|
-
for (;
|
|
1158
|
+
for (; I(r);) i = !0, r === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), r = e.input.charCodeAt(++e.position);
|
|
1159
1159
|
if (t && i && r === 35) do
|
|
1160
1160
|
r = e.input.charCodeAt(++e.position);
|
|
1161
|
-
while (!
|
|
1162
|
-
if (!
|
|
1163
|
-
for (
|
|
1161
|
+
while (!F(r) && r !== 0);
|
|
1162
|
+
if (!F(r)) break;
|
|
1163
|
+
for (vn(e), n++, i = !0, r = e.input.charCodeAt(e.position); r === 32;) e.lineIndent++, r = e.input.charCodeAt(++e.position);
|
|
1164
1164
|
}
|
|
1165
1165
|
return n;
|
|
1166
1166
|
}
|
|
1167
|
-
function
|
|
1167
|
+
function V(e, t = e.position) {
|
|
1168
1168
|
let n = e.input.charCodeAt(t);
|
|
1169
1169
|
if ((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2)) {
|
|
1170
1170
|
let n = e.input.charCodeAt(t + 3);
|
|
1171
|
-
return n === 0 ||
|
|
1171
|
+
return n === 0 || L(n);
|
|
1172
1172
|
}
|
|
1173
1173
|
return !1;
|
|
1174
1174
|
}
|
|
1175
|
-
function
|
|
1175
|
+
function yn(e) {
|
|
1176
1176
|
let t = e.input.charCodeAt(e.position);
|
|
1177
|
-
for (; t !== 0 && !
|
|
1177
|
+
for (; t !== 0 && !F(t);) t = e.input.charCodeAt(++e.position);
|
|
1178
1178
|
}
|
|
1179
|
-
function
|
|
1180
|
-
|
|
1179
|
+
function bn(e, t, n) {
|
|
1180
|
+
Qt.test(e.input.slice(t, n)) && P(e, "the stream contains non-printable characters");
|
|
1181
1181
|
}
|
|
1182
|
-
function
|
|
1182
|
+
function xn(e, t, n) {
|
|
1183
1183
|
if (e.input.charCodeAt(e.position) !== 33) return !1;
|
|
1184
|
-
t.tagStart !== D &&
|
|
1184
|
+
t.tagStart !== D && P(e, "duplication of a tag property");
|
|
1185
1185
|
let r = e.position, i = !1, a = !1, o = "!", s = e.input.charCodeAt(++e.position);
|
|
1186
1186
|
s === 60 ? (i = !0, s = e.input.charCodeAt(++e.position)) : s === 33 && (a = !0, o = "!!", s = e.input.charCodeAt(++e.position));
|
|
1187
1187
|
let c = e.position, l;
|
|
1188
1188
|
if (i) {
|
|
1189
1189
|
for (; s !== 0 && s !== 62;) s = e.input.charCodeAt(++e.position);
|
|
1190
|
-
s !== 62 &&
|
|
1190
|
+
s !== 62 && P(e, "unexpected end of the stream within a verbatim tag"), l = e.input.slice(c, e.position), e.position++;
|
|
1191
1191
|
} else {
|
|
1192
|
-
for (; s !== 0 && !
|
|
1193
|
-
l = e.input.slice(c, e.position),
|
|
1192
|
+
for (; s !== 0 && !L(s) && !(n && z(s));) s === 33 && (a ? P(e, "tag suffix cannot contain exclamation marks") : (o = e.input.slice(c - 1, e.position + 1), en.test(o) || P(e, "named tag handle cannot contain such characters"), a = !0, c = e.position + 1)), s = e.input.charCodeAt(++e.position);
|
|
1193
|
+
l = e.input.slice(c, e.position), $t.test(l) && P(e, "tag suffix cannot contain flow indicator characters");
|
|
1194
1194
|
}
|
|
1195
|
-
return l && !(i ?
|
|
1195
|
+
return l && !(i ? rn.test(l) : an.test(l)) && P(e, `tag name cannot contain such characters: ${l}`), !i && o !== "!" && o !== "!!" && !Jt.call(e.tagHandlers, o) && P(e, `undeclared tag handle "${o}"`), t.tagStart = r, t.tagEnd = e.position, !0;
|
|
1196
1196
|
}
|
|
1197
|
-
function
|
|
1197
|
+
function Sn(e, t) {
|
|
1198
1198
|
if (e.input.charCodeAt(e.position) !== 38) return !1;
|
|
1199
|
-
t.anchorStart !== D &&
|
|
1199
|
+
t.anchorStart !== D && P(e, "duplication of an anchor property"), e.position++;
|
|
1200
1200
|
let n = e.position;
|
|
1201
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1202
|
-
return e.position === n &&
|
|
1201
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !L(e.input.charCodeAt(e.position)) && !z(e.input.charCodeAt(e.position));) e.position++;
|
|
1202
|
+
return e.position === n && P(e, "name of an anchor node must contain at least one character"), t.anchorStart = n, t.anchorEnd = e.position, !0;
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1204
|
+
function Cn(e, t) {
|
|
1205
1205
|
if (e.input.charCodeAt(e.position) !== 42) return !1;
|
|
1206
|
-
(t.anchorStart !== D || t.tagStart !== D) &&
|
|
1206
|
+
(t.anchorStart !== D || t.tagStart !== D) && P(e, "alias node should not have any properties"), e.position++;
|
|
1207
1207
|
let n = e.position;
|
|
1208
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1209
|
-
return e.position === n &&
|
|
1208
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !L(e.input.charCodeAt(e.position)) && !z(e.input.charCodeAt(e.position));) e.position++;
|
|
1209
|
+
return e.position === n && P(e, "name of an alias node must contain at least one character"), fn(e, n, e.position), !0;
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1212
|
-
|
|
1211
|
+
function wn(e, t) {
|
|
1212
|
+
B(e, !1), e.lineIndent < t && P(e, "deficient indentation");
|
|
1213
1213
|
}
|
|
1214
|
-
function
|
|
1214
|
+
function Tn(e, t, n) {
|
|
1215
1215
|
if (e.input.charCodeAt(e.position) !== 39) return !1;
|
|
1216
1216
|
e.position++;
|
|
1217
1217
|
let r = e.position, i = !0;
|
|
@@ -1223,13 +1223,13 @@ function bn(e, t, n) {
|
|
|
1223
1223
|
continue;
|
|
1224
1224
|
}
|
|
1225
1225
|
let t = e.position;
|
|
1226
|
-
return e.position++,
|
|
1226
|
+
return e.position++, k(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2, 1, -1, i), !0;
|
|
1227
1227
|
}
|
|
1228
|
-
|
|
1228
|
+
F(a) ? (i = !1, wn(e, t)) : e.position === e.lineStart && V(e) ? P(e, "unexpected end of the document within a single quoted scalar") : a !== 9 && a < 32 ? P(e, "expected valid JSON character") : e.position++;
|
|
1229
1229
|
}
|
|
1230
|
-
|
|
1230
|
+
P(e, "unexpected end of the stream within a single quoted scalar");
|
|
1231
1231
|
}
|
|
1232
|
-
function
|
|
1232
|
+
function En(e, t, n) {
|
|
1233
1233
|
if (e.input.charCodeAt(e.position) !== 34) return !1;
|
|
1234
1234
|
e.position++;
|
|
1235
1235
|
let r = e.position, i = !0;
|
|
@@ -1237,35 +1237,35 @@ function xn(e, t, n) {
|
|
|
1237
1237
|
let a = e.input.charCodeAt(e.position);
|
|
1238
1238
|
if (a === 34) {
|
|
1239
1239
|
let t = e.position;
|
|
1240
|
-
return e.position++,
|
|
1240
|
+
return e.position++, k(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 3, 1, -1, i), !0;
|
|
1241
1241
|
}
|
|
1242
1242
|
if (a === 92) {
|
|
1243
1243
|
i = !1;
|
|
1244
1244
|
let n = e.input.charCodeAt(++e.position);
|
|
1245
|
-
if (
|
|
1246
|
-
else if (
|
|
1245
|
+
if (F(n)) wn(e, t);
|
|
1246
|
+
else if (_n(n)) e.position++;
|
|
1247
1247
|
else {
|
|
1248
|
-
let t =
|
|
1249
|
-
for (t === 0 &&
|
|
1248
|
+
let t = gn(n);
|
|
1249
|
+
for (t === 0 && P(e, "unknown escape sequence"); t-- > 0;) e.position++, hn(e.input.charCodeAt(e.position)) < 0 && P(e, "expected hexadecimal character");
|
|
1250
1250
|
e.position++;
|
|
1251
1251
|
}
|
|
1252
|
-
} else
|
|
1252
|
+
} else F(a) ? (i = !1, wn(e, t)) : e.position === e.lineStart && V(e) ? P(e, "unexpected end of the document within a double quoted scalar") : a !== 9 && a < 32 ? P(e, "expected valid JSON character") : e.position++;
|
|
1253
1253
|
}
|
|
1254
|
-
|
|
1254
|
+
P(e, "unexpected end of the stream within a double quoted scalar");
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function Dn(e, t, n) {
|
|
1257
1257
|
let r = e.input.charCodeAt(e.position), i = 1, a = -1, o = !1;
|
|
1258
1258
|
if (r !== 124 && r !== 62) return !1;
|
|
1259
1259
|
let s = r === 124 ? 4 : 5;
|
|
1260
1260
|
for (e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1261
|
-
let n = e.input.charCodeAt(e.position), r =
|
|
1262
|
-
if (n === 43 || n === 45) i !== 1 &&
|
|
1263
|
-
else if (r >= 0) r === 0 &&
|
|
1261
|
+
let n = e.input.charCodeAt(e.position), r = mn(n);
|
|
1262
|
+
if (n === 43 || n === 45) i !== 1 && P(e, "repeat of a chomping mode identifier"), i = n === 43 ? 3 : 2, e.position++;
|
|
1263
|
+
else if (r >= 0) r === 0 && P(e, "bad explicit indentation width of a block scalar; it cannot be less than one"), o && P(e, "repeat of an indentation width identifier"), a = t + r - 1, o = !0, e.position++;
|
|
1264
1264
|
else break;
|
|
1265
1265
|
}
|
|
1266
1266
|
let c = !1;
|
|
1267
|
-
for (;
|
|
1268
|
-
c && e.input.charCodeAt(e.position) === 35 &&
|
|
1267
|
+
for (; I(e.input.charCodeAt(e.position));) c = !0, e.position++;
|
|
1268
|
+
c && e.input.charCodeAt(e.position) === 35 && yn(e), F(e.input.charCodeAt(e.position)) ? vn(e) : e.input.charCodeAt(e.position) !== 0 && P(e, "a line break is expected");
|
|
1269
1269
|
let l = o ? a : -1, u = 0, d = e.position, f = e.position;
|
|
1270
1270
|
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1271
1271
|
let n = e.position, r = 0;
|
|
@@ -1275,168 +1275,168 @@ function Sn(e, t, n) {
|
|
|
1275
1275
|
l >= 0 ? r > l && (f = n + r) : r > 0 && (f = n + r);
|
|
1276
1276
|
break;
|
|
1277
1277
|
}
|
|
1278
|
-
if (n === e.lineStart &&
|
|
1279
|
-
if (!o && l === -1 &&
|
|
1278
|
+
if (n === e.lineStart && V(e, n)) break;
|
|
1279
|
+
if (!o && l === -1 && F(i) && (u = Math.max(u, r)), !o && l === -1 && !F(i) && (i === 9 && r < t && (e.position = n + r, P(e, "tab characters must not be used in indentation")), r < u && (e.position = n + r, P(e, "bad indentation of a mapping entry"))), l === -1 && i !== 0 && !F(i) && r < t) {
|
|
1280
1280
|
e.lineIndent = r, e.position = n + r;
|
|
1281
1281
|
break;
|
|
1282
1282
|
}
|
|
1283
|
-
!o && i !== 0 && !
|
|
1283
|
+
!o && i !== 0 && !F(i) && l === -1 && (l = r);
|
|
1284
1284
|
let a = l === -1 ? t + 1 : l;
|
|
1285
|
-
if (i !== 0 && !
|
|
1285
|
+
if (i !== 0 && !F(i) && r < a) {
|
|
1286
1286
|
e.lineIndent = r, e.position = n + r;
|
|
1287
1287
|
break;
|
|
1288
1288
|
}
|
|
1289
|
-
|
|
1289
|
+
yn(e), f = e.position, F(e.input.charCodeAt(e.position)) && (vn(e), f = e.position);
|
|
1290
1290
|
}
|
|
1291
|
-
return
|
|
1291
|
+
return bn(e, d, f), k(e, d, f, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, s, i, l), !0;
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1293
|
+
function On(e, t) {
|
|
1294
1294
|
let n = e.input.charCodeAt(e.position), r = t === O;
|
|
1295
|
-
if (n === 0 ||
|
|
1295
|
+
if (n === 0 || L(n) || n === 35 || n === 38 || n === 42 || n === 33 || n === 124 || n === 62 || n === 39 || n === 34 || n === 37 || n === 64 || n === 96 || r && z(n)) return !1;
|
|
1296
1296
|
if (n === 63 || n === 45) {
|
|
1297
1297
|
let t = e.input.charCodeAt(e.position + 1);
|
|
1298
|
-
if (
|
|
1298
|
+
if (R(t) || r && z(t)) return !1;
|
|
1299
1299
|
}
|
|
1300
1300
|
return !0;
|
|
1301
1301
|
}
|
|
1302
|
-
function
|
|
1303
|
-
if (!
|
|
1302
|
+
function kn(e, t, n, r) {
|
|
1303
|
+
if (!On(e, n)) return !1;
|
|
1304
1304
|
let i = e.position, a = e.position, o = e.input.charCodeAt(e.position), s = n === O, c = !1;
|
|
1305
|
-
for (; o !== 0 && !(e.position === e.lineStart &&
|
|
1305
|
+
for (; o !== 0 && !(e.position === e.lineStart && V(e));) {
|
|
1306
1306
|
if (o === 58) {
|
|
1307
1307
|
let t = e.input.charCodeAt(e.position + 1);
|
|
1308
|
-
if (
|
|
1308
|
+
if (R(t) || s && z(t)) break;
|
|
1309
1309
|
} else if (o === 35) {
|
|
1310
|
-
if (
|
|
1311
|
-
} else if (s &&
|
|
1312
|
-
else if (
|
|
1310
|
+
if (L(e.input.charCodeAt(e.position - 1))) break;
|
|
1311
|
+
} else if (s && z(o)) break;
|
|
1312
|
+
else if (F(o)) {
|
|
1313
1313
|
let n = e.position, r = e.line, i = e.lineStart, a = e.lineIndent;
|
|
1314
|
-
if (
|
|
1314
|
+
if (B(e, !1), e.lineIndent >= t) {
|
|
1315
1315
|
c = !0, o = e.input.charCodeAt(e.position);
|
|
1316
1316
|
continue;
|
|
1317
1317
|
}
|
|
1318
1318
|
e.position = n, e.line = r, e.lineStart = i, e.lineIndent = a;
|
|
1319
1319
|
break;
|
|
1320
1320
|
}
|
|
1321
|
-
|
|
1321
|
+
I(o) || (a = e.position + 1), o = e.input.charCodeAt(++e.position);
|
|
1322
1322
|
}
|
|
1323
|
-
return a === i ? !1 : (
|
|
1323
|
+
return a === i ? !1 : (bn(e, i, a), k(e, i, a, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1, 1, -1, !c), !0);
|
|
1324
1324
|
}
|
|
1325
|
-
function
|
|
1325
|
+
function H(e, t) {
|
|
1326
1326
|
let n = e.line;
|
|
1327
|
-
|
|
1327
|
+
B(e, !0), (e.line > n && e.lineIndent < t || e.firstTabInLine !== -1 && e.lineIndent < t) && P(e, "deficient indentation");
|
|
1328
1328
|
}
|
|
1329
|
-
function
|
|
1329
|
+
function An(e, t, n) {
|
|
1330
1330
|
let r = e.input.charCodeAt(e.position), i = r === 123, a = e.position, o = !0;
|
|
1331
1331
|
if (r !== 91 && r !== 123) return !1;
|
|
1332
1332
|
let s = i ? 125 : 93;
|
|
1333
|
-
for (i ?
|
|
1334
|
-
|
|
1333
|
+
for (i ? un(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2) : ln(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2), e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1334
|
+
H(e, t);
|
|
1335
1335
|
let n = e.input.charCodeAt(e.position);
|
|
1336
|
-
if (n === s) return e.position++,
|
|
1337
|
-
o ? n === 44 &&
|
|
1336
|
+
if (n === s) return e.position++, A(e), !0;
|
|
1337
|
+
o ? n === 44 && P(e, "expected the node content, but found ','") : P(e, "missed comma between flow collection entries");
|
|
1338
1338
|
let r = !1, a = !1;
|
|
1339
|
-
n === 63 &&
|
|
1340
|
-
let c = e.line, l =
|
|
1341
|
-
|
|
1339
|
+
n === 63 && L(e.input.charCodeAt(e.position + 1)) && (r = a = !0, e.position += 1, H(e, t));
|
|
1340
|
+
let c = e.line, l = M(e), u = U(e, t, O, !1, !0);
|
|
1341
|
+
H(e, t), n = e.input.charCodeAt(e.position), (i || a || e.line === c) && n === 58 ? (r = !0, e.position++, H(e, t), i || dn(e, l), u || j(e), U(e, t, O, !1, !0) || j(e), H(e, t), i || A(e)) : i && r ? (u || j(e), j(e)) : i ? j(e) : r && (dn(e, l), u || j(e), j(e), A(e)), n = e.input.charCodeAt(e.position), n === 44 ? (o = !0, e.position++) : o = !1;
|
|
1342
1342
|
}
|
|
1343
|
-
|
|
1343
|
+
P(e, "unexpected end of the stream within a flow collection");
|
|
1344
1344
|
}
|
|
1345
|
-
function
|
|
1346
|
-
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !
|
|
1347
|
-
for (
|
|
1348
|
-
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine,
|
|
1345
|
+
function jn(e, t, n) {
|
|
1346
|
+
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !R(e.input.charCodeAt(e.position + 1))) return !1;
|
|
1347
|
+
for (ln(e, e.position, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 1); e.input.charCodeAt(e.position) === 45 && R(e.input.charCodeAt(e.position + 1));) {
|
|
1348
|
+
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, P(e, "tab characters must not be used in indentation"));
|
|
1349
1349
|
let n = e.line;
|
|
1350
1350
|
e.position++;
|
|
1351
|
-
let r =
|
|
1352
|
-
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 &&
|
|
1353
|
-
e.lineIndent > t &&
|
|
1351
|
+
let r = B(e, !0) > 0;
|
|
1352
|
+
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 && R(e.input.charCodeAt(e.position + 1)) && P(e, "bad indentation of a sequence entry"), r && e.lineIndent <= t ? j(e) : U(e, t, Xt, !1, !0), B(e, !0), e.lineIndent < t || e.position >= e.length) break;
|
|
1353
|
+
e.lineIndent > t && P(e, "bad indentation of a sequence entry"), e.line === n && e.input.charCodeAt(e.position) === 45 && R(e.input.charCodeAt(e.position + 1)) && P(e, "bad indentation of a sequence entry");
|
|
1354
1354
|
}
|
|
1355
|
-
return
|
|
1355
|
+
return A(e), !0;
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1357
|
+
function Mn(e, t, n, r) {
|
|
1358
1358
|
let i = !1, a = !1, o = !1, s = !1;
|
|
1359
1359
|
if (e.firstTabInLine !== -1) return !1;
|
|
1360
1360
|
let c = e.input.charCodeAt(e.position);
|
|
1361
1361
|
for (; c !== 0;) {
|
|
1362
|
-
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine,
|
|
1362
|
+
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, P(e, "tab characters must not be used in indentation"));
|
|
1363
1363
|
let l = e.input.charCodeAt(e.position + 1), u = e.line;
|
|
1364
|
-
if ((c === 63 || c === 58) &&
|
|
1364
|
+
if ((c === 63 || c === 58) && R(l)) o ||= (un(e, e.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1), !0), c === 63 ? (i && j(e), a = !0, i = !0) : i ? i = !1 : (j(e), a = !0, i = !1), e.position += 1, s = !0;
|
|
1365
1365
|
else {
|
|
1366
|
-
i &&= (
|
|
1367
|
-
let t =
|
|
1368
|
-
if (!
|
|
1366
|
+
i &&= (j(e), !1);
|
|
1367
|
+
let t = M(e);
|
|
1368
|
+
if (!U(e, n, Yt, !1, !0)) break;
|
|
1369
1369
|
if (e.line === u) {
|
|
1370
|
-
for (c = e.input.charCodeAt(e.position);
|
|
1370
|
+
for (c = e.input.charCodeAt(e.position); I(c);) c = e.input.charCodeAt(++e.position);
|
|
1371
1371
|
if (c === 58) {
|
|
1372
|
-
if (c = e.input.charCodeAt(++e.position),
|
|
1373
|
-
for (
|
|
1372
|
+
if (c = e.input.charCodeAt(++e.position), R(c) || P(e, "a whitespace character is expected after the key-value separator within a block mapping"), !o) {
|
|
1373
|
+
for (N(e, t), un(e, t.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1), o = !0, U(e, n, Yt, !1, !0), c = e.input.charCodeAt(e.position); I(c);) c = e.input.charCodeAt(++e.position);
|
|
1374
1374
|
e.position++;
|
|
1375
1375
|
}
|
|
1376
1376
|
a = !0, i = !1, s = !1;
|
|
1377
|
-
} else if (a)
|
|
1378
|
-
else return r.anchorStart !== D || r.tagStart !== D ? (
|
|
1379
|
-
} else if (a)
|
|
1380
|
-
else return r.anchorStart !== D || r.tagStart !== D ? (
|
|
1377
|
+
} else if (a) P(e, "expected ':' after a mapping key");
|
|
1378
|
+
else return r.anchorStart !== D || r.tagStart !== D ? (N(e, t), !1) : !0;
|
|
1379
|
+
} else if (a) P(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
1380
|
+
else return r.anchorStart !== D || r.tagStart !== D ? (N(e, t), !1) : !0;
|
|
1381
1381
|
}
|
|
1382
|
-
if (
|
|
1382
|
+
if (U(e, t, Zt, !0, s) && (s = !1), i || (s &&= (j(e), !1)), B(e, !0), c = e.input.charCodeAt(e.position), (e.line === u || e.lineIndent > t) && c !== 0) P(e, "bad indentation of a mapping entry");
|
|
1383
1383
|
else if (e.lineIndent < t) break;
|
|
1384
1384
|
}
|
|
1385
|
-
return a ? (i &&
|
|
1385
|
+
return a ? (i && j(e), o && A(e), !0) : !1;
|
|
1386
1386
|
}
|
|
1387
|
-
function
|
|
1388
|
-
e.depth >= e.maxDepth &&
|
|
1389
|
-
let o = 1, s = !1, c = !1, l = null, u =
|
|
1390
|
-
if (r &&
|
|
1391
|
-
let r = e.input.charCodeAt(e.position), i =
|
|
1387
|
+
function U(e, t, n, r, i, a = !0) {
|
|
1388
|
+
e.depth >= e.maxDepth && P(e, `nesting exceeded maxDepth (${e.maxDepth})`), e.depth++;
|
|
1389
|
+
let o = 1, s = !1, c = !1, l = null, u = pn(), d = n === Zt || n === Xt, f = d, p = d;
|
|
1390
|
+
if (r && B(e, !0) && (s = !0, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1), o === 1) for (;;) {
|
|
1391
|
+
let r = e.input.charCodeAt(e.position), i = M(e);
|
|
1392
1392
|
if (s && o !== 1 && (r === 33 || r === 38)) break;
|
|
1393
1393
|
if (s && p && (u.tagStart !== D || u.anchorStart !== D) && (r === 33 || r === 38)) {
|
|
1394
|
-
let n =
|
|
1395
|
-
if (
|
|
1396
|
-
|
|
1394
|
+
let n = M(e), r = t + 1;
|
|
1395
|
+
if (Mn(e, e.position - e.lineStart, r, u) && e.events[n.eventsLength]?.type === 3) return e.depth--, !0;
|
|
1396
|
+
N(e, n);
|
|
1397
1397
|
}
|
|
1398
|
-
if (s && (r === 33 && u.tagStart !== D || r === 38 && u.anchorStart !== D) || !
|
|
1399
|
-
l === null && (l = i),
|
|
1398
|
+
if (s && (r === 33 && u.tagStart !== D || r === 38 && u.anchorStart !== D) || !xn(e, u, n === O) && !Sn(e, u)) break;
|
|
1399
|
+
l === null && (l = i), B(e, !0) ? (s = !0, f = p, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1) : f = !1;
|
|
1400
1400
|
}
|
|
1401
|
-
if (f &&= s || i, o === 1 || n ===
|
|
1402
|
-
let r = n === O || n ===
|
|
1403
|
-
if (o === 1) if (f && (
|
|
1401
|
+
if (f &&= s || i, o === 1 || n === Zt) {
|
|
1402
|
+
let r = n === O || n === Yt ? t : t + 1, i = e.position - e.lineStart;
|
|
1403
|
+
if (o === 1) if (f && (jn(e, i, u) || Mn(e, i, r, u)) || An(e, r, u)) c = !0;
|
|
1404
1404
|
else {
|
|
1405
1405
|
let t = e.input.charCodeAt(e.position);
|
|
1406
1406
|
if (l !== null && a && p && !f && t !== 124 && t !== 62) {
|
|
1407
|
-
let t =
|
|
1408
|
-
|
|
1407
|
+
let t = M(e), n = l.position - l.lineStart;
|
|
1408
|
+
N(e, l), Mn(e, n, r, pn()) && e.events[t.eventsLength]?.type === 3 ? c = !0 : N(e, t);
|
|
1409
1409
|
}
|
|
1410
|
-
!c && (d &&
|
|
1410
|
+
!c && (d && Dn(e, r, u) || Tn(e, r, u) || En(e, r, u) || Cn(e, u) || kn(e, r, n, u)) && (c = !0);
|
|
1411
1411
|
}
|
|
1412
|
-
else o === 0 && (c = f &&
|
|
1412
|
+
else o === 0 && (c = f && jn(e, i, u));
|
|
1413
1413
|
}
|
|
1414
|
-
return d &&= !c, !c && (u.anchorStart !== D || u.tagStart !== D || d) && (
|
|
1414
|
+
return d &&= !c, !c && (u.anchorStart !== D || u.tagStart !== D || d) && (k(e, D, D, u.anchorStart, u.anchorEnd, u.tagStart, u.tagEnd, 1), c = !0), e.depth--, c || u.anchorStart !== D || u.tagStart !== D;
|
|
1415
1415
|
}
|
|
1416
|
-
function
|
|
1416
|
+
function Nn(e) {
|
|
1417
1417
|
if (e.lineIndent > 0 || e.input.charCodeAt(e.position) !== 37) return !1;
|
|
1418
1418
|
e.position++;
|
|
1419
1419
|
let t = e.position;
|
|
1420
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1420
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !L(e.input.charCodeAt(e.position));) e.position++;
|
|
1421
1421
|
let n = e.input.slice(t, e.position), r = [];
|
|
1422
|
-
for (n.length === 0 &&
|
|
1423
|
-
for (;
|
|
1424
|
-
if (e.input.charCodeAt(e.position) === 35 ||
|
|
1422
|
+
for (n.length === 0 && P(e, "directive name must not be less than one character in length"); e.input.charCodeAt(e.position) !== 0 && !F(e.input.charCodeAt(e.position));) {
|
|
1423
|
+
for (; I(e.input.charCodeAt(e.position));) e.position++;
|
|
1424
|
+
if (e.input.charCodeAt(e.position) === 35 || F(e.input.charCodeAt(e.position)) || e.input.charCodeAt(e.position) === 0) break;
|
|
1425
1425
|
let t = e.position;
|
|
1426
|
-
for (; e.input.charCodeAt(e.position) !== 0 && !
|
|
1426
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !L(e.input.charCodeAt(e.position));) e.position++;
|
|
1427
1427
|
r.push(e.input.slice(t, e.position));
|
|
1428
1428
|
}
|
|
1429
|
-
if (
|
|
1430
|
-
e.directives.some((e) => e.kind === "yaml") &&
|
|
1429
|
+
if (F(e.input.charCodeAt(e.position)) && vn(e), n === "YAML") {
|
|
1430
|
+
e.directives.some((e) => e.kind === "yaml") && P(e, "duplication of %YAML directive"), r.length !== 1 && P(e, "YAML directive accepts exactly one argument");
|
|
1431
1431
|
let t = /^([0-9]+)\.([0-9]+)$/.exec(r[0]);
|
|
1432
|
-
t === null &&
|
|
1432
|
+
t === null && P(e, "ill-formed argument of the YAML directive"), parseInt(t[1], 10) !== 1 && P(e, "unacceptable YAML version of the document"), e.directives.push({
|
|
1433
1433
|
kind: "yaml",
|
|
1434
1434
|
version: r[0]
|
|
1435
1435
|
});
|
|
1436
1436
|
} else if (n === "TAG") {
|
|
1437
|
-
r.length !== 2 &&
|
|
1437
|
+
r.length !== 2 && P(e, "TAG directive accepts exactly two arguments");
|
|
1438
1438
|
let [t, n] = r;
|
|
1439
|
-
|
|
1439
|
+
en.test(t) || P(e, "ill-formed tag handle (first argument) of the TAG directive"), Jt.call(e.tagHandlers, t) && P(e, `there is a previously declared suffix for "${t}" tag handle`), on.test(n) || P(e, "ill-formed tag prefix (second argument) of the TAG directive"), e.tagHandlers[t] = n, e.directives.push({
|
|
1440
1440
|
kind: "tag",
|
|
1441
1441
|
handle: t,
|
|
1442
1442
|
prefix: n
|
|
@@ -1444,31 +1444,31 @@ function On(e) {
|
|
|
1444
1444
|
}
|
|
1445
1445
|
return !0;
|
|
1446
1446
|
}
|
|
1447
|
-
function
|
|
1447
|
+
function Pn(e) {
|
|
1448
1448
|
e.directives = [], e.tagHandlers = Object.create(null);
|
|
1449
1449
|
let t = !1;
|
|
1450
|
-
for (
|
|
1450
|
+
for (B(e, !0); Nn(e);) t = !0, B(e, !0);
|
|
1451
1451
|
let n = !1, r = !1, i = !0;
|
|
1452
|
-
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 &&
|
|
1452
|
+
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 && R(e.input.charCodeAt(e.position + 3))) {
|
|
1453
1453
|
n = !0;
|
|
1454
1454
|
let t = e.line;
|
|
1455
|
-
e.position += 3,
|
|
1456
|
-
} else t &&
|
|
1455
|
+
e.position += 3, B(e, !0), i = e.line > t;
|
|
1456
|
+
} else t && P(e, "directives end mark is expected");
|
|
1457
1457
|
let a = e.events.length;
|
|
1458
|
-
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 &&
|
|
1459
|
-
e.position += 3,
|
|
1458
|
+
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 && V(e)) {
|
|
1459
|
+
e.position += 3, B(e, !0);
|
|
1460
1460
|
return;
|
|
1461
1461
|
}
|
|
1462
|
-
if (
|
|
1462
|
+
if (cn(e, n, !1), U(e, e.lineIndent - 1, Zt, !1, i, i) || j(e), B(e, !0), e.position === e.lineStart && V(e) && (r = e.input.charCodeAt(e.position) === 46, r)) {
|
|
1463
1463
|
let t = e.line;
|
|
1464
|
-
e.position += 3,
|
|
1464
|
+
e.position += 3, B(e, !0), e.line === t && e.position < e.length && P(e, "end of the stream or a document separator is expected");
|
|
1465
1465
|
}
|
|
1466
1466
|
let o = e.events[a];
|
|
1467
|
-
o?.type === 1 && (o.explicitEnd = r),
|
|
1467
|
+
o?.type === 1 && (o.explicitEnd = r), A(e), !r && e.position < e.length && !(e.position === e.lineStart && V(e)) && P(e, "end of the stream or a document separator is expected");
|
|
1468
1468
|
}
|
|
1469
|
-
function
|
|
1469
|
+
function Fn(e, t) {
|
|
1470
1470
|
let n = e.length, r = {
|
|
1471
|
-
...
|
|
1471
|
+
...sn,
|
|
1472
1472
|
...t,
|
|
1473
1473
|
input: `${e}\0`,
|
|
1474
1474
|
length: n,
|
|
@@ -1482,35 +1482,35 @@ function An(e, t) {
|
|
|
1482
1482
|
tagHandlers: Object.create(null),
|
|
1483
1483
|
events: []
|
|
1484
1484
|
}, i = e.indexOf("\0");
|
|
1485
|
-
for (i !== -1 &&
|
|
1485
|
+
for (i !== -1 && _t(e, i, "null byte is not allowed in input", r.filename), r.input.charCodeAt(r.position) === 65279 && r.position++; r.position < r.length && (B(r, !0), !(r.position >= r.length));) {
|
|
1486
1486
|
let e = r.position;
|
|
1487
|
-
|
|
1487
|
+
Pn(r), r.position === e && P(r, "can not read a document");
|
|
1488
1488
|
}
|
|
1489
1489
|
return r.events;
|
|
1490
1490
|
}
|
|
1491
|
-
var
|
|
1492
|
-
...
|
|
1493
|
-
...
|
|
1491
|
+
var In = {
|
|
1492
|
+
...sn,
|
|
1493
|
+
...Pt
|
|
1494
1494
|
};
|
|
1495
|
-
function
|
|
1495
|
+
function Ln(e, t = {}) {
|
|
1496
1496
|
let n = {
|
|
1497
|
-
...
|
|
1497
|
+
...In,
|
|
1498
1498
|
...t
|
|
1499
|
-
}, r = String(e), i = Object.keys(
|
|
1500
|
-
return
|
|
1501
|
-
...
|
|
1499
|
+
}, r = String(e), i = Object.keys(sn), a = Object.keys(Pt);
|
|
1500
|
+
return qt(Fn(r, et(n, i)), {
|
|
1501
|
+
...et(n, a),
|
|
1502
1502
|
source: r
|
|
1503
1503
|
});
|
|
1504
1504
|
}
|
|
1505
|
-
function
|
|
1506
|
-
let n =
|
|
1507
|
-
if (n.length === 0) throw new
|
|
1505
|
+
function Rn(e, t) {
|
|
1506
|
+
let n = Ln(e, t);
|
|
1507
|
+
if (n.length === 0) throw new w("expected a document, but the input is empty");
|
|
1508
1508
|
if (n.length === 1) return n[0];
|
|
1509
|
-
throw new
|
|
1509
|
+
throw new w("expected a single document in the stream, but found more");
|
|
1510
1510
|
}
|
|
1511
|
-
var
|
|
1512
|
-
|
|
1513
|
-
var
|
|
1511
|
+
var W = {};
|
|
1512
|
+
W[0] = "\\0", W[7] = "\\a", W[8] = "\\b", W[9] = "\\t", W[10] = "\\n", W[11] = "\\v", W[12] = "\\f", W[13] = "\\r", W[27] = "\\e", W[34] = "\\\"", W[92] = "\\\\", W[133] = "\\N", W[160] = "\\_", W[8232] = "\\L", W[8233] = "\\P";
|
|
1513
|
+
var zn = {
|
|
1514
1514
|
indent: 2,
|
|
1515
1515
|
seqNoIndent: !1,
|
|
1516
1516
|
seqInlineFirst: !0,
|
|
@@ -1524,47 +1524,47 @@ var Pn = {
|
|
|
1524
1524
|
forceQuotes: !1,
|
|
1525
1525
|
tagBeforeAnchor: !1
|
|
1526
1526
|
};
|
|
1527
|
-
|
|
1528
|
-
...
|
|
1527
|
+
ut.withTags({
|
|
1528
|
+
...Ee,
|
|
1529
1529
|
resolve: (e, t, n) => {
|
|
1530
|
-
let r =
|
|
1531
|
-
return r ===
|
|
1530
|
+
let r = Ee.resolve(e, t, n);
|
|
1531
|
+
return r === g ? _e.resolve(e, t, n) : r;
|
|
1532
1532
|
}
|
|
1533
1533
|
}, {
|
|
1534
|
-
...
|
|
1534
|
+
...Ve,
|
|
1535
1535
|
resolve: (e, t, n) => {
|
|
1536
|
-
let r =
|
|
1537
|
-
return r ===
|
|
1536
|
+
let r = Ve.resolve(e, t, n);
|
|
1537
|
+
return r === g ? je.resolve(e, t, n) : r;
|
|
1538
1538
|
}
|
|
1539
|
-
}), { ...
|
|
1539
|
+
}), { ...zn };
|
|
1540
1540
|
//#endregion
|
|
1541
1541
|
//#region ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
1542
|
-
var
|
|
1542
|
+
var Bn = (() => {
|
|
1543
1543
|
let e = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
1544
1544
|
return (t) => {
|
|
1545
1545
|
let n = 0;
|
|
1546
1546
|
for (e.lastIndex = 0; e.test(t);) n += 1;
|
|
1547
1547
|
return t.length - n;
|
|
1548
1548
|
};
|
|
1549
|
-
})(),
|
|
1549
|
+
})(), Vn = (e) => e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510, Hn = (e) => e === 8987 || e === 9001 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12771 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 19903 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141, Un = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y, Wn = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, Gn = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy, Kn = /\t{1,1000}/y, qn = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy, Jn = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, Yn = /\p{M}+/gu, Xn = {
|
|
1550
1550
|
limit: Infinity,
|
|
1551
1551
|
ellipsis: ""
|
|
1552
|
-
},
|
|
1553
|
-
let r = t.limit ?? Infinity, i = t.ellipsis ?? "", a = t?.ellipsisWidth ?? (i ?
|
|
1554
|
-
[
|
|
1555
|
-
[
|
|
1556
|
-
[
|
|
1557
|
-
[
|
|
1558
|
-
[
|
|
1559
|
-
[
|
|
1552
|
+
}, Zn = (e, t = {}, n = {}) => {
|
|
1553
|
+
let r = t.limit ?? Infinity, i = t.ellipsis ?? "", a = t?.ellipsisWidth ?? (i ? Zn(i, Xn, n).width : 0), o = n.controlWidth ?? 0, s = n.tabWidth ?? 8, c = n.emojiWidth ?? 2, l = n.regularWidth ?? 1, u = n.wideWidth ?? 2, d = [
|
|
1554
|
+
[Jn, l],
|
|
1555
|
+
[Un, 0],
|
|
1556
|
+
[Wn, o],
|
|
1557
|
+
[Kn, s],
|
|
1558
|
+
[qn, c],
|
|
1559
|
+
[Gn, u]
|
|
1560
1560
|
], f = 0, p = 0, m = e.length, h = 0, g = !1, _ = m, v = Math.max(0, r - a), y = 0, b = 0, x = 0, S = 0;
|
|
1561
1561
|
outer: for (;;) {
|
|
1562
1562
|
if (b > y || p >= m && p > f) {
|
|
1563
1563
|
let t = e.slice(y, b) || e.slice(f, p);
|
|
1564
1564
|
h = 0;
|
|
1565
|
-
for (let e of t.replaceAll(
|
|
1565
|
+
for (let e of t.replaceAll(Yn, "")) {
|
|
1566
1566
|
let t = e.codePointAt(0) || 0;
|
|
1567
|
-
if (S =
|
|
1567
|
+
if (S = Vn(t) ? 2 : Hn(t) ? u : l, x + S > v && (_ = Math.min(_, Math.max(y, f) + h)), x + S > r) {
|
|
1568
1568
|
g = !0;
|
|
1569
1569
|
break outer;
|
|
1570
1570
|
}
|
|
@@ -1576,7 +1576,7 @@ var Fn = (() => {
|
|
|
1576
1576
|
for (let t = 0, n = d.length; t < n; t++) {
|
|
1577
1577
|
let [n, i] = d[t];
|
|
1578
1578
|
if (n.lastIndex = p, n.test(e)) {
|
|
1579
|
-
if (h = n ===
|
|
1579
|
+
if (h = n === Gn ? Bn(e.slice(p, n.lastIndex)) : n === qn ? 1 : n.lastIndex - p, S = h * i, x + S > v && (_ = Math.min(_, p + Math.floor((v - x) / i))), x + S > r) {
|
|
1580
1580
|
g = !0;
|
|
1581
1581
|
break outer;
|
|
1582
1582
|
}
|
|
@@ -1592,11 +1592,11 @@ var Fn = (() => {
|
|
|
1592
1592
|
truncated: g,
|
|
1593
1593
|
ellipsed: g && r >= a
|
|
1594
1594
|
};
|
|
1595
|
-
},
|
|
1595
|
+
}, Qn = {
|
|
1596
1596
|
limit: Infinity,
|
|
1597
1597
|
ellipsis: "",
|
|
1598
1598
|
ellipsisWidth: 0
|
|
1599
|
-
},
|
|
1599
|
+
}, G = (e, t = {}) => Zn(e, Qn, t).width, $n = "\x1B", er = "", tr = 39, nr = "\x07", rr = "[", ir = "]", ar = "m", or = `${ir}8;;`, sr = RegExp(`(?:\\${rr}(?<code>\\d+)m|\\${or}(?<uri>.*)${nr})`, "y"), cr = (e) => {
|
|
1600
1600
|
if (e >= 30 && e <= 37 || e >= 90 && e <= 97) return 39;
|
|
1601
1601
|
if (e >= 40 && e <= 47 || e >= 100 && e <= 107) return 49;
|
|
1602
1602
|
if (e === 1 || e === 2) return 22;
|
|
@@ -1606,74 +1606,74 @@ var Fn = (() => {
|
|
|
1606
1606
|
if (e === 8) return 28;
|
|
1607
1607
|
if (e === 9) return 29;
|
|
1608
1608
|
if (e === 0) return 0;
|
|
1609
|
-
},
|
|
1610
|
-
let r = t[Symbol.iterator](), i = !1, a = !1, o = e.at(-1), s = o === void 0 ? 0 :
|
|
1609
|
+
}, lr = (e) => `${$n}${rr}${e}${ar}`, ur = (e) => `${$n}${or}${e}${nr}`, dr = (e, t, n) => {
|
|
1610
|
+
let r = t[Symbol.iterator](), i = !1, a = !1, o = e.at(-1), s = o === void 0 ? 0 : G(o), c = r.next(), l = r.next(), u = 0;
|
|
1611
1611
|
for (; !c.done;) {
|
|
1612
|
-
let o = c.value, d =
|
|
1613
|
-
s + d <= n ? e[e.length - 1] += o : (e.push(o), s = 0), (o ===
|
|
1612
|
+
let o = c.value, d = G(o);
|
|
1613
|
+
s + d <= n ? e[e.length - 1] += o : (e.push(o), s = 0), (o === $n || o === er) && (i = !0, a = t.startsWith(or, u + 1)), i ? a ? o === nr && (i = !1, a = !1) : o === ar && (i = !1) : (s += d, s === n && !l.done && (e.push(""), s = 0)), c = l, l = r.next(), u += o.length;
|
|
1614
1614
|
}
|
|
1615
1615
|
o = e.at(-1), !s && o !== void 0 && o.length && e.length > 1 && (e[e.length - 2] += e.pop());
|
|
1616
|
-
},
|
|
1616
|
+
}, fr = (e) => {
|
|
1617
1617
|
let t = e.split(" "), n = t.length;
|
|
1618
|
-
for (; n && !
|
|
1618
|
+
for (; n && !G(t[n - 1]);) n--;
|
|
1619
1619
|
return n === t.length ? e : t.slice(0, n).join(" ") + t.slice(n).join("");
|
|
1620
|
-
},
|
|
1620
|
+
}, pr = (e, t, n = {}) => {
|
|
1621
1621
|
if (n.trim !== !1 && e.trim() === "") return "";
|
|
1622
1622
|
let r = "", i, a, o = e.split(" "), s = [""], c = 0;
|
|
1623
1623
|
for (let e = 0; e < o.length; e++) {
|
|
1624
1624
|
let r = o[e];
|
|
1625
1625
|
if (n.trim !== !1) {
|
|
1626
1626
|
let e = s.at(-1) ?? "", t = e.trimStart();
|
|
1627
|
-
e.length !== t.length && (s[s.length - 1] = t, c =
|
|
1627
|
+
e.length !== t.length && (s[s.length - 1] = t, c = G(t));
|
|
1628
1628
|
}
|
|
1629
1629
|
e !== 0 && (c >= t && (n.wordWrap === !1 || n.trim === !1) && (s.push(""), c = 0), (c || n.trim === !1) && (s[s.length - 1] += " ", c++));
|
|
1630
|
-
let i =
|
|
1630
|
+
let i = G(r);
|
|
1631
1631
|
if (n.hard && i > t) {
|
|
1632
1632
|
let e = t - c, n = 1 + Math.floor((i - e - 1) / t);
|
|
1633
|
-
Math.floor((i - 1) / t) < n && s.push(""),
|
|
1633
|
+
Math.floor((i - 1) / t) < n && s.push(""), dr(s, r, t), c = G(s.at(-1) ?? "");
|
|
1634
1634
|
continue;
|
|
1635
1635
|
}
|
|
1636
1636
|
if (c + i > t && c && i) {
|
|
1637
1637
|
if (n.wordWrap === !1 && c < t) {
|
|
1638
|
-
|
|
1638
|
+
dr(s, r, t), c = G(s.at(-1) ?? "");
|
|
1639
1639
|
continue;
|
|
1640
1640
|
}
|
|
1641
1641
|
s.push(""), c = 0;
|
|
1642
1642
|
}
|
|
1643
1643
|
if (c + i > t && n.wordWrap === !1) {
|
|
1644
|
-
|
|
1644
|
+
dr(s, r, t), c = G(s.at(-1) ?? "");
|
|
1645
1645
|
continue;
|
|
1646
1646
|
}
|
|
1647
1647
|
s[s.length - 1] += r, c += i;
|
|
1648
1648
|
}
|
|
1649
|
-
n.trim !== !1 && (s = s.map((e) =>
|
|
1649
|
+
n.trim !== !1 && (s = s.map((e) => fr(e)));
|
|
1650
1650
|
let l = s.join("\n"), u = !1;
|
|
1651
1651
|
for (let e = 0; e < l.length; e++) {
|
|
1652
1652
|
let t = l[e];
|
|
1653
1653
|
if (r += t, u) u = !1;
|
|
1654
1654
|
else if (u = t >= "\ud800" && t <= "\udbff", u) continue;
|
|
1655
|
-
if (t ===
|
|
1656
|
-
|
|
1657
|
-
let t =
|
|
1655
|
+
if (t === $n || t === er) {
|
|
1656
|
+
sr.lastIndex = e + 1;
|
|
1657
|
+
let t = sr.exec(l)?.groups;
|
|
1658
1658
|
if (t?.code !== void 0) {
|
|
1659
1659
|
let e = Number.parseFloat(t.code);
|
|
1660
|
-
i = e ===
|
|
1660
|
+
i = e === tr ? void 0 : e;
|
|
1661
1661
|
} else t?.uri !== void 0 && (a = t.uri.length === 0 ? void 0 : t.uri);
|
|
1662
1662
|
}
|
|
1663
1663
|
if (l[e + 1] === "\n") {
|
|
1664
|
-
a && (r +=
|
|
1665
|
-
let e = i ?
|
|
1666
|
-
i && e && (r +=
|
|
1667
|
-
} else t === "\n" && (i &&
|
|
1664
|
+
a && (r += ur(""));
|
|
1665
|
+
let e = i ? cr(i) : void 0;
|
|
1666
|
+
i && e && (r += lr(e));
|
|
1667
|
+
} else t === "\n" && (i && cr(i) && (r += lr(i)), a && (r += ur(a)));
|
|
1668
1668
|
}
|
|
1669
1669
|
return r;
|
|
1670
|
-
},
|
|
1671
|
-
function
|
|
1672
|
-
return String(e).normalize().split(
|
|
1670
|
+
}, mr = /\r?\n/;
|
|
1671
|
+
function hr(e, t, n) {
|
|
1672
|
+
return String(e).normalize().split(mr).map((e) => pr(e, t, n)).join("\n");
|
|
1673
1673
|
}
|
|
1674
1674
|
//#endregion
|
|
1675
1675
|
//#region ../../node_modules/.pnpm/@clack+core@1.4.3/node_modules/@clack/core/dist/index.mjs
|
|
1676
|
-
var
|
|
1676
|
+
var K = (/* @__PURE__ */ t(((e, t) => {
|
|
1677
1677
|
var n = "\x1B", r = `${n}[`, i = "\x07", a = {
|
|
1678
1678
|
to(e, t) {
|
|
1679
1679
|
return t ? `${r}${t + 1};${e + 1}H` : `${r}${e + 1}G`;
|
|
@@ -1716,12 +1716,12 @@ var q = (/* @__PURE__ */ t(((e, t) => {
|
|
|
1716
1716
|
beep: i
|
|
1717
1717
|
};
|
|
1718
1718
|
})))();
|
|
1719
|
-
function
|
|
1719
|
+
function gr(e, t, n) {
|
|
1720
1720
|
if (!n.some((e) => !e.disabled)) return e;
|
|
1721
1721
|
let r = e + t, i = Math.max(n.length - 1, 0), a = r < 0 ? i : r > i ? 0 : r;
|
|
1722
|
-
return n[a]?.disabled ?
|
|
1722
|
+
return n[a]?.disabled ? gr(a, t < 0 ? -1 : 1, n) : a;
|
|
1723
1723
|
}
|
|
1724
|
-
var
|
|
1724
|
+
var q = {
|
|
1725
1725
|
actions: /* @__PURE__ */ new Set([
|
|
1726
1726
|
"up",
|
|
1727
1727
|
"down",
|
|
@@ -1768,12 +1768,12 @@ var J = {
|
|
|
1768
1768
|
}
|
|
1769
1769
|
}
|
|
1770
1770
|
};
|
|
1771
|
-
function
|
|
1772
|
-
if (typeof e == "string") return
|
|
1773
|
-
for (let n of e) if (n !== void 0 &&
|
|
1771
|
+
function _r(e, t) {
|
|
1772
|
+
if (typeof e == "string") return q.aliases.get(e) === t;
|
|
1773
|
+
for (let n of e) if (n !== void 0 && _r(n, t)) return !0;
|
|
1774
1774
|
return !1;
|
|
1775
1775
|
}
|
|
1776
|
-
function
|
|
1776
|
+
function vr(e, t) {
|
|
1777
1777
|
if (e === t) return;
|
|
1778
1778
|
let n = e.split("\n"), r = t.split("\n"), i = Math.max(n.length, r.length), a = [];
|
|
1779
1779
|
for (let e = 0; e < i; e++) n[e] !== r[e] && a.push(e);
|
|
@@ -1785,17 +1785,17 @@ function pr(e, t) {
|
|
|
1785
1785
|
};
|
|
1786
1786
|
}
|
|
1787
1787
|
globalThis.process.platform.startsWith("win");
|
|
1788
|
-
var
|
|
1789
|
-
function
|
|
1790
|
-
return e ===
|
|
1788
|
+
var yr = Symbol("clack:cancel");
|
|
1789
|
+
function br(e) {
|
|
1790
|
+
return e === yr;
|
|
1791
1791
|
}
|
|
1792
|
-
function
|
|
1792
|
+
function xr(e, t) {
|
|
1793
1793
|
let n = e;
|
|
1794
1794
|
n.isTTY && n.setRawMode(t);
|
|
1795
1795
|
}
|
|
1796
|
-
var
|
|
1797
|
-
function
|
|
1798
|
-
return
|
|
1796
|
+
var Sr = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80, Cr = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
|
|
1797
|
+
function wr(e, t, n, r = n, i = n, a) {
|
|
1798
|
+
return hr(t, Sr(e ?? m) - n.length, {
|
|
1799
1799
|
hard: !0,
|
|
1800
1800
|
trim: !1
|
|
1801
1801
|
}).split("\n").map((e, t, o) => {
|
|
@@ -1803,7 +1803,7 @@ function yr(e, t, n, r = n, i = n, a) {
|
|
|
1803
1803
|
return t === 0 ? `${r}${s}` : t === o.length - 1 ? `${i}${s}` : `${n}${s}`;
|
|
1804
1804
|
}).join("\n");
|
|
1805
1805
|
}
|
|
1806
|
-
function
|
|
1806
|
+
function Tr(e, t) {
|
|
1807
1807
|
if ("~standard" in e) {
|
|
1808
1808
|
let n = e["~standard"].validate(t);
|
|
1809
1809
|
if (n instanceof Promise) throw TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");
|
|
@@ -1811,7 +1811,7 @@ function br(e, t) {
|
|
|
1811
1811
|
}
|
|
1812
1812
|
return e(t);
|
|
1813
1813
|
}
|
|
1814
|
-
var
|
|
1814
|
+
var Er = class {
|
|
1815
1815
|
input;
|
|
1816
1816
|
output;
|
|
1817
1817
|
_abortSignal;
|
|
@@ -1827,7 +1827,7 @@ var xr = class {
|
|
|
1827
1827
|
value;
|
|
1828
1828
|
userInput = "";
|
|
1829
1829
|
constructor(e, t = !0) {
|
|
1830
|
-
let { input: n =
|
|
1830
|
+
let { input: n = p, output: r = m, render: i, signal: a, ...o } = e;
|
|
1831
1831
|
this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = a, this.input = n, this.output = r;
|
|
1832
1832
|
}
|
|
1833
1833
|
unsubscribe() {
|
|
@@ -1854,21 +1854,21 @@ var xr = class {
|
|
|
1854
1854
|
prompt() {
|
|
1855
1855
|
return new Promise((e) => {
|
|
1856
1856
|
if (this._abortSignal) {
|
|
1857
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), e(
|
|
1857
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), e(yr);
|
|
1858
1858
|
this._abortSignal.addEventListener("abort", () => {
|
|
1859
1859
|
this.state = "cancel", this.close();
|
|
1860
1860
|
}, { once: !0 });
|
|
1861
1861
|
}
|
|
1862
|
-
this.rl =
|
|
1862
|
+
this.rl = h.createInterface({
|
|
1863
1863
|
input: this.input,
|
|
1864
1864
|
tabSize: 2,
|
|
1865
1865
|
prompt: "",
|
|
1866
1866
|
escapeCodeTimeout: 50,
|
|
1867
1867
|
terminal: !0
|
|
1868
|
-
}), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress),
|
|
1869
|
-
this.output.write(
|
|
1868
|
+
}), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), xr(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
1869
|
+
this.output.write(K.cursor.show), this.output.off("resize", this.render), xr(this.input, !1), e(this.value);
|
|
1870
1870
|
}), this.once("cancel", () => {
|
|
1871
|
-
this.output.write(
|
|
1871
|
+
this.output.write(K.cursor.show), this.output.off("resize", this.render), xr(this.input, !1), e(yr);
|
|
1872
1872
|
});
|
|
1873
1873
|
});
|
|
1874
1874
|
}
|
|
@@ -1894,38 +1894,38 @@ var xr = class {
|
|
|
1894
1894
|
if (this._track && t.name !== "return" && (t.name && this._isActionKey(e, t) && this.rl?.write(null, {
|
|
1895
1895
|
ctrl: !0,
|
|
1896
1896
|
name: "h"
|
|
1897
|
-
}), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), t?.name && (!this._track &&
|
|
1897
|
+
}), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), t?.name && (!this._track && q.aliases.has(t.name) && this.emit("cursor", q.aliases.get(t.name)), q.actions.has(t.name) && this.emit("cursor", t.name)), e && (e.toLowerCase() === "y" || e.toLowerCase() === "n") && this.emit("confirm", e.toLowerCase() === "y"), this.emit("key", e, t), t?.name === "return" && this._shouldSubmit(e, t)) {
|
|
1898
1898
|
if (this.opts.validate) {
|
|
1899
|
-
let e =
|
|
1899
|
+
let e = Tr(this.opts.validate, this.value);
|
|
1900
1900
|
e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
|
|
1901
1901
|
}
|
|
1902
1902
|
this.state !== "error" && (this.state = "submit");
|
|
1903
1903
|
}
|
|
1904
|
-
|
|
1904
|
+
_r([
|
|
1905
1905
|
e,
|
|
1906
1906
|
t?.name,
|
|
1907
1907
|
t?.sequence
|
|
1908
1908
|
], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
1909
1909
|
}
|
|
1910
1910
|
close() {
|
|
1911
|
-
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write("\n"),
|
|
1911
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write("\n"), xr(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
1912
1912
|
}
|
|
1913
1913
|
restoreCursor() {
|
|
1914
|
-
let e =
|
|
1914
|
+
let e = hr(this._prevFrame, process.stdout.columns, {
|
|
1915
1915
|
hard: !0,
|
|
1916
1916
|
trim: !1
|
|
1917
1917
|
}).split("\n").length - 1;
|
|
1918
|
-
this.output.write(
|
|
1918
|
+
this.output.write(K.cursor.move(-999, e * -1));
|
|
1919
1919
|
}
|
|
1920
1920
|
render() {
|
|
1921
|
-
let e =
|
|
1921
|
+
let e = hr(this._render(this) ?? "", process.stdout.columns, {
|
|
1922
1922
|
hard: !0,
|
|
1923
1923
|
trim: !1
|
|
1924
1924
|
});
|
|
1925
1925
|
if (e !== this._prevFrame) {
|
|
1926
|
-
if (this.state === "initial") this.output.write(
|
|
1926
|
+
if (this.state === "initial") this.output.write(K.cursor.hide);
|
|
1927
1927
|
else {
|
|
1928
|
-
let t =
|
|
1928
|
+
let t = vr(this._prevFrame, e), n = Cr(this.output);
|
|
1929
1929
|
if (this.restoreCursor(), t) {
|
|
1930
1930
|
let r = Math.max(0, t.numLinesAfter - n), i = Math.max(0, t.numLinesBefore - n), a = t.lines.find((e) => e >= r);
|
|
1931
1931
|
if (a === void 0) {
|
|
@@ -1933,28 +1933,28 @@ var xr = class {
|
|
|
1933
1933
|
return;
|
|
1934
1934
|
}
|
|
1935
1935
|
if (t.lines.length === 1) {
|
|
1936
|
-
this.output.write(
|
|
1936
|
+
this.output.write(K.cursor.move(0, a - i)), this.output.write(K.erase.lines(1));
|
|
1937
1937
|
let t = e.split("\n");
|
|
1938
|
-
this.output.write(t[a]), this._prevFrame = e, this.output.write(
|
|
1938
|
+
this.output.write(t[a]), this._prevFrame = e, this.output.write(K.cursor.move(0, t.length - a - 1));
|
|
1939
1939
|
return;
|
|
1940
1940
|
} else if (t.lines.length > 1) {
|
|
1941
1941
|
if (r < i) a = r;
|
|
1942
1942
|
else {
|
|
1943
1943
|
let e = a - i;
|
|
1944
|
-
e > 0 && this.output.write(
|
|
1944
|
+
e > 0 && this.output.write(K.cursor.move(0, e));
|
|
1945
1945
|
}
|
|
1946
|
-
this.output.write(
|
|
1946
|
+
this.output.write(K.erase.down());
|
|
1947
1947
|
let t = e.split("\n").slice(a);
|
|
1948
1948
|
this.output.write(t.join("\n")), this._prevFrame = e;
|
|
1949
1949
|
return;
|
|
1950
1950
|
}
|
|
1951
1951
|
}
|
|
1952
|
-
this.output.write(
|
|
1952
|
+
this.output.write(K.erase.down());
|
|
1953
1953
|
}
|
|
1954
1954
|
this.output.write(e), this.state === "initial" && (this.state = "active"), this._prevFrame = e;
|
|
1955
1955
|
}
|
|
1956
1956
|
}
|
|
1957
|
-
},
|
|
1957
|
+
}, Dr = class extends Er {
|
|
1958
1958
|
options;
|
|
1959
1959
|
cursor = 0;
|
|
1960
1960
|
get _selectedValue() {
|
|
@@ -1967,27 +1967,27 @@ var xr = class {
|
|
|
1967
1967
|
constructor(e) {
|
|
1968
1968
|
super(e, !1), this.options = e.options;
|
|
1969
1969
|
let t = this.options.findIndex(({ value: t }) => t === e.initialValue), n = t === -1 ? 0 : t;
|
|
1970
|
-
this.cursor = this.options[n]?.disabled ?
|
|
1970
|
+
this.cursor = this.options[n]?.disabled ? gr(n, 1, this.options) : n, this.changeValue(), this.on("cursor", (e) => {
|
|
1971
1971
|
switch (e) {
|
|
1972
1972
|
case "left":
|
|
1973
1973
|
case "up":
|
|
1974
|
-
this.cursor =
|
|
1974
|
+
this.cursor = gr(this.cursor, -1, this.options);
|
|
1975
1975
|
break;
|
|
1976
1976
|
case "down":
|
|
1977
1977
|
case "right":
|
|
1978
|
-
this.cursor =
|
|
1978
|
+
this.cursor = gr(this.cursor, 1, this.options);
|
|
1979
1979
|
break;
|
|
1980
1980
|
}
|
|
1981
1981
|
this.changeValue();
|
|
1982
1982
|
});
|
|
1983
1983
|
}
|
|
1984
|
-
},
|
|
1984
|
+
}, Or = class extends Er {
|
|
1985
1985
|
get userInputWithCursor() {
|
|
1986
1986
|
if (this.state === "submit") return this.userInput;
|
|
1987
1987
|
let e = this.userInput;
|
|
1988
1988
|
if (this.cursor >= e.length) return `${this.userInput}\u2588`;
|
|
1989
1989
|
let t = e.slice(0, this.cursor), n = e.slice(this.cursor, this.cursor + 1), r = e.slice(this.cursor + 1);
|
|
1990
|
-
return `${t}${
|
|
1990
|
+
return `${t}${d("inverse", n)}${r}`;
|
|
1991
1991
|
}
|
|
1992
1992
|
get cursor() {
|
|
1993
1993
|
return this._cursor;
|
|
@@ -2005,31 +2005,31 @@ var xr = class {
|
|
|
2005
2005
|
};
|
|
2006
2006
|
//#endregion
|
|
2007
2007
|
//#region ../../node_modules/.pnpm/@clack+prompts@1.7.0/node_modules/@clack/prompts/dist/index.mjs
|
|
2008
|
-
function
|
|
2009
|
-
return
|
|
2008
|
+
function kr() {
|
|
2009
|
+
return f.platform === "win32" ? !!f.env.CI || !!f.env.WT_SESSION || !!f.env.TERMINUS_SUBLIME || f.env.ConEmuTask === "{cmd::Cmder}" || f.env.TERM_PROGRAM === "Terminus-Sublime" || f.env.TERM_PROGRAM === "vscode" || f.env.TERM === "xterm-256color" || f.env.TERM === "alacritty" || f.env.TERMINAL_EMULATOR === "JetBrains-JediTerm" : f.env.TERM !== "linux";
|
|
2010
2010
|
}
|
|
2011
|
-
var
|
|
2011
|
+
var Ar = kr(), J = (e, t) => Ar ? e : t, jr = J("◆", "*"), Mr = J("■", "x"), Nr = J("▲", "x"), Pr = J("◇", "o"), Fr = J("┌", "T"), Y = J("│", "|"), X = J("└", "—"), Ir = J("●", ">"), Lr = J("○", " "), Rr = J("●", "•"), zr = J("◆", "*"), Br = J("▲", "!"), Vr = J("■", "x"), Hr = (e) => {
|
|
2012
2012
|
switch (e) {
|
|
2013
2013
|
case "initial":
|
|
2014
|
-
case "active": return
|
|
2015
|
-
case "cancel": return
|
|
2016
|
-
case "error": return
|
|
2017
|
-
case "submit": return
|
|
2014
|
+
case "active": return d("cyan", jr);
|
|
2015
|
+
case "cancel": return d("red", Mr);
|
|
2016
|
+
case "error": return d("yellow", Nr);
|
|
2017
|
+
case "submit": return d("green", Pr);
|
|
2018
2018
|
}
|
|
2019
|
-
},
|
|
2019
|
+
}, Ur = (e) => {
|
|
2020
2020
|
switch (e) {
|
|
2021
2021
|
case "initial":
|
|
2022
|
-
case "active": return
|
|
2023
|
-
case "cancel": return
|
|
2024
|
-
case "error": return
|
|
2025
|
-
case "submit": return
|
|
2022
|
+
case "active": return d("cyan", Y);
|
|
2023
|
+
case "cancel": return d("red", Y);
|
|
2024
|
+
case "error": return d("yellow", Y);
|
|
2025
|
+
case "submit": return d("green", Y);
|
|
2026
2026
|
}
|
|
2027
2027
|
};
|
|
2028
|
-
function
|
|
2029
|
-
let n = [`${t ? `${
|
|
2030
|
-
return t && n.push(
|
|
2028
|
+
function Wr(e, t) {
|
|
2029
|
+
let n = [`${t ? `${d("cyan", Y)} ` : ""}${e.join(" • ")}`];
|
|
2030
|
+
return t && n.push(d("cyan", X)), n;
|
|
2031
2031
|
}
|
|
2032
|
-
var
|
|
2032
|
+
var Gr = (e, t, n, r, i, a = !1) => {
|
|
2033
2033
|
let o = t, s = 0;
|
|
2034
2034
|
if (a) for (let t = r - 1; t >= n; t--) {
|
|
2035
2035
|
let n = e[t];
|
|
@@ -2043,143 +2043,143 @@ var Br = (e, t, n, r, i, a = !1) => {
|
|
|
2043
2043
|
lineCount: o,
|
|
2044
2044
|
removals: s
|
|
2045
2045
|
};
|
|
2046
|
-
},
|
|
2047
|
-
let
|
|
2046
|
+
}, Kr = ({ cursor: e, options: t, style: n, output: r = process.stdout, maxItems: i = Infinity, columnPadding: a = 0, rowPadding: o = 4 }) => {
|
|
2047
|
+
let s = Sr(r) - a, c = Cr(r), l = d("dim", "..."), u = Math.max(c - o, 0), f = Math.max(Math.min(i, u), 5), p = 0;
|
|
2048
2048
|
e >= f - 3 && (p = Math.max(Math.min(e - f + 3, t.length - f), 0));
|
|
2049
2049
|
let m = f < t.length && p > 0, h = f < t.length && p + f < t.length, g = Math.min(p + f, t.length), _ = [], v = 0;
|
|
2050
2050
|
m && v++, h && v++;
|
|
2051
2051
|
let y = p + +!!m, b = g - +!!h;
|
|
2052
2052
|
for (let r = y; r < b; r++) {
|
|
2053
|
-
let i = t[r], a =
|
|
2053
|
+
let i = t[r], a = hr(i ? n(i, r === e) : "", s, {
|
|
2054
2054
|
hard: !0,
|
|
2055
2055
|
trim: !1
|
|
2056
2056
|
}).split("\n");
|
|
2057
2057
|
_.push(a), v += a.length;
|
|
2058
2058
|
}
|
|
2059
|
-
if (v >
|
|
2060
|
-
let t = 0, n = 0, r = v, i = e - y, a =
|
|
2059
|
+
if (v > u) {
|
|
2060
|
+
let t = 0, n = 0, r = v, i = e - y, a = u, o = () => Gr(_, r, 0, i, a), s = () => Gr(_, r, i + 1, _.length, a, !0);
|
|
2061
2061
|
m ? ({lineCount: r, removals: t} = o(), r > a && (h || --a, {lineCount: r, removals: n} = s())) : (h || --a, {lineCount: r, removals: n} = s(), r > a && (--a, {lineCount: r, removals: t} = o())), t > 0 && (m = !0, _.splice(0, t)), n > 0 && (h = !0, _.splice(_.length - n, n));
|
|
2062
2062
|
}
|
|
2063
2063
|
let x = [];
|
|
2064
|
-
m && x.push(
|
|
2064
|
+
m && x.push(l);
|
|
2065
2065
|
for (let e of _) for (let t of e) x.push(t);
|
|
2066
|
-
return h && x.push(
|
|
2066
|
+
return h && x.push(l), x;
|
|
2067
2067
|
};
|
|
2068
|
-
`${
|
|
2069
|
-
var
|
|
2070
|
-
message: (e = [], { symbol: t =
|
|
2071
|
-
let o = [],
|
|
2072
|
-
for (let e = 0; e < i; e++) o.push(
|
|
2068
|
+
`${d("dim", "↑/↓")}`, `${d("dim", "Space:")}`, `${d("dim", "Enter:")}`;
|
|
2069
|
+
var Z = {
|
|
2070
|
+
message: (e = [], { symbol: t = d("gray", Y), secondarySymbol: n = d("gray", Y), output: r = process.stdout, spacing: i = 1, withGuide: a } = {}) => {
|
|
2071
|
+
let o = [], s = a ?? q.withGuide, c = s ? n : "", l = s ? `${t} ` : "", u = s ? `${n} ` : "";
|
|
2072
|
+
for (let e = 0; e < i; e++) o.push(c);
|
|
2073
2073
|
let f = Array.isArray(e) ? e : e.split("\n");
|
|
2074
2074
|
if (f.length > 0) {
|
|
2075
2075
|
let [e, ...r] = f;
|
|
2076
|
-
e.length > 0 ? o.push(`${
|
|
2077
|
-
for (let e of r) e.length > 0 ? o.push(`${
|
|
2076
|
+
e.length > 0 ? o.push(`${l}${e}`) : o.push(s ? t : "");
|
|
2077
|
+
for (let e of r) e.length > 0 ? o.push(`${u}${e}`) : o.push(s ? n : "");
|
|
2078
2078
|
}
|
|
2079
2079
|
r.write(`${o.join("\n")}
|
|
2080
2080
|
`);
|
|
2081
2081
|
},
|
|
2082
2082
|
info: (e, t) => {
|
|
2083
|
-
|
|
2083
|
+
Z.message(e, {
|
|
2084
2084
|
...t,
|
|
2085
|
-
symbol:
|
|
2085
|
+
symbol: d("blue", Rr)
|
|
2086
2086
|
});
|
|
2087
2087
|
},
|
|
2088
2088
|
success: (e, t) => {
|
|
2089
|
-
|
|
2089
|
+
Z.message(e, {
|
|
2090
2090
|
...t,
|
|
2091
|
-
symbol:
|
|
2091
|
+
symbol: d("green", zr)
|
|
2092
2092
|
});
|
|
2093
2093
|
},
|
|
2094
2094
|
step: (e, t) => {
|
|
2095
|
-
|
|
2095
|
+
Z.message(e, {
|
|
2096
2096
|
...t,
|
|
2097
|
-
symbol:
|
|
2097
|
+
symbol: d("green", Pr)
|
|
2098
2098
|
});
|
|
2099
2099
|
},
|
|
2100
2100
|
warn: (e, t) => {
|
|
2101
|
-
|
|
2101
|
+
Z.message(e, {
|
|
2102
2102
|
...t,
|
|
2103
|
-
symbol:
|
|
2103
|
+
symbol: d("yellow", Br)
|
|
2104
2104
|
});
|
|
2105
2105
|
},
|
|
2106
2106
|
warning: (e, t) => {
|
|
2107
|
-
|
|
2107
|
+
Z.warn(e, t);
|
|
2108
2108
|
},
|
|
2109
2109
|
error: (e, t) => {
|
|
2110
|
-
|
|
2110
|
+
Z.message(e, {
|
|
2111
2111
|
...t,
|
|
2112
|
-
symbol:
|
|
2112
|
+
symbol: d("red", Vr)
|
|
2113
2113
|
});
|
|
2114
2114
|
}
|
|
2115
|
-
},
|
|
2116
|
-
let n = t?.output ?? process.stdout, r = t?.withGuide ??
|
|
2117
|
-
n.write(`${r}${
|
|
2115
|
+
}, qr = (e = "", t) => {
|
|
2116
|
+
let n = t?.output ?? process.stdout, r = t?.withGuide ?? q.withGuide ? `${d("gray", X)} ` : "";
|
|
2117
|
+
n.write(`${r}${d("red", e)}
|
|
2118
2118
|
|
|
2119
2119
|
`);
|
|
2120
|
-
},
|
|
2121
|
-
let n = t?.output ?? process.stdout, r = t?.withGuide ??
|
|
2120
|
+
}, Jr = (e = "", t) => {
|
|
2121
|
+
let n = t?.output ?? process.stdout, r = t?.withGuide ?? q.withGuide ? `${d("gray", Fr)} ` : "";
|
|
2122
2122
|
n.write(`${r}${e}
|
|
2123
2123
|
`);
|
|
2124
|
-
},
|
|
2125
|
-
let n = t?.output ?? process.stdout, r = t?.withGuide ??
|
|
2126
|
-
${
|
|
2124
|
+
}, Yr = (e = "", t) => {
|
|
2125
|
+
let n = t?.output ?? process.stdout, r = t?.withGuide ?? q.withGuide ? `${d("gray", Y)}
|
|
2126
|
+
${d("gray", X)} ` : "";
|
|
2127
2127
|
n.write(`${r}${e}
|
|
2128
2128
|
|
|
2129
2129
|
`);
|
|
2130
|
-
},
|
|
2130
|
+
}, Xr = [`${d("dim", "↑/↓")} to navigate`, `${d("dim", "Enter:")} confirm`], Q = (e, t) => e.includes("\n") ? e.split("\n").map((e) => t(e)).join("\n") : t(e), Zr = (e) => {
|
|
2131
2131
|
let t = (e, t) => {
|
|
2132
2132
|
if (e === void 0) return "";
|
|
2133
2133
|
let n = e.label ?? String(e.value);
|
|
2134
2134
|
switch (t) {
|
|
2135
|
-
case "disabled": return `${
|
|
2136
|
-
case "selected": return `${
|
|
2137
|
-
case "active": return `${
|
|
2138
|
-
case "cancelled": return `${
|
|
2139
|
-
default: return `${
|
|
2135
|
+
case "disabled": return `${d("gray", Lr)} ${Q(n, (e) => d("gray", e))}${e.hint ? ` ${d("dim", `(${e.hint ?? "disabled"})`)}` : ""}`;
|
|
2136
|
+
case "selected": return `${Q(n, (e) => d("dim", e))}`;
|
|
2137
|
+
case "active": return `${d("green", Ir)} ${n}${e.hint ? ` ${d("dim", `(${e.hint})`)}` : ""}`;
|
|
2138
|
+
case "cancelled": return `${Q(n, (e) => d(["strikethrough", "dim"], e))}`;
|
|
2139
|
+
default: return `${d("dim", Lr)} ${Q(n, (e) => d("dim", e))}`;
|
|
2140
2140
|
}
|
|
2141
2141
|
}, n = e.showInstructions ?? !0;
|
|
2142
|
-
return new
|
|
2142
|
+
return new Dr({
|
|
2143
2143
|
options: e.options,
|
|
2144
2144
|
signal: e.signal,
|
|
2145
2145
|
input: e.input,
|
|
2146
2146
|
output: e.output,
|
|
2147
2147
|
initialValue: e.initialValue,
|
|
2148
2148
|
render() {
|
|
2149
|
-
let r = e.withGuide ??
|
|
2149
|
+
let r = e.withGuide ?? q.withGuide, i = `${Hr(this.state)} `, a = `${Ur(this.state)} `, o = wr(e.output, e.message, a, i), s = `${r ? `${d("gray", Y)}
|
|
2150
2150
|
` : ""}${o}
|
|
2151
2151
|
`;
|
|
2152
2152
|
switch (this.state) {
|
|
2153
2153
|
case "submit": {
|
|
2154
|
-
let n = r ? `${
|
|
2155
|
-
return `${
|
|
2154
|
+
let n = r ? `${d("gray", Y)} ` : "";
|
|
2155
|
+
return `${s}${wr(e.output, t(this.options[this.cursor], "selected"), n)}`;
|
|
2156
2156
|
}
|
|
2157
2157
|
case "cancel": {
|
|
2158
|
-
let n = r ? `${
|
|
2159
|
-
return `${
|
|
2160
|
-
${
|
|
2158
|
+
let n = r ? `${d("gray", Y)} ` : "";
|
|
2159
|
+
return `${s}${wr(e.output, t(this.options[this.cursor], "cancelled"), n)}${r ? `
|
|
2160
|
+
${d("gray", Y)}` : ""}`;
|
|
2161
2161
|
}
|
|
2162
2162
|
default: {
|
|
2163
|
-
let i = r ? `${
|
|
2164
|
-
return `${
|
|
2163
|
+
let i = r ? `${d("cyan", Y)} ` : "", a = s.split("\n").length, o = n ? Wr(Xr, r) : r ? [d("cyan", X)] : [], c = o.join("\n"), l = o.length + 1;
|
|
2164
|
+
return `${s}${i}${Kr({
|
|
2165
2165
|
output: e.output,
|
|
2166
2166
|
cursor: this.cursor,
|
|
2167
2167
|
options: this.options,
|
|
2168
2168
|
maxItems: e.maxItems,
|
|
2169
2169
|
columnPadding: i.length,
|
|
2170
|
-
rowPadding: a +
|
|
2170
|
+
rowPadding: a + l,
|
|
2171
2171
|
style: (e, n) => t(e, e.disabled ? "disabled" : n ? "active" : "inactive")
|
|
2172
2172
|
}).join(`
|
|
2173
2173
|
${i}`)}
|
|
2174
|
-
${
|
|
2174
|
+
${c}
|
|
2175
2175
|
`;
|
|
2176
2176
|
}
|
|
2177
2177
|
}
|
|
2178
2178
|
}
|
|
2179
2179
|
}).prompt();
|
|
2180
2180
|
};
|
|
2181
|
-
`${
|
|
2182
|
-
var
|
|
2181
|
+
`${d("gray", Y)}`;
|
|
2182
|
+
var Qr = (e) => new Or({
|
|
2183
2183
|
validate: e.validate,
|
|
2184
2184
|
placeholder: e.placeholder,
|
|
2185
2185
|
defaultValue: e.defaultValue,
|
|
@@ -2188,51 +2188,51 @@ var Jr = (e) => new Cr({
|
|
|
2188
2188
|
signal: e.signal,
|
|
2189
2189
|
input: e.input,
|
|
2190
2190
|
render() {
|
|
2191
|
-
let t = e?.withGuide ??
|
|
2192
|
-
` : ""}${
|
|
2193
|
-
`, r = e.placeholder && e.placeholder.length > 0 ?
|
|
2191
|
+
let t = e?.withGuide ?? q.withGuide, n = `${`${t ? `${d("gray", Y)}
|
|
2192
|
+
` : ""}${Hr(this.state)} `}${e.message}
|
|
2193
|
+
`, r = e.placeholder && e.placeholder.length > 0 ? d("inverse", e.placeholder[0]) + d("dim", e.placeholder.slice(1)) : d(["inverse", "hidden"], "_"), i = this.userInput ? this.userInputWithCursor : r, a = this.value ?? "";
|
|
2194
2194
|
switch (this.state) {
|
|
2195
2195
|
case "error": {
|
|
2196
|
-
let e = this.error ? ` ${
|
|
2196
|
+
let e = this.error ? ` ${d("yellow", this.error)}` : "", r = t ? `${d("yellow", Y)} ` : "", a = t ? d("yellow", X) : "";
|
|
2197
2197
|
return `${n.trim()}
|
|
2198
2198
|
${r}${i}
|
|
2199
2199
|
${a}${e}
|
|
2200
2200
|
`;
|
|
2201
2201
|
}
|
|
2202
2202
|
case "submit": {
|
|
2203
|
-
let e = a ? ` ${
|
|
2204
|
-
return `${n}${t ?
|
|
2203
|
+
let e = a ? ` ${d("dim", a)}` : "";
|
|
2204
|
+
return `${n}${t ? d("gray", Y) : ""}${e}`;
|
|
2205
2205
|
}
|
|
2206
2206
|
case "cancel": {
|
|
2207
|
-
let e = a ? ` ${
|
|
2207
|
+
let e = a ? ` ${d(["strikethrough", "dim"], a)}` : "", r = t ? d("gray", Y) : "";
|
|
2208
2208
|
return `${n}${r}${e}${a.trim() ? `
|
|
2209
2209
|
${r}` : ""}`;
|
|
2210
2210
|
}
|
|
2211
|
-
default: return `${n}${t ? `${
|
|
2212
|
-
${t ?
|
|
2211
|
+
default: return `${n}${t ? `${d("cyan", Y)} ` : ""}${i}
|
|
2212
|
+
${t ? d("cyan", X) : ""}
|
|
2213
2213
|
`;
|
|
2214
2214
|
}
|
|
2215
2215
|
}
|
|
2216
2216
|
}).prompt();
|
|
2217
2217
|
//#endregion
|
|
2218
2218
|
//#region src/node/cli/init.ts
|
|
2219
|
-
async function
|
|
2220
|
-
await
|
|
2221
|
-
}
|
|
2222
|
-
async function
|
|
2223
|
-
|
|
2224
|
-
let t = await
|
|
2225
|
-
t.hasTypedownYaml && await
|
|
2226
|
-
let n = await
|
|
2219
|
+
async function $r(e) {
|
|
2220
|
+
await fi(e, await ei(e)), ui(e);
|
|
2221
|
+
}
|
|
2222
|
+
async function ei(e) {
|
|
2223
|
+
Jr("typedown");
|
|
2224
|
+
let t = await ni(e);
|
|
2225
|
+
t.hasTypedownYaml && await ti();
|
|
2226
|
+
let n = await di("Project name", t.packageName ?? l.basename(e));
|
|
2227
2227
|
return {
|
|
2228
2228
|
projectName: n,
|
|
2229
|
-
siteTitle: await
|
|
2230
|
-
siteDescription: await
|
|
2229
|
+
siteTitle: await di("Site title", t.siteTitle ?? n),
|
|
2230
|
+
siteDescription: await di("Site description", t.siteDescription ?? "A typedown site")
|
|
2231
2231
|
};
|
|
2232
2232
|
}
|
|
2233
|
-
async function
|
|
2234
|
-
|
|
2235
|
-
let e = await
|
|
2233
|
+
async function ti() {
|
|
2234
|
+
Z.warn("typedown.yaml already exists in this directory");
|
|
2235
|
+
let e = await Zr({
|
|
2236
2236
|
message: "What would you like to do?",
|
|
2237
2237
|
options: [{
|
|
2238
2238
|
value: "scaffold",
|
|
@@ -2242,53 +2242,57 @@ async function Zr() {
|
|
|
2242
2242
|
label: "Cancel"
|
|
2243
2243
|
}]
|
|
2244
2244
|
});
|
|
2245
|
-
(
|
|
2245
|
+
(br(e) || e === "cancel") && (qr("Cancelled."), process.exit(0));
|
|
2246
2246
|
}
|
|
2247
|
-
async function
|
|
2248
|
-
let
|
|
2247
|
+
async function ni(e) {
|
|
2248
|
+
let t = {
|
|
2249
2249
|
hasPackageJson: !1,
|
|
2250
2250
|
hasTypedownYaml: !1,
|
|
2251
2251
|
packageName: void 0,
|
|
2252
2252
|
siteTitle: void 0,
|
|
2253
2253
|
siteDescription: void 0
|
|
2254
|
-
}, r =
|
|
2254
|
+
}, r = l.join(e, "package.json");
|
|
2255
2255
|
try {
|
|
2256
|
-
let e = await
|
|
2257
|
-
|
|
2256
|
+
let e = await u.readFile(r, "utf-8"), n = JSON.parse(e);
|
|
2257
|
+
t.hasPackageJson = !0, typeof n.name == "string" && 0 < n.name.length && (t.packageName = n.name);
|
|
2258
2258
|
} catch {}
|
|
2259
|
-
for (let r of
|
|
2260
|
-
let
|
|
2261
|
-
|
|
2262
|
-
let i =
|
|
2263
|
-
typeof i?.title == "string" && (
|
|
2259
|
+
for (let r of n) try {
|
|
2260
|
+
let n = Rn(await u.readFile(l.join(e, r), "utf-8"));
|
|
2261
|
+
t.hasTypedownYaml = !0;
|
|
2262
|
+
let i = n?.site;
|
|
2263
|
+
typeof i?.title == "string" && (t.siteTitle = i.title), typeof i?.description == "string" && (t.siteDescription = i.description);
|
|
2264
2264
|
break;
|
|
2265
2265
|
} catch {}
|
|
2266
|
-
return
|
|
2266
|
+
return t;
|
|
2267
2267
|
}
|
|
2268
|
-
function
|
|
2268
|
+
function ri() {
|
|
2269
|
+
return `<svg fill="none" viewBox="${i}" xmlns="http://www.w3.org/2000/svg">
|
|
2270
|
+
<path clip-rule="evenodd" d="${o}" fill-rule="evenodd" fill="${s}"/>
|
|
2271
|
+
<path d="${a}" fill="${s}"/>
|
|
2272
|
+
<path d="${c}" fill="${s}"/>
|
|
2273
|
+
</svg>
|
|
2274
|
+
`;
|
|
2275
|
+
}
|
|
2276
|
+
function ii(t) {
|
|
2269
2277
|
return `<!doctype html>
|
|
2270
2278
|
<html lang="en">
|
|
2271
2279
|
<head>
|
|
2272
2280
|
<meta charset="UTF-8" />
|
|
2273
2281
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
2274
|
-
<title>${
|
|
2275
|
-
<link
|
|
2276
|
-
rel="icon"
|
|
2277
|
-
type="image/svg+xml"
|
|
2278
|
-
href="${i}"
|
|
2279
|
-
>
|
|
2282
|
+
<title>${e(t.siteTitle)}</title>
|
|
2283
|
+
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
|
2280
2284
|
</head>
|
|
2281
2285
|
<body>
|
|
2282
2286
|
<div id="app"></div>
|
|
2283
2287
|
<script
|
|
2284
2288
|
type="module"
|
|
2285
|
-
src="/${
|
|
2289
|
+
src="/${r}"
|
|
2286
2290
|
><\/script>
|
|
2287
2291
|
</body>
|
|
2288
2292
|
</html>
|
|
2289
2293
|
`;
|
|
2290
2294
|
}
|
|
2291
|
-
function
|
|
2295
|
+
function ai(e) {
|
|
2292
2296
|
return JSON.stringify({
|
|
2293
2297
|
name: e.projectName,
|
|
2294
2298
|
version: "0.0.0",
|
|
@@ -2299,16 +2303,19 @@ function ei(e) {
|
|
|
2299
2303
|
build: "typerighter build",
|
|
2300
2304
|
preview: "typerighter preview"
|
|
2301
2305
|
},
|
|
2302
|
-
devDependencies: { typerighter: "^0.
|
|
2306
|
+
devDependencies: { typerighter: "^0.9.0" }
|
|
2303
2307
|
}, void 0, 2) + "\n";
|
|
2304
2308
|
}
|
|
2305
|
-
function
|
|
2309
|
+
function oi() {
|
|
2310
|
+
return "User-agent: *\nAllow: /\n\nSitemap: /sitemap.xml\n";
|
|
2311
|
+
}
|
|
2312
|
+
function si() {
|
|
2306
2313
|
return "---\n_type: Article\ntitle: \"Hello, world\"\n---\n\nWelcome to your new typedown site.\n";
|
|
2307
2314
|
}
|
|
2308
|
-
function
|
|
2315
|
+
function ci() {
|
|
2309
2316
|
return "---\n_type: schema\nproperties:\n title:\n type: string\n tags:\n type: list[string]\n optional: true\n---\n";
|
|
2310
2317
|
}
|
|
2311
|
-
function
|
|
2318
|
+
function li(e) {
|
|
2312
2319
|
return `version: "1.0.0"
|
|
2313
2320
|
vault:
|
|
2314
2321
|
content_dir: vault/content
|
|
@@ -2318,40 +2325,43 @@ site:
|
|
|
2318
2325
|
description: "${e.siteDescription}"
|
|
2319
2326
|
`;
|
|
2320
2327
|
}
|
|
2321
|
-
function
|
|
2328
|
+
function ui(e) {
|
|
2322
2329
|
let t = ["Done scaffolding."];
|
|
2323
|
-
e !== "." && t.push(`cd ${e}`), t.push("pnpm install"), t.push("pnpm dev"),
|
|
2330
|
+
e !== "." && t.push(`cd ${e}`), t.push("pnpm install"), t.push("pnpm dev"), Yr(t.join("\n"));
|
|
2324
2331
|
}
|
|
2325
|
-
async function
|
|
2326
|
-
let n = await
|
|
2332
|
+
async function di(e, t) {
|
|
2333
|
+
let n = await Qr({
|
|
2327
2334
|
message: e,
|
|
2328
2335
|
placeholder: t,
|
|
2329
2336
|
defaultValue: t
|
|
2330
2337
|
});
|
|
2331
|
-
return
|
|
2338
|
+
return br(n) && (qr("Cancelled."), process.exit(0)), n;
|
|
2332
2339
|
}
|
|
2333
|
-
async function
|
|
2334
|
-
let n =
|
|
2340
|
+
async function fi(e, t) {
|
|
2341
|
+
let n = l.join(e, "vault", "content"), r = l.join(e, "vault", "schemas"), i = l.join(e, "public"), a = l.join(e, ".typedown", ".local");
|
|
2335
2342
|
await Promise.all([
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2343
|
+
u.mkdir(n, { recursive: !0 }),
|
|
2344
|
+
u.mkdir(r, { recursive: !0 }),
|
|
2345
|
+
u.mkdir(i, { recursive: !0 }),
|
|
2346
|
+
u.mkdir(a, { recursive: !0 })
|
|
2347
|
+
]), await $(a, ".gitignore", "*\n", { silent: !0 }), await Promise.all([
|
|
2340
2348
|
$(e, ".gitignore", "node_modules/\ndist/\n", { silent: !0 }),
|
|
2341
|
-
$(e, "package.json",
|
|
2342
|
-
$(e, "typedown.yaml",
|
|
2343
|
-
$(e, "index.html",
|
|
2349
|
+
$(e, "package.json", ai(t)),
|
|
2350
|
+
$(e, "typedown.yaml", li(t)),
|
|
2351
|
+
$(e, "index.html", ii(t)),
|
|
2352
|
+
$(i, "favicon.svg", ri(), { silent: !0 }),
|
|
2353
|
+
$(i, "robots.txt", oi(), { silent: !0 })
|
|
2344
2354
|
]);
|
|
2345
|
-
let
|
|
2346
|
-
0 <
|
|
2355
|
+
let o = await Promise.all([$(r, "Article.td", ci(), { silent: !0 }), $(n, "hello.td", si(), { silent: !0 })]), s = o.filter(Boolean), c = o.filter((e) => !e);
|
|
2356
|
+
0 < s.length && Z.success(`created sample schema and content (${s.length} files)`), 0 < c.length && Z.warn(`skipped ${c.length} sample files (already exist)`);
|
|
2347
2357
|
}
|
|
2348
2358
|
async function $(e, t, n, r = {}) {
|
|
2349
|
-
let i =
|
|
2359
|
+
let i = l.join(e, t);
|
|
2350
2360
|
try {
|
|
2351
|
-
return await
|
|
2361
|
+
return await u.access(i), r.silent || Z.warn(`skip ${t} (already exists)`), !1;
|
|
2352
2362
|
} catch {
|
|
2353
|
-
return await
|
|
2363
|
+
return await u.writeFile(i, n), r.silent || Z.success(`created ${t}`), !0;
|
|
2354
2364
|
}
|
|
2355
2365
|
}
|
|
2356
2366
|
//#endregion
|
|
2357
|
-
export {
|
|
2367
|
+
export { $r as initialize };
|