dorian 2.6.8 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.node-version +1 -1
  3. data/.npm-version +1 -1
  4. data/.rubocop.yml +25 -21
  5. data/.ruby-version +1 -1
  6. data/.tool-versions +2 -3
  7. data/Gemfile +0 -4
  8. data/Gemfile.lock +63 -116
  9. data/VERSION +1 -1
  10. data/dorian.gemspec +19 -19
  11. data/lib/dorian/bin.rb +82 -75
  12. data/package-lock.json +8 -8
  13. data/package.json +5 -5
  14. data/vendor/prettier/LICENSE +0 -4372
  15. data/vendor/prettier/README.md +14 -19
  16. data/vendor/prettier/THIRD-PARTY-NOTICES.md +6059 -0
  17. data/vendor/prettier/bin/prettier.cjs +27 -18
  18. data/vendor/prettier/doc.d.ts +11 -0
  19. data/vendor/prettier/doc.js +742 -776
  20. data/vendor/prettier/doc.mjs +743 -766
  21. data/vendor/prettier/index.cjs +266 -371
  22. data/vendor/prettier/index.d.ts +43 -16
  23. data/vendor/prettier/index.mjs +9615 -16721
  24. data/vendor/prettier/internal/experimental-cli-worker.mjs +2841 -0
  25. data/vendor/prettier/internal/experimental-cli.mjs +12790 -0
  26. data/vendor/prettier/internal/legacy-cli.mjs +6229 -0
  27. data/vendor/prettier/package.json +113 -108
  28. data/vendor/prettier/plugins/acorn.js +16 -6618
  29. data/vendor/prettier/plugins/acorn.mjs +16 -6456
  30. data/vendor/prettier/plugins/angular.js +4 -2435
  31. data/vendor/prettier/plugins/angular.mjs +4 -2375
  32. data/vendor/prettier/plugins/babel.d.ts +7 -7
  33. data/vendor/prettier/plugins/babel.js +15 -14271
  34. data/vendor/prettier/plugins/babel.mjs +15 -13986
  35. data/vendor/prettier/plugins/estree.d.ts +6 -1
  36. data/vendor/prettier/plugins/estree.js +43 -9486
  37. data/vendor/prettier/plugins/estree.mjs +43 -9278
  38. data/vendor/prettier/plugins/flow.js +19 -51476
  39. data/vendor/prettier/plugins/flow.mjs +19 -51218
  40. data/vendor/prettier/plugins/glimmer.d.ts +5 -1
  41. data/vendor/prettier/plugins/glimmer.js +30 -8527
  42. data/vendor/prettier/plugins/glimmer.mjs +30 -8414
  43. data/vendor/prettier/plugins/graphql.d.ts +5 -1
  44. data/vendor/prettier/plugins/graphql.js +15 -2408
  45. data/vendor/prettier/plugins/graphql.mjs +15 -2334
  46. data/vendor/prettier/plugins/html.d.ts +6 -1
  47. data/vendor/prettier/plugins/html.js +25 -8182
  48. data/vendor/prettier/plugins/html.mjs +25 -8077
  49. data/vendor/prettier/plugins/markdown.d.ts +5 -1
  50. data/vendor/prettier/plugins/markdown.js +57 -9063
  51. data/vendor/prettier/plugins/markdown.mjs +57 -8972
  52. data/vendor/prettier/plugins/meriyah.js +5 -5953
  53. data/vendor/prettier/plugins/meriyah.mjs +5 -5800
  54. data/vendor/prettier/plugins/postcss.d.ts +5 -1
  55. data/vendor/prettier/plugins/postcss.js +61 -9244
  56. data/vendor/prettier/plugins/postcss.mjs +61 -9046
  57. data/vendor/prettier/plugins/typescript.js +15 -38052
  58. data/vendor/prettier/plugins/typescript.mjs +15 -37726
  59. data/vendor/prettier/plugins/yaml.d.ts +5 -1
  60. data/vendor/prettier/plugins/yaml.js +157 -7423
  61. data/vendor/prettier/plugins/yaml.mjs +157 -7327
  62. data/vendor/prettier/standalone.d.ts +1 -1
  63. data/vendor/prettier/standalone.js +29 -3984
  64. data/vendor/prettier/standalone.mjs +29 -3938
  65. metadata +145 -40
  66. data/vendor/prettier/internal/cli.mjs +0 -4366
