eddyter 1.3.59 → 1.3.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/ai/aiAgentService.d.ts +44 -0
- package/dist/api/ai/index.d.ts +12 -12
- package/dist/assets/index.css +1 -0
- package/dist/babel-19rkKi7e.js +7157 -0
- package/dist/components/FileUpload/InsertFileDialog.d.ts +0 -1
- package/dist/components/LinkPreviewHover/index.d.ts +0 -1
- package/dist/components/ScopedEditor.d.ts +0 -1
- package/dist/components/TextEnhanceDialog/index.d.ts +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +3 -3
- package/dist/components/ui/skeleton.d.ts +0 -1
- package/dist/context/ToolbarContext.d.ts +6 -2
- package/dist/editorConfig.d.ts +1 -0
- package/dist/estree-DmlwiAu4.js +4453 -0
- package/dist/hooks/useModal.d.ts +0 -1
- package/dist/{html-3f297a3a.js → html-DtcgJGeD.js} +1097 -1358
- package/dist/html2pdf.bundle-BP8K5ERw.js +32961 -0
- package/dist/html2pdf.bundle.min-BrDn1HSi.js +20244 -0
- package/dist/{index-25fd6b76.js → index-CFq39nnT.js} +17746 -18306
- package/dist/{index-940faa12.js → index-CnBHpreC.js} +347 -377
- package/dist/{index-1da728d1.js → index-DnHnFalw.js} +8 -38
- package/dist/index.js +13 -46
- package/dist/{markdown-08edd93b.js → markdown-C2JcxpgA.js} +1374 -1836
- package/dist/plugins/AIChatPlugin.d.ts +1 -2
- package/dist/plugins/AutocompletePlugin.d.ts +0 -1
- package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRulePlugin.d.ts +0 -1
- package/dist/plugins/HtmlSyncPlugin.d.ts +0 -1
- package/dist/plugins/LinkPreviewPlugin/index.d.ts +0 -1
- package/dist/plugins/PasteOptionsPlugin/index.d.ts +0 -1
- package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasPlugin.d.ts +0 -1
- package/dist/plugins/SlashCommandPlugin/index.d.ts +0 -1
- package/dist/plugins/UsageTrackingPlugin.d.ts +0 -1
- package/dist/plugins/VoiceTranscriptPlugin.d.ts +1 -1
- package/dist/postcss-Banlrd6S.js +4703 -0
- package/dist/{standalone-83d5947a.js → standalone-JqHlnZSs.js} +975 -1274
- package/dist/types.d.ts +2 -0
- package/dist/typescript-D_phonMq.js +12929 -0
- package/package.json +7 -5
- package/dist/assets/style.css +0 -1
- package/dist/babel-2d5b260f.js +0 -7770
- package/dist/estree-28f5912a.js +0 -4920
- package/dist/html2pdf.bundle-eacf777f.js +0 -34001
- package/dist/html2pdf.bundle.min-d9ce156b.js +0 -21964
- package/dist/postcss-0e22bc25.js +0 -5187
- package/dist/typescript-0559ee85.js +0 -13660
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (!
|
|
5
|
-
throw TypeError("Cannot " + u);
|
|
6
|
-
};
|
|
7
|
-
var Me = (e, t, u) => {
|
|
8
|
-
if (t.has(e))
|
|
9
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
10
|
-
t instanceof WeakSet ? t.add(e) : t.set(e, u);
|
|
11
|
-
};
|
|
12
|
-
var ce = (e, t, u) => (Hu(e, t, "access private method"), u);
|
|
13
|
-
var Gu = Object.create, et = Object.defineProperty, Yu = Object.getOwnPropertyDescriptor, Qu = Object.getOwnPropertyNames, Zu = Object.getPrototypeOf, er = Object.prototype.hasOwnProperty, tr = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), tt = (e, t) => {
|
|
14
|
-
for (var u in t)
|
|
15
|
-
et(e, u, { get: t[u], enumerable: !0 });
|
|
16
|
-
}, ur = (e, t, u, r) => {
|
|
17
|
-
if (t && typeof t == "object" || typeof t == "function")
|
|
18
|
-
for (let n of Qu(t))
|
|
19
|
-
!er.call(e, n) && n !== u && et(e, n, { get: () => t[n], enumerable: !(r = Yu(t, n)) || r.enumerable });
|
|
1
|
+
var $u = Object.create, Xe = Object.defineProperty, Ju = Object.getOwnPropertyDescriptor, Ru = Object.getOwnPropertyNames, Mu = Object.getPrototypeOf, Vu = Object.prototype.hasOwnProperty, Wu = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), Ue = (e, t) => {
|
|
2
|
+
for (var u in t) Xe(e, u, { get: t[u], enumerable: !0 });
|
|
3
|
+
}, Ku = (e, t, u, r) => {
|
|
4
|
+
if (t && typeof t == "object" || typeof t == "function") for (let n of Ru(t)) !Vu.call(e, n) && n !== u && Xe(e, n, { get: () => t[n], enumerable: !(r = Ju(t, n)) || r.enumerable });
|
|
20
5
|
return e;
|
|
21
|
-
},
|
|
6
|
+
}, zu = (e, t, u) => (u = e != null ? $u(Mu(e)) : {}, Ku(Xe(u, "default", { value: e, enumerable: !0 }), e)), Xu = Wu((e, t) => {
|
|
22
7
|
var u, r, n, D, a, i, o, s, l, f, c, F, d, p, E, g, m, b, C;
|
|
23
8
|
d = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]|[^\/\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu, F = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y, u = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu, E = /(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y, c = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y, g = /[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y, C = /[\t\v\f\ufeff\p{Zs}]+/yu, s = /\r?\n|[\r\u2028\u2029]/y, l = /\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y, p = /\/\/.*/y, n = /[<>.:={}]|\/(?![\/*])/y, r = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu, D = /(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y, a = /[^<>{}]+/y, b = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/, m = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/, i = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/, o = /^(?:return|throw|yield)$/, f = RegExp(s.source), t.exports = function* (y, { jsx: w = !1 } = {}) {
|
|
24
|
-
var x, L, $, v, B, se, h, P, le, N, ue, A,
|
|
9
|
+
var x, L, $, v, B, se, h, P, le, N, ue, A, he, k;
|
|
25
10
|
for ({ length: se } = y, v = 0, B = "", k = [{ tag: "JS" }], x = [], ue = 0, A = !1; v < se; ) {
|
|
26
11
|
switch (P = k[k.length - 1], P.tag) {
|
|
27
12
|
case "JS":
|
|
@@ -33,7 +18,7 @@ var Gu = Object.create, et = Object.defineProperty, Yu = Object.getOwnPropertyDe
|
|
|
33
18
|
continue;
|
|
34
19
|
}
|
|
35
20
|
if (F.lastIndex = v, h = F.exec(y)) {
|
|
36
|
-
switch (
|
|
21
|
+
switch (he = h[0], le = F.lastIndex, N = he, he) {
|
|
37
22
|
case "(":
|
|
38
23
|
B === "?NonExpressionParenKeyword" && k.push({ tag: "JSNonExpressionParen", nesting: ue }), ue++, A = !1;
|
|
39
24
|
break;
|
|
@@ -68,7 +53,7 @@ var Gu = Object.create, et = Object.defineProperty, Yu = Object.getOwnPropertyDe
|
|
|
68
53
|
break;
|
|
69
54
|
case "<":
|
|
70
55
|
if (w && (b.test(B) || i.test(B))) {
|
|
71
|
-
k.push({ tag: "JSXTag" }), v += 1, B = "<", yield { type: "JSXPunctuator", value:
|
|
56
|
+
k.push({ tag: "JSXTag" }), v += 1, B = "<", yield { type: "JSXPunctuator", value: he };
|
|
72
57
|
continue;
|
|
73
58
|
}
|
|
74
59
|
A = !1;
|
|
@@ -76,7 +61,7 @@ var Gu = Object.create, et = Object.defineProperty, Yu = Object.getOwnPropertyDe
|
|
|
76
61
|
default:
|
|
77
62
|
A = !1;
|
|
78
63
|
}
|
|
79
|
-
v = le, B = N, yield { type: "Punctuator", value:
|
|
64
|
+
v = le, B = N, yield { type: "Punctuator", value: he };
|
|
80
65
|
continue;
|
|
81
66
|
}
|
|
82
67
|
if (u.lastIndex = v, h = u.exec(y)) {
|
|
@@ -164,14 +149,13 @@ var Gu = Object.create, et = Object.defineProperty, Yu = Object.getOwnPropertyDe
|
|
|
164
149
|
L = String.fromCodePoint(y.codePointAt(v)), v += L.length, B = L, A = !1, yield { type: P.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid", value: L };
|
|
165
150
|
}
|
|
166
151
|
};
|
|
167
|
-
}),
|
|
168
|
-
|
|
169
|
-
var
|
|
152
|
+
}), Uu = {};
|
|
153
|
+
Ue(Uu, { __debug: () => La, check: () => Pa, doc: () => Ou, format: () => Lu, formatWithCursor: () => ju, getSupportInfo: () => ja, util: () => _u, version: () => oa });
|
|
154
|
+
var me = (e, t) => (u, r, ...n) => u | 1 && r == null ? void 0 : (t.call(r) ?? r[e]).apply(r, n), qu = String.prototype.replaceAll ?? function(e, t) {
|
|
170
155
|
return e.global ? this.replace(e, t) : this.split(e).join(t);
|
|
171
|
-
},
|
|
172
|
-
if (typeof this == "string")
|
|
173
|
-
|
|
174
|
-
}), Oe = ir, or = class {
|
|
156
|
+
}, Hu = me("replaceAll", function() {
|
|
157
|
+
if (typeof this == "string") return qu;
|
|
158
|
+
}), xe = Hu, Gu = class {
|
|
175
159
|
diff(e, t, u = {}) {
|
|
176
160
|
let r;
|
|
177
161
|
typeof u == "function" ? (r = u, u = {}) : "callback" in u && (r = u.callback);
|
|
@@ -186,13 +170,11 @@ var Be = (e, t) => (u, r, ...n) => u | 1 && r == null ? void 0 : (t.call(r) ?? r
|
|
|
186
170
|
r(g);
|
|
187
171
|
}, 0);
|
|
188
172
|
return;
|
|
189
|
-
} else
|
|
190
|
-
return g;
|
|
173
|
+
} else return g;
|
|
191
174
|
}, a = t.length, i = e.length, o = 1, s = a + i;
|
|
192
175
|
u.maxEditLength != null && (s = Math.min(s, u.maxEditLength));
|
|
193
176
|
let l = (n = u.timeout) !== null && n !== void 0 ? n : 1 / 0, f = Date.now() + l, c = [{ oldPos: -1, lastComponent: void 0 }], F = this.extractCommon(c[0], t, e, 0, u);
|
|
194
|
-
if (c[0].oldPos + 1 >= i && F + 1 >= a)
|
|
195
|
-
return D(this.buildValues(c[0].lastComponent, t, e));
|
|
177
|
+
if (c[0].oldPos + 1 >= i && F + 1 >= a) return D(this.buildValues(c[0].lastComponent, t, e));
|
|
196
178
|
let d = -1 / 0, p = 1 / 0, E = () => {
|
|
197
179
|
for (let g = Math.max(d, -o); g <= Math.min(p, o); g += 2) {
|
|
198
180
|
let m, b = c[g - 1], C = c[g + 1];
|
|
@@ -207,26 +189,21 @@ var Be = (e, t) => (u, r, ...n) => u | 1 && r == null ? void 0 : (t.call(r) ?? r
|
|
|
207
189
|
c[g] = void 0;
|
|
208
190
|
continue;
|
|
209
191
|
}
|
|
210
|
-
if (!w || y && b.oldPos < C.oldPos ? m = this.addToPath(C, !0, !1, 0, u) : m = this.addToPath(b, !1, !0, 1, u), F = this.extractCommon(m, t, e, g, u), m.oldPos + 1 >= i && F + 1 >= a)
|
|
211
|
-
return D(this.buildValues(m.lastComponent, t, e)) || !0;
|
|
192
|
+
if (!w || y && b.oldPos < C.oldPos ? m = this.addToPath(C, !0, !1, 0, u) : m = this.addToPath(b, !1, !0, 1, u), F = this.extractCommon(m, t, e, g, u), m.oldPos + 1 >= i && F + 1 >= a) return D(this.buildValues(m.lastComponent, t, e)) || !0;
|
|
212
193
|
c[g] = m, m.oldPos + 1 >= i && (p = Math.min(p, g - 1)), F + 1 >= a && (d = Math.max(d, g + 1));
|
|
213
194
|
}
|
|
214
195
|
o++;
|
|
215
196
|
};
|
|
216
|
-
if (r)
|
|
217
|
-
(function
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
let g = E();
|
|
227
|
-
if (g)
|
|
228
|
-
return g;
|
|
229
|
-
}
|
|
197
|
+
if (r) (function g() {
|
|
198
|
+
setTimeout(function() {
|
|
199
|
+
if (o > s || Date.now() > f) return r(void 0);
|
|
200
|
+
E() || g();
|
|
201
|
+
}, 0);
|
|
202
|
+
})();
|
|
203
|
+
else for (; o <= s && Date.now() <= f; ) {
|
|
204
|
+
let g = E();
|
|
205
|
+
if (g) return g;
|
|
206
|
+
}
|
|
230
207
|
}
|
|
231
208
|
addToPath(e, t, u, r, n) {
|
|
232
209
|
let D = e.lastComponent;
|
|
@@ -234,8 +211,7 @@ var Be = (e, t) => (u, r, ...n) => u | 1 && r == null ? void 0 : (t.call(r) ?? r
|
|
|
234
211
|
}
|
|
235
212
|
extractCommon(e, t, u, r, n) {
|
|
236
213
|
let D = t.length, a = u.length, i = e.oldPos, o = i - r, s = 0;
|
|
237
|
-
for (; o + 1 < D && i + 1 < a && this.equals(u[i + 1], t[o + 1], n); )
|
|
238
|
-
o++, i++, s++, n.oneChangePerToken && (e.lastComponent = { count: 1, previousComponent: e.lastComponent, added: !1, removed: !1 });
|
|
214
|
+
for (; o + 1 < D && i + 1 < a && this.equals(u[i + 1], t[o + 1], n); ) o++, i++, s++, n.oneChangePerToken && (e.lastComponent = { count: 1, previousComponent: e.lastComponent, added: !1, removed: !1 });
|
|
239
215
|
return s && !n.oneChangePerToken && (e.lastComponent = { count: s, previousComponent: e.lastComponent, added: !1, removed: !1 }), e.oldPos = i, o;
|
|
240
216
|
}
|
|
241
217
|
equals(e, t, u) {
|
|
@@ -243,8 +219,7 @@ var Be = (e, t) => (u, r, ...n) => u | 1 && r == null ? void 0 : (t.call(r) ?? r
|
|
|
243
219
|
}
|
|
244
220
|
removeEmpty(e) {
|
|
245
221
|
let t = [];
|
|
246
|
-
for (let u = 0; u < e.length; u++)
|
|
247
|
-
e[u] && t.push(e[u]);
|
|
222
|
+
for (let u = 0; u < e.length; u++) e[u] && t.push(e[u]);
|
|
248
223
|
return t;
|
|
249
224
|
}
|
|
250
225
|
castInput(e, t) {
|
|
@@ -264,14 +239,12 @@ var Be = (e, t) => (u, r, ...n) => u | 1 && r == null ? void 0 : (t.call(r) ?? r
|
|
|
264
239
|
}
|
|
265
240
|
buildValues(e, t, u) {
|
|
266
241
|
let r = [], n;
|
|
267
|
-
for (; e; )
|
|
268
|
-
r.push(e), n = e.previousComponent, delete e.previousComponent, e = n;
|
|
242
|
+
for (; e; ) r.push(e), n = e.previousComponent, delete e.previousComponent, e = n;
|
|
269
243
|
r.reverse();
|
|
270
244
|
let D = r.length, a = 0, i = 0, o = 0;
|
|
271
245
|
for (; a < D; a++) {
|
|
272
246
|
let s = r[a];
|
|
273
|
-
if (s.removed)
|
|
274
|
-
s.value = this.join(u.slice(o, o + s.count)), o += s.count;
|
|
247
|
+
if (s.removed) s.value = this.join(u.slice(o, o + s.count)), o += s.count;
|
|
275
248
|
else {
|
|
276
249
|
if (!s.added && this.useLongestToken) {
|
|
277
250
|
let l = t.slice(i, i + s.count);
|
|
@@ -279,14 +252,13 @@ var Be = (e, t) => (u, r, ...n) => u | 1 && r == null ? void 0 : (t.call(r) ?? r
|
|
|
279
252
|
let F = u[o + c];
|
|
280
253
|
return F.length > f.length ? F : f;
|
|
281
254
|
}), s.value = this.join(l);
|
|
282
|
-
} else
|
|
283
|
-
s.value = this.join(t.slice(i, i + s.count));
|
|
255
|
+
} else s.value = this.join(t.slice(i, i + s.count));
|
|
284
256
|
i += s.count, s.added || (o += s.count);
|
|
285
257
|
}
|
|
286
258
|
}
|
|
287
259
|
return r;
|
|
288
260
|
}
|
|
289
|
-
},
|
|
261
|
+
}, Yu = class extends Gu {
|
|
290
262
|
tokenize(e) {
|
|
291
263
|
return e.slice();
|
|
292
264
|
}
|
|
@@ -296,137 +268,118 @@ var Be = (e, t) => (u, r, ...n) => u | 1 && r == null ? void 0 : (t.call(r) ?? r
|
|
|
296
268
|
removeEmpty(e) {
|
|
297
269
|
return e;
|
|
298
270
|
}
|
|
299
|
-
},
|
|
300
|
-
function
|
|
301
|
-
return
|
|
271
|
+
}, Qu = new Yu();
|
|
272
|
+
function Zu(e, t, u) {
|
|
273
|
+
return Qu.diff(e, t, u);
|
|
302
274
|
}
|
|
303
|
-
var
|
|
304
|
-
},
|
|
305
|
-
`,
|
|
306
|
-
`,
|
|
307
|
-
function
|
|
308
|
-
let t = e.indexOf(
|
|
309
|
-
return t !== -1 ? e.charAt(t + 1) ===
|
|
275
|
+
var er = () => {
|
|
276
|
+
}, tr = er, $t = "cr", Jt = "crlf", ur = "lf", rr = ur, qe = "\r", Rt = `\r
|
|
277
|
+
`, Se = `
|
|
278
|
+
`, nr = Se;
|
|
279
|
+
function Dr(e) {
|
|
280
|
+
let t = e.indexOf(qe);
|
|
281
|
+
return t !== -1 ? e.charAt(t + 1) === Se ? Jt : $t : rr;
|
|
310
282
|
}
|
|
311
|
-
function
|
|
312
|
-
return e ===
|
|
283
|
+
function He(e) {
|
|
284
|
+
return e === $t ? qe : e === Jt ? Rt : nr;
|
|
313
285
|
}
|
|
314
|
-
var
|
|
315
|
-
function
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
return ((r = e.match(u)) == null ? void 0 : r.length) ?? 0;
|
|
286
|
+
var ar = /* @__PURE__ */ new Map([[Se, /\n/gu], [qe, /\r/gu], [Rt, /\r\n/gu]]);
|
|
287
|
+
function Mt(e, t) {
|
|
288
|
+
let u = ar.get(t);
|
|
289
|
+
return e.match(u)?.length ?? 0;
|
|
319
290
|
}
|
|
320
|
-
var
|
|
321
|
-
function
|
|
322
|
-
return
|
|
291
|
+
var ir = /\r\n?/gu;
|
|
292
|
+
function or(e) {
|
|
293
|
+
return xe(0, e, ir, Se);
|
|
323
294
|
}
|
|
324
|
-
function
|
|
295
|
+
function sr(e) {
|
|
325
296
|
return this[e < 0 ? this.length + e : e];
|
|
326
297
|
}
|
|
327
|
-
var
|
|
328
|
-
if (Array.isArray(this) || typeof this == "string")
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
function Br(e) {
|
|
298
|
+
var lr = me("at", function() {
|
|
299
|
+
if (Array.isArray(this) || typeof this == "string") return sr;
|
|
300
|
+
}), S = lr, ie = "string", z = "array", ee = "cursor", X = "indent", U = "align", q = "trim", _ = "group", M = "fill", T = "if-break", H = "indent-if-break", G = "line-suffix", Y = "line-suffix-boundary", I = "line", V = "label", j = "break-parent", Vt = /* @__PURE__ */ new Set([ee, X, U, q, _, M, T, H, G, Y, I, V, j]);
|
|
301
|
+
function cr(e) {
|
|
332
302
|
let t = e.length;
|
|
333
303
|
for (; t > 0 && (e[t - 1] === "\r" || e[t - 1] === `
|
|
334
|
-
`); )
|
|
335
|
-
t--;
|
|
304
|
+
`); ) t--;
|
|
336
305
|
return t < e.length ? e.slice(0, t) : e;
|
|
337
306
|
}
|
|
338
|
-
function
|
|
339
|
-
if (typeof e == "string")
|
|
340
|
-
|
|
341
|
-
if (
|
|
342
|
-
return z;
|
|
343
|
-
if (!e)
|
|
344
|
-
return;
|
|
307
|
+
function fr(e) {
|
|
308
|
+
if (typeof e == "string") return ie;
|
|
309
|
+
if (Array.isArray(e)) return z;
|
|
310
|
+
if (!e) return;
|
|
345
311
|
let { type: t } = e;
|
|
346
|
-
if (
|
|
347
|
-
return t;
|
|
312
|
+
if (Vt.has(t)) return t;
|
|
348
313
|
}
|
|
349
|
-
var oe =
|
|
350
|
-
function
|
|
314
|
+
var oe = fr, Fr = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
|
|
315
|
+
function dr(e) {
|
|
351
316
|
let t = e === null ? "null" : typeof e;
|
|
352
|
-
if (t !== "string" && t !== "object")
|
|
353
|
-
return `Unexpected doc '${t}',
|
|
317
|
+
if (t !== "string" && t !== "object") return `Unexpected doc '${t}',
|
|
354
318
|
Expected it to be 'string' or 'object'.`;
|
|
355
|
-
if (oe(e))
|
|
356
|
-
throw new Error("doc is valid.");
|
|
319
|
+
if (oe(e)) throw new Error("doc is valid.");
|
|
357
320
|
let u = Object.prototype.toString.call(e);
|
|
358
|
-
if (u !== "[object Object]")
|
|
359
|
-
|
|
360
|
-
let r = Ar([...Yt].map((n) => `'${n}'`));
|
|
321
|
+
if (u !== "[object Object]") return `Unexpected doc '${u}'.`;
|
|
322
|
+
let r = Fr([...Vt].map((n) => `'${n}'`));
|
|
361
323
|
return `Unexpected doc.type '${e.type}'.
|
|
362
324
|
Expected it to be ${r}.`;
|
|
363
325
|
}
|
|
364
|
-
var
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
this.doc = t;
|
|
326
|
+
var pr = class extends Error {
|
|
327
|
+
name = "InvalidDocError";
|
|
328
|
+
constructor(e) {
|
|
329
|
+
super(dr(e)), this.doc = e;
|
|
369
330
|
}
|
|
370
|
-
},
|
|
371
|
-
function
|
|
331
|
+
}, Fe = pr, ft = {};
|
|
332
|
+
function hr(e, t, u, r) {
|
|
372
333
|
let n = [e];
|
|
373
334
|
for (; n.length > 0; ) {
|
|
374
335
|
let D = n.pop();
|
|
375
|
-
if (D ===
|
|
336
|
+
if (D === ft) {
|
|
376
337
|
u(n.pop());
|
|
377
338
|
continue;
|
|
378
339
|
}
|
|
379
|
-
u && n.push(D,
|
|
340
|
+
u && n.push(D, ft);
|
|
380
341
|
let a = oe(D);
|
|
381
|
-
if (!a)
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
for (let o = i.length, s = o - 1; s >= 0; --s)
|
|
389
|
-
n.push(i[s]);
|
|
390
|
-
break;
|
|
391
|
-
}
|
|
392
|
-
case T:
|
|
393
|
-
n.push(D.flatContents, D.breakContents);
|
|
394
|
-
break;
|
|
395
|
-
case O:
|
|
396
|
-
if (r && D.expandedStates)
|
|
397
|
-
for (let i = D.expandedStates.length, o = i - 1; o >= 0; --o)
|
|
398
|
-
n.push(D.expandedStates[o]);
|
|
399
|
-
else
|
|
400
|
-
n.push(D.contents);
|
|
401
|
-
break;
|
|
402
|
-
case U:
|
|
403
|
-
case X:
|
|
404
|
-
case H:
|
|
405
|
-
case V:
|
|
406
|
-
case G:
|
|
407
|
-
n.push(D.contents);
|
|
408
|
-
break;
|
|
409
|
-
case ie:
|
|
410
|
-
case ee:
|
|
411
|
-
case q:
|
|
412
|
-
case Y:
|
|
413
|
-
case I:
|
|
414
|
-
case j:
|
|
415
|
-
break;
|
|
416
|
-
default:
|
|
417
|
-
throw new pe(D);
|
|
342
|
+
if (!a) throw new Fe(D);
|
|
343
|
+
if (t?.(D) !== !1) switch (a) {
|
|
344
|
+
case z:
|
|
345
|
+
case M: {
|
|
346
|
+
let i = a === z ? D : D.parts;
|
|
347
|
+
for (let o = i.length, s = o - 1; s >= 0; --s) n.push(i[s]);
|
|
348
|
+
break;
|
|
418
349
|
}
|
|
350
|
+
case T:
|
|
351
|
+
n.push(D.flatContents, D.breakContents);
|
|
352
|
+
break;
|
|
353
|
+
case _:
|
|
354
|
+
if (r && D.expandedStates) for (let i = D.expandedStates.length, o = i - 1; o >= 0; --o) n.push(D.expandedStates[o]);
|
|
355
|
+
else n.push(D.contents);
|
|
356
|
+
break;
|
|
357
|
+
case U:
|
|
358
|
+
case X:
|
|
359
|
+
case H:
|
|
360
|
+
case V:
|
|
361
|
+
case G:
|
|
362
|
+
n.push(D.contents);
|
|
363
|
+
break;
|
|
364
|
+
case ie:
|
|
365
|
+
case ee:
|
|
366
|
+
case q:
|
|
367
|
+
case Y:
|
|
368
|
+
case I:
|
|
369
|
+
case j:
|
|
370
|
+
break;
|
|
371
|
+
default:
|
|
372
|
+
throw new Fe(D);
|
|
373
|
+
}
|
|
419
374
|
}
|
|
420
375
|
}
|
|
421
|
-
var
|
|
422
|
-
function
|
|
423
|
-
if (typeof e == "string")
|
|
424
|
-
return t(e);
|
|
376
|
+
var Ge = hr;
|
|
377
|
+
function Ie(e, t) {
|
|
378
|
+
if (typeof e == "string") return t(e);
|
|
425
379
|
let u = /* @__PURE__ */ new Map();
|
|
426
380
|
return r(e);
|
|
427
381
|
function r(D) {
|
|
428
|
-
if (u.has(D))
|
|
429
|
-
return u.get(D);
|
|
382
|
+
if (u.has(D)) return u.get(D);
|
|
430
383
|
let a = n(D);
|
|
431
384
|
return u.set(D, a), a;
|
|
432
385
|
}
|
|
@@ -434,11 +387,11 @@ function Pe(e, t) {
|
|
|
434
387
|
switch (oe(D)) {
|
|
435
388
|
case z:
|
|
436
389
|
return t(D.map(r));
|
|
437
|
-
case
|
|
390
|
+
case M:
|
|
438
391
|
return t({ ...D, parts: D.parts.map(r) });
|
|
439
392
|
case T:
|
|
440
393
|
return t({ ...D, breakContents: r(D.breakContents), flatContents: r(D.flatContents) });
|
|
441
|
-
case
|
|
394
|
+
case _: {
|
|
442
395
|
let { expandedStates: a, contents: i } = D;
|
|
443
396
|
return a ? (a = a.map(r), i = a[0]) : i = r(i), t({ ...D, contents: i, expandedStates: a });
|
|
444
397
|
}
|
|
@@ -456,81 +409,77 @@ function Pe(e, t) {
|
|
|
456
409
|
case j:
|
|
457
410
|
return t(D);
|
|
458
411
|
default:
|
|
459
|
-
throw new
|
|
412
|
+
throw new Fe(D);
|
|
460
413
|
}
|
|
461
414
|
}
|
|
462
415
|
}
|
|
463
|
-
function
|
|
416
|
+
function Ye(e, t, u) {
|
|
464
417
|
let r = u, n = !1;
|
|
465
418
|
function D(a) {
|
|
466
|
-
if (n)
|
|
467
|
-
return !1;
|
|
419
|
+
if (n) return !1;
|
|
468
420
|
let i = t(a);
|
|
469
421
|
i !== void 0 && (n = !0, r = i);
|
|
470
422
|
}
|
|
471
|
-
return
|
|
423
|
+
return Ge(e, D), r;
|
|
472
424
|
}
|
|
473
|
-
function
|
|
474
|
-
if (e.type ===
|
|
475
|
-
return !0;
|
|
425
|
+
function Cr(e) {
|
|
426
|
+
if (e.type === _ && e.break || e.type === I && e.hard || e.type === j) return !0;
|
|
476
427
|
}
|
|
477
|
-
function
|
|
478
|
-
return
|
|
428
|
+
function gr(e) {
|
|
429
|
+
return Ye(e, Cr, !1);
|
|
479
430
|
}
|
|
480
|
-
function
|
|
431
|
+
function Ft(e) {
|
|
481
432
|
if (e.length > 0) {
|
|
482
433
|
let t = S(0, e, -1);
|
|
483
434
|
!t.expandedStates && !t.break && (t.break = "propagated");
|
|
484
435
|
}
|
|
485
436
|
return null;
|
|
486
437
|
}
|
|
487
|
-
function
|
|
438
|
+
function Er(e) {
|
|
488
439
|
let t = /* @__PURE__ */ new Set(), u = [];
|
|
489
440
|
function r(D) {
|
|
490
|
-
if (D.type === j &&
|
|
491
|
-
if (u.push(D), t.has(D))
|
|
492
|
-
return !1;
|
|
441
|
+
if (D.type === j && Ft(u), D.type === _) {
|
|
442
|
+
if (u.push(D), t.has(D)) return !1;
|
|
493
443
|
t.add(D);
|
|
494
444
|
}
|
|
495
445
|
}
|
|
496
446
|
function n(D) {
|
|
497
|
-
D.type ===
|
|
447
|
+
D.type === _ && u.pop().break && Ft(u);
|
|
498
448
|
}
|
|
499
|
-
|
|
449
|
+
Ge(e, r, n, !0);
|
|
500
450
|
}
|
|
501
|
-
function
|
|
451
|
+
function mr(e) {
|
|
502
452
|
return e.type === I && !e.hard ? e.soft ? "" : " " : e.type === T ? e.flatContents : e;
|
|
503
453
|
}
|
|
504
|
-
function
|
|
505
|
-
return
|
|
454
|
+
function yr(e) {
|
|
455
|
+
return Ie(e, mr);
|
|
506
456
|
}
|
|
507
|
-
function
|
|
508
|
-
for (e = [...e]; e.length >= 2 && S(0, e, -2).type === I && S(0, e, -1).type === j; )
|
|
509
|
-
e.length -= 2;
|
|
457
|
+
function dt(e) {
|
|
458
|
+
for (e = [...e]; e.length >= 2 && S(0, e, -2).type === I && S(0, e, -1).type === j; ) e.length -= 2;
|
|
510
459
|
if (e.length > 0) {
|
|
511
|
-
let t =
|
|
460
|
+
let t = Ce(S(0, e, -1));
|
|
512
461
|
e[e.length - 1] = t;
|
|
513
462
|
}
|
|
514
463
|
return e;
|
|
515
464
|
}
|
|
516
|
-
function
|
|
465
|
+
function Ce(e) {
|
|
517
466
|
switch (oe(e)) {
|
|
518
467
|
case X:
|
|
519
468
|
case H:
|
|
520
|
-
case
|
|
469
|
+
case _:
|
|
521
470
|
case G:
|
|
522
471
|
case V: {
|
|
523
|
-
let t =
|
|
472
|
+
let t = Ce(e.contents);
|
|
524
473
|
return { ...e, contents: t };
|
|
525
474
|
}
|
|
526
475
|
case T:
|
|
527
|
-
return { ...e, breakContents:
|
|
528
|
-
case
|
|
529
|
-
return { ...e, parts:
|
|
476
|
+
return { ...e, breakContents: Ce(e.breakContents), flatContents: Ce(e.flatContents) };
|
|
477
|
+
case M:
|
|
478
|
+
return { ...e, parts: dt(e.parts) };
|
|
530
479
|
case z:
|
|
531
|
-
return
|
|
480
|
+
return dt(e);
|
|
532
481
|
case ie:
|
|
533
|
-
return
|
|
482
|
+
return cr(e);
|
|
534
483
|
case U:
|
|
535
484
|
case ee:
|
|
536
485
|
case q:
|
|
@@ -539,41 +488,35 @@ function Ee(e) {
|
|
|
539
488
|
case j:
|
|
540
489
|
break;
|
|
541
490
|
default:
|
|
542
|
-
throw new
|
|
491
|
+
throw new Fe(e);
|
|
543
492
|
}
|
|
544
493
|
return e;
|
|
545
494
|
}
|
|
546
|
-
function
|
|
547
|
-
return
|
|
495
|
+
function Wt(e) {
|
|
496
|
+
return Ce(Br(e));
|
|
548
497
|
}
|
|
549
|
-
function
|
|
498
|
+
function vr(e) {
|
|
550
499
|
switch (oe(e)) {
|
|
551
|
-
case
|
|
552
|
-
if (e.parts.every((t) => t === ""))
|
|
553
|
-
return "";
|
|
500
|
+
case M:
|
|
501
|
+
if (e.parts.every((t) => t === "")) return "";
|
|
554
502
|
break;
|
|
555
|
-
case
|
|
556
|
-
if (!e.contents && !e.id && !e.break && !e.expandedStates)
|
|
557
|
-
|
|
558
|
-
if (e.contents.type === O && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates)
|
|
559
|
-
return e.contents;
|
|
503
|
+
case _:
|
|
504
|
+
if (!e.contents && !e.id && !e.break && !e.expandedStates) return "";
|
|
505
|
+
if (e.contents.type === _ && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates) return e.contents;
|
|
560
506
|
break;
|
|
561
507
|
case U:
|
|
562
508
|
case X:
|
|
563
509
|
case H:
|
|
564
510
|
case G:
|
|
565
|
-
if (!e.contents)
|
|
566
|
-
return "";
|
|
511
|
+
if (!e.contents) return "";
|
|
567
512
|
break;
|
|
568
513
|
case T:
|
|
569
|
-
if (!e.flatContents && !e.breakContents)
|
|
570
|
-
return "";
|
|
514
|
+
if (!e.flatContents && !e.breakContents) return "";
|
|
571
515
|
break;
|
|
572
516
|
case z: {
|
|
573
517
|
let t = [];
|
|
574
518
|
for (let u of e) {
|
|
575
|
-
if (!u)
|
|
576
|
-
continue;
|
|
519
|
+
if (!u) continue;
|
|
577
520
|
let [r, ...n] = Array.isArray(u) ? u : [u];
|
|
578
521
|
typeof r == "string" && typeof S(0, t, -1) == "string" ? t[t.length - 1] += r : t.push(r), t.push(...n);
|
|
579
522
|
}
|
|
@@ -588,205 +531,180 @@ function Tr(e) {
|
|
|
588
531
|
case j:
|
|
589
532
|
break;
|
|
590
533
|
default:
|
|
591
|
-
throw new
|
|
534
|
+
throw new Fe(e);
|
|
592
535
|
}
|
|
593
536
|
return e;
|
|
594
537
|
}
|
|
595
|
-
function
|
|
596
|
-
return
|
|
538
|
+
function Br(e) {
|
|
539
|
+
return Ie(e, (t) => vr(t));
|
|
597
540
|
}
|
|
598
|
-
function
|
|
599
|
-
return
|
|
541
|
+
function br(e, t = Gt) {
|
|
542
|
+
return Ie(e, (u) => typeof u == "string" ? Ut(t, u.split(`
|
|
600
543
|
`)) : u);
|
|
601
544
|
}
|
|
602
|
-
function
|
|
603
|
-
if (e.type === I)
|
|
604
|
-
return !0;
|
|
545
|
+
function Ar(e) {
|
|
546
|
+
if (e.type === I) return !0;
|
|
605
547
|
}
|
|
606
|
-
function
|
|
607
|
-
return
|
|
548
|
+
function wr(e) {
|
|
549
|
+
return Ye(e, Ar, !1);
|
|
608
550
|
}
|
|
609
|
-
function
|
|
551
|
+
function Ae(e, t) {
|
|
610
552
|
return e.type === V ? { ...e, contents: t(e.contents) } : t(e);
|
|
611
553
|
}
|
|
612
|
-
var
|
|
613
|
-
function
|
|
554
|
+
var kr = tr;
|
|
555
|
+
function ke(e) {
|
|
614
556
|
return { type: X, contents: e };
|
|
615
557
|
}
|
|
616
|
-
function
|
|
558
|
+
function de(e, t) {
|
|
617
559
|
return { type: U, contents: t, n: e };
|
|
618
560
|
}
|
|
619
|
-
function
|
|
620
|
-
return
|
|
561
|
+
function xr(e) {
|
|
562
|
+
return de(Number.NEGATIVE_INFINITY, e);
|
|
621
563
|
}
|
|
622
|
-
function
|
|
623
|
-
return
|
|
564
|
+
function Kt(e) {
|
|
565
|
+
return de({ type: "root" }, e);
|
|
624
566
|
}
|
|
625
|
-
function
|
|
626
|
-
return
|
|
567
|
+
function Sr(e) {
|
|
568
|
+
return de(-1, e);
|
|
627
569
|
}
|
|
628
|
-
function
|
|
570
|
+
function zt(e, t, u) {
|
|
629
571
|
let r = e;
|
|
630
572
|
if (t > 0) {
|
|
631
|
-
for (let n = 0; n < Math.floor(t / u); ++n)
|
|
632
|
-
|
|
633
|
-
r = he(t % u, r), r = he(Number.NEGATIVE_INFINITY, r);
|
|
573
|
+
for (let n = 0; n < Math.floor(t / u); ++n) r = ke(r);
|
|
574
|
+
r = de(t % u, r), r = de(Number.NEGATIVE_INFINITY, r);
|
|
634
575
|
}
|
|
635
576
|
return r;
|
|
636
577
|
}
|
|
637
|
-
var
|
|
638
|
-
function
|
|
639
|
-
return { type:
|
|
578
|
+
var Ne = { type: j }, De = { type: ee };
|
|
579
|
+
function Ir(e) {
|
|
580
|
+
return { type: M, parts: e };
|
|
640
581
|
}
|
|
641
|
-
function
|
|
642
|
-
return
|
|
582
|
+
function Xt(e, t = {}) {
|
|
583
|
+
return kr(t.expandedStates), { type: _, id: t.id, contents: e, break: !!t.shouldBreak, expandedStates: t.expandedStates };
|
|
643
584
|
}
|
|
644
|
-
function
|
|
645
|
-
return
|
|
585
|
+
function Nr(e, t) {
|
|
586
|
+
return Xt(e[0], { ...t, expandedStates: e });
|
|
646
587
|
}
|
|
647
|
-
function
|
|
588
|
+
function Or(e, t = "", u = {}) {
|
|
648
589
|
return { type: T, breakContents: e, flatContents: t, groupId: u.groupId };
|
|
649
590
|
}
|
|
650
|
-
function
|
|
591
|
+
function _r(e, t) {
|
|
651
592
|
return { type: H, contents: e, groupId: t.groupId, negate: t.negate };
|
|
652
593
|
}
|
|
653
|
-
function
|
|
594
|
+
function Ut(e, t) {
|
|
654
595
|
let u = [];
|
|
655
|
-
for (let r = 0; r < t.length; r++)
|
|
656
|
-
r !== 0 && u.push(e), u.push(t[r]);
|
|
596
|
+
for (let r = 0; r < t.length; r++) r !== 0 && u.push(e), u.push(t[r]);
|
|
657
597
|
return u;
|
|
658
598
|
}
|
|
659
|
-
function
|
|
599
|
+
function Tr(e, t) {
|
|
660
600
|
return e ? { type: V, label: e, contents: t } : t;
|
|
661
601
|
}
|
|
662
|
-
var
|
|
663
|
-
function
|
|
602
|
+
var qt = { type: I }, Pr = { type: I, soft: !0 }, Qe = { type: I, hard: !0 }, K = [Qe, Ne], Ht = { type: I, hard: !0, literal: !0 }, Gt = [Ht, Ne];
|
|
603
|
+
function Ve(e) {
|
|
664
604
|
return { type: G, contents: e };
|
|
665
605
|
}
|
|
666
|
-
var
|
|
606
|
+
var jr = { type: Y }, Lr = { type: q };
|
|
667
607
|
function W(e) {
|
|
668
|
-
|
|
669
|
-
if (!e)
|
|
670
|
-
return "";
|
|
608
|
+
if (!e) return "";
|
|
671
609
|
if (Array.isArray(e)) {
|
|
672
|
-
let
|
|
673
|
-
for (let
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
}
|
|
680
|
-
return u;
|
|
610
|
+
let t = [];
|
|
611
|
+
for (let u of e) if (Array.isArray(u)) t.push(...W(u));
|
|
612
|
+
else {
|
|
613
|
+
let r = W(u);
|
|
614
|
+
r !== "" && t.push(r);
|
|
615
|
+
}
|
|
616
|
+
return t;
|
|
681
617
|
}
|
|
682
|
-
return e.type === T ? { ...e, breakContents: W(e.breakContents), flatContents: W(e.flatContents) } : e.type ===
|
|
618
|
+
return e.type === T ? { ...e, breakContents: W(e.breakContents), flatContents: W(e.flatContents) } : e.type === _ ? { ...e, contents: W(e.contents), expandedStates: e.expandedStates?.map(W) } : e.type === M ? { type: "fill", parts: e.parts.map(W) } : e.contents ? { ...e, contents: W(e.contents) } : e;
|
|
683
619
|
}
|
|
684
|
-
function
|
|
620
|
+
function $r(e) {
|
|
685
621
|
let t = /* @__PURE__ */ Object.create(null), u = /* @__PURE__ */ new Set();
|
|
686
622
|
return r(W(e));
|
|
687
623
|
function r(D, a, i) {
|
|
688
|
-
|
|
689
|
-
if (typeof D == "string")
|
|
690
|
-
return JSON.stringify(D);
|
|
624
|
+
if (typeof D == "string") return JSON.stringify(D);
|
|
691
625
|
if (Array.isArray(D)) {
|
|
692
|
-
let
|
|
693
|
-
return
|
|
626
|
+
let o = D.map(r).filter(Boolean);
|
|
627
|
+
return o.length === 1 ? o[0] : `[${o.join(", ")}]`;
|
|
694
628
|
}
|
|
695
629
|
if (D.type === I) {
|
|
696
|
-
let
|
|
697
|
-
return D.literal ?
|
|
630
|
+
let o = i?.[a + 1]?.type === j;
|
|
631
|
+
return D.literal ? o ? "literalline" : "literallineWithoutBreakParent" : D.hard ? o ? "hardline" : "hardlineWithoutBreakParent" : D.soft ? "softline" : "line";
|
|
698
632
|
}
|
|
699
|
-
if (D.type === j)
|
|
700
|
-
|
|
701
|
-
if (D.type ===
|
|
702
|
-
|
|
703
|
-
if (D.type ===
|
|
704
|
-
return "indent(" + r(D.contents) + ")";
|
|
705
|
-
if (D.type === U)
|
|
706
|
-
return D.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + r(D.contents) + ")" : D.n < 0 ? "dedent(" + r(D.contents) + ")" : D.n.type === "root" ? "markAsRoot(" + r(D.contents) + ")" : "align(" + JSON.stringify(D.n) + ", " + r(D.contents) + ")";
|
|
707
|
-
if (D.type === T)
|
|
708
|
-
return "ifBreak(" + r(D.breakContents) + (D.flatContents ? ", " + r(D.flatContents) : "") + (D.groupId ? (D.flatContents ? "" : ', ""') + `, { groupId: ${n(D.groupId)} }` : "") + ")";
|
|
633
|
+
if (D.type === j) return i?.[a - 1]?.type === I && i[a - 1].hard ? void 0 : "breakParent";
|
|
634
|
+
if (D.type === q) return "trim";
|
|
635
|
+
if (D.type === X) return "indent(" + r(D.contents) + ")";
|
|
636
|
+
if (D.type === U) return D.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + r(D.contents) + ")" : D.n < 0 ? "dedent(" + r(D.contents) + ")" : D.n.type === "root" ? "markAsRoot(" + r(D.contents) + ")" : "align(" + JSON.stringify(D.n) + ", " + r(D.contents) + ")";
|
|
637
|
+
if (D.type === T) return "ifBreak(" + r(D.breakContents) + (D.flatContents ? ", " + r(D.flatContents) : "") + (D.groupId ? (D.flatContents ? "" : ', ""') + `, { groupId: ${n(D.groupId)} }` : "") + ")";
|
|
709
638
|
if (D.type === H) {
|
|
710
|
-
let
|
|
711
|
-
D.negate &&
|
|
712
|
-
let
|
|
713
|
-
return `indentIfBreak(${r(D.contents)}${
|
|
639
|
+
let o = [];
|
|
640
|
+
D.negate && o.push("negate: true"), D.groupId && o.push(`groupId: ${n(D.groupId)}`);
|
|
641
|
+
let s = o.length > 0 ? `, { ${o.join(", ")} }` : "";
|
|
642
|
+
return `indentIfBreak(${r(D.contents)}${s})`;
|
|
714
643
|
}
|
|
715
|
-
if (D.type ===
|
|
716
|
-
let
|
|
717
|
-
D.break && D.break !== "propagated" &&
|
|
718
|
-
let
|
|
719
|
-
return D.expandedStates ? `conditionalGroup([${D.expandedStates.map((
|
|
644
|
+
if (D.type === _) {
|
|
645
|
+
let o = [];
|
|
646
|
+
D.break && D.break !== "propagated" && o.push("shouldBreak: true"), D.id && o.push(`id: ${n(D.id)}`);
|
|
647
|
+
let s = o.length > 0 ? `, { ${o.join(", ")} }` : "";
|
|
648
|
+
return D.expandedStates ? `conditionalGroup([${D.expandedStates.map((l) => r(l)).join(",")}]${s})` : `group(${r(D.contents)}${s})`;
|
|
720
649
|
}
|
|
721
|
-
if (D.type ===
|
|
722
|
-
|
|
723
|
-
if (D.type ===
|
|
724
|
-
|
|
725
|
-
if (D.type ===
|
|
726
|
-
return "lineSuffixBoundary";
|
|
727
|
-
if (D.type === V)
|
|
728
|
-
return `label(${JSON.stringify(D.label)}, ${r(D.contents)})`;
|
|
729
|
-
if (D.type === ee)
|
|
730
|
-
return "cursor";
|
|
650
|
+
if (D.type === M) return `fill([${D.parts.map((o) => r(o)).join(", ")}])`;
|
|
651
|
+
if (D.type === G) return "lineSuffix(" + r(D.contents) + ")";
|
|
652
|
+
if (D.type === Y) return "lineSuffixBoundary";
|
|
653
|
+
if (D.type === V) return `label(${JSON.stringify(D.label)}, ${r(D.contents)})`;
|
|
654
|
+
if (D.type === ee) return "cursor";
|
|
731
655
|
throw new Error("Unknown doc type " + D.type);
|
|
732
656
|
}
|
|
733
657
|
function n(D) {
|
|
734
|
-
if (typeof D != "symbol")
|
|
735
|
-
|
|
736
|
-
if (D in t)
|
|
737
|
-
return t[D];
|
|
658
|
+
if (typeof D != "symbol") return JSON.stringify(String(D));
|
|
659
|
+
if (D in t) return t[D];
|
|
738
660
|
let a = D.description || "symbol";
|
|
739
661
|
for (let i = 0; ; i++) {
|
|
740
662
|
let o = a + (i > 0 ? ` #${i}` : "");
|
|
741
|
-
if (!u.has(o))
|
|
742
|
-
return u.add(o), t[D] = `Symbol.for(${JSON.stringify(o)})`;
|
|
663
|
+
if (!u.has(o)) return u.add(o), t[D] = `Symbol.for(${JSON.stringify(o)})`;
|
|
743
664
|
}
|
|
744
665
|
}
|
|
745
666
|
}
|
|
746
|
-
var Yr = () => /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
747
|
-
function
|
|
667
|
+
var Jr = () => /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
668
|
+
function Rr(e) {
|
|
748
669
|
return e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510;
|
|
749
670
|
}
|
|
750
|
-
function
|
|
671
|
+
function Mr(e) {
|
|
751
672
|
return e >= 4352 && e <= 4447 || e === 8986 || e === 8987 || e === 9001 || e === 9002 || e >= 9193 && e <= 9196 || e === 9200 || e === 9203 || e === 9725 || e === 9726 || e === 9748 || e === 9749 || e >= 9776 && e <= 9783 || e >= 9800 && e <= 9811 || e === 9855 || e >= 9866 && e <= 9871 || e === 9875 || e === 9889 || e === 9898 || e === 9899 || e === 9917 || e === 9918 || e === 9924 || e === 9925 || e === 9934 || e === 9940 || e === 9962 || e === 9970 || e === 9971 || e === 9973 || e === 9978 || e === 9981 || e === 9989 || e === 9994 || e === 9995 || e === 10024 || e === 10060 || e === 10062 || e >= 10067 && e <= 10069 || e === 10071 || e >= 10133 && e <= 10135 || e === 10160 || e === 10175 || e === 11035 || e === 11036 || e === 11088 || e === 11093 || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12773 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 94176 && e <= 94180 || e >= 94192 && e <= 94198 || e >= 94208 && e <= 101589 || e >= 101631 && e <= 101662 || e >= 101760 && e <= 101874 || e >= 110576 && e <= 110579 || e >= 110581 && e <= 110587 || e === 110589 || e === 110590 || e >= 110592 && e <= 110882 || e === 110898 || e >= 110928 && e <= 110930 || e === 110933 || e >= 110948 && e <= 110951 || e >= 110960 && e <= 111355 || e >= 119552 && e <= 119638 || e >= 119648 && e <= 119670 || e === 126980 || e === 127183 || e === 127374 || e >= 127377 && e <= 127386 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || e === 127568 || e === 127569 || e >= 127584 && e <= 127589 || e >= 127744 && e <= 127776 || e >= 127789 && e <= 127797 || e >= 127799 && e <= 127868 || e >= 127870 && e <= 127891 || e >= 127904 && e <= 127946 || e >= 127951 && e <= 127955 || e >= 127968 && e <= 127984 || e === 127988 || e >= 127992 && e <= 128062 || e === 128064 || e >= 128066 && e <= 128252 || e >= 128255 && e <= 128317 || e >= 128331 && e <= 128334 || e >= 128336 && e <= 128359 || e === 128378 || e === 128405 || e === 128406 || e === 128420 || e >= 128507 && e <= 128591 || e >= 128640 && e <= 128709 || e === 128716 || e >= 128720 && e <= 128722 || e >= 128725 && e <= 128728 || e >= 128732 && e <= 128735 || e === 128747 || e === 128748 || e >= 128756 && e <= 128764 || e >= 128992 && e <= 129003 || e === 129008 || e >= 129292 && e <= 129338 || e >= 129340 && e <= 129349 || e >= 129351 && e <= 129535 || e >= 129648 && e <= 129660 || e >= 129664 && e <= 129674 || e >= 129678 && e <= 129734 || e === 129736 || e >= 129741 && e <= 129756 || e >= 129759 && e <= 129770 || e >= 129775 && e <= 129784 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141;
|
|
752
673
|
}
|
|
753
|
-
var
|
|
754
|
-
function
|
|
755
|
-
if (!e)
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
return e.length;
|
|
759
|
-
e = e.replace(Yr(), (u) => un.has(u) ? " " : " ");
|
|
674
|
+
var Vr = "©®‼⁉™ℹ↔↕↖↗↘↙↩↪⌨⏏⏱⏲⏸⏹⏺▪▫▶◀◻◼☀☁☂☃☄☎☑☘☝☠☢☣☦☪☮☯☸☹☺♀♂♟♠♣♥♦♨♻♾⚒⚔⚕⚖⚗⚙⚛⚜⚠⚧⚰⚱⛈⛏⛑⛓⛩⛱⛷⛸⛹✂✈✉✌✍✏✒✔✖✝✡✳✴❄❇❣❤➡⤴⤵⬅⬆⬇", Wr = /[^\x20-\x7F]/u, Kr = new Set(Vr);
|
|
675
|
+
function zr(e) {
|
|
676
|
+
if (!e) return 0;
|
|
677
|
+
if (!Wr.test(e)) return e.length;
|
|
678
|
+
e = e.replace(Jr(), (u) => Kr.has(u) ? " " : " ");
|
|
760
679
|
let t = 0;
|
|
761
680
|
for (let u of e) {
|
|
762
681
|
let r = u.codePointAt(0);
|
|
763
|
-
r <= 31 || r >= 127 && r <= 159 || r >= 768 && r <= 879 || r >= 65024 && r <= 65039 || (t +=
|
|
682
|
+
r <= 31 || r >= 127 && r <= 159 || r >= 768 && r <= 879 || r >= 65024 && r <= 65039 || (t += Rr(r) || Mr(r) ? 2 : 1);
|
|
764
683
|
}
|
|
765
684
|
return t;
|
|
766
685
|
}
|
|
767
|
-
var
|
|
768
|
-
return
|
|
686
|
+
var Ze = zr, Xr = { type: 0 }, Ur = { type: 1 }, Yt = { value: "", length: 0, queue: [], get root() {
|
|
687
|
+
return Yt;
|
|
769
688
|
} };
|
|
770
|
-
function
|
|
689
|
+
function Qt(e, t, u) {
|
|
771
690
|
let r = t.type === 1 ? e.queue.slice(0, -1) : [...e.queue, t], n = "", D = 0, a = 0, i = 0;
|
|
772
|
-
for (let d of r)
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
break;
|
|
781
|
-
}
|
|
782
|
-
case 2: {
|
|
783
|
-
let { width: p } = d;
|
|
784
|
-
a += 1, i += p;
|
|
785
|
-
break;
|
|
786
|
-
}
|
|
787
|
-
default:
|
|
788
|
-
throw new Error(`Unexpected indent comment '${d.type}'.`);
|
|
691
|
+
for (let d of r) switch (d.type) {
|
|
692
|
+
case 0:
|
|
693
|
+
l(), u.useTabs ? o(1) : s(u.tabWidth);
|
|
694
|
+
break;
|
|
695
|
+
case 3: {
|
|
696
|
+
let { string: p } = d;
|
|
697
|
+
l(), n += p, D += p.length;
|
|
698
|
+
break;
|
|
789
699
|
}
|
|
700
|
+
case 2: {
|
|
701
|
+
let { width: p } = d;
|
|
702
|
+
a += 1, i += p;
|
|
703
|
+
break;
|
|
704
|
+
}
|
|
705
|
+
default:
|
|
706
|
+
throw new Error(`Unexpected indent comment '${d.type}'.`);
|
|
707
|
+
}
|
|
790
708
|
return c(), { ...e, value: n, length: D, queue: r };
|
|
791
709
|
function o(d) {
|
|
792
710
|
n += " ".repeat(d), D += u.tabWidth * d;
|
|
@@ -807,56 +725,48 @@ function iu(e, t, u) {
|
|
|
807
725
|
a = 0, i = 0;
|
|
808
726
|
}
|
|
809
727
|
}
|
|
810
|
-
function
|
|
811
|
-
if (!t)
|
|
812
|
-
|
|
813
|
-
if (t
|
|
814
|
-
return { ...e, root: e };
|
|
815
|
-
if (t === Number.NEGATIVE_INFINITY)
|
|
816
|
-
return e.root;
|
|
728
|
+
function qr(e, t, u) {
|
|
729
|
+
if (!t) return e;
|
|
730
|
+
if (t.type === "root") return { ...e, root: e };
|
|
731
|
+
if (t === Number.NEGATIVE_INFINITY) return e.root;
|
|
817
732
|
let r;
|
|
818
|
-
return typeof t == "number" ? t < 0 ? r =
|
|
733
|
+
return typeof t == "number" ? t < 0 ? r = Ur : r = { type: 2, width: t } : r = { type: 3, string: t }, Qt(e, r, u);
|
|
819
734
|
}
|
|
820
|
-
function
|
|
821
|
-
return
|
|
735
|
+
function Hr(e, t) {
|
|
736
|
+
return Qt(e, Xr, t);
|
|
822
737
|
}
|
|
823
|
-
function
|
|
738
|
+
function Gr(e) {
|
|
824
739
|
let t = 0;
|
|
825
740
|
for (let u = e.length - 1; u >= 0; u--) {
|
|
826
741
|
let r = e[u];
|
|
827
|
-
if (r === " " || r === " ")
|
|
828
|
-
|
|
829
|
-
else
|
|
830
|
-
break;
|
|
742
|
+
if (r === " " || r === " ") t++;
|
|
743
|
+
else break;
|
|
831
744
|
}
|
|
832
745
|
return t;
|
|
833
746
|
}
|
|
834
|
-
function
|
|
835
|
-
let t =
|
|
747
|
+
function Zt(e) {
|
|
748
|
+
let t = Gr(e);
|
|
836
749
|
return { text: t === 0 ? e : e.slice(0, e.length - t), count: t };
|
|
837
750
|
}
|
|
838
|
-
var
|
|
839
|
-
function
|
|
840
|
-
if (u === Number.POSITIVE_INFINITY)
|
|
841
|
-
return !0;
|
|
751
|
+
var O = /* @__PURE__ */ Symbol("MODE_BREAK"), J = /* @__PURE__ */ Symbol("MODE_FLAT"), We = /* @__PURE__ */ Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
752
|
+
function Be(e, t, u, r, n, D) {
|
|
753
|
+
if (u === Number.POSITIVE_INFINITY) return !0;
|
|
842
754
|
let a = t.length, i = !1, o = [e], s = "";
|
|
843
755
|
for (; u >= 0; ) {
|
|
844
756
|
if (o.length === 0) {
|
|
845
|
-
if (a === 0)
|
|
846
|
-
return !0;
|
|
757
|
+
if (a === 0) return !0;
|
|
847
758
|
o.push(t[--a]);
|
|
848
759
|
continue;
|
|
849
760
|
}
|
|
850
761
|
let { mode: l, doc: f } = o.pop(), c = oe(f);
|
|
851
762
|
switch (c) {
|
|
852
763
|
case ie:
|
|
853
|
-
f && (i && (s += " ", u -= 1, i = !1), s += f, u -=
|
|
764
|
+
f && (i && (s += " ", u -= 1, i = !1), s += f, u -= Ze(f));
|
|
854
765
|
break;
|
|
855
766
|
case z:
|
|
856
|
-
case
|
|
857
|
-
let F = c === z ? f : f.parts, d = f[
|
|
858
|
-
for (let p = F.length - 1; p >= d; p--)
|
|
859
|
-
o.push({ mode: l, doc: F[p] });
|
|
767
|
+
case M: {
|
|
768
|
+
let F = c === z ? f : f.parts, d = f[We] ?? 0;
|
|
769
|
+
for (let p = F.length - 1; p >= d; p--) o.push({ mode: l, doc: F[p] });
|
|
860
770
|
break;
|
|
861
771
|
}
|
|
862
772
|
case X:
|
|
@@ -866,131 +776,121 @@ function ke(e, t, u, r, n, D) {
|
|
|
866
776
|
o.push({ mode: l, doc: f.contents });
|
|
867
777
|
break;
|
|
868
778
|
case q: {
|
|
869
|
-
let { text: F, count: d } =
|
|
779
|
+
let { text: F, count: d } = Zt(s);
|
|
870
780
|
s = F, u += d;
|
|
871
781
|
break;
|
|
872
782
|
}
|
|
873
|
-
case
|
|
874
|
-
if (D && f.break)
|
|
875
|
-
|
|
876
|
-
let F = f.break ? _ : l, d = f.expandedStates && F === _ ? S(0, f.expandedStates, -1) : f.contents;
|
|
783
|
+
case _: {
|
|
784
|
+
if (D && f.break) return !1;
|
|
785
|
+
let F = f.break ? O : l, d = f.expandedStates && F === O ? S(0, f.expandedStates, -1) : f.contents;
|
|
877
786
|
o.push({ mode: F, doc: d });
|
|
878
787
|
break;
|
|
879
788
|
}
|
|
880
789
|
case T: {
|
|
881
|
-
let F = (f.groupId ? n[f.groupId] || J : l) ===
|
|
790
|
+
let F = (f.groupId ? n[f.groupId] || J : l) === O ? f.breakContents : f.flatContents;
|
|
882
791
|
F && o.push({ mode: l, doc: F });
|
|
883
792
|
break;
|
|
884
793
|
}
|
|
885
794
|
case I:
|
|
886
|
-
if (l ===
|
|
887
|
-
return !0;
|
|
795
|
+
if (l === O || f.hard) return !0;
|
|
888
796
|
f.soft || (i = !0);
|
|
889
797
|
break;
|
|
890
798
|
case G:
|
|
891
799
|
r = !0;
|
|
892
800
|
break;
|
|
893
801
|
case Y:
|
|
894
|
-
if (r)
|
|
895
|
-
return !1;
|
|
802
|
+
if (r) return !1;
|
|
896
803
|
break;
|
|
897
804
|
}
|
|
898
805
|
}
|
|
899
806
|
return !1;
|
|
900
807
|
}
|
|
901
|
-
function
|
|
902
|
-
let u = /* @__PURE__ */ Object.create(null), r = t.printWidth, n =
|
|
903
|
-
for (
|
|
808
|
+
function Oe(e, t) {
|
|
809
|
+
let u = /* @__PURE__ */ Object.create(null), r = t.printWidth, n = He(t.endOfLine), D = 0, a = [{ indent: Yt, mode: O, doc: e }], i = "", o = !1, s = [], l = [], f = [], c = [], F = 0;
|
|
810
|
+
for (Er(e); a.length > 0; ) {
|
|
904
811
|
let { indent: m, mode: b, doc: C } = a.pop();
|
|
905
812
|
switch (oe(C)) {
|
|
906
813
|
case ie: {
|
|
907
814
|
let y = n !== `
|
|
908
|
-
` ?
|
|
815
|
+
` ? xe(0, C, `
|
|
909
816
|
`, n) : C;
|
|
910
|
-
y && (i += y, a.length > 0 && (D +=
|
|
817
|
+
y && (i += y, a.length > 0 && (D += Ze(y)));
|
|
911
818
|
break;
|
|
912
819
|
}
|
|
913
820
|
case z:
|
|
914
|
-
for (let y = C.length - 1; y >= 0; y--)
|
|
915
|
-
a.push({ indent: m, mode: b, doc: C[y] });
|
|
821
|
+
for (let y = C.length - 1; y >= 0; y--) a.push({ indent: m, mode: b, doc: C[y] });
|
|
916
822
|
break;
|
|
917
823
|
case ee:
|
|
918
|
-
if (l.length >= 2)
|
|
919
|
-
throw new Error("There are too many 'cursor' in doc.");
|
|
824
|
+
if (l.length >= 2) throw new Error("There are too many 'cursor' in doc.");
|
|
920
825
|
l.push(F + i.length);
|
|
921
826
|
break;
|
|
922
827
|
case X:
|
|
923
|
-
a.push({ indent:
|
|
828
|
+
a.push({ indent: Hr(m, t), mode: b, doc: C.contents });
|
|
924
829
|
break;
|
|
925
830
|
case U:
|
|
926
|
-
a.push({ indent:
|
|
831
|
+
a.push({ indent: qr(m, C.n, t), mode: b, doc: C.contents });
|
|
927
832
|
break;
|
|
928
833
|
case q:
|
|
929
834
|
g();
|
|
930
835
|
break;
|
|
931
|
-
case
|
|
836
|
+
case _:
|
|
932
837
|
switch (b) {
|
|
933
838
|
case J:
|
|
934
839
|
if (!o) {
|
|
935
|
-
a.push({ indent: m, mode: C.break ?
|
|
840
|
+
a.push({ indent: m, mode: C.break ? O : J, doc: C.contents });
|
|
936
841
|
break;
|
|
937
842
|
}
|
|
938
|
-
case
|
|
843
|
+
case O: {
|
|
939
844
|
o = !1;
|
|
940
845
|
let y = { indent: m, mode: J, doc: C.contents }, w = r - D, x = s.length > 0;
|
|
941
|
-
if (!C.break &&
|
|
942
|
-
a.push(y);
|
|
846
|
+
if (!C.break && Be(y, a, w, x, u)) a.push(y);
|
|
943
847
|
else if (C.expandedStates) {
|
|
944
848
|
let L = S(0, C.expandedStates, -1);
|
|
945
849
|
if (C.break) {
|
|
946
|
-
a.push({ indent: m, mode:
|
|
850
|
+
a.push({ indent: m, mode: O, doc: L });
|
|
947
851
|
break;
|
|
948
|
-
} else
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
}
|
|
960
|
-
} else
|
|
961
|
-
a.push({ indent: m, mode: _, doc: C.contents });
|
|
852
|
+
} else for (let $ = 1; $ < C.expandedStates.length + 1; $++) if ($ >= C.expandedStates.length) {
|
|
853
|
+
a.push({ indent: m, mode: O, doc: L });
|
|
854
|
+
break;
|
|
855
|
+
} else {
|
|
856
|
+
let v = C.expandedStates[$], B = { indent: m, mode: J, doc: v };
|
|
857
|
+
if (Be(B, a, w, x, u)) {
|
|
858
|
+
a.push(B);
|
|
859
|
+
break;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
} else a.push({ indent: m, mode: O, doc: C.contents });
|
|
962
863
|
break;
|
|
963
864
|
}
|
|
964
865
|
}
|
|
965
866
|
C.id && (u[C.id] = S(0, a, -1).mode);
|
|
966
867
|
break;
|
|
967
|
-
case
|
|
968
|
-
let y = r - D, w = C[
|
|
969
|
-
if (L === 0)
|
|
970
|
-
|
|
971
|
-
let $ = x[w + 0], v = x[w + 1], B = { indent: m, mode: J, doc: $ }, se = { indent: m, mode: _, doc: $ }, h = ke(B, [], y, s.length > 0, u, !0);
|
|
868
|
+
case M: {
|
|
869
|
+
let y = r - D, w = C[We] ?? 0, { parts: x } = C, L = x.length - w;
|
|
870
|
+
if (L === 0) break;
|
|
871
|
+
let $ = x[w + 0], v = x[w + 1], B = { indent: m, mode: J, doc: $ }, se = { indent: m, mode: O, doc: $ }, h = Be(B, [], y, s.length > 0, u, !0);
|
|
972
872
|
if (L === 1) {
|
|
973
873
|
h ? a.push(B) : a.push(se);
|
|
974
874
|
break;
|
|
975
875
|
}
|
|
976
|
-
let P = { indent: m, mode: J, doc: v }, le = { indent: m, mode:
|
|
876
|
+
let P = { indent: m, mode: J, doc: v }, le = { indent: m, mode: O, doc: v };
|
|
977
877
|
if (L === 2) {
|
|
978
878
|
h ? a.push(P, B) : a.push(le, se);
|
|
979
879
|
break;
|
|
980
880
|
}
|
|
981
|
-
let N = x[w + 2], ue = { indent: m, mode: b, doc: { ...C, [
|
|
881
|
+
let N = x[w + 2], ue = { indent: m, mode: b, doc: { ...C, [We]: w + 2 } }, A = Be({ indent: m, mode: J, doc: [$, v, N] }, [], y, s.length > 0, u, !0);
|
|
982
882
|
a.push(ue), A ? a.push(P, B) : h ? a.push(le, B) : a.push(le, se);
|
|
983
883
|
break;
|
|
984
884
|
}
|
|
985
885
|
case T:
|
|
986
886
|
case H: {
|
|
987
887
|
let y = C.groupId ? u[C.groupId] : b;
|
|
988
|
-
if (y ===
|
|
989
|
-
let w = C.type === T ? C.breakContents : C.negate ? C.contents :
|
|
888
|
+
if (y === O) {
|
|
889
|
+
let w = C.type === T ? C.breakContents : C.negate ? C.contents : ke(C.contents);
|
|
990
890
|
w && a.push({ indent: m, mode: b, doc: w });
|
|
991
891
|
}
|
|
992
892
|
if (y === J) {
|
|
993
|
-
let w = C.type === T ? C.flatContents : C.negate ?
|
|
893
|
+
let w = C.type === T ? C.flatContents : C.negate ? ke(C.contents) : C.contents;
|
|
994
894
|
w && a.push({ indent: m, mode: b, doc: w });
|
|
995
895
|
}
|
|
996
896
|
break;
|
|
@@ -999,18 +899,17 @@ function Le(e, t) {
|
|
|
999
899
|
s.push({ indent: m, mode: b, doc: C.contents });
|
|
1000
900
|
break;
|
|
1001
901
|
case Y:
|
|
1002
|
-
s.length > 0 && a.push({ indent: m, mode: b, doc:
|
|
902
|
+
s.length > 0 && a.push({ indent: m, mode: b, doc: Qe });
|
|
1003
903
|
break;
|
|
1004
904
|
case I:
|
|
1005
905
|
switch (b) {
|
|
1006
906
|
case J:
|
|
1007
|
-
if (C.hard)
|
|
1008
|
-
o = !0;
|
|
907
|
+
if (C.hard) o = !0;
|
|
1009
908
|
else {
|
|
1010
909
|
C.soft || (i += " ", D += 1);
|
|
1011
910
|
break;
|
|
1012
911
|
}
|
|
1013
|
-
case
|
|
912
|
+
case O:
|
|
1014
913
|
if (s.length > 0) {
|
|
1015
914
|
a.push({ indent: m, mode: b, doc: C }, ...s.reverse()), s.length = 0;
|
|
1016
915
|
break;
|
|
@@ -1025,30 +924,26 @@ function Le(e, t) {
|
|
|
1025
924
|
case j:
|
|
1026
925
|
break;
|
|
1027
926
|
default:
|
|
1028
|
-
throw new
|
|
927
|
+
throw new Fe(C);
|
|
1029
928
|
}
|
|
1030
929
|
a.length === 0 && s.length > 0 && (a.push(...s.reverse()), s.length = 0);
|
|
1031
930
|
}
|
|
1032
931
|
let d = f.join("") + i, p = [...c, ...l];
|
|
1033
|
-
if (p.length !== 2)
|
|
1034
|
-
return { formatted: d };
|
|
932
|
+
if (p.length !== 2) return { formatted: d };
|
|
1035
933
|
let E = p[0];
|
|
1036
934
|
return { formatted: d, cursorNodeStart: E, cursorNodeText: d.slice(E, S(0, p, -1)) };
|
|
1037
935
|
function g() {
|
|
1038
|
-
let { text: m, count: b } =
|
|
936
|
+
let { text: m, count: b } = Zt(i);
|
|
1039
937
|
m && (f.push(m), F += m.length), i = "", D -= b, l.length > 0 && (c.push(...l.map((C) => Math.min(C, F))), l.length = 0);
|
|
1040
938
|
}
|
|
1041
939
|
}
|
|
1042
|
-
function
|
|
940
|
+
function Yr(e, t, u = 0) {
|
|
1043
941
|
let r = 0;
|
|
1044
|
-
for (let n = u; n < e.length; ++n)
|
|
1045
|
-
e[n] === " " ? r = r + t - r % t : r++;
|
|
942
|
+
for (let n = u; n < e.length; ++n) e[n] === " " ? r = r + t - r % t : r++;
|
|
1046
943
|
return r;
|
|
1047
944
|
}
|
|
1048
|
-
var
|
|
945
|
+
var et = Yr, Qr = class {
|
|
1049
946
|
constructor(e) {
|
|
1050
|
-
Me(this, ve);
|
|
1051
|
-
Me(this, de);
|
|
1052
947
|
this.stack = [e];
|
|
1053
948
|
}
|
|
1054
949
|
get key() {
|
|
@@ -1096,7 +991,7 @@ var ot = ln, ve, Ye, de, Ie, Xt, cn = (Xt = class {
|
|
|
1096
991
|
return this.stack[0];
|
|
1097
992
|
}
|
|
1098
993
|
get ancestors() {
|
|
1099
|
-
return [...
|
|
994
|
+
return [...this.#e()];
|
|
1100
995
|
}
|
|
1101
996
|
getName() {
|
|
1102
997
|
let { stack: e } = this, { length: t } = e;
|
|
@@ -1106,16 +1001,20 @@ var ot = ln, ve, Ye, de, Ie, Xt, cn = (Xt = class {
|
|
|
1106
1001
|
return S(0, this.stack, -1);
|
|
1107
1002
|
}
|
|
1108
1003
|
getNode(e = 0) {
|
|
1109
|
-
let t =
|
|
1004
|
+
let t = this.#t(e);
|
|
1110
1005
|
return t === -1 ? null : this.stack[t];
|
|
1111
1006
|
}
|
|
1112
1007
|
getParentNode(e = 0) {
|
|
1113
1008
|
return this.getNode(e + 1);
|
|
1114
1009
|
}
|
|
1010
|
+
#t(e) {
|
|
1011
|
+
let { stack: t } = this;
|
|
1012
|
+
for (let u = t.length - 1; u >= 0; u -= 2) if (!Array.isArray(t[u]) && --e < 0) return u;
|
|
1013
|
+
return -1;
|
|
1014
|
+
}
|
|
1115
1015
|
call(e, ...t) {
|
|
1116
1016
|
let { stack: u } = this, { length: r } = u, n = S(0, u, -1);
|
|
1117
|
-
for (let D of t)
|
|
1118
|
-
n = n == null ? void 0 : n[D], u.push(D, n);
|
|
1017
|
+
for (let D of t) n = n?.[D], u.push(D, n);
|
|
1119
1018
|
try {
|
|
1120
1019
|
return e(this);
|
|
1121
1020
|
} finally {
|
|
@@ -1123,7 +1022,7 @@ var ot = ln, ve, Ye, de, Ie, Xt, cn = (Xt = class {
|
|
|
1123
1022
|
}
|
|
1124
1023
|
}
|
|
1125
1024
|
callParent(e, t = 0) {
|
|
1126
|
-
let u =
|
|
1025
|
+
let u = this.#t(t + 1), r = this.stack.splice(u + 1);
|
|
1127
1026
|
try {
|
|
1128
1027
|
return e(this);
|
|
1129
1028
|
} finally {
|
|
@@ -1132,11 +1031,9 @@ var ot = ln, ve, Ye, de, Ie, Xt, cn = (Xt = class {
|
|
|
1132
1031
|
}
|
|
1133
1032
|
each(e, ...t) {
|
|
1134
1033
|
let { stack: u } = this, { length: r } = u, n = S(0, u, -1);
|
|
1135
|
-
for (let D of t)
|
|
1136
|
-
n = n[D], u.push(D, n);
|
|
1034
|
+
for (let D of t) n = n[D], u.push(D, n);
|
|
1137
1035
|
try {
|
|
1138
|
-
for (let D = 0; D < n.length; ++D)
|
|
1139
|
-
u.push(D, n[D]), e(this, D, n), u.length -= 2;
|
|
1036
|
+
for (let D = 0; D < n.length; ++D) u.push(D, n[D]), e(this, D, n), u.length -= 2;
|
|
1140
1037
|
} finally {
|
|
1141
1038
|
u.length = r;
|
|
1142
1039
|
}
|
|
@@ -1150,150 +1047,123 @@ var ot = ln, ve, Ye, de, Ie, Xt, cn = (Xt = class {
|
|
|
1150
1047
|
match(...e) {
|
|
1151
1048
|
let t = this.stack.length - 1, u = null, r = this.stack[t--];
|
|
1152
1049
|
for (let n of e) {
|
|
1153
|
-
if (r === void 0)
|
|
1154
|
-
return !1;
|
|
1050
|
+
if (r === void 0) return !1;
|
|
1155
1051
|
let D = null;
|
|
1156
|
-
if (typeof u == "number" && (D = u, u = this.stack[t--], r = this.stack[t--]), n && !n(r, u, D))
|
|
1157
|
-
return !1;
|
|
1052
|
+
if (typeof u == "number" && (D = u, u = this.stack[t--], r = this.stack[t--]), n && !n(r, u, D)) return !1;
|
|
1158
1053
|
u = this.stack[t--], r = this.stack[t--];
|
|
1159
1054
|
}
|
|
1160
1055
|
return !0;
|
|
1161
1056
|
}
|
|
1162
1057
|
findAncestor(e) {
|
|
1163
|
-
for (let t of
|
|
1164
|
-
if (e(t))
|
|
1165
|
-
return t;
|
|
1058
|
+
for (let t of this.#e()) if (e(t)) return t;
|
|
1166
1059
|
}
|
|
1167
1060
|
hasAncestor(e) {
|
|
1168
|
-
for (let t of
|
|
1169
|
-
if (e(t))
|
|
1170
|
-
return !0;
|
|
1061
|
+
for (let t of this.#e()) if (e(t)) return !0;
|
|
1171
1062
|
return !1;
|
|
1172
1063
|
}
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
let u = e[t];
|
|
1183
|
-
Array.isArray(u) || (yield u);
|
|
1184
|
-
}
|
|
1185
|
-
}, Xt), fn = cn;
|
|
1186
|
-
function Fn(e) {
|
|
1064
|
+
*#e() {
|
|
1065
|
+
let { stack: e } = this;
|
|
1066
|
+
for (let t = e.length - 3; t >= 0; t -= 2) {
|
|
1067
|
+
let u = e[t];
|
|
1068
|
+
Array.isArray(u) || (yield u);
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}, Zr = Qr;
|
|
1072
|
+
function en(e) {
|
|
1187
1073
|
return e !== null && typeof e == "object";
|
|
1188
1074
|
}
|
|
1189
|
-
var
|
|
1190
|
-
function
|
|
1075
|
+
var tt = en;
|
|
1076
|
+
function ye(e) {
|
|
1191
1077
|
return (t, u, r) => {
|
|
1192
|
-
let n = !!
|
|
1193
|
-
if (u === !1)
|
|
1194
|
-
return !1;
|
|
1078
|
+
let n = !!r?.backwards;
|
|
1079
|
+
if (u === !1) return !1;
|
|
1195
1080
|
let { length: D } = t, a = u;
|
|
1196
1081
|
for (; a >= 0 && a < D; ) {
|
|
1197
1082
|
let i = t.charAt(a);
|
|
1198
1083
|
if (e instanceof RegExp) {
|
|
1199
|
-
if (!e.test(i))
|
|
1200
|
-
|
|
1201
|
-
} else if (!e.includes(i))
|
|
1202
|
-
return a;
|
|
1084
|
+
if (!e.test(i)) return a;
|
|
1085
|
+
} else if (!e.includes(i)) return a;
|
|
1203
1086
|
n ? a-- : a++;
|
|
1204
1087
|
}
|
|
1205
1088
|
return a === -1 || a === D ? a : !1;
|
|
1206
1089
|
};
|
|
1207
1090
|
}
|
|
1208
|
-
var
|
|
1091
|
+
var tn = ye(/\s/u), Z = ye(" "), eu = ye(",; "), tu = ye(/[^\n\r]/u), pt = (e) => e === `
|
|
1209
1092
|
` || e === "\r" || e === "\u2028" || e === "\u2029";
|
|
1210
|
-
function
|
|
1211
|
-
let r = !!
|
|
1212
|
-
if (t === !1)
|
|
1213
|
-
return !1;
|
|
1093
|
+
function un(e, t, u) {
|
|
1094
|
+
let r = !!u?.backwards;
|
|
1095
|
+
if (t === !1) return !1;
|
|
1214
1096
|
let n = e.charAt(t);
|
|
1215
1097
|
if (r) {
|
|
1216
1098
|
if (e.charAt(t - 1) === "\r" && n === `
|
|
1217
|
-
`)
|
|
1218
|
-
|
|
1219
|
-
if (Bt(n))
|
|
1220
|
-
return t - 1;
|
|
1099
|
+
`) return t - 2;
|
|
1100
|
+
if (pt(n)) return t - 1;
|
|
1221
1101
|
} else {
|
|
1222
1102
|
if (n === "\r" && e.charAt(t + 1) === `
|
|
1223
|
-
`)
|
|
1224
|
-
|
|
1225
|
-
if (Bt(n))
|
|
1226
|
-
return t + 1;
|
|
1103
|
+
`) return t + 2;
|
|
1104
|
+
if (pt(n)) return t + 1;
|
|
1227
1105
|
}
|
|
1228
1106
|
return t;
|
|
1229
1107
|
}
|
|
1230
|
-
var ae =
|
|
1231
|
-
function
|
|
1108
|
+
var ae = un;
|
|
1109
|
+
function rn(e, t, u = {}) {
|
|
1232
1110
|
let r = Z(e, u.backwards ? t - 1 : t, u), n = ae(e, r, u);
|
|
1233
1111
|
return r !== n;
|
|
1234
1112
|
}
|
|
1235
|
-
var Q =
|
|
1236
|
-
function
|
|
1113
|
+
var Q = rn;
|
|
1114
|
+
function nn(e) {
|
|
1237
1115
|
return Array.isArray(e) && e.length > 0;
|
|
1238
1116
|
}
|
|
1239
|
-
var
|
|
1240
|
-
function*
|
|
1241
|
-
let { getVisitorKeys: u, filter: r = () => !0 } = t, n = (D) =>
|
|
1117
|
+
var Dn = nn;
|
|
1118
|
+
function* _e(e, t) {
|
|
1119
|
+
let { getVisitorKeys: u, filter: r = () => !0 } = t, n = (D) => tt(D) && r(D);
|
|
1242
1120
|
for (let D of u(e)) {
|
|
1243
1121
|
let a = e[D];
|
|
1244
|
-
if (Array.isArray(a))
|
|
1245
|
-
|
|
1246
|
-
n(i) && (yield i);
|
|
1247
|
-
else
|
|
1248
|
-
n(a) && (yield a);
|
|
1122
|
+
if (Array.isArray(a)) for (let i of a) n(i) && (yield i);
|
|
1123
|
+
else n(a) && (yield a);
|
|
1249
1124
|
}
|
|
1250
1125
|
}
|
|
1251
|
-
function*
|
|
1126
|
+
function* an(e, t) {
|
|
1252
1127
|
let u = [e];
|
|
1253
1128
|
for (let r = 0; r < u.length; r++) {
|
|
1254
1129
|
let n = u[r];
|
|
1255
|
-
for (let D of
|
|
1256
|
-
yield D, u.push(D);
|
|
1130
|
+
for (let D of _e(n, t)) yield D, u.push(D);
|
|
1257
1131
|
}
|
|
1258
1132
|
}
|
|
1259
|
-
function
|
|
1260
|
-
return
|
|
1133
|
+
function on(e, t) {
|
|
1134
|
+
return _e(e, t).next().done;
|
|
1261
1135
|
}
|
|
1262
|
-
function
|
|
1263
|
-
var s;
|
|
1136
|
+
function uu(e, t, u) {
|
|
1264
1137
|
let { cache: r } = u;
|
|
1265
|
-
if (r.has(e))
|
|
1266
|
-
return r.get(e);
|
|
1138
|
+
if (r.has(e)) return r.get(e);
|
|
1267
1139
|
let { filter: n } = u;
|
|
1268
|
-
if (!n)
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
return a.sort((l, f) => i(l) - i(f) || o(l) - o(f)), r.set(e, a), a;
|
|
1140
|
+
if (!n) return [];
|
|
1141
|
+
let D, a = (u.getChildren?.(e, u) ?? [..._e(e, { getVisitorKeys: u.getVisitorKeys })]).flatMap((s) => (D ?? (D = [e, ...t]), n(s, D) ? [s] : uu(s, D, u))), { locStart: i, locEnd: o } = u;
|
|
1142
|
+
return a.sort((s, l) => i(s) - i(l) || o(s) - o(l)), r.set(e, a), a;
|
|
1272
1143
|
}
|
|
1273
|
-
var
|
|
1274
|
-
function
|
|
1144
|
+
var ru = uu;
|
|
1145
|
+
function sn(e) {
|
|
1275
1146
|
let t = e.type || e.kind || "(unknown type)", u = String(e.name || e.id && (typeof e.id == "object" ? e.id.name : e.id) || e.key && (typeof e.key == "object" ? e.key.name : e.key) || e.value && (typeof e.value == "object" ? "" : String(e.value)) || e.operator || "");
|
|
1276
1147
|
return u.length > 20 && (u = u.slice(0, 19) + "…"), t + (u ? " " + u : "");
|
|
1277
1148
|
}
|
|
1278
|
-
function
|
|
1279
|
-
(e.comments ?? (e.comments = [])).push(t), t.printed = !1, t.nodeDescription =
|
|
1149
|
+
function ut(e, t) {
|
|
1150
|
+
(e.comments ?? (e.comments = [])).push(t), t.printed = !1, t.nodeDescription = sn(e);
|
|
1280
1151
|
}
|
|
1281
|
-
function
|
|
1282
|
-
t.leading = !0, t.trailing = !1,
|
|
1152
|
+
function ge(e, t) {
|
|
1153
|
+
t.leading = !0, t.trailing = !1, ut(e, t);
|
|
1283
1154
|
}
|
|
1284
1155
|
function re(e, t, u) {
|
|
1285
|
-
t.leading = !1, t.trailing = !1, u && (t.marker = u),
|
|
1156
|
+
t.leading = !1, t.trailing = !1, u && (t.marker = u), ut(e, t);
|
|
1286
1157
|
}
|
|
1287
|
-
function
|
|
1288
|
-
t.leading = !1, t.trailing = !0,
|
|
1158
|
+
function Ee(e, t) {
|
|
1159
|
+
t.leading = !1, t.trailing = !0, ut(e, t);
|
|
1289
1160
|
}
|
|
1290
|
-
var
|
|
1291
|
-
function
|
|
1292
|
-
let { locStart: D, locEnd: a } = u, i = D(t), o = a(t), s =
|
|
1161
|
+
var nu = /* @__PURE__ */ new WeakMap();
|
|
1162
|
+
function Du(e, t, u, r, n = []) {
|
|
1163
|
+
let { locStart: D, locEnd: a } = u, i = D(t), o = a(t), s = ru(e, n, { cache: nu, locStart: D, locEnd: a, getVisitorKeys: u.getVisitorKeys, filter: u.printer.canAttachComment, getChildren: u.printer.getCommentChildNodes }), l, f, c = 0, F = s.length;
|
|
1293
1164
|
for (; c < F; ) {
|
|
1294
1165
|
let d = c + F >> 1, p = s[d], E = D(p), g = a(p);
|
|
1295
|
-
if (E <= i && o <= g)
|
|
1296
|
-
return du(p, t, u, p, [p, ...n]);
|
|
1166
|
+
if (E <= i && o <= g) return Du(p, t, u, p, [p, ...n]);
|
|
1297
1167
|
if (g <= i) {
|
|
1298
1168
|
l = p, c = d + 1;
|
|
1299
1169
|
continue;
|
|
@@ -1304,179 +1174,141 @@ function du(e, t, u, r, n = []) {
|
|
|
1304
1174
|
}
|
|
1305
1175
|
throw new Error("Comment location overlaps with node location");
|
|
1306
1176
|
}
|
|
1307
|
-
if (
|
|
1308
|
-
let { quasis: d } = r, p =
|
|
1309
|
-
l &&
|
|
1177
|
+
if (r?.type === "TemplateLiteral") {
|
|
1178
|
+
let { quasis: d } = r, p = je(d, t, u);
|
|
1179
|
+
l && je(d, l, u) !== p && (l = null), f && je(d, f, u) !== p && (f = null);
|
|
1310
1180
|
}
|
|
1311
1181
|
return { enclosingNode: r, precedingNode: l, followingNode: f };
|
|
1312
1182
|
}
|
|
1313
|
-
var
|
|
1314
|
-
function
|
|
1183
|
+
var Pe = () => !1;
|
|
1184
|
+
function ln(e, t) {
|
|
1315
1185
|
let { comments: u } = e;
|
|
1316
|
-
if (delete e.comments, !
|
|
1317
|
-
|
|
1318
|
-
let r = [], { printer: { features: { experimental_avoidAstMutation: n }, handleComments: D = {} }, originalText: a } = t, { ownLine: i = Re, endOfLine: o = Re, remaining: s = Re } = D, l = u.map((f, c) => ({ ...du(e, f, t), comment: f, text: a, options: t, ast: e, isLastComment: u.length - 1 === c }));
|
|
1186
|
+
if (delete e.comments, !Dn(u) || !t.printer.canAttachComment) return;
|
|
1187
|
+
let r = [], { printer: { features: { experimental_avoidAstMutation: n }, handleComments: D = {} }, originalText: a } = t, { ownLine: i = Pe, endOfLine: o = Pe, remaining: s = Pe } = D, l = u.map((f, c) => ({ ...Du(e, f, t), comment: f, text: a, options: t, ast: e, isLastComment: u.length - 1 === c }));
|
|
1319
1188
|
for (let [f, c] of l.entries()) {
|
|
1320
1189
|
let { comment: F, precedingNode: d, enclosingNode: p, followingNode: E, text: g, options: m, ast: b, isLastComment: C } = c, y;
|
|
1321
|
-
if (n ? y = [c] : (F.enclosingNode = p, F.precedingNode = d, F.followingNode = E, y = [F, g, m, b, C]),
|
|
1322
|
-
|
|
1323
|
-
else if (
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
if (bt(r, t), !n)
|
|
1333
|
-
for (let f of u)
|
|
1334
|
-
delete f.precedingNode, delete f.enclosingNode, delete f.followingNode;
|
|
1335
|
-
}
|
|
1336
|
-
var pu = (e) => !/[\S\n\u2028\u2029]/u.test(e);
|
|
1337
|
-
function Bn(e, t, u, r) {
|
|
1190
|
+
if (n ? y = [c] : (F.enclosingNode = p, F.precedingNode = d, F.followingNode = E, y = [F, g, m, b, C]), cn(g, m, l, f)) F.placement = "ownLine", i(...y) || (E ? ge(E, F) : d ? Ee(d, F) : re(p || b, F));
|
|
1191
|
+
else if (fn(g, m, l, f)) F.placement = "endOfLine", o(...y) || (d ? Ee(d, F) : E ? ge(E, F) : re(p || b, F));
|
|
1192
|
+
else if (F.placement = "remaining", !s(...y)) if (d && E) {
|
|
1193
|
+
let w = r.length;
|
|
1194
|
+
w > 0 && r[w - 1].followingNode !== E && ht(r, m), r.push(c);
|
|
1195
|
+
} else d ? Ee(d, F) : E ? ge(E, F) : re(p || b, F);
|
|
1196
|
+
}
|
|
1197
|
+
if (ht(r, t), !n) for (let f of u) delete f.precedingNode, delete f.enclosingNode, delete f.followingNode;
|
|
1198
|
+
}
|
|
1199
|
+
var au = (e) => !/[\S\n\u2028\u2029]/u.test(e);
|
|
1200
|
+
function cn(e, t, u, r) {
|
|
1338
1201
|
let { comment: n, precedingNode: D } = u[r], { locStart: a, locEnd: i } = t, o = a(n);
|
|
1339
|
-
if (D)
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
o = a(l);
|
|
1345
|
-
}
|
|
1202
|
+
if (D) for (let s = r - 1; s >= 0; s--) {
|
|
1203
|
+
let { comment: l, precedingNode: f } = u[s];
|
|
1204
|
+
if (f !== D || !au(e.slice(i(l), o))) break;
|
|
1205
|
+
o = a(l);
|
|
1206
|
+
}
|
|
1346
1207
|
return Q(e, o, { backwards: !0 });
|
|
1347
1208
|
}
|
|
1348
|
-
function
|
|
1209
|
+
function fn(e, t, u, r) {
|
|
1349
1210
|
let { comment: n, followingNode: D } = u[r], { locStart: a, locEnd: i } = t, o = i(n);
|
|
1350
|
-
if (D)
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
o = i(l);
|
|
1356
|
-
}
|
|
1211
|
+
if (D) for (let s = r + 1; s < u.length; s++) {
|
|
1212
|
+
let { comment: l, followingNode: f } = u[s];
|
|
1213
|
+
if (f !== D || !au(e.slice(o, a(l)))) break;
|
|
1214
|
+
o = i(l);
|
|
1215
|
+
}
|
|
1357
1216
|
return Q(e, o);
|
|
1358
1217
|
}
|
|
1359
|
-
function
|
|
1360
|
-
var i, o;
|
|
1218
|
+
function ht(e, t) {
|
|
1361
1219
|
let u = e.length;
|
|
1362
|
-
if (u === 0)
|
|
1363
|
-
return;
|
|
1220
|
+
if (u === 0) return;
|
|
1364
1221
|
let { precedingNode: r, followingNode: n } = e[0], D = t.locStart(n), a;
|
|
1365
1222
|
for (a = u; a > 0; --a) {
|
|
1366
|
-
let { comment:
|
|
1367
|
-
if (
|
|
1368
|
-
|
|
1369
|
-
else
|
|
1370
|
-
break;
|
|
1223
|
+
let { comment: i, precedingNode: o, followingNode: s } = e[a - 1], l = t.originalText.slice(t.locEnd(i), D);
|
|
1224
|
+
if (t.printer.isGap?.(l, t) ?? /^[\s(]*$/u.test(l)) D = t.locStart(i);
|
|
1225
|
+
else break;
|
|
1371
1226
|
}
|
|
1372
|
-
for (let [
|
|
1373
|
-
|
|
1374
|
-
for (let s of [r, n])
|
|
1375
|
-
s.comments && s.comments.length > 1 && s.comments.sort((l, f) => t.locStart(l) - t.locStart(f));
|
|
1227
|
+
for (let [i, { comment: o }] of e.entries()) i < a ? Ee(r, o) : ge(n, o);
|
|
1228
|
+
for (let i of [r, n]) i.comments && i.comments.length > 1 && i.comments.sort((o, s) => t.locStart(o) - t.locStart(s));
|
|
1376
1229
|
e.length = 0;
|
|
1377
1230
|
}
|
|
1378
|
-
function
|
|
1231
|
+
function je(e, t, u) {
|
|
1379
1232
|
let r = u.locStart(t) - 1;
|
|
1380
|
-
for (let n = 1; n < e.length; ++n)
|
|
1381
|
-
if (r < u.locStart(e[n]))
|
|
1382
|
-
return n - 1;
|
|
1233
|
+
for (let n = 1; n < e.length; ++n) if (r < u.locStart(e[n])) return n - 1;
|
|
1383
1234
|
return 0;
|
|
1384
1235
|
}
|
|
1385
|
-
function
|
|
1236
|
+
function Fn(e, t) {
|
|
1386
1237
|
let u = t - 1;
|
|
1387
1238
|
u = Z(e, u, { backwards: !0 }), u = ae(e, u, { backwards: !0 }), u = Z(e, u, { backwards: !0 });
|
|
1388
1239
|
let r = ae(e, u, { backwards: !0 });
|
|
1389
1240
|
return u !== r;
|
|
1390
1241
|
}
|
|
1391
|
-
var
|
|
1392
|
-
function
|
|
1242
|
+
var rt = Fn;
|
|
1243
|
+
function iu(e, t) {
|
|
1393
1244
|
let u = e.node;
|
|
1394
1245
|
return u.printed = !0, t.printer.printComment(e, t);
|
|
1395
1246
|
}
|
|
1396
|
-
function
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
} else
|
|
1403
|
-
r.push(K);
|
|
1247
|
+
function dn(e, t) {
|
|
1248
|
+
let u = e.node, r = [iu(e, t)], { printer: n, originalText: D, locStart: a, locEnd: i } = t;
|
|
1249
|
+
if (n.isBlockComment?.(u)) {
|
|
1250
|
+
let s = Q(D, i(u)) ? Q(D, a(u), { backwards: !0 }) ? K : qt : " ";
|
|
1251
|
+
r.push(s);
|
|
1252
|
+
} else r.push(K);
|
|
1404
1253
|
let o = ae(D, Z(D, i(u)));
|
|
1405
1254
|
return o !== !1 && Q(D, o) && r.push(K), r;
|
|
1406
1255
|
}
|
|
1407
|
-
function
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
return { doc: He([K, l ? K : "", n]), isBlock: o, hasLineSuffix: !0 };
|
|
1256
|
+
function pn(e, t, u) {
|
|
1257
|
+
let r = e.node, n = iu(e, t), { printer: D, originalText: a, locStart: i } = t, o = D.isBlockComment?.(r);
|
|
1258
|
+
if (u?.hasLineSuffix && !u?.isBlock || Q(a, i(r), { backwards: !0 })) {
|
|
1259
|
+
let s = rt(a, i(r));
|
|
1260
|
+
return { doc: Ve([K, s ? K : "", n]), isBlock: o, hasLineSuffix: !0 };
|
|
1413
1261
|
}
|
|
1414
|
-
return !o || u
|
|
1262
|
+
return !o || u?.hasLineSuffix ? { doc: [Ve([" ", n]), Ne], isBlock: o, hasLineSuffix: !0 } : { doc: [" ", n], isBlock: o, hasLineSuffix: !1 };
|
|
1415
1263
|
}
|
|
1416
|
-
function
|
|
1264
|
+
function hn(e, t) {
|
|
1417
1265
|
let u = e.node;
|
|
1418
|
-
if (!u)
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
if ((u.comments || []).filter((i) => !r.has(i)).length === 0)
|
|
1422
|
-
return { leading: "", trailing: "" };
|
|
1266
|
+
if (!u) return {};
|
|
1267
|
+
let r = t[/* @__PURE__ */ Symbol.for("printedComments")];
|
|
1268
|
+
if ((u.comments || []).filter((i) => !r.has(i)).length === 0) return { leading: "", trailing: "" };
|
|
1423
1269
|
let n = [], D = [], a;
|
|
1424
1270
|
return e.each(() => {
|
|
1425
1271
|
let i = e.node;
|
|
1426
|
-
if (r
|
|
1427
|
-
return;
|
|
1272
|
+
if (r?.has(i)) return;
|
|
1428
1273
|
let { leading: o, trailing: s } = i;
|
|
1429
|
-
o ? n.push(
|
|
1274
|
+
o ? n.push(dn(e, t)) : s && (a = pn(e, t, a), D.push(a.doc));
|
|
1430
1275
|
}, "comments"), { leading: n, trailing: D };
|
|
1431
1276
|
}
|
|
1432
|
-
function
|
|
1433
|
-
let { leading: r, trailing: n } =
|
|
1434
|
-
return !r && !n ? t :
|
|
1277
|
+
function Cn(e, t, u) {
|
|
1278
|
+
let { leading: r, trailing: n } = hn(e, u);
|
|
1279
|
+
return !r && !n ? t : Ae(t, (D) => [r, D, n]);
|
|
1435
1280
|
}
|
|
1436
|
-
function
|
|
1437
|
-
let { [Symbol.for("comments")]: t, [Symbol.for("printedComments")]: u } = e;
|
|
1281
|
+
function gn(e) {
|
|
1282
|
+
let { [/* @__PURE__ */ Symbol.for("comments")]: t, [/* @__PURE__ */ Symbol.for("printedComments")]: u } = e;
|
|
1438
1283
|
for (let r of t) {
|
|
1439
|
-
if (!r.printed && !u.has(r))
|
|
1440
|
-
throw new Error('Comment "' + r.value.trim() + '" was not printed. Please report this error!');
|
|
1284
|
+
if (!r.printed && !u.has(r)) throw new Error('Comment "' + r.value.trim() + '" was not printed. Please report this error!');
|
|
1441
1285
|
delete r.printed;
|
|
1442
1286
|
}
|
|
1443
1287
|
}
|
|
1444
|
-
var
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
}, At = class extends Error {
|
|
1450
|
-
constructor() {
|
|
1451
|
-
super(...arguments);
|
|
1452
|
-
we(this, "name", "UndefinedParserError");
|
|
1453
|
-
}
|
|
1454
|
-
}, Nn = { checkIgnorePragma: { category: "Special", type: "boolean", default: !1, description: "Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.", cliCategory: "Other" }, cursorOffset: { category: "Special", type: "int", default: -1, range: { start: -1, end: 1 / 0, step: 1 }, description: "Print (to stderr) where a cursor at the given position would move to after formatting.", cliCategory: "Editor" }, endOfLine: { category: "Global", type: "choice", default: "lf", description: "Which end of line characters to apply.", choices: [{ value: "lf", description: "Line Feed only (\\n), common on Linux and macOS as well as inside git repos" }, { value: "crlf", description: "Carriage Return + Line Feed characters (\\r\\n), common on Windows" }, { value: "cr", description: "Carriage Return character only (\\r), used very rarely" }, { value: "auto", description: `Maintain existing
|
|
1288
|
+
var ou = class extends Error {
|
|
1289
|
+
name = "ConfigError";
|
|
1290
|
+
}, Ct = class extends Error {
|
|
1291
|
+
name = "UndefinedParserError";
|
|
1292
|
+
}, En = { checkIgnorePragma: { category: "Special", type: "boolean", default: !1, description: "Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.", cliCategory: "Other" }, cursorOffset: { category: "Special", type: "int", default: -1, range: { start: -1, end: 1 / 0, step: 1 }, description: "Print (to stderr) where a cursor at the given position would move to after formatting.", cliCategory: "Editor" }, endOfLine: { category: "Global", type: "choice", default: "lf", description: "Which end of line characters to apply.", choices: [{ value: "lf", description: "Line Feed only (\\n), common on Linux and macOS as well as inside git repos" }, { value: "crlf", description: "Carriage Return + Line Feed characters (\\r\\n), common on Windows" }, { value: "cr", description: "Carriage Return character only (\\r), used very rarely" }, { value: "auto", description: `Maintain existing
|
|
1455
1293
|
(mixed values within one file are normalised by looking at what's used after the first line)` }] }, filepath: { category: "Special", type: "path", description: "Specify the input filepath. This will be used to do parser inference.", cliName: "stdin-filepath", cliCategory: "Other", cliDescription: "Path to the file to pretend that stdin comes from." }, insertPragma: { category: "Special", type: "boolean", default: !1, description: "Insert @format pragma into file's first docblock comment.", cliCategory: "Other" }, parser: { category: "Global", type: "choice", default: void 0, description: "Which parser to use.", exception: (e) => typeof e == "string" || typeof e == "function", choices: [{ value: "flow", description: "Flow" }, { value: "babel", description: "JavaScript" }, { value: "babel-flow", description: "Flow" }, { value: "babel-ts", description: "TypeScript" }, { value: "typescript", description: "TypeScript" }, { value: "acorn", description: "JavaScript" }, { value: "espree", description: "JavaScript" }, { value: "meriyah", description: "JavaScript" }, { value: "css", description: "CSS" }, { value: "less", description: "Less" }, { value: "scss", description: "SCSS" }, { value: "json", description: "JSON" }, { value: "json5", description: "JSON5" }, { value: "jsonc", description: "JSON with Comments" }, { value: "json-stringify", description: "JSON.stringify" }, { value: "graphql", description: "GraphQL" }, { value: "markdown", description: "Markdown" }, { value: "mdx", description: "MDX" }, { value: "vue", description: "Vue" }, { value: "yaml", description: "YAML" }, { value: "glimmer", description: "Ember / Handlebars" }, { value: "html", description: "HTML" }, { value: "angular", description: "Angular" }, { value: "lwc", description: "Lightning Web Components" }, { value: "mjml", description: "MJML" }] }, plugins: { type: "path", array: !0, default: [{ value: [] }], category: "Global", description: "Add a plugin. Multiple plugins can be passed as separate `--plugin`s.", exception: (e) => typeof e == "string" || typeof e == "object", cliName: "plugin", cliCategory: "Config" }, printWidth: { category: "Global", type: "int", default: 80, description: "The line length where Prettier will try wrap.", range: { start: 0, end: 1 / 0, step: 1 } }, rangeEnd: { category: "Special", type: "int", default: 1 / 0, range: { start: 0, end: 1 / 0, step: 1 }, description: `Format code ending at a given character offset (exclusive).
|
|
1456
1294
|
The range will extend forwards to the end of the selected statement.`, cliCategory: "Editor" }, rangeStart: { category: "Special", type: "int", default: 0, range: { start: 0, end: 1 / 0, step: 1 }, description: `Format code starting at a given character offset.
|
|
1457
1295
|
The range will extend backwards to the start of the first line containing the selected statement.`, cliCategory: "Editor" }, requirePragma: { category: "Special", type: "boolean", default: !1, description: "Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.", cliCategory: "Other" }, tabWidth: { type: "int", category: "Global", default: 2, description: "Number of spaces per indentation level.", range: { start: 0, end: 1 / 0, step: 1 } }, useTabs: { category: "Global", type: "boolean", default: !1, description: "Indent with tabs instead of spaces." }, embeddedLanguageFormatting: { category: "Global", type: "choice", default: "auto", description: "Control how Prettier formats quoted code embedded in the file.", choices: [{ value: "auto", description: "Format embedded code if Prettier can automatically identify it." }, { value: "off", description: "Never automatically format embedded code." }] } };
|
|
1458
|
-
function
|
|
1296
|
+
function su({ plugins: e = [], showDeprecated: t = !1 } = {}) {
|
|
1459
1297
|
let u = e.flatMap((n) => n.languages ?? []), r = [];
|
|
1460
|
-
for (let n of
|
|
1461
|
-
!t && n.deprecated || (Array.isArray(n.choices) && (t || (n.choices = n.choices.filter((D) => !D.deprecated)), n.name === "parser" && (n.choices = [...n.choices, ..._n(n.choices, u, e)])), n.pluginDefaults = Object.fromEntries(e.filter((D) => {
|
|
1462
|
-
var a;
|
|
1463
|
-
return ((a = D.defaultOptions) == null ? void 0 : a[n.name]) !== void 0;
|
|
1464
|
-
}).map((D) => [D.name, D.defaultOptions[n.name]])), r.push(n));
|
|
1298
|
+
for (let n of yn(Object.assign({}, ...e.map(({ options: D }) => D), En))) !t && n.deprecated || (Array.isArray(n.choices) && (t || (n.choices = n.choices.filter((D) => !D.deprecated)), n.name === "parser" && (n.choices = [...n.choices, ...mn(n.choices, u, e)])), n.pluginDefaults = Object.fromEntries(e.filter((D) => D.defaultOptions?.[n.name] !== void 0).map((D) => [D.name, D.defaultOptions[n.name]])), r.push(n));
|
|
1465
1299
|
return { languages: u, options: r };
|
|
1466
1300
|
}
|
|
1467
|
-
function*
|
|
1301
|
+
function* mn(e, t, u) {
|
|
1468
1302
|
let r = new Set(e.map((n) => n.value));
|
|
1469
|
-
for (let n of t)
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
let a = u.find((o) => o.parsers && Object.prototype.hasOwnProperty.call(o.parsers, D)), i = n.name;
|
|
1475
|
-
a != null && a.name && (i += ` (plugin: ${a.name})`), yield { value: D, description: i };
|
|
1476
|
-
}
|
|
1303
|
+
for (let n of t) if (n.parsers) {
|
|
1304
|
+
for (let D of n.parsers) if (!r.has(D)) {
|
|
1305
|
+
r.add(D);
|
|
1306
|
+
let a = u.find((o) => o.parsers && Object.prototype.hasOwnProperty.call(o.parsers, D)), i = n.name;
|
|
1307
|
+
a?.name && (i += ` (plugin: ${a.name})`), yield { value: D, description: i };
|
|
1477
1308
|
}
|
|
1309
|
+
}
|
|
1478
1310
|
}
|
|
1479
|
-
function
|
|
1311
|
+
function yn(e) {
|
|
1480
1312
|
let t = [];
|
|
1481
1313
|
for (let [u, r] of Object.entries(e)) {
|
|
1482
1314
|
let n = { name: u, ...r };
|
|
@@ -1484,165 +1316,134 @@ function On(e) {
|
|
|
1484
1316
|
}
|
|
1485
1317
|
return t;
|
|
1486
1318
|
}
|
|
1487
|
-
var
|
|
1319
|
+
var vn = Array.prototype.toReversed ?? function() {
|
|
1488
1320
|
return [...this].reverse();
|
|
1489
|
-
},
|
|
1490
|
-
if (Array.isArray(this))
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
function Eu(e) {
|
|
1500
|
-
if (e = e instanceof URL ? e : new URL(e), e.protocol !== "file:")
|
|
1501
|
-
throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);
|
|
1321
|
+
}, Bn = me("toReversed", function() {
|
|
1322
|
+
if (Array.isArray(this)) return vn;
|
|
1323
|
+
}), bn = Bn;
|
|
1324
|
+
function An() {
|
|
1325
|
+
let e = globalThis, t = e.Deno?.build?.os;
|
|
1326
|
+
return typeof t == "string" ? t === "windows" : e.navigator?.platform?.startsWith("Win") ?? e.process?.platform?.startsWith("win") ?? !1;
|
|
1327
|
+
}
|
|
1328
|
+
var wn = An();
|
|
1329
|
+
function lu(e) {
|
|
1330
|
+
if (e = e instanceof URL ? e : new URL(e), e.protocol !== "file:") throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);
|
|
1502
1331
|
return e;
|
|
1503
1332
|
}
|
|
1504
|
-
function
|
|
1505
|
-
return e =
|
|
1333
|
+
function kn(e) {
|
|
1334
|
+
return e = lu(e), decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
|
|
1506
1335
|
}
|
|
1507
|
-
function
|
|
1508
|
-
e =
|
|
1336
|
+
function xn(e) {
|
|
1337
|
+
e = lu(e);
|
|
1509
1338
|
let t = decodeURIComponent(e.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
|
|
1510
1339
|
return e.hostname !== "" && (t = `\\\\${e.hostname}${t}`), t;
|
|
1511
1340
|
}
|
|
1512
|
-
function
|
|
1513
|
-
return
|
|
1341
|
+
function Sn(e) {
|
|
1342
|
+
return wn ? xn(e) : kn(e);
|
|
1514
1343
|
}
|
|
1515
|
-
var
|
|
1516
|
-
function
|
|
1517
|
-
if (!t)
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
return e.find(({ filenames: r }) => r == null ? void 0 : r.some((n) => n.toLowerCase() === u)) ?? e.find(({ extensions: r }) => r == null ? void 0 : r.some((n) => u.endsWith(n)));
|
|
1344
|
+
var In = (e) => String(e).split(/[/\\]/u).pop(), Nn = (e) => String(e).startsWith("file:");
|
|
1345
|
+
function gt(e, t) {
|
|
1346
|
+
if (!t) return;
|
|
1347
|
+
let u = In(t).toLowerCase();
|
|
1348
|
+
return e.find(({ filenames: r }) => r?.some((n) => n.toLowerCase() === u)) ?? e.find(({ extensions: r }) => r?.some((n) => u.endsWith(n)));
|
|
1521
1349
|
}
|
|
1522
|
-
function
|
|
1523
|
-
if (t)
|
|
1524
|
-
return e.find(({ name: u }) => u.toLowerCase() === t) ?? e.find(({ aliases: u }) => u == null ? void 0 : u.includes(t)) ?? e.find(({ extensions: u }) => u == null ? void 0 : u.includes(`.${t}`));
|
|
1350
|
+
function On(e, t) {
|
|
1351
|
+
if (t) return e.find(({ name: u }) => u.toLowerCase() === t) ?? e.find(({ aliases: u }) => u?.includes(t)) ?? e.find(({ extensions: u }) => u?.includes(`.${t}`));
|
|
1525
1352
|
}
|
|
1526
|
-
var
|
|
1527
|
-
function
|
|
1353
|
+
var _n = void 0;
|
|
1354
|
+
function Et(e, t) {
|
|
1528
1355
|
if (t) {
|
|
1529
|
-
if (
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
if (typeof t == "string")
|
|
1536
|
-
return e.find(({ isSupported: u }) => u == null ? void 0 : u({ filepath: t }));
|
|
1356
|
+
if (Nn(t)) try {
|
|
1357
|
+
t = Sn(t);
|
|
1358
|
+
} catch {
|
|
1359
|
+
return;
|
|
1360
|
+
}
|
|
1361
|
+
if (typeof t == "string") return e.find(({ isSupported: u }) => u?.({ filepath: t }));
|
|
1537
1362
|
}
|
|
1538
1363
|
}
|
|
1539
|
-
function
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
if (e
|
|
1546
|
-
return JSON.stringify(e);
|
|
1547
|
-
if (Array.isArray(e))
|
|
1548
|
-
return `[${e.map((u) => Fe.value(u)).join(", ")}]`;
|
|
1364
|
+
function Tn(e, t) {
|
|
1365
|
+
let u = bn(0, e.plugins).flatMap((r) => r.languages ?? []);
|
|
1366
|
+
return (On(u, t.language) ?? gt(u, t.physicalFile) ?? gt(u, t.file) ?? Et(u, t.physicalFile) ?? Et(u, t.file) ?? _n?.(u, t.physicalFile))?.parsers[0];
|
|
1367
|
+
}
|
|
1368
|
+
var cu = Tn, fe = { key: (e) => /^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e) ? e : JSON.stringify(e), value(e) {
|
|
1369
|
+
if (e === null || typeof e != "object") return JSON.stringify(e);
|
|
1370
|
+
if (Array.isArray(e)) return `[${e.map((u) => fe.value(u)).join(", ")}]`;
|
|
1549
1371
|
let t = Object.keys(e);
|
|
1550
|
-
return t.length === 0 ? "{}" : `{ ${t.map((u) => `${
|
|
1551
|
-
}, pair: ({ key: e, value: t }) =>
|
|
1552
|
-
let r = [`${
|
|
1553
|
-
return t && r.push(`we now treat it as ${
|
|
1554
|
-
},
|
|
1372
|
+
return t.length === 0 ? "{}" : `{ ${t.map((u) => `${fe.key(u)}: ${fe.value(e[u])}`).join(", ")} }`;
|
|
1373
|
+
}, pair: ({ key: e, value: t }) => fe.value({ [e]: t }) }, nt = new Proxy(String, { get: () => nt }), R = nt, fu = () => nt, Pn = (e, t, { descriptor: u }) => {
|
|
1374
|
+
let r = [`${R.yellow(typeof e == "string" ? u.key(e) : u.pair(e))} is deprecated`];
|
|
1375
|
+
return t && r.push(`we now treat it as ${R.blue(typeof t == "string" ? u.key(t) : u.pair(t))}`), r.join("; ") + ".";
|
|
1376
|
+
}, Fu = /* @__PURE__ */ Symbol.for("vnopts.VALUE_NOT_EXIST"), we = /* @__PURE__ */ Symbol.for("vnopts.VALUE_UNCHANGED"), mt = " ".repeat(2), jn = (e, t, u) => {
|
|
1555
1377
|
let { text: r, list: n } = u.normalizeExpectedResult(u.schemas[e].expected(u)), D = [];
|
|
1556
|
-
return r && D.push(
|
|
1557
|
-
`)),
|
|
1378
|
+
return r && D.push(yt(e, t, r, u.descriptor)), n && D.push([yt(e, t, n.title, u.descriptor)].concat(n.values.map((a) => du(a, u.loggerPrintWidth))).join(`
|
|
1379
|
+
`)), pu(D, u.loggerPrintWidth);
|
|
1558
1380
|
};
|
|
1559
|
-
function
|
|
1560
|
-
return [`Invalid ${
|
|
1381
|
+
function yt(e, t, u, r) {
|
|
1382
|
+
return [`Invalid ${R.red(r.key(e))} value.`, `Expected ${R.blue(u)},`, `but received ${t === Fu ? R.gray("nothing") : R.red(r.value(t))}.`].join(" ");
|
|
1561
1383
|
}
|
|
1562
|
-
function
|
|
1384
|
+
function du({ text: e, list: t }, u) {
|
|
1563
1385
|
let r = [];
|
|
1564
|
-
return e && r.push(`- ${
|
|
1565
|
-
`)),
|
|
1386
|
+
return e && r.push(`- ${R.blue(e)}`), t && r.push([`- ${R.blue(t.title)}:`].concat(t.values.map((n) => du(n, u - mt.length).replace(/^|\n/g, `$&${mt}`))).join(`
|
|
1387
|
+
`)), pu(r, u);
|
|
1566
1388
|
}
|
|
1567
|
-
function
|
|
1568
|
-
if (e.length === 1)
|
|
1569
|
-
return e[0];
|
|
1389
|
+
function pu(e, t) {
|
|
1390
|
+
if (e.length === 1) return e[0];
|
|
1570
1391
|
let [u, r] = e, [n, D] = e.map((a) => a.split(`
|
|
1571
1392
|
`, 1)[0].length);
|
|
1572
1393
|
return n > t && n > D ? r : u;
|
|
1573
1394
|
}
|
|
1574
|
-
var
|
|
1575
|
-
function
|
|
1576
|
-
if (e === t)
|
|
1577
|
-
|
|
1578
|
-
let r = u == null ? void 0 : u.maxDistance, n = e;
|
|
1395
|
+
var ce = [], Le = [];
|
|
1396
|
+
function $e(e, t, u) {
|
|
1397
|
+
if (e === t) return 0;
|
|
1398
|
+
let r = u?.maxDistance, n = e;
|
|
1579
1399
|
e.length > t.length && (e = t, t = n);
|
|
1580
1400
|
let D = e.length, a = t.length;
|
|
1581
|
-
for (; D > 0 && e.charCodeAt(~-D) === t.charCodeAt(~-a); )
|
|
1582
|
-
D--, a--;
|
|
1401
|
+
for (; D > 0 && e.charCodeAt(~-D) === t.charCodeAt(~-a); ) D--, a--;
|
|
1583
1402
|
let i = 0;
|
|
1584
|
-
for (; i < D && e.charCodeAt(i) === t.charCodeAt(i); )
|
|
1585
|
-
|
|
1586
|
-
if (D
|
|
1587
|
-
return r;
|
|
1588
|
-
if (D === 0)
|
|
1589
|
-
return r !== void 0 && a > r ? r : a;
|
|
1403
|
+
for (; i < D && e.charCodeAt(i) === t.charCodeAt(i); ) i++;
|
|
1404
|
+
if (D -= i, a -= i, r !== void 0 && a - D > r) return r;
|
|
1405
|
+
if (D === 0) return r !== void 0 && a > r ? r : a;
|
|
1590
1406
|
let o, s, l, f, c = 0, F = 0;
|
|
1591
|
-
for (; c < D; )
|
|
1592
|
-
Ke[c] = e.charCodeAt(i + c), fe[c] = ++c;
|
|
1407
|
+
for (; c < D; ) Le[c] = e.charCodeAt(i + c), ce[c] = ++c;
|
|
1593
1408
|
for (; F < a; ) {
|
|
1594
|
-
for (o = t.charCodeAt(i + F), l = F++, s = F, c = 0; c < D; c++)
|
|
1595
|
-
f = o === Ke[c] ? l : l + 1, l = fe[c], s = fe[c] = l > s ? f > s ? s + 1 : f : f > l ? l + 1 : f;
|
|
1409
|
+
for (o = t.charCodeAt(i + F), l = F++, s = F, c = 0; c < D; c++) f = o === Le[c] ? l : l + 1, l = ce[c], s = ce[c] = l > s ? f > s ? s + 1 : f : f > l ? l + 1 : f;
|
|
1596
1410
|
if (r !== void 0) {
|
|
1597
1411
|
let d = s;
|
|
1598
|
-
for (c = 0; c < D; c++)
|
|
1599
|
-
|
|
1600
|
-
if (d > r)
|
|
1601
|
-
return r;
|
|
1412
|
+
for (c = 0; c < D; c++) ce[c] < d && (d = ce[c]);
|
|
1413
|
+
if (d > r) return r;
|
|
1602
1414
|
}
|
|
1603
1415
|
}
|
|
1604
|
-
return
|
|
1605
|
-
}
|
|
1606
|
-
function
|
|
1607
|
-
if (!Array.isArray(t) || t.length === 0)
|
|
1608
|
-
|
|
1609
|
-
let
|
|
1610
|
-
for (let o of t)
|
|
1611
|
-
if (o === e)
|
|
1612
|
-
return o;
|
|
1613
|
-
if (r === 0)
|
|
1614
|
-
return;
|
|
1416
|
+
return ce.length = D, Le.length = D, r !== void 0 && s > r ? r : s;
|
|
1417
|
+
}
|
|
1418
|
+
function Ln(e, t, u) {
|
|
1419
|
+
if (!Array.isArray(t) || t.length === 0) return;
|
|
1420
|
+
let r = u?.maxDistance, n = e.length;
|
|
1421
|
+
for (let o of t) if (o === e) return o;
|
|
1615
1422
|
let D, a = Number.POSITIVE_INFINITY, i = /* @__PURE__ */ new Set();
|
|
1616
1423
|
for (let o of t) {
|
|
1617
|
-
if (i.has(o))
|
|
1618
|
-
continue;
|
|
1424
|
+
if (i.has(o)) continue;
|
|
1619
1425
|
i.add(o);
|
|
1620
1426
|
let s = Math.abs(o.length - n);
|
|
1621
|
-
if (s >= a ||
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
if (r !== void 0 && f > r)
|
|
1625
|
-
continue;
|
|
1427
|
+
if (s >= a || s > r) continue;
|
|
1428
|
+
let l = Number.isFinite(a) ? Math.min(a, r) : r, f = l === void 0 ? $e(e, o) : $e(e, o, { maxDistance: l });
|
|
1429
|
+
if (f > r) continue;
|
|
1626
1430
|
let c = f;
|
|
1627
|
-
if (l !== void 0 && f === l && l === r && (c =
|
|
1628
|
-
break;
|
|
1431
|
+
if (l !== void 0 && f === l && l === r && (c = $e(e, o)), c < a && (a = c, D = o, a === 0)) break;
|
|
1629
1432
|
}
|
|
1630
|
-
if (!(
|
|
1631
|
-
return D;
|
|
1433
|
+
if (!(a > r)) return D;
|
|
1632
1434
|
}
|
|
1633
|
-
var
|
|
1634
|
-
let D = [`Ignored unknown option ${
|
|
1635
|
-
a && D.push(`Did you mean ${
|
|
1636
|
-
},
|
|
1637
|
-
function
|
|
1435
|
+
var hu = (e, t, { descriptor: u, logger: r, schemas: n }) => {
|
|
1436
|
+
let D = [`Ignored unknown option ${R.yellow(u.pair({ key: e, value: t }))}.`], a = Ln(e, Object.keys(n), { maxDistance: 3 });
|
|
1437
|
+
a && D.push(`Did you mean ${R.blue(u.key(a))}?`), r.warn(D.join(" "));
|
|
1438
|
+
}, $n = ["default", "expected", "validate", "deprecated", "forward", "redirect", "overlap", "preprocess", "postprocess"];
|
|
1439
|
+
function Jn(e, t) {
|
|
1638
1440
|
let u = new e(t), r = Object.create(u);
|
|
1639
|
-
for (let n of
|
|
1640
|
-
n in t && (r[n] = Yn(t[n], u, te.prototype[n].length));
|
|
1441
|
+
for (let n of $n) n in t && (r[n] = Rn(t[n], u, te.prototype[n].length));
|
|
1641
1442
|
return r;
|
|
1642
1443
|
}
|
|
1643
1444
|
var te = class {
|
|
1644
1445
|
static create(e) {
|
|
1645
|
-
return
|
|
1446
|
+
return Jn(this, e);
|
|
1646
1447
|
}
|
|
1647
1448
|
constructor(e) {
|
|
1648
1449
|
this.name = e.name;
|
|
@@ -1669,13 +1470,13 @@ var te = class {
|
|
|
1669
1470
|
return e;
|
|
1670
1471
|
}
|
|
1671
1472
|
postprocess(e, t) {
|
|
1672
|
-
return
|
|
1473
|
+
return we;
|
|
1673
1474
|
}
|
|
1674
1475
|
};
|
|
1675
|
-
function
|
|
1476
|
+
function Rn(e, t, u) {
|
|
1676
1477
|
return typeof e == "function" ? (...r) => e(...r.slice(0, u - 1), t, ...r.slice(u - 1)) : () => e;
|
|
1677
1478
|
}
|
|
1678
|
-
var
|
|
1479
|
+
var Mn = class extends te {
|
|
1679
1480
|
constructor(e) {
|
|
1680
1481
|
super(e), this._sourceName = e.sourceName;
|
|
1681
1482
|
}
|
|
@@ -1688,14 +1489,14 @@ var Qn = class extends te {
|
|
|
1688
1489
|
redirect(e, t) {
|
|
1689
1490
|
return this._sourceName;
|
|
1690
1491
|
}
|
|
1691
|
-
},
|
|
1492
|
+
}, Vn = class extends te {
|
|
1692
1493
|
expected() {
|
|
1693
1494
|
return "anything";
|
|
1694
1495
|
}
|
|
1695
1496
|
validate() {
|
|
1696
1497
|
return !0;
|
|
1697
1498
|
}
|
|
1698
|
-
},
|
|
1499
|
+
}, Wn = class extends te {
|
|
1699
1500
|
constructor({ valueSchema: e, name: t = e.name, ...u }) {
|
|
1700
1501
|
super({ ...u, name: t }), this._valueSchema = e;
|
|
1701
1502
|
}
|
|
@@ -1704,8 +1505,7 @@ var Qn = class extends te {
|
|
|
1704
1505
|
return { text: t && `an array of ${t}`, list: u && { title: "an array of the following values", values: [{ list: u }] } };
|
|
1705
1506
|
}
|
|
1706
1507
|
validate(e, t) {
|
|
1707
|
-
if (!Array.isArray(e))
|
|
1708
|
-
return !1;
|
|
1508
|
+
if (!Array.isArray(e)) return !1;
|
|
1709
1509
|
let u = [];
|
|
1710
1510
|
for (let r of e) {
|
|
1711
1511
|
let n = t.normalizeValidateResult(this._valueSchema.validate(r, t), r);
|
|
@@ -1725,7 +1525,7 @@ var Qn = class extends te {
|
|
|
1725
1525
|
let u = [];
|
|
1726
1526
|
for (let r of e) {
|
|
1727
1527
|
let n = t.normalizeForwardResult(this._valueSchema.forward(r, t), r);
|
|
1728
|
-
u.push(...n.map(
|
|
1528
|
+
u.push(...n.map(vt));
|
|
1729
1529
|
}
|
|
1730
1530
|
return u;
|
|
1731
1531
|
}
|
|
@@ -1733,7 +1533,7 @@ var Qn = class extends te {
|
|
|
1733
1533
|
let u = [], r = [];
|
|
1734
1534
|
for (let n of e) {
|
|
1735
1535
|
let D = t.normalizeRedirectResult(this._valueSchema.redirect(n, t), n);
|
|
1736
|
-
"remain" in D && u.push(D.remain), r.push(...D.redirect.map(
|
|
1536
|
+
"remain" in D && u.push(D.remain), r.push(...D.redirect.map(vt));
|
|
1737
1537
|
}
|
|
1738
1538
|
return u.length === 0 ? { redirect: r } : { redirect: r, remain: u };
|
|
1739
1539
|
}
|
|
@@ -1741,10 +1541,10 @@ var Qn = class extends te {
|
|
|
1741
1541
|
return e.concat(t);
|
|
1742
1542
|
}
|
|
1743
1543
|
};
|
|
1744
|
-
function
|
|
1544
|
+
function vt({ from: e, to: t }) {
|
|
1745
1545
|
return { from: [e], to: t };
|
|
1746
1546
|
}
|
|
1747
|
-
var
|
|
1547
|
+
var Kn = class extends te {
|
|
1748
1548
|
expected() {
|
|
1749
1549
|
return "true or false";
|
|
1750
1550
|
}
|
|
@@ -1752,89 +1552,83 @@ var tD = class extends te {
|
|
|
1752
1552
|
return typeof e == "boolean";
|
|
1753
1553
|
}
|
|
1754
1554
|
};
|
|
1755
|
-
function
|
|
1555
|
+
function zn(e, t) {
|
|
1756
1556
|
let u = /* @__PURE__ */ Object.create(null);
|
|
1757
1557
|
for (let r of e) {
|
|
1758
1558
|
let n = r[t];
|
|
1759
|
-
if (u[n])
|
|
1760
|
-
throw new Error(`Duplicate ${t} ${JSON.stringify(n)}`);
|
|
1559
|
+
if (u[n]) throw new Error(`Duplicate ${t} ${JSON.stringify(n)}`);
|
|
1761
1560
|
u[n] = r;
|
|
1762
1561
|
}
|
|
1763
1562
|
return u;
|
|
1764
1563
|
}
|
|
1765
|
-
function
|
|
1564
|
+
function Xn(e, t) {
|
|
1766
1565
|
let u = /* @__PURE__ */ new Map();
|
|
1767
1566
|
for (let r of e) {
|
|
1768
1567
|
let n = r[t];
|
|
1769
|
-
if (u.has(n))
|
|
1770
|
-
throw new Error(`Duplicate ${t} ${JSON.stringify(n)}`);
|
|
1568
|
+
if (u.has(n)) throw new Error(`Duplicate ${t} ${JSON.stringify(n)}`);
|
|
1771
1569
|
u.set(n, r);
|
|
1772
1570
|
}
|
|
1773
1571
|
return u;
|
|
1774
1572
|
}
|
|
1775
|
-
function
|
|
1573
|
+
function Un() {
|
|
1776
1574
|
let e = /* @__PURE__ */ Object.create(null);
|
|
1777
1575
|
return (t) => {
|
|
1778
1576
|
let u = JSON.stringify(t);
|
|
1779
1577
|
return e[u] ? !0 : (e[u] = !0, !1);
|
|
1780
1578
|
};
|
|
1781
1579
|
}
|
|
1782
|
-
function
|
|
1580
|
+
function qn(e, t) {
|
|
1783
1581
|
let u = [], r = [];
|
|
1784
|
-
for (let n of e)
|
|
1785
|
-
t(n) ? u.push(n) : r.push(n);
|
|
1582
|
+
for (let n of e) t(n) ? u.push(n) : r.push(n);
|
|
1786
1583
|
return [u, r];
|
|
1787
1584
|
}
|
|
1788
|
-
function
|
|
1585
|
+
function Hn(e) {
|
|
1789
1586
|
return e === Math.floor(e);
|
|
1790
1587
|
}
|
|
1791
|
-
function
|
|
1792
|
-
if (e === t)
|
|
1793
|
-
return 0;
|
|
1588
|
+
function Gn(e, t) {
|
|
1589
|
+
if (e === t) return 0;
|
|
1794
1590
|
let u = typeof e, r = typeof t, n = ["undefined", "object", "boolean", "number", "string"];
|
|
1795
1591
|
return u !== r ? n.indexOf(u) - n.indexOf(r) : u !== "string" ? Number(e) - Number(t) : e.localeCompare(t);
|
|
1796
1592
|
}
|
|
1797
|
-
function
|
|
1593
|
+
function Yn(e) {
|
|
1798
1594
|
return (...t) => {
|
|
1799
1595
|
let u = e(...t);
|
|
1800
1596
|
return typeof u == "string" ? new Error(u) : u;
|
|
1801
1597
|
};
|
|
1802
1598
|
}
|
|
1803
|
-
function
|
|
1599
|
+
function Bt(e) {
|
|
1804
1600
|
return e === void 0 ? {} : e;
|
|
1805
1601
|
}
|
|
1806
|
-
function
|
|
1807
|
-
if (typeof e == "string")
|
|
1808
|
-
return { text: e };
|
|
1602
|
+
function Cu(e) {
|
|
1603
|
+
if (typeof e == "string") return { text: e };
|
|
1809
1604
|
let { text: t, list: u } = e;
|
|
1810
|
-
return
|
|
1605
|
+
return Qn((t || u) !== void 0, "Unexpected `expected` result, there should be at least one field."), u ? { text: t, list: { title: u.title, values: u.values.map(Cu) } } : { text: t };
|
|
1811
1606
|
}
|
|
1812
|
-
function
|
|
1607
|
+
function bt(e, t) {
|
|
1813
1608
|
return e === !0 ? !0 : e === !1 ? { value: t } : e;
|
|
1814
1609
|
}
|
|
1815
|
-
function
|
|
1610
|
+
function At(e, t, u = !1) {
|
|
1816
1611
|
return e === !1 ? !1 : e === !0 ? u ? !0 : [{ value: t }] : "value" in e ? [e] : e.length === 0 ? !1 : e;
|
|
1817
1612
|
}
|
|
1818
|
-
function
|
|
1613
|
+
function wt(e, t) {
|
|
1819
1614
|
return typeof e == "string" || "key" in e ? { from: t, to: e } : "from" in e ? { from: e.from, to: e.to } : { from: t, to: e.to };
|
|
1820
1615
|
}
|
|
1821
|
-
function
|
|
1822
|
-
return e === void 0 ? [] : Array.isArray(e) ? e.map((u) =>
|
|
1616
|
+
function Ke(e, t) {
|
|
1617
|
+
return e === void 0 ? [] : Array.isArray(e) ? e.map((u) => wt(u, t)) : [wt(e, t)];
|
|
1823
1618
|
}
|
|
1824
|
-
function
|
|
1825
|
-
let u =
|
|
1619
|
+
function kt(e, t) {
|
|
1620
|
+
let u = Ke(typeof e == "object" && "redirect" in e ? e.redirect : e, t);
|
|
1826
1621
|
return u.length === 0 ? { remain: t, redirect: u } : typeof e == "object" && "remain" in e ? { remain: e.remain, redirect: u } : { redirect: u };
|
|
1827
1622
|
}
|
|
1828
|
-
function
|
|
1829
|
-
if (!e)
|
|
1830
|
-
throw new Error(t);
|
|
1623
|
+
function Qn(e, t) {
|
|
1624
|
+
if (!e) throw new Error(t);
|
|
1831
1625
|
}
|
|
1832
|
-
var
|
|
1626
|
+
var Zn = class extends te {
|
|
1833
1627
|
constructor(e) {
|
|
1834
|
-
super(e), this._choices =
|
|
1628
|
+
super(e), this._choices = Xn(e.choices.map((t) => t && typeof t == "object" ? t : { value: t }), "value");
|
|
1835
1629
|
}
|
|
1836
1630
|
expected({ descriptor: e }) {
|
|
1837
|
-
let t = Array.from(this._choices.keys()).map((n) => this._choices.get(n)).filter(({ hidden: n }) => !n).map((n) => n.value).sort(
|
|
1631
|
+
let t = Array.from(this._choices.keys()).map((n) => this._choices.get(n)).filter(({ hidden: n }) => !n).map((n) => n.value).sort(Gn).map(e.value), u = t.slice(0, -2), r = t.slice(-2);
|
|
1838
1632
|
return { text: u.concat(r.join(" or ")).join(", "), list: { title: "one of the following values", values: t } };
|
|
1839
1633
|
}
|
|
1840
1634
|
validate(e) {
|
|
@@ -1852,35 +1646,35 @@ var lD = class extends te {
|
|
|
1852
1646
|
let t = this._choices.get(e);
|
|
1853
1647
|
return t ? t.redirect : void 0;
|
|
1854
1648
|
}
|
|
1855
|
-
},
|
|
1649
|
+
}, eD = class extends te {
|
|
1856
1650
|
expected() {
|
|
1857
1651
|
return "a number";
|
|
1858
1652
|
}
|
|
1859
1653
|
validate(e, t) {
|
|
1860
1654
|
return typeof e == "number";
|
|
1861
1655
|
}
|
|
1862
|
-
},
|
|
1656
|
+
}, tD = class extends eD {
|
|
1863
1657
|
expected() {
|
|
1864
1658
|
return "an integer";
|
|
1865
1659
|
}
|
|
1866
1660
|
validate(e, t) {
|
|
1867
|
-
return t.normalizeValidateResult(super.validate(e, t), e) === !0 &&
|
|
1661
|
+
return t.normalizeValidateResult(super.validate(e, t), e) === !0 && Hn(e);
|
|
1868
1662
|
}
|
|
1869
|
-
},
|
|
1663
|
+
}, xt = class extends te {
|
|
1870
1664
|
expected() {
|
|
1871
1665
|
return "a string";
|
|
1872
1666
|
}
|
|
1873
1667
|
validate(e) {
|
|
1874
1668
|
return typeof e == "string";
|
|
1875
1669
|
}
|
|
1876
|
-
},
|
|
1670
|
+
}, uD = fe, rD = hu, nD = jn, DD = Pn, aD = class {
|
|
1877
1671
|
constructor(e, t) {
|
|
1878
|
-
let { logger: u = console, loggerPrintWidth: r = 80, descriptor: n =
|
|
1672
|
+
let { logger: u = console, loggerPrintWidth: r = 80, descriptor: n = uD, unknown: D = rD, invalid: a = nD, deprecated: i = DD, missing: o = () => !1, required: s = () => !1, preprocess: l = (c) => c, postprocess: f = () => we } = t || {};
|
|
1879
1673
|
this._utils = { descriptor: n, logger: u || { warn: () => {
|
|
1880
|
-
} }, loggerPrintWidth: r, schemas:
|
|
1674
|
+
} }, loggerPrintWidth: r, schemas: zn(e, "name"), normalizeDefaultResult: Bt, normalizeExpectedResult: Cu, normalizeDeprecatedResult: At, normalizeForwardResult: Ke, normalizeRedirectResult: kt, normalizeValidateResult: bt }, this._unknownHandler = D, this._invalidHandler = Yn(a), this._deprecatedHandler = i, this._identifyMissing = (c, F) => !(c in F) || o(c, F), this._identifyRequired = s, this._preprocess = l, this._postprocess = f, this.cleanHistory();
|
|
1881
1675
|
}
|
|
1882
1676
|
cleanHistory() {
|
|
1883
|
-
this._hasDeprecationWarned =
|
|
1677
|
+
this._hasDeprecationWarned = Un();
|
|
1884
1678
|
}
|
|
1885
1679
|
normalize(e) {
|
|
1886
1680
|
let t = {}, u = [this._preprocess(e, this._utils)], r = () => {
|
|
@@ -1893,16 +1687,15 @@ var lD = class extends te {
|
|
|
1893
1687
|
for (let n of Object.keys(this._utils.schemas)) {
|
|
1894
1688
|
let D = this._utils.schemas[n];
|
|
1895
1689
|
if (!(n in t)) {
|
|
1896
|
-
let a =
|
|
1690
|
+
let a = Bt(D.default(this._utils));
|
|
1897
1691
|
"value" in a && u.push({ [n]: a.value });
|
|
1898
1692
|
}
|
|
1899
1693
|
}
|
|
1900
1694
|
r();
|
|
1901
1695
|
for (let n of Object.keys(this._utils.schemas)) {
|
|
1902
|
-
if (!(n in t))
|
|
1903
|
-
continue;
|
|
1696
|
+
if (!(n in t)) continue;
|
|
1904
1697
|
let D = this._utils.schemas[n], a = t[n], i = D.postprocess(a, this._utils);
|
|
1905
|
-
i !==
|
|
1698
|
+
i !== we && (this._applyValidation(i, n, D), t[n] = i);
|
|
1906
1699
|
}
|
|
1907
1700
|
return this._applyPostprocess(t), this._applyRequiredCheck(t), t;
|
|
1908
1701
|
}
|
|
@@ -1914,27 +1707,23 @@ var lD = class extends te {
|
|
|
1914
1707
|
let o = ({ from: f, to: c }) => {
|
|
1915
1708
|
u.push(typeof c == "string" ? { [c]: f } : { [c.key]: c.value });
|
|
1916
1709
|
}, s = ({ value: f, redirectTo: c }) => {
|
|
1917
|
-
let F =
|
|
1918
|
-
if (F !== !1)
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
this._utils.logger.warn(this._deprecatedHandler(p, E, this._utils));
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1710
|
+
let F = At(a.deprecated(f, this._utils), i, !0);
|
|
1711
|
+
if (F !== !1) if (F === !0) this._hasDeprecationWarned(D) || this._utils.logger.warn(this._deprecatedHandler(D, c, this._utils));
|
|
1712
|
+
else for (let { value: d } of F) {
|
|
1713
|
+
let p = { key: D, value: d };
|
|
1714
|
+
if (!this._hasDeprecationWarned(p)) {
|
|
1715
|
+
let E = typeof c == "string" ? { key: c, value: d } : c;
|
|
1716
|
+
this._utils.logger.warn(this._deprecatedHandler(p, E, this._utils));
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1929
1719
|
};
|
|
1930
|
-
|
|
1931
|
-
let l =
|
|
1720
|
+
Ke(a.forward(i, this._utils), i).forEach(o);
|
|
1721
|
+
let l = kt(a.redirect(i, this._utils), i);
|
|
1932
1722
|
if (l.redirect.forEach(o), "remain" in l) {
|
|
1933
1723
|
let f = l.remain;
|
|
1934
1724
|
t[D] = D in t ? a.overlap(t[D], f, this._utils) : f, s({ value: f });
|
|
1935
1725
|
}
|
|
1936
|
-
for (let { from: f, to: c } of l.redirect)
|
|
1937
|
-
s({ value: f, redirectTo: c });
|
|
1726
|
+
for (let { from: f, to: c } of l.redirect) s({ value: f, redirectTo: c });
|
|
1938
1727
|
}
|
|
1939
1728
|
for (let D of n) {
|
|
1940
1729
|
let a = e[D];
|
|
@@ -1945,35 +1734,28 @@ var lD = class extends te {
|
|
|
1945
1734
|
return u;
|
|
1946
1735
|
}
|
|
1947
1736
|
_applyRequiredCheck(e) {
|
|
1948
|
-
for (let t of Object.keys(this._utils.schemas))
|
|
1949
|
-
if (this._identifyMissing(t, e) && this._identifyRequired(t))
|
|
1950
|
-
throw this._invalidHandler(t, vu, this._utils);
|
|
1737
|
+
for (let t of Object.keys(this._utils.schemas)) if (this._identifyMissing(t, e) && this._identifyRequired(t)) throw this._invalidHandler(t, Fu, this._utils);
|
|
1951
1738
|
}
|
|
1952
1739
|
_partitionOptionKeys(e) {
|
|
1953
|
-
let [t, u] =
|
|
1740
|
+
let [t, u] = qn(Object.keys(e).filter((r) => !this._identifyMissing(r, e)), (r) => r in this._utils.schemas);
|
|
1954
1741
|
return { knownKeys: t, unknownKeys: u };
|
|
1955
1742
|
}
|
|
1956
1743
|
_applyValidation(e, t, u) {
|
|
1957
|
-
let r =
|
|
1958
|
-
if (r !== !0)
|
|
1959
|
-
throw this._invalidHandler(t, r.value, this._utils);
|
|
1744
|
+
let r = bt(u.validate(e, this._utils), e);
|
|
1745
|
+
if (r !== !0) throw this._invalidHandler(t, r.value, this._utils);
|
|
1960
1746
|
}
|
|
1961
1747
|
_applyUnknownHandler(e, t, u, r) {
|
|
1962
1748
|
let n = this._unknownHandler(e, t, this._utils);
|
|
1963
|
-
if (n)
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
D in this._utils.schemas ? r(D, a) : u[D] = a;
|
|
1969
|
-
}
|
|
1749
|
+
if (n) for (let D of Object.keys(n)) {
|
|
1750
|
+
if (this._identifyMissing(D, n)) continue;
|
|
1751
|
+
let a = n[D];
|
|
1752
|
+
D in this._utils.schemas ? r(D, a) : u[D] = a;
|
|
1753
|
+
}
|
|
1970
1754
|
}
|
|
1971
1755
|
_applyPostprocess(e) {
|
|
1972
1756
|
let t = this._postprocess(e, this._utils);
|
|
1973
|
-
if (t !==
|
|
1974
|
-
if (t.delete)
|
|
1975
|
-
for (let u of t.delete)
|
|
1976
|
-
delete e[u];
|
|
1757
|
+
if (t !== we) {
|
|
1758
|
+
if (t.delete) for (let u of t.delete) delete e[u];
|
|
1977
1759
|
if (t.override) {
|
|
1978
1760
|
let { knownKeys: u, unknownKeys: r } = this._partitionOptionKeys(t.override);
|
|
1979
1761
|
for (let n of u) {
|
|
@@ -1990,50 +1772,46 @@ var lD = class extends te {
|
|
|
1990
1772
|
}
|
|
1991
1773
|
}
|
|
1992
1774
|
}
|
|
1993
|
-
},
|
|
1994
|
-
function
|
|
1775
|
+
}, Je;
|
|
1776
|
+
function iD(e, t, { logger: u = !1, isCLI: r = !1, passThrough: n = !1, FlagSchema: D, descriptor: a } = {}) {
|
|
1995
1777
|
if (r) {
|
|
1996
|
-
if (!D)
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
throw new Error("'descriptor' option is required.");
|
|
2000
|
-
} else
|
|
2001
|
-
a = Fe;
|
|
1778
|
+
if (!D) throw new Error("'FlagSchema' option is required.");
|
|
1779
|
+
if (!a) throw new Error("'descriptor' option is required.");
|
|
1780
|
+
} else a = fe;
|
|
2002
1781
|
let i = n ? Array.isArray(n) ? (c, F) => n.includes(c) ? { [c]: F } : void 0 : (c, F) => ({ [c]: F }) : (c, F, d) => {
|
|
2003
1782
|
let { _: p, ...E } = d.schemas;
|
|
2004
|
-
return
|
|
2005
|
-
}, o =
|
|
2006
|
-
l &&
|
|
1783
|
+
return hu(c, F, { ...d, schemas: E });
|
|
1784
|
+
}, o = oD(t, { isCLI: r, FlagSchema: D }), s = new aD(o, { logger: u, unknown: i, descriptor: a }), l = u !== !1;
|
|
1785
|
+
l && Je && (s._hasDeprecationWarned = Je);
|
|
2007
1786
|
let f = s.normalize(e);
|
|
2008
|
-
return l && (
|
|
1787
|
+
return l && (Je = s._hasDeprecationWarned), f;
|
|
2009
1788
|
}
|
|
2010
|
-
function
|
|
1789
|
+
function oD(e, { isCLI: t, FlagSchema: u }) {
|
|
2011
1790
|
let r = [];
|
|
2012
|
-
t && r.push(
|
|
2013
|
-
for (let n of e)
|
|
2014
|
-
r.push(mD(n, { isCLI: t, optionInfos: e, FlagSchema: u })), n.alias && t && r.push(Qn.create({ name: n.alias, sourceName: n.name }));
|
|
1791
|
+
t && r.push(Vn.create({ name: "_" }));
|
|
1792
|
+
for (let n of e) r.push(sD(n, { isCLI: t, optionInfos: e, FlagSchema: u })), n.alias && t && r.push(Mn.create({ name: n.alias, sourceName: n.name }));
|
|
2015
1793
|
return r;
|
|
2016
1794
|
}
|
|
2017
|
-
function
|
|
1795
|
+
function sD(e, { isCLI: t, optionInfos: u, FlagSchema: r }) {
|
|
2018
1796
|
let { name: n } = e, D = { name: n }, a, i = {};
|
|
2019
1797
|
switch (e.type) {
|
|
2020
1798
|
case "int":
|
|
2021
|
-
a =
|
|
1799
|
+
a = tD, t && (D.preprocess = Number);
|
|
2022
1800
|
break;
|
|
2023
1801
|
case "string":
|
|
2024
|
-
a =
|
|
1802
|
+
a = xt;
|
|
2025
1803
|
break;
|
|
2026
1804
|
case "choice":
|
|
2027
|
-
a =
|
|
1805
|
+
a = Zn, D.choices = e.choices.map((o) => o?.redirect ? { ...o, redirect: { to: { key: e.name, value: o.redirect } } } : o);
|
|
2028
1806
|
break;
|
|
2029
1807
|
case "boolean":
|
|
2030
|
-
a =
|
|
1808
|
+
a = Kn;
|
|
2031
1809
|
break;
|
|
2032
1810
|
case "flag":
|
|
2033
1811
|
a = r, D.flags = u.flatMap((o) => [o.alias, o.description && o.name, o.oppositeDescription && `no-${o.name}`].filter(Boolean));
|
|
2034
1812
|
break;
|
|
2035
1813
|
case "path":
|
|
2036
|
-
a =
|
|
1814
|
+
a = xt;
|
|
2037
1815
|
break;
|
|
2038
1816
|
default:
|
|
2039
1817
|
throw new Error(`Unexpected type ${e.type}`);
|
|
@@ -2042,173 +1820,154 @@ function mD(e, { isCLI: t, optionInfos: u, FlagSchema: r }) {
|
|
|
2042
1820
|
let o = D.preprocess || ((s) => s);
|
|
2043
1821
|
D.preprocess = (s, l, f) => l.preprocess(o(Array.isArray(s) ? S(0, s, -1) : s), f);
|
|
2044
1822
|
}
|
|
2045
|
-
return e.array ?
|
|
1823
|
+
return e.array ? Wn.create({ ...t ? { preprocess: (o) => Array.isArray(o) ? o : [o] } : {}, ...i, valueSchema: a.create(D) }) : a.create({ ...D, ...i });
|
|
2046
1824
|
}
|
|
2047
|
-
var
|
|
1825
|
+
var lD = iD, cD = Array.prototype.findLast ?? function(e) {
|
|
2048
1826
|
for (let t = this.length - 1; t >= 0; t--) {
|
|
2049
1827
|
let u = this[t];
|
|
2050
|
-
if (e(u, t, this))
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
var Ft = wD, xu = /* @__PURE__ */ new Set(["yaml", "toml"]), Su = ({ node: e }) => Ft(e) && xu.has(e.language);
|
|
2061
|
-
async function kD(e, t, u, r) {
|
|
1828
|
+
if (e(u, t, this)) return u;
|
|
1829
|
+
}
|
|
1830
|
+
}, fD = me("findLast", function() {
|
|
1831
|
+
if (Array.isArray(this)) return cD;
|
|
1832
|
+
}), gu = fD, FD = /* @__PURE__ */ Symbol.for("PRETTIER_IS_FRONT_MATTER"), dD = [];
|
|
1833
|
+
function pD(e) {
|
|
1834
|
+
return !!e?.[FD];
|
|
1835
|
+
}
|
|
1836
|
+
var Dt = pD, Eu = /* @__PURE__ */ new Set(["yaml", "toml"]), mu = ({ node: e }) => Dt(e) && Eu.has(e.language);
|
|
1837
|
+
async function hD(e, t, u, r) {
|
|
2062
1838
|
let { node: n } = u, { language: D } = n;
|
|
2063
|
-
if (!
|
|
2064
|
-
return;
|
|
1839
|
+
if (!Eu.has(D)) return;
|
|
2065
1840
|
let a = n.value.trim(), i;
|
|
2066
1841
|
if (a) {
|
|
2067
|
-
let o = D === "yaml" ? D :
|
|
2068
|
-
if (!o)
|
|
2069
|
-
return;
|
|
1842
|
+
let o = D === "yaml" ? D : cu(r, { language: D });
|
|
1843
|
+
if (!o) return;
|
|
2070
1844
|
i = a ? await e(a, { parser: o }) : "";
|
|
2071
|
-
} else
|
|
2072
|
-
|
|
2073
|
-
return Zt([n.startDelimiter, n.explicitLanguage ?? "", K, i, i ? K : "", n.endDelimiter]);
|
|
1845
|
+
} else i = a;
|
|
1846
|
+
return Kt([n.startDelimiter, n.explicitLanguage ?? "", K, i, i ? K : "", n.endDelimiter]);
|
|
2074
1847
|
}
|
|
2075
|
-
function
|
|
2076
|
-
return
|
|
1848
|
+
function CD(e, t) {
|
|
1849
|
+
return mu({ node: e }) && (delete t.end, delete t.raw, delete t.value), t;
|
|
2077
1850
|
}
|
|
2078
|
-
var
|
|
2079
|
-
function
|
|
1851
|
+
var gD = CD;
|
|
1852
|
+
function ED({ node: e }) {
|
|
2080
1853
|
return e.raw;
|
|
2081
1854
|
}
|
|
2082
|
-
var
|
|
2083
|
-
function
|
|
2084
|
-
let u = e ? (r) => e(r,
|
|
2085
|
-
return t ? new Proxy(u, { apply: (r, n, D) =>
|
|
2086
|
-
}
|
|
2087
|
-
var
|
|
2088
|
-
function
|
|
2089
|
-
if (!t)
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
if (u)
|
|
2093
|
-
return u;
|
|
1855
|
+
var mD = ED, yu = /* @__PURE__ */ new Set(["tokens", "comments", "parent", "enclosingNode", "precedingNode", "followingNode"]), yD = (e) => Object.keys(e).filter((t) => !yu.has(t));
|
|
1856
|
+
function vD(e, t) {
|
|
1857
|
+
let u = e ? (r) => e(r, yu) : yD;
|
|
1858
|
+
return t ? new Proxy(u, { apply: (r, n, D) => Dt(D[0]) ? dD : Reflect.apply(r, n, D) }) : u;
|
|
1859
|
+
}
|
|
1860
|
+
var St = vD;
|
|
1861
|
+
function vu(e, t) {
|
|
1862
|
+
if (!t) throw new Error("parserName is required.");
|
|
1863
|
+
let u = gu(0, e, (n) => n.parsers && Object.prototype.hasOwnProperty.call(n.parsers, t));
|
|
1864
|
+
if (u) return u;
|
|
2094
1865
|
let r = `Couldn't resolve parser "${t}".`;
|
|
2095
|
-
throw r += " Plugins must be explicitly added to the standalone bundle.", new
|
|
1866
|
+
throw r += " Plugins must be explicitly added to the standalone bundle.", new ou(r);
|
|
2096
1867
|
}
|
|
2097
|
-
function
|
|
2098
|
-
if (!t)
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
if (u)
|
|
2102
|
-
return u;
|
|
1868
|
+
function BD(e, t) {
|
|
1869
|
+
if (!t) throw new Error("astFormat is required.");
|
|
1870
|
+
let u = gu(0, e, (n) => n.printers && Object.prototype.hasOwnProperty.call(n.printers, t));
|
|
1871
|
+
if (u) return u;
|
|
2103
1872
|
let r = `Couldn't find plugin for AST format "${t}".`;
|
|
2104
|
-
throw r += " Plugins must be explicitly added to the standalone bundle.", new
|
|
1873
|
+
throw r += " Plugins must be explicitly added to the standalone bundle.", new ou(r);
|
|
2105
1874
|
}
|
|
2106
|
-
function
|
|
2107
|
-
let u =
|
|
2108
|
-
return
|
|
1875
|
+
function at({ plugins: e, parser: t }) {
|
|
1876
|
+
let u = vu(e, t);
|
|
1877
|
+
return Bu(u, t);
|
|
2109
1878
|
}
|
|
2110
|
-
function
|
|
1879
|
+
function Bu(e, t) {
|
|
2111
1880
|
let u = e.parsers[t];
|
|
2112
1881
|
return typeof u == "function" ? u() : u;
|
|
2113
1882
|
}
|
|
2114
|
-
async function
|
|
1883
|
+
async function bD(e, t) {
|
|
2115
1884
|
let u = e.printers[t], r = typeof u == "function" ? await u() : u;
|
|
2116
|
-
return
|
|
1885
|
+
return AD(r);
|
|
2117
1886
|
}
|
|
2118
|
-
var
|
|
2119
|
-
function
|
|
2120
|
-
if (
|
|
2121
|
-
return Ue.get(e);
|
|
1887
|
+
var Re = /* @__PURE__ */ new WeakMap();
|
|
1888
|
+
function AD(e) {
|
|
1889
|
+
if (Re.has(e)) return Re.get(e);
|
|
2122
1890
|
let { features: t, getVisitorKeys: u, embed: r, massageAstNode: n, print: D, ...a } = e;
|
|
2123
|
-
t =
|
|
1891
|
+
t = SD(t);
|
|
2124
1892
|
let i = t.experimental_frontMatterSupport;
|
|
2125
|
-
u =
|
|
1893
|
+
u = St(u, i.massageAstNode || i.embed || i.print);
|
|
2126
1894
|
let o = n;
|
|
2127
1895
|
n && i.massageAstNode && (o = new Proxy(n, { apply(c, F, d) {
|
|
2128
|
-
return
|
|
1896
|
+
return gD(...d), Reflect.apply(c, F, d);
|
|
2129
1897
|
} }));
|
|
2130
1898
|
let s = r;
|
|
2131
1899
|
if (r) {
|
|
2132
1900
|
let c;
|
|
2133
1901
|
s = new Proxy(r, { get(F, d, p) {
|
|
2134
|
-
return d === "getVisitorKeys" ? (c ?? (c = r.getVisitorKeys ?
|
|
2135
|
-
}, apply: (F, d, p) => i.embed &&
|
|
1902
|
+
return d === "getVisitorKeys" ? (c ?? (c = r.getVisitorKeys ? St(r.getVisitorKeys, i.massageAstNode || i.embed) : u), c) : Reflect.get(F, d, p);
|
|
1903
|
+
}, apply: (F, d, p) => i.embed && mu(...p) ? hD : Reflect.apply(F, d, p) });
|
|
2136
1904
|
}
|
|
2137
1905
|
let l = D;
|
|
2138
1906
|
i.print && (l = new Proxy(D, { apply(c, F, d) {
|
|
2139
1907
|
let [p] = d;
|
|
2140
|
-
return
|
|
1908
|
+
return Dt(p.node) ? mD(p) : Reflect.apply(c, F, d);
|
|
2141
1909
|
} }));
|
|
2142
1910
|
let f = { features: t, getVisitorKeys: u, embed: s, massageAstNode: o, print: l, ...a };
|
|
2143
|
-
return
|
|
1911
|
+
return Re.set(e, f), f;
|
|
2144
1912
|
}
|
|
2145
|
-
var
|
|
2146
|
-
function
|
|
2147
|
-
return {
|
|
1913
|
+
var wD = ["clean", "embed", "print"], kD = Object.fromEntries(wD.map((e) => [e, !1]));
|
|
1914
|
+
function xD(e) {
|
|
1915
|
+
return { ...kD, ...e };
|
|
2148
1916
|
}
|
|
2149
|
-
function
|
|
2150
|
-
return { experimental_avoidAstMutation: !1, ...e, experimental_frontMatterSupport:
|
|
1917
|
+
function SD(e) {
|
|
1918
|
+
return { experimental_avoidAstMutation: !1, ...e, experimental_frontMatterSupport: xD(e?.experimental_frontMatterSupport) };
|
|
2151
1919
|
}
|
|
2152
|
-
var
|
|
2153
|
-
async function
|
|
2154
|
-
var f;
|
|
1920
|
+
var It = { astFormat: "estree", printer: {}, originalText: void 0, locStart: null, locEnd: null, getVisitorKeys: null };
|
|
1921
|
+
async function ID(e, t = {}) {
|
|
2155
1922
|
let u = { ...e };
|
|
2156
|
-
if (!u.parser)
|
|
2157
|
-
if (u.filepath) {
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
} else
|
|
2161
|
-
throw new At("No parser and no file path given, couldn't infer a parser.");
|
|
2162
|
-
let r = gu({ plugins: e.plugins, showDeprecated: !0 }).options, n = { ...$t, ...Object.fromEntries(r.filter((c) => c.default !== void 0).map((c) => [c.name, c.default])) }, D = Nu(u.plugins, u.parser), a = await _u(D, u.parser);
|
|
1923
|
+
if (!u.parser) if (u.filepath) {
|
|
1924
|
+
if (u.parser = cu(u, { physicalFile: u.filepath }), !u.parser) throw new Ct(`No parser could be inferred for file "${u.filepath}".`);
|
|
1925
|
+
} else throw new Ct("No parser and no file path given, couldn't infer a parser.");
|
|
1926
|
+
let r = su({ plugins: e.plugins, showDeprecated: !0 }).options, n = { ...It, ...Object.fromEntries(r.filter((f) => f.default !== void 0).map((f) => [f.name, f.default])) }, D = vu(u.plugins, u.parser), a = await Bu(D, u.parser);
|
|
2163
1927
|
u.astFormat = a.astFormat, u.locEnd = a.locEnd, u.locStart = a.locStart;
|
|
2164
|
-
let i =
|
|
1928
|
+
let i = D.printers?.[a.astFormat] ? D : BD(u.plugins, a.astFormat), o = await bD(i, a.astFormat);
|
|
2165
1929
|
u.printer = o, u.getVisitorKeys = o.getVisitorKeys;
|
|
2166
|
-
let s = i.defaultOptions ? Object.fromEntries(Object.entries(i.defaultOptions).filter(([,
|
|
2167
|
-
for (let [
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
new Set(
|
|
2175
|
-
new Set(
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
function VD() {
|
|
1930
|
+
let s = i.defaultOptions ? Object.fromEntries(Object.entries(i.defaultOptions).filter(([, f]) => f !== void 0)) : {}, l = { ...n, ...s };
|
|
1931
|
+
for (let [f, c] of Object.entries(l)) (u[f] === null || u[f] === void 0) && (u[f] = c);
|
|
1932
|
+
return u.parser === "json" && (u.trailingComma = "none"), lD(u, r, { passThrough: Object.keys(It), ...t });
|
|
1933
|
+
}
|
|
1934
|
+
var pe = ID;
|
|
1935
|
+
zu(Xu());
|
|
1936
|
+
var it = { keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], strictBind: ["eval", "arguments"] };
|
|
1937
|
+
new Set(it.keyword);
|
|
1938
|
+
new Set(it.strict);
|
|
1939
|
+
new Set(it.strictBind);
|
|
1940
|
+
var be = (e, t) => (u) => e(t(u));
|
|
1941
|
+
function bu(e) {
|
|
1942
|
+
return { keyword: e.cyan, capitalized: e.yellow, jsxIdentifier: e.yellow, punctuator: e.yellow, number: e.magenta, string: e.green, regex: e.magenta, comment: e.gray, invalid: be(be(e.white, e.bgRed), e.bold), gutter: e.gray, marker: be(e.red, e.bold), message: be(e.red, e.bold), reset: e.reset };
|
|
1943
|
+
}
|
|
1944
|
+
bu(fu());
|
|
1945
|
+
bu(fu());
|
|
1946
|
+
function ND() {
|
|
2184
1947
|
return new Proxy({}, { get: () => (e) => e });
|
|
2185
1948
|
}
|
|
2186
|
-
var
|
|
2187
|
-
function
|
|
1949
|
+
var Nt = /\r\n|[\n\r\u2028\u2029]/;
|
|
1950
|
+
function OD(e, t, u) {
|
|
2188
1951
|
let r = Object.assign({ column: 0, line: -1 }, e.start), n = Object.assign({}, r, e.end), { linesAbove: D = 2, linesBelow: a = 3 } = u || {}, i = r.line, o = r.column, s = n.line, l = n.column, f = Math.max(i - (D + 1), 0), c = Math.min(t.length, s + a);
|
|
2189
1952
|
i === -1 && (f = 0), s === -1 && (c = t.length);
|
|
2190
1953
|
let F = s - i, d = {};
|
|
2191
|
-
if (F)
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
else {
|
|
2202
|
-
let g = t[E - p].length;
|
|
2203
|
-
d[E] = [0, g];
|
|
2204
|
-
}
|
|
1954
|
+
if (F) for (let p = 0; p <= F; p++) {
|
|
1955
|
+
let E = p + i;
|
|
1956
|
+
if (!o) d[E] = !0;
|
|
1957
|
+
else if (p === 0) {
|
|
1958
|
+
let g = t[E - 1].length;
|
|
1959
|
+
d[E] = [o, g - o + 1];
|
|
1960
|
+
} else if (p === F) d[E] = [0, l];
|
|
1961
|
+
else {
|
|
1962
|
+
let g = t[E - p].length;
|
|
1963
|
+
d[E] = [0, g];
|
|
2205
1964
|
}
|
|
2206
|
-
|
|
2207
|
-
|
|
1965
|
+
}
|
|
1966
|
+
else o === l ? o ? d[i] = [o, 0] : d[i] = !0 : d[i] = [o, l - o];
|
|
2208
1967
|
return { start: f, end: c, markerLines: d };
|
|
2209
1968
|
}
|
|
2210
|
-
function
|
|
2211
|
-
let r =
|
|
1969
|
+
function _D(e, t, u = {}) {
|
|
1970
|
+
let r = ND(), n = e.split(Nt), { start: D, end: a, markerLines: i } = OD(t, n, u), o = t.start && typeof t.start.column == "number", s = String(a).length, l = e.split(Nt, a).slice(D, a).map((f, c) => {
|
|
2212
1971
|
let F = D + 1 + c, d = ` ${` ${F}`.slice(-s)} |`, p = i[F], E = !i[F + 1];
|
|
2213
1972
|
if (p) {
|
|
2214
1973
|
let g = "";
|
|
@@ -2218,64 +1977,56 @@ function KD(e, t, u = {}) {
|
|
|
2218
1977
|
`, r.gutter(d.replace(/\d/g, " ")), " ", m, r.marker("^").repeat(b)].join(""), E && u.message && (g += " " + r.message(u.message));
|
|
2219
1978
|
}
|
|
2220
1979
|
return [r.marker(">"), r.gutter(d), f.length > 0 ? ` ${f}` : "", g].join("");
|
|
2221
|
-
} else
|
|
2222
|
-
return ` ${r.gutter(d)}${f.length > 0 ? ` ${f}` : ""}`;
|
|
1980
|
+
} else return ` ${r.gutter(d)}${f.length > 0 ? ` ${f}` : ""}`;
|
|
2223
1981
|
}).join(`
|
|
2224
1982
|
`);
|
|
2225
1983
|
return u.message && !o && (l = `${" ".repeat(s + 1)}${u.message}
|
|
2226
1984
|
${l}`), l;
|
|
2227
1985
|
}
|
|
2228
|
-
async function
|
|
2229
|
-
let u = await
|
|
1986
|
+
async function TD(e, t) {
|
|
1987
|
+
let u = await at(t), r = u.preprocess ? await u.preprocess(e, t) : e;
|
|
2230
1988
|
t.originalText = r;
|
|
2231
1989
|
let n;
|
|
2232
1990
|
try {
|
|
2233
1991
|
n = await u.parse(r, t, t);
|
|
2234
1992
|
} catch (D) {
|
|
2235
|
-
|
|
1993
|
+
PD(D, e);
|
|
2236
1994
|
}
|
|
2237
1995
|
return { text: r, ast: n };
|
|
2238
1996
|
}
|
|
2239
|
-
function
|
|
1997
|
+
function PD(e, t) {
|
|
2240
1998
|
let { loc: u } = e;
|
|
2241
1999
|
if (u) {
|
|
2242
|
-
let r =
|
|
2000
|
+
let r = _D(t, u, {});
|
|
2243
2001
|
throw e.message += `
|
|
2244
2002
|
` + r, e.codeFrame = r, e;
|
|
2245
2003
|
}
|
|
2246
2004
|
throw e;
|
|
2247
2005
|
}
|
|
2248
|
-
var
|
|
2249
|
-
async function
|
|
2250
|
-
if (u.embeddedLanguageFormatting !== "auto")
|
|
2251
|
-
return;
|
|
2006
|
+
var ve = TD;
|
|
2007
|
+
async function jD(e, t, u, r, n) {
|
|
2008
|
+
if (u.embeddedLanguageFormatting !== "auto") return;
|
|
2252
2009
|
let { printer: D } = u, { embed: a } = D;
|
|
2253
|
-
if (!a)
|
|
2254
|
-
|
|
2255
|
-
if (a.length > 2)
|
|
2256
|
-
throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");
|
|
2010
|
+
if (!a) return;
|
|
2011
|
+
if (a.length > 2) throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");
|
|
2257
2012
|
let { hasPrettierIgnore: i } = D, { getVisitorKeys: o } = a, s = [];
|
|
2258
2013
|
c();
|
|
2259
2014
|
let l = e.stack;
|
|
2260
|
-
for (let { print: F, node: d, pathStack: p } of s)
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
throw E;
|
|
2268
|
-
}
|
|
2015
|
+
for (let { print: F, node: d, pathStack: p } of s) try {
|
|
2016
|
+
e.stack = p;
|
|
2017
|
+
let E = await F(f, t, e, u);
|
|
2018
|
+
E && n.set(d, E);
|
|
2019
|
+
} catch (E) {
|
|
2020
|
+
if (globalThis.PRETTIER_DEBUG) throw E;
|
|
2021
|
+
}
|
|
2269
2022
|
e.stack = l;
|
|
2270
2023
|
function f(F, d) {
|
|
2271
|
-
return
|
|
2024
|
+
return LD(F, d, u, r);
|
|
2272
2025
|
}
|
|
2273
2026
|
function c() {
|
|
2274
2027
|
let { node: F } = e;
|
|
2275
|
-
if (F === null || typeof F != "object" || i
|
|
2276
|
-
|
|
2277
|
-
for (let p of o(F))
|
|
2278
|
-
Array.isArray(F[p]) ? e.each(c, p) : e.call(c, p);
|
|
2028
|
+
if (F === null || typeof F != "object" || i?.(e)) return;
|
|
2029
|
+
for (let p of o(F)) Array.isArray(F[p]) ? e.each(c, p) : e.call(c, p);
|
|
2279
2030
|
let d = a(e, u);
|
|
2280
2031
|
if (d) {
|
|
2281
2032
|
if (typeof d == "function") {
|
|
@@ -2286,28 +2037,25 @@ async function UD(e, t, u, r, n) {
|
|
|
2286
2037
|
}
|
|
2287
2038
|
}
|
|
2288
2039
|
}
|
|
2289
|
-
async function
|
|
2290
|
-
let n = await
|
|
2291
|
-
return
|
|
2040
|
+
async function LD(e, t, u, r) {
|
|
2041
|
+
let n = await pe({ ...u, ...t, parentParser: u.parser, originalText: e, cursorOffset: void 0, rangeStart: void 0, rangeEnd: void 0 }, { passThrough: !0 }), { ast: D } = await ve(e, n), a = await r(D, n);
|
|
2042
|
+
return Wt(a);
|
|
2292
2043
|
}
|
|
2293
|
-
function
|
|
2294
|
-
let { originalText: n, [Symbol.for("comments")]: D, locStart: a, locEnd: i, [Symbol.for("printedComments")]: o } = t, { node: s } = e, l = a(s), f = i(s);
|
|
2295
|
-
for (let F of D)
|
|
2296
|
-
a(F) >= l && i(F) <= f && o.add(F);
|
|
2044
|
+
function $D(e, t, u, r) {
|
|
2045
|
+
let { originalText: n, [/* @__PURE__ */ Symbol.for("comments")]: D, locStart: a, locEnd: i, [/* @__PURE__ */ Symbol.for("printedComments")]: o } = t, { node: s } = e, l = a(s), f = i(s);
|
|
2046
|
+
for (let F of D) a(F) >= l && i(F) <= f && o.add(F);
|
|
2297
2047
|
let { printPrettierIgnored: c } = t.printer;
|
|
2298
2048
|
return c ? c(e, t, u, r) : n.slice(l, f);
|
|
2299
2049
|
}
|
|
2300
|
-
var
|
|
2301
|
-
async function
|
|
2302
|
-
({ ast: e } = await
|
|
2303
|
-
let u = /* @__PURE__ */ new Map(), r = new
|
|
2304
|
-
await
|
|
2305
|
-
let D = await
|
|
2306
|
-
if (
|
|
2307
|
-
if (t.nodeAfterCursor && !t.nodeBeforeCursor)
|
|
2308
|
-
|
|
2309
|
-
if (t.nodeBeforeCursor && !t.nodeAfterCursor)
|
|
2310
|
-
return [D, De];
|
|
2050
|
+
var JD = $D;
|
|
2051
|
+
async function Te(e, t) {
|
|
2052
|
+
({ ast: e } = await Au(e, t));
|
|
2053
|
+
let u = /* @__PURE__ */ new Map(), r = new Zr(e), n = /* @__PURE__ */ new Map();
|
|
2054
|
+
await jD(r, a, t, Te, n);
|
|
2055
|
+
let D = await Ot(r, t, a, void 0, n);
|
|
2056
|
+
if (gn(t), t.cursorOffset >= 0) {
|
|
2057
|
+
if (t.nodeAfterCursor && !t.nodeBeforeCursor) return [De, D];
|
|
2058
|
+
if (t.nodeBeforeCursor && !t.nodeAfterCursor) return [D, De];
|
|
2311
2059
|
}
|
|
2312
2060
|
return D;
|
|
2313
2061
|
function a(o, s) {
|
|
@@ -2315,48 +2063,43 @@ async function Je(e, t) {
|
|
|
2315
2063
|
}
|
|
2316
2064
|
function i(o) {
|
|
2317
2065
|
let s = r.node;
|
|
2318
|
-
if (s == null)
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
return u.get(s);
|
|
2323
|
-
let f = Mt(r, t, a, o, n);
|
|
2066
|
+
if (s == null) return "";
|
|
2067
|
+
let l = tt(s) && o === void 0;
|
|
2068
|
+
if (l && u.has(s)) return u.get(s);
|
|
2069
|
+
let f = Ot(r, t, a, o, n);
|
|
2324
2070
|
return l && u.set(s, f), f;
|
|
2325
2071
|
}
|
|
2326
2072
|
}
|
|
2327
|
-
function
|
|
2328
|
-
var o, s;
|
|
2073
|
+
function Ot(e, t, u, r, n) {
|
|
2329
2074
|
let { node: D } = e, { printer: a } = t, i;
|
|
2330
|
-
switch (
|
|
2075
|
+
switch (a.hasPrettierIgnore?.(e) ? i = JD(e, t, u, r) : n.has(D) ? i = n.get(D) : i = a.print(e, t, u, r), D) {
|
|
2331
2076
|
case t.cursorNode:
|
|
2332
|
-
i =
|
|
2077
|
+
i = Ae(i, (o) => [De, o, De]);
|
|
2333
2078
|
break;
|
|
2334
2079
|
case t.nodeBeforeCursor:
|
|
2335
|
-
i =
|
|
2080
|
+
i = Ae(i, (o) => [o, De]);
|
|
2336
2081
|
break;
|
|
2337
2082
|
case t.nodeAfterCursor:
|
|
2338
|
-
i =
|
|
2083
|
+
i = Ae(i, (o) => [De, o]);
|
|
2339
2084
|
break;
|
|
2340
2085
|
}
|
|
2341
|
-
return a.printComment && !
|
|
2086
|
+
return a.printComment && !a.willPrintOwnComments?.(e, t) && (i = Cn(e, i, t)), i;
|
|
2342
2087
|
}
|
|
2343
|
-
async function
|
|
2088
|
+
async function Au(e, t) {
|
|
2344
2089
|
let u = e.comments ?? [];
|
|
2345
|
-
t[Symbol.for("comments")] = u, t[Symbol.for("printedComments")] = /* @__PURE__ */ new Set(),
|
|
2090
|
+
t[/* @__PURE__ */ Symbol.for("comments")] = u, t[/* @__PURE__ */ Symbol.for("printedComments")] = /* @__PURE__ */ new Set(), ln(e, t);
|
|
2346
2091
|
let { printer: { preprocess: r } } = t;
|
|
2347
2092
|
return e = r ? await r(e, t) : e, { ast: e, comments: u };
|
|
2348
2093
|
}
|
|
2349
|
-
function
|
|
2094
|
+
function RD(e, t) {
|
|
2350
2095
|
let { cursorOffset: u, locStart: r, locEnd: n, getVisitorKeys: D } = t, a = (F) => r(F) <= u && n(F) >= u, i = e, o = [e];
|
|
2351
|
-
for (let F of
|
|
2352
|
-
|
|
2353
|
-
if (mn(i, { getVisitorKeys: D }))
|
|
2354
|
-
return { cursorNode: i };
|
|
2096
|
+
for (let F of an(e, { getVisitorKeys: D, filter: a })) o.push(F), i = F;
|
|
2097
|
+
if (on(i, { getVisitorKeys: D })) return { cursorNode: i };
|
|
2355
2098
|
let s, l, f = -1, c = Number.POSITIVE_INFINITY;
|
|
2356
2099
|
for (; o.length > 0 && (s === void 0 || l === void 0); ) {
|
|
2357
2100
|
i = o.pop();
|
|
2358
2101
|
let F = s !== void 0, d = l !== void 0;
|
|
2359
|
-
for (let p of
|
|
2102
|
+
for (let p of _e(i, { getVisitorKeys: D })) {
|
|
2360
2103
|
if (!F) {
|
|
2361
2104
|
let E = n(p);
|
|
2362
2105
|
E <= u && E > f && (s = p, f = E);
|
|
@@ -2369,85 +2112,67 @@ function YD(e, t) {
|
|
|
2369
2112
|
}
|
|
2370
2113
|
return { nodeBeforeCursor: s, nodeAfterCursor: l };
|
|
2371
2114
|
}
|
|
2372
|
-
var
|
|
2373
|
-
function
|
|
2115
|
+
var wu = RD;
|
|
2116
|
+
function MD(e, t) {
|
|
2374
2117
|
let { printer: u } = t, r = u.massageAstNode;
|
|
2375
|
-
if (!r)
|
|
2376
|
-
return e;
|
|
2118
|
+
if (!r) return e;
|
|
2377
2119
|
let { getVisitorKeys: n } = u, { ignoredProperties: D } = r;
|
|
2378
2120
|
return a(e);
|
|
2379
2121
|
function a(i, o) {
|
|
2380
|
-
if (!
|
|
2381
|
-
|
|
2382
|
-
if (Array.isArray(i))
|
|
2383
|
-
return i.map((c) => a(c, o)).filter(Boolean);
|
|
2122
|
+
if (!tt(i)) return i;
|
|
2123
|
+
if (Array.isArray(i)) return i.map((c) => a(c, o)).filter(Boolean);
|
|
2384
2124
|
let s = {}, l = new Set(n(i));
|
|
2385
|
-
for (let c in i)
|
|
2386
|
-
!Object.prototype.hasOwnProperty.call(i, c) || D != null && D.has(c) || (l.has(c) ? s[c] = a(i[c], i) : s[c] = i[c]);
|
|
2125
|
+
for (let c in i) !Object.prototype.hasOwnProperty.call(i, c) || D?.has(c) || (l.has(c) ? s[c] = a(i[c], i) : s[c] = i[c]);
|
|
2387
2126
|
let f = r(i, s, o);
|
|
2388
|
-
if (f !== null)
|
|
2389
|
-
return f ?? s;
|
|
2127
|
+
if (f !== null) return f ?? s;
|
|
2390
2128
|
}
|
|
2391
2129
|
}
|
|
2392
|
-
var
|
|
2130
|
+
var VD = MD, WD = Array.prototype.findLastIndex ?? function(e) {
|
|
2393
2131
|
for (let t = this.length - 1; t >= 0; t--) {
|
|
2394
2132
|
let u = this[t];
|
|
2395
|
-
if (e(u, t, this))
|
|
2396
|
-
return t;
|
|
2133
|
+
if (e(u, t, this)) return t;
|
|
2397
2134
|
}
|
|
2398
2135
|
return -1;
|
|
2399
|
-
},
|
|
2400
|
-
if (Array.isArray(this))
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
let t = ua(0, e, (u) => u.type !== "Program" && u.type !== "File");
|
|
2136
|
+
}, KD = me("findLastIndex", function() {
|
|
2137
|
+
if (Array.isArray(this)) return WD;
|
|
2138
|
+
}), zD = KD, XD = ({ parser: e }) => e === "json" || e === "json5" || e === "jsonc" || e === "json-stringify";
|
|
2139
|
+
function UD(e, t) {
|
|
2140
|
+
return t = new Set(t), e.find((u) => ku.has(u.type) && t.has(u));
|
|
2141
|
+
}
|
|
2142
|
+
function _t(e) {
|
|
2143
|
+
let t = zD(0, e, (u) => u.type !== "Program" && u.type !== "File");
|
|
2408
2144
|
return t === -1 ? e : e.slice(0, t + 1);
|
|
2409
2145
|
}
|
|
2410
|
-
function
|
|
2146
|
+
function qD(e, t, { locStart: u, locEnd: r }) {
|
|
2411
2147
|
let [n, ...D] = e, [a, ...i] = t;
|
|
2412
|
-
if (n === a)
|
|
2413
|
-
return [n, a];
|
|
2148
|
+
if (n === a) return [n, a];
|
|
2414
2149
|
let o = u(n);
|
|
2415
|
-
for (let l of
|
|
2416
|
-
|
|
2417
|
-
a = l;
|
|
2418
|
-
else
|
|
2419
|
-
break;
|
|
2150
|
+
for (let l of _t(i)) if (u(l) >= o) a = l;
|
|
2151
|
+
else break;
|
|
2420
2152
|
let s = r(a);
|
|
2421
|
-
for (let l of
|
|
2422
|
-
if (r(l) <= s)
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
break;
|
|
2426
|
-
if (n === a)
|
|
2427
|
-
break;
|
|
2153
|
+
for (let l of _t(D)) {
|
|
2154
|
+
if (r(l) <= s) n = l;
|
|
2155
|
+
else break;
|
|
2156
|
+
if (n === a) break;
|
|
2428
2157
|
}
|
|
2429
2158
|
return [n, a];
|
|
2430
2159
|
}
|
|
2431
|
-
function
|
|
2160
|
+
function ze(e, t, u, r, n = [], D) {
|
|
2432
2161
|
let { locStart: a, locEnd: i } = u, o = a(e), s = i(e);
|
|
2433
|
-
if (t > s || t < o || D === "rangeEnd" && t === o || D === "rangeStart" && t === s)
|
|
2434
|
-
|
|
2435
|
-
let l = [e, ...n], f = fu(e, l, { cache: Fu, locStart: a, locEnd: i, getVisitorKeys: u.getVisitorKeys, filter: u.printer.canAttachComment, getChildren: u.printer.getCommentChildNodes });
|
|
2162
|
+
if (t > s || t < o || D === "rangeEnd" && t === o || D === "rangeStart" && t === s) return;
|
|
2163
|
+
let l = [e, ...n], f = ru(e, l, { cache: nu, locStart: a, locEnd: i, getVisitorKeys: u.getVisitorKeys, filter: u.printer.canAttachComment, getChildren: u.printer.getCommentChildNodes });
|
|
2436
2164
|
for (let c of f) {
|
|
2437
|
-
let F =
|
|
2438
|
-
if (F)
|
|
2439
|
-
return F;
|
|
2165
|
+
let F = ze(c, t, u, r, l, D);
|
|
2166
|
+
if (F) return F;
|
|
2440
2167
|
}
|
|
2441
|
-
if (r(e, n[0]))
|
|
2442
|
-
return l;
|
|
2168
|
+
if (r(e, n[0])) return l;
|
|
2443
2169
|
}
|
|
2444
|
-
function
|
|
2170
|
+
function HD(e, t) {
|
|
2445
2171
|
return t !== "DeclareExportDeclaration" && e !== "TypeParameterDeclaration" && (e === "Directive" || e === "TypeAlias" || e === "TSExportAssignment" || e.startsWith("Declare") || e.startsWith("TSDeclare") || e.endsWith("Statement") || e.endsWith("Declaration"));
|
|
2446
2172
|
}
|
|
2447
|
-
var
|
|
2448
|
-
function
|
|
2449
|
-
if (!t)
|
|
2450
|
-
return !1;
|
|
2173
|
+
var ku = /* @__PURE__ */ new Set(["JsonRoot", "ObjectExpression", "ArrayExpression", "StringLiteral", "NumericLiteral", "BooleanLiteral", "NullLiteral", "UnaryExpression", "TemplateLiteral"]), GD = /* @__PURE__ */ new Set(["OperationDefinition", "FragmentDefinition", "VariableDefinition", "TypeExtensionDefinition", "ObjectTypeDefinition", "FieldDefinition", "DirectiveDefinition", "EnumTypeDefinition", "EnumValueDefinition", "InputValueDefinition", "InputObjectTypeDefinition", "SchemaDefinition", "OperationTypeDefinition", "InterfaceTypeDefinition", "UnionTypeDefinition", "ScalarTypeDefinition"]);
|
|
2174
|
+
function Tt(e, t, u) {
|
|
2175
|
+
if (!t) return !1;
|
|
2451
2176
|
switch (e.parser) {
|
|
2452
2177
|
case "flow":
|
|
2453
2178
|
case "hermes":
|
|
@@ -2461,244 +2186,220 @@ function Vt(e, t, u) {
|
|
|
2461
2186
|
case "oxc":
|
|
2462
2187
|
case "oxc-ts":
|
|
2463
2188
|
case "__babel_estree":
|
|
2464
|
-
return
|
|
2189
|
+
return HD(t.type, u?.type);
|
|
2465
2190
|
case "json":
|
|
2466
2191
|
case "json5":
|
|
2467
2192
|
case "jsonc":
|
|
2468
2193
|
case "json-stringify":
|
|
2469
|
-
return
|
|
2194
|
+
return ku.has(t.type);
|
|
2470
2195
|
case "graphql":
|
|
2471
|
-
return
|
|
2196
|
+
return GD.has(t.kind);
|
|
2472
2197
|
case "vue":
|
|
2473
2198
|
return t.tag !== "root";
|
|
2474
2199
|
}
|
|
2475
2200
|
return !1;
|
|
2476
2201
|
}
|
|
2477
|
-
function
|
|
2202
|
+
function YD(e, t, u) {
|
|
2478
2203
|
let { rangeStart: r, rangeEnd: n, locStart: D, locEnd: a } = t, i = e.slice(r, n).search(/\S/u), o = i === -1;
|
|
2479
|
-
if (!o)
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
let
|
|
2483
|
-
if (!
|
|
2484
|
-
return;
|
|
2485
|
-
let l = o ? s : Ze(u, n, t, (F) => Vt(t, F), [], "rangeEnd");
|
|
2486
|
-
if (!l)
|
|
2487
|
-
return;
|
|
2204
|
+
if (!o) for (r += i; n > r && !/\S/u.test(e[n - 1]); --n) ;
|
|
2205
|
+
let s = ze(u, r, t, (F, d) => Tt(t, F, d), [], "rangeStart");
|
|
2206
|
+
if (!s) return;
|
|
2207
|
+
let l = o ? s : ze(u, n, t, (F) => Tt(t, F), [], "rangeEnd");
|
|
2208
|
+
if (!l) return;
|
|
2488
2209
|
let f, c;
|
|
2489
|
-
if (
|
|
2490
|
-
let F =
|
|
2210
|
+
if (XD(t)) {
|
|
2211
|
+
let F = UD(s, l);
|
|
2491
2212
|
f = F, c = F;
|
|
2492
|
-
} else
|
|
2493
|
-
[f, c] = Da(s, l, t);
|
|
2213
|
+
} else [f, c] = qD(s, l, t);
|
|
2494
2214
|
return [Math.min(D(f), D(c)), Math.max(a(f), a(c))];
|
|
2495
2215
|
}
|
|
2496
|
-
var
|
|
2497
|
-
async function
|
|
2498
|
-
if (!e || e.trim().length === 0)
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
let a = Le(D, t);
|
|
2216
|
+
var xu = "\uFEFF", Pt = /* @__PURE__ */ Symbol("cursor");
|
|
2217
|
+
async function Su(e, t, u = 0) {
|
|
2218
|
+
if (!e || e.trim().length === 0) return { formatted: "", cursorOffset: -1, comments: [] };
|
|
2219
|
+
let { ast: r, text: n } = await ve(e, t);
|
|
2220
|
+
t.cursorOffset >= 0 && (t = { ...t, ...wu(r, t) });
|
|
2221
|
+
let D = await Te(r, t);
|
|
2222
|
+
u > 0 && (D = zt([K, D], u, t.tabWidth));
|
|
2223
|
+
let a = Oe(D, t);
|
|
2505
2224
|
if (u > 0) {
|
|
2506
2225
|
let o = a.formatted.trim();
|
|
2507
|
-
a.cursorNodeStart !== void 0 && (a.cursorNodeStart -= a.formatted.indexOf(o), a.cursorNodeStart < 0 && (a.cursorNodeStart = 0, a.cursorNodeText = a.cursorNodeText.trimStart()), a.cursorNodeStart + a.cursorNodeText.length > o.length && (a.cursorNodeText = a.cursorNodeText.trimEnd())), a.formatted = o +
|
|
2226
|
+
a.cursorNodeStart !== void 0 && (a.cursorNodeStart -= a.formatted.indexOf(o), a.cursorNodeStart < 0 && (a.cursorNodeStart = 0, a.cursorNodeText = a.cursorNodeText.trimStart()), a.cursorNodeStart + a.cursorNodeText.length > o.length && (a.cursorNodeText = a.cursorNodeText.trimEnd())), a.formatted = o + He(t.endOfLine);
|
|
2508
2227
|
}
|
|
2509
|
-
let i = t[Symbol.for("comments")];
|
|
2228
|
+
let i = t[/* @__PURE__ */ Symbol.for("comments")];
|
|
2510
2229
|
if (t.cursorOffset >= 0) {
|
|
2511
2230
|
let o, s, l, f;
|
|
2512
|
-
if ((t.cursorNode || t.nodeBeforeCursor || t.nodeAfterCursor) && a.cursorNodeText)
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
s = n.slice(o, g);
|
|
2521
|
-
}
|
|
2522
|
-
else
|
|
2523
|
-
o = 0, s = n, l = 0, f = a.formatted;
|
|
2231
|
+
if ((t.cursorNode || t.nodeBeforeCursor || t.nodeAfterCursor) && a.cursorNodeText) if (l = a.cursorNodeStart, f = a.cursorNodeText, t.cursorNode) o = t.locStart(t.cursorNode), s = n.slice(o, t.locEnd(t.cursorNode));
|
|
2232
|
+
else {
|
|
2233
|
+
if (!t.nodeBeforeCursor && !t.nodeAfterCursor) throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");
|
|
2234
|
+
o = t.nodeBeforeCursor ? t.locEnd(t.nodeBeforeCursor) : 0;
|
|
2235
|
+
let g = t.nodeAfterCursor ? t.locStart(t.nodeAfterCursor) : n.length;
|
|
2236
|
+
s = n.slice(o, g);
|
|
2237
|
+
}
|
|
2238
|
+
else o = 0, s = n, l = 0, f = a.formatted;
|
|
2524
2239
|
let c = t.cursorOffset - o;
|
|
2525
|
-
if (s === f)
|
|
2526
|
-
return { formatted: a.formatted, cursorOffset: l + c, comments: i };
|
|
2240
|
+
if (s === f) return { formatted: a.formatted, cursorOffset: l + c, comments: i };
|
|
2527
2241
|
let F = s.split("");
|
|
2528
|
-
F.splice(c, 0,
|
|
2529
|
-
let d = f.split(""), p =
|
|
2530
|
-
for (let g of p)
|
|
2531
|
-
if (g.
|
|
2532
|
-
|
|
2533
|
-
break;
|
|
2534
|
-
} else
|
|
2535
|
-
E += g.count;
|
|
2242
|
+
F.splice(c, 0, Pt);
|
|
2243
|
+
let d = f.split(""), p = Zu(F, d), E = l;
|
|
2244
|
+
for (let g of p) if (g.removed) {
|
|
2245
|
+
if (g.value.includes(Pt)) break;
|
|
2246
|
+
} else E += g.count;
|
|
2536
2247
|
return { formatted: a.formatted, cursorOffset: E, comments: i };
|
|
2537
2248
|
}
|
|
2538
2249
|
return { formatted: a.formatted, cursorOffset: -1, comments: i };
|
|
2539
2250
|
}
|
|
2540
|
-
async function
|
|
2541
|
-
let { ast: u, text: r } = await
|
|
2542
|
-
`, n) + 1), o = r.slice(i, n).match(/^\s*/u)[0], s =
|
|
2251
|
+
async function QD(e, t) {
|
|
2252
|
+
let { ast: u, text: r } = await ve(e, t), [n, D] = YD(r, t, u) ?? [0, 0], a = r.slice(n, D), i = Math.min(n, r.lastIndexOf(`
|
|
2253
|
+
`, n) + 1), o = r.slice(i, n).match(/^\s*/u)[0], s = et(o, t.tabWidth), l = await Su(a, { ...t, rangeStart: 0, rangeEnd: Number.POSITIVE_INFINITY, cursorOffset: t.cursorOffset > n && t.cursorOffset <= D ? t.cursorOffset - n : -1, endOfLine: "lf" }, s), f = l.formatted.trimEnd(), { cursorOffset: c } = t;
|
|
2543
2254
|
c > D ? c += f.length - a.length : l.cursorOffset >= 0 && (c = l.cursorOffset + n);
|
|
2544
2255
|
let F = r.slice(0, n) + f + r.slice(D);
|
|
2545
2256
|
if (t.endOfLine !== "lf") {
|
|
2546
|
-
let d =
|
|
2257
|
+
let d = He(t.endOfLine);
|
|
2547
2258
|
c >= 0 && d === `\r
|
|
2548
|
-
` && (c +=
|
|
2549
|
-
`)), F =
|
|
2259
|
+
` && (c += Mt(F.slice(0, c), `
|
|
2260
|
+
`)), F = xe(0, F, `
|
|
2550
2261
|
`, d);
|
|
2551
2262
|
}
|
|
2552
2263
|
return { formatted: F, cursorOffset: c, comments: l.comments };
|
|
2553
2264
|
}
|
|
2554
|
-
function
|
|
2265
|
+
function Me(e, t, u) {
|
|
2555
2266
|
return typeof t != "number" || Number.isNaN(t) || t < 0 || t > e.length ? u : t;
|
|
2556
2267
|
}
|
|
2557
|
-
function
|
|
2268
|
+
function jt(e, t) {
|
|
2558
2269
|
let { cursorOffset: u, rangeStart: r, rangeEnd: n } = t;
|
|
2559
|
-
return u =
|
|
2270
|
+
return u = Me(e, u, -1), r = Me(e, r, 0), n = Me(e, n, e.length), { ...t, cursorOffset: u, rangeStart: r, rangeEnd: n };
|
|
2560
2271
|
}
|
|
2561
|
-
function
|
|
2562
|
-
let { cursorOffset: u, rangeStart: r, rangeEnd: n, endOfLine: D } =
|
|
2563
|
-
if (a && (e = e.slice(1), u--, r--, n--), D === "auto" && (D =
|
|
2564
|
-
let i = (o) =>
|
|
2272
|
+
function Iu(e, t) {
|
|
2273
|
+
let { cursorOffset: u, rangeStart: r, rangeEnd: n, endOfLine: D } = jt(e, t), a = e.charAt(0) === xu;
|
|
2274
|
+
if (a && (e = e.slice(1), u--, r--, n--), D === "auto" && (D = Dr(e)), e.includes("\r")) {
|
|
2275
|
+
let i = (o) => Mt(e.slice(0, Math.max(o, 0)), `\r
|
|
2565
2276
|
`);
|
|
2566
|
-
u -= i(u), r -= i(r), n -= i(n), e =
|
|
2277
|
+
u -= i(u), r -= i(r), n -= i(n), e = or(e);
|
|
2567
2278
|
}
|
|
2568
|
-
return { hasBOM: a, text: e, options:
|
|
2279
|
+
return { hasBOM: a, text: e, options: jt(e, { ...t, cursorOffset: u, rangeStart: r, rangeEnd: n, endOfLine: D }) };
|
|
2569
2280
|
}
|
|
2570
|
-
async function
|
|
2571
|
-
let u = await
|
|
2281
|
+
async function Lt(e, t) {
|
|
2282
|
+
let u = await at(t);
|
|
2572
2283
|
return !u.hasPragma || u.hasPragma(e);
|
|
2573
2284
|
}
|
|
2574
|
-
async function
|
|
2575
|
-
|
|
2576
|
-
return (r = (u = await dt(t)).hasIgnorePragma) == null ? void 0 : r.call(u, e);
|
|
2285
|
+
async function ZD(e, t) {
|
|
2286
|
+
return (await at(t)).hasIgnorePragma?.(e);
|
|
2577
2287
|
}
|
|
2578
|
-
async function
|
|
2579
|
-
let { hasBOM: u, text: r, options: n } =
|
|
2580
|
-
if (n.rangeStart >= n.rangeEnd && r !== "" || n.requirePragma && !await
|
|
2581
|
-
return { formatted: e, cursorOffset: t.cursorOffset, comments: [] };
|
|
2288
|
+
async function Nu(e, t) {
|
|
2289
|
+
let { hasBOM: u, text: r, options: n } = Iu(e, await pe(t));
|
|
2290
|
+
if (n.rangeStart >= n.rangeEnd && r !== "" || n.requirePragma && !await Lt(r, n) || n.checkIgnorePragma && await ZD(r, n)) return { formatted: e, cursorOffset: t.cursorOffset, comments: [] };
|
|
2582
2291
|
let D;
|
|
2583
|
-
return n.rangeStart > 0 || n.rangeEnd < r.length ? D = await
|
|
2292
|
+
return n.rangeStart > 0 || n.rangeEnd < r.length ? D = await QD(r, n) : (!n.requirePragma && n.insertPragma && n.printer.insertPragma && !await Lt(r, n) && (r = n.printer.insertPragma(r)), D = await Su(r, n)), u && (D.formatted = xu + D.formatted, D.cursorOffset >= 0 && D.cursorOffset++), D;
|
|
2584
2293
|
}
|
|
2585
|
-
async function
|
|
2586
|
-
let { text: r, options: n } =
|
|
2587
|
-
return u && (u.preprocessForPrint && (D.ast = await
|
|
2294
|
+
async function ea(e, t, u) {
|
|
2295
|
+
let { text: r, options: n } = Iu(e, await pe(t)), D = await ve(r, n);
|
|
2296
|
+
return u && (u.preprocessForPrint && (D.ast = await Au(D.ast, n)), u.massage && (D.ast = VD(D.ast, n))), D;
|
|
2588
2297
|
}
|
|
2589
|
-
async function
|
|
2590
|
-
t = await
|
|
2591
|
-
let u = await
|
|
2592
|
-
return
|
|
2298
|
+
async function ta(e, t) {
|
|
2299
|
+
t = await pe(t);
|
|
2300
|
+
let u = await Te(e, t);
|
|
2301
|
+
return Oe(u, t);
|
|
2593
2302
|
}
|
|
2594
|
-
async function
|
|
2595
|
-
let u =
|
|
2303
|
+
async function ua(e, t) {
|
|
2304
|
+
let u = $r(e), { formatted: r } = await Nu(u, { ...t, parser: "__js_expression" });
|
|
2596
2305
|
return r;
|
|
2597
2306
|
}
|
|
2598
|
-
async function
|
|
2599
|
-
t = await
|
|
2600
|
-
let { ast: u } = await
|
|
2601
|
-
return t.cursorOffset >= 0 && (t = { ...t, ...
|
|
2307
|
+
async function ra(e, t) {
|
|
2308
|
+
t = await pe(t);
|
|
2309
|
+
let { ast: u } = await ve(e, t);
|
|
2310
|
+
return t.cursorOffset >= 0 && (t = { ...t, ...wu(u, t) }), Te(u, t);
|
|
2602
2311
|
}
|
|
2603
|
-
async function
|
|
2604
|
-
return
|
|
2312
|
+
async function na(e, t) {
|
|
2313
|
+
return Oe(e, await pe(t));
|
|
2605
2314
|
}
|
|
2606
|
-
var
|
|
2607
|
-
|
|
2608
|
-
var
|
|
2609
|
-
|
|
2610
|
-
function
|
|
2611
|
-
if (t === !1)
|
|
2612
|
-
return !1;
|
|
2315
|
+
var Ou = {};
|
|
2316
|
+
Ue(Ou, { builders: () => Da, printer: () => aa, utils: () => ia });
|
|
2317
|
+
var Da = { join: Ut, line: qt, softline: Pr, hardline: K, literalline: Gt, group: Xt, conditionalGroup: Nr, fill: Ir, lineSuffix: Ve, lineSuffixBoundary: jr, cursor: De, breakParent: Ne, ifBreak: Or, trim: Lr, indent: ke, indentIfBreak: _r, align: de, addAlignmentToDoc: zt, markAsRoot: Kt, dedentToRoot: xr, dedent: Sr, hardlineWithoutBreakParent: Qe, literallineWithoutBreakParent: Ht, label: Tr, concat: (e) => e }, aa = { printDocToString: Oe }, ia = { willBreak: gr, traverseDoc: Ge, findInDoc: Ye, mapDoc: Ie, removeLines: yr, stripTrailingHardline: Wt, replaceEndOfLine: br, canBreak: wr }, oa = "3.8.1", _u = {};
|
|
2318
|
+
Ue(_u, { addDanglingComment: () => re, addLeadingComment: () => ge, addTrailingComment: () => Ee, getAlignmentSize: () => et, getIndentSize: () => da, getMaxContinuousCount: () => Ca, getNextNonSpaceNonCommentCharacter: () => Ea, getNextNonSpaceNonCommentCharacterIndex: () => Sa, getPreferredQuote: () => Ba, getStringWidth: () => Ze, hasNewline: () => Q, hasNewlineInRange: () => Aa, hasSpaces: () => ka, isNextLineEmpty: () => Ta, isNextLineEmptyAfterIndex: () => ct, isPreviousLineEmpty: () => Na, makeString: () => _a, skip: () => ye, skipEverythingButNewLine: () => tu, skipInlineComment: () => ot, skipNewline: () => ae, skipSpaces: () => Z, skipToLineEnd: () => eu, skipTrailingComment: () => st, skipWhitespace: () => tn });
|
|
2319
|
+
function sa(e, t) {
|
|
2320
|
+
if (t === !1) return !1;
|
|
2613
2321
|
if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
|
|
2614
|
-
for (let u = t + 2; u < e.length; ++u)
|
|
2615
|
-
if (e.charAt(u) === "*" && e.charAt(u + 1) === "/")
|
|
2616
|
-
return u + 2;
|
|
2322
|
+
for (let u = t + 2; u < e.length; ++u) if (e.charAt(u) === "*" && e.charAt(u + 1) === "/") return u + 2;
|
|
2617
2323
|
}
|
|
2618
2324
|
return t;
|
|
2619
2325
|
}
|
|
2620
|
-
var
|
|
2621
|
-
function
|
|
2622
|
-
return t === !1 ? !1 : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ?
|
|
2326
|
+
var ot = sa;
|
|
2327
|
+
function la(e, t) {
|
|
2328
|
+
return t === !1 ? !1 : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? tu(e, t) : t;
|
|
2623
2329
|
}
|
|
2624
|
-
var
|
|
2625
|
-
function
|
|
2330
|
+
var st = la;
|
|
2331
|
+
function ca(e, t) {
|
|
2626
2332
|
let u = null, r = t;
|
|
2627
|
-
for (; r !== u; )
|
|
2628
|
-
u = r, r = Z(e, r), r = ht(e, r), r = Ct(e, r), r = ae(e, r);
|
|
2333
|
+
for (; r !== u; ) u = r, r = Z(e, r), r = ot(e, r), r = st(e, r), r = ae(e, r);
|
|
2629
2334
|
return r;
|
|
2630
2335
|
}
|
|
2631
|
-
var
|
|
2632
|
-
function
|
|
2336
|
+
var lt = ca;
|
|
2337
|
+
function fa(e, t) {
|
|
2633
2338
|
let u = null, r = t;
|
|
2634
|
-
for (; r !== u; )
|
|
2635
|
-
|
|
2636
|
-
return r = Ct(e, r), r = ae(e, r), r !== !1 && Q(e, r);
|
|
2339
|
+
for (; r !== u; ) u = r, r = eu(e, r), r = ot(e, r), r = Z(e, r);
|
|
2340
|
+
return r = st(e, r), r = ae(e, r), r !== !1 && Q(e, r);
|
|
2637
2341
|
}
|
|
2638
|
-
var
|
|
2639
|
-
function
|
|
2342
|
+
var ct = fa;
|
|
2343
|
+
function Fa(e, t) {
|
|
2640
2344
|
let u = e.lastIndexOf(`
|
|
2641
2345
|
`);
|
|
2642
|
-
return u === -1 ? 0 :
|
|
2346
|
+
return u === -1 ? 0 : et(e.slice(u + 1).match(/^[\t ]*/u)[0], t);
|
|
2643
2347
|
}
|
|
2644
|
-
var
|
|
2645
|
-
function
|
|
2646
|
-
if (typeof e != "string")
|
|
2647
|
-
throw new TypeError("Expected a string");
|
|
2348
|
+
var da = Fa;
|
|
2349
|
+
function pa(e) {
|
|
2350
|
+
if (typeof e != "string") throw new TypeError("Expected a string");
|
|
2648
2351
|
return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
2649
2352
|
}
|
|
2650
|
-
function
|
|
2651
|
-
let u = e.matchAll(new RegExp(`(?:${
|
|
2353
|
+
function ha(e, t) {
|
|
2354
|
+
let u = e.matchAll(new RegExp(`(?:${pa(t)})+`, "gu"));
|
|
2652
2355
|
return u.reduce || (u = [...u]), u.reduce((r, [n]) => Math.max(r, n.length), 0) / t.length;
|
|
2653
2356
|
}
|
|
2654
|
-
var
|
|
2655
|
-
function
|
|
2656
|
-
let u =
|
|
2357
|
+
var Ca = ha;
|
|
2358
|
+
function ga(e, t) {
|
|
2359
|
+
let u = lt(e, t);
|
|
2657
2360
|
return u === !1 ? "" : e.charAt(u);
|
|
2658
2361
|
}
|
|
2659
|
-
var
|
|
2660
|
-
function
|
|
2661
|
-
let { preferred: u, alternate: r } = t === !0 || t === "'" ?
|
|
2362
|
+
var Ea = ga, Tu = Object.freeze({ character: "'", codePoint: 39 }), Pu = Object.freeze({ character: '"', codePoint: 34 }), ma = Object.freeze({ preferred: Tu, alternate: Pu }), ya = Object.freeze({ preferred: Pu, alternate: Tu });
|
|
2363
|
+
function va(e, t) {
|
|
2364
|
+
let { preferred: u, alternate: r } = t === !0 || t === "'" ? ma : ya, { length: n } = e, D = 0, a = 0;
|
|
2662
2365
|
for (let i = 0; i < n; i++) {
|
|
2663
2366
|
let o = e.charCodeAt(i);
|
|
2664
2367
|
o === u.codePoint ? D++ : o === r.codePoint && a++;
|
|
2665
2368
|
}
|
|
2666
2369
|
return (D > a ? r : u).character;
|
|
2667
2370
|
}
|
|
2668
|
-
var
|
|
2669
|
-
function
|
|
2670
|
-
for (let r = t; r < u; ++r)
|
|
2671
|
-
|
|
2672
|
-
`)
|
|
2673
|
-
return !0;
|
|
2371
|
+
var Ba = va;
|
|
2372
|
+
function ba(e, t, u) {
|
|
2373
|
+
for (let r = t; r < u; ++r) if (e.charAt(r) === `
|
|
2374
|
+
`) return !0;
|
|
2674
2375
|
return !1;
|
|
2675
2376
|
}
|
|
2676
|
-
var
|
|
2677
|
-
function
|
|
2377
|
+
var Aa = ba;
|
|
2378
|
+
function wa(e, t, u = {}) {
|
|
2678
2379
|
return Z(e, u.backwards ? t - 1 : t, u) !== t;
|
|
2679
2380
|
}
|
|
2680
|
-
var
|
|
2681
|
-
function
|
|
2682
|
-
return
|
|
2381
|
+
var ka = wa;
|
|
2382
|
+
function xa(e, t, u) {
|
|
2383
|
+
return lt(e, u(t));
|
|
2683
2384
|
}
|
|
2684
|
-
function
|
|
2685
|
-
return arguments.length === 2 || typeof t == "number" ?
|
|
2385
|
+
function Sa(e, t) {
|
|
2386
|
+
return arguments.length === 2 || typeof t == "number" ? lt(e, t) : xa(...arguments);
|
|
2686
2387
|
}
|
|
2687
|
-
function
|
|
2688
|
-
return
|
|
2388
|
+
function Ia(e, t, u) {
|
|
2389
|
+
return rt(e, u(t));
|
|
2689
2390
|
}
|
|
2690
|
-
function
|
|
2691
|
-
return arguments.length === 2 || typeof t == "number" ?
|
|
2391
|
+
function Na(e, t) {
|
|
2392
|
+
return arguments.length === 2 || typeof t == "number" ? rt(e, t) : Ia(...arguments);
|
|
2692
2393
|
}
|
|
2693
|
-
function
|
|
2694
|
-
return
|
|
2394
|
+
function Oa(e, t, u) {
|
|
2395
|
+
return ct(e, u(t));
|
|
2695
2396
|
}
|
|
2696
|
-
function
|
|
2697
|
-
let r = t === '"' ? "'" : '"', n =
|
|
2397
|
+
function _a(e, t, u) {
|
|
2398
|
+
let r = t === '"' ? "'" : '"', n = xe(0, e, /\\(.)|(["'])/gsu, (D, a, i) => a === r ? a : i === t ? "\\" + i : i || (u && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(a) ? a : "\\" + a));
|
|
2698
2399
|
return t + n + t;
|
|
2699
2400
|
}
|
|
2700
|
-
function
|
|
2701
|
-
return arguments.length === 2 || typeof t == "number" ?
|
|
2401
|
+
function Ta(e, t) {
|
|
2402
|
+
return arguments.length === 2 || typeof t == "number" ? ct(e, t) : Oa(...arguments);
|
|
2702
2403
|
}
|
|
2703
2404
|
function ne(e, t = 1) {
|
|
2704
2405
|
return async (...u) => {
|
|
@@ -2706,23 +2407,23 @@ function ne(e, t = 1) {
|
|
|
2706
2407
|
return u[t] = { ...r, plugins: Array.isArray(n) ? n : Object.values(n) }, e(...u);
|
|
2707
2408
|
};
|
|
2708
2409
|
}
|
|
2709
|
-
var
|
|
2710
|
-
async function
|
|
2711
|
-
let { formatted: u } = await
|
|
2410
|
+
var ju = ne(Nu);
|
|
2411
|
+
async function Lu(e, t) {
|
|
2412
|
+
let { formatted: u } = await ju(e, { ...t, cursorOffset: -1 });
|
|
2712
2413
|
return u;
|
|
2713
2414
|
}
|
|
2714
|
-
async function
|
|
2715
|
-
return await
|
|
2415
|
+
async function Pa(e, t) {
|
|
2416
|
+
return await Lu(e, t) === e;
|
|
2716
2417
|
}
|
|
2717
|
-
var
|
|
2418
|
+
var ja = ne(su, 0), La = { parse: ne(ea), formatAST: ne(ta), formatDoc: ne(ua), printToDoc: ne(ra), printDocToString: ne(na) };
|
|
2718
2419
|
export {
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2420
|
+
La as __debug,
|
|
2421
|
+
Pa as check,
|
|
2422
|
+
Uu as default,
|
|
2423
|
+
Ou as doc,
|
|
2424
|
+
Lu as format,
|
|
2425
|
+
ju as formatWithCursor,
|
|
2426
|
+
ja as getSupportInfo,
|
|
2427
|
+
_u as util,
|
|
2428
|
+
oa as version
|
|
2728
2429
|
};
|