eddyter 1.3.61 → 1.3.63

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.
@@ -0,0 +1,2211 @@
1
+ var yt = Object.create, Me = Object.defineProperty, vt = Object.getOwnPropertyDescriptor, Bt = Object.getOwnPropertyNames, bt = Object.getPrototypeOf, At = Object.prototype.hasOwnProperty, ju = (e) => {
2
+ throw TypeError(e);
3
+ }, wt = (e, u) => () => (u || e((u = { exports: {} }).exports, u), u.exports), Ve = (e, u) => {
4
+ for (var t in u) Me(e, t, { get: u[t], enumerable: !0 });
5
+ }, kt = (e, u, t, r) => {
6
+ if (u && typeof u == "object" || typeof u == "function") for (let n of Bt(u)) !At.call(e, n) && n !== t && Me(e, n, { get: () => u[n], enumerable: !(r = vt(u, n)) || r.enumerable });
7
+ return e;
8
+ }, St = (e, u, t) => (t = e != null ? yt(bt(e)) : {}, kt(Me(t, "default", { value: e, enumerable: !0 }), e)), xt = (e, u, t) => u.has(e) || ju("Cannot " + t), Nt = (e, u, t) => u.has(e) ? ju("Cannot add the same private member more than once") : u instanceof WeakSet ? u.add(e) : u.set(e, t), De = (e, u, t) => (xt(e, u, "access private method"), t), Ot = wt((e) => {
9
+ Object.defineProperty(e, "__esModule", { value: !0 });
10
+ function u() {
11
+ return new Proxy({}, { get: () => (D) => D });
12
+ }
13
+ var t = /\r\n|[\n\r\u2028\u2029]/;
14
+ function r(D, a, i) {
15
+ let o = Object.assign({ column: 0, line: -1 }, D.start), s = Object.assign({}, o, D.end), { linesAbove: c = 2, linesBelow: F = 3 } = i || {}, l = o.line, d = o.column, f = s.line, h = s.column, p = Math.max(l - (c + 1), 0), C = Math.min(a.length, f + F);
16
+ l === -1 && (p = 0), f === -1 && (C = a.length);
17
+ let E = f - l, m = {};
18
+ if (E) for (let y = 0; y <= E; y++) {
19
+ let g = y + l;
20
+ if (!d) m[g] = !0;
21
+ else if (y === 0) {
22
+ let B = a[g - 1].length;
23
+ m[g] = [d, B - d + 1];
24
+ } else if (y === E) m[g] = [0, h];
25
+ else {
26
+ let B = a[g - y].length;
27
+ m[g] = [0, B];
28
+ }
29
+ }
30
+ else d === h ? d ? m[l] = [d, 0] : m[l] = !0 : m[l] = [d, h - d];
31
+ return { start: p, end: C, markerLines: m };
32
+ }
33
+ function n(D, a, i = {}) {
34
+ let o = u(), s = D.split(t), { start: c, end: F, markerLines: l } = r(a, s, i), d = a.start && typeof a.start.column == "number", f = String(F).length, h = D.split(t, F).slice(c, F).map((p, C) => {
35
+ let E = c + 1 + C, m = ` ${` ${E}`.slice(-f)} |`, y = l[E], g = !l[E + 1];
36
+ if (y) {
37
+ let B = "";
38
+ if (Array.isArray(y)) {
39
+ let M = p.slice(0, Math.max(y[0] - 1, 0)).replace(/[^\t]/g, " "), ce = y[1] || 1;
40
+ B = [`
41
+ `, o.gutter(m.replace(/\d/g, " ")), " ", M, o.marker("^").repeat(ce)].join(""), g && i.message && (B += " " + o.message(i.message));
42
+ }
43
+ return [o.marker(">"), o.gutter(m), p.length > 0 ? ` ${p}` : "", B].join("");
44
+ } else return ` ${o.gutter(m)}${p.length > 0 ? ` ${p}` : ""}`;
45
+ }).join(`
46
+ `);
47
+ return i.message && !d && (h = `${" ".repeat(f + 1)}${i.message}
48
+ ${h}`), h;
49
+ }
50
+ e.codeFrameColumns = n;
51
+ }), _t = {};
52
+ Ve(_t, { __debug: () => JD, check: () => qD, doc: () => ht, format: () => Et, formatWithCursor: () => mt, getSupportInfo: () => UD, util: () => Ct, version: () => mD });
53
+ var jt = (e, u, t, r) => {
54
+ if (!(e && u == null)) return u.replaceAll ? u.replaceAll(t, r) : t.global ? u.replace(t, r) : u.split(t).join(r);
55
+ }, me = jt, Tt = class {
56
+ diff(e, u, t = {}) {
57
+ let r;
58
+ typeof t == "function" ? (r = t, t = {}) : "callback" in t && (r = t.callback);
59
+ let n = this.castInput(e, t), D = this.castInput(u, t), a = this.removeEmpty(this.tokenize(n, t)), i = this.removeEmpty(this.tokenize(D, t));
60
+ return this.diffWithOptionsObj(a, i, t, r);
61
+ }
62
+ diffWithOptionsObj(e, u, t, r) {
63
+ var n;
64
+ let D = (C) => {
65
+ if (C = this.postProcess(C, t), r) {
66
+ setTimeout(function() {
67
+ r(C);
68
+ }, 0);
69
+ return;
70
+ } else return C;
71
+ }, a = u.length, i = e.length, o = 1, s = a + i;
72
+ t.maxEditLength != null && (s = Math.min(s, t.maxEditLength));
73
+ let c = (n = t.timeout) !== null && n !== void 0 ? n : 1 / 0, F = Date.now() + c, l = [{ oldPos: -1, lastComponent: void 0 }], d = this.extractCommon(l[0], u, e, 0, t);
74
+ if (l[0].oldPos + 1 >= i && d + 1 >= a) return D(this.buildValues(l[0].lastComponent, u, e));
75
+ let f = -1 / 0, h = 1 / 0, p = () => {
76
+ for (let C = Math.max(f, -o); C <= Math.min(h, o); C += 2) {
77
+ let E, m = l[C - 1], y = l[C + 1];
78
+ m && (l[C - 1] = void 0);
79
+ let g = !1;
80
+ if (y) {
81
+ let M = y.oldPos - C;
82
+ g = y && 0 <= M && M < a;
83
+ }
84
+ let B = m && m.oldPos + 1 < i;
85
+ if (!g && !B) {
86
+ l[C] = void 0;
87
+ continue;
88
+ }
89
+ if (!B || g && m.oldPos < y.oldPos ? E = this.addToPath(y, !0, !1, 0, t) : E = this.addToPath(m, !1, !0, 1, t), d = this.extractCommon(E, u, e, C, t), E.oldPos + 1 >= i && d + 1 >= a) return D(this.buildValues(E.lastComponent, u, e)) || !0;
90
+ l[C] = E, E.oldPos + 1 >= i && (h = Math.min(h, C - 1)), d + 1 >= a && (f = Math.max(f, C + 1));
91
+ }
92
+ o++;
93
+ };
94
+ if (r) (function C() {
95
+ setTimeout(function() {
96
+ if (o > s || Date.now() > F) return r(void 0);
97
+ p() || C();
98
+ }, 0);
99
+ })();
100
+ else for (; o <= s && Date.now() <= F; ) {
101
+ let C = p();
102
+ if (C) return C;
103
+ }
104
+ }
105
+ addToPath(e, u, t, r, n) {
106
+ let D = e.lastComponent;
107
+ return D && !n.oneChangePerToken && D.added === u && D.removed === t ? { oldPos: e.oldPos + r, lastComponent: { count: D.count + 1, added: u, removed: t, previousComponent: D.previousComponent } } : { oldPos: e.oldPos + r, lastComponent: { count: 1, added: u, removed: t, previousComponent: D } };
108
+ }
109
+ extractCommon(e, u, t, r, n) {
110
+ let D = u.length, a = t.length, i = e.oldPos, o = i - r, s = 0;
111
+ for (; o + 1 < D && i + 1 < a && this.equals(t[i + 1], u[o + 1], n); ) o++, i++, s++, n.oneChangePerToken && (e.lastComponent = { count: 1, previousComponent: e.lastComponent, added: !1, removed: !1 });
112
+ return s && !n.oneChangePerToken && (e.lastComponent = { count: s, previousComponent: e.lastComponent, added: !1, removed: !1 }), e.oldPos = i, o;
113
+ }
114
+ equals(e, u, t) {
115
+ return t.comparator ? t.comparator(e, u) : e === u || !!t.ignoreCase && e.toLowerCase() === u.toLowerCase();
116
+ }
117
+ removeEmpty(e) {
118
+ let u = [];
119
+ for (let t = 0; t < e.length; t++) e[t] && u.push(e[t]);
120
+ return u;
121
+ }
122
+ castInput(e, u) {
123
+ return e;
124
+ }
125
+ tokenize(e, u) {
126
+ return Array.from(e);
127
+ }
128
+ join(e) {
129
+ return e.join("");
130
+ }
131
+ postProcess(e, u) {
132
+ return e;
133
+ }
134
+ get useLongestToken() {
135
+ return !1;
136
+ }
137
+ buildValues(e, u, t) {
138
+ let r = [], n;
139
+ for (; e; ) r.push(e), n = e.previousComponent, delete e.previousComponent, e = n;
140
+ r.reverse();
141
+ let D = r.length, a = 0, i = 0, o = 0;
142
+ for (; a < D; a++) {
143
+ let s = r[a];
144
+ if (s.removed) s.value = this.join(t.slice(o, o + s.count)), o += s.count;
145
+ else {
146
+ if (!s.added && this.useLongestToken) {
147
+ let c = u.slice(i, i + s.count);
148
+ c = c.map(function(F, l) {
149
+ let d = t[o + l];
150
+ return d.length > F.length ? d : F;
151
+ }), s.value = this.join(c);
152
+ } else s.value = this.join(u.slice(i, i + s.count));
153
+ i += s.count, s.added || (o += s.count);
154
+ }
155
+ }
156
+ return r;
157
+ }
158
+ }, It = class extends Tt {
159
+ tokenize(e) {
160
+ return e.slice();
161
+ }
162
+ join(e) {
163
+ return e;
164
+ }
165
+ removeEmpty(e) {
166
+ return e;
167
+ }
168
+ }, Pt = new It();
169
+ function $t(e, u, t) {
170
+ return Pt.diff(e, u, t);
171
+ }
172
+ function Lt(e) {
173
+ let u = e.indexOf("\r");
174
+ return u !== -1 ? e.charAt(u + 1) === `
175
+ ` ? "crlf" : "cr" : "lf";
176
+ }
177
+ function ze(e) {
178
+ switch (e) {
179
+ case "cr":
180
+ return "\r";
181
+ case "crlf":
182
+ return `\r
183
+ `;
184
+ default:
185
+ return `
186
+ `;
187
+ }
188
+ }
189
+ function Tu(e, u) {
190
+ let t;
191
+ switch (u) {
192
+ case `
193
+ `:
194
+ t = /\n/gu;
195
+ break;
196
+ case "\r":
197
+ t = /\r/gu;
198
+ break;
199
+ case `\r
200
+ `:
201
+ t = /\r\n/gu;
202
+ break;
203
+ default:
204
+ throw new Error(`Unexpected "eol" ${JSON.stringify(u)}.`);
205
+ }
206
+ let r = e.match(t);
207
+ return r ? r.length : 0;
208
+ }
209
+ function Rt(e) {
210
+ return me(!1, e, /\r\n?/gu, `
211
+ `);
212
+ }
213
+ var Q = "string", T = "array", q = "cursor", I = "indent", P = "align", $ = "trim", w = "group", O = "fill", k = "if-break", L = "indent-if-break", R = "line-suffix", W = "line-suffix-boundary", b = "line", _ = "label", S = "break-parent", Iu = /* @__PURE__ */ new Set([q, I, P, $, w, O, k, L, R, W, b, _, S]), Wt = (e, u, t) => {
214
+ if (!(e && u == null)) return Array.isArray(u) || typeof u == "string" ? u[t < 0 ? u.length + t : t] : u.at(t);
215
+ }, v = Wt;
216
+ function Mt(e) {
217
+ let u = e.length;
218
+ for (; u > 0 && (e[u - 1] === "\r" || e[u - 1] === `
219
+ `); ) u--;
220
+ return u < e.length ? e.slice(0, u) : e;
221
+ }
222
+ function Vt(e) {
223
+ if (typeof e == "string") return Q;
224
+ if (Array.isArray(e)) return T;
225
+ if (!e) return;
226
+ let { type: u } = e;
227
+ if (Iu.has(u)) return u;
228
+ }
229
+ var X = Vt, zt = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
230
+ function qt(e) {
231
+ let u = e === null ? "null" : typeof e;
232
+ if (u !== "string" && u !== "object") return `Unexpected doc '${u}',
233
+ Expected it to be 'string' or 'object'.`;
234
+ if (X(e)) throw new Error("doc is valid.");
235
+ let t = Object.prototype.toString.call(e);
236
+ if (t !== "[object Object]") return `Unexpected doc '${t}'.`;
237
+ let r = zt([...Iu].map((n) => `'${n}'`));
238
+ return `Unexpected doc.type '${e.type}'.
239
+ Expected it to be ${r}.`;
240
+ }
241
+ var Ut = class extends Error {
242
+ name = "InvalidDocError";
243
+ constructor(e) {
244
+ super(qt(e)), this.doc = e;
245
+ }
246
+ }, te = Ut, ru = {};
247
+ function Jt(e, u, t, r) {
248
+ let n = [e];
249
+ for (; n.length > 0; ) {
250
+ let D = n.pop();
251
+ if (D === ru) {
252
+ t(n.pop());
253
+ continue;
254
+ }
255
+ t && n.push(D, ru);
256
+ let a = X(D);
257
+ if (!a) throw new te(D);
258
+ if (u?.(D) !== !1) switch (a) {
259
+ case T:
260
+ case O: {
261
+ let i = a === T ? D : D.parts;
262
+ for (let o = i.length, s = o - 1; s >= 0; --s) n.push(i[s]);
263
+ break;
264
+ }
265
+ case k:
266
+ n.push(D.flatContents, D.breakContents);
267
+ break;
268
+ case w:
269
+ if (r && D.expandedStates) for (let i = D.expandedStates.length, o = i - 1; o >= 0; --o) n.push(D.expandedStates[o]);
270
+ else n.push(D.contents);
271
+ break;
272
+ case P:
273
+ case I:
274
+ case L:
275
+ case _:
276
+ case R:
277
+ n.push(D.contents);
278
+ break;
279
+ case Q:
280
+ case q:
281
+ case $:
282
+ case W:
283
+ case b:
284
+ case S:
285
+ break;
286
+ default:
287
+ throw new te(D);
288
+ }
289
+ }
290
+ }
291
+ var qe = Jt;
292
+ function Ee(e, u) {
293
+ if (typeof e == "string") return u(e);
294
+ let t = /* @__PURE__ */ new Map();
295
+ return r(e);
296
+ function r(D) {
297
+ if (t.has(D)) return t.get(D);
298
+ let a = n(D);
299
+ return t.set(D, a), a;
300
+ }
301
+ function n(D) {
302
+ switch (X(D)) {
303
+ case T:
304
+ return u(D.map(r));
305
+ case O:
306
+ return u({ ...D, parts: D.parts.map(r) });
307
+ case k:
308
+ return u({ ...D, breakContents: r(D.breakContents), flatContents: r(D.flatContents) });
309
+ case w: {
310
+ let { expandedStates: a, contents: i } = D;
311
+ return a ? (a = a.map(r), i = a[0]) : i = r(i), u({ ...D, contents: i, expandedStates: a });
312
+ }
313
+ case P:
314
+ case I:
315
+ case L:
316
+ case _:
317
+ case R:
318
+ return u({ ...D, contents: r(D.contents) });
319
+ case Q:
320
+ case q:
321
+ case $:
322
+ case W:
323
+ case b:
324
+ case S:
325
+ return u(D);
326
+ default:
327
+ throw new te(D);
328
+ }
329
+ }
330
+ }
331
+ function Ue(e, u, t) {
332
+ let r = t, n = !1;
333
+ function D(a) {
334
+ if (n) return !1;
335
+ let i = u(a);
336
+ i !== void 0 && (n = !0, r = i);
337
+ }
338
+ return qe(e, D), r;
339
+ }
340
+ function Gt(e) {
341
+ if (e.type === w && e.break || e.type === b && e.hard || e.type === S) return !0;
342
+ }
343
+ function Ht(e) {
344
+ return Ue(e, Gt, !1);
345
+ }
346
+ function nu(e) {
347
+ if (e.length > 0) {
348
+ let u = v(!1, e, -1);
349
+ !u.expandedStates && !u.break && (u.break = "propagated");
350
+ }
351
+ return null;
352
+ }
353
+ function Kt(e) {
354
+ let u = /* @__PURE__ */ new Set(), t = [];
355
+ function r(D) {
356
+ if (D.type === S && nu(t), D.type === w) {
357
+ if (t.push(D), u.has(D)) return !1;
358
+ u.add(D);
359
+ }
360
+ }
361
+ function n(D) {
362
+ D.type === w && t.pop().break && nu(t);
363
+ }
364
+ qe(e, r, n, !0);
365
+ }
366
+ function Yt(e) {
367
+ return e.type === b && !e.hard ? e.soft ? "" : " " : e.type === k ? e.flatContents : e;
368
+ }
369
+ function Zt(e) {
370
+ return Ee(e, Yt);
371
+ }
372
+ function Du(e) {
373
+ for (e = [...e]; e.length >= 2 && v(!1, e, -2).type === b && v(!1, e, -1).type === S; ) e.length -= 2;
374
+ if (e.length > 0) {
375
+ let u = ae(v(!1, e, -1));
376
+ e[e.length - 1] = u;
377
+ }
378
+ return e;
379
+ }
380
+ function ae(e) {
381
+ switch (X(e)) {
382
+ case I:
383
+ case L:
384
+ case w:
385
+ case R:
386
+ case _: {
387
+ let u = ae(e.contents);
388
+ return { ...e, contents: u };
389
+ }
390
+ case k:
391
+ return { ...e, breakContents: ae(e.breakContents), flatContents: ae(e.flatContents) };
392
+ case O:
393
+ return { ...e, parts: Du(e.parts) };
394
+ case T:
395
+ return Du(e);
396
+ case Q:
397
+ return Mt(e);
398
+ case P:
399
+ case q:
400
+ case $:
401
+ case W:
402
+ case b:
403
+ case S:
404
+ break;
405
+ default:
406
+ throw new te(e);
407
+ }
408
+ return e;
409
+ }
410
+ function Pu(e) {
411
+ return ae(Xt(e));
412
+ }
413
+ function Qt(e) {
414
+ switch (X(e)) {
415
+ case O:
416
+ if (e.parts.every((u) => u === "")) return "";
417
+ break;
418
+ case w:
419
+ if (!e.contents && !e.id && !e.break && !e.expandedStates) return "";
420
+ if (e.contents.type === w && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates) return e.contents;
421
+ break;
422
+ case P:
423
+ case I:
424
+ case L:
425
+ case R:
426
+ if (!e.contents) return "";
427
+ break;
428
+ case k:
429
+ if (!e.flatContents && !e.breakContents) return "";
430
+ break;
431
+ case T: {
432
+ let u = [];
433
+ for (let t of e) {
434
+ if (!t) continue;
435
+ let [r, ...n] = Array.isArray(t) ? t : [t];
436
+ typeof r == "string" && typeof v(!1, u, -1) == "string" ? u[u.length - 1] += r : u.push(r), u.push(...n);
437
+ }
438
+ return u.length === 0 ? "" : u.length === 1 ? u[0] : u;
439
+ }
440
+ case Q:
441
+ case q:
442
+ case $:
443
+ case W:
444
+ case b:
445
+ case _:
446
+ case S:
447
+ break;
448
+ default:
449
+ throw new te(e);
450
+ }
451
+ return e;
452
+ }
453
+ function Xt(e) {
454
+ return Ee(e, (u) => Qt(u));
455
+ }
456
+ function er(e, u = Wu) {
457
+ return Ee(e, (t) => typeof t == "string" ? Mu(u, t.split(`
458
+ `)) : t);
459
+ }
460
+ function ur(e) {
461
+ if (e.type === b) return !0;
462
+ }
463
+ function tr(e) {
464
+ return Ue(e, ur, !1);
465
+ }
466
+ function Fe(e, u) {
467
+ return e.type === _ ? { ...e, contents: u(e.contents) } : u(e);
468
+ }
469
+ var rr = () => {
470
+ }, nr = rr;
471
+ function Ce(e) {
472
+ return { type: I, contents: e };
473
+ }
474
+ function re(e, u) {
475
+ return { type: P, contents: u, n: e };
476
+ }
477
+ function $u(e, u = {}) {
478
+ return nr(u.expandedStates), { type: w, id: u.id, contents: e, break: !!u.shouldBreak, expandedStates: u.expandedStates };
479
+ }
480
+ function Dr(e) {
481
+ return re(Number.NEGATIVE_INFINITY, e);
482
+ }
483
+ function ar(e) {
484
+ return re({ type: "root" }, e);
485
+ }
486
+ function ir(e) {
487
+ return re(-1, e);
488
+ }
489
+ function or(e, u) {
490
+ return $u(e[0], { ...u, expandedStates: e });
491
+ }
492
+ function sr(e) {
493
+ return { type: O, parts: e };
494
+ }
495
+ function lr(e, u = "", t = {}) {
496
+ return { type: k, breakContents: e, flatContents: u, groupId: t.groupId };
497
+ }
498
+ function cr(e, u) {
499
+ return { type: L, contents: e, groupId: u.groupId, negate: u.negate };
500
+ }
501
+ function je(e) {
502
+ return { type: R, contents: e };
503
+ }
504
+ var fr = { type: W }, ge = { type: S }, dr = { type: $ }, Je = { type: b, hard: !0 }, Lu = { type: b, hard: !0, literal: !0 }, Ru = { type: b }, Fr = { type: b, soft: !0 }, Y = [Je, ge], Wu = [Lu, ge], K = { type: q };
505
+ function Mu(e, u) {
506
+ let t = [];
507
+ for (let r = 0; r < u.length; r++) r !== 0 && t.push(e), t.push(u[r]);
508
+ return t;
509
+ }
510
+ function Vu(e, u, t) {
511
+ let r = e;
512
+ if (u > 0) {
513
+ for (let n = 0; n < Math.floor(u / t); ++n) r = Ce(r);
514
+ r = re(u % t, r), r = re(Number.NEGATIVE_INFINITY, r);
515
+ }
516
+ return r;
517
+ }
518
+ function pr(e, u) {
519
+ return e ? { type: _, label: e, contents: u } : u;
520
+ }
521
+ function j(e) {
522
+ var u;
523
+ if (!e) return "";
524
+ if (Array.isArray(e)) {
525
+ let t = [];
526
+ for (let r of e) if (Array.isArray(r)) t.push(...j(r));
527
+ else {
528
+ let n = j(r);
529
+ n !== "" && t.push(n);
530
+ }
531
+ return t;
532
+ }
533
+ return e.type === k ? { ...e, breakContents: j(e.breakContents), flatContents: j(e.flatContents) } : e.type === w ? { ...e, contents: j(e.contents), expandedStates: (u = e.expandedStates) == null ? void 0 : u.map(j) } : e.type === O ? { type: "fill", parts: e.parts.map(j) } : e.contents ? { ...e, contents: j(e.contents) } : e;
534
+ }
535
+ function hr(e) {
536
+ let u = /* @__PURE__ */ Object.create(null), t = /* @__PURE__ */ new Set();
537
+ return r(j(e));
538
+ function r(D, a, i) {
539
+ var o, s;
540
+ if (typeof D == "string") return JSON.stringify(D);
541
+ if (Array.isArray(D)) {
542
+ let c = D.map(r).filter(Boolean);
543
+ return c.length === 1 ? c[0] : `[${c.join(", ")}]`;
544
+ }
545
+ if (D.type === b) {
546
+ let c = ((o = i?.[a + 1]) == null ? void 0 : o.type) === S;
547
+ return D.literal ? c ? "literalline" : "literallineWithoutBreakParent" : D.hard ? c ? "hardline" : "hardlineWithoutBreakParent" : D.soft ? "softline" : "line";
548
+ }
549
+ if (D.type === S) return ((s = i?.[a - 1]) == null ? void 0 : s.type) === b && i[a - 1].hard ? void 0 : "breakParent";
550
+ if (D.type === $) return "trim";
551
+ if (D.type === I) return "indent(" + r(D.contents) + ")";
552
+ if (D.type === P) 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) + ")";
553
+ if (D.type === k) return "ifBreak(" + r(D.breakContents) + (D.flatContents ? ", " + r(D.flatContents) : "") + (D.groupId ? (D.flatContents ? "" : ', ""') + `, { groupId: ${n(D.groupId)} }` : "") + ")";
554
+ if (D.type === L) {
555
+ let c = [];
556
+ D.negate && c.push("negate: true"), D.groupId && c.push(`groupId: ${n(D.groupId)}`);
557
+ let F = c.length > 0 ? `, { ${c.join(", ")} }` : "";
558
+ return `indentIfBreak(${r(D.contents)}${F})`;
559
+ }
560
+ if (D.type === w) {
561
+ let c = [];
562
+ D.break && D.break !== "propagated" && c.push("shouldBreak: true"), D.id && c.push(`id: ${n(D.id)}`);
563
+ let F = c.length > 0 ? `, { ${c.join(", ")} }` : "";
564
+ return D.expandedStates ? `conditionalGroup([${D.expandedStates.map((l) => r(l)).join(",")}]${F})` : `group(${r(D.contents)}${F})`;
565
+ }
566
+ if (D.type === O) return `fill([${D.parts.map((c) => r(c)).join(", ")}])`;
567
+ if (D.type === R) return "lineSuffix(" + r(D.contents) + ")";
568
+ if (D.type === W) return "lineSuffixBoundary";
569
+ if (D.type === _) return `label(${JSON.stringify(D.label)}, ${r(D.contents)})`;
570
+ if (D.type === q) return "cursor";
571
+ throw new Error("Unknown doc type " + D.type);
572
+ }
573
+ function n(D) {
574
+ if (typeof D != "symbol") return JSON.stringify(String(D));
575
+ if (D in u) return u[D];
576
+ let a = D.description || "symbol";
577
+ for (let i = 0; ; i++) {
578
+ let o = a + (i > 0 ? ` #${i}` : "");
579
+ if (!t.has(o)) return t.add(o), u[D] = `Symbol.for(${JSON.stringify(o)})`;
580
+ }
581
+ }
582
+ }
583
+ var Cr = () => /[#*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\uDC70\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-\uDED7\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\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\uDD3D\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-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\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]|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\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;
584
+ function mr(e) {
585
+ return e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510;
586
+ }
587
+ function Er(e) {
588
+ 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 === 94193 || e >= 94208 && e <= 100343 || e >= 100352 && e <= 101589 || e >= 101631 && e <= 101640 || 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 <= 128727 || 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 <= 129673 || e >= 129679 && e <= 129734 || e >= 129742 && e <= 129756 || e >= 129759 && e <= 129769 || e >= 129776 && e <= 129784 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141;
589
+ }
590
+ var gr = (e) => !(mr(e) || Er(e)), yr = /[^\x20-\x7F]/u;
591
+ function vr(e) {
592
+ if (!e) return 0;
593
+ if (!yr.test(e)) return e.length;
594
+ e = e.replace(Cr(), " ");
595
+ let u = 0;
596
+ for (let t of e) {
597
+ let r = t.codePointAt(0);
598
+ r <= 31 || r >= 127 && r <= 159 || r >= 768 && r <= 879 || (u += gr(r) ? 1 : 2);
599
+ }
600
+ return u;
601
+ }
602
+ var Ge = vr, A = /* @__PURE__ */ Symbol("MODE_BREAK"), x = /* @__PURE__ */ Symbol("MODE_FLAT"), ee = /* @__PURE__ */ Symbol("cursor"), Te = /* @__PURE__ */ Symbol("DOC_FILL_PRINTED_LENGTH");
603
+ function zu() {
604
+ return { value: "", length: 0, queue: [] };
605
+ }
606
+ function Br(e, u) {
607
+ return Ie(e, { type: "indent" }, u);
608
+ }
609
+ function br(e, u, t) {
610
+ return u === Number.NEGATIVE_INFINITY ? e.root || zu() : u < 0 ? Ie(e, { type: "dedent" }, t) : u ? u.type === "root" ? { ...e, root: e } : Ie(e, { type: typeof u == "string" ? "stringAlign" : "numberAlign", n: u }, t) : e;
611
+ }
612
+ function Ie(e, u, t) {
613
+ let r = u.type === "dedent" ? e.queue.slice(0, -1) : [...e.queue, u], n = "", D = 0, a = 0, i = 0;
614
+ for (let f of r) switch (f.type) {
615
+ case "indent":
616
+ c(), t.useTabs ? o(1) : s(t.tabWidth);
617
+ break;
618
+ case "stringAlign":
619
+ c(), n += f.n, D += f.n.length;
620
+ break;
621
+ case "numberAlign":
622
+ a += 1, i += f.n;
623
+ break;
624
+ default:
625
+ throw new Error(`Unexpected type '${f.type}'`);
626
+ }
627
+ return l(), { ...e, value: n, length: D, queue: r };
628
+ function o(f) {
629
+ n += " ".repeat(f), D += t.tabWidth * f;
630
+ }
631
+ function s(f) {
632
+ n += " ".repeat(f), D += f;
633
+ }
634
+ function c() {
635
+ t.useTabs ? F() : l();
636
+ }
637
+ function F() {
638
+ a > 0 && o(a), d();
639
+ }
640
+ function l() {
641
+ i > 0 && s(i), d();
642
+ }
643
+ function d() {
644
+ a = 0, i = 0;
645
+ }
646
+ }
647
+ function Pe(e) {
648
+ let u = 0, t = 0, r = e.length;
649
+ e: for (; r--; ) {
650
+ let n = e[r];
651
+ if (n === ee) {
652
+ t++;
653
+ continue;
654
+ }
655
+ for (let D = n.length - 1; D >= 0; D--) {
656
+ let a = n[D];
657
+ if (a === " " || a === " ") u++;
658
+ else {
659
+ e[r] = n.slice(0, D + 1);
660
+ break e;
661
+ }
662
+ }
663
+ }
664
+ if (u > 0 || t > 0) for (e.length = r + 1; t-- > 0; ) e.push(ee);
665
+ return u;
666
+ }
667
+ function fe(e, u, t, r, n, D) {
668
+ if (t === Number.POSITIVE_INFINITY) return !0;
669
+ let a = u.length, i = [e], o = [];
670
+ for (; t >= 0; ) {
671
+ if (i.length === 0) {
672
+ if (a === 0) return !0;
673
+ i.push(u[--a]);
674
+ continue;
675
+ }
676
+ let { mode: s, doc: c } = i.pop(), F = X(c);
677
+ switch (F) {
678
+ case Q:
679
+ o.push(c), t -= Ge(c);
680
+ break;
681
+ case T:
682
+ case O: {
683
+ let l = F === T ? c : c.parts, d = c[Te] ?? 0;
684
+ for (let f = l.length - 1; f >= d; f--) i.push({ mode: s, doc: l[f] });
685
+ break;
686
+ }
687
+ case I:
688
+ case P:
689
+ case L:
690
+ case _:
691
+ i.push({ mode: s, doc: c.contents });
692
+ break;
693
+ case $:
694
+ t += Pe(o);
695
+ break;
696
+ case w: {
697
+ if (D && c.break) return !1;
698
+ let l = c.break ? A : s, d = c.expandedStates && l === A ? v(!1, c.expandedStates, -1) : c.contents;
699
+ i.push({ mode: l, doc: d });
700
+ break;
701
+ }
702
+ case k: {
703
+ let l = (c.groupId ? n[c.groupId] || x : s) === A ? c.breakContents : c.flatContents;
704
+ l && i.push({ mode: s, doc: l });
705
+ break;
706
+ }
707
+ case b:
708
+ if (s === A || c.hard) return !0;
709
+ c.soft || (o.push(" "), t--);
710
+ break;
711
+ case R:
712
+ r = !0;
713
+ break;
714
+ case W:
715
+ if (r) return !1;
716
+ break;
717
+ }
718
+ }
719
+ return !1;
720
+ }
721
+ function ye(e, u) {
722
+ let t = {}, r = u.printWidth, n = ze(u.endOfLine), D = 0, a = [{ ind: zu(), mode: A, doc: e }], i = [], o = !1, s = [], c = 0;
723
+ for (Kt(e); a.length > 0; ) {
724
+ let { ind: l, mode: d, doc: f } = a.pop();
725
+ switch (X(f)) {
726
+ case Q: {
727
+ let h = n !== `
728
+ ` ? me(!1, f, `
729
+ `, n) : f;
730
+ i.push(h), a.length > 0 && (D += Ge(h));
731
+ break;
732
+ }
733
+ case T:
734
+ for (let h = f.length - 1; h >= 0; h--) a.push({ ind: l, mode: d, doc: f[h] });
735
+ break;
736
+ case q:
737
+ if (c >= 2) throw new Error("There are too many 'cursor' in doc.");
738
+ i.push(ee), c++;
739
+ break;
740
+ case I:
741
+ a.push({ ind: Br(l, u), mode: d, doc: f.contents });
742
+ break;
743
+ case P:
744
+ a.push({ ind: br(l, f.n, u), mode: d, doc: f.contents });
745
+ break;
746
+ case $:
747
+ D -= Pe(i);
748
+ break;
749
+ case w:
750
+ switch (d) {
751
+ case x:
752
+ if (!o) {
753
+ a.push({ ind: l, mode: f.break ? A : x, doc: f.contents });
754
+ break;
755
+ }
756
+ case A: {
757
+ o = !1;
758
+ let h = { ind: l, mode: x, doc: f.contents }, p = r - D, C = s.length > 0;
759
+ if (!f.break && fe(h, a, p, C, t)) a.push(h);
760
+ else if (f.expandedStates) {
761
+ let E = v(!1, f.expandedStates, -1);
762
+ if (f.break) {
763
+ a.push({ ind: l, mode: A, doc: E });
764
+ break;
765
+ } else for (let m = 1; m < f.expandedStates.length + 1; m++) if (m >= f.expandedStates.length) {
766
+ a.push({ ind: l, mode: A, doc: E });
767
+ break;
768
+ } else {
769
+ let y = f.expandedStates[m], g = { ind: l, mode: x, doc: y };
770
+ if (fe(g, a, p, C, t)) {
771
+ a.push(g);
772
+ break;
773
+ }
774
+ }
775
+ } else a.push({ ind: l, mode: A, doc: f.contents });
776
+ break;
777
+ }
778
+ }
779
+ f.id && (t[f.id] = v(!1, a, -1).mode);
780
+ break;
781
+ case O: {
782
+ let h = r - D, p = f[Te] ?? 0, { parts: C } = f, E = C.length - p;
783
+ if (E === 0) break;
784
+ let m = C[p + 0], y = C[p + 1], g = { ind: l, mode: x, doc: m }, B = { ind: l, mode: A, doc: m }, M = fe(g, [], h, s.length > 0, t, !0);
785
+ if (E === 1) {
786
+ M ? a.push(g) : a.push(B);
787
+ break;
788
+ }
789
+ let ce = { ind: l, mode: x, doc: y }, Ae = { ind: l, mode: A, doc: y };
790
+ if (E === 2) {
791
+ M ? a.push(ce, g) : a.push(Ae, B);
792
+ break;
793
+ }
794
+ let gt = C[p + 2], we = { ind: l, mode: d, doc: { ...f, [Te]: p + 2 } };
795
+ fe({ ind: l, mode: x, doc: [m, y, gt] }, [], h, s.length > 0, t, !0) ? a.push(we, ce, g) : M ? a.push(we, Ae, g) : a.push(we, Ae, B);
796
+ break;
797
+ }
798
+ case k:
799
+ case L: {
800
+ let h = f.groupId ? t[f.groupId] : d;
801
+ if (h === A) {
802
+ let p = f.type === k ? f.breakContents : f.negate ? f.contents : Ce(f.contents);
803
+ p && a.push({ ind: l, mode: d, doc: p });
804
+ }
805
+ if (h === x) {
806
+ let p = f.type === k ? f.flatContents : f.negate ? Ce(f.contents) : f.contents;
807
+ p && a.push({ ind: l, mode: d, doc: p });
808
+ }
809
+ break;
810
+ }
811
+ case R:
812
+ s.push({ ind: l, mode: d, doc: f.contents });
813
+ break;
814
+ case W:
815
+ s.length > 0 && a.push({ ind: l, mode: d, doc: Je });
816
+ break;
817
+ case b:
818
+ switch (d) {
819
+ case x:
820
+ if (f.hard) o = !0;
821
+ else {
822
+ f.soft || (i.push(" "), D += 1);
823
+ break;
824
+ }
825
+ case A:
826
+ if (s.length > 0) {
827
+ a.push({ ind: l, mode: d, doc: f }, ...s.reverse()), s.length = 0;
828
+ break;
829
+ }
830
+ f.literal ? l.root ? (i.push(n, l.root.value), D = l.root.length) : (i.push(n), D = 0) : (D -= Pe(i), i.push(n + l.value), D = l.length);
831
+ break;
832
+ }
833
+ break;
834
+ case _:
835
+ a.push({ ind: l, mode: d, doc: f.contents });
836
+ break;
837
+ case S:
838
+ break;
839
+ default:
840
+ throw new te(f);
841
+ }
842
+ a.length === 0 && s.length > 0 && (a.push(...s.reverse()), s.length = 0);
843
+ }
844
+ let F = i.indexOf(ee);
845
+ if (F !== -1) {
846
+ let l = i.indexOf(ee, F + 1);
847
+ if (l === -1) return { formatted: i.filter((p) => p !== ee).join("") };
848
+ let d = i.slice(0, F).join(""), f = i.slice(F + 1, l).join(""), h = i.slice(l + 1).join("");
849
+ return { formatted: d + f + h, cursorNodeStart: d.length, cursorNodeText: f };
850
+ }
851
+ return { formatted: i.join("") };
852
+ }
853
+ function Ar(e, u, t = 0) {
854
+ let r = 0;
855
+ for (let n = t; n < e.length; ++n) e[n] === " " ? r = r + u - r % u : r++;
856
+ return r;
857
+ }
858
+ var He = Ar, J, $e, pe, wr = class {
859
+ constructor(e) {
860
+ Nt(this, J), this.stack = [e];
861
+ }
862
+ get key() {
863
+ let { stack: e, siblings: u } = this;
864
+ return v(!1, e, u === null ? -2 : -4) ?? null;
865
+ }
866
+ get index() {
867
+ return this.siblings === null ? null : v(!1, this.stack, -2);
868
+ }
869
+ get node() {
870
+ return v(!1, this.stack, -1);
871
+ }
872
+ get parent() {
873
+ return this.getNode(1);
874
+ }
875
+ get grandparent() {
876
+ return this.getNode(2);
877
+ }
878
+ get isInArray() {
879
+ return this.siblings !== null;
880
+ }
881
+ get siblings() {
882
+ let { stack: e } = this, u = v(!1, e, -3);
883
+ return Array.isArray(u) ? u : null;
884
+ }
885
+ get next() {
886
+ let { siblings: e } = this;
887
+ return e === null ? null : e[this.index + 1];
888
+ }
889
+ get previous() {
890
+ let { siblings: e } = this;
891
+ return e === null ? null : e[this.index - 1];
892
+ }
893
+ get isFirst() {
894
+ return this.index === 0;
895
+ }
896
+ get isLast() {
897
+ let { siblings: e, index: u } = this;
898
+ return e !== null && u === e.length - 1;
899
+ }
900
+ get isRoot() {
901
+ return this.stack.length === 1;
902
+ }
903
+ get root() {
904
+ return this.stack[0];
905
+ }
906
+ get ancestors() {
907
+ return [...De(this, J, pe).call(this)];
908
+ }
909
+ getName() {
910
+ let { stack: e } = this, { length: u } = e;
911
+ return u > 1 ? v(!1, e, -2) : null;
912
+ }
913
+ getValue() {
914
+ return v(!1, this.stack, -1);
915
+ }
916
+ getNode(e = 0) {
917
+ let u = De(this, J, $e).call(this, e);
918
+ return u === -1 ? null : this.stack[u];
919
+ }
920
+ getParentNode(e = 0) {
921
+ return this.getNode(e + 1);
922
+ }
923
+ call(e, ...u) {
924
+ let { stack: t } = this, { length: r } = t, n = v(!1, t, -1);
925
+ for (let D of u) n = n[D], t.push(D, n);
926
+ try {
927
+ return e(this);
928
+ } finally {
929
+ t.length = r;
930
+ }
931
+ }
932
+ callParent(e, u = 0) {
933
+ let t = De(this, J, $e).call(this, u + 1), r = this.stack.splice(t + 1);
934
+ try {
935
+ return e(this);
936
+ } finally {
937
+ this.stack.push(...r);
938
+ }
939
+ }
940
+ each(e, ...u) {
941
+ let { stack: t } = this, { length: r } = t, n = v(!1, t, -1);
942
+ for (let D of u) n = n[D], t.push(D, n);
943
+ try {
944
+ for (let D = 0; D < n.length; ++D) t.push(D, n[D]), e(this, D, n), t.length -= 2;
945
+ } finally {
946
+ t.length = r;
947
+ }
948
+ }
949
+ map(e, ...u) {
950
+ let t = [];
951
+ return this.each((r, n, D) => {
952
+ t[n] = e(r, n, D);
953
+ }, ...u), t;
954
+ }
955
+ match(...e) {
956
+ let u = this.stack.length - 1, t = null, r = this.stack[u--];
957
+ for (let n of e) {
958
+ if (r === void 0) return !1;
959
+ let D = null;
960
+ if (typeof t == "number" && (D = t, t = this.stack[u--], r = this.stack[u--]), n && !n(r, t, D)) return !1;
961
+ t = this.stack[u--], r = this.stack[u--];
962
+ }
963
+ return !0;
964
+ }
965
+ findAncestor(e) {
966
+ for (let u of De(this, J, pe).call(this)) if (e(u)) return u;
967
+ }
968
+ hasAncestor(e) {
969
+ for (let u of De(this, J, pe).call(this)) if (e(u)) return !0;
970
+ return !1;
971
+ }
972
+ };
973
+ J = /* @__PURE__ */ new WeakSet(), $e = function(e) {
974
+ let { stack: u } = this;
975
+ for (let t = u.length - 1; t >= 0; t -= 2) if (!Array.isArray(u[t]) && --e < 0) return t;
976
+ return -1;
977
+ }, pe = function* () {
978
+ let { stack: e } = this;
979
+ for (let u = e.length - 3; u >= 0; u -= 2) {
980
+ let t = e[u];
981
+ Array.isArray(t) || (yield t);
982
+ }
983
+ };
984
+ var kr = wr, qu = new Proxy(() => {
985
+ }, { get: () => qu }), Le = qu;
986
+ function Sr(e) {
987
+ return e !== null && typeof e == "object";
988
+ }
989
+ var xr = Sr;
990
+ function* ve(e, u) {
991
+ let { getVisitorKeys: t, filter: r = () => !0 } = u, n = (D) => xr(D) && r(D);
992
+ for (let D of t(e)) {
993
+ let a = e[D];
994
+ if (Array.isArray(a)) for (let i of a) n(i) && (yield i);
995
+ else n(a) && (yield a);
996
+ }
997
+ }
998
+ function* Nr(e, u) {
999
+ let t = [e];
1000
+ for (let r = 0; r < t.length; r++) {
1001
+ let n = t[r];
1002
+ for (let D of ve(n, u)) yield D, t.push(D);
1003
+ }
1004
+ }
1005
+ function Or(e, u) {
1006
+ return ve(e, u).next().done;
1007
+ }
1008
+ function se(e) {
1009
+ return (u, t, r) => {
1010
+ let n = !!(r != null && r.backwards);
1011
+ if (t === !1) return !1;
1012
+ let { length: D } = u, a = t;
1013
+ for (; a >= 0 && a < D; ) {
1014
+ let i = u.charAt(a);
1015
+ if (e instanceof RegExp) {
1016
+ if (!e.test(i)) return a;
1017
+ } else if (!e.includes(i)) return a;
1018
+ n ? a-- : a++;
1019
+ }
1020
+ return a === -1 || a === D ? a : !1;
1021
+ };
1022
+ }
1023
+ var _r = se(/\s/u), z = se(" "), Uu = se(",; "), Ju = se(/[^\n\r]/u);
1024
+ function jr(e, u, t) {
1025
+ let r = !!(t != null && t.backwards);
1026
+ if (u === !1) return !1;
1027
+ let n = e.charAt(u);
1028
+ if (r) {
1029
+ if (e.charAt(u - 1) === "\r" && n === `
1030
+ `) return u - 2;
1031
+ if (n === `
1032
+ ` || n === "\r" || n === "\u2028" || n === "\u2029") return u - 1;
1033
+ } else {
1034
+ if (n === "\r" && e.charAt(u + 1) === `
1035
+ `) return u + 2;
1036
+ if (n === `
1037
+ ` || n === "\r" || n === "\u2028" || n === "\u2029") return u + 1;
1038
+ }
1039
+ return u;
1040
+ }
1041
+ var Z = jr;
1042
+ function Tr(e, u, t = {}) {
1043
+ let r = z(e, t.backwards ? u - 1 : u, t), n = Z(e, r, t);
1044
+ return r !== n;
1045
+ }
1046
+ var V = Tr;
1047
+ function Ir(e) {
1048
+ return Array.isArray(e) && e.length > 0;
1049
+ }
1050
+ var Pr = Ir, Gu = /* @__PURE__ */ new Set(["tokens", "comments", "parent", "enclosingNode", "precedingNode", "followingNode"]), $r = (e) => Object.keys(e).filter((u) => !Gu.has(u));
1051
+ function Lr(e) {
1052
+ return e ? (u) => e(u, Gu) : $r;
1053
+ }
1054
+ var Be = Lr;
1055
+ function Rr(e) {
1056
+ let u = e.type || e.kind || "(unknown type)", t = 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 || "");
1057
+ return t.length > 20 && (t = t.slice(0, 19) + "…"), u + (t ? " " + t : "");
1058
+ }
1059
+ function Ke(e, u) {
1060
+ (e.comments ?? (e.comments = [])).push(u), u.printed = !1, u.nodeDescription = Rr(e);
1061
+ }
1062
+ function ie(e, u) {
1063
+ u.leading = !0, u.trailing = !1, Ke(e, u);
1064
+ }
1065
+ function G(e, u, t) {
1066
+ u.leading = !1, u.trailing = !1, t && (u.marker = t), Ke(e, u);
1067
+ }
1068
+ function oe(e, u) {
1069
+ u.leading = !1, u.trailing = !0, Ke(e, u);
1070
+ }
1071
+ var ke = /* @__PURE__ */ new WeakMap();
1072
+ function Ye(e, u) {
1073
+ if (ke.has(e)) return ke.get(e);
1074
+ let { printer: { getCommentChildNodes: t, canAttachComment: r, getVisitorKeys: n }, locStart: D, locEnd: a } = u;
1075
+ if (!r) return [];
1076
+ let i = (t?.(e, u) ?? [...ve(e, { getVisitorKeys: Be(n) })]).flatMap((o) => r(o) ? [o] : Ye(o, u));
1077
+ return i.sort((o, s) => D(o) - D(s) || a(o) - a(s)), ke.set(e, i), i;
1078
+ }
1079
+ function Hu(e, u, t, r) {
1080
+ let { locStart: n, locEnd: D } = t, a = n(u), i = D(u), o = Ye(e, t), s, c, F = 0, l = o.length;
1081
+ for (; F < l; ) {
1082
+ let d = F + l >> 1, f = o[d], h = n(f), p = D(f);
1083
+ if (h <= a && i <= p) return Hu(f, u, t, f);
1084
+ if (p <= a) {
1085
+ s = f, F = d + 1;
1086
+ continue;
1087
+ }
1088
+ if (i <= h) {
1089
+ c = f, l = d;
1090
+ continue;
1091
+ }
1092
+ throw new Error("Comment location overlaps with node location");
1093
+ }
1094
+ if (r?.type === "TemplateLiteral") {
1095
+ let { quasis: d } = r, f = xe(d, u, t);
1096
+ s && xe(d, s, t) !== f && (s = null), c && xe(d, c, t) !== f && (c = null);
1097
+ }
1098
+ return { enclosingNode: r, precedingNode: s, followingNode: c };
1099
+ }
1100
+ var Se = () => !1;
1101
+ function Wr(e, u) {
1102
+ let { comments: t } = e;
1103
+ if (delete e.comments, !Pr(t) || !u.printer.canAttachComment) return;
1104
+ let r = [], { printer: { experimentalFeatures: { avoidAstMutation: n = !1 } = {}, handleComments: D = {} }, originalText: a } = u, { ownLine: i = Se, endOfLine: o = Se, remaining: s = Se } = D, c = t.map((F, l) => ({ ...Hu(e, F, u), comment: F, text: a, options: u, ast: e, isLastComment: t.length - 1 === l }));
1105
+ for (let [F, l] of c.entries()) {
1106
+ let { comment: d, precedingNode: f, enclosingNode: h, followingNode: p, text: C, options: E, ast: m, isLastComment: y } = l, g;
1107
+ if (n ? g = [l] : (d.enclosingNode = h, d.precedingNode = f, d.followingNode = p, g = [d, C, E, m, y]), Mr(C, E, c, F)) d.placement = "ownLine", i(...g) || (p ? ie(p, d) : f ? oe(f, d) : G(h || m, d));
1108
+ else if (Vr(C, E, c, F)) d.placement = "endOfLine", o(...g) || (f ? oe(f, d) : p ? ie(p, d) : G(h || m, d));
1109
+ else if (d.placement = "remaining", !s(...g)) if (f && p) {
1110
+ let B = r.length;
1111
+ B > 0 && r[B - 1].followingNode !== p && au(r, E), r.push(l);
1112
+ } else f ? oe(f, d) : p ? ie(p, d) : G(h || m, d);
1113
+ }
1114
+ if (au(r, u), !n) for (let F of t) delete F.precedingNode, delete F.enclosingNode, delete F.followingNode;
1115
+ }
1116
+ var Ku = (e) => !/[\S\n\u2028\u2029]/u.test(e);
1117
+ function Mr(e, u, t, r) {
1118
+ let { comment: n, precedingNode: D } = t[r], { locStart: a, locEnd: i } = u, o = a(n);
1119
+ if (D) for (let s = r - 1; s >= 0; s--) {
1120
+ let { comment: c, precedingNode: F } = t[s];
1121
+ if (F !== D || !Ku(e.slice(i(c), o))) break;
1122
+ o = a(c);
1123
+ }
1124
+ return V(e, o, { backwards: !0 });
1125
+ }
1126
+ function Vr(e, u, t, r) {
1127
+ let { comment: n, followingNode: D } = t[r], { locStart: a, locEnd: i } = u, o = i(n);
1128
+ if (D) for (let s = r + 1; s < t.length; s++) {
1129
+ let { comment: c, followingNode: F } = t[s];
1130
+ if (F !== D || !Ku(e.slice(o, a(c)))) break;
1131
+ o = i(c);
1132
+ }
1133
+ return V(e, o);
1134
+ }
1135
+ function au(e, u) {
1136
+ var t, r;
1137
+ let n = e.length;
1138
+ if (n === 0) return;
1139
+ let { precedingNode: D, followingNode: a } = e[0], i = u.locStart(a), o;
1140
+ for (o = n; o > 0; --o) {
1141
+ let { comment: s, precedingNode: c, followingNode: F } = e[o - 1];
1142
+ Le.strictEqual(c, D), Le.strictEqual(F, a);
1143
+ let l = u.originalText.slice(u.locEnd(s), i);
1144
+ if (((r = (t = u.printer).isGap) == null ? void 0 : r.call(t, l, u)) ?? /^[\s(]*$/u.test(l)) i = u.locStart(s);
1145
+ else break;
1146
+ }
1147
+ for (let [s, { comment: c }] of e.entries()) s < o ? oe(D, c) : ie(a, c);
1148
+ for (let s of [D, a]) s.comments && s.comments.length > 1 && s.comments.sort((c, F) => u.locStart(c) - u.locStart(F));
1149
+ e.length = 0;
1150
+ }
1151
+ function xe(e, u, t) {
1152
+ let r = t.locStart(u) - 1;
1153
+ for (let n = 1; n < e.length; ++n) if (r < t.locStart(e[n])) return n - 1;
1154
+ return 0;
1155
+ }
1156
+ function zr(e, u) {
1157
+ let t = u - 1;
1158
+ t = z(e, t, { backwards: !0 }), t = Z(e, t, { backwards: !0 }), t = z(e, t, { backwards: !0 });
1159
+ let r = Z(e, t, { backwards: !0 });
1160
+ return t !== r;
1161
+ }
1162
+ var Ze = zr;
1163
+ function Yu(e, u) {
1164
+ let t = e.node;
1165
+ return t.printed = !0, u.printer.printComment(e, u);
1166
+ }
1167
+ function qr(e, u) {
1168
+ var t;
1169
+ let r = e.node, n = [Yu(e, u)], { printer: D, originalText: a, locStart: i, locEnd: o } = u;
1170
+ if ((t = D.isBlockComment) != null && t.call(D, r)) {
1171
+ let c = V(a, o(r)) ? V(a, i(r), { backwards: !0 }) ? Y : Ru : " ";
1172
+ n.push(c);
1173
+ } else n.push(Y);
1174
+ let s = Z(a, z(a, o(r)));
1175
+ return s !== !1 && V(a, s) && n.push(Y), n;
1176
+ }
1177
+ function Ur(e, u, t) {
1178
+ var r;
1179
+ let n = e.node, D = Yu(e, u), { printer: a, originalText: i, locStart: o } = u, s = (r = a.isBlockComment) == null ? void 0 : r.call(a, n);
1180
+ if (t != null && t.hasLineSuffix && !(t != null && t.isBlock) || V(i, o(n), { backwards: !0 })) {
1181
+ let c = Ze(i, o(n));
1182
+ return { doc: je([Y, c ? Y : "", D]), isBlock: s, hasLineSuffix: !0 };
1183
+ }
1184
+ return !s || t != null && t.hasLineSuffix ? { doc: [je([" ", D]), ge], isBlock: s, hasLineSuffix: !0 } : { doc: [" ", D], isBlock: s, hasLineSuffix: !1 };
1185
+ }
1186
+ function Jr(e, u) {
1187
+ let t = e.node;
1188
+ if (!t) return {};
1189
+ let r = u[/* @__PURE__ */ Symbol.for("printedComments")];
1190
+ if ((t.comments || []).filter((i) => !r.has(i)).length === 0) return { leading: "", trailing: "" };
1191
+ let n = [], D = [], a;
1192
+ return e.each(() => {
1193
+ let i = e.node;
1194
+ if (r != null && r.has(i)) return;
1195
+ let { leading: o, trailing: s } = i;
1196
+ o ? n.push(qr(e, u)) : s && (a = Ur(e, u, a), D.push(a.doc));
1197
+ }, "comments"), { leading: n, trailing: D };
1198
+ }
1199
+ function Gr(e, u, t) {
1200
+ let { leading: r, trailing: n } = Jr(e, t);
1201
+ return !r && !n ? u : Fe(u, (D) => [r, D, n]);
1202
+ }
1203
+ function Hr(e) {
1204
+ let { [/* @__PURE__ */ Symbol.for("comments")]: u, [/* @__PURE__ */ Symbol.for("printedComments")]: t } = e;
1205
+ for (let r of u) {
1206
+ if (!r.printed && !t.has(r)) throw new Error('Comment "' + r.value.trim() + '" was not printed. Please report this error!');
1207
+ delete r.printed;
1208
+ }
1209
+ }
1210
+ var Zu = class extends Error {
1211
+ name = "ConfigError";
1212
+ }, iu = class extends Error {
1213
+ name = "UndefinedParserError";
1214
+ }, Kr = { 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
1215
+ (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).
1216
+ 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.
1217
+ 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." }] } };
1218
+ function Qu({ plugins: e = [], showDeprecated: u = !1 } = {}) {
1219
+ let t = e.flatMap((n) => n.languages ?? []), r = [];
1220
+ for (let n of Zr(Object.assign({}, ...e.map(({ options: D }) => D), Kr))) !u && n.deprecated || (Array.isArray(n.choices) && (u || (n.choices = n.choices.filter((D) => !D.deprecated)), n.name === "parser" && (n.choices = [...n.choices, ...Yr(n.choices, t, e)])), n.pluginDefaults = Object.fromEntries(e.filter((D) => {
1221
+ var a;
1222
+ return ((a = D.defaultOptions) == null ? void 0 : a[n.name]) !== void 0;
1223
+ }).map((D) => [D.name, D.defaultOptions[n.name]])), r.push(n));
1224
+ return { languages: t, options: r };
1225
+ }
1226
+ function* Yr(e, u, t) {
1227
+ let r = new Set(e.map((n) => n.value));
1228
+ for (let n of u) if (n.parsers) {
1229
+ for (let D of n.parsers) if (!r.has(D)) {
1230
+ r.add(D);
1231
+ let a = t.find((o) => o.parsers && Object.prototype.hasOwnProperty.call(o.parsers, D)), i = n.name;
1232
+ a != null && a.name && (i += ` (plugin: ${a.name})`), yield { value: D, description: i };
1233
+ }
1234
+ }
1235
+ }
1236
+ function Zr(e) {
1237
+ let u = [];
1238
+ for (let [t, r] of Object.entries(e)) {
1239
+ let n = { name: t, ...r };
1240
+ Array.isArray(n.default) && (n.default = v(!1, n.default, -1).value), u.push(n);
1241
+ }
1242
+ return u;
1243
+ }
1244
+ var Qr = (e, u) => {
1245
+ if (!(e && u == null)) return u.toReversed || !Array.isArray(u) ? u.toReversed() : [...u].reverse();
1246
+ }, Xr = Qr, ou, su, lu, cu, fu, en = ((ou = globalThis.Deno) == null ? void 0 : ou.build.os) === "windows" || ((lu = (su = globalThis.navigator) == null ? void 0 : su.platform) == null ? void 0 : lu.startsWith("Win")) || ((fu = (cu = globalThis.process) == null ? void 0 : cu.platform) == null ? void 0 : fu.startsWith("win")) || !1;
1247
+ function Xu(e) {
1248
+ if (e = e instanceof URL ? e : new URL(e), e.protocol !== "file:") throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);
1249
+ return e;
1250
+ }
1251
+ function un(e) {
1252
+ return e = Xu(e), decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
1253
+ }
1254
+ function tn(e) {
1255
+ e = Xu(e);
1256
+ let u = decodeURIComponent(e.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
1257
+ return e.hostname !== "" && (u = `\\\\${e.hostname}${u}`), u;
1258
+ }
1259
+ function rn(e) {
1260
+ return en ? tn(e) : un(e);
1261
+ }
1262
+ var nn = rn, Dn = (e) => String(e).split(/[/\\]/u).pop();
1263
+ function du(e, u) {
1264
+ if (!u) return;
1265
+ let t = Dn(u).toLowerCase();
1266
+ return e.find(({ filenames: r }) => r?.some((n) => n.toLowerCase() === t)) ?? e.find(({ extensions: r }) => r?.some((n) => t.endsWith(n)));
1267
+ }
1268
+ function an(e, u) {
1269
+ if (u) return e.find(({ name: t }) => t.toLowerCase() === u) ?? e.find(({ aliases: t }) => t?.includes(u)) ?? e.find(({ extensions: t }) => t?.includes(`.${u}`));
1270
+ }
1271
+ function Fu(e, u) {
1272
+ if (u) {
1273
+ if (String(u).startsWith("file:")) try {
1274
+ u = nn(u);
1275
+ } catch {
1276
+ return;
1277
+ }
1278
+ if (typeof u == "string") return e.find(({ isSupported: t }) => t?.({ filepath: u }));
1279
+ }
1280
+ }
1281
+ function on(e, u) {
1282
+ let t = Xr(!1, e.plugins).flatMap((n) => n.languages ?? []), r = an(t, u.language) ?? du(t, u.physicalFile) ?? du(t, u.file) ?? Fu(t, u.physicalFile) ?? Fu(t, u.file) ?? (u.physicalFile, void 0);
1283
+ return r?.parsers[0];
1284
+ }
1285
+ var sn = on, ue = { key: (e) => /^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e) ? e : JSON.stringify(e), value(e) {
1286
+ if (e === null || typeof e != "object") return JSON.stringify(e);
1287
+ if (Array.isArray(e)) return `[${e.map((t) => ue.value(t)).join(", ")}]`;
1288
+ let u = Object.keys(e);
1289
+ return u.length === 0 ? "{}" : `{ ${u.map((t) => `${ue.key(t)}: ${ue.value(e[t])}`).join(", ")} }`;
1290
+ }, pair: ({ key: e, value: u }) => ue.value({ [e]: u }) }, et = new Proxy(String, { get: () => et }), N = et, ln = (e, u, { descriptor: t }) => {
1291
+ let r = [`${N.yellow(typeof e == "string" ? t.key(e) : t.pair(e))} is deprecated`];
1292
+ return u && r.push(`we now treat it as ${N.blue(typeof u == "string" ? t.key(u) : t.pair(u))}`), r.join("; ") + ".";
1293
+ }, ut = /* @__PURE__ */ Symbol.for("vnopts.VALUE_NOT_EXIST"), he = /* @__PURE__ */ Symbol.for("vnopts.VALUE_UNCHANGED"), pu = " ".repeat(2), cn = (e, u, t) => {
1294
+ let { text: r, list: n } = t.normalizeExpectedResult(t.schemas[e].expected(t)), D = [];
1295
+ return r && D.push(hu(e, u, r, t.descriptor)), n && D.push([hu(e, u, n.title, t.descriptor)].concat(n.values.map((a) => tt(a, t.loggerPrintWidth))).join(`
1296
+ `)), rt(D, t.loggerPrintWidth);
1297
+ };
1298
+ function hu(e, u, t, r) {
1299
+ return [`Invalid ${N.red(r.key(e))} value.`, `Expected ${N.blue(t)},`, `but received ${u === ut ? N.gray("nothing") : N.red(r.value(u))}.`].join(" ");
1300
+ }
1301
+ function tt({ text: e, list: u }, t) {
1302
+ let r = [];
1303
+ return e && r.push(`- ${N.blue(e)}`), u && r.push([`- ${N.blue(u.title)}:`].concat(u.values.map((n) => tt(n, t - pu.length).replace(/^|\n/g, `$&${pu}`))).join(`
1304
+ `)), rt(r, t);
1305
+ }
1306
+ function rt(e, u) {
1307
+ if (e.length === 1) return e[0];
1308
+ let [t, r] = e, [n, D] = e.map((a) => a.split(`
1309
+ `, 1)[0].length);
1310
+ return n > u && n > D ? r : t;
1311
+ }
1312
+ var Ne = [], Cu = [];
1313
+ function fn(e, u) {
1314
+ if (e === u) return 0;
1315
+ let t = e;
1316
+ e.length > u.length && (e = u, u = t);
1317
+ let r = e.length, n = u.length;
1318
+ for (; r > 0 && e.charCodeAt(~-r) === u.charCodeAt(~-n); ) r--, n--;
1319
+ let D = 0;
1320
+ for (; D < r && e.charCodeAt(D) === u.charCodeAt(D); ) D++;
1321
+ if (r -= D, n -= D, r === 0) return n;
1322
+ let a, i, o, s, c = 0, F = 0;
1323
+ for (; c < r; ) Cu[c] = e.charCodeAt(D + c), Ne[c] = ++c;
1324
+ for (; F < n; ) for (a = u.charCodeAt(D + F), o = F++, i = F, c = 0; c < r; c++) s = a === Cu[c] ? o : o + 1, o = Ne[c], i = Ne[c] = o > i ? s > i ? i + 1 : s : s > o ? o + 1 : s;
1325
+ return i;
1326
+ }
1327
+ var nt = (e, u, { descriptor: t, logger: r, schemas: n }) => {
1328
+ let D = [`Ignored unknown option ${N.yellow(t.pair({ key: e, value: u }))}.`], a = Object.keys(n).sort().find((i) => fn(e, i) < 3);
1329
+ a && D.push(`Did you mean ${N.blue(t.key(a))}?`), r.warn(D.join(" "));
1330
+ }, dn = ["default", "expected", "validate", "deprecated", "forward", "redirect", "overlap", "preprocess", "postprocess"];
1331
+ function Fn(e, u) {
1332
+ let t = new e(u), r = Object.create(t);
1333
+ for (let n of dn) n in u && (r[n] = pn(u[n], t, U.prototype[n].length));
1334
+ return r;
1335
+ }
1336
+ var U = class {
1337
+ static create(e) {
1338
+ return Fn(this, e);
1339
+ }
1340
+ constructor(e) {
1341
+ this.name = e.name;
1342
+ }
1343
+ default(e) {
1344
+ }
1345
+ expected(e) {
1346
+ return "nothing";
1347
+ }
1348
+ validate(e, u) {
1349
+ return !1;
1350
+ }
1351
+ deprecated(e, u) {
1352
+ return !1;
1353
+ }
1354
+ forward(e, u) {
1355
+ }
1356
+ redirect(e, u) {
1357
+ }
1358
+ overlap(e, u, t) {
1359
+ return e;
1360
+ }
1361
+ preprocess(e, u) {
1362
+ return e;
1363
+ }
1364
+ postprocess(e, u) {
1365
+ return he;
1366
+ }
1367
+ };
1368
+ function pn(e, u, t) {
1369
+ return typeof e == "function" ? (...r) => e(...r.slice(0, t - 1), u, ...r.slice(t - 1)) : () => e;
1370
+ }
1371
+ var hn = class extends U {
1372
+ constructor(e) {
1373
+ super(e), this._sourceName = e.sourceName;
1374
+ }
1375
+ expected(e) {
1376
+ return e.schemas[this._sourceName].expected(e);
1377
+ }
1378
+ validate(e, u) {
1379
+ return u.schemas[this._sourceName].validate(e, u);
1380
+ }
1381
+ redirect(e, u) {
1382
+ return this._sourceName;
1383
+ }
1384
+ }, Cn = class extends U {
1385
+ expected() {
1386
+ return "anything";
1387
+ }
1388
+ validate() {
1389
+ return !0;
1390
+ }
1391
+ }, mn = class extends U {
1392
+ constructor({ valueSchema: e, name: u = e.name, ...t }) {
1393
+ super({ ...t, name: u }), this._valueSchema = e;
1394
+ }
1395
+ expected(e) {
1396
+ let { text: u, list: t } = e.normalizeExpectedResult(this._valueSchema.expected(e));
1397
+ return { text: u && `an array of ${u}`, list: t && { title: "an array of the following values", values: [{ list: t }] } };
1398
+ }
1399
+ validate(e, u) {
1400
+ if (!Array.isArray(e)) return !1;
1401
+ let t = [];
1402
+ for (let r of e) {
1403
+ let n = u.normalizeValidateResult(this._valueSchema.validate(r, u), r);
1404
+ n !== !0 && t.push(n.value);
1405
+ }
1406
+ return t.length === 0 ? !0 : { value: t };
1407
+ }
1408
+ deprecated(e, u) {
1409
+ let t = [];
1410
+ for (let r of e) {
1411
+ let n = u.normalizeDeprecatedResult(this._valueSchema.deprecated(r, u), r);
1412
+ n !== !1 && t.push(...n.map(({ value: D }) => ({ value: [D] })));
1413
+ }
1414
+ return t;
1415
+ }
1416
+ forward(e, u) {
1417
+ let t = [];
1418
+ for (let r of e) {
1419
+ let n = u.normalizeForwardResult(this._valueSchema.forward(r, u), r);
1420
+ t.push(...n.map(mu));
1421
+ }
1422
+ return t;
1423
+ }
1424
+ redirect(e, u) {
1425
+ let t = [], r = [];
1426
+ for (let n of e) {
1427
+ let D = u.normalizeRedirectResult(this._valueSchema.redirect(n, u), n);
1428
+ "remain" in D && t.push(D.remain), r.push(...D.redirect.map(mu));
1429
+ }
1430
+ return t.length === 0 ? { redirect: r } : { redirect: r, remain: t };
1431
+ }
1432
+ overlap(e, u) {
1433
+ return e.concat(u);
1434
+ }
1435
+ };
1436
+ function mu({ from: e, to: u }) {
1437
+ return { from: [e], to: u };
1438
+ }
1439
+ var En = class extends U {
1440
+ expected() {
1441
+ return "true or false";
1442
+ }
1443
+ validate(e) {
1444
+ return typeof e == "boolean";
1445
+ }
1446
+ };
1447
+ function gn(e, u) {
1448
+ let t = /* @__PURE__ */ Object.create(null);
1449
+ for (let r of e) {
1450
+ let n = r[u];
1451
+ if (t[n]) throw new Error(`Duplicate ${u} ${JSON.stringify(n)}`);
1452
+ t[n] = r;
1453
+ }
1454
+ return t;
1455
+ }
1456
+ function yn(e, u) {
1457
+ let t = /* @__PURE__ */ new Map();
1458
+ for (let r of e) {
1459
+ let n = r[u];
1460
+ if (t.has(n)) throw new Error(`Duplicate ${u} ${JSON.stringify(n)}`);
1461
+ t.set(n, r);
1462
+ }
1463
+ return t;
1464
+ }
1465
+ function vn() {
1466
+ let e = /* @__PURE__ */ Object.create(null);
1467
+ return (u) => {
1468
+ let t = JSON.stringify(u);
1469
+ return e[t] ? !0 : (e[t] = !0, !1);
1470
+ };
1471
+ }
1472
+ function Bn(e, u) {
1473
+ let t = [], r = [];
1474
+ for (let n of e) u(n) ? t.push(n) : r.push(n);
1475
+ return [t, r];
1476
+ }
1477
+ function bn(e) {
1478
+ return e === Math.floor(e);
1479
+ }
1480
+ function An(e, u) {
1481
+ if (e === u) return 0;
1482
+ let t = typeof e, r = typeof u, n = ["undefined", "object", "boolean", "number", "string"];
1483
+ return t !== r ? n.indexOf(t) - n.indexOf(r) : t !== "string" ? Number(e) - Number(u) : e.localeCompare(u);
1484
+ }
1485
+ function wn(e) {
1486
+ return (...u) => {
1487
+ let t = e(...u);
1488
+ return typeof t == "string" ? new Error(t) : t;
1489
+ };
1490
+ }
1491
+ function Eu(e) {
1492
+ return e === void 0 ? {} : e;
1493
+ }
1494
+ function Dt(e) {
1495
+ if (typeof e == "string") return { text: e };
1496
+ let { text: u, list: t } = e;
1497
+ return kn((u || t) !== void 0, "Unexpected `expected` result, there should be at least one field."), t ? { text: u, list: { title: t.title, values: t.values.map(Dt) } } : { text: u };
1498
+ }
1499
+ function gu(e, u) {
1500
+ return e === !0 ? !0 : e === !1 ? { value: u } : e;
1501
+ }
1502
+ function yu(e, u, t = !1) {
1503
+ return e === !1 ? !1 : e === !0 ? t ? !0 : [{ value: u }] : "value" in e ? [e] : e.length === 0 ? !1 : e;
1504
+ }
1505
+ function vu(e, u) {
1506
+ return typeof e == "string" || "key" in e ? { from: u, to: e } : "from" in e ? { from: e.from, to: e.to } : { from: u, to: e.to };
1507
+ }
1508
+ function Re(e, u) {
1509
+ return e === void 0 ? [] : Array.isArray(e) ? e.map((t) => vu(t, u)) : [vu(e, u)];
1510
+ }
1511
+ function Bu(e, u) {
1512
+ let t = Re(typeof e == "object" && "redirect" in e ? e.redirect : e, u);
1513
+ return t.length === 0 ? { remain: u, redirect: t } : typeof e == "object" && "remain" in e ? { remain: e.remain, redirect: t } : { redirect: t };
1514
+ }
1515
+ function kn(e, u) {
1516
+ if (!e) throw new Error(u);
1517
+ }
1518
+ var Sn = class extends U {
1519
+ constructor(e) {
1520
+ super(e), this._choices = yn(e.choices.map((u) => u && typeof u == "object" ? u : { value: u }), "value");
1521
+ }
1522
+ expected({ descriptor: e }) {
1523
+ let u = Array.from(this._choices.keys()).map((n) => this._choices.get(n)).filter(({ hidden: n }) => !n).map((n) => n.value).sort(An).map(e.value), t = u.slice(0, -2), r = u.slice(-2);
1524
+ return { text: t.concat(r.join(" or ")).join(", "), list: { title: "one of the following values", values: u } };
1525
+ }
1526
+ validate(e) {
1527
+ return this._choices.has(e);
1528
+ }
1529
+ deprecated(e) {
1530
+ let u = this._choices.get(e);
1531
+ return u && u.deprecated ? { value: e } : !1;
1532
+ }
1533
+ forward(e) {
1534
+ let u = this._choices.get(e);
1535
+ return u ? u.forward : void 0;
1536
+ }
1537
+ redirect(e) {
1538
+ let u = this._choices.get(e);
1539
+ return u ? u.redirect : void 0;
1540
+ }
1541
+ }, xn = class extends U {
1542
+ expected() {
1543
+ return "a number";
1544
+ }
1545
+ validate(e, u) {
1546
+ return typeof e == "number";
1547
+ }
1548
+ }, Nn = class extends xn {
1549
+ expected() {
1550
+ return "an integer";
1551
+ }
1552
+ validate(e, u) {
1553
+ return u.normalizeValidateResult(super.validate(e, u), e) === !0 && bn(e);
1554
+ }
1555
+ }, bu = class extends U {
1556
+ expected() {
1557
+ return "a string";
1558
+ }
1559
+ validate(e) {
1560
+ return typeof e == "string";
1561
+ }
1562
+ }, On = ue, _n = nt, jn = cn, Tn = ln, In = class {
1563
+ constructor(e, u) {
1564
+ let { logger: t = console, loggerPrintWidth: r = 80, descriptor: n = On, unknown: D = _n, invalid: a = jn, deprecated: i = Tn, missing: o = () => !1, required: s = () => !1, preprocess: c = (l) => l, postprocess: F = () => he } = u || {};
1565
+ this._utils = { descriptor: n, logger: t || { warn: () => {
1566
+ } }, loggerPrintWidth: r, schemas: gn(e, "name"), normalizeDefaultResult: Eu, normalizeExpectedResult: Dt, normalizeDeprecatedResult: yu, normalizeForwardResult: Re, normalizeRedirectResult: Bu, normalizeValidateResult: gu }, this._unknownHandler = D, this._invalidHandler = wn(a), this._deprecatedHandler = i, this._identifyMissing = (l, d) => !(l in d) || o(l, d), this._identifyRequired = s, this._preprocess = c, this._postprocess = F, this.cleanHistory();
1567
+ }
1568
+ cleanHistory() {
1569
+ this._hasDeprecationWarned = vn();
1570
+ }
1571
+ normalize(e) {
1572
+ let u = {}, t = [this._preprocess(e, this._utils)], r = () => {
1573
+ for (; t.length !== 0; ) {
1574
+ let n = t.shift(), D = this._applyNormalization(n, u);
1575
+ t.push(...D);
1576
+ }
1577
+ };
1578
+ r();
1579
+ for (let n of Object.keys(this._utils.schemas)) {
1580
+ let D = this._utils.schemas[n];
1581
+ if (!(n in u)) {
1582
+ let a = Eu(D.default(this._utils));
1583
+ "value" in a && t.push({ [n]: a.value });
1584
+ }
1585
+ }
1586
+ r();
1587
+ for (let n of Object.keys(this._utils.schemas)) {
1588
+ if (!(n in u)) continue;
1589
+ let D = this._utils.schemas[n], a = u[n], i = D.postprocess(a, this._utils);
1590
+ i !== he && (this._applyValidation(i, n, D), u[n] = i);
1591
+ }
1592
+ return this._applyPostprocess(u), this._applyRequiredCheck(u), u;
1593
+ }
1594
+ _applyNormalization(e, u) {
1595
+ let t = [], { knownKeys: r, unknownKeys: n } = this._partitionOptionKeys(e);
1596
+ for (let D of r) {
1597
+ let a = this._utils.schemas[D], i = a.preprocess(e[D], this._utils);
1598
+ this._applyValidation(i, D, a);
1599
+ let o = ({ from: F, to: l }) => {
1600
+ t.push(typeof l == "string" ? { [l]: F } : { [l.key]: l.value });
1601
+ }, s = ({ value: F, redirectTo: l }) => {
1602
+ let d = yu(a.deprecated(F, this._utils), i, !0);
1603
+ if (d !== !1) if (d === !0) this._hasDeprecationWarned(D) || this._utils.logger.warn(this._deprecatedHandler(D, l, this._utils));
1604
+ else for (let { value: f } of d) {
1605
+ let h = { key: D, value: f };
1606
+ if (!this._hasDeprecationWarned(h)) {
1607
+ let p = typeof l == "string" ? { key: l, value: f } : l;
1608
+ this._utils.logger.warn(this._deprecatedHandler(h, p, this._utils));
1609
+ }
1610
+ }
1611
+ };
1612
+ Re(a.forward(i, this._utils), i).forEach(o);
1613
+ let c = Bu(a.redirect(i, this._utils), i);
1614
+ if (c.redirect.forEach(o), "remain" in c) {
1615
+ let F = c.remain;
1616
+ u[D] = D in u ? a.overlap(u[D], F, this._utils) : F, s({ value: F });
1617
+ }
1618
+ for (let { from: F, to: l } of c.redirect) s({ value: F, redirectTo: l });
1619
+ }
1620
+ for (let D of n) {
1621
+ let a = e[D];
1622
+ this._applyUnknownHandler(D, a, u, (i, o) => {
1623
+ t.push({ [i]: o });
1624
+ });
1625
+ }
1626
+ return t;
1627
+ }
1628
+ _applyRequiredCheck(e) {
1629
+ for (let u of Object.keys(this._utils.schemas)) if (this._identifyMissing(u, e) && this._identifyRequired(u)) throw this._invalidHandler(u, ut, this._utils);
1630
+ }
1631
+ _partitionOptionKeys(e) {
1632
+ let [u, t] = Bn(Object.keys(e).filter((r) => !this._identifyMissing(r, e)), (r) => r in this._utils.schemas);
1633
+ return { knownKeys: u, unknownKeys: t };
1634
+ }
1635
+ _applyValidation(e, u, t) {
1636
+ let r = gu(t.validate(e, this._utils), e);
1637
+ if (r !== !0) throw this._invalidHandler(u, r.value, this._utils);
1638
+ }
1639
+ _applyUnknownHandler(e, u, t, r) {
1640
+ let n = this._unknownHandler(e, u, this._utils);
1641
+ if (n) for (let D of Object.keys(n)) {
1642
+ if (this._identifyMissing(D, n)) continue;
1643
+ let a = n[D];
1644
+ D in this._utils.schemas ? r(D, a) : t[D] = a;
1645
+ }
1646
+ }
1647
+ _applyPostprocess(e) {
1648
+ let u = this._postprocess(e, this._utils);
1649
+ if (u !== he) {
1650
+ if (u.delete) for (let t of u.delete) delete e[t];
1651
+ if (u.override) {
1652
+ let { knownKeys: t, unknownKeys: r } = this._partitionOptionKeys(u.override);
1653
+ for (let n of t) {
1654
+ let D = u.override[n];
1655
+ this._applyValidation(D, n, this._utils.schemas[n]), e[n] = D;
1656
+ }
1657
+ for (let n of r) {
1658
+ let D = u.override[n];
1659
+ this._applyUnknownHandler(n, D, e, (a, i) => {
1660
+ let o = this._utils.schemas[a];
1661
+ this._applyValidation(i, a, o), e[a] = i;
1662
+ });
1663
+ }
1664
+ }
1665
+ }
1666
+ }
1667
+ }, Oe;
1668
+ function Pn(e, u, { logger: t = !1, isCLI: r = !1, passThrough: n = !1, FlagSchema: D, descriptor: a } = {}) {
1669
+ if (r) {
1670
+ if (!D) throw new Error("'FlagSchema' option is required.");
1671
+ if (!a) throw new Error("'descriptor' option is required.");
1672
+ } else a = ue;
1673
+ let i = n ? Array.isArray(n) ? (l, d) => n.includes(l) ? { [l]: d } : void 0 : (l, d) => ({ [l]: d }) : (l, d, f) => {
1674
+ let { _: h, ...p } = f.schemas;
1675
+ return nt(l, d, { ...f, schemas: p });
1676
+ }, o = $n(u, { isCLI: r, FlagSchema: D }), s = new In(o, { logger: t, unknown: i, descriptor: a }), c = t !== !1;
1677
+ c && Oe && (s._hasDeprecationWarned = Oe);
1678
+ let F = s.normalize(e);
1679
+ return c && (Oe = s._hasDeprecationWarned), F;
1680
+ }
1681
+ function $n(e, { isCLI: u, FlagSchema: t }) {
1682
+ let r = [];
1683
+ u && r.push(Cn.create({ name: "_" }));
1684
+ for (let n of e) r.push(Ln(n, { isCLI: u, optionInfos: e, FlagSchema: t })), n.alias && u && r.push(hn.create({ name: n.alias, sourceName: n.name }));
1685
+ return r;
1686
+ }
1687
+ function Ln(e, { isCLI: u, optionInfos: t, FlagSchema: r }) {
1688
+ let { name: n } = e, D = { name: n }, a, i = {};
1689
+ switch (e.type) {
1690
+ case "int":
1691
+ a = Nn, u && (D.preprocess = Number);
1692
+ break;
1693
+ case "string":
1694
+ a = bu;
1695
+ break;
1696
+ case "choice":
1697
+ a = Sn, D.choices = e.choices.map((o) => o != null && o.redirect ? { ...o, redirect: { to: { key: e.name, value: o.redirect } } } : o);
1698
+ break;
1699
+ case "boolean":
1700
+ a = En;
1701
+ break;
1702
+ case "flag":
1703
+ a = r, D.flags = t.flatMap((o) => [o.alias, o.description && o.name, o.oppositeDescription && `no-${o.name}`].filter(Boolean));
1704
+ break;
1705
+ case "path":
1706
+ a = bu;
1707
+ break;
1708
+ default:
1709
+ throw new Error(`Unexpected type ${e.type}`);
1710
+ }
1711
+ if (e.exception ? D.validate = (o, s, c) => e.exception(o) || s.validate(o, c) : D.validate = (o, s, c) => o === void 0 || s.validate(o, c), e.redirect && (i.redirect = (o) => o ? { to: typeof e.redirect == "string" ? e.redirect : { key: e.redirect.option, value: e.redirect.value } } : void 0), e.deprecated && (i.deprecated = !0), u && !e.array) {
1712
+ let o = D.preprocess || ((s) => s);
1713
+ D.preprocess = (s, c, F) => c.preprocess(o(Array.isArray(s) ? v(!1, s, -1) : s), F);
1714
+ }
1715
+ return e.array ? mn.create({ ...u ? { preprocess: (o) => Array.isArray(o) ? o : [o] } : {}, ...i, valueSchema: a.create(D) }) : a.create({ ...D, ...i });
1716
+ }
1717
+ var Rn = Pn, Wn = (e, u, t) => {
1718
+ if (!(e && u == null)) {
1719
+ if (u.findLast) return u.findLast(t);
1720
+ for (let r = u.length - 1; r >= 0; r--) {
1721
+ let n = u[r];
1722
+ if (t(n, r, u)) return n;
1723
+ }
1724
+ }
1725
+ }, at = Wn;
1726
+ function it(e, u) {
1727
+ if (!u) throw new Error("parserName is required.");
1728
+ let t = at(!1, e, (n) => n.parsers && Object.prototype.hasOwnProperty.call(n.parsers, u));
1729
+ if (t) return t;
1730
+ let r = `Couldn't resolve parser "${u}".`;
1731
+ throw r += " Plugins must be explicitly added to the standalone bundle.", new Zu(r);
1732
+ }
1733
+ function Mn(e, u) {
1734
+ if (!u) throw new Error("astFormat is required.");
1735
+ let t = at(!1, e, (n) => n.printers && Object.prototype.hasOwnProperty.call(n.printers, u));
1736
+ if (t) return t;
1737
+ let r = `Couldn't find plugin for AST format "${u}".`;
1738
+ throw r += " Plugins must be explicitly added to the standalone bundle.", new Zu(r);
1739
+ }
1740
+ function Qe({ plugins: e, parser: u }) {
1741
+ let t = it(e, u);
1742
+ return ot(t, u);
1743
+ }
1744
+ function ot(e, u) {
1745
+ let t = e.parsers[u];
1746
+ return typeof t == "function" ? t() : t;
1747
+ }
1748
+ function Vn(e, u) {
1749
+ let t = e.printers[u];
1750
+ return typeof t == "function" ? t() : t;
1751
+ }
1752
+ var Au = { astFormat: "estree", printer: {}, originalText: void 0, locStart: null, locEnd: null };
1753
+ async function zn(e, u = {}) {
1754
+ var t;
1755
+ let r = { ...e };
1756
+ if (!r.parser) if (r.filepath) {
1757
+ if (r.parser = sn(r, { physicalFile: r.filepath }), !r.parser) throw new iu(`No parser could be inferred for file "${r.filepath}".`);
1758
+ } else throw new iu("No parser and no file path given, couldn't infer a parser.");
1759
+ let n = Qu({ plugins: e.plugins, showDeprecated: !0 }).options, D = { ...Au, ...Object.fromEntries(n.filter((l) => l.default !== void 0).map((l) => [l.name, l.default])) }, a = it(r.plugins, r.parser), i = await ot(a, r.parser);
1760
+ r.astFormat = i.astFormat, r.locEnd = i.locEnd, r.locStart = i.locStart;
1761
+ let o = (t = a.printers) != null && t[i.astFormat] ? a : Mn(r.plugins, i.astFormat), s = await Vn(o, i.astFormat);
1762
+ r.printer = s;
1763
+ let c = o.defaultOptions ? Object.fromEntries(Object.entries(o.defaultOptions).filter(([, l]) => l !== void 0)) : {}, F = { ...D, ...c };
1764
+ for (let [l, d] of Object.entries(F)) (r[l] === null || r[l] === void 0) && (r[l] = d);
1765
+ return r.parser === "json" && (r.trailingComma = "none"), Rn(r, n, { passThrough: Object.keys(Au), ...u });
1766
+ }
1767
+ var ne = zn, qn = St(Ot());
1768
+ async function Un(e, u) {
1769
+ let t = await Qe(u), r = t.preprocess ? t.preprocess(e, u) : e;
1770
+ u.originalText = r;
1771
+ let n;
1772
+ try {
1773
+ n = await t.parse(r, u, u);
1774
+ } catch (D) {
1775
+ Jn(D, e);
1776
+ }
1777
+ return { text: r, ast: n };
1778
+ }
1779
+ function Jn(e, u) {
1780
+ let { loc: t } = e;
1781
+ if (t) {
1782
+ let r = (0, qn.codeFrameColumns)(u, t, { highlightCode: !0 });
1783
+ throw e.message += `
1784
+ ` + r, e.codeFrame = r, e;
1785
+ }
1786
+ throw e;
1787
+ }
1788
+ var le = Un;
1789
+ async function Gn(e, u, t, r, n) {
1790
+ let { embeddedLanguageFormatting: D, printer: { embed: a, hasPrettierIgnore: i = () => !1, getVisitorKeys: o } } = t;
1791
+ if (!a || D !== "auto") return;
1792
+ 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");
1793
+ let s = Be(a.getVisitorKeys ?? o), c = [];
1794
+ d();
1795
+ let F = e.stack;
1796
+ for (let { print: f, node: h, pathStack: p } of c) try {
1797
+ e.stack = p;
1798
+ let C = await f(l, u, e, t);
1799
+ C && n.set(h, C);
1800
+ } catch (C) {
1801
+ if (globalThis.PRETTIER_DEBUG) throw C;
1802
+ }
1803
+ e.stack = F;
1804
+ function l(f, h) {
1805
+ return Hn(f, h, t, r);
1806
+ }
1807
+ function d() {
1808
+ let { node: f } = e;
1809
+ if (f === null || typeof f != "object" || i(e)) return;
1810
+ for (let p of s(f)) Array.isArray(f[p]) ? e.each(d, p) : e.call(d, p);
1811
+ let h = a(e, t);
1812
+ if (h) {
1813
+ if (typeof h == "function") {
1814
+ c.push({ print: h, node: f, pathStack: [...e.stack] });
1815
+ return;
1816
+ }
1817
+ n.set(f, h);
1818
+ }
1819
+ }
1820
+ }
1821
+ async function Hn(e, u, t, r) {
1822
+ let n = await ne({ ...t, ...u, parentParser: t.parser, originalText: e, cursorOffset: void 0, rangeStart: void 0, rangeEnd: void 0 }, { passThrough: !0 }), { ast: D } = await le(e, n), a = await r(D, n);
1823
+ return Pu(a);
1824
+ }
1825
+ function Kn(e, u) {
1826
+ let { originalText: t, [/* @__PURE__ */ Symbol.for("comments")]: r, locStart: n, locEnd: D, [/* @__PURE__ */ Symbol.for("printedComments")]: a } = u, { node: i } = e, o = n(i), s = D(i);
1827
+ for (let c of r) n(c) >= o && D(c) <= s && a.add(c);
1828
+ return t.slice(o, s);
1829
+ }
1830
+ var Yn = Kn;
1831
+ async function be(e, u) {
1832
+ ({ ast: e } = await st(e, u));
1833
+ let t = /* @__PURE__ */ new Map(), r = new kr(e), n = /* @__PURE__ */ new Map();
1834
+ await Gn(r, a, u, be, n);
1835
+ let D = await wu(r, u, a, void 0, n);
1836
+ if (Hr(u), u.cursorOffset >= 0) {
1837
+ if (u.nodeAfterCursor && !u.nodeBeforeCursor) return [K, D];
1838
+ if (u.nodeBeforeCursor && !u.nodeAfterCursor) return [D, K];
1839
+ }
1840
+ return D;
1841
+ function a(o, s) {
1842
+ return o === void 0 || o === r ? i(s) : Array.isArray(o) ? r.call(() => i(s), ...o) : r.call(() => i(s), o);
1843
+ }
1844
+ function i(o) {
1845
+ let s = r.node;
1846
+ if (s == null) return "";
1847
+ let c = s && typeof s == "object" && o === void 0;
1848
+ if (c && t.has(s)) return t.get(s);
1849
+ let F = wu(r, u, a, o, n);
1850
+ return c && t.set(s, F), F;
1851
+ }
1852
+ }
1853
+ function wu(e, u, t, r, n) {
1854
+ var D;
1855
+ let { node: a } = e, { printer: i } = u, o;
1856
+ switch ((D = i.hasPrettierIgnore) != null && D.call(i, e) ? o = Yn(e, u) : n.has(a) ? o = n.get(a) : o = i.print(e, u, t, r), a) {
1857
+ case u.cursorNode:
1858
+ o = Fe(o, (s) => [K, s, K]);
1859
+ break;
1860
+ case u.nodeBeforeCursor:
1861
+ o = Fe(o, (s) => [s, K]);
1862
+ break;
1863
+ case u.nodeAfterCursor:
1864
+ o = Fe(o, (s) => [K, s]);
1865
+ break;
1866
+ }
1867
+ return i.printComment && (!i.willPrintOwnComments || !i.willPrintOwnComments(e, u)) && (o = Gr(e, o, u)), o;
1868
+ }
1869
+ async function st(e, u) {
1870
+ let t = e.comments ?? [];
1871
+ u[/* @__PURE__ */ Symbol.for("comments")] = t, u[/* @__PURE__ */ Symbol.for("printedComments")] = /* @__PURE__ */ new Set(), Wr(e, u);
1872
+ let { printer: { preprocess: r } } = u;
1873
+ return e = r ? await r(e, u) : e, { ast: e, comments: t };
1874
+ }
1875
+ function Zn(e, u) {
1876
+ let { cursorOffset: t, locStart: r, locEnd: n } = u, D = Be(u.printer.getVisitorKeys), a = (d) => r(d) <= t && n(d) >= t, i = e, o = [e];
1877
+ for (let d of Nr(e, { getVisitorKeys: D, filter: a })) o.push(d), i = d;
1878
+ if (Or(i, { getVisitorKeys: D })) return { cursorNode: i };
1879
+ let s, c, F = -1, l = Number.POSITIVE_INFINITY;
1880
+ for (; o.length > 0 && (s === void 0 || c === void 0); ) {
1881
+ i = o.pop();
1882
+ let d = s !== void 0, f = c !== void 0;
1883
+ for (let h of ve(i, { getVisitorKeys: D })) {
1884
+ if (!d) {
1885
+ let p = n(h);
1886
+ p <= t && p > F && (s = h, F = p);
1887
+ }
1888
+ if (!f) {
1889
+ let p = r(h);
1890
+ p >= t && p < l && (c = h, l = p);
1891
+ }
1892
+ }
1893
+ }
1894
+ return { nodeBeforeCursor: s, nodeAfterCursor: c };
1895
+ }
1896
+ var lt = Zn;
1897
+ function Qn(e, u) {
1898
+ let { printer: { massageAstNode: t, getVisitorKeys: r } } = u;
1899
+ if (!t) return e;
1900
+ let n = Be(r), D = t.ignoredProperties ?? /* @__PURE__ */ new Set();
1901
+ return a(e);
1902
+ function a(i, o) {
1903
+ if (!(i !== null && typeof i == "object")) return i;
1904
+ if (Array.isArray(i)) return i.map((l) => a(l, o)).filter(Boolean);
1905
+ let s = {}, c = new Set(n(i));
1906
+ for (let l in i) !Object.prototype.hasOwnProperty.call(i, l) || D.has(l) || (c.has(l) ? s[l] = a(i[l], i) : s[l] = i[l]);
1907
+ let F = t(i, s, o);
1908
+ if (F !== null) return F ?? s;
1909
+ }
1910
+ }
1911
+ var Xn = Qn, eD = (e, u, t) => {
1912
+ if (!(e && u == null)) {
1913
+ if (u.findLastIndex) return u.findLastIndex(t);
1914
+ for (let r = u.length - 1; r >= 0; r--) {
1915
+ let n = u[r];
1916
+ if (t(n, r, u)) return r;
1917
+ }
1918
+ return -1;
1919
+ }
1920
+ }, uD = eD, tD = ({ parser: e }) => e === "json" || e === "json5" || e === "jsonc" || e === "json-stringify";
1921
+ function rD(e, u) {
1922
+ let t = [e.node, ...e.parentNodes], r = /* @__PURE__ */ new Set([u.node, ...u.parentNodes]);
1923
+ return t.find((n) => ct.has(n.type) && r.has(n));
1924
+ }
1925
+ function ku(e) {
1926
+ let u = uD(!1, e, (t) => t.type !== "Program" && t.type !== "File");
1927
+ return u === -1 ? e : e.slice(0, u + 1);
1928
+ }
1929
+ function nD(e, u, { locStart: t, locEnd: r }) {
1930
+ let n = e.node, D = u.node;
1931
+ if (n === D) return { startNode: n, endNode: D };
1932
+ let a = t(e.node);
1933
+ for (let o of ku(u.parentNodes)) if (t(o) >= a) D = o;
1934
+ else break;
1935
+ let i = r(u.node);
1936
+ for (let o of ku(e.parentNodes)) {
1937
+ if (r(o) <= i) n = o;
1938
+ else break;
1939
+ if (n === D) break;
1940
+ }
1941
+ return { startNode: n, endNode: D };
1942
+ }
1943
+ function We(e, u, t, r, n = [], D) {
1944
+ let { locStart: a, locEnd: i } = t, o = a(e), s = i(e);
1945
+ if (!(u > s || u < o || D === "rangeEnd" && u === o || D === "rangeStart" && u === s)) {
1946
+ for (let c of Ye(e, t)) {
1947
+ let F = We(c, u, t, r, [e, ...n], D);
1948
+ if (F) return F;
1949
+ }
1950
+ if (!r || r(e, n[0])) return { node: e, parentNodes: n };
1951
+ }
1952
+ }
1953
+ function DD(e, u) {
1954
+ return u !== "DeclareExportDeclaration" && e !== "TypeParameterDeclaration" && (e === "Directive" || e === "TypeAlias" || e === "TSExportAssignment" || e.startsWith("Declare") || e.startsWith("TSDeclare") || e.endsWith("Statement") || e.endsWith("Declaration"));
1955
+ }
1956
+ var ct = /* @__PURE__ */ new Set(["JsonRoot", "ObjectExpression", "ArrayExpression", "StringLiteral", "NumericLiteral", "BooleanLiteral", "NullLiteral", "UnaryExpression", "TemplateLiteral"]), aD = /* @__PURE__ */ new Set(["OperationDefinition", "FragmentDefinition", "VariableDefinition", "TypeExtensionDefinition", "ObjectTypeDefinition", "FieldDefinition", "DirectiveDefinition", "EnumTypeDefinition", "EnumValueDefinition", "InputValueDefinition", "InputObjectTypeDefinition", "SchemaDefinition", "OperationTypeDefinition", "InterfaceTypeDefinition", "UnionTypeDefinition", "ScalarTypeDefinition"]);
1957
+ function Su(e, u, t) {
1958
+ if (!u) return !1;
1959
+ switch (e.parser) {
1960
+ case "flow":
1961
+ case "hermes":
1962
+ case "babel":
1963
+ case "babel-flow":
1964
+ case "babel-ts":
1965
+ case "typescript":
1966
+ case "acorn":
1967
+ case "espree":
1968
+ case "meriyah":
1969
+ case "oxc":
1970
+ case "oxc-ts":
1971
+ case "__babel_estree":
1972
+ return DD(u.type, t?.type);
1973
+ case "json":
1974
+ case "json5":
1975
+ case "jsonc":
1976
+ case "json-stringify":
1977
+ return ct.has(u.type);
1978
+ case "graphql":
1979
+ return aD.has(u.kind);
1980
+ case "vue":
1981
+ return u.tag !== "root";
1982
+ }
1983
+ return !1;
1984
+ }
1985
+ function iD(e, u, t) {
1986
+ let { rangeStart: r, rangeEnd: n, locStart: D, locEnd: a } = u;
1987
+ Le.ok(n > r);
1988
+ let i = e.slice(r, n).search(/\S/u), o = i === -1;
1989
+ if (!o) for (r += i; n > r && !/\S/u.test(e[n - 1]); --n) ;
1990
+ let s = We(t, r, u, (d, f) => Su(u, d, f), [], "rangeStart"), c = o ? s : We(t, n, u, (d) => Su(u, d), [], "rangeEnd");
1991
+ if (!s || !c) return { rangeStart: 0, rangeEnd: 0 };
1992
+ let F, l;
1993
+ if (tD(u)) {
1994
+ let d = rD(s, c);
1995
+ F = d, l = d;
1996
+ } else ({ startNode: F, endNode: l } = nD(s, c, u));
1997
+ return { rangeStart: Math.min(D(F), D(l)), rangeEnd: Math.max(a(F), a(l)) };
1998
+ }
1999
+ var ft = "\uFEFF", xu = /* @__PURE__ */ Symbol("cursor");
2000
+ async function dt(e, u, t = 0) {
2001
+ if (!e || e.trim().length === 0) return { formatted: "", cursorOffset: -1, comments: [] };
2002
+ let { ast: r, text: n } = await le(e, u);
2003
+ u.cursorOffset >= 0 && (u = { ...u, ...lt(r, u) });
2004
+ let D = await be(r, u);
2005
+ t > 0 && (D = Vu([Y, D], t, u.tabWidth));
2006
+ let a = ye(D, u);
2007
+ if (t > 0) {
2008
+ let o = a.formatted.trim();
2009
+ 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 + ze(u.endOfLine);
2010
+ }
2011
+ let i = u[/* @__PURE__ */ Symbol.for("comments")];
2012
+ if (u.cursorOffset >= 0) {
2013
+ let o, s, c, F;
2014
+ if ((u.cursorNode || u.nodeBeforeCursor || u.nodeAfterCursor) && a.cursorNodeText) if (c = a.cursorNodeStart, F = a.cursorNodeText, u.cursorNode) o = u.locStart(u.cursorNode), s = n.slice(o, u.locEnd(u.cursorNode));
2015
+ else {
2016
+ if (!u.nodeBeforeCursor && !u.nodeAfterCursor) throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");
2017
+ o = u.nodeBeforeCursor ? u.locEnd(u.nodeBeforeCursor) : 0;
2018
+ let C = u.nodeAfterCursor ? u.locStart(u.nodeAfterCursor) : n.length;
2019
+ s = n.slice(o, C);
2020
+ }
2021
+ else o = 0, s = n, c = 0, F = a.formatted;
2022
+ let l = u.cursorOffset - o;
2023
+ if (s === F) return { formatted: a.formatted, cursorOffset: c + l, comments: i };
2024
+ let d = s.split("");
2025
+ d.splice(l, 0, xu);
2026
+ let f = F.split(""), h = $t(d, f), p = c;
2027
+ for (let C of h) if (C.removed) {
2028
+ if (C.value.includes(xu)) break;
2029
+ } else p += C.count;
2030
+ return { formatted: a.formatted, cursorOffset: p, comments: i };
2031
+ }
2032
+ return { formatted: a.formatted, cursorOffset: -1, comments: i };
2033
+ }
2034
+ async function oD(e, u) {
2035
+ let { ast: t, text: r } = await le(e, u), { rangeStart: n, rangeEnd: D } = iD(r, u, t), a = r.slice(n, D), i = Math.min(n, r.lastIndexOf(`
2036
+ `, n) + 1), o = r.slice(i, n).match(/^\s*/u)[0], s = He(o, u.tabWidth), c = await dt(a, { ...u, rangeStart: 0, rangeEnd: Number.POSITIVE_INFINITY, cursorOffset: u.cursorOffset > n && u.cursorOffset <= D ? u.cursorOffset - n : -1, endOfLine: "lf" }, s), F = c.formatted.trimEnd(), { cursorOffset: l } = u;
2037
+ l > D ? l += F.length - a.length : c.cursorOffset >= 0 && (l = c.cursorOffset + n);
2038
+ let d = r.slice(0, n) + F + r.slice(D);
2039
+ if (u.endOfLine !== "lf") {
2040
+ let f = ze(u.endOfLine);
2041
+ l >= 0 && f === `\r
2042
+ ` && (l += Tu(d.slice(0, l), `
2043
+ `)), d = me(!1, d, `
2044
+ `, f);
2045
+ }
2046
+ return { formatted: d, cursorOffset: l, comments: c.comments };
2047
+ }
2048
+ function _e(e, u, t) {
2049
+ return typeof u != "number" || Number.isNaN(u) || u < 0 || u > e.length ? t : u;
2050
+ }
2051
+ function Nu(e, u) {
2052
+ let { cursorOffset: t, rangeStart: r, rangeEnd: n } = u;
2053
+ return t = _e(e, t, -1), r = _e(e, r, 0), n = _e(e, n, e.length), { ...u, cursorOffset: t, rangeStart: r, rangeEnd: n };
2054
+ }
2055
+ function Ft(e, u) {
2056
+ let { cursorOffset: t, rangeStart: r, rangeEnd: n, endOfLine: D } = Nu(e, u), a = e.charAt(0) === ft;
2057
+ if (a && (e = e.slice(1), t--, r--, n--), D === "auto" && (D = Lt(e)), e.includes("\r")) {
2058
+ let i = (o) => Tu(e.slice(0, Math.max(o, 0)), `\r
2059
+ `);
2060
+ t -= i(t), r -= i(r), n -= i(n), e = Rt(e);
2061
+ }
2062
+ return { hasBOM: a, text: e, options: Nu(e, { ...u, cursorOffset: t, rangeStart: r, rangeEnd: n, endOfLine: D }) };
2063
+ }
2064
+ async function Ou(e, u) {
2065
+ let t = await Qe(u);
2066
+ return !t.hasPragma || t.hasPragma(e);
2067
+ }
2068
+ async function sD(e, u) {
2069
+ var t;
2070
+ let r = await Qe(u);
2071
+ return (t = r.hasIgnorePragma) == null ? void 0 : t.call(r, e);
2072
+ }
2073
+ async function pt(e, u) {
2074
+ let { hasBOM: t, text: r, options: n } = Ft(e, await ne(u));
2075
+ if (n.rangeStart >= n.rangeEnd && r !== "" || n.requirePragma && !await Ou(r, n) || n.checkIgnorePragma && await sD(r, n)) return { formatted: e, cursorOffset: u.cursorOffset, comments: [] };
2076
+ let D;
2077
+ return n.rangeStart > 0 || n.rangeEnd < r.length ? D = await oD(r, n) : (!n.requirePragma && n.insertPragma && n.printer.insertPragma && !await Ou(r, n) && (r = n.printer.insertPragma(r)), D = await dt(r, n)), t && (D.formatted = ft + D.formatted, D.cursorOffset >= 0 && D.cursorOffset++), D;
2078
+ }
2079
+ async function lD(e, u, t) {
2080
+ let { text: r, options: n } = Ft(e, await ne(u)), D = await le(r, n);
2081
+ return t && (t.preprocessForPrint && (D.ast = await st(D.ast, n)), t.massage && (D.ast = Xn(D.ast, n))), D;
2082
+ }
2083
+ async function cD(e, u) {
2084
+ u = await ne(u);
2085
+ let t = await be(e, u);
2086
+ return ye(t, u);
2087
+ }
2088
+ async function fD(e, u) {
2089
+ let t = hr(e), { formatted: r } = await pt(t, { ...u, parser: "__js_expression" });
2090
+ return r;
2091
+ }
2092
+ async function dD(e, u) {
2093
+ u = await ne(u);
2094
+ let { ast: t } = await le(e, u);
2095
+ return u.cursorOffset >= 0 && (u = { ...u, ...lt(t, u) }), be(t, u);
2096
+ }
2097
+ async function FD(e, u) {
2098
+ return ye(e, await ne(u));
2099
+ }
2100
+ var ht = {};
2101
+ Ve(ht, { builders: () => pD, printer: () => hD, utils: () => CD });
2102
+ var pD = { join: Mu, line: Ru, softline: Fr, hardline: Y, literalline: Wu, group: $u, conditionalGroup: or, fill: sr, lineSuffix: je, lineSuffixBoundary: fr, cursor: K, breakParent: ge, ifBreak: lr, trim: dr, indent: Ce, indentIfBreak: cr, align: re, addAlignmentToDoc: Vu, markAsRoot: ar, dedentToRoot: Dr, dedent: ir, hardlineWithoutBreakParent: Je, literallineWithoutBreakParent: Lu, label: pr, concat: (e) => e }, hD = { printDocToString: ye }, CD = { willBreak: Ht, traverseDoc: qe, findInDoc: Ue, mapDoc: Ee, removeLines: Zt, stripTrailingHardline: Pu, replaceEndOfLine: er, canBreak: tr }, mD = "3.6.2", Ct = {};
2103
+ Ve(Ct, { addDanglingComment: () => G, addLeadingComment: () => ie, addTrailingComment: () => oe, getAlignmentSize: () => He, getIndentSize: () => bD, getMaxContinuousCount: () => kD, getNextNonSpaceNonCommentCharacter: () => xD, getNextNonSpaceNonCommentCharacterIndex: () => RD, getPreferredQuote: () => OD, getStringWidth: () => Ge, hasNewline: () => V, hasNewlineInRange: () => jD, hasSpaces: () => ID, isNextLineEmpty: () => zD, isNextLineEmptyAfterIndex: () => tu, isPreviousLineEmpty: () => MD, makeString: () => $D, skip: () => se, skipEverythingButNewLine: () => Ju, skipInlineComment: () => Xe, skipNewline: () => Z, skipSpaces: () => z, skipToLineEnd: () => Uu, skipTrailingComment: () => eu, skipWhitespace: () => _r });
2104
+ function ED(e, u) {
2105
+ if (u === !1) return !1;
2106
+ if (e.charAt(u) === "/" && e.charAt(u + 1) === "*") {
2107
+ for (let t = u + 2; t < e.length; ++t) if (e.charAt(t) === "*" && e.charAt(t + 1) === "/") return t + 2;
2108
+ }
2109
+ return u;
2110
+ }
2111
+ var Xe = ED;
2112
+ function gD(e, u) {
2113
+ return u === !1 ? !1 : e.charAt(u) === "/" && e.charAt(u + 1) === "/" ? Ju(e, u) : u;
2114
+ }
2115
+ var eu = gD;
2116
+ function yD(e, u) {
2117
+ let t = null, r = u;
2118
+ for (; r !== t; ) t = r, r = z(e, r), r = Xe(e, r), r = eu(e, r), r = Z(e, r);
2119
+ return r;
2120
+ }
2121
+ var uu = yD;
2122
+ function vD(e, u) {
2123
+ let t = null, r = u;
2124
+ for (; r !== t; ) t = r, r = Uu(e, r), r = Xe(e, r), r = z(e, r);
2125
+ return r = eu(e, r), r = Z(e, r), r !== !1 && V(e, r);
2126
+ }
2127
+ var tu = vD;
2128
+ function BD(e, u) {
2129
+ let t = e.lastIndexOf(`
2130
+ `);
2131
+ return t === -1 ? 0 : He(e.slice(t + 1).match(/^[\t ]*/u)[0], u);
2132
+ }
2133
+ var bD = BD;
2134
+ function AD(e) {
2135
+ if (typeof e != "string") throw new TypeError("Expected a string");
2136
+ return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
2137
+ }
2138
+ function wD(e, u) {
2139
+ let t = e.match(new RegExp(`(${AD(u)})+`, "gu"));
2140
+ return t === null ? 0 : t.reduce((r, n) => Math.max(r, n.length / u.length), 0);
2141
+ }
2142
+ var kD = wD;
2143
+ function SD(e, u) {
2144
+ let t = uu(e, u);
2145
+ return t === !1 ? "" : e.charAt(t);
2146
+ }
2147
+ var xD = SD, de = "'", _u = '"';
2148
+ function ND(e, u) {
2149
+ let t = u === !0 || u === de ? de : _u, r = t === de ? _u : de, n = 0, D = 0;
2150
+ for (let a of e) a === t ? n++ : a === r && D++;
2151
+ return n > D ? r : t;
2152
+ }
2153
+ var OD = ND;
2154
+ function _D(e, u, t) {
2155
+ for (let r = u; r < t; ++r) if (e.charAt(r) === `
2156
+ `) return !0;
2157
+ return !1;
2158
+ }
2159
+ var jD = _D;
2160
+ function TD(e, u, t = {}) {
2161
+ return z(e, t.backwards ? u - 1 : u, t) !== u;
2162
+ }
2163
+ var ID = TD;
2164
+ function PD(e, u, t) {
2165
+ let r = u === '"' ? "'" : '"', n = me(!1, e, /\\(.)|(["'])/gsu, (D, a, i) => a === r ? a : i === u ? "\\" + i : i || (t && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(a) ? a : "\\" + a));
2166
+ return u + n + u;
2167
+ }
2168
+ var $D = PD;
2169
+ function LD(e, u, t) {
2170
+ return uu(e, t(u));
2171
+ }
2172
+ function RD(e, u) {
2173
+ return arguments.length === 2 || typeof u == "number" ? uu(e, u) : LD(...arguments);
2174
+ }
2175
+ function WD(e, u, t) {
2176
+ return Ze(e, t(u));
2177
+ }
2178
+ function MD(e, u) {
2179
+ return arguments.length === 2 || typeof u == "number" ? Ze(e, u) : WD(...arguments);
2180
+ }
2181
+ function VD(e, u, t) {
2182
+ return tu(e, t(u));
2183
+ }
2184
+ function zD(e, u) {
2185
+ return arguments.length === 2 || typeof u == "number" ? tu(e, u) : VD(...arguments);
2186
+ }
2187
+ function H(e, u = 1) {
2188
+ return async (...t) => {
2189
+ let r = t[u] ?? {}, n = r.plugins ?? [];
2190
+ return t[u] = { ...r, plugins: Array.isArray(n) ? n : Object.values(n) }, e(...t);
2191
+ };
2192
+ }
2193
+ var mt = H(pt);
2194
+ async function Et(e, u) {
2195
+ let { formatted: t } = await mt(e, { ...u, cursorOffset: -1 });
2196
+ return t;
2197
+ }
2198
+ async function qD(e, u) {
2199
+ return await Et(e, u) === e;
2200
+ }
2201
+ var UD = H(Qu, 0), JD = { parse: H(lD), formatAST: H(cD), formatDoc: H(fD), printToDoc: H(dD), printDocToString: H(FD) };
2202
+ export {
2203
+ JD as __debug,
2204
+ qD as check,
2205
+ ht as doc,
2206
+ Et as format,
2207
+ mt as formatWithCursor,
2208
+ UD as getSupportInfo,
2209
+ Ct as util,
2210
+ mD as version
2211
+ };