@@ -1,3938 +1,29 @@
1
- var yu = Object.create;
2
- var He = Object.defineProperty;
3
- var Au = Object.getOwnPropertyDescriptor;
4
- var Bu = Object.getOwnPropertyNames;
5
- var wu = Object.getPrototypeOf,
6
- xu = Object.prototype.hasOwnProperty;
7
- var sr = (e) => {
8
- throw TypeError(e);
9
- };
10
- var _u = (e, t) => () => (e && (t = e((e = 0))), t);
11
- var At = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports),
12
- We = (e, t) => {
13
- for (var r in t) He(e, r, { get: t[r], enumerable: !0 });
14
- },
15
- ar = (e, t, r, n) => {
16
- if ((t && typeof t == "object") || typeof t == "function")
17
- for (let o of Bu(t))
18
- !xu.call(e, o) &&
19
- o !== r &&
20
- He(e, o, {
21
- get: () => t[o],
22
- enumerable: !(n = Au(t, o)) || n.enumerable,
23
- });
24
- return e;
25
- };
26
- var Me = (e, t, r) => (
27
- (r = e != null ? yu(wu(e)) : {}),
28
- ar(
29
- t || !e || !e.__esModule
30
- ? He(r, "default", { value: e, enumerable: !0 })
31
- : r,
32
- e,
33
- )
34
- ),
35
- vu = (e) => ar(He({}, "__esModule", { value: !0 }), e);
36
- var bu = (e, t, r) => t.has(e) || sr("Cannot " + r);
37
- var Dr = (e, t, r) =>
38
- t.has(e)
39
- ? sr("Cannot add the same private member more than once")
40
- : t instanceof WeakSet
41
- ? t.add(e)
42
- : t.set(e, r);
43
- var pe = (e, t, r) => (bu(e, t, "access private method"), r);
44
- var it = At((ia, sn) => {
45
- "use strict";
46
- var on = new Proxy(String, { get: () => on });
47
- sn.exports = on;
48
- });
49
- var Tn = {};
50
- We(Tn, { default: () => _o, shouldHighlight: () => xo });
51
- var xo,
52
- _o,
53
- kn = _u(() => {
54
- (xo = () => !1), (_o = String);
55
- });
56
- var Pn = At((bD, Xt) => {
57
- var g = String,
58
- Ln = function () {
59
- return {
60
- isColorSupported: !1,
61
- reset: g,
62
- bold: g,
63
- dim: g,
64
- italic: g,
65
- underline: g,
66
- inverse: g,
67
- hidden: g,
68
- strikethrough: g,
69
- black: g,
70
- red: g,
71
- green: g,
72
- yellow: g,
73
- blue: g,
74
- magenta: g,
75
- cyan: g,
76
- white: g,
77
- gray: g,
78
- bgBlack: g,
79
- bgRed: g,
80
- bgGreen: g,
81
- bgYellow: g,
82
- bgBlue: g,
83
- bgMagenta: g,
84
- bgCyan: g,
85
- bgWhite: g,
86
- };
87
- };
88
- Xt.exports = Ln();
89
- Xt.exports.createColors = Ln;
90
- });
91
- var $n = At((Ct) => {
92
- "use strict";
93
- Object.defineProperty(Ct, "__esModule", { value: !0 });
94
- Ct.codeFrameColumns = Mn;
95
- Ct.default = To;
96
- var In = (kn(), vu(Tn)),
97
- Hn = vo(Pn(), !0);
98
- function Wn(e) {
99
- if (typeof WeakMap != "function") return null;
100
- var t = new WeakMap(),
101
- r = new WeakMap();
102
- return (Wn = function (n) {
103
- return n ? r : t;
104
- })(e);
105
- }
106
- function vo(e, t) {
107
- if (!t && e && e.__esModule) return e;
108
- if (e === null || (typeof e != "object" && typeof e != "function"))
109
- return { default: e };
110
- var r = Wn(t);
111
- if (r && r.has(e)) return r.get(e);
112
- var n = { __proto__: null },
113
- o = Object.defineProperty && Object.getOwnPropertyDescriptor;
114
- for (var u in e)
115
- if (u !== "default" && {}.hasOwnProperty.call(e, u)) {
116
- var i = o ? Object.getOwnPropertyDescriptor(e, u) : null;
117
- i && (i.get || i.set) ? Object.defineProperty(n, u, i) : (n[u] = e[u]);
118
- }
119
- return (n.default = e), r && r.set(e, n), n;
120
- }
121
- var bo = Hn.default,
122
- Rn = (e, t) => (r) => e(t(r)),
123
- Zt;
124
- function Oo(e) {
125
- if (e) {
126
- var t;
127
- return (t = Zt) != null || (Zt = (0, Hn.createColors)(!0)), Zt;
128
- }
129
- return bo;
130
- }
131
- var Yn = !1;
132
- function So(e) {
133
- return {
134
- gutter: e.gray,
135
- marker: Rn(e.red, e.bold),
136
- message: Rn(e.red, e.bold),
137
- };
138
- }
139
- var jn = /\r\n|[\n\r\u2028\u2029]/;
140
- function No(e, t, r) {
141
- let n = Object.assign({ column: 0, line: -1 }, e.start),
142
- o = Object.assign({}, n, e.end),
143
- { linesAbove: u = 2, linesBelow: i = 3 } = r || {},
144
- s = n.line,
145
- a = n.column,
146
- D = o.line,
147
- l = o.column,
148
- d = Math.max(s - (u + 1), 0),
149
- f = Math.min(t.length, D + i);
150
- s === -1 && (d = 0), D === -1 && (f = t.length);
151
- let p = D - s,
152
- c = {};
153
- if (p)
154
- for (let F = 0; F <= p; F++) {
155
- let m = F + s;
156
- if (!a) c[m] = !0;
157
- else if (F === 0) {
158
- let E = t[m - 1].length;
159
- c[m] = [a, E - a + 1];
160
- } else if (F === p) c[m] = [0, l];
161
- else {
162
- let E = t[m - F].length;
163
- c[m] = [0, E];
164
- }
165
- }
166
- else a === l ? (a ? (c[s] = [a, 0]) : (c[s] = !0)) : (c[s] = [a, l - a]);
167
- return { start: d, end: f, markerLines: c };
168
- }
169
- function Mn(e, t, r = {}) {
170
- let n = (r.highlightCode || r.forceColor) && (0, In.shouldHighlight)(r),
171
- o = Oo(r.forceColor),
172
- u = So(o),
173
- i = (F, m) => (n ? F(m) : m),
174
- s = e.split(jn),
175
- { start: a, end: D, markerLines: l } = No(t, s, r),
176
- d = t.start && typeof t.start.column == "number",
177
- f = String(D).length,
178
- c = (n ? (0, In.default)(e, r) : e)
179
- .split(jn, D)
180
- .slice(a, D)
181
- .map((F, m) => {
182
- let E = a + 1 + m,
183
- w = ` ${` ${E}`.slice(-f)} |`,
184
- h = l[E],
185
- C = !l[E + 1];
186
- if (h) {
187
- let k = "";
188
- if (Array.isArray(h)) {
189
- let v = F.slice(0, Math.max(h[0] - 1, 0)).replace(/[^\t]/g, " "),
190
- $ = h[1] || 1;
191
- (k = [
192
- `
193
- `,
194
- i(u.gutter, w.replace(/\d/g, " ")),
195
- " ",
196
- v,
197
- i(u.marker, "^").repeat($),
198
- ].join("")),
199
- C && r.message && (k += " " + i(u.message, r.message));
200
- }
201
- return [
202
- i(u.marker, ">"),
203
- i(u.gutter, w),
204
- F.length > 0 ? ` ${F}` : "",
205
- k,
206
- ].join("");
207
- } else return ` ${i(u.gutter, w)}${F.length > 0 ? ` ${F}` : ""}`;
208
- }).join(`
209
- `);
210
- return (
211
- r.message &&
212
- !d &&
213
- (c = `${" ".repeat(f + 1)}${r.message}
214
- ${c}`),
215
- n ? o.reset(c) : c
216
- );
217
- }
218
- function To(e, t, r, n = {}) {
219
- if (!Yn) {
220
- Yn = !0;
221
- let u =
222
- "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
223
- {
224
- let i = new Error(u);
225
- (i.name = "DeprecationWarning"), console.warn(new Error(u));
226
- }
227
- }
228
- return (r = Math.max(r, 0)), Mn(e, { start: { column: r, line: t } }, n);
229
- }
230
- });
231
- var ir = {};
232
- We(ir, {
233
- __debug: () => di,
234
- check: () => fi,
235
- doc: () => nr,
236
- format: () => gu,
237
- formatWithCursor: () => Cu,
238
- getSupportInfo: () => pi,
239
- util: () => or,
240
- version: () => fu,
241
- });
242
- var Ou = (e, t, r, n) => {
243
- if (!(e && t == null))
244
- return t.replaceAll
245
- ? t.replaceAll(r, n)
246
- : r.global
247
- ? t.replace(r, n)
248
- : t.split(r).join(n);
249
- },
250
- ne = Ou;
251
- function Z() {}
252
- Z.prototype = {
253
- diff: function (t, r) {
254
- var n,
255
- o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {},
256
- u = o.callback;
257
- typeof o == "function" && ((u = o), (o = {})), (this.options = o);
258
- var i = this;
259
- function s(h) {
260
- return u
261
- ? (setTimeout(function () {
262
- u(void 0, h);
263
- }, 0),
264
- !0)
265
- : h;
266
- }
267
- (t = this.castInput(t)),
268
- (r = this.castInput(r)),
269
- (t = this.removeEmpty(this.tokenize(t))),
270
- (r = this.removeEmpty(this.tokenize(r)));
271
- var a = r.length,
272
- D = t.length,
273
- l = 1,
274
- d = a + D;
275
- o.maxEditLength && (d = Math.min(d, o.maxEditLength));
276
- var f = (n = o.timeout) !== null && n !== void 0 ? n : 1 / 0,
277
- p = Date.now() + f,
278
- c = [{ oldPos: -1, lastComponent: void 0 }],
279
- F = this.extractCommon(c[0], r, t, 0);
280
- if (c[0].oldPos + 1 >= D && F + 1 >= a)
281
- return s([{ value: this.join(r), count: r.length }]);
282
- var m = -1 / 0,
283
- E = 1 / 0;
284
- function A() {
285
- for (var h = Math.max(m, -l); h <= Math.min(E, l); h += 2) {
286
- var C = void 0,
287
- k = c[h - 1],
288
- v = c[h + 1];
289
- k && (c[h - 1] = void 0);
290
- var $ = !1;
291
- if (v) {
292
- var ye = v.oldPos - h;
293
- $ = v && 0 <= ye && ye < a;
294
- }
295
- var yt = k && k.oldPos + 1 < D;
296
- if (!$ && !yt) {
297
- c[h] = void 0;
298
- continue;
299
- }
300
- if (
301
- (!yt || ($ && k.oldPos + 1 < v.oldPos)
302
- ? (C = i.addToPath(v, !0, void 0, 0))
303
- : (C = i.addToPath(k, void 0, !0, 1)),
304
- (F = i.extractCommon(C, r, t, h)),
305
- C.oldPos + 1 >= D && F + 1 >= a)
306
- )
307
- return s(Su(i, C.lastComponent, r, t, i.useLongestToken));
308
- (c[h] = C),
309
- C.oldPos + 1 >= D && (E = Math.min(E, h - 1)),
310
- F + 1 >= a && (m = Math.max(m, h + 1));
311
- }
312
- l++;
313
- }
314
- if (u)
315
- (function h() {
316
- setTimeout(function () {
317
- if (l > d || Date.now() > p) return u();
318
- A() || h();
319
- }, 0);
320
- })();
321
- else
322
- for (; l <= d && Date.now() <= p; ) {
323
- var w = A();
324
- if (w) return w;
325
- }
326
- },
327
- addToPath: function (t, r, n, o) {
328
- var u = t.lastComponent;
329
- return u && u.added === r && u.removed === n
330
- ? {
331
- oldPos: t.oldPos + o,
332
- lastComponent: {
333
- count: u.count + 1,
334
- added: r,
335
- removed: n,
336
- previousComponent: u.previousComponent,
337
- },
338
- }
339
- : {
340
- oldPos: t.oldPos + o,
341
- lastComponent: {
342
- count: 1,
343
- added: r,
344
- removed: n,
345
- previousComponent: u,
346
- },
347
- };
348
- },
349
- extractCommon: function (t, r, n, o) {
350
- for (
351
- var u = r.length, i = n.length, s = t.oldPos, a = s - o, D = 0;
352
- a + 1 < u && s + 1 < i && this.equals(r[a + 1], n[s + 1]);
353
-
354
- )
355
- a++, s++, D++;
356
- return (
357
- D && (t.lastComponent = { count: D, previousComponent: t.lastComponent }),
358
- (t.oldPos = s),
359
- a
360
- );
361
- },
362
- equals: function (t, r) {
363
- return this.options.comparator
364
- ? this.options.comparator(t, r)
365
- : t === r ||
366
- (this.options.ignoreCase && t.toLowerCase() === r.toLowerCase());
367
- },
368
- removeEmpty: function (t) {
369
- for (var r = [], n = 0; n < t.length; n++) t[n] && r.push(t[n]);
370
- return r;
371
- },
372
- castInput: function (t) {
373
- return t;
374
- },
375
- tokenize: function (t) {
376
- return t.split("");
377
- },
378
- join: function (t) {
379
- return t.join("");
380
- },
381
- };
382
- function Su(e, t, r, n, o) {
383
- for (var u = [], i; t; )
384
- u.push(t), (i = t.previousComponent), delete t.previousComponent, (t = i);
385
- u.reverse();
386
- for (var s = 0, a = u.length, D = 0, l = 0; s < a; s++) {
387
- var d = u[s];
388
- if (d.removed) {
389
- if (
390
- ((d.value = e.join(n.slice(l, l + d.count))),
391
- (l += d.count),
392
- s && u[s - 1].added)
393
- ) {
394
- var p = u[s - 1];
395
- (u[s - 1] = u[s]), (u[s] = p);
396
- }
397
- } else {
398
- if (!d.added && o) {
399
- var f = r.slice(D, D + d.count);
400
- (f = f.map(function (F, m) {
401
- var E = n[l + m];
402
- return E.length > F.length ? E : F;
403
- })),
404
- (d.value = e.join(f));
405
- } else d.value = e.join(r.slice(D, D + d.count));
406
- (D += d.count), d.added || (l += d.count);
407
- }
408
- }
409
- var c = u[a - 1];
410
- return (
411
- a > 1 &&
412
- typeof c.value == "string" &&
413
- (c.added || c.removed) &&
414
- e.equals("", c.value) &&
415
- ((u[a - 2].value += c.value), u.pop()),
416
- u
417
- );
418
- }
419
- var hi = new Z();
420
- var lr = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,
421
- cr = /\S/,
422
- fr = new Z();
423
- fr.equals = function (e, t) {
424
- return (
425
- this.options.ignoreCase && ((e = e.toLowerCase()), (t = t.toLowerCase())),
426
- e === t || (this.options.ignoreWhitespace && !cr.test(e) && !cr.test(t))
427
- );
428
- };
429
- fr.tokenize = function (e) {
430
- for (
431
- var t = e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/), r = 0;
432
- r < t.length - 1;
433
- r++
434
- )
435
- !t[r + 1] &&
436
- t[r + 2] &&
437
- lr.test(t[r]) &&
438
- lr.test(t[r + 2]) &&
439
- ((t[r] += t[r + 2]), t.splice(r + 1, 2), r--);
440
- return t;
441
- };
442
- var pr = new Z();
443
- pr.tokenize = function (e) {
444
- this.options.stripTrailingCr &&
445
- (e = e.replace(
446
- /\r\n/g,
447
- `
448
- `,
449
- ));
450
- var t = [],
451
- r = e.split(/(\n|\r\n)/);
452
- r[r.length - 1] || r.pop();
453
- for (var n = 0; n < r.length; n++) {
454
- var o = r[n];
455
- n % 2 && !this.options.newlineIsToken
456
- ? (t[t.length - 1] += o)
457
- : (this.options.ignoreWhitespace && (o = o.trim()), t.push(o));
458
- }
459
- return t;
460
- };
461
- var Nu = new Z();
462
- Nu.tokenize = function (e) {
463
- return e.split(/(\S.+?[.!?])(?=\s+|$)/);
464
- };
465
- var Tu = new Z();
466
- Tu.tokenize = function (e) {
467
- return e.split(/([{}:;,]|\s+)/);
468
- };
469
- function $e(e) {
470
- "@babel/helpers - typeof";
471
- return (
472
- typeof Symbol == "function" && typeof Symbol.iterator == "symbol"
473
- ? ($e = function (t) {
474
- return typeof t;
475
- })
476
- : ($e = function (t) {
477
- return t &&
478
- typeof Symbol == "function" &&
479
- t.constructor === Symbol &&
480
- t !== Symbol.prototype
481
- ? "symbol"
482
- : typeof t;
483
- }),
484
- $e(e)
485
- );
486
- }
487
- var ku = Object.prototype.toString,
488
- Ae = new Z();
489
- Ae.useLongestToken = !0;
490
- Ae.tokenize = pr.tokenize;
491
- Ae.castInput = function (e) {
492
- var t = this.options,
493
- r = t.undefinedReplacement,
494
- n = t.stringifyReplacer,
495
- o =
496
- n === void 0
497
- ? function (u, i) {
498
- return typeof i > "u" ? r : i;
499
- }
500
- : n;
501
- return typeof e == "string"
502
- ? e
503
- : JSON.stringify(Bt(e, null, null, o), o, " ");
504
- };
505
- Ae.equals = function (e, t) {
506
- return Z.prototype.equals.call(
507
- Ae,
508
- e.replace(/,([\r\n])/g, "$1"),
509
- t.replace(/,([\r\n])/g, "$1"),
510
- );
511
- };
512
- function Bt(e, t, r, n, o) {
513
- (t = t || []), (r = r || []), n && (e = n(o, e));
514
- var u;
515
- for (u = 0; u < t.length; u += 1) if (t[u] === e) return r[u];
516
- var i;
517
- if (ku.call(e) === "[object Array]") {
518
- for (
519
- t.push(e), i = new Array(e.length), r.push(i), u = 0;
520
- u < e.length;
521
- u += 1
522
- )
523
- i[u] = Bt(e[u], t, r, n, o);
524
- return t.pop(), r.pop(), i;
525
- }
526
- if ((e && e.toJSON && (e = e.toJSON()), $e(e) === "object" && e !== null)) {
527
- t.push(e), (i = {}), r.push(i);
528
- var s = [],
529
- a;
530
- for (a in e) e.hasOwnProperty(a) && s.push(a);
531
- for (s.sort(), u = 0; u < s.length; u += 1)
532
- (a = s[u]), (i[a] = Bt(e[a], t, r, n, a));
533
- t.pop(), r.pop();
534
- } else i = e;
535
- return i;
536
- }
537
- var Ve = new Z();
538
- Ve.tokenize = function (e) {
539
- return e.slice();
540
- };
541
- Ve.join = Ve.removeEmpty = function (e) {
542
- return e;
543
- };
544
- function dr(e, t, r) {
545
- return Ve.diff(e, t, r);
546
- }
547
- function Fr(e) {
548
- let t = e.indexOf("\r");
549
- return t >= 0
550
- ? e.charAt(t + 1) ===
551
- `
552
- `
553
- ? "crlf"
554
- : "cr"
555
- : "lf";
556
- }
557
- function Be(e) {
558
- switch (e) {
559
- case "cr":
560
- return "\r";
561
- case "crlf":
562
- return `\r
563
- `;
564
- default:
565
- return `
566
- `;
567
- }
568
- }
569
- function wt(e, t) {
570
- let r;
571
- switch (t) {
572
- case `
573
- `:
574
- r = /\n/gu;
575
- break;
576
- case "\r":
577
- r = /\r/gu;
578
- break;
579
- case `\r
580
- `:
581
- r = /\r\n/gu;
582
- break;
583
- default:
584
- throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`);
585
- }
586
- let n = e.match(r);
587
- return n ? n.length : 0;
588
- }
589
- function mr(e) {
590
- return ne(
591
- !1,
592
- e,
593
- /\r\n?/gu,
594
- `
595
- `,
596
- );
597
- }
598
- var U = "string",
599
- W = "array",
600
- z = "cursor",
601
- L = "indent",
602
- P = "align",
603
- I = "trim",
604
- x = "group",
605
- S = "fill",
606
- _ = "if-break",
607
- R = "indent-if-break",
608
- Y = "line-suffix",
609
- j = "line-suffix-boundary",
610
- B = "line",
611
- N = "label",
612
- b = "break-parent",
613
- Ue = new Set([z, L, P, I, x, S, _, R, Y, j, B, N, b]);
614
- function Lu(e) {
615
- if (typeof e == "string") return U;
616
- if (Array.isArray(e)) return W;
617
- if (!e) return;
618
- let { type: t } = e;
619
- if (Ue.has(t)) return t;
620
- }
621
- var G = Lu;
622
- var Pu = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
623
- function Iu(e) {
624
- let t = e === null ? "null" : typeof e;
625
- if (t !== "string" && t !== "object")
626
- return `Unexpected doc '${t}',
627
- Expected it to be 'string' or 'object'.`;
628
- if (G(e)) throw new Error("doc is valid.");
629
- let r = Object.prototype.toString.call(e);
630
- if (r !== "[object Object]") return `Unexpected doc '${r}'.`;
631
- let n = Pu([...Ue].map((o) => `'${o}'`));
632
- return `Unexpected doc.type '${e.type}'.
633
- Expected it to be ${n}.`;
634
- }
635
- var xt = class extends Error {
636
- name = "InvalidDocError";
637
- constructor(t) {
638
- super(Iu(t)), (this.doc = t);
639
- }
640
- },
641
- Q = xt;
642
- var Er = {};
643
- function Ru(e, t, r, n) {
644
- let o = [e];
645
- for (; o.length > 0; ) {
646
- let u = o.pop();
647
- if (u === Er) {
648
- r(o.pop());
649
- continue;
650
- }
651
- r && o.push(u, Er);
652
- let i = G(u);
653
- if (!i) throw new Q(u);
654
- if ((t == null ? void 0 : t(u)) !== !1)
655
- switch (i) {
656
- case W:
657
- case S: {
658
- let s = i === W ? u : u.parts;
659
- for (let a = s.length, D = a - 1; D >= 0; --D) o.push(s[D]);
660
- break;
661
- }
662
- case _:
663
- o.push(u.flatContents, u.breakContents);
664
- break;
665
- case x:
666
- if (n && u.expandedStates)
667
- for (let s = u.expandedStates.length, a = s - 1; a >= 0; --a)
668
- o.push(u.expandedStates[a]);
669
- else o.push(u.contents);
670
- break;
671
- case P:
672
- case L:
673
- case R:
674
- case N:
675
- case Y:
676
- o.push(u.contents);
677
- break;
678
- case U:
679
- case z:
680
- case I:
681
- case j:
682
- case B:
683
- case b:
684
- break;
685
- default:
686
- throw new Q(u);
687
- }
688
- }
689
- }
690
- var we = Ru;
691
- var hr = () => {},
692
- K = hr,
693
- ze = hr;
694
- function De(e) {
695
- return K(e), { type: L, contents: e };
696
- }
697
- function ae(e, t) {
698
- return K(t), { type: P, contents: t, n: e };
699
- }
700
- function _t(e, t = {}) {
701
- return (
702
- K(e),
703
- ze(t.expandedStates, !0),
704
- {
705
- type: x,
706
- id: t.id,
707
- contents: e,
708
- break: !!t.shouldBreak,
709
- expandedStates: t.expandedStates,
710
- }
711
- );
712
- }
713
- function Cr(e) {
714
- return ae(Number.NEGATIVE_INFINITY, e);
715
- }
716
- function gr(e) {
717
- return ae({ type: "root" }, e);
718
- }
719
- function yr(e) {
720
- return ae(-1, e);
721
- }
722
- function Ar(e, t) {
723
- return _t(e[0], { ...t, expandedStates: e });
724
- }
725
- function Ge(e) {
726
- return ze(e), { type: S, parts: e };
727
- }
728
- function Br(e, t = "", r = {}) {
729
- return (
730
- K(e),
731
- t !== "" && K(t),
732
- { type: _, breakContents: e, flatContents: t, groupId: r.groupId }
733
- );
734
- }
735
- function wr(e, t) {
736
- return K(e), { type: R, contents: e, groupId: t.groupId, negate: t.negate };
737
- }
738
- function xe(e) {
739
- return K(e), { type: Y, contents: e };
740
- }
741
- var xr = { type: j },
742
- de = { type: b },
743
- _r = { type: I },
744
- _e = { type: B, hard: !0 },
745
- vt = { type: B, hard: !0, literal: !0 },
746
- Ke = { type: B },
747
- vr = { type: B, soft: !0 },
748
- q = [_e, de],
749
- qe = [vt, de],
750
- ve = { type: z };
751
- function be(e, t) {
752
- K(e), ze(t);
753
- let r = [];
754
- for (let n = 0; n < t.length; n++) n !== 0 && r.push(e), r.push(t[n]);
755
- return r;
756
- }
757
- function Je(e, t, r) {
758
- K(e);
759
- let n = e;
760
- if (t > 0) {
761
- for (let o = 0; o < Math.floor(t / r); ++o) n = De(n);
762
- (n = ae(t % r, n)), (n = ae(Number.NEGATIVE_INFINITY, n));
763
- }
764
- return n;
765
- }
766
- function br(e, t) {
767
- return K(t), e ? { type: N, label: e, contents: t } : t;
768
- }
769
- function ee(e) {
770
- var t;
771
- if (!e) return "";
772
- if (Array.isArray(e)) {
773
- let r = [];
774
- for (let n of e)
775
- if (Array.isArray(n)) r.push(...ee(n));
776
- else {
777
- let o = ee(n);
778
- o !== "" && r.push(o);
779
- }
780
- return r;
781
- }
782
- return e.type === _
783
- ? {
784
- ...e,
785
- breakContents: ee(e.breakContents),
786
- flatContents: ee(e.flatContents),
787
- }
788
- : e.type === x
789
- ? {
790
- ...e,
791
- contents: ee(e.contents),
792
- expandedStates: (t = e.expandedStates) == null ? void 0 : t.map(ee),
793
- }
794
- : e.type === S
795
- ? { type: "fill", parts: e.parts.map(ee) }
796
- : e.contents
797
- ? { ...e, contents: ee(e.contents) }
798
- : e;
799
- }
800
- function Or(e) {
801
- let t = Object.create(null),
802
- r = new Set();
803
- return n(ee(e));
804
- function n(u, i, s) {
805
- var a, D;
806
- if (typeof u == "string") return JSON.stringify(u);
807
- if (Array.isArray(u)) {
808
- let l = u.map(n).filter(Boolean);
809
- return l.length === 1 ? l[0] : `[${l.join(", ")}]`;
810
- }
811
- if (u.type === B) {
812
- let l =
813
- ((a = s == null ? void 0 : s[i + 1]) == null ? void 0 : a.type) === b;
814
- return u.literal
815
- ? l
816
- ? "literalline"
817
- : "literallineWithoutBreakParent"
818
- : u.hard
819
- ? l
820
- ? "hardline"
821
- : "hardlineWithoutBreakParent"
822
- : u.soft
823
- ? "softline"
824
- : "line";
825
- }
826
- if (u.type === b)
827
- return ((D = s == null ? void 0 : s[i - 1]) == null ? void 0 : D.type) ===
828
- B && s[i - 1].hard
829
- ? void 0
830
- : "breakParent";
831
- if (u.type === I) return "trim";
832
- if (u.type === L) return "indent(" + n(u.contents) + ")";
833
- if (u.type === P)
834
- return u.n === Number.NEGATIVE_INFINITY
835
- ? "dedentToRoot(" + n(u.contents) + ")"
836
- : u.n < 0
837
- ? "dedent(" + n(u.contents) + ")"
838
- : u.n.type === "root"
839
- ? "markAsRoot(" + n(u.contents) + ")"
840
- : "align(" + JSON.stringify(u.n) + ", " + n(u.contents) + ")";
841
- if (u.type === _)
842
- return (
843
- "ifBreak(" +
844
- n(u.breakContents) +
845
- (u.flatContents ? ", " + n(u.flatContents) : "") +
846
- (u.groupId
847
- ? (u.flatContents ? "" : ', ""') + `, { groupId: ${o(u.groupId)} }`
848
- : "") +
849
- ")"
850
- );
851
- if (u.type === R) {
852
- let l = [];
853
- u.negate && l.push("negate: true"),
854
- u.groupId && l.push(`groupId: ${o(u.groupId)}`);
855
- let d = l.length > 0 ? `, { ${l.join(", ")} }` : "";
856
- return `indentIfBreak(${n(u.contents)}${d})`;
857
- }
858
- if (u.type === x) {
859
- let l = [];
860
- u.break && u.break !== "propagated" && l.push("shouldBreak: true"),
861
- u.id && l.push(`id: ${o(u.id)}`);
862
- let d = l.length > 0 ? `, { ${l.join(", ")} }` : "";
863
- return u.expandedStates
864
- ? `conditionalGroup([${u.expandedStates.map((f) => n(f)).join(",")}]${d})`
865
- : `group(${n(u.contents)}${d})`;
866
- }
867
- if (u.type === S) return `fill([${u.parts.map((l) => n(l)).join(", ")}])`;
868
- if (u.type === Y) return "lineSuffix(" + n(u.contents) + ")";
869
- if (u.type === j) return "lineSuffixBoundary";
870
- if (u.type === N)
871
- return `label(${JSON.stringify(u.label)}, ${n(u.contents)})`;
872
- throw new Error("Unknown doc type " + u.type);
873
- }
874
- function o(u) {
875
- if (typeof u != "symbol") return JSON.stringify(String(u));
876
- if (u in t) return t[u];
877
- let i = u.description || "symbol";
878
- for (let s = 0; ; s++) {
879
- let a = i + (s > 0 ? ` #${s}` : "");
880
- if (!r.has(a))
881
- return r.add(a), (t[u] = `Symbol.for(${JSON.stringify(a)})`);
882
- }
883
- }
884
- }
885
- var Yu = (e, t, r) => {
886
- if (!(e && t == null))
887
- return Array.isArray(t) || typeof t == "string"
888
- ? t[r < 0 ? t.length + r : r]
889
- : t.at(r);
890
- },
891
- y = Yu;
892
- var Sr = () =>
893
- /[#*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](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\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(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\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](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\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-\uDDF5\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](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\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(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\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-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\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;
894
- function Nr(e) {
895
- return (
896
- e === 12288 || (e >= 65281 && e <= 65376) || (e >= 65504 && e <= 65510)
897
- );
898
- }
899
- function Tr(e) {
900
- return (
901
- (e >= 4352 && e <= 4447) ||
902
- e === 8986 ||
903
- e === 8987 ||
904
- e === 9001 ||
905
- e === 9002 ||
906
- (e >= 9193 && e <= 9196) ||
907
- e === 9200 ||
908
- e === 9203 ||
909
- e === 9725 ||
910
- e === 9726 ||
911
- e === 9748 ||
912
- e === 9749 ||
913
- (e >= 9800 && e <= 9811) ||
914
- e === 9855 ||
915
- e === 9875 ||
916
- e === 9889 ||
917
- e === 9898 ||
918
- e === 9899 ||
919
- e === 9917 ||
920
- e === 9918 ||
921
- e === 9924 ||
922
- e === 9925 ||
923
- e === 9934 ||
924
- e === 9940 ||
925
- e === 9962 ||
926
- e === 9970 ||
927
- e === 9971 ||
928
- e === 9973 ||
929
- e === 9978 ||
930
- e === 9981 ||
931
- e === 9989 ||
932
- e === 9994 ||
933
- e === 9995 ||
934
- e === 10024 ||
935
- e === 10060 ||
936
- e === 10062 ||
937
- (e >= 10067 && e <= 10069) ||
938
- e === 10071 ||
939
- (e >= 10133 && e <= 10135) ||
940
- e === 10160 ||
941
- e === 10175 ||
942
- e === 11035 ||
943
- e === 11036 ||
944
- e === 11088 ||
945
- e === 11093 ||
946
- (e >= 11904 && e <= 11929) ||
947
- (e >= 11931 && e <= 12019) ||
948
- (e >= 12032 && e <= 12245) ||
949
- (e >= 12272 && e <= 12287) ||
950
- (e >= 12289 && e <= 12350) ||
951
- (e >= 12353 && e <= 12438) ||
952
- (e >= 12441 && e <= 12543) ||
953
- (e >= 12549 && e <= 12591) ||
954
- (e >= 12593 && e <= 12686) ||
955
- (e >= 12688 && e <= 12771) ||
956
- (e >= 12783 && e <= 12830) ||
957
- (e >= 12832 && e <= 12871) ||
958
- (e >= 12880 && e <= 19903) ||
959
- (e >= 19968 && e <= 42124) ||
960
- (e >= 42128 && e <= 42182) ||
961
- (e >= 43360 && e <= 43388) ||
962
- (e >= 44032 && e <= 55203) ||
963
- (e >= 63744 && e <= 64255) ||
964
- (e >= 65040 && e <= 65049) ||
965
- (e >= 65072 && e <= 65106) ||
966
- (e >= 65108 && e <= 65126) ||
967
- (e >= 65128 && e <= 65131) ||
968
- (e >= 94176 && e <= 94180) ||
969
- e === 94192 ||
970
- e === 94193 ||
971
- (e >= 94208 && e <= 100343) ||
972
- (e >= 100352 && e <= 101589) ||
973
- (e >= 101632 && e <= 101640) ||
974
- (e >= 110576 && e <= 110579) ||
975
- (e >= 110581 && e <= 110587) ||
976
- e === 110589 ||
977
- e === 110590 ||
978
- (e >= 110592 && e <= 110882) ||
979
- e === 110898 ||
980
- (e >= 110928 && e <= 110930) ||
981
- e === 110933 ||
982
- (e >= 110948 && e <= 110951) ||
983
- (e >= 110960 && e <= 111355) ||
984
- e === 126980 ||
985
- e === 127183 ||
986
- e === 127374 ||
987
- (e >= 127377 && e <= 127386) ||
988
- (e >= 127488 && e <= 127490) ||
989
- (e >= 127504 && e <= 127547) ||
990
- (e >= 127552 && e <= 127560) ||
991
- e === 127568 ||
992
- e === 127569 ||
993
- (e >= 127584 && e <= 127589) ||
994
- (e >= 127744 && e <= 127776) ||
995
- (e >= 127789 && e <= 127797) ||
996
- (e >= 127799 && e <= 127868) ||
997
- (e >= 127870 && e <= 127891) ||
998
- (e >= 127904 && e <= 127946) ||
999
- (e >= 127951 && e <= 127955) ||
1000
- (e >= 127968 && e <= 127984) ||
1001
- e === 127988 ||
1002
- (e >= 127992 && e <= 128062) ||
1003
- e === 128064 ||
1004
- (e >= 128066 && e <= 128252) ||
1005
- (e >= 128255 && e <= 128317) ||
1006
- (e >= 128331 && e <= 128334) ||
1007
- (e >= 128336 && e <= 128359) ||
1008
- e === 128378 ||
1009
- e === 128405 ||
1010
- e === 128406 ||
1011
- e === 128420 ||
1012
- (e >= 128507 && e <= 128591) ||
1013
- (e >= 128640 && e <= 128709) ||
1014
- e === 128716 ||
1015
- (e >= 128720 && e <= 128722) ||
1016
- (e >= 128725 && e <= 128727) ||
1017
- (e >= 128732 && e <= 128735) ||
1018
- e === 128747 ||
1019
- e === 128748 ||
1020
- (e >= 128756 && e <= 128764) ||
1021
- (e >= 128992 && e <= 129003) ||
1022
- e === 129008 ||
1023
- (e >= 129292 && e <= 129338) ||
1024
- (e >= 129340 && e <= 129349) ||
1025
- (e >= 129351 && e <= 129535) ||
1026
- (e >= 129648 && e <= 129660) ||
1027
- (e >= 129664 && e <= 129672) ||
1028
- (e >= 129680 && e <= 129725) ||
1029
- (e >= 129727 && e <= 129733) ||
1030
- (e >= 129742 && e <= 129755) ||
1031
- (e >= 129760 && e <= 129768) ||
1032
- (e >= 129776 && e <= 129784) ||
1033
- (e >= 131072 && e <= 196605) ||
1034
- (e >= 196608 && e <= 262141)
1035
- );
1036
- }
1037
- var kr = (e) => !(Nr(e) || Tr(e));
1038
- var ju = /[^\x20-\x7F]/u;
1039
- function Hu(e) {
1040
- if (!e) return 0;
1041
- if (!ju.test(e)) return e.length;
1042
- e = e.replace(Sr(), " ");
1043
- let t = 0;
1044
- for (let r of e) {
1045
- let n = r.codePointAt(0);
1046
- n <= 31 ||
1047
- (n >= 127 && n <= 159) ||
1048
- (n >= 768 && n <= 879) ||
1049
- (t += kr(n) ? 1 : 2);
1050
- }
1051
- return t;
1052
- }
1053
- var Oe = Hu;
1054
- function Ne(e, t) {
1055
- if (typeof e == "string") return t(e);
1056
- let r = new Map();
1057
- return n(e);
1058
- function n(u) {
1059
- if (r.has(u)) return r.get(u);
1060
- let i = o(u);
1061
- return r.set(u, i), i;
1062
- }
1063
- function o(u) {
1064
- switch (G(u)) {
1065
- case W:
1066
- return t(u.map(n));
1067
- case S:
1068
- return t({ ...u, parts: u.parts.map(n) });
1069
- case _:
1070
- return t({
1071
- ...u,
1072
- breakContents: n(u.breakContents),
1073
- flatContents: n(u.flatContents),
1074
- });
1075
- case x: {
1076
- let { expandedStates: i, contents: s } = u;
1077
- return (
1078
- i ? ((i = i.map(n)), (s = i[0])) : (s = n(s)),
1079
- t({ ...u, contents: s, expandedStates: i })
1080
- );
1081
- }
1082
- case P:
1083
- case L:
1084
- case R:
1085
- case N:
1086
- case Y:
1087
- return t({ ...u, contents: n(u.contents) });
1088
- case U:
1089
- case z:
1090
- case I:
1091
- case j:
1092
- case B:
1093
- case b:
1094
- return t(u);
1095
- default:
1096
- throw new Q(u);
1097
- }
1098
- }
1099
- }
1100
- function Xe(e, t, r) {
1101
- let n = r,
1102
- o = !1;
1103
- function u(i) {
1104
- if (o) return !1;
1105
- let s = t(i);
1106
- s !== void 0 && ((o = !0), (n = s));
1107
- }
1108
- return we(e, u), n;
1109
- }
1110
- function Wu(e) {
1111
- if ((e.type === x && e.break) || (e.type === B && e.hard) || e.type === b)
1112
- return !0;
1113
- }
1114
- function Ir(e) {
1115
- return Xe(e, Wu, !1);
1116
- }
1117
- function Lr(e) {
1118
- if (e.length > 0) {
1119
- let t = y(!1, e, -1);
1120
- !t.expandedStates && !t.break && (t.break = "propagated");
1121
- }
1122
- return null;
1123
- }
1124
- function Rr(e) {
1125
- let t = new Set(),
1126
- r = [];
1127
- function n(u) {
1128
- if ((u.type === b && Lr(r), u.type === x)) {
1129
- if ((r.push(u), t.has(u))) return !1;
1130
- t.add(u);
1131
- }
1132
- }
1133
- function o(u) {
1134
- u.type === x && r.pop().break && Lr(r);
1135
- }
1136
- we(e, n, o, !0);
1137
- }
1138
- function Mu(e) {
1139
- return e.type === B && !e.hard
1140
- ? e.soft
1141
- ? ""
1142
- : " "
1143
- : e.type === _
1144
- ? e.flatContents
1145
- : e;
1146
- }
1147
- function Yr(e) {
1148
- return Ne(e, Mu);
1149
- }
1150
- function Pr(e) {
1151
- for (
1152
- e = [...e];
1153
- e.length >= 2 && y(!1, e, -2).type === B && y(!1, e, -1).type === b;
1154
-
1155
- )
1156
- e.length -= 2;
1157
- if (e.length > 0) {
1158
- let t = Se(y(!1, e, -1));
1159
- e[e.length - 1] = t;
1160
- }
1161
- return e;
1162
- }
1163
- function Se(e) {
1164
- switch (G(e)) {
1165
- case L:
1166
- case R:
1167
- case x:
1168
- case Y:
1169
- case N: {
1170
- let t = Se(e.contents);
1171
- return { ...e, contents: t };
1172
- }
1173
- case _:
1174
- return {
1175
- ...e,
1176
- breakContents: Se(e.breakContents),
1177
- flatContents: Se(e.flatContents),
1178
- };
1179
- case S:
1180
- return { ...e, parts: Pr(e.parts) };
1181
- case W:
1182
- return Pr(e);
1183
- case U:
1184
- return e.replace(/[\n\r]*$/u, "");
1185
- case P:
1186
- case z:
1187
- case I:
1188
- case j:
1189
- case B:
1190
- case b:
1191
- break;
1192
- default:
1193
- throw new Q(e);
1194
- }
1195
- return e;
1196
- }
1197
- function Ze(e) {
1198
- return Se(Vu(e));
1199
- }
1200
- function $u(e) {
1201
- switch (G(e)) {
1202
- case S:
1203
- if (e.parts.every((t) => t === "")) return "";
1204
- break;
1205
- case x:
1206
- if (!e.contents && !e.id && !e.break && !e.expandedStates) return "";
1207
- if (
1208
- e.contents.type === x &&
1209
- e.contents.id === e.id &&
1210
- e.contents.break === e.break &&
1211
- e.contents.expandedStates === e.expandedStates
1212
- )
1213
- return e.contents;
1214
- break;
1215
- case P:
1216
- case L:
1217
- case R:
1218
- case Y:
1219
- if (!e.contents) return "";
1220
- break;
1221
- case _:
1222
- if (!e.flatContents && !e.breakContents) return "";
1223
- break;
1224
- case W: {
1225
- let t = [];
1226
- for (let r of e) {
1227
- if (!r) continue;
1228
- let [n, ...o] = Array.isArray(r) ? r : [r];
1229
- typeof n == "string" && typeof y(!1, t, -1) == "string"
1230
- ? (t[t.length - 1] += n)
1231
- : t.push(n),
1232
- t.push(...o);
1233
- }
1234
- return t.length === 0 ? "" : t.length === 1 ? t[0] : t;
1235
- }
1236
- case U:
1237
- case z:
1238
- case I:
1239
- case j:
1240
- case B:
1241
- case N:
1242
- case b:
1243
- break;
1244
- default:
1245
- throw new Q(e);
1246
- }
1247
- return e;
1248
- }
1249
- function Vu(e) {
1250
- return Ne(e, (t) => $u(t));
1251
- }
1252
- function jr(e, t = qe) {
1253
- return Ne(e, (r) =>
1254
- typeof r == "string"
1255
- ? be(
1256
- t,
1257
- r.split(`
1258
- `),
1259
- )
1260
- : r,
1261
- );
1262
- }
1263
- function Uu(e) {
1264
- if (e.type === B) return !0;
1265
- }
1266
- function Hr(e) {
1267
- return Xe(e, Uu, !1);
1268
- }
1269
- function Qe(e, t) {
1270
- return e.type === N ? { ...e, contents: t(e.contents) } : t(e);
1271
- }
1272
- var H = Symbol("MODE_BREAK"),
1273
- J = Symbol("MODE_FLAT"),
1274
- Te = Symbol("cursor");
1275
- function Wr() {
1276
- return { value: "", length: 0, queue: [] };
1277
- }
1278
- function zu(e, t) {
1279
- return bt(e, { type: "indent" }, t);
1280
- }
1281
- function Gu(e, t, r) {
1282
- return t === Number.NEGATIVE_INFINITY
1283
- ? e.root || Wr()
1284
- : t < 0
1285
- ? bt(e, { type: "dedent" }, r)
1286
- : t
1287
- ? t.type === "root"
1288
- ? { ...e, root: e }
1289
- : bt(
1290
- e,
1291
- {
1292
- type: typeof t == "string" ? "stringAlign" : "numberAlign",
1293
- n: t,
1294
- },
1295
- r,
1296
- )
1297
- : e;
1298
- }
1299
- function bt(e, t, r) {
1300
- let n = t.type === "dedent" ? e.queue.slice(0, -1) : [...e.queue, t],
1301
- o = "",
1302
- u = 0,
1303
- i = 0,
1304
- s = 0;
1305
- for (let c of n)
1306
- switch (c.type) {
1307
- case "indent":
1308
- l(), r.useTabs ? a(1) : D(r.tabWidth);
1309
- break;
1310
- case "stringAlign":
1311
- l(), (o += c.n), (u += c.n.length);
1312
- break;
1313
- case "numberAlign":
1314
- (i += 1), (s += c.n);
1315
- break;
1316
- default:
1317
- throw new Error(`Unexpected type '${c.type}'`);
1318
- }
1319
- return f(), { ...e, value: o, length: u, queue: n };
1320
- function a(c) {
1321
- (o += " ".repeat(c)), (u += r.tabWidth * c);
1322
- }
1323
- function D(c) {
1324
- (o += " ".repeat(c)), (u += c);
1325
- }
1326
- function l() {
1327
- r.useTabs ? d() : f();
1328
- }
1329
- function d() {
1330
- i > 0 && a(i), p();
1331
- }
1332
- function f() {
1333
- s > 0 && D(s), p();
1334
- }
1335
- function p() {
1336
- (i = 0), (s = 0);
1337
- }
1338
- }
1339
- function Ot(e) {
1340
- let t = 0,
1341
- r = 0,
1342
- n = e.length;
1343
- e: for (; n--; ) {
1344
- let o = e[n];
1345
- if (o === Te) {
1346
- r++;
1347
- continue;
1348
- }
1349
- for (let u = o.length - 1; u >= 0; u--) {
1350
- let i = o[u];
1351
- if (i === " " || i === " ") t++;
1352
- else {
1353
- e[n] = o.slice(0, u + 1);
1354
- break e;
1355
- }
1356
- }
1357
- }
1358
- if (t > 0 || r > 0) for (e.length = n + 1; r-- > 0; ) e.push(Te);
1359
- return t;
1360
- }
1361
- function et(e, t, r, n, o, u) {
1362
- if (r === Number.POSITIVE_INFINITY) return !0;
1363
- let i = t.length,
1364
- s = [e],
1365
- a = [];
1366
- for (; r >= 0; ) {
1367
- if (s.length === 0) {
1368
- if (i === 0) return !0;
1369
- s.push(t[--i]);
1370
- continue;
1371
- }
1372
- let { mode: D, doc: l } = s.pop(),
1373
- d = G(l);
1374
- switch (d) {
1375
- case U:
1376
- a.push(l), (r -= Oe(l));
1377
- break;
1378
- case W:
1379
- case S: {
1380
- let f = d === W ? l : l.parts;
1381
- for (let p = f.length - 1; p >= 0; p--) s.push({ mode: D, doc: f[p] });
1382
- break;
1383
- }
1384
- case L:
1385
- case P:
1386
- case R:
1387
- case N:
1388
- s.push({ mode: D, doc: l.contents });
1389
- break;
1390
- case I:
1391
- r += Ot(a);
1392
- break;
1393
- case x: {
1394
- if (u && l.break) return !1;
1395
- let f = l.break ? H : D,
1396
- p =
1397
- l.expandedStates && f === H
1398
- ? y(!1, l.expandedStates, -1)
1399
- : l.contents;
1400
- s.push({ mode: f, doc: p });
1401
- break;
1402
- }
1403
- case _: {
1404
- let p =
1405
- (l.groupId ? o[l.groupId] || J : D) === H
1406
- ? l.breakContents
1407
- : l.flatContents;
1408
- p && s.push({ mode: D, doc: p });
1409
- break;
1410
- }
1411
- case B:
1412
- if (D === H || l.hard) return !0;
1413
- l.soft || (a.push(" "), r--);
1414
- break;
1415
- case Y:
1416
- n = !0;
1417
- break;
1418
- case j:
1419
- if (n) return !1;
1420
- break;
1421
- }
1422
- }
1423
- return !1;
1424
- }
1425
- function Fe(e, t) {
1426
- let r = {},
1427
- n = t.printWidth,
1428
- o = Be(t.endOfLine),
1429
- u = 0,
1430
- i = [{ ind: Wr(), mode: H, doc: e }],
1431
- s = [],
1432
- a = !1,
1433
- D = [],
1434
- l = 0;
1435
- for (Rr(e); i.length > 0; ) {
1436
- let { ind: f, mode: p, doc: c } = i.pop();
1437
- switch (G(c)) {
1438
- case U: {
1439
- let F =
1440
- o !==
1441
- `
1442
- `
1443
- ? ne(
1444
- !1,
1445
- c,
1446
- `
1447
- `,
1448
- o,
1449
- )
1450
- : c;
1451
- s.push(F), i.length > 0 && (u += Oe(F));
1452
- break;
1453
- }
1454
- case W:
1455
- for (let F = c.length - 1; F >= 0; F--)
1456
- i.push({ ind: f, mode: p, doc: c[F] });
1457
- break;
1458
- case z:
1459
- if (l >= 2) throw new Error("There are too many 'cursor' in doc.");
1460
- s.push(Te), l++;
1461
- break;
1462
- case L:
1463
- i.push({ ind: zu(f, t), mode: p, doc: c.contents });
1464
- break;
1465
- case P:
1466
- i.push({ ind: Gu(f, c.n, t), mode: p, doc: c.contents });
1467
- break;
1468
- case I:
1469
- u -= Ot(s);
1470
- break;
1471
- case x:
1472
- switch (p) {
1473
- case J:
1474
- if (!a) {
1475
- i.push({ ind: f, mode: c.break ? H : J, doc: c.contents });
1476
- break;
1477
- }
1478
- case H: {
1479
- a = !1;
1480
- let F = { ind: f, mode: J, doc: c.contents },
1481
- m = n - u,
1482
- E = D.length > 0;
1483
- if (!c.break && et(F, i, m, E, r)) i.push(F);
1484
- else if (c.expandedStates) {
1485
- let A = y(!1, c.expandedStates, -1);
1486
- if (c.break) {
1487
- i.push({ ind: f, mode: H, doc: A });
1488
- break;
1489
- } else
1490
- for (let w = 1; w < c.expandedStates.length + 1; w++)
1491
- if (w >= c.expandedStates.length) {
1492
- i.push({ ind: f, mode: H, doc: A });
1493
- break;
1494
- } else {
1495
- let h = c.expandedStates[w],
1496
- C = { ind: f, mode: J, doc: h };
1497
- if (et(C, i, m, E, r)) {
1498
- i.push(C);
1499
- break;
1500
- }
1501
- }
1502
- } else i.push({ ind: f, mode: H, doc: c.contents });
1503
- break;
1504
- }
1505
- }
1506
- c.id && (r[c.id] = y(!1, i, -1).mode);
1507
- break;
1508
- case S: {
1509
- let F = n - u,
1510
- { parts: m } = c;
1511
- if (m.length === 0) break;
1512
- let [E, A] = m,
1513
- w = { ind: f, mode: J, doc: E },
1514
- h = { ind: f, mode: H, doc: E },
1515
- C = et(w, [], F, D.length > 0, r, !0);
1516
- if (m.length === 1) {
1517
- C ? i.push(w) : i.push(h);
1518
- break;
1519
- }
1520
- let k = { ind: f, mode: J, doc: A },
1521
- v = { ind: f, mode: H, doc: A };
1522
- if (m.length === 2) {
1523
- C ? i.push(k, w) : i.push(v, h);
1524
- break;
1525
- }
1526
- m.splice(0, 2);
1527
- let $ = { ind: f, mode: p, doc: Ge(m) },
1528
- ye = m[0];
1529
- et({ ind: f, mode: J, doc: [E, A, ye] }, [], F, D.length > 0, r, !0)
1530
- ? i.push($, k, w)
1531
- : C
1532
- ? i.push($, v, w)
1533
- : i.push($, v, h);
1534
- break;
1535
- }
1536
- case _:
1537
- case R: {
1538
- let F = c.groupId ? r[c.groupId] : p;
1539
- if (F === H) {
1540
- let m =
1541
- c.type === _
1542
- ? c.breakContents
1543
- : c.negate
1544
- ? c.contents
1545
- : De(c.contents);
1546
- m && i.push({ ind: f, mode: p, doc: m });
1547
- }
1548
- if (F === J) {
1549
- let m =
1550
- c.type === _
1551
- ? c.flatContents
1552
- : c.negate
1553
- ? De(c.contents)
1554
- : c.contents;
1555
- m && i.push({ ind: f, mode: p, doc: m });
1556
- }
1557
- break;
1558
- }
1559
- case Y:
1560
- D.push({ ind: f, mode: p, doc: c.contents });
1561
- break;
1562
- case j:
1563
- D.length > 0 && i.push({ ind: f, mode: p, doc: _e });
1564
- break;
1565
- case B:
1566
- switch (p) {
1567
- case J:
1568
- if (c.hard) a = !0;
1569
- else {
1570
- c.soft || (s.push(" "), (u += 1));
1571
- break;
1572
- }
1573
- case H:
1574
- if (D.length > 0) {
1575
- i.push({ ind: f, mode: p, doc: c }, ...D.reverse()),
1576
- (D.length = 0);
1577
- break;
1578
- }
1579
- c.literal
1580
- ? f.root
1581
- ? (s.push(o, f.root.value), (u = f.root.length))
1582
- : (s.push(o), (u = 0))
1583
- : ((u -= Ot(s)), s.push(o + f.value), (u = f.length));
1584
- break;
1585
- }
1586
- break;
1587
- case N:
1588
- i.push({ ind: f, mode: p, doc: c.contents });
1589
- break;
1590
- case b:
1591
- break;
1592
- default:
1593
- throw new Q(c);
1594
- }
1595
- i.length === 0 && D.length > 0 && (i.push(...D.reverse()), (D.length = 0));
1596
- }
1597
- let d = s.indexOf(Te);
1598
- if (d !== -1) {
1599
- let f = s.indexOf(Te, d + 1),
1600
- p = s.slice(0, d).join(""),
1601
- c = s.slice(d + 1, f).join(""),
1602
- F = s.slice(f + 1).join("");
1603
- return {
1604
- formatted: p + c + F,
1605
- cursorNodeStart: p.length,
1606
- cursorNodeText: c,
1607
- };
1608
- }
1609
- return { formatted: s.join("") };
1610
- }
1611
- function Ku(e, t, r = 0) {
1612
- let n = 0;
1613
- for (let o = r; o < e.length; ++o) e[o] === " " ? (n = n + t - (n % t)) : n++;
1614
- return n;
1615
- }
1616
- var me = Ku;
1617
- var te,
1618
- Nt,
1619
- tt,
1620
- St = class {
1621
- constructor(t) {
1622
- Dr(this, te);
1623
- this.stack = [t];
1624
- }
1625
- get key() {
1626
- let { stack: t, siblings: r } = this;
1627
- return y(!1, t, r === null ? -2 : -4) ?? null;
1628
- }
1629
- get index() {
1630
- return this.siblings === null ? null : y(!1, this.stack, -2);
1631
- }
1632
- get node() {
1633
- return y(!1, this.stack, -1);
1634
- }
1635
- get parent() {
1636
- return this.getNode(1);
1637
- }
1638
- get grandparent() {
1639
- return this.getNode(2);
1640
- }
1641
- get isInArray() {
1642
- return this.siblings !== null;
1643
- }
1644
- get siblings() {
1645
- let { stack: t } = this,
1646
- r = y(!1, t, -3);
1647
- return Array.isArray(r) ? r : null;
1648
- }
1649
- get next() {
1650
- let { siblings: t } = this;
1651
- return t === null ? null : t[this.index + 1];
1652
- }
1653
- get previous() {
1654
- let { siblings: t } = this;
1655
- return t === null ? null : t[this.index - 1];
1656
- }
1657
- get isFirst() {
1658
- return this.index === 0;
1659
- }
1660
- get isLast() {
1661
- let { siblings: t, index: r } = this;
1662
- return t !== null && r === t.length - 1;
1663
- }
1664
- get isRoot() {
1665
- return this.stack.length === 1;
1666
- }
1667
- get root() {
1668
- return this.stack[0];
1669
- }
1670
- get ancestors() {
1671
- return [...pe(this, te, tt).call(this)];
1672
- }
1673
- getName() {
1674
- let { stack: t } = this,
1675
- { length: r } = t;
1676
- return r > 1 ? y(!1, t, -2) : null;
1677
- }
1678
- getValue() {
1679
- return y(!1, this.stack, -1);
1680
- }
1681
- getNode(t = 0) {
1682
- let r = pe(this, te, Nt).call(this, t);
1683
- return r === -1 ? null : this.stack[r];
1684
- }
1685
- getParentNode(t = 0) {
1686
- return this.getNode(t + 1);
1687
- }
1688
- call(t, ...r) {
1689
- let { stack: n } = this,
1690
- { length: o } = n,
1691
- u = y(!1, n, -1);
1692
- for (let i of r) (u = u[i]), n.push(i, u);
1693
- try {
1694
- return t(this);
1695
- } finally {
1696
- n.length = o;
1697
- }
1698
- }
1699
- callParent(t, r = 0) {
1700
- let n = pe(this, te, Nt).call(this, r + 1),
1701
- o = this.stack.splice(n + 1);
1702
- try {
1703
- return t(this);
1704
- } finally {
1705
- this.stack.push(...o);
1706
- }
1707
- }
1708
- each(t, ...r) {
1709
- let { stack: n } = this,
1710
- { length: o } = n,
1711
- u = y(!1, n, -1);
1712
- for (let i of r) (u = u[i]), n.push(i, u);
1713
- try {
1714
- for (let i = 0; i < u.length; ++i)
1715
- n.push(i, u[i]), t(this, i, u), (n.length -= 2);
1716
- } finally {
1717
- n.length = o;
1718
- }
1719
- }
1720
- map(t, ...r) {
1721
- let n = [];
1722
- return (
1723
- this.each(
1724
- (o, u, i) => {
1725
- n[u] = t(o, u, i);
1726
- },
1727
- ...r,
1728
- ),
1729
- n
1730
- );
1731
- }
1732
- match(...t) {
1733
- let r = this.stack.length - 1,
1734
- n = null,
1735
- o = this.stack[r--];
1736
- for (let u of t) {
1737
- if (o === void 0) return !1;
1738
- let i = null;
1739
- if (
1740
- (typeof n == "number" &&
1741
- ((i = n), (n = this.stack[r--]), (o = this.stack[r--])),
1742
- u && !u(o, n, i))
1743
- )
1744
- return !1;
1745
- (n = this.stack[r--]), (o = this.stack[r--]);
1746
- }
1747
- return !0;
1748
- }
1749
- findAncestor(t) {
1750
- for (let r of pe(this, te, tt).call(this)) if (t(r)) return r;
1751
- }
1752
- hasAncestor(t) {
1753
- for (let r of pe(this, te, tt).call(this)) if (t(r)) return !0;
1754
- return !1;
1755
- }
1756
- };
1757
- (te = new WeakSet()),
1758
- (Nt = function (t) {
1759
- let { stack: r } = this;
1760
- for (let n = r.length - 1; n >= 0; n -= 2)
1761
- if (!Array.isArray(r[n]) && --t < 0) return n;
1762
- return -1;
1763
- }),
1764
- (tt = function* () {
1765
- let { stack: t } = this;
1766
- for (let r = t.length - 3; r >= 0; r -= 2) {
1767
- let n = t[r];
1768
- Array.isArray(n) || (yield n);
1769
- }
1770
- });
1771
- var Mr = St;
1772
- var $r = new Proxy(() => {}, { get: () => $r }),
1773
- ke = $r;
1774
- function qu(e) {
1775
- return e !== null && typeof e == "object";
1776
- }
1777
- var Vr = qu;
1778
- function* Tt(e, t) {
1779
- let { getVisitorKeys: r, filter: n = () => !0 } = t,
1780
- o = (u) => Vr(u) && n(u);
1781
- for (let u of r(e)) {
1782
- let i = e[u];
1783
- if (Array.isArray(i)) for (let s of i) o(s) && (yield s);
1784
- else o(i) && (yield i);
1785
- }
1786
- }
1787
- function* Ur(e, t) {
1788
- let r = [e];
1789
- for (let n = 0; n < r.length; n++) {
1790
- let o = r[n];
1791
- for (let u of Tt(o, t)) yield u, r.push(u);
1792
- }
1793
- }
1794
- function Ee(e) {
1795
- return (t, r, n) => {
1796
- let o = !!(n != null && n.backwards);
1797
- if (r === !1) return !1;
1798
- let { length: u } = t,
1799
- i = r;
1800
- for (; i >= 0 && i < u; ) {
1801
- let s = t.charAt(i);
1802
- if (e instanceof RegExp) {
1803
- if (!e.test(s)) return i;
1804
- } else if (!e.includes(s)) return i;
1805
- o ? i-- : i++;
1806
- }
1807
- return i === -1 || i === u ? i : !1;
1808
- };
1809
- }
1810
- var zr = Ee(/\s/u),
1811
- T = Ee(" "),
1812
- rt = Ee(",; "),
1813
- nt = Ee(/[^\n\r]/u);
1814
- function Ju(e, t, r) {
1815
- let n = !!(r != null && r.backwards);
1816
- if (t === !1) return !1;
1817
- let o = e.charAt(t);
1818
- if (n) {
1819
- if (
1820
- e.charAt(t - 1) === "\r" &&
1821
- o ===
1822
- `
1823
- `
1824
- )
1825
- return t - 2;
1826
- if (
1827
- o ===
1828
- `
1829
- ` ||
1830
- o === "\r" ||
1831
- o === "\u2028" ||
1832
- o === "\u2029"
1833
- )
1834
- return t - 1;
1835
- } else {
1836
- if (
1837
- o === "\r" &&
1838
- e.charAt(t + 1) ===
1839
- `
1840
- `
1841
- )
1842
- return t + 2;
1843
- if (
1844
- o ===
1845
- `
1846
- ` ||
1847
- o === "\r" ||
1848
- o === "\u2028" ||
1849
- o === "\u2029"
1850
- )
1851
- return t + 1;
1852
- }
1853
- return t;
1854
- }
1855
- var M = Ju;
1856
- function Xu(e, t, r = {}) {
1857
- let n = T(e, r.backwards ? t - 1 : t, r),
1858
- o = M(e, n, r);
1859
- return n !== o;
1860
- }
1861
- var V = Xu;
1862
- function Zu(e) {
1863
- return Array.isArray(e) && e.length > 0;
1864
- }
1865
- var kt = Zu;
1866
- var Gr = new Set([
1867
- "tokens",
1868
- "comments",
1869
- "parent",
1870
- "enclosingNode",
1871
- "precedingNode",
1872
- "followingNode",
1873
- ]),
1874
- Qu = (e) => Object.keys(e).filter((t) => !Gr.has(t));
1875
- function eo(e) {
1876
- return e ? (t) => e(t, Gr) : Qu;
1877
- }
1878
- var X = eo;
1879
- function to(e) {
1880
- let t = e.type || e.kind || "(unknown type)",
1881
- r = String(
1882
- e.name ||
1883
- (e.id && (typeof e.id == "object" ? e.id.name : e.id)) ||
1884
- (e.key && (typeof e.key == "object" ? e.key.name : e.key)) ||
1885
- (e.value && (typeof e.value == "object" ? "" : String(e.value))) ||
1886
- e.operator ||
1887
- "",
1888
- );
1889
- return (
1890
- r.length > 20 && (r = r.slice(0, 19) + "\u2026"), t + (r ? " " + r : "")
1891
- );
1892
- }
1893
- function Lt(e, t) {
1894
- (e.comments ?? (e.comments = [])).push(t),
1895
- (t.printed = !1),
1896
- (t.nodeDescription = to(e));
1897
- }
1898
- function ue(e, t) {
1899
- (t.leading = !0), (t.trailing = !1), Lt(e, t);
1900
- }
1901
- function re(e, t, r) {
1902
- (t.leading = !1), (t.trailing = !1), r && (t.marker = r), Lt(e, t);
1903
- }
1904
- function oe(e, t) {
1905
- (t.leading = !1), (t.trailing = !0), Lt(e, t);
1906
- }
1907
- var Pt = new WeakMap();
1908
- function ut(e, t) {
1909
- if (Pt.has(e)) return Pt.get(e);
1910
- let {
1911
- printer: {
1912
- getCommentChildNodes: r,
1913
- canAttachComment: n,
1914
- getVisitorKeys: o,
1915
- },
1916
- locStart: u,
1917
- locEnd: i,
1918
- } = t;
1919
- if (!n) return [];
1920
- let s = (
1921
- (r == null ? void 0 : r(e, t)) ?? [...Tt(e, { getVisitorKeys: X(o) })]
1922
- ).flatMap((a) => (n(a) ? [a] : ut(a, t)));
1923
- return s.sort((a, D) => u(a) - u(D) || i(a) - i(D)), Pt.set(e, s), s;
1924
- }
1925
- function qr(e, t, r, n) {
1926
- let { locStart: o, locEnd: u } = r,
1927
- i = o(t),
1928
- s = u(t),
1929
- a = ut(e, r),
1930
- D,
1931
- l,
1932
- d = 0,
1933
- f = a.length;
1934
- for (; d < f; ) {
1935
- let p = (d + f) >> 1,
1936
- c = a[p],
1937
- F = o(c),
1938
- m = u(c);
1939
- if (F <= i && s <= m) return qr(c, t, r, c);
1940
- if (m <= i) {
1941
- (D = c), (d = p + 1);
1942
- continue;
1943
- }
1944
- if (s <= F) {
1945
- (l = c), (f = p);
1946
- continue;
1947
- }
1948
- throw new Error("Comment location overlaps with node location");
1949
- }
1950
- if ((n == null ? void 0 : n.type) === "TemplateLiteral") {
1951
- let { quasis: p } = n,
1952
- c = Rt(p, t, r);
1953
- D && Rt(p, D, r) !== c && (D = null), l && Rt(p, l, r) !== c && (l = null);
1954
- }
1955
- return { enclosingNode: n, precedingNode: D, followingNode: l };
1956
- }
1957
- var It = () => !1;
1958
- function Jr(e, t) {
1959
- let { comments: r } = e;
1960
- if ((delete e.comments, !kt(r) || !t.printer.canAttachComment)) return;
1961
- let n = [],
1962
- {
1963
- locStart: o,
1964
- locEnd: u,
1965
- printer: {
1966
- experimentalFeatures: { avoidAstMutation: i = !1 } = {},
1967
- handleComments: s = {},
1968
- },
1969
- originalText: a,
1970
- } = t,
1971
- { ownLine: D = It, endOfLine: l = It, remaining: d = It } = s,
1972
- f = r.map((p, c) => ({
1973
- ...qr(e, p, t),
1974
- comment: p,
1975
- text: a,
1976
- options: t,
1977
- ast: e,
1978
- isLastComment: r.length - 1 === c,
1979
- }));
1980
- for (let [p, c] of f.entries()) {
1981
- let {
1982
- comment: F,
1983
- precedingNode: m,
1984
- enclosingNode: E,
1985
- followingNode: A,
1986
- text: w,
1987
- options: h,
1988
- ast: C,
1989
- isLastComment: k,
1990
- } = c;
1991
- if (
1992
- h.parser === "json" ||
1993
- h.parser === "json5" ||
1994
- h.parser === "jsonc" ||
1995
- h.parser === "__js_expression" ||
1996
- h.parser === "__ts_expression" ||
1997
- h.parser === "__vue_expression" ||
1998
- h.parser === "__vue_ts_expression"
1999
- ) {
2000
- if (o(F) - o(C) <= 0) {
2001
- ue(C, F);
2002
- continue;
2003
- }
2004
- if (u(F) - u(C) >= 0) {
2005
- oe(C, F);
2006
- continue;
2007
- }
2008
- }
2009
- let v;
2010
- if (
2011
- (i
2012
- ? (v = [c])
2013
- : ((F.enclosingNode = E),
2014
- (F.precedingNode = m),
2015
- (F.followingNode = A),
2016
- (v = [F, w, h, C, k])),
2017
- ro(w, h, f, p))
2018
- )
2019
- (F.placement = "ownLine"),
2020
- D(...v) || (A ? ue(A, F) : m ? oe(m, F) : E ? re(E, F) : re(C, F));
2021
- else if (no(w, h, f, p))
2022
- (F.placement = "endOfLine"),
2023
- l(...v) || (m ? oe(m, F) : A ? ue(A, F) : E ? re(E, F) : re(C, F));
2024
- else if (((F.placement = "remaining"), !d(...v)))
2025
- if (m && A) {
2026
- let $ = n.length;
2027
- $ > 0 && n[$ - 1].followingNode !== A && Kr(n, h), n.push(c);
2028
- } else m ? oe(m, F) : A ? ue(A, F) : E ? re(E, F) : re(C, F);
2029
- }
2030
- if ((Kr(n, t), !i))
2031
- for (let p of r)
2032
- delete p.precedingNode, delete p.enclosingNode, delete p.followingNode;
2033
- }
2034
- var Xr = (e) => !/[\S\n\u2028\u2029]/u.test(e);
2035
- function ro(e, t, r, n) {
2036
- let { comment: o, precedingNode: u } = r[n],
2037
- { locStart: i, locEnd: s } = t,
2038
- a = i(o);
2039
- if (u)
2040
- for (let D = n - 1; D >= 0; D--) {
2041
- let { comment: l, precedingNode: d } = r[D];
2042
- if (d !== u || !Xr(e.slice(s(l), a))) break;
2043
- a = i(l);
2044
- }
2045
- return V(e, a, { backwards: !0 });
2046
- }
2047
- function no(e, t, r, n) {
2048
- let { comment: o, followingNode: u } = r[n],
2049
- { locStart: i, locEnd: s } = t,
2050
- a = s(o);
2051
- if (u)
2052
- for (let D = n + 1; D < r.length; D++) {
2053
- let { comment: l, followingNode: d } = r[D];
2054
- if (d !== u || !Xr(e.slice(a, i(l)))) break;
2055
- a = s(l);
2056
- }
2057
- return V(e, a);
2058
- }
2059
- function Kr(e, t) {
2060
- var s, a;
2061
- let r = e.length;
2062
- if (r === 0) return;
2063
- let { precedingNode: n, followingNode: o } = e[0],
2064
- u = t.locStart(o),
2065
- i;
2066
- for (i = r; i > 0; --i) {
2067
- let { comment: D, precedingNode: l, followingNode: d } = e[i - 1];
2068
- ke.strictEqual(l, n), ke.strictEqual(d, o);
2069
- let f = t.originalText.slice(t.locEnd(D), u);
2070
- if (
2071
- ((a = (s = t.printer).isGap) == null ? void 0 : a.call(s, f, t)) ??
2072
- /^[\s(]*$/u.test(f)
2073
- )
2074
- u = t.locStart(D);
2075
- else break;
2076
- }
2077
- for (let [D, { comment: l }] of e.entries()) D < i ? oe(n, l) : ue(o, l);
2078
- for (let D of [n, o])
2079
- D.comments &&
2080
- D.comments.length > 1 &&
2081
- D.comments.sort((l, d) => t.locStart(l) - t.locStart(d));
2082
- e.length = 0;
2083
- }
2084
- function Rt(e, t, r) {
2085
- let n = r.locStart(t) - 1;
2086
- for (let o = 1; o < e.length; ++o) if (n < r.locStart(e[o])) return o - 1;
2087
- return 0;
2088
- }
2089
- function uo(e, t) {
2090
- let r = t - 1;
2091
- (r = T(e, r, { backwards: !0 })),
2092
- (r = M(e, r, { backwards: !0 })),
2093
- (r = T(e, r, { backwards: !0 }));
2094
- let n = M(e, r, { backwards: !0 });
2095
- return r !== n;
2096
- }
2097
- var Le = uo;
2098
- function Zr(e, t) {
2099
- let r = e.node;
2100
- return (r.printed = !0), t.printer.printComment(e, t);
2101
- }
2102
- function oo(e, t) {
2103
- var l;
2104
- let r = e.node,
2105
- n = [Zr(e, t)],
2106
- { printer: o, originalText: u, locStart: i, locEnd: s } = t;
2107
- if ((l = o.isBlockComment) == null ? void 0 : l.call(o, r)) {
2108
- let d = V(u, s(r)) ? (V(u, i(r), { backwards: !0 }) ? q : Ke) : " ";
2109
- n.push(d);
2110
- } else n.push(q);
2111
- let D = M(u, T(u, s(r)));
2112
- return D !== !1 && V(u, D) && n.push(q), n;
2113
- }
2114
- function io(e, t, r) {
2115
- var D;
2116
- let n = e.node,
2117
- o = Zr(e, t),
2118
- { printer: u, originalText: i, locStart: s } = t,
2119
- a = (D = u.isBlockComment) == null ? void 0 : D.call(u, n);
2120
- if (
2121
- (r != null && r.hasLineSuffix && !(r != null && r.isBlock)) ||
2122
- V(i, s(n), { backwards: !0 })
2123
- ) {
2124
- let l = Le(i, s(n));
2125
- return { doc: xe([q, l ? q : "", o]), isBlock: a, hasLineSuffix: !0 };
2126
- }
2127
- return !a || (r != null && r.hasLineSuffix)
2128
- ? { doc: [xe([" ", o]), de], isBlock: a, hasLineSuffix: !0 }
2129
- : { doc: [" ", o], isBlock: a, hasLineSuffix: !1 };
2130
- }
2131
- function so(e, t) {
2132
- let r = e.node;
2133
- if (!r) return {};
2134
- let n = t[Symbol.for("printedComments")];
2135
- if ((r.comments || []).filter((a) => !n.has(a)).length === 0)
2136
- return { leading: "", trailing: "" };
2137
- let u = [],
2138
- i = [],
2139
- s;
2140
- return (
2141
- e.each(() => {
2142
- let a = e.node;
2143
- if (n != null && n.has(a)) return;
2144
- let { leading: D, trailing: l } = a;
2145
- D ? u.push(oo(e, t)) : l && ((s = io(e, t, s)), i.push(s.doc));
2146
- }, "comments"),
2147
- { leading: u, trailing: i }
2148
- );
2149
- }
2150
- function Qr(e, t, r) {
2151
- let { leading: n, trailing: o } = so(e, r);
2152
- return !n && !o ? t : Qe(t, (u) => [n, u, o]);
2153
- }
2154
- function en(e) {
2155
- let { [Symbol.for("comments")]: t, [Symbol.for("printedComments")]: r } = e;
2156
- for (let n of t) {
2157
- if (!n.printed && !r.has(n))
2158
- throw new Error(
2159
- 'Comment "' +
2160
- n.value.trim() +
2161
- '" was not printed. Please report this error!',
2162
- );
2163
- delete n.printed;
2164
- }
2165
- }
2166
- function ao(e) {
2167
- return () => {};
2168
- }
2169
- var tn = ao;
2170
- var Pe = class extends Error {
2171
- name = "ConfigError";
2172
- },
2173
- Ie = class extends Error {
2174
- name = "UndefinedParserError";
2175
- };
2176
- var rn = {
2177
- cursorOffset: {
2178
- category: "Special",
2179
- type: "int",
2180
- default: -1,
2181
- range: { start: -1, end: 1 / 0, step: 1 },
2182
- description:
2183
- "Print (to stderr) where a cursor at the given position would move to after formatting.",
2184
- cliCategory: "Editor",
2185
- },
2186
- endOfLine: {
2187
- category: "Global",
2188
- type: "choice",
2189
- default: "lf",
2190
- description: "Which end of line characters to apply.",
2191
- choices: [
2192
- {
2193
- value: "lf",
2194
- description:
2195
- "Line Feed only (\\n), common on Linux and macOS as well as inside git repos",
2196
- },
2197
- {
2198
- value: "crlf",
2199
- description:
2200
- "Carriage Return + Line Feed characters (\\r\\n), common on Windows",
2201
- },
2202
- {
2203
- value: "cr",
2204
- description: "Carriage Return character only (\\r), used very rarely",
2205
- },
2206
- {
2207
- value: "auto",
2208
- description: `Maintain existing
2209
- (mixed values within one file are normalised by looking at what's used after the first line)`,
2210
- },
2211
- ],
2212
- },
2213
- filepath: {
2214
- category: "Special",
2215
- type: "path",
2216
- description:
2217
- "Specify the input filepath. This will be used to do parser inference.",
2218
- cliName: "stdin-filepath",
2219
- cliCategory: "Other",
2220
- cliDescription: "Path to the file to pretend that stdin comes from.",
2221
- },
2222
- insertPragma: {
2223
- category: "Special",
2224
- type: "boolean",
2225
- default: !1,
2226
- description: "Insert @format pragma into file's first docblock comment.",
2227
- cliCategory: "Other",
2228
- },
2229
- parser: {
2230
- category: "Global",
2231
- type: "choice",
2232
- default: void 0,
2233
- description: "Which parser to use.",
2234
- exception: (e) => typeof e == "string" || typeof e == "function",
2235
- choices: [
2236
- { value: "flow", description: "Flow" },
2237
- { value: "babel", description: "JavaScript" },
2238
- { value: "babel-flow", description: "Flow" },
2239
- { value: "babel-ts", description: "TypeScript" },
2240
- { value: "typescript", description: "TypeScript" },
2241
- { value: "acorn", description: "JavaScript" },
2242
- { value: "espree", description: "JavaScript" },
2243
- { value: "meriyah", description: "JavaScript" },
2244
- { value: "css", description: "CSS" },
2245
- { value: "less", description: "Less" },
2246
- { value: "scss", description: "SCSS" },
2247
- { value: "json", description: "JSON" },
2248
- { value: "json5", description: "JSON5" },
2249
- { value: "jsonc", description: "JSON with Comments" },
2250
- { value: "json-stringify", description: "JSON.stringify" },
2251
- { value: "graphql", description: "GraphQL" },
2252
- { value: "markdown", description: "Markdown" },
2253
- { value: "mdx", description: "MDX" },
2254
- { value: "vue", description: "Vue" },
2255
- { value: "yaml", description: "YAML" },
2256
- { value: "glimmer", description: "Ember / Handlebars" },
2257
- { value: "html", description: "HTML" },
2258
- { value: "angular", description: "Angular" },
2259
- { value: "lwc", description: "Lightning Web Components" },
2260
- ],
2261
- },
2262
- plugins: {
2263
- type: "path",
2264
- array: !0,
2265
- default: [{ value: [] }],
2266
- category: "Global",
2267
- description:
2268
- "Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",
2269
- exception: (e) => typeof e == "string" || typeof e == "object",
2270
- cliName: "plugin",
2271
- cliCategory: "Config",
2272
- },
2273
- printWidth: {
2274
- category: "Global",
2275
- type: "int",
2276
- default: 80,
2277
- description: "The line length where Prettier will try wrap.",
2278
- range: { start: 0, end: 1 / 0, step: 1 },
2279
- },
2280
- rangeEnd: {
2281
- category: "Special",
2282
- type: "int",
2283
- default: 1 / 0,
2284
- range: { start: 0, end: 1 / 0, step: 1 },
2285
- description: `Format code ending at a given character offset (exclusive).
2286
- The range will extend forwards to the end of the selected statement.`,
2287
- cliCategory: "Editor",
2288
- },
2289
- rangeStart: {
2290
- category: "Special",
2291
- type: "int",
2292
- default: 0,
2293
- range: { start: 0, end: 1 / 0, step: 1 },
2294
- description: `Format code starting at a given character offset.
2295
- The range will extend backwards to the start of the first line containing the selected statement.`,
2296
- cliCategory: "Editor",
2297
- },
2298
- requirePragma: {
2299
- category: "Special",
2300
- type: "boolean",
2301
- default: !1,
2302
- description: `Require either '@prettier' or '@format' to be present in the file's first docblock comment
2303
- in order for it to be formatted.`,
2304
- cliCategory: "Other",
2305
- },
2306
- tabWidth: {
2307
- type: "int",
2308
- category: "Global",
2309
- default: 2,
2310
- description: "Number of spaces per indentation level.",
2311
- range: { start: 0, end: 1 / 0, step: 1 },
2312
- },
2313
- useTabs: {
2314
- category: "Global",
2315
- type: "boolean",
2316
- default: !1,
2317
- description: "Indent with tabs instead of spaces.",
2318
- },
2319
- embeddedLanguageFormatting: {
2320
- category: "Global",
2321
- type: "choice",
2322
- default: "auto",
2323
- description:
2324
- "Control how Prettier formats quoted code embedded in the file.",
2325
- choices: [
2326
- {
2327
- value: "auto",
2328
- description:
2329
- "Format embedded code if Prettier can automatically identify it.",
2330
- },
2331
- {
2332
- value: "off",
2333
- description: "Never automatically format embedded code.",
2334
- },
2335
- ],
2336
- },
2337
- };
2338
- function ot({ plugins: e = [], showDeprecated: t = !1 } = {}) {
2339
- let r = e.flatMap((o) => o.languages ?? []),
2340
- n = [];
2341
- for (let o of lo(Object.assign({}, ...e.map(({ options: u }) => u), rn)))
2342
- (!t && o.deprecated) ||
2343
- (Array.isArray(o.choices) &&
2344
- (t || (o.choices = o.choices.filter((u) => !u.deprecated)),
2345
- o.name === "parser" &&
2346
- (o.choices = [...o.choices, ...Do(o.choices, r, e)])),
2347
- (o.pluginDefaults = Object.fromEntries(
2348
- e
2349
- .filter((u) => {
2350
- var i;
2351
- return (
2352
- ((i = u.defaultOptions) == null ? void 0 : i[o.name]) !== void 0
2353
- );
2354
- })
2355
- .map((u) => [u.name, u.defaultOptions[o.name]]),
2356
- )),
2357
- n.push(o));
2358
- return { languages: r, options: n };
2359
- }
2360
- function* Do(e, t, r) {
2361
- let n = new Set(e.map((o) => o.value));
2362
- for (let o of t)
2363
- if (o.parsers) {
2364
- for (let u of o.parsers)
2365
- if (!n.has(u)) {
2366
- n.add(u);
2367
- let i = r.find(
2368
- (a) =>
2369
- a.parsers && Object.prototype.hasOwnProperty.call(a.parsers, u),
2370
- ),
2371
- s = o.name;
2372
- i != null && i.name && (s += ` (plugin: ${i.name})`),
2373
- yield { value: u, description: s };
2374
- }
2375
- }
2376
- }
2377
- function lo(e) {
2378
- let t = [];
2379
- for (let [r, n] of Object.entries(e)) {
2380
- let o = { name: r, ...n };
2381
- Array.isArray(o.default) && (o.default = y(!1, o.default, -1).value),
2382
- t.push(o);
2383
- }
2384
- return t;
2385
- }
2386
- var co = (e) => String(e).split(/[/\\]/u).pop();
2387
- function nn(e, t) {
2388
- if (!t) return;
2389
- let r = co(t).toLowerCase();
2390
- return (
2391
- e.find(({ filenames: n }) =>
2392
- n == null ? void 0 : n.some((o) => o.toLowerCase() === r),
2393
- ) ??
2394
- e.find(({ extensions: n }) =>
2395
- n == null ? void 0 : n.some((o) => r.endsWith(o)),
2396
- )
2397
- );
2398
- }
2399
- function fo(e, t) {
2400
- if (t)
2401
- return (
2402
- e.find(({ name: r }) => r.toLowerCase() === t) ??
2403
- e.find(({ aliases: r }) => (r == null ? void 0 : r.includes(t))) ??
2404
- e.find(({ extensions: r }) => (r == null ? void 0 : r.includes(`.${t}`)))
2405
- );
2406
- }
2407
- function po(e, t) {
2408
- let r = e.plugins.flatMap((o) => o.languages ?? []),
2409
- n =
2410
- fo(r, t.language) ??
2411
- nn(r, t.physicalFile) ??
2412
- nn(r, t.file) ??
2413
- (t.physicalFile, void 0);
2414
- return n == null ? void 0 : n.parsers[0];
2415
- }
2416
- var un = po;
2417
- var ie = {
2418
- key: (e) => (/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e) ? e : JSON.stringify(e)),
2419
- value(e) {
2420
- if (e === null || typeof e != "object") return JSON.stringify(e);
2421
- if (Array.isArray(e)) return `[${e.map((r) => ie.value(r)).join(", ")}]`;
2422
- let t = Object.keys(e);
2423
- return t.length === 0
2424
- ? "{}"
2425
- : `{ ${t.map((r) => `${ie.key(r)}: ${ie.value(e[r])}`).join(", ")} }`;
2426
- },
2427
- pair: ({ key: e, value: t }) => ie.value({ [e]: t }),
2428
- };
2429
- var Yt = Me(it(), 1),
2430
- an = (e, t, { descriptor: r }) => {
2431
- let n = [
2432
- `${Yt.default.yellow(typeof e == "string" ? r.key(e) : r.pair(e))} is deprecated`,
2433
- ];
2434
- return (
2435
- t &&
2436
- n.push(
2437
- `we now treat it as ${Yt.default.blue(typeof t == "string" ? r.key(t) : r.pair(t))}`,
2438
- ),
2439
- n.join("; ") + "."
2440
- );
2441
- };
2442
- var le = Me(it(), 1);
2443
- var st = Symbol.for("vnopts.VALUE_NOT_EXIST"),
2444
- he = Symbol.for("vnopts.VALUE_UNCHANGED");
2445
- var Dn = " ".repeat(2),
2446
- cn = (e, t, r) => {
2447
- let { text: n, list: o } = r.normalizeExpectedResult(
2448
- r.schemas[e].expected(r),
2449
- ),
2450
- u = [];
2451
- return (
2452
- n && u.push(ln(e, t, n, r.descriptor)),
2453
- o &&
2454
- u.push(
2455
- [ln(e, t, o.title, r.descriptor)].concat(
2456
- o.values.map((i) => fn(i, r.loggerPrintWidth)),
2457
- ).join(`
2458
- `),
2459
- ),
2460
- pn(u, r.loggerPrintWidth)
2461
- );
2462
- };
2463
- function ln(e, t, r, n) {
2464
- return [
2465
- `Invalid ${le.default.red(n.key(e))} value.`,
2466
- `Expected ${le.default.blue(r)},`,
2467
- `but received ${t === st ? le.default.gray("nothing") : le.default.red(n.value(t))}.`,
2468
- ].join(" ");
2469
- }
2470
- function fn({ text: e, list: t }, r) {
2471
- let n = [];
2472
- return (
2473
- e && n.push(`- ${le.default.blue(e)}`),
2474
- t &&
2475
- n.push(
2476
- [`- ${le.default.blue(t.title)}:`].concat(
2477
- t.values.map((o) => fn(o, r - Dn.length).replace(/^|\n/g, `$&${Dn}`)),
2478
- ).join(`
2479
- `),
2480
- ),
2481
- pn(n, r)
2482
- );
2483
- }
2484
- function pn(e, t) {
2485
- if (e.length === 1) return e[0];
2486
- let [r, n] = e,
2487
- [o, u] = e.map(
2488
- (i) =>
2489
- i.split(
2490
- `
2491
- `,
2492
- 1,
2493
- )[0].length,
2494
- );
2495
- return o > t && o > u ? n : r;
2496
- }
2497
- var Wt = Me(it(), 1);
2498
- var jt = [],
2499
- dn = [];
2500
- function Ht(e, t) {
2501
- if (e === t) return 0;
2502
- let r = e;
2503
- e.length > t.length && ((e = t), (t = r));
2504
- let n = e.length,
2505
- o = t.length;
2506
- for (; n > 0 && e.charCodeAt(~-n) === t.charCodeAt(~-o); ) n--, o--;
2507
- let u = 0;
2508
- for (; u < n && e.charCodeAt(u) === t.charCodeAt(u); ) u++;
2509
- if (((n -= u), (o -= u), n === 0)) return o;
2510
- let i,
2511
- s,
2512
- a,
2513
- D,
2514
- l = 0,
2515
- d = 0;
2516
- for (; l < n; ) (dn[l] = e.charCodeAt(u + l)), (jt[l] = ++l);
2517
- for (; d < o; )
2518
- for (i = t.charCodeAt(u + d), a = d++, s = d, l = 0; l < n; l++)
2519
- (D = i === dn[l] ? a : a + 1),
2520
- (a = jt[l]),
2521
- (s = jt[l] = a > s ? (D > s ? s + 1 : D) : D > a ? a + 1 : D);
2522
- return s;
2523
- }
2524
- var at = (e, t, { descriptor: r, logger: n, schemas: o }) => {
2525
- let u = [
2526
- `Ignored unknown option ${Wt.default.yellow(r.pair({ key: e, value: t }))}.`,
2527
- ],
2528
- i = Object.keys(o)
2529
- .sort()
2530
- .find((s) => Ht(e, s) < 3);
2531
- i && u.push(`Did you mean ${Wt.default.blue(r.key(i))}?`),
2532
- n.warn(u.join(" "));
2533
- };
2534
- var Fo = [
2535
- "default",
2536
- "expected",
2537
- "validate",
2538
- "deprecated",
2539
- "forward",
2540
- "redirect",
2541
- "overlap",
2542
- "preprocess",
2543
- "postprocess",
2544
- ];
2545
- function mo(e, t) {
2546
- let r = new e(t),
2547
- n = Object.create(r);
2548
- for (let o of Fo) o in t && (n[o] = Eo(t[o], r, O.prototype[o].length));
2549
- return n;
2550
- }
2551
- var O = class {
2552
- static create(t) {
2553
- return mo(this, t);
2554
- }
2555
- constructor(t) {
2556
- this.name = t.name;
2557
- }
2558
- default(t) {}
2559
- expected(t) {
2560
- return "nothing";
2561
- }
2562
- validate(t, r) {
2563
- return !1;
2564
- }
2565
- deprecated(t, r) {
2566
- return !1;
2567
- }
2568
- forward(t, r) {}
2569
- redirect(t, r) {}
2570
- overlap(t, r, n) {
2571
- return t;
2572
- }
2573
- preprocess(t, r) {
2574
- return t;
2575
- }
2576
- postprocess(t, r) {
2577
- return he;
2578
- }
2579
- };
2580
- function Eo(e, t, r) {
2581
- return typeof e == "function"
2582
- ? (...n) => e(...n.slice(0, r - 1), t, ...n.slice(r - 1))
2583
- : () => e;
2584
- }
2585
- var Dt = class extends O {
2586
- constructor(t) {
2587
- super(t), (this._sourceName = t.sourceName);
2588
- }
2589
- expected(t) {
2590
- return t.schemas[this._sourceName].expected(t);
2591
- }
2592
- validate(t, r) {
2593
- return r.schemas[this._sourceName].validate(t, r);
2594
- }
2595
- redirect(t, r) {
2596
- return this._sourceName;
2597
- }
2598
- };
2599
- var lt = class extends O {
2600
- expected() {
2601
- return "anything";
2602
- }
2603
- validate() {
2604
- return !0;
2605
- }
2606
- };
2607
- var ct = class extends O {
2608
- constructor({ valueSchema: t, name: r = t.name, ...n }) {
2609
- super({ ...n, name: r }), (this._valueSchema = t);
2610
- }
2611
- expected(t) {
2612
- let { text: r, list: n } = t.normalizeExpectedResult(
2613
- this._valueSchema.expected(t),
2614
- );
2615
- return {
2616
- text: r && `an array of ${r}`,
2617
- list: n && {
2618
- title: "an array of the following values",
2619
- values: [{ list: n }],
2620
- },
2621
- };
2622
- }
2623
- validate(t, r) {
2624
- if (!Array.isArray(t)) return !1;
2625
- let n = [];
2626
- for (let o of t) {
2627
- let u = r.normalizeValidateResult(this._valueSchema.validate(o, r), o);
2628
- u !== !0 && n.push(u.value);
2629
- }
2630
- return n.length === 0 ? !0 : { value: n };
2631
- }
2632
- deprecated(t, r) {
2633
- let n = [];
2634
- for (let o of t) {
2635
- let u = r.normalizeDeprecatedResult(
2636
- this._valueSchema.deprecated(o, r),
2637
- o,
2638
- );
2639
- u !== !1 && n.push(...u.map(({ value: i }) => ({ value: [i] })));
2640
- }
2641
- return n;
2642
- }
2643
- forward(t, r) {
2644
- let n = [];
2645
- for (let o of t) {
2646
- let u = r.normalizeForwardResult(this._valueSchema.forward(o, r), o);
2647
- n.push(...u.map(Fn));
2648
- }
2649
- return n;
2650
- }
2651
- redirect(t, r) {
2652
- let n = [],
2653
- o = [];
2654
- for (let u of t) {
2655
- let i = r.normalizeRedirectResult(this._valueSchema.redirect(u, r), u);
2656
- "remain" in i && n.push(i.remain), o.push(...i.redirect.map(Fn));
2657
- }
2658
- return n.length === 0 ? { redirect: o } : { redirect: o, remain: n };
2659
- }
2660
- overlap(t, r) {
2661
- return t.concat(r);
2662
- }
2663
- };
2664
- function Fn({ from: e, to: t }) {
2665
- return { from: [e], to: t };
2666
- }
2667
- var ft = class extends O {
2668
- expected() {
2669
- return "true or false";
2670
- }
2671
- validate(t) {
2672
- return typeof t == "boolean";
2673
- }
2674
- };
2675
- function En(e, t) {
2676
- let r = Object.create(null);
2677
- for (let n of e) {
2678
- let o = n[t];
2679
- if (r[o]) throw new Error(`Duplicate ${t} ${JSON.stringify(o)}`);
2680
- r[o] = n;
2681
- }
2682
- return r;
2683
- }
2684
- function hn(e, t) {
2685
- let r = new Map();
2686
- for (let n of e) {
2687
- let o = n[t];
2688
- if (r.has(o)) throw new Error(`Duplicate ${t} ${JSON.stringify(o)}`);
2689
- r.set(o, n);
2690
- }
2691
- return r;
2692
- }
2693
- function Cn() {
2694
- let e = Object.create(null);
2695
- return (t) => {
2696
- let r = JSON.stringify(t);
2697
- return e[r] ? !0 : ((e[r] = !0), !1);
2698
- };
2699
- }
2700
- function gn(e, t) {
2701
- let r = [],
2702
- n = [];
2703
- for (let o of e) t(o) ? r.push(o) : n.push(o);
2704
- return [r, n];
2705
- }
2706
- function yn(e) {
2707
- return e === Math.floor(e);
2708
- }
2709
- function An(e, t) {
2710
- if (e === t) return 0;
2711
- let r = typeof e,
2712
- n = typeof t,
2713
- o = ["undefined", "object", "boolean", "number", "string"];
2714
- return r !== n
2715
- ? o.indexOf(r) - o.indexOf(n)
2716
- : r !== "string"
2717
- ? Number(e) - Number(t)
2718
- : e.localeCompare(t);
2719
- }
2720
- function Bn(e) {
2721
- return (...t) => {
2722
- let r = e(...t);
2723
- return typeof r == "string" ? new Error(r) : r;
2724
- };
2725
- }
2726
- function Mt(e) {
2727
- return e === void 0 ? {} : e;
2728
- }
2729
- function $t(e) {
2730
- if (typeof e == "string") return { text: e };
2731
- let { text: t, list: r } = e;
2732
- return (
2733
- ho(
2734
- (t || r) !== void 0,
2735
- "Unexpected `expected` result, there should be at least one field.",
2736
- ),
2737
- r
2738
- ? { text: t, list: { title: r.title, values: r.values.map($t) } }
2739
- : { text: t }
2740
- );
2741
- }
2742
- function Vt(e, t) {
2743
- return e === !0 ? !0 : e === !1 ? { value: t } : e;
2744
- }
2745
- function Ut(e, t, r = !1) {
2746
- return e === !1
2747
- ? !1
2748
- : e === !0
2749
- ? r
2750
- ? !0
2751
- : [{ value: t }]
2752
- : "value" in e
2753
- ? [e]
2754
- : e.length === 0
2755
- ? !1
2756
- : e;
2757
- }
2758
- function mn(e, t) {
2759
- return typeof e == "string" || "key" in e
2760
- ? { from: t, to: e }
2761
- : "from" in e
2762
- ? { from: e.from, to: e.to }
2763
- : { from: t, to: e.to };
2764
- }
2765
- function pt(e, t) {
2766
- return e === void 0
2767
- ? []
2768
- : Array.isArray(e)
2769
- ? e.map((r) => mn(r, t))
2770
- : [mn(e, t)];
2771
- }
2772
- function zt(e, t) {
2773
- let r = pt(typeof e == "object" && "redirect" in e ? e.redirect : e, t);
2774
- return r.length === 0
2775
- ? { remain: t, redirect: r }
2776
- : typeof e == "object" && "remain" in e
2777
- ? { remain: e.remain, redirect: r }
2778
- : { redirect: r };
2779
- }
2780
- function ho(e, t) {
2781
- if (!e) throw new Error(t);
2782
- }
2783
- var dt = class extends O {
2784
- constructor(t) {
2785
- super(t),
2786
- (this._choices = hn(
2787
- t.choices.map((r) => (r && typeof r == "object" ? r : { value: r })),
2788
- "value",
2789
- ));
2790
- }
2791
- expected({ descriptor: t }) {
2792
- let r = Array.from(this._choices.keys())
2793
- .map((i) => this._choices.get(i))
2794
- .filter(({ hidden: i }) => !i)
2795
- .map((i) => i.value)
2796
- .sort(An)
2797
- .map(t.value),
2798
- n = r.slice(0, -2),
2799
- o = r.slice(-2);
2800
- return {
2801
- text: n.concat(o.join(" or ")).join(", "),
2802
- list: { title: "one of the following values", values: r },
2803
- };
2804
- }
2805
- validate(t) {
2806
- return this._choices.has(t);
2807
- }
2808
- deprecated(t) {
2809
- let r = this._choices.get(t);
2810
- return r && r.deprecated ? { value: t } : !1;
2811
- }
2812
- forward(t) {
2813
- let r = this._choices.get(t);
2814
- return r ? r.forward : void 0;
2815
- }
2816
- redirect(t) {
2817
- let r = this._choices.get(t);
2818
- return r ? r.redirect : void 0;
2819
- }
2820
- };
2821
- var Ft = class extends O {
2822
- expected() {
2823
- return "a number";
2824
- }
2825
- validate(t, r) {
2826
- return typeof t == "number";
2827
- }
2828
- };
2829
- var mt = class extends Ft {
2830
- expected() {
2831
- return "an integer";
2832
- }
2833
- validate(t, r) {
2834
- return r.normalizeValidateResult(super.validate(t, r), t) === !0 && yn(t);
2835
- }
2836
- };
2837
- var Re = class extends O {
2838
- expected() {
2839
- return "a string";
2840
- }
2841
- validate(t) {
2842
- return typeof t == "string";
2843
- }
2844
- };
2845
- var wn = ie,
2846
- xn = at,
2847
- _n = cn,
2848
- vn = an;
2849
- var Et = class {
2850
- constructor(t, r) {
2851
- let {
2852
- logger: n = console,
2853
- loggerPrintWidth: o = 80,
2854
- descriptor: u = wn,
2855
- unknown: i = xn,
2856
- invalid: s = _n,
2857
- deprecated: a = vn,
2858
- missing: D = () => !1,
2859
- required: l = () => !1,
2860
- preprocess: d = (p) => p,
2861
- postprocess: f = () => he,
2862
- } = r || {};
2863
- (this._utils = {
2864
- descriptor: u,
2865
- logger: n || { warn: () => {} },
2866
- loggerPrintWidth: o,
2867
- schemas: En(t, "name"),
2868
- normalizeDefaultResult: Mt,
2869
- normalizeExpectedResult: $t,
2870
- normalizeDeprecatedResult: Ut,
2871
- normalizeForwardResult: pt,
2872
- normalizeRedirectResult: zt,
2873
- normalizeValidateResult: Vt,
2874
- }),
2875
- (this._unknownHandler = i),
2876
- (this._invalidHandler = Bn(s)),
2877
- (this._deprecatedHandler = a),
2878
- (this._identifyMissing = (p, c) => !(p in c) || D(p, c)),
2879
- (this._identifyRequired = l),
2880
- (this._preprocess = d),
2881
- (this._postprocess = f),
2882
- this.cleanHistory();
2883
- }
2884
- cleanHistory() {
2885
- this._hasDeprecationWarned = Cn();
2886
- }
2887
- normalize(t) {
2888
- let r = {},
2889
- o = [this._preprocess(t, this._utils)],
2890
- u = () => {
2891
- for (; o.length !== 0; ) {
2892
- let i = o.shift(),
2893
- s = this._applyNormalization(i, r);
2894
- o.push(...s);
2895
- }
2896
- };
2897
- u();
2898
- for (let i of Object.keys(this._utils.schemas)) {
2899
- let s = this._utils.schemas[i];
2900
- if (!(i in r)) {
2901
- let a = Mt(s.default(this._utils));
2902
- "value" in a && o.push({ [i]: a.value });
2903
- }
2904
- }
2905
- u();
2906
- for (let i of Object.keys(this._utils.schemas)) {
2907
- if (!(i in r)) continue;
2908
- let s = this._utils.schemas[i],
2909
- a = r[i],
2910
- D = s.postprocess(a, this._utils);
2911
- D !== he && (this._applyValidation(D, i, s), (r[i] = D));
2912
- }
2913
- return this._applyPostprocess(r), this._applyRequiredCheck(r), r;
2914
- }
2915
- _applyNormalization(t, r) {
2916
- let n = [],
2917
- { knownKeys: o, unknownKeys: u } = this._partitionOptionKeys(t);
2918
- for (let i of o) {
2919
- let s = this._utils.schemas[i],
2920
- a = s.preprocess(t[i], this._utils);
2921
- this._applyValidation(a, i, s);
2922
- let D = ({ from: p, to: c }) => {
2923
- n.push(typeof c == "string" ? { [c]: p } : { [c.key]: c.value });
2924
- },
2925
- l = ({ value: p, redirectTo: c }) => {
2926
- let F = Ut(s.deprecated(p, this._utils), a, !0);
2927
- if (F !== !1)
2928
- if (F === !0)
2929
- this._hasDeprecationWarned(i) ||
2930
- this._utils.logger.warn(
2931
- this._deprecatedHandler(i, c, this._utils),
2932
- );
2933
- else
2934
- for (let { value: m } of F) {
2935
- let E = { key: i, value: m };
2936
- if (!this._hasDeprecationWarned(E)) {
2937
- let A = typeof c == "string" ? { key: c, value: m } : c;
2938
- this._utils.logger.warn(
2939
- this._deprecatedHandler(E, A, this._utils),
2940
- );
2941
- }
2942
- }
2943
- };
2944
- pt(s.forward(a, this._utils), a).forEach(D);
2945
- let f = zt(s.redirect(a, this._utils), a);
2946
- if ((f.redirect.forEach(D), "remain" in f)) {
2947
- let p = f.remain;
2948
- (r[i] = i in r ? s.overlap(r[i], p, this._utils) : p), l({ value: p });
2949
- }
2950
- for (let { from: p, to: c } of f.redirect) l({ value: p, redirectTo: c });
2951
- }
2952
- for (let i of u) {
2953
- let s = t[i];
2954
- this._applyUnknownHandler(i, s, r, (a, D) => {
2955
- n.push({ [a]: D });
2956
- });
2957
- }
2958
- return n;
2959
- }
2960
- _applyRequiredCheck(t) {
2961
- for (let r of Object.keys(this._utils.schemas))
2962
- if (this._identifyMissing(r, t) && this._identifyRequired(r))
2963
- throw this._invalidHandler(r, st, this._utils);
2964
- }
2965
- _partitionOptionKeys(t) {
2966
- let [r, n] = gn(
2967
- Object.keys(t).filter((o) => !this._identifyMissing(o, t)),
2968
- (o) => o in this._utils.schemas,
2969
- );
2970
- return { knownKeys: r, unknownKeys: n };
2971
- }
2972
- _applyValidation(t, r, n) {
2973
- let o = Vt(n.validate(t, this._utils), t);
2974
- if (o !== !0) throw this._invalidHandler(r, o.value, this._utils);
2975
- }
2976
- _applyUnknownHandler(t, r, n, o) {
2977
- let u = this._unknownHandler(t, r, this._utils);
2978
- if (u)
2979
- for (let i of Object.keys(u)) {
2980
- if (this._identifyMissing(i, u)) continue;
2981
- let s = u[i];
2982
- i in this._utils.schemas ? o(i, s) : (n[i] = s);
2983
- }
2984
- }
2985
- _applyPostprocess(t) {
2986
- let r = this._postprocess(t, this._utils);
2987
- if (r !== he) {
2988
- if (r.delete) for (let n of r.delete) delete t[n];
2989
- if (r.override) {
2990
- let { knownKeys: n, unknownKeys: o } = this._partitionOptionKeys(
2991
- r.override,
2992
- );
2993
- for (let u of n) {
2994
- let i = r.override[u];
2995
- this._applyValidation(i, u, this._utils.schemas[u]), (t[u] = i);
2996
- }
2997
- for (let u of o) {
2998
- let i = r.override[u];
2999
- this._applyUnknownHandler(u, i, t, (s, a) => {
3000
- let D = this._utils.schemas[s];
3001
- this._applyValidation(a, s, D), (t[s] = a);
3002
- });
3003
- }
3004
- }
3005
- }
3006
- }
3007
- };
3008
- var Gt;
3009
- function go(
3010
- e,
3011
- t,
3012
- {
3013
- logger: r = !1,
3014
- isCLI: n = !1,
3015
- passThrough: o = !1,
3016
- FlagSchema: u,
3017
- descriptor: i,
3018
- } = {},
3019
- ) {
3020
- if (n) {
3021
- if (!u) throw new Error("'FlagSchema' option is required.");
3022
- if (!i) throw new Error("'descriptor' option is required.");
3023
- } else i = ie;
3024
- let s = o
3025
- ? Array.isArray(o)
3026
- ? (f, p) => (o.includes(f) ? { [f]: p } : void 0)
3027
- : (f, p) => ({ [f]: p })
3028
- : (f, p, c) => {
3029
- let { _: F, ...m } = c.schemas;
3030
- return at(f, p, { ...c, schemas: m });
3031
- },
3032
- a = yo(t, { isCLI: n, FlagSchema: u }),
3033
- D = new Et(a, { logger: r, unknown: s, descriptor: i }),
3034
- l = r !== !1;
3035
- l && Gt && (D._hasDeprecationWarned = Gt);
3036
- let d = D.normalize(e);
3037
- return l && (Gt = D._hasDeprecationWarned), d;
3038
- }
3039
- function yo(e, { isCLI: t, FlagSchema: r }) {
3040
- let n = [];
3041
- t && n.push(lt.create({ name: "_" }));
3042
- for (let o of e)
3043
- n.push(Ao(o, { isCLI: t, optionInfos: e, FlagSchema: r })),
3044
- o.alias && t && n.push(Dt.create({ name: o.alias, sourceName: o.name }));
3045
- return n;
3046
- }
3047
- function Ao(e, { isCLI: t, optionInfos: r, FlagSchema: n }) {
3048
- let { name: o } = e,
3049
- u = { name: o },
3050
- i,
3051
- s = {};
3052
- switch (e.type) {
3053
- case "int":
3054
- (i = mt), t && (u.preprocess = Number);
3055
- break;
3056
- case "string":
3057
- i = Re;
3058
- break;
3059
- case "choice":
3060
- (i = dt),
3061
- (u.choices = e.choices.map((a) =>
3062
- a != null && a.redirect
3063
- ? { ...a, redirect: { to: { key: e.name, value: a.redirect } } }
3064
- : a,
3065
- ));
3066
- break;
3067
- case "boolean":
3068
- i = ft;
3069
- break;
3070
- case "flag":
3071
- (i = n),
3072
- (u.flags = r.flatMap((a) =>
3073
- [
3074
- a.alias,
3075
- a.description && a.name,
3076
- a.oppositeDescription && `no-${a.name}`,
3077
- ].filter(Boolean),
3078
- ));
3079
- break;
3080
- case "path":
3081
- i = Re;
3082
- break;
3083
- default:
3084
- throw new Error(`Unexpected type ${e.type}`);
3085
- }
3086
- if (
3087
- (e.exception
3088
- ? (u.validate = (a, D, l) => e.exception(a) || D.validate(a, l))
3089
- : (u.validate = (a, D, l) => a === void 0 || D.validate(a, l)),
3090
- e.redirect &&
3091
- (s.redirect = (a) =>
3092
- a
3093
- ? {
3094
- to:
3095
- typeof e.redirect == "string"
3096
- ? e.redirect
3097
- : { key: e.redirect.option, value: e.redirect.value },
3098
- }
3099
- : void 0),
3100
- e.deprecated && (s.deprecated = !0),
3101
- t && !e.array)
3102
- ) {
3103
- let a = u.preprocess || ((D) => D);
3104
- u.preprocess = (D, l, d) =>
3105
- l.preprocess(a(Array.isArray(D) ? y(!1, D, -1) : D), d);
3106
- }
3107
- return e.array
3108
- ? ct.create({
3109
- ...(t ? { preprocess: (a) => (Array.isArray(a) ? a : [a]) } : {}),
3110
- ...s,
3111
- valueSchema: i.create(u),
3112
- })
3113
- : i.create({ ...u, ...s });
3114
- }
3115
- var bn = go;
3116
- var Bo = (e, t, r) => {
3117
- if (!(e && t == null)) {
3118
- if (t.findLast) return t.findLast(r);
3119
- for (let n = t.length - 1; n >= 0; n--) {
3120
- let o = t[n];
3121
- if (r(o, n, t)) return o;
3122
- }
3123
- }
3124
- },
3125
- Kt = Bo;
3126
- function qt(e, t) {
3127
- if (!t) throw new Error("parserName is required.");
3128
- let r = Kt(
3129
- !1,
3130
- e,
3131
- (o) => o.parsers && Object.prototype.hasOwnProperty.call(o.parsers, t),
3132
- );
3133
- if (r) return r;
3134
- let n = `Couldn't resolve parser "${t}".`;
3135
- throw (
3136
- ((n += " Plugins must be explicitly added to the standalone bundle."),
3137
- new Pe(n))
3138
- );
3139
- }
3140
- function On(e, t) {
3141
- if (!t) throw new Error("astFormat is required.");
3142
- let r = Kt(
3143
- !1,
3144
- e,
3145
- (o) => o.printers && Object.prototype.hasOwnProperty.call(o.printers, t),
3146
- );
3147
- if (r) return r;
3148
- let n = `Couldn't find plugin for AST format "${t}".`;
3149
- throw (
3150
- ((n += " Plugins must be explicitly added to the standalone bundle."),
3151
- new Pe(n))
3152
- );
3153
- }
3154
- function ht({ plugins: e, parser: t }) {
3155
- let r = qt(e, t);
3156
- return Jt(r, t);
3157
- }
3158
- function Jt(e, t) {
3159
- let r = e.parsers[t];
3160
- return typeof r == "function" ? r() : r;
3161
- }
3162
- function Sn(e, t) {
3163
- let r = e.printers[t];
3164
- return typeof r == "function" ? r() : r;
3165
- }
3166
- var Nn = {
3167
- astFormat: "estree",
3168
- printer: {},
3169
- originalText: void 0,
3170
- locStart: null,
3171
- locEnd: null,
3172
- };
3173
- async function wo(e, t = {}) {
3174
- var d;
3175
- let r = { ...e };
3176
- if (!r.parser)
3177
- if (r.filepath) {
3178
- if (((r.parser = un(r, { physicalFile: r.filepath })), !r.parser))
3179
- throw new Ie(`No parser could be inferred for file "${r.filepath}".`);
3180
- } else
3181
- throw new Ie(
3182
- "No parser and no file path given, couldn't infer a parser.",
3183
- );
3184
- let n = ot({ plugins: e.plugins, showDeprecated: !0 }).options,
3185
- o = {
3186
- ...Nn,
3187
- ...Object.fromEntries(
3188
- n.filter((f) => f.default !== void 0).map((f) => [f.name, f.default]),
3189
- ),
3190
- },
3191
- u = qt(r.plugins, r.parser),
3192
- i = await Jt(u, r.parser);
3193
- (r.astFormat = i.astFormat), (r.locEnd = i.locEnd), (r.locStart = i.locStart);
3194
- let s =
3195
- (d = u.printers) != null && d[i.astFormat]
3196
- ? u
3197
- : On(r.plugins, i.astFormat),
3198
- a = await Sn(s, i.astFormat);
3199
- r.printer = a;
3200
- let D = s.defaultOptions
3201
- ? Object.fromEntries(
3202
- Object.entries(s.defaultOptions).filter(([, f]) => f !== void 0),
3203
- )
3204
- : {},
3205
- l = { ...o, ...D };
3206
- for (let [f, p] of Object.entries(l))
3207
- (r[f] === null || r[f] === void 0) && (r[f] = p);
3208
- return (
3209
- r.parser === "json" && (r.trailingComma = "none"),
3210
- bn(r, n, { passThrough: Object.keys(Nn), ...t })
3211
- );
3212
- }
3213
- var se = wo;
3214
- var Vn = Me($n(), 1);
3215
- async function ko(e, t) {
3216
- let r = await ht(t),
3217
- n = r.preprocess ? r.preprocess(e, t) : e;
3218
- t.originalText = n;
3219
- let o;
3220
- try {
3221
- o = await r.parse(n, t, t);
3222
- } catch (u) {
3223
- Lo(u, e);
3224
- }
3225
- return { text: n, ast: o };
3226
- }
3227
- function Lo(e, t) {
3228
- let { loc: r } = e;
3229
- if (r) {
3230
- let n = (0, Vn.codeFrameColumns)(t, r, { highlightCode: !0 });
3231
- throw (
3232
- ((e.message +=
3233
- `
3234
- ` + n),
3235
- (e.codeFrame = n),
3236
- e)
3237
- );
3238
- }
3239
- throw e;
3240
- }
3241
- var ce = ko;
3242
- async function Un(e, t, r, n, o) {
3243
- let {
3244
- embeddedLanguageFormatting: u,
3245
- printer: { embed: i, hasPrettierIgnore: s = () => !1, getVisitorKeys: a },
3246
- } = r;
3247
- if (!i || u !== "auto") return;
3248
- if (i.length > 2)
3249
- throw new Error(
3250
- "printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed",
3251
- );
3252
- let D = X(i.getVisitorKeys ?? a),
3253
- l = [];
3254
- p();
3255
- let d = e.stack;
3256
- for (let { print: c, node: F, pathStack: m } of l)
3257
- try {
3258
- e.stack = m;
3259
- let E = await c(f, t, e, r);
3260
- E && o.set(F, E);
3261
- } catch (E) {
3262
- if (globalThis.PRETTIER_DEBUG) throw E;
3263
- }
3264
- e.stack = d;
3265
- function f(c, F) {
3266
- return Po(c, F, r, n);
3267
- }
3268
- function p() {
3269
- let { node: c } = e;
3270
- if (c === null || typeof c != "object" || s(e)) return;
3271
- for (let m of D(c)) Array.isArray(c[m]) ? e.each(p, m) : e.call(p, m);
3272
- let F = i(e, r);
3273
- if (F) {
3274
- if (typeof F == "function") {
3275
- l.push({ print: F, node: c, pathStack: [...e.stack] });
3276
- return;
3277
- }
3278
- o.set(c, F);
3279
- }
3280
- }
3281
- }
3282
- async function Po(e, t, r, n) {
3283
- let o = await se(
3284
- { ...r, ...t, parentParser: r.parser, originalText: e },
3285
- { passThrough: !0 },
3286
- ),
3287
- { ast: u } = await ce(e, o),
3288
- i = await n(u, o);
3289
- return Ze(i);
3290
- }
3291
- function Io(e, t) {
3292
- let {
3293
- originalText: r,
3294
- [Symbol.for("comments")]: n,
3295
- locStart: o,
3296
- locEnd: u,
3297
- [Symbol.for("printedComments")]: i,
3298
- } = t,
3299
- { node: s } = e,
3300
- a = o(s),
3301
- D = u(s);
3302
- for (let l of n) o(l) >= a && u(l) <= D && i.add(l);
3303
- return r.slice(a, D);
3304
- }
3305
- var zn = Io;
3306
- async function Ye(e, t) {
3307
- ({ ast: e } = await Qt(e, t));
3308
- let r = new Map(),
3309
- n = new Mr(e),
3310
- o = tn(t),
3311
- u = new Map();
3312
- await Un(n, s, t, Ye, u);
3313
- let i = await Gn(n, t, s, void 0, u);
3314
- return en(t), i;
3315
- function s(D, l) {
3316
- return D === void 0 || D === n
3317
- ? a(l)
3318
- : Array.isArray(D)
3319
- ? n.call(() => a(l), ...D)
3320
- : n.call(() => a(l), D);
3321
- }
3322
- function a(D) {
3323
- o(n);
3324
- let l = n.node;
3325
- if (l == null) return "";
3326
- let d = l && typeof l == "object" && D === void 0;
3327
- if (d && r.has(l)) return r.get(l);
3328
- let f = Gn(n, t, s, D, u);
3329
- return d && r.set(l, f), f;
3330
- }
3331
- }
3332
- function Gn(e, t, r, n, o) {
3333
- var a;
3334
- let { node: u } = e,
3335
- { printer: i } = t,
3336
- s;
3337
- return (
3338
- (a = i.hasPrettierIgnore) != null && a.call(i, e)
3339
- ? (s = zn(e, t))
3340
- : o.has(u)
3341
- ? (s = o.get(u))
3342
- : (s = i.print(e, t, r, n)),
3343
- u === t.cursorNode && (s = Qe(s, (D) => [ve, D, ve])),
3344
- i.printComment &&
3345
- (!i.willPrintOwnComments || !i.willPrintOwnComments(e, t)) &&
3346
- (s = Qr(e, s, t)),
3347
- s
3348
- );
3349
- }
3350
- async function Qt(e, t) {
3351
- let r = e.comments ?? [];
3352
- (t[Symbol.for("comments")] = r),
3353
- (t[Symbol.for("tokens")] = e.tokens ?? []),
3354
- (t[Symbol.for("printedComments")] = new Set()),
3355
- Jr(e, t);
3356
- let {
3357
- printer: { preprocess: n },
3358
- } = t;
3359
- return (e = n ? await n(e, t) : e), { ast: e, comments: r };
3360
- }
3361
- function Ro(e, t) {
3362
- let { cursorOffset: r, locStart: n, locEnd: o } = t,
3363
- u = X(t.printer.getVisitorKeys),
3364
- i = (a) => n(a) <= r && o(a) >= r,
3365
- s = e;
3366
- for (let a of Ur(e, { getVisitorKeys: u, filter: i })) s = a;
3367
- return s;
3368
- }
3369
- var Kn = Ro;
3370
- function Yo(e, t) {
3371
- let {
3372
- printer: { massageAstNode: r, getVisitorKeys: n },
3373
- } = t;
3374
- if (!r) return e;
3375
- let o = X(n),
3376
- u = r.ignoredProperties ?? new Set();
3377
- return i(e);
3378
- function i(s, a) {
3379
- if (!(s !== null && typeof s == "object")) return s;
3380
- if (Array.isArray(s)) return s.map((f) => i(f, a)).filter(Boolean);
3381
- let D = {},
3382
- l = new Set(o(s));
3383
- for (let f in s)
3384
- !Object.prototype.hasOwnProperty.call(s, f) ||
3385
- u.has(f) ||
3386
- (l.has(f) ? (D[f] = i(s[f], s)) : (D[f] = s[f]));
3387
- let d = r(s, D, a);
3388
- if (d !== null) return d ?? D;
3389
- }
3390
- }
3391
- var qn = Yo;
3392
- var jo = (e, t, r) => {
3393
- if (!(e && t == null)) {
3394
- if (t.findLastIndex) return t.findLastIndex(r);
3395
- for (let n = t.length - 1; n >= 0; n--) {
3396
- let o = t[n];
3397
- if (r(o, n, t)) return n;
3398
- }
3399
- return -1;
3400
- }
3401
- },
3402
- Jn = jo;
3403
- var Ho = ({ parser: e }) =>
3404
- e === "json" || e === "json5" || e === "jsonc" || e === "json-stringify";
3405
- function Wo(e, t) {
3406
- let r = [e.node, ...e.parentNodes],
3407
- n = new Set([t.node, ...t.parentNodes]);
3408
- return r.find((o) => Qn.has(o.type) && n.has(o));
3409
- }
3410
- function Xn(e) {
3411
- let t = Jn(!1, e, (r) => r.type !== "Program" && r.type !== "File");
3412
- return t === -1 ? e : e.slice(0, t + 1);
3413
- }
3414
- function Mo(e, t, { locStart: r, locEnd: n }) {
3415
- let o = e.node,
3416
- u = t.node;
3417
- if (o === u) return { startNode: o, endNode: u };
3418
- let i = r(e.node);
3419
- for (let a of Xn(t.parentNodes))
3420
- if (r(a) >= i) u = a;
3421
- else break;
3422
- let s = n(t.node);
3423
- for (let a of Xn(e.parentNodes)) {
3424
- if (n(a) <= s) o = a;
3425
- else break;
3426
- if (o === u) break;
3427
- }
3428
- return { startNode: o, endNode: u };
3429
- }
3430
- function er(e, t, r, n, o = [], u) {
3431
- let { locStart: i, locEnd: s } = r,
3432
- a = i(e),
3433
- D = s(e);
3434
- if (
3435
- !(
3436
- t > D ||
3437
- t < a ||
3438
- (u === "rangeEnd" && t === a) ||
3439
- (u === "rangeStart" && t === D)
3440
- )
3441
- ) {
3442
- for (let l of ut(e, r)) {
3443
- let d = er(l, t, r, n, [e, ...o], u);
3444
- if (d) return d;
3445
- }
3446
- if (!n || n(e, o[0])) return { node: e, parentNodes: o };
3447
- }
3448
- }
3449
- function $o(e, t) {
3450
- return (
3451
- t !== "DeclareExportDeclaration" &&
3452
- e !== "TypeParameterDeclaration" &&
3453
- (e === "Directive" ||
3454
- e === "TypeAlias" ||
3455
- e === "TSExportAssignment" ||
3456
- e.startsWith("Declare") ||
3457
- e.startsWith("TSDeclare") ||
3458
- e.endsWith("Statement") ||
3459
- e.endsWith("Declaration"))
3460
- );
3461
- }
3462
- var Qn = new Set([
3463
- "JsonRoot",
3464
- "ObjectExpression",
3465
- "ArrayExpression",
3466
- "StringLiteral",
3467
- "NumericLiteral",
3468
- "BooleanLiteral",
3469
- "NullLiteral",
3470
- "UnaryExpression",
3471
- "TemplateLiteral",
3472
- ]),
3473
- Vo = new Set([
3474
- "OperationDefinition",
3475
- "FragmentDefinition",
3476
- "VariableDefinition",
3477
- "TypeExtensionDefinition",
3478
- "ObjectTypeDefinition",
3479
- "FieldDefinition",
3480
- "DirectiveDefinition",
3481
- "EnumTypeDefinition",
3482
- "EnumValueDefinition",
3483
- "InputValueDefinition",
3484
- "InputObjectTypeDefinition",
3485
- "SchemaDefinition",
3486
- "OperationTypeDefinition",
3487
- "InterfaceTypeDefinition",
3488
- "UnionTypeDefinition",
3489
- "ScalarTypeDefinition",
3490
- ]);
3491
- function Zn(e, t, r) {
3492
- if (!t) return !1;
3493
- switch (e.parser) {
3494
- case "flow":
3495
- case "babel":
3496
- case "babel-flow":
3497
- case "babel-ts":
3498
- case "typescript":
3499
- case "acorn":
3500
- case "espree":
3501
- case "meriyah":
3502
- case "__babel_estree":
3503
- return $o(t.type, r == null ? void 0 : r.type);
3504
- case "json":
3505
- case "json5":
3506
- case "jsonc":
3507
- case "json-stringify":
3508
- return Qn.has(t.type);
3509
- case "graphql":
3510
- return Vo.has(t.kind);
3511
- case "vue":
3512
- return t.tag !== "root";
3513
- }
3514
- return !1;
3515
- }
3516
- function eu(e, t, r) {
3517
- let { rangeStart: n, rangeEnd: o, locStart: u, locEnd: i } = t;
3518
- ke.ok(o > n);
3519
- let s = e.slice(n, o).search(/\S/u),
3520
- a = s === -1;
3521
- if (!a) for (n += s; o > n && !/\S/u.test(e[o - 1]); --o);
3522
- let D = er(r, n, t, (p, c) => Zn(t, p, c), [], "rangeStart"),
3523
- l = a ? D : er(r, o, t, (p) => Zn(t, p), [], "rangeEnd");
3524
- if (!D || !l) return { rangeStart: 0, rangeEnd: 0 };
3525
- let d, f;
3526
- if (Ho(t)) {
3527
- let p = Wo(D, l);
3528
- (d = p), (f = p);
3529
- } else ({ startNode: d, endNode: f } = Mo(D, l, t));
3530
- return { rangeStart: Math.min(u(d), u(f)), rangeEnd: Math.max(i(d), i(f)) };
3531
- }
3532
- var uu = "\uFEFF",
3533
- tu = Symbol("cursor");
3534
- async function ou(e, t, r = 0) {
3535
- if (!e || e.trim().length === 0)
3536
- return { formatted: "", cursorOffset: -1, comments: [] };
3537
- let { ast: n, text: o } = await ce(e, t);
3538
- t.cursorOffset >= 0 && (t.cursorNode = Kn(n, t));
3539
- let u = await Ye(n, t, r);
3540
- r > 0 && (u = Je([q, u], r, t.tabWidth));
3541
- let i = Fe(u, t);
3542
- if (r > 0) {
3543
- let a = i.formatted.trim();
3544
- i.cursorNodeStart !== void 0 &&
3545
- (i.cursorNodeStart -= i.formatted.indexOf(a)),
3546
- (i.formatted = a + Be(t.endOfLine));
3547
- }
3548
- let s = t[Symbol.for("comments")];
3549
- if (t.cursorOffset >= 0) {
3550
- let a, D, l, d, f;
3551
- if (
3552
- (t.cursorNode && i.cursorNodeText
3553
- ? ((a = t.locStart(t.cursorNode)),
3554
- (D = o.slice(a, t.locEnd(t.cursorNode))),
3555
- (l = t.cursorOffset - a),
3556
- (d = i.cursorNodeStart),
3557
- (f = i.cursorNodeText))
3558
- : ((a = 0), (D = o), (l = t.cursorOffset), (d = 0), (f = i.formatted)),
3559
- D === f)
3560
- )
3561
- return { formatted: i.formatted, cursorOffset: d + l, comments: s };
3562
- let p = D.split("");
3563
- p.splice(l, 0, tu);
3564
- let c = f.split(""),
3565
- F = dr(p, c),
3566
- m = d;
3567
- for (let E of F)
3568
- if (E.removed) {
3569
- if (E.value.includes(tu)) break;
3570
- } else m += E.count;
3571
- return { formatted: i.formatted, cursorOffset: m, comments: s };
3572
- }
3573
- return { formatted: i.formatted, cursorOffset: -1, comments: s };
3574
- }
3575
- async function Uo(e, t) {
3576
- let { ast: r, text: n } = await ce(e, t),
3577
- { rangeStart: o, rangeEnd: u } = eu(n, t, r),
3578
- i = n.slice(o, u),
3579
- s = Math.min(
3580
- o,
3581
- n.lastIndexOf(
3582
- `
3583
- `,
3584
- o,
3585
- ) + 1,
3586
- ),
3587
- a = n.slice(s, o).match(/^\s*/u)[0],
3588
- D = me(a, t.tabWidth),
3589
- l = await ou(
3590
- i,
3591
- {
3592
- ...t,
3593
- rangeStart: 0,
3594
- rangeEnd: Number.POSITIVE_INFINITY,
3595
- cursorOffset:
3596
- t.cursorOffset > o && t.cursorOffset <= u ? t.cursorOffset - o : -1,
3597
- endOfLine: "lf",
3598
- },
3599
- D,
3600
- ),
3601
- d = l.formatted.trimEnd(),
3602
- { cursorOffset: f } = t;
3603
- f > u
3604
- ? (f += d.length - i.length)
3605
- : l.cursorOffset >= 0 && (f = l.cursorOffset + o);
3606
- let p = n.slice(0, o) + d + n.slice(u);
3607
- if (t.endOfLine !== "lf") {
3608
- let c = Be(t.endOfLine);
3609
- f >= 0 &&
3610
- c ===
3611
- `\r
3612
- ` &&
3613
- (f += wt(
3614
- p.slice(0, f),
3615
- `
3616
- `,
3617
- )),
3618
- (p = ne(
3619
- !1,
3620
- p,
3621
- `
3622
- `,
3623
- c,
3624
- ));
3625
- }
3626
- return { formatted: p, cursorOffset: f, comments: l.comments };
3627
- }
3628
- function tr(e, t, r) {
3629
- return typeof t != "number" || Number.isNaN(t) || t < 0 || t > e.length
3630
- ? r
3631
- : t;
3632
- }
3633
- function ru(e, t) {
3634
- let { cursorOffset: r, rangeStart: n, rangeEnd: o } = t;
3635
- return (
3636
- (r = tr(e, r, -1)),
3637
- (n = tr(e, n, 0)),
3638
- (o = tr(e, o, e.length)),
3639
- { ...t, cursorOffset: r, rangeStart: n, rangeEnd: o }
3640
- );
3641
- }
3642
- function iu(e, t) {
3643
- let { cursorOffset: r, rangeStart: n, rangeEnd: o, endOfLine: u } = ru(e, t),
3644
- i = e.charAt(0) === uu;
3645
- if (
3646
- (i && ((e = e.slice(1)), r--, n--, o--),
3647
- u === "auto" && (u = Fr(e)),
3648
- e.includes("\r"))
3649
- ) {
3650
- let s = (a) =>
3651
- wt(
3652
- e.slice(0, Math.max(a, 0)),
3653
- `\r
3654
- `,
3655
- );
3656
- (r -= s(r)), (n -= s(n)), (o -= s(o)), (e = mr(e));
3657
- }
3658
- return {
3659
- hasBOM: i,
3660
- text: e,
3661
- options: ru(e, {
3662
- ...t,
3663
- cursorOffset: r,
3664
- rangeStart: n,
3665
- rangeEnd: o,
3666
- endOfLine: u,
3667
- }),
3668
- };
3669
- }
3670
- async function nu(e, t) {
3671
- let r = await ht(t);
3672
- return !r.hasPragma || r.hasPragma(e);
3673
- }
3674
- async function rr(e, t) {
3675
- let { hasBOM: r, text: n, options: o } = iu(e, await se(t));
3676
- if (
3677
- (o.rangeStart >= o.rangeEnd && n !== "") ||
3678
- (o.requirePragma && !(await nu(n, o)))
3679
- )
3680
- return { formatted: e, cursorOffset: t.cursorOffset, comments: [] };
3681
- let u;
3682
- return (
3683
- o.rangeStart > 0 || o.rangeEnd < n.length
3684
- ? (u = await Uo(n, o))
3685
- : (!o.requirePragma &&
3686
- o.insertPragma &&
3687
- o.printer.insertPragma &&
3688
- !(await nu(n, o)) &&
3689
- (n = o.printer.insertPragma(n)),
3690
- (u = await ou(n, o))),
3691
- r &&
3692
- ((u.formatted = uu + u.formatted),
3693
- u.cursorOffset >= 0 && u.cursorOffset++),
3694
- u
3695
- );
3696
- }
3697
- async function su(e, t, r) {
3698
- let { text: n, options: o } = iu(e, await se(t)),
3699
- u = await ce(n, o);
3700
- return (
3701
- r &&
3702
- (r.preprocessForPrint && (u.ast = await Qt(u.ast, o)),
3703
- r.massage && (u.ast = qn(u.ast, o))),
3704
- u
3705
- );
3706
- }
3707
- async function au(e, t) {
3708
- t = await se(t);
3709
- let r = await Ye(e, t);
3710
- return Fe(r, t);
3711
- }
3712
- async function Du(e, t) {
3713
- let r = Or(e),
3714
- { formatted: n } = await rr(r, { ...t, parser: "__js_expression" });
3715
- return n;
3716
- }
3717
- async function lu(e, t) {
3718
- t = await se(t);
3719
- let { ast: r } = await ce(e, t);
3720
- return Ye(r, t);
3721
- }
3722
- async function cu(e, t) {
3723
- return Fe(e, await se(t));
3724
- }
3725
- var nr = {};
3726
- We(nr, { builders: () => Go, printer: () => Ko, utils: () => qo });
3727
- var Go = {
3728
- join: be,
3729
- line: Ke,
3730
- softline: vr,
3731
- hardline: q,
3732
- literalline: qe,
3733
- group: _t,
3734
- conditionalGroup: Ar,
3735
- fill: Ge,
3736
- lineSuffix: xe,
3737
- lineSuffixBoundary: xr,
3738
- cursor: ve,
3739
- breakParent: de,
3740
- ifBreak: Br,
3741
- trim: _r,
3742
- indent: De,
3743
- indentIfBreak: wr,
3744
- align: ae,
3745
- addAlignmentToDoc: Je,
3746
- markAsRoot: gr,
3747
- dedentToRoot: Cr,
3748
- dedent: yr,
3749
- hardlineWithoutBreakParent: _e,
3750
- literallineWithoutBreakParent: vt,
3751
- label: br,
3752
- concat: (e) => e,
3753
- },
3754
- Ko = { printDocToString: Fe },
3755
- qo = {
3756
- willBreak: Ir,
3757
- traverseDoc: we,
3758
- findInDoc: Xe,
3759
- mapDoc: Ne,
3760
- removeLines: Yr,
3761
- stripTrailingHardline: Ze,
3762
- replaceEndOfLine: jr,
3763
- canBreak: Hr,
3764
- };
3765
- var fu = "3.3.3";
3766
- var or = {};
3767
- We(or, {
3768
- addDanglingComment: () => re,
3769
- addLeadingComment: () => ue,
3770
- addTrailingComment: () => oe,
3771
- getAlignmentSize: () => me,
3772
- getIndentSize: () => pu,
3773
- getMaxContinuousCount: () => du,
3774
- getNextNonSpaceNonCommentCharacter: () => Fu,
3775
- getNextNonSpaceNonCommentCharacterIndex: () => si,
3776
- getStringWidth: () => Oe,
3777
- hasNewline: () => V,
3778
- hasNewlineInRange: () => mu,
3779
- hasSpaces: () => Eu,
3780
- isNextLineEmpty: () => ci,
3781
- isNextLineEmptyAfterIndex: () => gt,
3782
- isPreviousLineEmpty: () => Di,
3783
- makeString: () => hu,
3784
- skip: () => Ee,
3785
- skipEverythingButNewLine: () => nt,
3786
- skipInlineComment: () => Ce,
3787
- skipNewline: () => M,
3788
- skipSpaces: () => T,
3789
- skipToLineEnd: () => rt,
3790
- skipTrailingComment: () => ge,
3791
- skipWhitespace: () => zr,
3792
- });
3793
- function Jo(e, t) {
3794
- if (t === !1) return !1;
3795
- if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
3796
- for (let r = t + 2; r < e.length; ++r)
3797
- if (e.charAt(r) === "*" && e.charAt(r + 1) === "/") return r + 2;
3798
- }
3799
- return t;
3800
- }
3801
- var Ce = Jo;
3802
- function Xo(e, t) {
3803
- return t === !1
3804
- ? !1
3805
- : e.charAt(t) === "/" && e.charAt(t + 1) === "/"
3806
- ? nt(e, t)
3807
- : t;
3808
- }
3809
- var ge = Xo;
3810
- function Zo(e, t) {
3811
- let r = null,
3812
- n = t;
3813
- for (; n !== r; )
3814
- (r = n), (n = T(e, n)), (n = Ce(e, n)), (n = ge(e, n)), (n = M(e, n));
3815
- return n;
3816
- }
3817
- var je = Zo;
3818
- function Qo(e, t) {
3819
- let r = null,
3820
- n = t;
3821
- for (; n !== r; ) (r = n), (n = rt(e, n)), (n = Ce(e, n)), (n = T(e, n));
3822
- return (n = ge(e, n)), (n = M(e, n)), n !== !1 && V(e, n);
3823
- }
3824
- var gt = Qo;
3825
- function ei(e, t) {
3826
- let r = e.lastIndexOf(`
3827
- `);
3828
- return r === -1 ? 0 : me(e.slice(r + 1).match(/^[\t ]*/u)[0], t);
3829
- }
3830
- var pu = ei;
3831
- function ur(e) {
3832
- if (typeof e != "string") throw new TypeError("Expected a string");
3833
- return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
3834
- }
3835
- function ti(e, t) {
3836
- let r = e.match(new RegExp(`(${ur(t)})+`, "gu"));
3837
- return r === null
3838
- ? 0
3839
- : r.reduce((n, o) => Math.max(n, o.length / t.length), 0);
3840
- }
3841
- var du = ti;
3842
- function ri(e, t) {
3843
- let r = je(e, t);
3844
- return r === !1 ? "" : e.charAt(r);
3845
- }
3846
- var Fu = ri;
3847
- function ni(e, t, r) {
3848
- for (let n = t; n < r; ++n)
3849
- if (
3850
- e.charAt(n) ===
3851
- `
3852
- `
3853
- )
3854
- return !0;
3855
- return !1;
3856
- }
3857
- var mu = ni;
3858
- function ui(e, t, r = {}) {
3859
- return T(e, r.backwards ? t - 1 : t, r) !== t;
3860
- }
3861
- var Eu = ui;
3862
- function oi(e, t, r) {
3863
- let n = t === '"' ? "'" : '"',
3864
- u = ne(!1, e, /\\(.)|(["'])/gsu, (i, s, a) =>
3865
- s === n
3866
- ? s
3867
- : a === t
3868
- ? "\\" + a
3869
- : a ||
3870
- (r && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(s)
3871
- ? s
3872
- : "\\" + s),
3873
- );
3874
- return t + u + t;
3875
- }
3876
- var hu = oi;
3877
- function ii(e, t, r) {
3878
- return je(e, r(t));
3879
- }
3880
- function si(e, t) {
3881
- return arguments.length === 2 || typeof t == "number"
3882
- ? je(e, t)
3883
- : ii(...arguments);
3884
- }
3885
- function ai(e, t, r) {
3886
- return Le(e, r(t));
3887
- }
3888
- function Di(e, t) {
3889
- return arguments.length === 2 || typeof t == "number"
3890
- ? Le(e, t)
3891
- : ai(...arguments);
3892
- }
3893
- function li(e, t, r) {
3894
- return gt(e, r(t));
3895
- }
3896
- function ci(e, t) {
3897
- return arguments.length === 2 || typeof t == "number"
3898
- ? gt(e, t)
3899
- : li(...arguments);
3900
- }
3901
- function fe(e, t = 1) {
3902
- return async (...r) => {
3903
- let n = r[t] ?? {},
3904
- o = n.plugins ?? [];
3905
- return (
3906
- (r[t] = { ...n, plugins: Array.isArray(o) ? o : Object.values(o) }),
3907
- e(...r)
3908
- );
3909
- };
3910
- }
3911
- var Cu = fe(rr);
3912
- async function gu(e, t) {
3913
- let { formatted: r } = await Cu(e, { ...t, cursorOffset: -1 });
3914
- return r;
3915
- }
3916
- async function fi(e, t) {
3917
- return (await gu(e, t)) === e;
3918
- }
3919
- var pi = fe(ot, 0),
3920
- di = {
3921
- parse: fe(su),
3922
- formatAST: fe(au),
3923
- formatDoc: fe(Du),
3924
- printToDoc: fe(lu),
3925
- printDocToString: fe(cu),
3926
- };
3927
- var fc = ir;
3928
- export {
3929
- di as __debug,
3930
- fi as check,
3931
- fc as default,
3932
- nr as doc,
3933
- gu as format,
3934
- Cu as formatWithCursor,
3935
- pi as getSupportInfo,
3936
- or as util,
3937
- fu as version,
3938
- };
1
+ var Zn=Object.create;var Mt=Object.defineProperty;var eo=Object.getOwnPropertyDescriptor;var to=Object.getOwnPropertyNames;var uo=Object.getPrototypeOf,ro=Object.prototype.hasOwnProperty;var no=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Yt=(e,t)=>{for(var u in t)Mt(e,u,{get:t[u],enumerable:!0})},oo=(e,t,u,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of to(t))!ro.call(e,o)&&o!==u&&Mt(e,o,{get:()=>t[o],enumerable:!(r=eo(t,o))||r.enumerable});return e};var ao=(e,t,u)=>(u=e!=null?Zn(uo(e)):{},oo(t||!e||!e.__esModule?Mt(u,"default",{value:e,enumerable:!0}):u,e));var dn=no((of,ln)=>{var yt,bt,At,_t,xt,$e,bu,Ke,Bt,cn,Tt,Ve,Nt,St,wt,pe,fn,Ot,Pt,Aa;Nt=/\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]|[^\/\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu;Ve=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;yt=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu;wt=/(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y;Tt=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;pe=/[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y;Pt=/[\t\v\f\ufeff\p{Zs}]+/yu;Ke=/\r?\n|[\r\u2028\u2029]/y;Bt=/\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y;St=/\/\/.*/y;At=/[<>.:={}]|\/(?![\/*])/y;bt=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu;_t=/(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y;xt=/[^<>{}]+/y;Ot=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;fn=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;$e=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;bu=/^(?:return|throw|yield)$/;cn=RegExp(Ke.source);ln.exports=Aa=function*(e,{jsx:t=!1}={}){var u,r,o,n,a,s,i,D,f,l,d,c,p,F;for({length:s}=e,n=0,a="",F=[{tag:"JS"}],u=[],d=0,c=!1;n<s;){switch(D=F[F.length-1],D.tag){case"JS":case"JSNonExpressionParen":case"InterpolationInTemplate":case"InterpolationInJSX":if(e[n]==="/"&&(Ot.test(a)||$e.test(a))&&(Nt.lastIndex=n,i=Nt.exec(e))){n=Nt.lastIndex,a=i[0],c=!0,yield{type:"RegularExpressionLiteral",value:i[0],closed:i[1]!==void 0&&i[1]!=="\\"};continue}if(Ve.lastIndex=n,i=Ve.exec(e)){switch(p=i[0],f=Ve.lastIndex,l=p,p){case"(":a==="?NonExpressionParenKeyword"&&F.push({tag:"JSNonExpressionParen",nesting:d}),d++,c=!1;break;case")":d--,c=!0,D.tag==="JSNonExpressionParen"&&d===D.nesting&&(F.pop(),l="?NonExpressionParenEnd",c=!1);break;case"{":Ve.lastIndex=0,o=!fn.test(a)&&(Ot.test(a)||$e.test(a)),u.push(o),c=!1;break;case"}":switch(D.tag){case"InterpolationInTemplate":if(u.length===D.nesting){pe.lastIndex=n,i=pe.exec(e),n=pe.lastIndex,a=i[0],i[1]==="${"?(a="?InterpolationInTemplate",c=!1,yield{type:"TemplateMiddle",value:i[0]}):(F.pop(),c=!0,yield{type:"TemplateTail",value:i[0],closed:i[1]==="`"});continue}break;case"InterpolationInJSX":if(u.length===D.nesting){F.pop(),n+=1,a="}",yield{type:"JSXPunctuator",value:"}"};continue}}c=u.pop(),l=c?"?ExpressionBraceEnd":"}";break;case"]":c=!0;break;case"++":case"--":l=c?"?PostfixIncDec":"?UnaryIncDec";break;case"<":if(t&&(Ot.test(a)||$e.test(a))){F.push({tag:"JSXTag"}),n+=1,a="<",yield{type:"JSXPunctuator",value:p};continue}c=!1;break;default:c=!1}n=f,a=l,yield{type:"Punctuator",value:p};continue}if(yt.lastIndex=n,i=yt.exec(e)){switch(n=yt.lastIndex,l=i[0],i[0]){case"for":case"if":case"while":case"with":a!=="."&&a!=="?."&&(l="?NonExpressionParenKeyword")}a=l,c=!$e.test(i[0]),yield{type:i[1]==="#"?"PrivateIdentifier":"IdentifierName",value:i[0]};continue}if(wt.lastIndex=n,i=wt.exec(e)){n=wt.lastIndex,a=i[0],c=!0,yield{type:"StringLiteral",value:i[0],closed:i[2]!==void 0};continue}if(Tt.lastIndex=n,i=Tt.exec(e)){n=Tt.lastIndex,a=i[0],c=!0,yield{type:"NumericLiteral",value:i[0]};continue}if(pe.lastIndex=n,i=pe.exec(e)){n=pe.lastIndex,a=i[0],i[1]==="${"?(a="?InterpolationInTemplate",F.push({tag:"InterpolationInTemplate",nesting:u.length}),c=!1,yield{type:"TemplateHead",value:i[0]}):(c=!0,yield{type:"NoSubstitutionTemplate",value:i[0],closed:i[1]==="`"});continue}break;case"JSXTag":case"JSXTagEnd":if(At.lastIndex=n,i=At.exec(e)){switch(n=At.lastIndex,l=i[0],i[0]){case"<":F.push({tag:"JSXTag"});break;case">":F.pop(),a==="/"||D.tag==="JSXTagEnd"?(l="?JSX",c=!0):F.push({tag:"JSXChildren"});break;case"{":F.push({tag:"InterpolationInJSX",nesting:u.length}),l="?InterpolationInJSX",c=!1;break;case"/":a==="<"&&(F.pop(),F[F.length-1].tag==="JSXChildren"&&F.pop(),F.push({tag:"JSXTagEnd"}))}a=l,yield{type:"JSXPunctuator",value:i[0]};continue}if(bt.lastIndex=n,i=bt.exec(e)){n=bt.lastIndex,a=i[0],yield{type:"JSXIdentifier",value:i[0]};continue}if(_t.lastIndex=n,i=_t.exec(e)){n=_t.lastIndex,a=i[0],yield{type:"JSXString",value:i[0],closed:i[2]!==void 0};continue}break;case"JSXChildren":if(xt.lastIndex=n,i=xt.exec(e)){n=xt.lastIndex,a=i[0],yield{type:"JSXText",value:i[0]};continue}switch(e[n]){case"<":F.push({tag:"JSXTag"}),n++,a="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":F.push({tag:"InterpolationInJSX",nesting:u.length}),n++,a="?InterpolationInJSX",c=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(Pt.lastIndex=n,i=Pt.exec(e)){n=Pt.lastIndex,yield{type:"WhiteSpace",value:i[0]};continue}if(Ke.lastIndex=n,i=Ke.exec(e)){n=Ke.lastIndex,c=!1,bu.test(a)&&(a="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:i[0]};continue}if(Bt.lastIndex=n,i=Bt.exec(e)){n=Bt.lastIndex,cn.test(i[0])&&(c=!1,bu.test(a)&&(a="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:i[0],closed:i[1]!==void 0};continue}if(St.lastIndex=n,i=St.exec(e)){n=St.lastIndex,c=!1,yield{type:"SingleLineComment",value:i[0]};continue}r=String.fromCodePoint(e.codePointAt(n)),n+=r.length,a=r,c=!1,yield{type:D.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:r}}}});var Hn={};Yt(Hn,{__debug:()=>li,check:()=>ci,doc:()=>wu,format:()=>Jn,formatWithCursor:()=>zn,getSupportInfo:()=>fi,util:()=>Pu,version:()=>Mn});var X=(e,t)=>(u,r,...o)=>u|1&&r==null?void 0:(t.call(r)??r[e]).apply(r,o);var io=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},so=X("replaceAll",function(){if(typeof this=="string")return io}),oe=so;var Ne=class{diff(t,u,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);let n=this.castInput(t,r),a=this.castInput(u,r),s=this.removeEmpty(this.tokenize(n,r)),i=this.removeEmpty(this.tokenize(a,r));return this.diffWithOptionsObj(s,i,r,o)}diffWithOptionsObj(t,u,r,o){var n;let a=m=>{if(m=this.postProcess(m,r),o){setTimeout(function(){o(m)},0);return}else return m},s=u.length,i=t.length,D=1,f=s+i;r.maxEditLength!=null&&(f=Math.min(f,r.maxEditLength));let l=(n=r.timeout)!==null&&n!==void 0?n:1/0,d=Date.now()+l,c=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(c[0],u,t,0,r);if(c[0].oldPos+1>=i&&p+1>=s)return a(this.buildValues(c[0].lastComponent,u,t));let F=-1/0,C=1/0,y=()=>{for(let m=Math.max(F,-D);m<=Math.min(C,D);m+=2){let h,E=c[m-1],g=c[m+1];E&&(c[m-1]=void 0);let A=!1;if(g){let Q=g.oldPos-m;A=g&&0<=Q&&Q<s}let J=E&&E.oldPos+1<i;if(!A&&!J){c[m]=void 0;continue}if(!J||A&&E.oldPos<g.oldPos?h=this.addToPath(g,!0,!1,0,r):h=this.addToPath(E,!1,!0,1,r),p=this.extractCommon(h,u,t,m,r),h.oldPos+1>=i&&p+1>=s)return a(this.buildValues(h.lastComponent,u,t))||!0;c[m]=h,h.oldPos+1>=i&&(C=Math.min(C,m-1)),p+1>=s&&(F=Math.max(F,m+1))}D++};if(o)(function m(){setTimeout(function(){if(D>f||Date.now()>d)return o(void 0);y()||m()},0)})();else for(;D<=f&&Date.now()<=d;){let m=y();if(m)return m}}addToPath(t,u,r,o,n){let a=t.lastComponent;return a&&!n.oneChangePerToken&&a.added===u&&a.removed===r?{oldPos:t.oldPos+o,lastComponent:{count:a.count+1,added:u,removed:r,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:u,removed:r,previousComponent:a}}}extractCommon(t,u,r,o,n){let a=u.length,s=r.length,i=t.oldPos,D=i-o,f=0;for(;D+1<a&&i+1<s&&this.equals(r[i+1],u[D+1],n);)D++,i++,f++,n.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return f&&!n.oneChangePerToken&&(t.lastComponent={count:f,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=i,D}equals(t,u,r){return r.comparator?r.comparator(t,u):t===u||!!r.ignoreCase&&t.toLowerCase()===u.toLowerCase()}removeEmpty(t){let u=[];for(let r=0;r<t.length;r++)t[r]&&u.push(t[r]);return u}castInput(t,u){return t}tokenize(t,u){return Array.from(t)}join(t){return t.join("")}postProcess(t,u){return t}get useLongestToken(){return!1}buildValues(t,u,r){let o=[],n;for(;t;)o.push(t),n=t.previousComponent,delete t.previousComponent,t=n;o.reverse();let a=o.length,s=0,i=0,D=0;for(;s<a;s++){let f=o[s];if(f.removed)f.value=this.join(r.slice(D,D+f.count)),D+=f.count;else{if(!f.added&&this.useLongestToken){let l=u.slice(i,i+f.count);l=l.map(function(d,c){let p=r[D+c];return p.length>d.length?p:d}),f.value=this.join(l)}else f.value=this.join(u.slice(i,i+f.count));i+=f.count,f.added||(D+=f.count)}}return o}};var jt=class extends Ne{tokenize(t){return t.slice()}join(t){return t}removeEmpty(t){return t}},ku=new jt;function Ut(e,t,u){return ku.diff(e,t,u)}var Do=()=>{},P=Do;var Ru="cr",Lu="crlf",co="lf",fo=co,Wt="\r",Mu=`\r
2
+ `,Je=`
3
+ `,lo=Je;function Yu(e){let t=e.indexOf(Wt);return t!==-1?e.charAt(t+1)===Je?Lu:Ru:fo}function Se(e){return e===Ru?Wt:e===Lu?Mu:lo}var po=new Map([[Je,/\n/gu],[Wt,/\r/gu],[Mu,/\r\n/gu]]);function $t(e,t){let u=po.get(t);return e.match(u)?.length??0}var Fo=/\r\n?/gu;function ju(e){return oe(0,e,Fo,Je)}function mo(e){return this[e<0?this.length+e:e]}var Eo=X("at",function(){if(Array.isArray(this)||typeof this=="string")return mo}),b=Eo;var G="string",j="array",U="cursor",I="indent",k="align",v="trim",x="group",w="fill",B="if-break",R="indent-if-break",L="line-suffix",M="line-suffix-boundary",_="line",O="label",T="break-parent",He=new Set([U,I,k,v,x,w,B,R,L,M,_,O,T]);function Uu(e){let t=e.length;for(;t>0&&(e[t-1]==="\r"||e[t-1]===`
4
+ `);)t--;return t<e.length?e.slice(0,t):e}function Co(e){if(typeof e=="string")return G;if(Array.isArray(e))return j;if(!e)return;let{type:t}=e;if(He.has(t))return t}var H=Co;var ho=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function go(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}',
5
+ Expected it to be 'string' or 'object'.`;if(H(e))throw new Error("doc is valid.");let u=Object.prototype.toString.call(e);if(u!=="[object Object]")return`Unexpected doc '${u}'.`;let r=ho([...He].map(o=>`'${o}'`));return`Unexpected doc.type '${e.type}'.
6
+ Expected it to be ${r}.`}var Vt=class extends Error{name="InvalidDocError";constructor(t){super(go(t)),this.doc=t}},Z=Vt;var Wu={};function yo(e,t,u,r){let o=[e];for(;o.length>0;){let n=o.pop();if(n===Wu){u(o.pop());continue}u&&o.push(n,Wu);let a=H(n);if(!a)throw new Z(n);if(t?.(n)!==!1)switch(a){case j:case w:{let s=a===j?n:n.parts;for(let i=s.length,D=i-1;D>=0;--D)o.push(s[D]);break}case B:o.push(n.flatContents,n.breakContents);break;case x:if(r&&n.expandedStates)for(let s=n.expandedStates.length,i=s-1;i>=0;--i)o.push(n.expandedStates[i]);else o.push(n.contents);break;case k:case I:case R:case O:case L:o.push(n.contents);break;case G:case U:case v:case M:case _:case T:break;default:throw new Z(n)}}}var we=yo;function Pe(e,t){if(typeof e=="string")return t(e);let u=new Map;return r(e);function r(n){if(u.has(n))return u.get(n);let a=o(n);return u.set(n,a),a}function o(n){switch(H(n)){case j:return t(n.map(r));case w:return t({...n,parts:n.parts.map(r)});case B:return t({...n,breakContents:r(n.breakContents),flatContents:r(n.flatContents)});case x:{let{expandedStates:a,contents:s}=n;return a?(a=a.map(r),s=a[0]):s=r(s),t({...n,contents:s,expandedStates:a})}case k:case I:case R:case O:case L:return t({...n,contents:r(n.contents)});case G:case U:case v:case M:case _:case T:return t(n);default:throw new Z(n)}}}function Xe(e,t,u){let r=u,o=!1;function n(a){if(o)return!1;let s=t(a);s!==void 0&&(o=!0,r=s)}return we(e,n),r}function bo(e){if(e.type===x&&e.break||e.type===_&&e.hard||e.type===T)return!0}function Ku(e){return Xe(e,bo,!1)}function $u(e){if(e.length>0){let t=b(0,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function Gu(e){let t=new Set,u=[];function r(n){if(n.type===T&&$u(u),n.type===x){if(u.push(n),t.has(n))return!1;t.add(n)}}function o(n){n.type===x&&u.pop().break&&$u(u)}we(e,r,o,!0)}function Ao(e){return e.type===_&&!e.hard?e.soft?"":" ":e.type===B?e.flatContents:e}function zu(e){return Pe(e,Ao)}function Vu(e){for(e=[...e];e.length>=2&&b(0,e,-2).type===_&&b(0,e,-1).type===T;)e.length-=2;if(e.length>0){let t=Oe(b(0,e,-1));e[e.length-1]=t}return e}function Oe(e){switch(H(e)){case I:case R:case x:case L:case O:{let t=Oe(e.contents);return{...e,contents:t}}case B:return{...e,breakContents:Oe(e.breakContents),flatContents:Oe(e.flatContents)};case w:return{...e,parts:Vu(e.parts)};case j:return Vu(e);case G:return Uu(e);case k:case U:case v:case M:case _:case T:break;default:throw new Z(e)}return e}function qe(e){return Oe(xo(e))}function _o(e){switch(H(e)){case w:if(e.parts.every(t=>t===""))return"";break;case x:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===x&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case k:case I:case R:case L:if(!e.contents)return"";break;case B:if(!e.flatContents&&!e.breakContents)return"";break;case j:{let t=[];for(let u of e){if(!u)continue;let[r,...o]=Array.isArray(u)?u:[u];typeof r=="string"&&typeof b(0,t,-1)=="string"?t[t.length-1]+=r:t.push(r),t.push(...o)}return t.length===0?"":t.length===1?t[0]:t}case G:case U:case v:case M:case _:case O:case T:break;default:throw new Z(e)}return e}function xo(e){return Pe(e,t=>_o(t))}function Ju(e,t=Qe){return Pe(e,u=>typeof u=="string"?Ie(t,u.split(`
7
+ `)):u)}function Bo(e){if(e.type===_)return!0}function Hu(e){return Xe(e,Bo,!1)}function Ee(e,t){return e.type===O?{...e,contents:t(e.contents)}:t(e)}var N=P,Ze=P,Xu=P,qu=P;function ae(e){return N(e),{type:I,contents:e}}function De(e,t){return qu(e),N(t),{type:k,contents:t,n:e}}function Qu(e){return De(Number.NEGATIVE_INFINITY,e)}function et(e){return De({type:"root"},e)}function Zu(e){return De(-1,e)}function tt(e,t,u){N(e);let r=e;if(t>0){for(let o=0;o<Math.floor(t/u);++o)r=ae(r);r=De(t%u,r),r=De(Number.NEGATIVE_INFINITY,r)}return r}var ce={type:T};var ee={type:U};function er(e){return Xu(e),{type:w,parts:e}}function Kt(e,t={}){return N(e),Ze(t.expandedStates,!0),{type:x,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function tr(e,t){return Kt(e[0],{...t,expandedStates:e})}function ur(e,t="",u={}){return N(e),t!==""&&N(t),{type:B,breakContents:e,flatContents:t,groupId:u.groupId}}function rr(e,t){return N(e),{type:R,contents:e,groupId:t.groupId,negate:t.negate}}function Ie(e,t){N(e),Ze(t);let u=[];for(let r=0;r<t.length;r++)r!==0&&u.push(e),u.push(t[r]);return u}function nr(e,t){return N(t),e?{type:O,label:e,contents:t}:t}var ut={type:_},or={type:_,soft:!0},ke={type:_,hard:!0},V=[ke,ce],Gt={type:_,hard:!0,literal:!0},Qe=[Gt,ce];function ve(e){return N(e),{type:L,contents:e}}var ar={type:M};var ir={type:v};function te(e){if(!e)return"";if(Array.isArray(e)){let t=[];for(let u of e)if(Array.isArray(u))t.push(...te(u));else{let r=te(u);r!==""&&t.push(r)}return t}return e.type===B?{...e,breakContents:te(e.breakContents),flatContents:te(e.flatContents)}:e.type===x?{...e,contents:te(e.contents),expandedStates:e.expandedStates?.map(te)}:e.type===w?{type:"fill",parts:e.parts.map(te)}:e.contents?{...e,contents:te(e.contents)}:e}function sr(e){let t=Object.create(null),u=new Set;return r(te(e));function r(n,a,s){if(typeof n=="string")return JSON.stringify(n);if(Array.isArray(n)){let i=n.map(r).filter(Boolean);return i.length===1?i[0]:`[${i.join(", ")}]`}if(n.type===_){let i=s?.[a+1]?.type===T;return n.literal?i?"literalline":"literallineWithoutBreakParent":n.hard?i?"hardline":"hardlineWithoutBreakParent":n.soft?"softline":"line"}if(n.type===T)return s?.[a-1]?.type===_&&s[a-1].hard?void 0:"breakParent";if(n.type===v)return"trim";if(n.type===I)return"indent("+r(n.contents)+")";if(n.type===k)return n.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+r(n.contents)+")":n.n<0?"dedent("+r(n.contents)+")":n.n.type==="root"?"markAsRoot("+r(n.contents)+")":"align("+JSON.stringify(n.n)+", "+r(n.contents)+")";if(n.type===B)return"ifBreak("+r(n.breakContents)+(n.flatContents?", "+r(n.flatContents):"")+(n.groupId?(n.flatContents?"":', ""')+`, { groupId: ${o(n.groupId)} }`:"")+")";if(n.type===R){let i=[];n.negate&&i.push("negate: true"),n.groupId&&i.push(`groupId: ${o(n.groupId)}`);let D=i.length>0?`, { ${i.join(", ")} }`:"";return`indentIfBreak(${r(n.contents)}${D})`}if(n.type===x){let i=[];n.break&&n.break!=="propagated"&&i.push("shouldBreak: true"),n.id&&i.push(`id: ${o(n.id)}`);let D=i.length>0?`, { ${i.join(", ")} }`:"";return n.expandedStates?`conditionalGroup([${n.expandedStates.map(f=>r(f)).join(",")}]${D})`:`group(${r(n.contents)}${D})`}if(n.type===w)return`fill([${n.parts.map(i=>r(i)).join(", ")}])`;if(n.type===L)return"lineSuffix("+r(n.contents)+")";if(n.type===M)return"lineSuffixBoundary";if(n.type===O)return`label(${JSON.stringify(n.label)}, ${r(n.contents)})`;if(n.type===U)return"cursor";throw new Error("Unknown doc type "+n.type)}function o(n){if(typeof n!="symbol")return JSON.stringify(String(n));if(n in t)return t[n];let a=n.description||"symbol";for(let s=0;;s++){let i=a+(s>0?` #${s}`:"");if(!u.has(i))return u.add(i),t[n]=`Symbol.for(${JSON.stringify(i)})`}}}var Dr=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function zt(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Jt(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var cr="\xA9\xAE\u203C\u2049\u2122\u2139\u2194\u2195\u2196\u2197\u2198\u2199\u21A9\u21AA\u2328\u23CF\u23F1\u23F2\u23F8\u23F9\u23FA\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600\u2601\u2602\u2603\u2604\u260E\u2611\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638\u2639\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694\u2695\u2696\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F1\u26F7\u26F8\u26F9\u2702\u2708\u2709\u270C\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u2764\u27A1\u2934\u2935\u2B05\u2B06\u2B07";var To=/[^\x20-\x7F]/u,No=new Set(cr);function So(e){if(!e)return 0;if(!To.test(e))return e.length;e=e.replace(Dr(),u=>No.has(u)?" ":" ");let t=0;for(let u of e){let r=u.codePointAt(0);r<=31||r>=127&&r<=159||r>=768&&r<=879||r>=65024&&r<=65039||(t+=zt(r)||Jt(r)?2:1)}return t}var Re=So;var wo={type:0},Oo={type:1},Ht={value:"",length:0,queue:[],get root(){return Ht}};function fr(e,t,u){let r=t.type===1?e.queue.slice(0,-1):[...e.queue,t],o="",n=0,a=0,s=0;for(let p of r)switch(p.type){case 0:f(),u.useTabs?i(1):D(u.tabWidth);break;case 3:{let{string:F}=p;f(),o+=F,n+=F.length;break}case 2:{let{width:F}=p;a+=1,s+=F;break}default:throw new Error(`Unexpected indent comment '${p.type}'.`)}return d(),{...e,value:o,length:n,queue:r};function i(p){o+=" ".repeat(p),n+=u.tabWidth*p}function D(p){o+=" ".repeat(p),n+=p}function f(){u.useTabs?l():d()}function l(){a>0&&i(a),c()}function d(){s>0&&D(s),c()}function c(){a=0,s=0}}function lr(e,t,u){if(!t)return e;if(t.type==="root")return{...e,root:e};if(t===Number.NEGATIVE_INFINITY)return e.root;let r;return typeof t=="number"?t<0?r=Oo:r={type:2,width:t}:r={type:3,string:t},fr(e,r,u)}function dr(e,t){return fr(e,wo,t)}function Po(e){let t=0;for(let u=e.length-1;u>=0;u--){let r=e[u];if(r===" "||r===" ")t++;else break}return t}function Xt(e){let t=Po(e);return{text:t===0?e:e.slice(0,e.length-t),count:t}}var W=Symbol("MODE_BREAK"),q=Symbol("MODE_FLAT"),qt=Symbol("DOC_FILL_PRINTED_LENGTH");function rt(e,t,u,r,o,n){if(u===Number.POSITIVE_INFINITY)return!0;let a=t.length,s=!1,i=[e],D="";for(;u>=0;){if(i.length===0){if(a===0)return!0;i.push(t[--a]);continue}let{mode:f,doc:l}=i.pop(),d=H(l);switch(d){case G:l&&(s&&(D+=" ",u-=1,s=!1),D+=l,u-=Re(l));break;case j:case w:{let c=d===j?l:l.parts,p=l[qt]??0;for(let F=c.length-1;F>=p;F--)i.push({mode:f,doc:c[F]});break}case I:case k:case R:case O:i.push({mode:f,doc:l.contents});break;case v:{let{text:c,count:p}=Xt(D);D=c,u+=p;break}case x:{if(n&&l.break)return!1;let c=l.break?W:f,p=l.expandedStates&&c===W?b(0,l.expandedStates,-1):l.contents;i.push({mode:c,doc:p});break}case B:{let p=(l.groupId?o[l.groupId]||q:f)===W?l.breakContents:l.flatContents;p&&i.push({mode:f,doc:p});break}case _:if(f===W||l.hard)return!0;l.soft||(s=!0);break;case L:r=!0;break;case M:if(r)return!1;break}}return!1}function Ce(e,t){let u=Object.create(null),r=t.printWidth,o=Se(t.endOfLine),n=0,a=[{indent:Ht,mode:W,doc:e}],s="",i=!1,D=[],f=[],l=[],d=[],c=0;for(Gu(e);a.length>0;){let{indent:m,mode:h,doc:E}=a.pop();switch(H(E)){case G:{let g=o!==`
8
+ `?oe(0,E,`
9
+ `,o):E;g&&(s+=g,a.length>0&&(n+=Re(g)));break}case j:for(let g=E.length-1;g>=0;g--)a.push({indent:m,mode:h,doc:E[g]});break;case U:if(f.length>=2)throw new Error("There are too many 'cursor' in doc.");f.push(c+s.length);break;case I:a.push({indent:dr(m,t),mode:h,doc:E.contents});break;case k:a.push({indent:lr(m,E.n,t),mode:h,doc:E.contents});break;case v:y();break;case x:switch(h){case q:if(!i){a.push({indent:m,mode:E.break?W:q,doc:E.contents});break}case W:{i=!1;let g={indent:m,mode:q,doc:E.contents},A=r-n,J=D.length>0;if(!E.break&&rt(g,a,A,J,u))a.push(g);else if(E.expandedStates){let Q=b(0,E.expandedStates,-1);if(E.break){a.push({indent:m,mode:W,doc:Q});break}else for(let re=1;re<E.expandedStates.length+1;re++)if(re>=E.expandedStates.length){a.push({indent:m,mode:W,doc:Q});break}else{let Te=E.expandedStates[re],ne={indent:m,mode:q,doc:Te};if(rt(ne,a,A,J,u)){a.push(ne);break}}}else a.push({indent:m,mode:W,doc:E.contents});break}}E.id&&(u[E.id]=b(0,a,-1).mode);break;case w:{let g=r-n,A=E[qt]??0,{parts:J}=E,Q=J.length-A;if(Q===0)break;let re=J[A+0],Te=J[A+1],ne={indent:m,mode:q,doc:re},vt={indent:m,mode:W,doc:re},Rt=rt(ne,[],g,D.length>0,u,!0);if(Q===1){Rt?a.push(ne):a.push(vt);break}let Iu={indent:m,mode:q,doc:Te},Lt={indent:m,mode:W,doc:Te};if(Q===2){Rt?a.push(Iu,ne):a.push(Lt,vt);break}let Xn=J[A+2],qn={indent:m,mode:h,doc:{...E,[qt]:A+2}},Qn=rt({indent:m,mode:q,doc:[re,Te,Xn]},[],g,D.length>0,u,!0);a.push(qn),Qn?a.push(Iu,ne):Rt?a.push(Lt,ne):a.push(Lt,vt);break}case B:case R:{let g=E.groupId?u[E.groupId]:h;if(g===W){let A=E.type===B?E.breakContents:E.negate?E.contents:ae(E.contents);A&&a.push({indent:m,mode:h,doc:A})}if(g===q){let A=E.type===B?E.flatContents:E.negate?ae(E.contents):E.contents;A&&a.push({indent:m,mode:h,doc:A})}break}case L:D.push({indent:m,mode:h,doc:E.contents});break;case M:D.length>0&&a.push({indent:m,mode:h,doc:ke});break;case _:switch(h){case q:if(E.hard)i=!0;else{E.soft||(s+=" ",n+=1);break}case W:if(D.length>0){a.push({indent:m,mode:h,doc:E},...D.reverse()),D.length=0;break}E.literal?(s+=o,n=0,m.root&&(m.root.value&&(s+=m.root.value),n=m.root.length)):(y(),s+=o+m.value,n=m.length);break}break;case O:a.push({indent:m,mode:h,doc:E.contents});break;case T:break;default:throw new Z(E)}a.length===0&&D.length>0&&(a.push(...D.reverse()),D.length=0)}let p=l.join("")+s,F=[...d,...f];if(F.length!==2)return{formatted:p};let C=F[0];return{formatted:p,cursorNodeStart:C,cursorNodeText:p.slice(C,b(0,F,-1))};function y(){let{text:m,count:h}=Xt(s);m&&(l.push(m),c+=m.length),s="",n-=h,f.length>0&&(d.push(...f.map(E=>Math.min(E,c))),f.length=0)}}function Io(e,t,u=0){let r=0;for(let o=u;o<e.length;++o)e[o]===" "?r=r+t-r%t:r++;return r}var he=Io;var Qt=class{constructor(t){this.stack=[t]}get key(){let{stack:t,siblings:u}=this;return b(0,t,u===null?-2:-4)??null}get index(){return this.siblings===null?null:b(0,this.stack,-2)}get node(){return b(0,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:t}=this,u=b(0,t,-3);return Array.isArray(u)?u:null}get next(){let{siblings:t}=this;return t===null?null:t[this.index+1]}get previous(){let{siblings:t}=this;return t===null?null:t[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:t,index:u}=this;return t!==null&&u===t.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return[...this.#e()]}getName(){let{stack:t}=this,{length:u}=t;return u>1?b(0,t,-2):null}getValue(){return b(0,this.stack,-1)}getNode(t=0){let u=this.#t(t);return u===-1?null:this.stack[u]}getParentNode(t=0){return this.getNode(t+1)}#t(t){let{stack:u}=this;for(let r=u.length-1;r>=0;r-=2)if(!Array.isArray(u[r])&&--t<0)return r;return-1}call(t,...u){let{stack:r}=this,{length:o}=r,n=b(0,r,-1);for(let a of u)n=n?.[a],r.push(a,n);try{return t(this)}finally{r.length=o}}callParent(t,u=0){let r=this.#t(u+1),o=this.stack.splice(r+1);try{return t(this)}finally{this.stack.push(...o)}}each(t,...u){let{stack:r}=this,{length:o}=r,n=b(0,r,-1);for(let a of u)n=n[a],r.push(a,n);try{for(let a=0;a<n.length;++a)r.push(a,n[a]),t(this,a,n),r.length-=2}finally{r.length=o}}map(t,...u){let r=[];return this.each((o,n,a)=>{r[n]=t(o,n,a)},...u),r}match(...t){let u=this.stack.length-1,r=null,o=this.stack[u--];for(let n of t){if(o===void 0)return!1;let a=null;if(typeof r=="number"&&(a=r,r=this.stack[u--],o=this.stack[u--]),n&&!n(o,r,a))return!1;r=this.stack[u--],o=this.stack[u--]}return!0}findAncestor(t){for(let u of this.#e())if(t(u))return u}hasAncestor(t){for(let u of this.#e())if(t(u))return!0;return!1}*#e(){let{stack:t}=this;for(let u=t.length-3;u>=0;u-=2){let r=t[u];Array.isArray(r)||(yield r)}}},pr=Qt;function ko(e){return e!==null&&typeof e=="object"}var ge=ko;function ye(e){return(t,u,r)=>{let o=!!r?.backwards;if(u===!1)return!1;let{length:n}=t,a=u;for(;a>=0&&a<n;){let s=t.charAt(a);if(e instanceof RegExp){if(!e.test(s))return a}else if(!e.includes(s))return a;o?a--:a++}return a===-1||a===n?a:!1}}var Fr=ye(/\s/u),Y=ye(" "),nt=ye(",; "),ot=ye(/[^\n\r]/u);var mr=e=>e===`
10
+ `||e==="\r"||e==="\u2028"||e==="\u2029";function vo(e,t,u){let r=!!u?.backwards;if(t===!1)return!1;let o=e.charAt(t);if(r){if(e.charAt(t-1)==="\r"&&o===`
11
+ `)return t-2;if(mr(o))return t-1}else{if(o==="\r"&&e.charAt(t+1)===`
12
+ `)return t+2;if(mr(o))return t+1}return t}var K=vo;function Ro(e,t,u={}){let r=Y(e,u.backwards?t-1:t,u),o=K(e,r,u);return r!==o}var z=Ro;function Lo(e){return Array.isArray(e)&&e.length>0}var Er=Lo;function*be(e,t){let{getVisitorKeys:u,filter:r=()=>!0}=t,o=n=>ge(n)&&r(n);for(let n of u(e)){let a=e[n];if(Array.isArray(a))for(let s of a)o(s)&&(yield s);else o(a)&&(yield a)}}function*Cr(e,t){let u=[e];for(let r=0;r<u.length;r++){let o=u[r];for(let n of be(o,t))yield n,u.push(n)}}function hr(e,t){return be(e,t).next().done}function gr(e,t,u){let{cache:r}=u;if(r.has(e))return r.get(e);let{filter:o}=u;if(!o)return[];let n,a=(u.getChildren?.(e,u)??[...be(e,{getVisitorKeys:u.getVisitorKeys})]).flatMap(D=>(n??(n=[e,...t]),o(D,n)?[D]:gr(D,n,u))),{locStart:s,locEnd:i}=u;return a.sort((D,f)=>s(D)-s(f)||i(D)-i(f)),r.set(e,a),a}var at=gr;function Mo(e){let t=e.type||e.kind||"(unknown type)",u=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return u.length>20&&(u=u.slice(0,19)+"\u2026"),t+(u?" "+u:"")}function Zt(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=Mo(e)}function fe(e,t){t.leading=!0,t.trailing=!1,Zt(e,t)}function ue(e,t,u){t.leading=!1,t.trailing=!1,u&&(t.marker=u),Zt(e,t)}function le(e,t){t.leading=!1,t.trailing=!0,Zt(e,t)}var uu=new WeakMap;function br(e,t,u,r,o=[]){let{locStart:n,locEnd:a}=u,s=n(t),i=a(t),D=at(e,o,{cache:uu,locStart:n,locEnd:a,getVisitorKeys:u.getVisitorKeys,filter:u.printer.canAttachComment,getChildren:u.printer.getCommentChildNodes}),f,l,d=0,c=D.length;for(;d<c;){let p=d+c>>1,F=D[p],C=n(F),y=a(F);if(C<=s&&i<=y)return br(F,t,u,F,[F,...o]);if(y<=s){f=F,d=p+1;continue}if(i<=C){l=F,c=p;continue}throw new Error("Comment location overlaps with node location")}if(r?.type==="TemplateLiteral"){let{quasis:p}=r,F=tu(p,t,u);f&&tu(p,f,u)!==F&&(f=null),l&&tu(p,l,u)!==F&&(l=null)}return{enclosingNode:r,precedingNode:f,followingNode:l}}var eu=()=>!1;function Ar(e,t){let{comments:u}=e;if(delete e.comments,!Er(u)||!t.printer.canAttachComment)return;let r=[],{printer:{features:{experimental_avoidAstMutation:o},handleComments:n={}},originalText:a}=t,{ownLine:s=eu,endOfLine:i=eu,remaining:D=eu}=n,f=u.map((l,d)=>({...br(e,l,t),comment:l,text:a,options:t,ast:e,isLastComment:u.length-1===d}));for(let[l,d]of f.entries()){let{comment:c,precedingNode:p,enclosingNode:F,followingNode:C,text:y,options:m,ast:h,isLastComment:E}=d,g;if(o?g=[d]:(c.enclosingNode=F,c.precedingNode=p,c.followingNode=C,g=[c,y,m,h,E]),Yo(y,m,f,l))c.placement="ownLine",s(...g)||(C?fe(C,c):p?le(p,c):F?ue(F,c):ue(h,c));else if(jo(y,m,f,l))c.placement="endOfLine",i(...g)||(p?le(p,c):C?fe(C,c):F?ue(F,c):ue(h,c));else if(c.placement="remaining",!D(...g))if(p&&C){let A=r.length;A>0&&r[A-1].followingNode!==C&&yr(r,m),r.push(d)}else p?le(p,c):C?fe(C,c):F?ue(F,c):ue(h,c)}if(yr(r,t),!o)for(let l of u)delete l.precedingNode,delete l.enclosingNode,delete l.followingNode}var _r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Yo(e,t,u,r){let{comment:o,precedingNode:n}=u[r],{locStart:a,locEnd:s}=t,i=a(o);if(n)for(let D=r-1;D>=0;D--){let{comment:f,precedingNode:l}=u[D];if(l!==n||!_r(e.slice(s(f),i)))break;i=a(f)}return z(e,i,{backwards:!0})}function jo(e,t,u,r){let{comment:o,followingNode:n}=u[r],{locStart:a,locEnd:s}=t,i=s(o);if(n)for(let D=r+1;D<u.length;D++){let{comment:f,followingNode:l}=u[D];if(l!==n||!_r(e.slice(i,a(f))))break;i=s(f)}return z(e,i)}function yr(e,t){let u=e.length;if(u===0)return;let{precedingNode:r,followingNode:o}=e[0],n=t.locStart(o),a;for(a=u;a>0;--a){let{comment:s,precedingNode:i,followingNode:D}=e[a-1];P(i,r),P(D,o);let f=t.originalText.slice(t.locEnd(s),n);if(t.printer.isGap?.(f,t)??/^[\s(]*$/u.test(f))n=t.locStart(s);else break}for(let[s,{comment:i}]of e.entries())s<a?le(r,i):fe(o,i);for(let s of[r,o])s.comments&&s.comments.length>1&&s.comments.sort((i,D)=>t.locStart(i)-t.locStart(D));e.length=0}function tu(e,t,u){let r=u.locStart(t)-1;for(let o=1;o<e.length;++o)if(r<u.locStart(e[o]))return o-1;return 0}function Uo(e,t){let u=t-1;u=Y(e,u,{backwards:!0}),u=K(e,u,{backwards:!0}),u=Y(e,u,{backwards:!0});let r=K(e,u,{backwards:!0});return u!==r}var Le=Uo;function xr(e,t){let u=e.node;return u.printed=!0,t.printer.printComment(e,t)}function Wo(e,t){let u=e.node,r=[xr(e,t)],{printer:o,originalText:n,locStart:a,locEnd:s}=t;if(o.isBlockComment?.(u)){let f=z(n,s(u))?z(n,a(u),{backwards:!0})?V:ut:" ";r.push(f)}else r.push(V);let D=K(n,Y(n,s(u)));return D!==!1&&z(n,D)&&r.push(V),r}function $o(e,t,u){let r=e.node,o=xr(e,t),{printer:n,originalText:a,locStart:s}=t,i=n.isBlockComment?.(r);if(u?.hasLineSuffix&&!u?.isBlock||z(a,s(r),{backwards:!0})){let D=Le(a,s(r));return{doc:ve([V,D?V:"",o]),isBlock:i,hasLineSuffix:!0}}return!i||u?.hasLineSuffix?{doc:[ve([" ",o]),ce],isBlock:i,hasLineSuffix:!0}:{doc:[" ",o],isBlock:i,hasLineSuffix:!1}}function Vo(e,t){let u=e.node;if(!u)return{};let r=t[Symbol.for("printedComments")];if((u.comments||[]).filter(i=>!r.has(i)).length===0)return{leading:"",trailing:""};let n=[],a=[],s;return e.each(()=>{let i=e.node;if(r?.has(i))return;let{leading:D,trailing:f}=i;D?n.push(Wo(e,t)):f&&(s=$o(e,t,s),a.push(s.doc))},"comments"),{leading:n,trailing:a}}function Br(e,t,u){let{leading:r,trailing:o}=Vo(e,u);return!r&&!o?t:Ee(t,n=>[r,n,o])}function Tr(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:u}=e;for(let r of t){if(!r.printed&&!u.has(r))throw new Error('Comment "'+r.value.trim()+'" was not printed. Please report this error!');delete r.printed}}var Nr=()=>P;var Me=class extends Error{name="ConfigError"},Ye=class extends Error{name="UndefinedParserError"};var Sr={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
13
+ (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).
14
+ 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.
15
+ 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."}]}};function it({plugins:e=[],showDeprecated:t=!1}={}){let u=e.flatMap(o=>o.languages??[]),r=[];for(let o of Go(Object.assign({},...e.map(({options:n})=>n),Sr)))!t&&o.deprecated||(Array.isArray(o.choices)&&(t||(o.choices=o.choices.filter(n=>!n.deprecated)),o.name==="parser"&&(o.choices=[...o.choices,...Ko(o.choices,u,e)])),o.pluginDefaults=Object.fromEntries(e.filter(n=>n.defaultOptions?.[o.name]!==void 0).map(n=>[n.name,n.defaultOptions[o.name]])),r.push(o));return{languages:u,options:r}}function*Ko(e,t,u){let r=new Set(e.map(o=>o.value));for(let o of t)if(o.parsers){for(let n of o.parsers)if(!r.has(n)){r.add(n);let a=u.find(i=>i.parsers&&Object.prototype.hasOwnProperty.call(i.parsers,n)),s=o.name;a?.name&&(s+=` (plugin: ${a.name})`),yield{value:n,description:s}}}}function Go(e){let t=[];for(let[u,r]of Object.entries(e)){let o={name:u,...r};Array.isArray(o.default)&&(o.default=b(0,o.default,-1).value),t.push(o)}return t}var zo=Array.prototype.toReversed??function(){return[...this].reverse()},Jo=X("toReversed",function(){if(Array.isArray(this))return zo}),wr=Jo;function Ho(){let e=globalThis,t=e.Deno?.build?.os;return typeof t=="string"?t==="windows":e.navigator?.platform?.startsWith("Win")??e.process?.platform?.startsWith("win")??!1}var Xo=Ho();function Or(e){if(e=e instanceof URL?e:new URL(e),e.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function qo(e){return e=Or(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function Qo(e){e=Or(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return e.hostname!==""&&(t=`\\\\${e.hostname}${t}`),t}function ru(e){return Xo?Qo(e):qo(e)}var Pr=e=>String(e).split(/[/\\]/u).pop(),Ir=e=>String(e).startsWith("file:");function kr(e,t){if(!t)return;let u=Pr(t).toLowerCase();return e.find(({filenames:r})=>r?.some(o=>o.toLowerCase()===u))??e.find(({extensions:r})=>r?.some(o=>u.endsWith(o)))}function Zo(e,t){if(t)return e.find(({name:u})=>u.toLowerCase()===t)??e.find(({aliases:u})=>u?.includes(t))??e.find(({extensions:u})=>u?.includes(`.${t}`))}var ea=void 0;function vr(e,t){if(t){if(Ir(t))try{t=ru(t)}catch{return}if(typeof t=="string")return e.find(({isSupported:u})=>u?.({filepath:t}))}}function ta(e,t){let u=wr(0,e.plugins).flatMap(o=>o.languages??[]);return(Zo(u,t.language)??kr(u,t.physicalFile)??kr(u,t.file)??vr(u,t.physicalFile)??vr(u,t.file)??ea?.(u,t.physicalFile))?.parsers[0]}var st=ta;var ie={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(u=>ie.value(u)).join(", ")}]`;let t=Object.keys(e);return t.length===0?"{}":`{ ${t.map(u=>`${ie.key(u)}: ${ie.value(e[u])}`).join(", ")} }`},pair:({key:e,value:t})=>ie.value({[e]:t})};var nu=new Proxy(String,{get:()=>nu}),$=nu,ou=()=>nu;var Rr=(e,t,{descriptor:u})=>{let r=[`${$.yellow(typeof e=="string"?u.key(e):u.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${$.blue(typeof t=="string"?u.key(t):u.pair(t))}`),r.join("; ")+"."};var Dt=Symbol.for("vnopts.VALUE_NOT_EXIST"),Ae=Symbol.for("vnopts.VALUE_UNCHANGED");var Lr=" ".repeat(2),Yr=(e,t,u)=>{let{text:r,list:o}=u.normalizeExpectedResult(u.schemas[e].expected(u)),n=[];return r&&n.push(Mr(e,t,r,u.descriptor)),o&&n.push([Mr(e,t,o.title,u.descriptor)].concat(o.values.map(a=>jr(a,u.loggerPrintWidth))).join(`
16
+ `)),Ur(n,u.loggerPrintWidth)};function Mr(e,t,u,r){return[`Invalid ${$.red(r.key(e))} value.`,`Expected ${$.blue(u)},`,`but received ${t===Dt?$.gray("nothing"):$.red(r.value(t))}.`].join(" ")}function jr({text:e,list:t},u){let r=[];return e&&r.push(`- ${$.blue(e)}`),t&&r.push([`- ${$.blue(t.title)}:`].concat(t.values.map(o=>jr(o,u-Lr.length).replace(/^|\n/g,`$&${Lr}`))).join(`
17
+ `)),Ur(r,u)}function Ur(e,t){if(e.length===1)return e[0];let[u,r]=e,[o,n]=e.map(a=>a.split(`
18
+ `,1)[0].length);return o>t&&o>n?r:u}var _e=[],au=[];function ct(e,t,u){if(e===t)return 0;let r=u?.maxDistance,o=e;e.length>t.length&&(e=t,t=o);let n=e.length,a=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-a);)n--,a--;let s=0;for(;s<n&&e.charCodeAt(s)===t.charCodeAt(s);)s++;if(n-=s,a-=s,r!==void 0&&a-n>r)return r;if(n===0)return r!==void 0&&a>r?r:a;let i,D,f,l,d=0,c=0;for(;d<n;)au[d]=e.charCodeAt(s+d),_e[d]=++d;for(;c<a;){for(i=t.charCodeAt(s+c),f=c++,D=c,d=0;d<n;d++)l=i===au[d]?f:f+1,f=_e[d],D=_e[d]=f>D?l>D?D+1:l:l>f?f+1:l;if(r!==void 0){let p=D;for(d=0;d<n;d++)_e[d]<p&&(p=_e[d]);if(p>r)return r}}return _e.length=n,au.length=n,r!==void 0&&D>r?r:D}function Wr(e,t,u){if(!Array.isArray(t)||t.length===0)return;let r=u?.maxDistance,o=e.length;for(let i of t)if(i===e)return i;if(r===0)return;let n,a=Number.POSITIVE_INFINITY,s=new Set;for(let i of t){if(s.has(i))continue;s.add(i);let D=Math.abs(i.length-o);if(D>=a||r!==void 0&&D>r)continue;let f=Number.isFinite(a)?r===void 0?a:Math.min(a,r):r,l=f===void 0?ct(e,i):ct(e,i,{maxDistance:f});if(r!==void 0&&l>r)continue;let d=l;if(f!==void 0&&l===f&&f===r&&(d=ct(e,i)),d<a&&(a=d,n=i,a===0))break}if(!(r!==void 0&&a>r))return n}var ft=(e,t,{descriptor:u,logger:r,schemas:o})=>{let n=[`Ignored unknown option ${$.yellow(u.pair({key:e,value:t}))}.`],a=Wr(e,Object.keys(o),{maxDistance:3});a&&n.push(`Did you mean ${$.blue(u.key(a))}?`),r.warn(n.join(" "))};var ua=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function ra(e,t){let u=new e(t),r=Object.create(u);for(let o of ua)o in t&&(r[o]=na(t[o],u,S.prototype[o].length));return r}var S=class{static create(t){return ra(this,t)}constructor(t){this.name=t.name}default(t){}expected(t){return"nothing"}validate(t,u){return!1}deprecated(t,u){return!1}forward(t,u){}redirect(t,u){}overlap(t,u,r){return t}preprocess(t,u){return t}postprocess(t,u){return Ae}};function na(e,t,u){return typeof e=="function"?(...r)=>e(...r.slice(0,u-1),t,...r.slice(u-1)):()=>e}var lt=class extends S{constructor(t){super(t),this._sourceName=t.sourceName}expected(t){return t.schemas[this._sourceName].expected(t)}validate(t,u){return u.schemas[this._sourceName].validate(t,u)}redirect(t,u){return this._sourceName}};var dt=class extends S{expected(){return"anything"}validate(){return!0}};var pt=class extends S{constructor({valueSchema:t,name:u=t.name,...r}){super({...r,name:u}),this._valueSchema=t}expected(t){let{text:u,list:r}=t.normalizeExpectedResult(this._valueSchema.expected(t));return{text:u&&`an array of ${u}`,list:r&&{title:"an array of the following values",values:[{list:r}]}}}validate(t,u){if(!Array.isArray(t))return!1;let r=[];for(let o of t){let n=u.normalizeValidateResult(this._valueSchema.validate(o,u),o);n!==!0&&r.push(n.value)}return r.length===0?!0:{value:r}}deprecated(t,u){let r=[];for(let o of t){let n=u.normalizeDeprecatedResult(this._valueSchema.deprecated(o,u),o);n!==!1&&r.push(...n.map(({value:a})=>({value:[a]})))}return r}forward(t,u){let r=[];for(let o of t){let n=u.normalizeForwardResult(this._valueSchema.forward(o,u),o);r.push(...n.map($r))}return r}redirect(t,u){let r=[],o=[];for(let n of t){let a=u.normalizeRedirectResult(this._valueSchema.redirect(n,u),n);"remain"in a&&r.push(a.remain),o.push(...a.redirect.map($r))}return r.length===0?{redirect:o}:{redirect:o,remain:r}}overlap(t,u){return t.concat(u)}};function $r({from:e,to:t}){return{from:[e],to:t}}var Ft=class extends S{expected(){return"true or false"}validate(t){return typeof t=="boolean"}};function Kr(e,t){let u=Object.create(null);for(let r of e){let o=r[t];if(u[o])throw new Error(`Duplicate ${t} ${JSON.stringify(o)}`);u[o]=r}return u}function Gr(e,t){let u=new Map;for(let r of e){let o=r[t];if(u.has(o))throw new Error(`Duplicate ${t} ${JSON.stringify(o)}`);u.set(o,r)}return u}function zr(){let e=Object.create(null);return t=>{let u=JSON.stringify(t);return e[u]?!0:(e[u]=!0,!1)}}function Jr(e,t){let u=[],r=[];for(let o of e)t(o)?u.push(o):r.push(o);return[u,r]}function Hr(e){return e===Math.floor(e)}function Xr(e,t){if(e===t)return 0;let u=typeof e,r=typeof t,o=["undefined","object","boolean","number","string"];return u!==r?o.indexOf(u)-o.indexOf(r):u!=="string"?Number(e)-Number(t):e.localeCompare(t)}function qr(e){return(...t)=>{let u=e(...t);return typeof u=="string"?new Error(u):u}}function iu(e){return e===void 0?{}:e}function su(e){if(typeof e=="string")return{text:e};let{text:t,list:u}=e;return oa((t||u)!==void 0,"Unexpected `expected` result, there should be at least one field."),u?{text:t,list:{title:u.title,values:u.values.map(su)}}:{text:t}}function Du(e,t){return e===!0?!0:e===!1?{value:t}:e}function cu(e,t,u=!1){return e===!1?!1:e===!0?u?!0:[{value:t}]:"value"in e?[e]:e.length===0?!1:e}function Vr(e,t){return typeof e=="string"||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function mt(e,t){return e===void 0?[]:Array.isArray(e)?e.map(u=>Vr(u,t)):[Vr(e,t)]}function fu(e,t){let u=mt(typeof e=="object"&&"redirect"in e?e.redirect:e,t);return u.length===0?{remain:t,redirect:u}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:u}:{redirect:u}}function oa(e,t){if(!e)throw new Error(t)}var Et=class extends S{constructor(t){super(t),this._choices=Gr(t.choices.map(u=>u&&typeof u=="object"?u:{value:u}),"value")}expected({descriptor:t}){let u=Array.from(this._choices.keys()).map(a=>this._choices.get(a)).filter(({hidden:a})=>!a).map(a=>a.value).sort(Xr).map(t.value),r=u.slice(0,-2),o=u.slice(-2);return{text:r.concat(o.join(" or ")).join(", "),list:{title:"one of the following values",values:u}}}validate(t){return this._choices.has(t)}deprecated(t){let u=this._choices.get(t);return u&&u.deprecated?{value:t}:!1}forward(t){let u=this._choices.get(t);return u?u.forward:void 0}redirect(t){let u=this._choices.get(t);return u?u.redirect:void 0}};var Ct=class extends S{expected(){return"a number"}validate(t,u){return typeof t=="number"}};var ht=class extends Ct{expected(){return"an integer"}validate(t,u){return u.normalizeValidateResult(super.validate(t,u),t)===!0&&Hr(t)}};var je=class extends S{expected(){return"a string"}validate(t){return typeof t=="string"}};var Qr=ie,Zr=ft,en=Yr,tn=Rr;var gt=class{constructor(t,u){let{logger:r=console,loggerPrintWidth:o=80,descriptor:n=Qr,unknown:a=Zr,invalid:s=en,deprecated:i=tn,missing:D=()=>!1,required:f=()=>!1,preprocess:l=c=>c,postprocess:d=()=>Ae}=u||{};this._utils={descriptor:n,logger:r||{warn:()=>{}},loggerPrintWidth:o,schemas:Kr(t,"name"),normalizeDefaultResult:iu,normalizeExpectedResult:su,normalizeDeprecatedResult:cu,normalizeForwardResult:mt,normalizeRedirectResult:fu,normalizeValidateResult:Du},this._unknownHandler=a,this._invalidHandler=qr(s),this._deprecatedHandler=i,this._identifyMissing=(c,p)=>!(c in p)||D(c,p),this._identifyRequired=f,this._preprocess=l,this._postprocess=d,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=zr()}normalize(t){let u={},o=[this._preprocess(t,this._utils)],n=()=>{for(;o.length!==0;){let a=o.shift(),s=this._applyNormalization(a,u);o.push(...s)}};n();for(let a of Object.keys(this._utils.schemas)){let s=this._utils.schemas[a];if(!(a in u)){let i=iu(s.default(this._utils));"value"in i&&o.push({[a]:i.value})}}n();for(let a of Object.keys(this._utils.schemas)){if(!(a in u))continue;let s=this._utils.schemas[a],i=u[a],D=s.postprocess(i,this._utils);D!==Ae&&(this._applyValidation(D,a,s),u[a]=D)}return this._applyPostprocess(u),this._applyRequiredCheck(u),u}_applyNormalization(t,u){let r=[],{knownKeys:o,unknownKeys:n}=this._partitionOptionKeys(t);for(let a of o){let s=this._utils.schemas[a],i=s.preprocess(t[a],this._utils);this._applyValidation(i,a,s);let D=({from:c,to:p})=>{r.push(typeof p=="string"?{[p]:c}:{[p.key]:p.value})},f=({value:c,redirectTo:p})=>{let F=cu(s.deprecated(c,this._utils),i,!0);if(F!==!1)if(F===!0)this._hasDeprecationWarned(a)||this._utils.logger.warn(this._deprecatedHandler(a,p,this._utils));else for(let{value:C}of F){let y={key:a,value:C};if(!this._hasDeprecationWarned(y)){let m=typeof p=="string"?{key:p,value:C}:p;this._utils.logger.warn(this._deprecatedHandler(y,m,this._utils))}}};mt(s.forward(i,this._utils),i).forEach(D);let d=fu(s.redirect(i,this._utils),i);if(d.redirect.forEach(D),"remain"in d){let c=d.remain;u[a]=a in u?s.overlap(u[a],c,this._utils):c,f({value:c})}for(let{from:c,to:p}of d.redirect)f({value:c,redirectTo:p})}for(let a of n){let s=t[a];this._applyUnknownHandler(a,s,u,(i,D)=>{r.push({[i]:D})})}return r}_applyRequiredCheck(t){for(let u of Object.keys(this._utils.schemas))if(this._identifyMissing(u,t)&&this._identifyRequired(u))throw this._invalidHandler(u,Dt,this._utils)}_partitionOptionKeys(t){let[u,r]=Jr(Object.keys(t).filter(o=>!this._identifyMissing(o,t)),o=>o in this._utils.schemas);return{knownKeys:u,unknownKeys:r}}_applyValidation(t,u,r){let o=Du(r.validate(t,this._utils),t);if(o!==!0)throw this._invalidHandler(u,o.value,this._utils)}_applyUnknownHandler(t,u,r,o){let n=this._unknownHandler(t,u,this._utils);if(n)for(let a of Object.keys(n)){if(this._identifyMissing(a,n))continue;let s=n[a];a in this._utils.schemas?o(a,s):r[a]=s}}_applyPostprocess(t){let u=this._postprocess(t,this._utils);if(u!==Ae){if(u.delete)for(let r of u.delete)delete t[r];if(u.override){let{knownKeys:r,unknownKeys:o}=this._partitionOptionKeys(u.override);for(let n of r){let a=u.override[n];this._applyValidation(a,n,this._utils.schemas[n]),t[n]=a}for(let n of o){let a=u.override[n];this._applyUnknownHandler(n,a,t,(s,i)=>{let D=this._utils.schemas[s];this._applyValidation(i,s,D),t[s]=i})}}}}};var lu;function ia(e,t,{logger:u=!1,isCLI:r=!1,passThrough:o=!1,FlagSchema:n,descriptor:a}={}){if(r){if(!n)throw new Error("'FlagSchema' option is required.");if(!a)throw new Error("'descriptor' option is required.")}else a=ie;let s=o?Array.isArray(o)?(d,c)=>o.includes(d)?{[d]:c}:void 0:(d,c)=>({[d]:c}):(d,c,p)=>{let{_:F,...C}=p.schemas;return ft(d,c,{...p,schemas:C})},i=sa(t,{isCLI:r,FlagSchema:n}),D=new gt(i,{logger:u,unknown:s,descriptor:a}),f=u!==!1;f&&lu&&(D._hasDeprecationWarned=lu);let l=D.normalize(e);return f&&(lu=D._hasDeprecationWarned),l}function sa(e,{isCLI:t,FlagSchema:u}){let r=[];t&&r.push(dt.create({name:"_"}));for(let o of e)r.push(Da(o,{isCLI:t,optionInfos:e,FlagSchema:u})),o.alias&&t&&r.push(lt.create({name:o.alias,sourceName:o.name}));return r}function Da(e,{isCLI:t,optionInfos:u,FlagSchema:r}){let{name:o}=e,n={name:o},a,s={};switch(e.type){case"int":a=ht,t&&(n.preprocess=Number);break;case"string":a=je;break;case"choice":a=Et,n.choices=e.choices.map(i=>i?.redirect?{...i,redirect:{to:{key:e.name,value:i.redirect}}}:i);break;case"boolean":a=Ft;break;case"flag":a=r,n.flags=u.flatMap(i=>[i.alias,i.description&&i.name,i.oppositeDescription&&`no-${i.name}`].filter(Boolean));break;case"path":a=je;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?n.validate=(i,D,f)=>e.exception(i)||D.validate(i,f):n.validate=(i,D,f)=>i===void 0||D.validate(i,f),e.redirect&&(s.redirect=i=>i?{to:typeof e.redirect=="string"?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(s.deprecated=!0),t&&!e.array){let i=n.preprocess||(D=>D);n.preprocess=(D,f,l)=>f.preprocess(i(Array.isArray(D)?b(0,D,-1):D),l)}return e.array?pt.create({...t?{preprocess:i=>Array.isArray(i)?i:[i]}:{},...s,valueSchema:a.create(n)}):a.create({...n,...s})}var un=ia;var ca=Array.prototype.findLast??function(e){for(let t=this.length-1;t>=0;t--){let u=this[t];if(e(u,t,this))return u}},fa=X("findLast",function(){if(Array.isArray(this))return ca}),du=fa;var rn=Symbol.for("PRETTIER_IS_FRONT_MATTER"),pu=[];function la(e){return!!e?.[rn]}var de=la;var nn=new Set(["yaml","toml"]),Ue=({node:e})=>de(e)&&nn.has(e.language);async function Fu(e,t,u,r){let{node:o}=u,{language:n}=o;if(!nn.has(n))return;let a=o.value.trim(),s;if(a){let i=n==="yaml"?n:st(r,{language:n});if(!i)return;s=a?await e(a,{parser:i}):""}else s=a;return et([o.startDelimiter,o.explicitLanguage??"",V,s,s?V:"",o.endDelimiter])}function da(e,t){return Ue({node:e})&&(delete t.end,delete t.raw,delete t.value),t}var mu=da;function pa({node:e}){return e.raw}var Eu=pa;var on=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),Fa=e=>Object.keys(e).filter(t=>!on.has(t));function ma(e,t){let u=e?r=>e(r,on):Fa;return t?new Proxy(u,{apply:(r,o,n)=>de(n[0])?pu:Reflect.apply(r,o,n)}):u}var Cu=ma;function gu(e,t){if(!t)throw new Error("parserName is required.");let u=du(0,e,o=>o.parsers&&Object.prototype.hasOwnProperty.call(o.parsers,t));if(u)return u;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Me(r)}function an(e,t){if(!t)throw new Error("astFormat is required.");let u=du(0,e,o=>o.printers&&Object.prototype.hasOwnProperty.call(o.printers,t));if(u)return u;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Me(r)}function We({plugins:e,parser:t}){let u=gu(e,t);return yu(u,t)}function yu(e,t){let u=e.parsers[t];return typeof u=="function"?u():u}async function sn(e,t){let u=e.printers[t],r=typeof u=="function"?await u():u;return Ea(r)}var hu=new WeakMap,q0=Symbol("PRINTER_NORMALIZED_MARK");function Ea(e){if(hu.has(e))return hu.get(e);let{features:t,getVisitorKeys:u,embed:r,massageAstNode:o,print:n,...a}=e;t=ya(t);let s=t.experimental_frontMatterSupport;u=Cu(u,s.massageAstNode||s.embed||s.print);let i=o;o&&s.massageAstNode&&(i=new Proxy(o,{apply(d,c,p){return mu(...p),Reflect.apply(d,c,p)}}));let D=r;if(r){let d;D=new Proxy(r,{get(c,p,F){return p==="getVisitorKeys"?(d??(d=r.getVisitorKeys?Cu(r.getVisitorKeys,s.massageAstNode||s.embed):u),d):Reflect.get(c,p,F)},apply:(c,p,F)=>s.embed&&Ue(...F)?Fu:Reflect.apply(c,p,F)})}let f=n;s.print&&(f=new Proxy(n,{apply(d,c,p){let[F]=p;return de(F.node)?Eu(F):Reflect.apply(d,c,p)}}));let l={features:t,getVisitorKeys:u,embed:D,massageAstNode:i,print:f,...a};return hu.set(e,l),l}var Ca=["clean","embed","print"],ha=Object.fromEntries(Ca.map(e=>[e,!1]));function ga(e){return{...ha,...e}}function ya(e){return{experimental_avoidAstMutation:!1,...e,experimental_frontMatterSupport:ga(e?.experimental_frontMatterSupport)}}var Dn={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null,getVisitorKeys:null};async function ba(e,t={}){let u={...e};if(!u.parser)if(u.filepath){if(u.parser=st(u,{physicalFile:u.filepath}),!u.parser)throw new Ye(`No parser could be inferred for file "${u.filepath}".`)}else throw new Ye("No parser and no file path given, couldn't infer a parser.");let r=it({plugins:e.plugins,showDeprecated:!0}).options,o={...Dn,...Object.fromEntries(r.filter(l=>l.default!==void 0).map(l=>[l.name,l.default]))},n=gu(u.plugins,u.parser),a=await yu(n,u.parser);u.astFormat=a.astFormat,u.locEnd=a.locEnd,u.locStart=a.locStart;let s=n.printers?.[a.astFormat]?n:an(u.plugins,a.astFormat),i=await sn(s,a.astFormat);u.printer=i,u.getVisitorKeys=i.getVisitorKeys;let D=s.defaultOptions?Object.fromEntries(Object.entries(s.defaultOptions).filter(([,l])=>l!==void 0)):{},f={...o,...D};for(let[l,d]of Object.entries(f))(u[l]===null||u[l]===void 0)&&(u[l]=d);return u.parser==="json"&&(u.trailingComma="none"),un(u,r,{passThrough:Object.keys(Dn),...t})}var se=ba;var pf=ao(dn(),1);var Au="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",pn="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",af=new RegExp("["+Au+"]"),sf=new RegExp("["+Au+pn+"]");Au=pn=null;var _u={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},Df=new Set(_u.keyword),cf=new Set(_u.strict),ff=new Set(_u.strictBind);var It=(e,t)=>u=>e(t(u));function mn(e){return{keyword:e.cyan,capitalized:e.yellow,jsxIdentifier:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.gray,invalid:It(It(e.white,e.bgRed),e.bold),gutter:e.gray,marker:It(e.red,e.bold),message:It(e.red,e.bold),reset:e.reset}}var hf=mn(ou(!0)),gf=mn(ou(!1));function _a(){return new Proxy({},{get:()=>e=>e})}var Fn=/\r\n|[\n\r\u2028\u2029]/;function xa(e,t,u){let r=Object.assign({column:0,line:-1},e.start),o=Object.assign({},r,e.end),{linesAbove:n=2,linesBelow:a=3}=u||{},s=r.line,i=r.column,D=o.line,f=o.column,l=Math.max(s-(n+1),0),d=Math.min(t.length,D+a);s===-1&&(l=0),D===-1&&(d=t.length);let c=D-s,p={};if(c)for(let F=0;F<=c;F++){let C=F+s;if(!i)p[C]=!0;else if(F===0){let y=t[C-1].length;p[C]=[i,y-i+1]}else if(F===c)p[C]=[0,f];else{let y=t[C-F].length;p[C]=[0,y]}}else i===f?i?p[s]=[i,0]:p[s]=!0:p[s]=[i,f-i];return{start:l,end:d,markerLines:p}}function En(e,t,u={}){let o=_a(!1),n=e.split(Fn),{start:a,end:s,markerLines:i}=xa(t,n,u),D=t.start&&typeof t.start.column=="number",f=String(s).length,d=e.split(Fn,s).slice(a,s).map((c,p)=>{let F=a+1+p,y=` ${` ${F}`.slice(-f)} |`,m=i[F],h=!i[F+1];if(m){let E="";if(Array.isArray(m)){let g=c.slice(0,Math.max(m[0]-1,0)).replace(/[^\t]/g," "),A=m[1]||1;E=[`
19
+ `,o.gutter(y.replace(/\d/g," "))," ",g,o.marker("^").repeat(A)].join(""),h&&u.message&&(E+=" "+o.message(u.message))}return[o.marker(">"),o.gutter(y),c.length>0?` ${c}`:"",E].join("")}else return` ${o.gutter(y)}${c.length>0?` ${c}`:""}`}).join(`
20
+ `);return u.message&&!D&&(d=`${" ".repeat(f+1)}${u.message}
21
+ ${d}`),d}async function Ba(e,t){let u=await We(t),r=u.preprocess?await u.preprocess(e,t):e;t.originalText=r;let o;try{o=await u.parse(r,t,t)}catch(n){Ta(n,e)}return{text:r,ast:o}}function Ta(e,t){let{loc:u}=e;if(u){let r=En(t,u,{highlightCode:!0});throw e.message+=`
22
+ `+r,e.codeFrame=r,e}throw e}var Fe=Ba;async function Cn(e,t,u,r,o){if(u.embeddedLanguageFormatting!=="auto")return;let{printer:n}=u,{embed:a}=n;if(!a)return;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");let{hasPrettierIgnore:s}=n,{getVisitorKeys:i}=a,D=[];d();let f=e.stack;for(let{print:c,node:p,pathStack:F}of D)try{e.stack=F;let C=await c(l,t,e,u);C&&o.set(p,C)}catch(C){if(globalThis.PRETTIER_DEBUG)throw C}e.stack=f;function l(c,p){return Na(c,p,u,r)}function d(){let{node:c}=e;if(c===null||typeof c!="object"||s?.(e))return;for(let F of i(c))Array.isArray(c[F])?e.each(d,F):e.call(d,F);let p=a(e,u);if(p){if(typeof p=="function"){D.push({print:p,node:c,pathStack:[...e.stack]});return}o.set(c,p)}}}async function Na(e,t,u,r){let o=await se({...u,...t,parentParser:u.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:n}=await Fe(e,o),a=await r(n,o);return qe(a)}function Sa(e,t,u,r){let{originalText:o,[Symbol.for("comments")]:n,locStart:a,locEnd:s,[Symbol.for("printedComments")]:i}=t,{node:D}=e,f=a(D),l=s(D);for(let c of n)a(c)>=f&&s(c)<=l&&i.add(c);let{printPrettierIgnored:d}=t.printer;return d?d(e,t,u,r):o.slice(f,l)}var hn=Sa;async function Ge(e,t){({ast:e}=await xu(e,t));let u=new Map,r=new pr(e),o=Nr(t),n=new Map;await Cn(r,s,t,Ge,n);let a=await gn(r,t,s,void 0,n);if(Tr(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[ee,a];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[a,ee]}return a;function s(D,f){return D===void 0||D===r?i(f):Array.isArray(D)?r.call(()=>i(f),...D):r.call(()=>i(f),D)}function i(D){o(r);let f=r.node;if(f==null)return"";let l=ge(f)&&D===void 0;if(l&&u.has(f))return u.get(f);let d=gn(r,t,s,D,n);return l&&u.set(f,d),d}}function gn(e,t,u,r,o){let{node:n}=e,{printer:a}=t,s;switch(a.hasPrettierIgnore?.(e)?s=hn(e,t,u,r):o.has(n)?s=o.get(n):s=a.print(e,t,u,r),n){case t.cursorNode:s=Ee(s,i=>[ee,i,ee]);break;case t.nodeBeforeCursor:s=Ee(s,i=>[i,ee]);break;case t.nodeAfterCursor:s=Ee(s,i=>[ee,i]);break}return a.printComment&&!a.willPrintOwnComments?.(e,t)&&(s=Br(e,s,t)),s}async function xu(e,t){let u=e.comments??[];t[Symbol.for("comments")]=u,t[Symbol.for("printedComments")]=new Set,Ar(e,t);let{printer:{preprocess:r}}=t;return e=r?await r(e,t):e,{ast:e,comments:u}}function wa(e,t){let{cursorOffset:u,locStart:r,locEnd:o,getVisitorKeys:n}=t,a=c=>r(c)<=u&&o(c)>=u,s=e,i=[e];for(let c of Cr(e,{getVisitorKeys:n,filter:a}))i.push(c),s=c;if(hr(s,{getVisitorKeys:n}))return{cursorNode:s};let D,f,l=-1,d=Number.POSITIVE_INFINITY;for(;i.length>0&&(D===void 0||f===void 0);){s=i.pop();let c=D!==void 0,p=f!==void 0;for(let F of be(s,{getVisitorKeys:n})){if(!c){let C=o(F);C<=u&&C>l&&(D=F,l=C)}if(!p){let C=r(F);C>=u&&C<d&&(f=F,d=C)}}}return{nodeBeforeCursor:D,nodeAfterCursor:f}}var Bu=wa;function Oa(e,t){let{printer:u}=t,r=u.massageAstNode;if(!r)return e;let{getVisitorKeys:o}=u,{ignoredProperties:n}=r;return a(e);function a(s,i){if(!ge(s))return s;if(Array.isArray(s))return s.map(d=>a(d,i)).filter(Boolean);let D={},f=new Set(o(s));for(let d in s)!Object.prototype.hasOwnProperty.call(s,d)||n?.has(d)||(f.has(d)?D[d]=a(s[d],s):D[d]=s[d]);let l=r(s,D,i);if(l!==null)return l??D}}var yn=Oa;var Pa=Array.prototype.findLastIndex??function(e){for(let t=this.length-1;t>=0;t--){let u=this[t];if(e(u,t,this))return t}return-1},Ia=X("findLastIndex",function(){if(Array.isArray(this))return Pa}),bn=Ia;var ka=({parser:e})=>e==="json"||e==="json5"||e==="jsonc"||e==="json-stringify";function va(e,t){return t=new Set(t),e.find(u=>xn.has(u.type)&&t.has(u))}function An(e){let t=bn(0,e,u=>u.type!=="Program"&&u.type!=="File");return t===-1?e:e.slice(0,t+1)}function Ra(e,t,{locStart:u,locEnd:r}){let[o,...n]=e,[a,...s]=t;if(o===a)return[o,a];let i=u(o);for(let f of An(s))if(u(f)>=i)a=f;else break;let D=r(a);for(let f of An(n)){if(r(f)<=D)o=f;else break;if(o===a)break}return[o,a]}function Tu(e,t,u,r,o=[],n){let{locStart:a,locEnd:s}=u,i=a(e),D=s(e);if(t>D||t<i||n==="rangeEnd"&&t===i||n==="rangeStart"&&t===D)return;let f=[e,...o],l=at(e,f,{cache:uu,locStart:a,locEnd:s,getVisitorKeys:u.getVisitorKeys,filter:u.printer.canAttachComment,getChildren:u.printer.getCommentChildNodes});for(let d of l){let c=Tu(d,t,u,r,f,n);if(c)return c}if(r(e,o[0]))return f}function La(e,t){return t!=="DeclareExportDeclaration"&&e!=="TypeParameterDeclaration"&&(e==="Directive"||e==="TypeAlias"||e==="TSExportAssignment"||e.startsWith("Declare")||e.startsWith("TSDeclare")||e.endsWith("Statement")||e.endsWith("Declaration"))}var xn=new Set(["JsonRoot","ObjectExpression","ArrayExpression","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","UnaryExpression","TemplateLiteral"]),Ma=new Set(["OperationDefinition","FragmentDefinition","VariableDefinition","TypeExtensionDefinition","ObjectTypeDefinition","FieldDefinition","DirectiveDefinition","EnumTypeDefinition","EnumValueDefinition","InputValueDefinition","InputObjectTypeDefinition","SchemaDefinition","OperationTypeDefinition","InterfaceTypeDefinition","UnionTypeDefinition","ScalarTypeDefinition"]);function _n(e,t,u){if(!t)return!1;switch(e.parser){case"flow":case"hermes":case"babel":case"babel-flow":case"babel-ts":case"typescript":case"acorn":case"espree":case"meriyah":case"oxc":case"oxc-ts":case"__babel_estree":return La(t.type,u?.type);case"json":case"json5":case"jsonc":case"json-stringify":return xn.has(t.type);case"graphql":return Ma.has(t.kind);case"vue":return t.tag!=="root"}return!1}function Bn(e,t,u){let{rangeStart:r,rangeEnd:o,locStart:n,locEnd:a}=t;P(o>r);let s=e.slice(r,o).search(/\S/u),i=s===-1;if(!i)for(r+=s;o>r&&!/\S/u.test(e[o-1]);--o);let D=Tu(u,r,t,(c,p)=>_n(t,c,p),[],"rangeStart");if(!D)return;let f=i?D:Tu(u,o,t,c=>_n(t,c),[],"rangeEnd");if(!f)return;let l,d;if(ka(t)){let c=va(D,f);l=c,d=c}else[l,d]=Ra(D,f,t);return[Math.min(n(l),n(d)),Math.max(a(l),a(d))]}var wn="\uFEFF",Tn=Symbol("cursor");async function On(e,t,u=0){if(!e||e.trim().length===0)return{formatted:"",cursorOffset:-1,comments:[]};let{ast:r,text:o}=await Fe(e,t);t.cursorOffset>=0&&(t={...t,...Bu(r,t)});let n=await Ge(r,t,u);u>0&&(n=tt([V,n],u,t.tabWidth));let a=Ce(n,t);if(u>0){let i=a.formatted.trim();a.cursorNodeStart!==void 0&&(a.cursorNodeStart-=a.formatted.indexOf(i),a.cursorNodeStart<0&&(a.cursorNodeStart=0,a.cursorNodeText=a.cursorNodeText.trimStart()),a.cursorNodeStart+a.cursorNodeText.length>i.length&&(a.cursorNodeText=a.cursorNodeText.trimEnd())),a.formatted=i+Se(t.endOfLine)}let s=t[Symbol.for("comments")];if(t.cursorOffset>=0){let i,D,f,l;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&a.cursorNodeText)if(f=a.cursorNodeStart,l=a.cursorNodeText,t.cursorNode)i=t.locStart(t.cursorNode),D=o.slice(i,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");i=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let y=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):o.length;D=o.slice(i,y)}else i=0,D=o,f=0,l=a.formatted;let d=t.cursorOffset-i;if(D===l)return{formatted:a.formatted,cursorOffset:f+d,comments:s};let c=D.split("");c.splice(d,0,Tn);let p=l.split(""),F=Ut(c,p),C=f;for(let y of F)if(y.removed){if(y.value.includes(Tn))break}else C+=y.count;return{formatted:a.formatted,cursorOffset:C,comments:s}}return{formatted:a.formatted,cursorOffset:-1,comments:s}}async function Ya(e,t){let{ast:u,text:r}=await Fe(e,t),[o,n]=Bn(r,t,u)??[0,0],a=r.slice(o,n),s=Math.min(o,r.lastIndexOf(`
23
+ `,o)+1),i=r.slice(s,o).match(/^\s*/u)[0],D=he(i,t.tabWidth),f=await On(a,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>o&&t.cursorOffset<=n?t.cursorOffset-o:-1,endOfLine:"lf"},D),l=f.formatted.trimEnd(),{cursorOffset:d}=t;d>n?d+=l.length-a.length:f.cursorOffset>=0&&(d=f.cursorOffset+o);let c=r.slice(0,o)+l+r.slice(n);if(t.endOfLine!=="lf"){let p=Se(t.endOfLine);d>=0&&p===`\r
24
+ `&&(d+=$t(c.slice(0,d),`
25
+ `)),c=oe(0,c,`
26
+ `,p)}return{formatted:c,cursorOffset:d,comments:f.comments}}function Nu(e,t,u){return typeof t!="number"||Number.isNaN(t)||t<0||t>e.length?u:t}function Nn(e,t){let{cursorOffset:u,rangeStart:r,rangeEnd:o}=t;return u=Nu(e,u,-1),r=Nu(e,r,0),o=Nu(e,o,e.length),{...t,cursorOffset:u,rangeStart:r,rangeEnd:o}}function Pn(e,t){let{cursorOffset:u,rangeStart:r,rangeEnd:o,endOfLine:n}=Nn(e,t),a=e.charAt(0)===wn;if(a&&(e=e.slice(1),u--,r--,o--),n==="auto"&&(n=Yu(e)),e.includes("\r")){let s=i=>$t(e.slice(0,Math.max(i,0)),`\r
27
+ `);u-=s(u),r-=s(r),o-=s(o),e=ju(e)}return{hasBOM:a,text:e,options:Nn(e,{...t,cursorOffset:u,rangeStart:r,rangeEnd:o,endOfLine:n})}}async function Sn(e,t){let u=await We(t);return!u.hasPragma||u.hasPragma(e)}async function ja(e,t){return(await We(t)).hasIgnorePragma?.(e)}async function Su(e,t){let{hasBOM:u,text:r,options:o}=Pn(e,await se(t));if(o.rangeStart>=o.rangeEnd&&r!==""||o.requirePragma&&!await Sn(r,o)||o.checkIgnorePragma&&await ja(r,o))return{formatted:e,cursorOffset:t.cursorOffset,comments:[]};let n;return o.rangeStart>0||o.rangeEnd<r.length?n=await Ya(r,o):(!o.requirePragma&&o.insertPragma&&o.printer.insertPragma&&!await Sn(r,o)&&(r=o.printer.insertPragma(r)),n=await On(r,o)),u&&(n.formatted=wn+n.formatted,n.cursorOffset>=0&&n.cursorOffset++),n}async function In(e,t,u){let{text:r,options:o}=Pn(e,await se(t)),n=await Fe(r,o);return u&&(u.preprocessForPrint&&(n.ast=await xu(n.ast,o)),u.massage&&(n.ast=yn(n.ast,o))),n}async function kn(e,t){t=await se(t);let u=await Ge(e,t);return Ce(u,t)}async function vn(e,t){let u=sr(e),{formatted:r}=await Su(u,{...t,parser:"__js_expression"});return r}async function Rn(e,t){t=await se(t);let{ast:u}=await Fe(e,t);return t.cursorOffset>=0&&(t={...t,...Bu(u,t)}),Ge(u,t)}async function Ln(e,t){return Ce(e,await se(t))}var wu={};Yt(wu,{builders:()=>Wa,printer:()=>$a,utils:()=>Va});var Wa={join:Ie,line:ut,softline:or,hardline:V,literalline:Qe,group:Kt,conditionalGroup:tr,fill:er,lineSuffix:ve,lineSuffixBoundary:ar,cursor:ee,breakParent:ce,ifBreak:ur,trim:ir,indent:ae,indentIfBreak:rr,align:De,addAlignmentToDoc:tt,markAsRoot:et,dedentToRoot:Qu,dedent:Zu,hardlineWithoutBreakParent:ke,literallineWithoutBreakParent:Gt,label:nr,concat:e=>e},$a={printDocToString:Ce},Va={willBreak:Ku,traverseDoc:we,findInDoc:Xe,mapDoc:Pe,removeLines:zu,stripTrailingHardline:qe,replaceEndOfLine:Ju,canBreak:Hu};var Mn="3.8.4";var Pu={};Yt(Pu,{addDanglingComment:()=>ue,addLeadingComment:()=>fe,addTrailingComment:()=>le,getAlignmentSize:()=>he,getIndentSize:()=>Yn,getMaxContinuousCount:()=>jn,getNextNonSpaceNonCommentCharacter:()=>Un,getNextNonSpaceNonCommentCharacterIndex:()=>ni,getPreferredQuote:()=>Vn,getStringWidth:()=>Re,hasNewline:()=>z,hasNewlineInRange:()=>Kn,hasSpaces:()=>Gn,isNextLineEmpty:()=>Di,isNextLineEmptyAfterIndex:()=>kt,isPreviousLineEmpty:()=>ai,makeString:()=>si,skip:()=>ye,skipEverythingButNewLine:()=>ot,skipInlineComment:()=>xe,skipNewline:()=>K,skipSpaces:()=>Y,skipToLineEnd:()=>nt,skipTrailingComment:()=>Be,skipWhitespace:()=>Fr});function Ka(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let u=t+2;u<e.length;++u)if(e.charAt(u)==="*"&&e.charAt(u+1)==="/")return u+2}return t}var xe=Ka;function Ga(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?ot(e,t):t}var Be=Ga;function za(e,t){let u=null,r=t;for(;r!==u;)u=r,r=Y(e,r),r=xe(e,r),r=Be(e,r),r=K(e,r);return r}var ze=za;function Ja(e,t){let u=null,r=t;for(;r!==u;)u=r,r=nt(e,r),r=xe(e,r),r=Y(e,r);return r=Be(e,r),r=K(e,r),r!==!1&&z(e,r)}var kt=Ja;function Ha(e,t){let u=e.lastIndexOf(`
28
+ `);return u===-1?0:he(e.slice(u+1).match(/^[\t ]*/u)[0],t)}var Yn=Ha;function Ou(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Xa(e,t){let u=e.matchAll(new RegExp(`(?:${Ou(t)})+`,"gu"));return u.reduce||(u=[...u]),u.reduce((r,[o])=>Math.max(r,o.length),0)/t.length}var jn=Xa;function qa(e,t){let u=ze(e,t);return u===!1?"":e.charAt(u)}var Un=qa;var Wn=Object.freeze({character:"'",codePoint:39}),$n=Object.freeze({character:'"',codePoint:34}),Qa=Object.freeze({preferred:Wn,alternate:$n}),Za=Object.freeze({preferred:$n,alternate:Wn});function ei(e,t){let{preferred:u,alternate:r}=t===!0||t==="'"?Qa:Za,{length:o}=e,n=0,a=0;for(let s=0;s<o;s++){let i=e.charCodeAt(s);i===u.codePoint?n++:i===r.codePoint&&a++}return(n>a?r:u).character}var Vn=ei;function ti(e,t,u){for(let r=t;r<u;++r)if(e.charAt(r)===`
29
+ `)return!0;return!1}var Kn=ti;function ui(e,t,u={}){return Y(e,u.backwards?t-1:t,u)!==t}var Gn=ui;function ri(e,t,u){return ze(e,u(t))}function ni(e,t){return arguments.length===2||typeof t=="number"?ze(e,t):ri(...arguments)}function oi(e,t,u){return Le(e,u(t))}function ai(e,t){return arguments.length===2||typeof t=="number"?Le(e,t):oi(...arguments)}function ii(e,t,u){return kt(e,u(t))}function si(e,t,u){let r=t==='"'?"'":'"',n=oe(0,e,/\\(.)|(["'])/gsu,(a,s,i)=>s===r?s:i===t?"\\"+i:i||(u&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(s)?s:"\\"+s));return t+n+t}function Di(e,t){return arguments.length===2||typeof t=="number"?kt(e,t):ii(...arguments)}function me(e,t=1){return async(...u)=>{let r=u[t]??{},o=r.plugins??[];return u[t]={...r,plugins:Array.isArray(o)?o:Object.values(o)},e(...u)}}var zn=me(Su);async function Jn(e,t){let{formatted:u}=await zn(e,{...t,cursorOffset:-1});return u}async function ci(e,t){return await Jn(e,t)===e}var fi=me(it,0),li={parse:me(In),formatAST:me(kn),formatDoc:me(vn),printToDoc:me(Rn),printDocToString:me(Ln)};export{li as __debug,ci as check,Hn as default,wu as doc,Jn as format,zn as formatWithCursor,fi as getSupportInfo,Pu as util,Mn as version};