eddyter 1.3.62 → 1.3.64

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 (36) hide show
  1. package/LICENSE +24 -24
  2. package/README.md +493 -493
  3. package/dist/ImageResizer-CbtUYHip.js +199 -0
  4. package/dist/api/auth.d.ts +4 -2
  5. package/dist/assets/style.css +1 -0
  6. package/dist/{babel-B9hn44Wo.js → babel-CCPWkrf4.js} +1302 -726
  7. package/dist/components/LockedFeature/LockedFeature.d.ts +23 -0
  8. package/dist/components/LockedFeature/index.d.ts +2 -0
  9. package/dist/components/UnifiedColorPicker/UnifiedColorPicker.d.ts +14 -0
  10. package/dist/components/VideoView/index.d.ts +13 -0
  11. package/dist/constants.d.ts +3 -1
  12. package/dist/editorConfig.d.ts +2 -3
  13. package/dist/{estree-CocPn_Md.js → estree-CxUPh9wa.js} +917 -529
  14. package/dist/{html-CxCicOef.js → html-CmniStvG.js} +589 -350
  15. package/dist/{html2pdf.bundle-DNyY_rJA.js → html2pdf.bundle-C1B1lr_T.js} +3796 -2777
  16. package/dist/{html2pdf.bundle.min-GfQzEXnM.js → html2pdf.bundle.min-kPviTsNx.js} +5223 -3407
  17. package/dist/index-BL8HWCRw.js +816 -0
  18. package/dist/index-BpsoOKOs.js +274 -0
  19. package/dist/{index-YHNm3bIK.js → index-DHKx5grA.js} +4 -4
  20. package/dist/{index-CIBuU2Zv.js → index-FZVNbwSO.js} +12356 -11290
  21. package/dist/index.js +3 -3
  22. package/dist/{markdown-BUjgWFLu.js → markdown-B0mEGGfQ.js} +1015 -578
  23. package/dist/nodes/UploadingVideoNode.d.ts +30 -0
  24. package/dist/nodes/VideoNode.d.ts +47 -0
  25. package/dist/plugins/CustomHorizontalRulePlugin/HorizontalRuleCustomizationDialog.d.ts +2 -1
  26. package/dist/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +1 -1
  27. package/dist/plugins/VideoPlugin.d.ts +17 -0
  28. package/dist/{postcss-CGIcwj_g.js → postcss-B0bxXf7u.js} +1065 -615
  29. package/dist/{standalone-C0qguT38.js → standalone-DmuJV5rn.js} +596 -350
  30. package/dist/types.d.ts +4 -6
  31. package/dist/{typescript-BM7wk6k-.js → typescript-DZlC_9M8.js} +1805 -1113
  32. package/dist/ui/Icons.d.ts +2 -1
  33. package/dist/utils/uploadManager.d.ts +17 -0
  34. package/package.json +151 -151
  35. package/dist/assets/index.css +0 -1
  36. package/dist/index-BoOSmKss.js +0 -985
@@ -1,9 +1,12 @@
1
1
  var yt = Object.create, Me = Object.defineProperty, vt = Object.getOwnPropertyDescriptor, Bt = Object.getOwnPropertyNames, bt = Object.getPrototypeOf, At = Object.prototype.hasOwnProperty, ju = (e) => {
2
2
  throw TypeError(e);
3
3
  }, wt = (e, u) => () => (u || e((u = { exports: {} }).exports, u), u.exports), Ve = (e, u) => {
4
- for (var t in u) Me(e, t, { get: u[t], enumerable: !0 });
4
+ for (var t in u)
5
+ Me(e, t, { get: u[t], enumerable: !0 });
5
6
  }, kt = (e, u, t, r) => {
6
- if (u && typeof u == "object" || typeof u == "function") for (let n of Bt(u)) !At.call(e, n) && n !== t && Me(e, n, { get: () => u[n], enumerable: !(r = vt(u, n)) || r.enumerable });
7
+ if (u && typeof u == "object" || typeof u == "function")
8
+ for (let n of Bt(u))
9
+ !At.call(e, n) && n !== t && Me(e, n, { get: () => u[n], enumerable: !(r = vt(u, n)) || r.enumerable });
7
10
  return e;
8
11
  }, St = (e, u, t) => (t = e != null ? yt(bt(e)) : {}, kt(Me(t, "default", { value: e, enumerable: !0 }), e)), xt = (e, u, t) => u.has(e) || ju("Cannot " + t), Nt = (e, u, t) => u.has(e) ? ju("Cannot add the same private member more than once") : u instanceof WeakSet ? u.add(e) : u.set(e, t), De = (e, u, t) => (xt(e, u, "access private method"), t), Ot = wt((e) => {
9
12
  Object.defineProperty(e, "__esModule", { value: !0 });
@@ -15,19 +18,23 @@ var yt = Object.create, Me = Object.defineProperty, vt = Object.getOwnPropertyDe
15
18
  let o = Object.assign({ column: 0, line: -1 }, D.start), s = Object.assign({}, o, D.end), { linesAbove: c = 2, linesBelow: F = 3 } = i || {}, l = o.line, d = o.column, f = s.line, h = s.column, p = Math.max(l - (c + 1), 0), C = Math.min(a.length, f + F);
16
19
  l === -1 && (p = 0), f === -1 && (C = a.length);
17
20
  let E = f - l, m = {};
18
- if (E) for (let y = 0; y <= E; y++) {
19
- let g = y + l;
20
- if (!d) m[g] = !0;
21
- else if (y === 0) {
22
- let B = a[g - 1].length;
23
- m[g] = [d, B - d + 1];
24
- } else if (y === E) m[g] = [0, h];
25
- else {
26
- let B = a[g - y].length;
27
- m[g] = [0, B];
21
+ if (E)
22
+ for (let y = 0; y <= E; y++) {
23
+ let g = y + l;
24
+ if (!d)
25
+ m[g] = !0;
26
+ else if (y === 0) {
27
+ let B = a[g - 1].length;
28
+ m[g] = [d, B - d + 1];
29
+ } else if (y === E)
30
+ m[g] = [0, h];
31
+ else {
32
+ let B = a[g - y].length;
33
+ m[g] = [0, B];
34
+ }
28
35
  }
29
- }
30
- else d === h ? d ? m[l] = [d, 0] : m[l] = !0 : m[l] = [d, h - d];
36
+ else
37
+ d === h ? d ? m[l] = [d, 0] : m[l] = !0 : m[l] = [d, h - d];
31
38
  return { start: p, end: C, markerLines: m };
32
39
  }
33
40
  function n(D, a, i = {}) {
@@ -41,7 +48,8 @@ var yt = Object.create, Me = Object.defineProperty, vt = Object.getOwnPropertyDe
41
48
  `, o.gutter(m.replace(/\d/g, " ")), " ", M, o.marker("^").repeat(ce)].join(""), g && i.message && (B += " " + o.message(i.message));
42
49
  }
43
50
  return [o.marker(">"), o.gutter(m), p.length > 0 ? ` ${p}` : "", B].join("");
44
- } else return ` ${o.gutter(m)}${p.length > 0 ? ` ${p}` : ""}`;
51
+ } else
52
+ return ` ${o.gutter(m)}${p.length > 0 ? ` ${p}` : ""}`;
45
53
  }).join(`
46
54
  `);
47
55
  return i.message && !d && (h = `${" ".repeat(f + 1)}${i.message}
@@ -51,7 +59,8 @@ ${h}`), h;
51
59
  }), _t = {};
52
60
  Ve(_t, { __debug: () => JD, check: () => qD, doc: () => ht, format: () => Et, formatWithCursor: () => mt, getSupportInfo: () => UD, util: () => Ct, version: () => mD });
53
61
  var jt = (e, u, t, r) => {
54
- if (!(e && u == null)) return u.replaceAll ? u.replaceAll(t, r) : t.global ? u.replace(t, r) : u.split(t).join(r);
62
+ if (!(e && u == null))
63
+ return u.replaceAll ? u.replaceAll(t, r) : t.global ? u.replace(t, r) : u.split(t).join(r);
55
64
  }, me = jt, Tt = class {
56
65
  diff(e, u, t = {}) {
57
66
  let r;
@@ -67,11 +76,13 @@ var jt = (e, u, t, r) => {
67
76
  r(C);
68
77
  }, 0);
69
78
  return;
70
- } else return C;
79
+ } else
80
+ return C;
71
81
  }, a = u.length, i = e.length, o = 1, s = a + i;
72
82
  t.maxEditLength != null && (s = Math.min(s, t.maxEditLength));
73
83
  let c = (n = t.timeout) !== null && n !== void 0 ? n : 1 / 0, F = Date.now() + c, l = [{ oldPos: -1, lastComponent: void 0 }], d = this.extractCommon(l[0], u, e, 0, t);
74
- if (l[0].oldPos + 1 >= i && d + 1 >= a) return D(this.buildValues(l[0].lastComponent, u, e));
84
+ if (l[0].oldPos + 1 >= i && d + 1 >= a)
85
+ return D(this.buildValues(l[0].lastComponent, u, e));
75
86
  let f = -1 / 0, h = 1 / 0, p = () => {
76
87
  for (let C = Math.max(f, -o); C <= Math.min(h, o); C += 2) {
77
88
  let E, m = l[C - 1], y = l[C + 1];
@@ -86,21 +97,26 @@ var jt = (e, u, t, r) => {
86
97
  l[C] = void 0;
87
98
  continue;
88
99
  }
89
- if (!B || g && m.oldPos < y.oldPos ? E = this.addToPath(y, !0, !1, 0, t) : E = this.addToPath(m, !1, !0, 1, t), d = this.extractCommon(E, u, e, C, t), E.oldPos + 1 >= i && d + 1 >= a) return D(this.buildValues(E.lastComponent, u, e)) || !0;
100
+ if (!B || g && m.oldPos < y.oldPos ? E = this.addToPath(y, !0, !1, 0, t) : E = this.addToPath(m, !1, !0, 1, t), d = this.extractCommon(E, u, e, C, t), E.oldPos + 1 >= i && d + 1 >= a)
101
+ return D(this.buildValues(E.lastComponent, u, e)) || !0;
90
102
  l[C] = E, E.oldPos + 1 >= i && (h = Math.min(h, C - 1)), d + 1 >= a && (f = Math.max(f, C + 1));
91
103
  }
92
104
  o++;
93
105
  };
94
- if (r) (function C() {
95
- setTimeout(function() {
96
- if (o > s || Date.now() > F) return r(void 0);
97
- p() || C();
98
- }, 0);
99
- })();
100
- else for (; o <= s && Date.now() <= F; ) {
101
- let C = p();
102
- if (C) return C;
103
- }
106
+ if (r)
107
+ (function C() {
108
+ setTimeout(function() {
109
+ if (o > s || Date.now() > F)
110
+ return r(void 0);
111
+ p() || C();
112
+ }, 0);
113
+ })();
114
+ else
115
+ for (; o <= s && Date.now() <= F; ) {
116
+ let C = p();
117
+ if (C)
118
+ return C;
119
+ }
104
120
  }
105
121
  addToPath(e, u, t, r, n) {
106
122
  let D = e.lastComponent;
@@ -108,7 +124,8 @@ var jt = (e, u, t, r) => {
108
124
  }
109
125
  extractCommon(e, u, t, r, n) {
110
126
  let D = u.length, a = t.length, i = e.oldPos, o = i - r, s = 0;
111
- for (; o + 1 < D && i + 1 < a && this.equals(t[i + 1], u[o + 1], n); ) o++, i++, s++, n.oneChangePerToken && (e.lastComponent = { count: 1, previousComponent: e.lastComponent, added: !1, removed: !1 });
127
+ for (; o + 1 < D && i + 1 < a && this.equals(t[i + 1], u[o + 1], n); )
128
+ o++, i++, s++, n.oneChangePerToken && (e.lastComponent = { count: 1, previousComponent: e.lastComponent, added: !1, removed: !1 });
112
129
  return s && !n.oneChangePerToken && (e.lastComponent = { count: s, previousComponent: e.lastComponent, added: !1, removed: !1 }), e.oldPos = i, o;
113
130
  }
114
131
  equals(e, u, t) {
@@ -116,7 +133,8 @@ var jt = (e, u, t, r) => {
116
133
  }
117
134
  removeEmpty(e) {
118
135
  let u = [];
119
- for (let t = 0; t < e.length; t++) e[t] && u.push(e[t]);
136
+ for (let t = 0; t < e.length; t++)
137
+ e[t] && u.push(e[t]);
120
138
  return u;
121
139
  }
122
140
  castInput(e, u) {
@@ -136,12 +154,14 @@ var jt = (e, u, t, r) => {
136
154
  }
137
155
  buildValues(e, u, t) {
138
156
  let r = [], n;
139
- for (; e; ) r.push(e), n = e.previousComponent, delete e.previousComponent, e = n;
157
+ for (; e; )
158
+ r.push(e), n = e.previousComponent, delete e.previousComponent, e = n;
140
159
  r.reverse();
141
160
  let D = r.length, a = 0, i = 0, o = 0;
142
161
  for (; a < D; a++) {
143
162
  let s = r[a];
144
- if (s.removed) s.value = this.join(t.slice(o, o + s.count)), o += s.count;
163
+ if (s.removed)
164
+ s.value = this.join(t.slice(o, o + s.count)), o += s.count;
145
165
  else {
146
166
  if (!s.added && this.useLongestToken) {
147
167
  let c = u.slice(i, i + s.count);
@@ -149,7 +169,8 @@ var jt = (e, u, t, r) => {
149
169
  let d = t[o + l];
150
170
  return d.length > F.length ? d : F;
151
171
  }), s.value = this.join(c);
152
- } else s.value = this.join(u.slice(i, i + s.count));
172
+ } else
173
+ s.value = this.join(u.slice(i, i + s.count));
153
174
  i += s.count, s.added || (o += s.count);
154
175
  }
155
176
  }
@@ -211,29 +232,38 @@ function Rt(e) {
211
232
  `);
212
233
  }
213
234
  var Q = "string", T = "array", q = "cursor", I = "indent", P = "align", $ = "trim", w = "group", O = "fill", k = "if-break", L = "indent-if-break", R = "line-suffix", W = "line-suffix-boundary", b = "line", _ = "label", S = "break-parent", Iu = /* @__PURE__ */ new Set([q, I, P, $, w, O, k, L, R, W, b, _, S]), Wt = (e, u, t) => {
214
- if (!(e && u == null)) return Array.isArray(u) || typeof u == "string" ? u[t < 0 ? u.length + t : t] : u.at(t);
235
+ if (!(e && u == null))
236
+ return Array.isArray(u) || typeof u == "string" ? u[t < 0 ? u.length + t : t] : u.at(t);
215
237
  }, v = Wt;
216
238
  function Mt(e) {
217
239
  let u = e.length;
218
240
  for (; u > 0 && (e[u - 1] === "\r" || e[u - 1] === `
219
- `); ) u--;
241
+ `); )
242
+ u--;
220
243
  return u < e.length ? e.slice(0, u) : e;
221
244
  }
222
245
  function Vt(e) {
223
- if (typeof e == "string") return Q;
224
- if (Array.isArray(e)) return T;
225
- if (!e) return;
246
+ if (typeof e == "string")
247
+ return Q;
248
+ if (Array.isArray(e))
249
+ return T;
250
+ if (!e)
251
+ return;
226
252
  let { type: u } = e;
227
- if (Iu.has(u)) return u;
253
+ if (Iu.has(u))
254
+ return u;
228
255
  }
229
256
  var X = Vt, zt = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
230
257
  function qt(e) {
231
258
  let u = e === null ? "null" : typeof e;
232
- if (u !== "string" && u !== "object") return `Unexpected doc '${u}',
259
+ if (u !== "string" && u !== "object")
260
+ return `Unexpected doc '${u}',
233
261
  Expected it to be 'string' or 'object'.`;
234
- if (X(e)) throw new Error("doc is valid.");
262
+ if (X(e))
263
+ throw new Error("doc is valid.");
235
264
  let t = Object.prototype.toString.call(e);
236
- if (t !== "[object Object]") return `Unexpected doc '${t}'.`;
265
+ if (t !== "[object Object]")
266
+ return `Unexpected doc '${t}'.`;
237
267
  let r = zt([...Iu].map((n) => `'${n}'`));
238
268
  return `Unexpected doc.type '${e.type}'.
239
269
  Expected it to be ${r}.`;
@@ -254,47 +284,55 @@ function Jt(e, u, t, r) {
254
284
  }
255
285
  t && n.push(D, ru);
256
286
  let a = X(D);
257
- if (!a) throw new te(D);
258
- if (u?.(D) !== !1) switch (a) {
259
- case T:
260
- case O: {
261
- let i = a === T ? D : D.parts;
262
- for (let o = i.length, s = o - 1; s >= 0; --s) n.push(i[s]);
263
- break;
287
+ if (!a)
288
+ throw new te(D);
289
+ if (u?.(D) !== !1)
290
+ switch (a) {
291
+ case T:
292
+ case O: {
293
+ let i = a === T ? D : D.parts;
294
+ for (let o = i.length, s = o - 1; s >= 0; --s)
295
+ n.push(i[s]);
296
+ break;
297
+ }
298
+ case k:
299
+ n.push(D.flatContents, D.breakContents);
300
+ break;
301
+ case w:
302
+ if (r && D.expandedStates)
303
+ for (let i = D.expandedStates.length, o = i - 1; o >= 0; --o)
304
+ n.push(D.expandedStates[o]);
305
+ else
306
+ n.push(D.contents);
307
+ break;
308
+ case P:
309
+ case I:
310
+ case L:
311
+ case _:
312
+ case R:
313
+ n.push(D.contents);
314
+ break;
315
+ case Q:
316
+ case q:
317
+ case $:
318
+ case W:
319
+ case b:
320
+ case S:
321
+ break;
322
+ default:
323
+ throw new te(D);
264
324
  }
265
- case k:
266
- n.push(D.flatContents, D.breakContents);
267
- break;
268
- case w:
269
- if (r && D.expandedStates) for (let i = D.expandedStates.length, o = i - 1; o >= 0; --o) n.push(D.expandedStates[o]);
270
- else n.push(D.contents);
271
- break;
272
- case P:
273
- case I:
274
- case L:
275
- case _:
276
- case R:
277
- n.push(D.contents);
278
- break;
279
- case Q:
280
- case q:
281
- case $:
282
- case W:
283
- case b:
284
- case S:
285
- break;
286
- default:
287
- throw new te(D);
288
- }
289
325
  }
290
326
  }
291
327
  var qe = Jt;
292
328
  function Ee(e, u) {
293
- if (typeof e == "string") return u(e);
329
+ if (typeof e == "string")
330
+ return u(e);
294
331
  let t = /* @__PURE__ */ new Map();
295
332
  return r(e);
296
333
  function r(D) {
297
- if (t.has(D)) return t.get(D);
334
+ if (t.has(D))
335
+ return t.get(D);
298
336
  let a = n(D);
299
337
  return t.set(D, a), a;
300
338
  }
@@ -331,14 +369,16 @@ function Ee(e, u) {
331
369
  function Ue(e, u, t) {
332
370
  let r = t, n = !1;
333
371
  function D(a) {
334
- if (n) return !1;
372
+ if (n)
373
+ return !1;
335
374
  let i = u(a);
336
375
  i !== void 0 && (n = !0, r = i);
337
376
  }
338
377
  return qe(e, D), r;
339
378
  }
340
379
  function Gt(e) {
341
- if (e.type === w && e.break || e.type === b && e.hard || e.type === S) return !0;
380
+ if (e.type === w && e.break || e.type === b && e.hard || e.type === S)
381
+ return !0;
342
382
  }
343
383
  function Ht(e) {
344
384
  return Ue(e, Gt, !1);
@@ -354,7 +394,8 @@ function Kt(e) {
354
394
  let u = /* @__PURE__ */ new Set(), t = [];
355
395
  function r(D) {
356
396
  if (D.type === S && nu(t), D.type === w) {
357
- if (t.push(D), u.has(D)) return !1;
397
+ if (t.push(D), u.has(D))
398
+ return !1;
358
399
  u.add(D);
359
400
  }
360
401
  }
@@ -370,7 +411,8 @@ function Zt(e) {
370
411
  return Ee(e, Yt);
371
412
  }
372
413
  function Du(e) {
373
- for (e = [...e]; e.length >= 2 && v(!1, e, -2).type === b && v(!1, e, -1).type === S; ) e.length -= 2;
414
+ for (e = [...e]; e.length >= 2 && v(!1, e, -2).type === b && v(!1, e, -1).type === S; )
415
+ e.length -= 2;
374
416
  if (e.length > 0) {
375
417
  let u = ae(v(!1, e, -1));
376
418
  e[e.length - 1] = u;
@@ -413,25 +455,31 @@ function Pu(e) {
413
455
  function Qt(e) {
414
456
  switch (X(e)) {
415
457
  case O:
416
- if (e.parts.every((u) => u === "")) return "";
458
+ if (e.parts.every((u) => u === ""))
459
+ return "";
417
460
  break;
418
461
  case w:
419
- if (!e.contents && !e.id && !e.break && !e.expandedStates) return "";
420
- if (e.contents.type === w && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates) return e.contents;
462
+ if (!e.contents && !e.id && !e.break && !e.expandedStates)
463
+ return "";
464
+ if (e.contents.type === w && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates)
465
+ return e.contents;
421
466
  break;
422
467
  case P:
423
468
  case I:
424
469
  case L:
425
470
  case R:
426
- if (!e.contents) return "";
471
+ if (!e.contents)
472
+ return "";
427
473
  break;
428
474
  case k:
429
- if (!e.flatContents && !e.breakContents) return "";
475
+ if (!e.flatContents && !e.breakContents)
476
+ return "";
430
477
  break;
431
478
  case T: {
432
479
  let u = [];
433
480
  for (let t of e) {
434
- if (!t) continue;
481
+ if (!t)
482
+ continue;
435
483
  let [r, ...n] = Array.isArray(t) ? t : [t];
436
484
  typeof r == "string" && typeof v(!1, u, -1) == "string" ? u[u.length - 1] += r : u.push(r), u.push(...n);
437
485
  }
@@ -458,7 +506,8 @@ function er(e, u = Wu) {
458
506
  `)) : t);
459
507
  }
460
508
  function ur(e) {
461
- if (e.type === b) return !0;
509
+ if (e.type === b)
510
+ return !0;
462
511
  }
463
512
  function tr(e) {
464
513
  return Ue(e, ur, !1);
@@ -504,13 +553,15 @@ function je(e) {
504
553
  var fr = { type: W }, ge = { type: S }, dr = { type: $ }, Je = { type: b, hard: !0 }, Lu = { type: b, hard: !0, literal: !0 }, Ru = { type: b }, Fr = { type: b, soft: !0 }, Y = [Je, ge], Wu = [Lu, ge], K = { type: q };
505
554
  function Mu(e, u) {
506
555
  let t = [];
507
- for (let r = 0; r < u.length; r++) r !== 0 && t.push(e), t.push(u[r]);
556
+ for (let r = 0; r < u.length; r++)
557
+ r !== 0 && t.push(e), t.push(u[r]);
508
558
  return t;
509
559
  }
510
560
  function Vu(e, u, t) {
511
561
  let r = e;
512
562
  if (u > 0) {
513
- for (let n = 0; n < Math.floor(u / t); ++n) r = Ce(r);
563
+ for (let n = 0; n < Math.floor(u / t); ++n)
564
+ r = Ce(r);
514
565
  r = re(u % t, r), r = re(Number.NEGATIVE_INFINITY, r);
515
566
  }
516
567
  return r;
@@ -520,14 +571,17 @@ function pr(e, u) {
520
571
  }
521
572
  function j(e) {
522
573
  var u;
523
- if (!e) return "";
574
+ if (!e)
575
+ return "";
524
576
  if (Array.isArray(e)) {
525
577
  let t = [];
526
- for (let r of e) if (Array.isArray(r)) t.push(...j(r));
527
- else {
528
- let n = j(r);
529
- n !== "" && t.push(n);
530
- }
578
+ for (let r of e)
579
+ if (Array.isArray(r))
580
+ t.push(...j(r));
581
+ else {
582
+ let n = j(r);
583
+ n !== "" && t.push(n);
584
+ }
531
585
  return t;
532
586
  }
533
587
  return e.type === k ? { ...e, breakContents: j(e.breakContents), flatContents: j(e.flatContents) } : e.type === w ? { ...e, contents: j(e.contents), expandedStates: (u = e.expandedStates) == null ? void 0 : u.map(j) } : e.type === O ? { type: "fill", parts: e.parts.map(j) } : e.contents ? { ...e, contents: j(e.contents) } : e;
@@ -537,7 +591,8 @@ function hr(e) {
537
591
  return r(j(e));
538
592
  function r(D, a, i) {
539
593
  var o, s;
540
- if (typeof D == "string") return JSON.stringify(D);
594
+ if (typeof D == "string")
595
+ return JSON.stringify(D);
541
596
  if (Array.isArray(D)) {
542
597
  let c = D.map(r).filter(Boolean);
543
598
  return c.length === 1 ? c[0] : `[${c.join(", ")}]`;
@@ -546,11 +601,16 @@ function hr(e) {
546
601
  let c = ((o = i?.[a + 1]) == null ? void 0 : o.type) === S;
547
602
  return D.literal ? c ? "literalline" : "literallineWithoutBreakParent" : D.hard ? c ? "hardline" : "hardlineWithoutBreakParent" : D.soft ? "softline" : "line";
548
603
  }
549
- if (D.type === S) return ((s = i?.[a - 1]) == null ? void 0 : s.type) === b && i[a - 1].hard ? void 0 : "breakParent";
550
- if (D.type === $) return "trim";
551
- if (D.type === I) return "indent(" + r(D.contents) + ")";
552
- if (D.type === P) return D.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + r(D.contents) + ")" : D.n < 0 ? "dedent(" + r(D.contents) + ")" : D.n.type === "root" ? "markAsRoot(" + r(D.contents) + ")" : "align(" + JSON.stringify(D.n) + ", " + r(D.contents) + ")";
553
- if (D.type === k) return "ifBreak(" + r(D.breakContents) + (D.flatContents ? ", " + r(D.flatContents) : "") + (D.groupId ? (D.flatContents ? "" : ', ""') + `, { groupId: ${n(D.groupId)} }` : "") + ")";
604
+ if (D.type === S)
605
+ return ((s = i?.[a - 1]) == null ? void 0 : s.type) === b && i[a - 1].hard ? void 0 : "breakParent";
606
+ if (D.type === $)
607
+ return "trim";
608
+ if (D.type === I)
609
+ return "indent(" + r(D.contents) + ")";
610
+ if (D.type === P)
611
+ return D.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + r(D.contents) + ")" : D.n < 0 ? "dedent(" + r(D.contents) + ")" : D.n.type === "root" ? "markAsRoot(" + r(D.contents) + ")" : "align(" + JSON.stringify(D.n) + ", " + r(D.contents) + ")";
612
+ if (D.type === k)
613
+ return "ifBreak(" + r(D.breakContents) + (D.flatContents ? ", " + r(D.flatContents) : "") + (D.groupId ? (D.flatContents ? "" : ', ""') + `, { groupId: ${n(D.groupId)} }` : "") + ")";
554
614
  if (D.type === L) {
555
615
  let c = [];
556
616
  D.negate && c.push("negate: true"), D.groupId && c.push(`groupId: ${n(D.groupId)}`);
@@ -563,20 +623,28 @@ function hr(e) {
563
623
  let F = c.length > 0 ? `, { ${c.join(", ")} }` : "";
564
624
  return D.expandedStates ? `conditionalGroup([${D.expandedStates.map((l) => r(l)).join(",")}]${F})` : `group(${r(D.contents)}${F})`;
565
625
  }
566
- if (D.type === O) return `fill([${D.parts.map((c) => r(c)).join(", ")}])`;
567
- if (D.type === R) return "lineSuffix(" + r(D.contents) + ")";
568
- if (D.type === W) return "lineSuffixBoundary";
569
- if (D.type === _) return `label(${JSON.stringify(D.label)}, ${r(D.contents)})`;
570
- if (D.type === q) return "cursor";
626
+ if (D.type === O)
627
+ return `fill([${D.parts.map((c) => r(c)).join(", ")}])`;
628
+ if (D.type === R)
629
+ return "lineSuffix(" + r(D.contents) + ")";
630
+ if (D.type === W)
631
+ return "lineSuffixBoundary";
632
+ if (D.type === _)
633
+ return `label(${JSON.stringify(D.label)}, ${r(D.contents)})`;
634
+ if (D.type === q)
635
+ return "cursor";
571
636
  throw new Error("Unknown doc type " + D.type);
572
637
  }
573
638
  function n(D) {
574
- if (typeof D != "symbol") return JSON.stringify(String(D));
575
- if (D in u) return u[D];
639
+ if (typeof D != "symbol")
640
+ return JSON.stringify(String(D));
641
+ if (D in u)
642
+ return u[D];
576
643
  let a = D.description || "symbol";
577
644
  for (let i = 0; ; i++) {
578
645
  let o = a + (i > 0 ? ` #${i}` : "");
579
- if (!t.has(o)) return t.add(o), u[D] = `Symbol.for(${JSON.stringify(o)})`;
646
+ if (!t.has(o))
647
+ return t.add(o), u[D] = `Symbol.for(${JSON.stringify(o)})`;
580
648
  }
581
649
  }
582
650
  }
@@ -589,8 +657,10 @@ function Er(e) {
589
657
  }
590
658
  var gr = (e) => !(mr(e) || Er(e)), yr = /[^\x20-\x7F]/u;
591
659
  function vr(e) {
592
- if (!e) return 0;
593
- if (!yr.test(e)) return e.length;
660
+ if (!e)
661
+ return 0;
662
+ if (!yr.test(e))
663
+ return e.length;
594
664
  e = e.replace(Cr(), " ");
595
665
  let u = 0;
596
666
  for (let t of e) {
@@ -599,7 +669,7 @@ function vr(e) {
599
669
  }
600
670
  return u;
601
671
  }
602
- var Ge = vr, A = /* @__PURE__ */ Symbol("MODE_BREAK"), x = /* @__PURE__ */ Symbol("MODE_FLAT"), ee = /* @__PURE__ */ Symbol("cursor"), Te = /* @__PURE__ */ Symbol("DOC_FILL_PRINTED_LENGTH");
672
+ var Ge = vr, A = Symbol("MODE_BREAK"), x = Symbol("MODE_FLAT"), ee = Symbol("cursor"), Te = Symbol("DOC_FILL_PRINTED_LENGTH");
603
673
  function zu() {
604
674
  return { value: "", length: 0, queue: [] };
605
675
  }
@@ -611,19 +681,20 @@ function br(e, u, t) {
611
681
  }
612
682
  function Ie(e, u, t) {
613
683
  let r = u.type === "dedent" ? e.queue.slice(0, -1) : [...e.queue, u], n = "", D = 0, a = 0, i = 0;
614
- for (let f of r) switch (f.type) {
615
- case "indent":
616
- c(), t.useTabs ? o(1) : s(t.tabWidth);
617
- break;
618
- case "stringAlign":
619
- c(), n += f.n, D += f.n.length;
620
- break;
621
- case "numberAlign":
622
- a += 1, i += f.n;
623
- break;
624
- default:
625
- throw new Error(`Unexpected type '${f.type}'`);
626
- }
684
+ for (let f of r)
685
+ switch (f.type) {
686
+ case "indent":
687
+ c(), t.useTabs ? o(1) : s(t.tabWidth);
688
+ break;
689
+ case "stringAlign":
690
+ c(), n += f.n, D += f.n.length;
691
+ break;
692
+ case "numberAlign":
693
+ a += 1, i += f.n;
694
+ break;
695
+ default:
696
+ throw new Error(`Unexpected type '${f.type}'`);
697
+ }
627
698
  return l(), { ...e, value: n, length: D, queue: r };
628
699
  function o(f) {
629
700
  n += " ".repeat(f), D += t.tabWidth * f;
@@ -646,30 +717,36 @@ function Ie(e, u, t) {
646
717
  }
647
718
  function Pe(e) {
648
719
  let u = 0, t = 0, r = e.length;
649
- e: for (; r--; ) {
650
- let n = e[r];
651
- if (n === ee) {
652
- t++;
653
- continue;
654
- }
655
- for (let D = n.length - 1; D >= 0; D--) {
656
- let a = n[D];
657
- if (a === " " || a === " ") u++;
658
- else {
659
- e[r] = n.slice(0, D + 1);
660
- break e;
720
+ e:
721
+ for (; r--; ) {
722
+ let n = e[r];
723
+ if (n === ee) {
724
+ t++;
725
+ continue;
726
+ }
727
+ for (let D = n.length - 1; D >= 0; D--) {
728
+ let a = n[D];
729
+ if (a === " " || a === " ")
730
+ u++;
731
+ else {
732
+ e[r] = n.slice(0, D + 1);
733
+ break e;
734
+ }
661
735
  }
662
736
  }
663
- }
664
- if (u > 0 || t > 0) for (e.length = r + 1; t-- > 0; ) e.push(ee);
737
+ if (u > 0 || t > 0)
738
+ for (e.length = r + 1; t-- > 0; )
739
+ e.push(ee);
665
740
  return u;
666
741
  }
667
742
  function fe(e, u, t, r, n, D) {
668
- if (t === Number.POSITIVE_INFINITY) return !0;
743
+ if (t === Number.POSITIVE_INFINITY)
744
+ return !0;
669
745
  let a = u.length, i = [e], o = [];
670
746
  for (; t >= 0; ) {
671
747
  if (i.length === 0) {
672
- if (a === 0) return !0;
748
+ if (a === 0)
749
+ return !0;
673
750
  i.push(u[--a]);
674
751
  continue;
675
752
  }
@@ -681,7 +758,8 @@ function fe(e, u, t, r, n, D) {
681
758
  case T:
682
759
  case O: {
683
760
  let l = F === T ? c : c.parts, d = c[Te] ?? 0;
684
- for (let f = l.length - 1; f >= d; f--) i.push({ mode: s, doc: l[f] });
761
+ for (let f = l.length - 1; f >= d; f--)
762
+ i.push({ mode: s, doc: l[f] });
685
763
  break;
686
764
  }
687
765
  case I:
@@ -694,7 +772,8 @@ function fe(e, u, t, r, n, D) {
694
772
  t += Pe(o);
695
773
  break;
696
774
  case w: {
697
- if (D && c.break) return !1;
775
+ if (D && c.break)
776
+ return !1;
698
777
  let l = c.break ? A : s, d = c.expandedStates && l === A ? v(!1, c.expandedStates, -1) : c.contents;
699
778
  i.push({ mode: l, doc: d });
700
779
  break;
@@ -705,14 +784,16 @@ function fe(e, u, t, r, n, D) {
705
784
  break;
706
785
  }
707
786
  case b:
708
- if (s === A || c.hard) return !0;
787
+ if (s === A || c.hard)
788
+ return !0;
709
789
  c.soft || (o.push(" "), t--);
710
790
  break;
711
791
  case R:
712
792
  r = !0;
713
793
  break;
714
794
  case W:
715
- if (r) return !1;
795
+ if (r)
796
+ return !1;
716
797
  break;
717
798
  }
718
799
  }
@@ -731,10 +812,12 @@ function ye(e, u) {
731
812
  break;
732
813
  }
733
814
  case T:
734
- for (let h = f.length - 1; h >= 0; h--) a.push({ ind: l, mode: d, doc: f[h] });
815
+ for (let h = f.length - 1; h >= 0; h--)
816
+ a.push({ ind: l, mode: d, doc: f[h] });
735
817
  break;
736
818
  case q:
737
- if (c >= 2) throw new Error("There are too many 'cursor' in doc.");
819
+ if (c >= 2)
820
+ throw new Error("There are too many 'cursor' in doc.");
738
821
  i.push(ee), c++;
739
822
  break;
740
823
  case I:
@@ -756,23 +839,27 @@ function ye(e, u) {
756
839
  case A: {
757
840
  o = !1;
758
841
  let h = { ind: l, mode: x, doc: f.contents }, p = r - D, C = s.length > 0;
759
- if (!f.break && fe(h, a, p, C, t)) a.push(h);
842
+ if (!f.break && fe(h, a, p, C, t))
843
+ a.push(h);
760
844
  else if (f.expandedStates) {
761
845
  let E = v(!1, f.expandedStates, -1);
762
846
  if (f.break) {
763
847
  a.push({ ind: l, mode: A, doc: E });
764
848
  break;
765
- } else for (let m = 1; m < f.expandedStates.length + 1; m++) if (m >= f.expandedStates.length) {
766
- a.push({ ind: l, mode: A, doc: E });
767
- break;
768
- } else {
769
- let y = f.expandedStates[m], g = { ind: l, mode: x, doc: y };
770
- if (fe(g, a, p, C, t)) {
771
- a.push(g);
772
- break;
773
- }
774
- }
775
- } else a.push({ ind: l, mode: A, doc: f.contents });
849
+ } else
850
+ for (let m = 1; m < f.expandedStates.length + 1; m++)
851
+ if (m >= f.expandedStates.length) {
852
+ a.push({ ind: l, mode: A, doc: E });
853
+ break;
854
+ } else {
855
+ let y = f.expandedStates[m], g = { ind: l, mode: x, doc: y };
856
+ if (fe(g, a, p, C, t)) {
857
+ a.push(g);
858
+ break;
859
+ }
860
+ }
861
+ } else
862
+ a.push({ ind: l, mode: A, doc: f.contents });
776
863
  break;
777
864
  }
778
865
  }
@@ -780,7 +867,8 @@ function ye(e, u) {
780
867
  break;
781
868
  case O: {
782
869
  let h = r - D, p = f[Te] ?? 0, { parts: C } = f, E = C.length - p;
783
- if (E === 0) break;
870
+ if (E === 0)
871
+ break;
784
872
  let m = C[p + 0], y = C[p + 1], g = { ind: l, mode: x, doc: m }, B = { ind: l, mode: A, doc: m }, M = fe(g, [], h, s.length > 0, t, !0);
785
873
  if (E === 1) {
786
874
  M ? a.push(g) : a.push(B);
@@ -817,7 +905,8 @@ function ye(e, u) {
817
905
  case b:
818
906
  switch (d) {
819
907
  case x:
820
- if (f.hard) o = !0;
908
+ if (f.hard)
909
+ o = !0;
821
910
  else {
822
911
  f.soft || (i.push(" "), D += 1);
823
912
  break;
@@ -844,7 +933,8 @@ function ye(e, u) {
844
933
  let F = i.indexOf(ee);
845
934
  if (F !== -1) {
846
935
  let l = i.indexOf(ee, F + 1);
847
- if (l === -1) return { formatted: i.filter((p) => p !== ee).join("") };
936
+ if (l === -1)
937
+ return { formatted: i.filter((p) => p !== ee).join("") };
848
938
  let d = i.slice(0, F).join(""), f = i.slice(F + 1, l).join(""), h = i.slice(l + 1).join("");
849
939
  return { formatted: d + f + h, cursorNodeStart: d.length, cursorNodeText: f };
850
940
  }
@@ -852,7 +942,8 @@ function ye(e, u) {
852
942
  }
853
943
  function Ar(e, u, t = 0) {
854
944
  let r = 0;
855
- for (let n = t; n < e.length; ++n) e[n] === " " ? r = r + u - r % u : r++;
945
+ for (let n = t; n < e.length; ++n)
946
+ e[n] === " " ? r = r + u - r % u : r++;
856
947
  return r;
857
948
  }
858
949
  var He = Ar, J, $e, pe, wr = class {
@@ -922,7 +1013,8 @@ var He = Ar, J, $e, pe, wr = class {
922
1013
  }
923
1014
  call(e, ...u) {
924
1015
  let { stack: t } = this, { length: r } = t, n = v(!1, t, -1);
925
- for (let D of u) n = n[D], t.push(D, n);
1016
+ for (let D of u)
1017
+ n = n[D], t.push(D, n);
926
1018
  try {
927
1019
  return e(this);
928
1020
  } finally {
@@ -939,9 +1031,11 @@ var He = Ar, J, $e, pe, wr = class {
939
1031
  }
940
1032
  each(e, ...u) {
941
1033
  let { stack: t } = this, { length: r } = t, n = v(!1, t, -1);
942
- for (let D of u) n = n[D], t.push(D, n);
1034
+ for (let D of u)
1035
+ n = n[D], t.push(D, n);
943
1036
  try {
944
- for (let D = 0; D < n.length; ++D) t.push(D, n[D]), e(this, D, n), t.length -= 2;
1037
+ for (let D = 0; D < n.length; ++D)
1038
+ t.push(D, n[D]), e(this, D, n), t.length -= 2;
945
1039
  } finally {
946
1040
  t.length = r;
947
1041
  }
@@ -955,24 +1049,32 @@ var He = Ar, J, $e, pe, wr = class {
955
1049
  match(...e) {
956
1050
  let u = this.stack.length - 1, t = null, r = this.stack[u--];
957
1051
  for (let n of e) {
958
- if (r === void 0) return !1;
1052
+ if (r === void 0)
1053
+ return !1;
959
1054
  let D = null;
960
- if (typeof t == "number" && (D = t, t = this.stack[u--], r = this.stack[u--]), n && !n(r, t, D)) return !1;
1055
+ if (typeof t == "number" && (D = t, t = this.stack[u--], r = this.stack[u--]), n && !n(r, t, D))
1056
+ return !1;
961
1057
  t = this.stack[u--], r = this.stack[u--];
962
1058
  }
963
1059
  return !0;
964
1060
  }
965
1061
  findAncestor(e) {
966
- for (let u of De(this, J, pe).call(this)) if (e(u)) return u;
1062
+ for (let u of De(this, J, pe).call(this))
1063
+ if (e(u))
1064
+ return u;
967
1065
  }
968
1066
  hasAncestor(e) {
969
- for (let u of De(this, J, pe).call(this)) if (e(u)) return !0;
1067
+ for (let u of De(this, J, pe).call(this))
1068
+ if (e(u))
1069
+ return !0;
970
1070
  return !1;
971
1071
  }
972
1072
  };
973
1073
  J = /* @__PURE__ */ new WeakSet(), $e = function(e) {
974
1074
  let { stack: u } = this;
975
- for (let t = u.length - 1; t >= 0; t -= 2) if (!Array.isArray(u[t]) && --e < 0) return t;
1075
+ for (let t = u.length - 1; t >= 0; t -= 2)
1076
+ if (!Array.isArray(u[t]) && --e < 0)
1077
+ return t;
976
1078
  return -1;
977
1079
  }, pe = function* () {
978
1080
  let { stack: e } = this;
@@ -991,15 +1093,19 @@ function* ve(e, u) {
991
1093
  let { getVisitorKeys: t, filter: r = () => !0 } = u, n = (D) => xr(D) && r(D);
992
1094
  for (let D of t(e)) {
993
1095
  let a = e[D];
994
- if (Array.isArray(a)) for (let i of a) n(i) && (yield i);
995
- else n(a) && (yield a);
1096
+ if (Array.isArray(a))
1097
+ for (let i of a)
1098
+ n(i) && (yield i);
1099
+ else
1100
+ n(a) && (yield a);
996
1101
  }
997
1102
  }
998
1103
  function* Nr(e, u) {
999
1104
  let t = [e];
1000
1105
  for (let r = 0; r < t.length; r++) {
1001
1106
  let n = t[r];
1002
- for (let D of ve(n, u)) yield D, t.push(D);
1107
+ for (let D of ve(n, u))
1108
+ yield D, t.push(D);
1003
1109
  }
1004
1110
  }
1005
1111
  function Or(e, u) {
@@ -1008,13 +1114,16 @@ function Or(e, u) {
1008
1114
  function se(e) {
1009
1115
  return (u, t, r) => {
1010
1116
  let n = !!(r != null && r.backwards);
1011
- if (t === !1) return !1;
1117
+ if (t === !1)
1118
+ return !1;
1012
1119
  let { length: D } = u, a = t;
1013
1120
  for (; a >= 0 && a < D; ) {
1014
1121
  let i = u.charAt(a);
1015
1122
  if (e instanceof RegExp) {
1016
- if (!e.test(i)) return a;
1017
- } else if (!e.includes(i)) return a;
1123
+ if (!e.test(i))
1124
+ return a;
1125
+ } else if (!e.includes(i))
1126
+ return a;
1018
1127
  n ? a-- : a++;
1019
1128
  }
1020
1129
  return a === -1 || a === D ? a : !1;
@@ -1023,18 +1132,23 @@ function se(e) {
1023
1132
  var _r = se(/\s/u), z = se(" "), Uu = se(",; "), Ju = se(/[^\n\r]/u);
1024
1133
  function jr(e, u, t) {
1025
1134
  let r = !!(t != null && t.backwards);
1026
- if (u === !1) return !1;
1135
+ if (u === !1)
1136
+ return !1;
1027
1137
  let n = e.charAt(u);
1028
1138
  if (r) {
1029
1139
  if (e.charAt(u - 1) === "\r" && n === `
1030
- `) return u - 2;
1140
+ `)
1141
+ return u - 2;
1031
1142
  if (n === `
1032
- ` || n === "\r" || n === "\u2028" || n === "\u2029") return u - 1;
1143
+ ` || n === "\r" || n === "\u2028" || n === "\u2029")
1144
+ return u - 1;
1033
1145
  } else {
1034
1146
  if (n === "\r" && e.charAt(u + 1) === `
1035
- `) return u + 2;
1147
+ `)
1148
+ return u + 2;
1036
1149
  if (n === `
1037
- ` || n === "\r" || n === "\u2028" || n === "\u2029") return u + 1;
1150
+ ` || n === "\r" || n === "\u2028" || n === "\u2029")
1151
+ return u + 1;
1038
1152
  }
1039
1153
  return u;
1040
1154
  }
@@ -1070,9 +1184,11 @@ function oe(e, u) {
1070
1184
  }
1071
1185
  var ke = /* @__PURE__ */ new WeakMap();
1072
1186
  function Ye(e, u) {
1073
- if (ke.has(e)) return ke.get(e);
1187
+ if (ke.has(e))
1188
+ return ke.get(e);
1074
1189
  let { printer: { getCommentChildNodes: t, canAttachComment: r, getVisitorKeys: n }, locStart: D, locEnd: a } = u;
1075
- if (!r) return [];
1190
+ if (!r)
1191
+ return [];
1076
1192
  let i = (t?.(e, u) ?? [...ve(e, { getVisitorKeys: Be(n) })]).flatMap((o) => r(o) ? [o] : Ye(o, u));
1077
1193
  return i.sort((o, s) => D(o) - D(s) || a(o) - a(s)), ke.set(e, i), i;
1078
1194
  }
@@ -1080,7 +1196,8 @@ function Hu(e, u, t, r) {
1080
1196
  let { locStart: n, locEnd: D } = t, a = n(u), i = D(u), o = Ye(e, t), s, c, F = 0, l = o.length;
1081
1197
  for (; F < l; ) {
1082
1198
  let d = F + l >> 1, f = o[d], h = n(f), p = D(f);
1083
- if (h <= a && i <= p) return Hu(f, u, t, f);
1199
+ if (h <= a && i <= p)
1200
+ return Hu(f, u, t, f);
1084
1201
  if (p <= a) {
1085
1202
  s = f, F = d + 1;
1086
1203
  continue;
@@ -1100,57 +1217,75 @@ function Hu(e, u, t, r) {
1100
1217
  var Se = () => !1;
1101
1218
  function Wr(e, u) {
1102
1219
  let { comments: t } = e;
1103
- if (delete e.comments, !Pr(t) || !u.printer.canAttachComment) return;
1220
+ if (delete e.comments, !Pr(t) || !u.printer.canAttachComment)
1221
+ return;
1104
1222
  let r = [], { printer: { experimentalFeatures: { avoidAstMutation: n = !1 } = {}, handleComments: D = {} }, originalText: a } = u, { ownLine: i = Se, endOfLine: o = Se, remaining: s = Se } = D, c = t.map((F, l) => ({ ...Hu(e, F, u), comment: F, text: a, options: u, ast: e, isLastComment: t.length - 1 === l }));
1105
1223
  for (let [F, l] of c.entries()) {
1106
1224
  let { comment: d, precedingNode: f, enclosingNode: h, followingNode: p, text: C, options: E, ast: m, isLastComment: y } = l, g;
1107
- if (n ? g = [l] : (d.enclosingNode = h, d.precedingNode = f, d.followingNode = p, g = [d, C, E, m, y]), Mr(C, E, c, F)) d.placement = "ownLine", i(...g) || (p ? ie(p, d) : f ? oe(f, d) : G(h || m, d));
1108
- else if (Vr(C, E, c, F)) d.placement = "endOfLine", o(...g) || (f ? oe(f, d) : p ? ie(p, d) : G(h || m, d));
1109
- else if (d.placement = "remaining", !s(...g)) if (f && p) {
1110
- let B = r.length;
1111
- B > 0 && r[B - 1].followingNode !== p && au(r, E), r.push(l);
1112
- } else f ? oe(f, d) : p ? ie(p, d) : G(h || m, d);
1113
- }
1114
- if (au(r, u), !n) for (let F of t) delete F.precedingNode, delete F.enclosingNode, delete F.followingNode;
1225
+ if (n ? g = [l] : (d.enclosingNode = h, d.precedingNode = f, d.followingNode = p, g = [d, C, E, m, y]), Mr(C, E, c, F))
1226
+ d.placement = "ownLine", i(...g) || (p ? ie(p, d) : f ? oe(f, d) : G(h || m, d));
1227
+ else if (Vr(C, E, c, F))
1228
+ d.placement = "endOfLine", o(...g) || (f ? oe(f, d) : p ? ie(p, d) : G(h || m, d));
1229
+ else if (d.placement = "remaining", !s(...g))
1230
+ if (f && p) {
1231
+ let B = r.length;
1232
+ B > 0 && r[B - 1].followingNode !== p && au(r, E), r.push(l);
1233
+ } else
1234
+ f ? oe(f, d) : p ? ie(p, d) : G(h || m, d);
1235
+ }
1236
+ if (au(r, u), !n)
1237
+ for (let F of t)
1238
+ delete F.precedingNode, delete F.enclosingNode, delete F.followingNode;
1115
1239
  }
1116
1240
  var Ku = (e) => !/[\S\n\u2028\u2029]/u.test(e);
1117
1241
  function Mr(e, u, t, r) {
1118
1242
  let { comment: n, precedingNode: D } = t[r], { locStart: a, locEnd: i } = u, o = a(n);
1119
- if (D) for (let s = r - 1; s >= 0; s--) {
1120
- let { comment: c, precedingNode: F } = t[s];
1121
- if (F !== D || !Ku(e.slice(i(c), o))) break;
1122
- o = a(c);
1123
- }
1243
+ if (D)
1244
+ for (let s = r - 1; s >= 0; s--) {
1245
+ let { comment: c, precedingNode: F } = t[s];
1246
+ if (F !== D || !Ku(e.slice(i(c), o)))
1247
+ break;
1248
+ o = a(c);
1249
+ }
1124
1250
  return V(e, o, { backwards: !0 });
1125
1251
  }
1126
1252
  function Vr(e, u, t, r) {
1127
1253
  let { comment: n, followingNode: D } = t[r], { locStart: a, locEnd: i } = u, o = i(n);
1128
- if (D) for (let s = r + 1; s < t.length; s++) {
1129
- let { comment: c, followingNode: F } = t[s];
1130
- if (F !== D || !Ku(e.slice(o, a(c)))) break;
1131
- o = i(c);
1132
- }
1254
+ if (D)
1255
+ for (let s = r + 1; s < t.length; s++) {
1256
+ let { comment: c, followingNode: F } = t[s];
1257
+ if (F !== D || !Ku(e.slice(o, a(c))))
1258
+ break;
1259
+ o = i(c);
1260
+ }
1133
1261
  return V(e, o);
1134
1262
  }
1135
1263
  function au(e, u) {
1136
1264
  var t, r;
1137
1265
  let n = e.length;
1138
- if (n === 0) return;
1266
+ if (n === 0)
1267
+ return;
1139
1268
  let { precedingNode: D, followingNode: a } = e[0], i = u.locStart(a), o;
1140
1269
  for (o = n; o > 0; --o) {
1141
1270
  let { comment: s, precedingNode: c, followingNode: F } = e[o - 1];
1142
1271
  Le.strictEqual(c, D), Le.strictEqual(F, a);
1143
1272
  let l = u.originalText.slice(u.locEnd(s), i);
1144
- if (((r = (t = u.printer).isGap) == null ? void 0 : r.call(t, l, u)) ?? /^[\s(]*$/u.test(l)) i = u.locStart(s);
1145
- else break;
1273
+ if (((r = (t = u.printer).isGap) == null ? void 0 : r.call(t, l, u)) ?? /^[\s(]*$/u.test(l))
1274
+ i = u.locStart(s);
1275
+ else
1276
+ break;
1146
1277
  }
1147
- for (let [s, { comment: c }] of e.entries()) s < o ? oe(D, c) : ie(a, c);
1148
- for (let s of [D, a]) s.comments && s.comments.length > 1 && s.comments.sort((c, F) => u.locStart(c) - u.locStart(F));
1278
+ for (let [s, { comment: c }] of e.entries())
1279
+ s < o ? oe(D, c) : ie(a, c);
1280
+ for (let s of [D, a])
1281
+ s.comments && s.comments.length > 1 && s.comments.sort((c, F) => u.locStart(c) - u.locStart(F));
1149
1282
  e.length = 0;
1150
1283
  }
1151
1284
  function xe(e, u, t) {
1152
1285
  let r = t.locStart(u) - 1;
1153
- for (let n = 1; n < e.length; ++n) if (r < t.locStart(e[n])) return n - 1;
1286
+ for (let n = 1; n < e.length; ++n)
1287
+ if (r < t.locStart(e[n]))
1288
+ return n - 1;
1154
1289
  return 0;
1155
1290
  }
1156
1291
  function zr(e, u) {
@@ -1170,7 +1305,8 @@ function qr(e, u) {
1170
1305
  if ((t = D.isBlockComment) != null && t.call(D, r)) {
1171
1306
  let c = V(a, o(r)) ? V(a, i(r), { backwards: !0 }) ? Y : Ru : " ";
1172
1307
  n.push(c);
1173
- } else n.push(Y);
1308
+ } else
1309
+ n.push(Y);
1174
1310
  let s = Z(a, z(a, o(r)));
1175
1311
  return s !== !1 && V(a, s) && n.push(Y), n;
1176
1312
  }
@@ -1185,13 +1321,16 @@ function Ur(e, u, t) {
1185
1321
  }
1186
1322
  function Jr(e, u) {
1187
1323
  let t = e.node;
1188
- if (!t) return {};
1189
- let r = u[/* @__PURE__ */ Symbol.for("printedComments")];
1190
- if ((t.comments || []).filter((i) => !r.has(i)).length === 0) return { leading: "", trailing: "" };
1324
+ if (!t)
1325
+ return {};
1326
+ let r = u[Symbol.for("printedComments")];
1327
+ if ((t.comments || []).filter((i) => !r.has(i)).length === 0)
1328
+ return { leading: "", trailing: "" };
1191
1329
  let n = [], D = [], a;
1192
1330
  return e.each(() => {
1193
1331
  let i = e.node;
1194
- if (r != null && r.has(i)) return;
1332
+ if (r != null && r.has(i))
1333
+ return;
1195
1334
  let { leading: o, trailing: s } = i;
1196
1335
  o ? n.push(qr(e, u)) : s && (a = Ur(e, u, a), D.push(a.doc));
1197
1336
  }, "comments"), { leading: n, trailing: D };
@@ -1201,9 +1340,10 @@ function Gr(e, u, t) {
1201
1340
  return !r && !n ? u : Fe(u, (D) => [r, D, n]);
1202
1341
  }
1203
1342
  function Hr(e) {
1204
- let { [/* @__PURE__ */ Symbol.for("comments")]: u, [/* @__PURE__ */ Symbol.for("printedComments")]: t } = e;
1343
+ let { [Symbol.for("comments")]: u, [Symbol.for("printedComments")]: t } = e;
1205
1344
  for (let r of u) {
1206
- if (!r.printed && !t.has(r)) throw new Error('Comment "' + r.value.trim() + '" was not printed. Please report this error!');
1345
+ if (!r.printed && !t.has(r))
1346
+ throw new Error('Comment "' + r.value.trim() + '" was not printed. Please report this error!');
1207
1347
  delete r.printed;
1208
1348
  }
1209
1349
  }
@@ -1217,21 +1357,24 @@ The range will extend forwards to the end of the selected statement.`, cliCatego
1217
1357
  The range will extend backwards to the start of the first line containing the selected statement.`, cliCategory: "Editor" }, requirePragma: { category: "Special", type: "boolean", default: !1, description: "Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.", cliCategory: "Other" }, tabWidth: { type: "int", category: "Global", default: 2, description: "Number of spaces per indentation level.", range: { start: 0, end: 1 / 0, step: 1 } }, useTabs: { category: "Global", type: "boolean", default: !1, description: "Indent with tabs instead of spaces." }, embeddedLanguageFormatting: { category: "Global", type: "choice", default: "auto", description: "Control how Prettier formats quoted code embedded in the file.", choices: [{ value: "auto", description: "Format embedded code if Prettier can automatically identify it." }, { value: "off", description: "Never automatically format embedded code." }] } };
1218
1358
  function Qu({ plugins: e = [], showDeprecated: u = !1 } = {}) {
1219
1359
  let t = e.flatMap((n) => n.languages ?? []), r = [];
1220
- for (let n of Zr(Object.assign({}, ...e.map(({ options: D }) => D), Kr))) !u && n.deprecated || (Array.isArray(n.choices) && (u || (n.choices = n.choices.filter((D) => !D.deprecated)), n.name === "parser" && (n.choices = [...n.choices, ...Yr(n.choices, t, e)])), n.pluginDefaults = Object.fromEntries(e.filter((D) => {
1221
- var a;
1222
- return ((a = D.defaultOptions) == null ? void 0 : a[n.name]) !== void 0;
1223
- }).map((D) => [D.name, D.defaultOptions[n.name]])), r.push(n));
1360
+ for (let n of Zr(Object.assign({}, ...e.map(({ options: D }) => D), Kr)))
1361
+ !u && n.deprecated || (Array.isArray(n.choices) && (u || (n.choices = n.choices.filter((D) => !D.deprecated)), n.name === "parser" && (n.choices = [...n.choices, ...Yr(n.choices, t, e)])), n.pluginDefaults = Object.fromEntries(e.filter((D) => {
1362
+ var a;
1363
+ return ((a = D.defaultOptions) == null ? void 0 : a[n.name]) !== void 0;
1364
+ }).map((D) => [D.name, D.defaultOptions[n.name]])), r.push(n));
1224
1365
  return { languages: t, options: r };
1225
1366
  }
1226
1367
  function* Yr(e, u, t) {
1227
1368
  let r = new Set(e.map((n) => n.value));
1228
- for (let n of u) if (n.parsers) {
1229
- for (let D of n.parsers) if (!r.has(D)) {
1230
- r.add(D);
1231
- let a = t.find((o) => o.parsers && Object.prototype.hasOwnProperty.call(o.parsers, D)), i = n.name;
1232
- a != null && a.name && (i += ` (plugin: ${a.name})`), yield { value: D, description: i };
1369
+ for (let n of u)
1370
+ if (n.parsers) {
1371
+ for (let D of n.parsers)
1372
+ if (!r.has(D)) {
1373
+ r.add(D);
1374
+ let a = t.find((o) => o.parsers && Object.prototype.hasOwnProperty.call(o.parsers, D)), i = n.name;
1375
+ a != null && a.name && (i += ` (plugin: ${a.name})`), yield { value: D, description: i };
1376
+ }
1233
1377
  }
1234
- }
1235
1378
  }
1236
1379
  function Zr(e) {
1237
1380
  let u = [];
@@ -1242,10 +1385,12 @@ function Zr(e) {
1242
1385
  return u;
1243
1386
  }
1244
1387
  var Qr = (e, u) => {
1245
- if (!(e && u == null)) return u.toReversed || !Array.isArray(u) ? u.toReversed() : [...u].reverse();
1388
+ if (!(e && u == null))
1389
+ return u.toReversed || !Array.isArray(u) ? u.toReversed() : [...u].reverse();
1246
1390
  }, Xr = Qr, ou, su, lu, cu, fu, en = ((ou = globalThis.Deno) == null ? void 0 : ou.build.os) === "windows" || ((lu = (su = globalThis.navigator) == null ? void 0 : su.platform) == null ? void 0 : lu.startsWith("Win")) || ((fu = (cu = globalThis.process) == null ? void 0 : cu.platform) == null ? void 0 : fu.startsWith("win")) || !1;
1247
1391
  function Xu(e) {
1248
- if (e = e instanceof URL ? e : new URL(e), e.protocol !== "file:") throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);
1392
+ if (e = e instanceof URL ? e : new URL(e), e.protocol !== "file:")
1393
+ throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);
1249
1394
  return e;
1250
1395
  }
1251
1396
  function un(e) {
@@ -1261,21 +1406,25 @@ function rn(e) {
1261
1406
  }
1262
1407
  var nn = rn, Dn = (e) => String(e).split(/[/\\]/u).pop();
1263
1408
  function du(e, u) {
1264
- if (!u) return;
1409
+ if (!u)
1410
+ return;
1265
1411
  let t = Dn(u).toLowerCase();
1266
1412
  return e.find(({ filenames: r }) => r?.some((n) => n.toLowerCase() === t)) ?? e.find(({ extensions: r }) => r?.some((n) => t.endsWith(n)));
1267
1413
  }
1268
1414
  function an(e, u) {
1269
- if (u) return e.find(({ name: t }) => t.toLowerCase() === u) ?? e.find(({ aliases: t }) => t?.includes(u)) ?? e.find(({ extensions: t }) => t?.includes(`.${u}`));
1415
+ if (u)
1416
+ return e.find(({ name: t }) => t.toLowerCase() === u) ?? e.find(({ aliases: t }) => t?.includes(u)) ?? e.find(({ extensions: t }) => t?.includes(`.${u}`));
1270
1417
  }
1271
1418
  function Fu(e, u) {
1272
1419
  if (u) {
1273
- if (String(u).startsWith("file:")) try {
1274
- u = nn(u);
1275
- } catch {
1276
- return;
1277
- }
1278
- if (typeof u == "string") return e.find(({ isSupported: t }) => t?.({ filepath: u }));
1420
+ if (String(u).startsWith("file:"))
1421
+ try {
1422
+ u = nn(u);
1423
+ } catch {
1424
+ return;
1425
+ }
1426
+ if (typeof u == "string")
1427
+ return e.find(({ isSupported: t }) => t?.({ filepath: u }));
1279
1428
  }
1280
1429
  }
1281
1430
  function on(e, u) {
@@ -1283,14 +1432,16 @@ function on(e, u) {
1283
1432
  return r?.parsers[0];
1284
1433
  }
1285
1434
  var sn = on, ue = { key: (e) => /^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e) ? e : JSON.stringify(e), value(e) {
1286
- if (e === null || typeof e != "object") return JSON.stringify(e);
1287
- if (Array.isArray(e)) return `[${e.map((t) => ue.value(t)).join(", ")}]`;
1435
+ if (e === null || typeof e != "object")
1436
+ return JSON.stringify(e);
1437
+ if (Array.isArray(e))
1438
+ return `[${e.map((t) => ue.value(t)).join(", ")}]`;
1288
1439
  let u = Object.keys(e);
1289
1440
  return u.length === 0 ? "{}" : `{ ${u.map((t) => `${ue.key(t)}: ${ue.value(e[t])}`).join(", ")} }`;
1290
1441
  }, pair: ({ key: e, value: u }) => ue.value({ [e]: u }) }, et = new Proxy(String, { get: () => et }), N = et, ln = (e, u, { descriptor: t }) => {
1291
1442
  let r = [`${N.yellow(typeof e == "string" ? t.key(e) : t.pair(e))} is deprecated`];
1292
1443
  return u && r.push(`we now treat it as ${N.blue(typeof u == "string" ? t.key(u) : t.pair(u))}`), r.join("; ") + ".";
1293
- }, ut = /* @__PURE__ */ Symbol.for("vnopts.VALUE_NOT_EXIST"), he = /* @__PURE__ */ Symbol.for("vnopts.VALUE_UNCHANGED"), pu = " ".repeat(2), cn = (e, u, t) => {
1444
+ }, ut = Symbol.for("vnopts.VALUE_NOT_EXIST"), he = Symbol.for("vnopts.VALUE_UNCHANGED"), pu = " ".repeat(2), cn = (e, u, t) => {
1294
1445
  let { text: r, list: n } = t.normalizeExpectedResult(t.schemas[e].expected(t)), D = [];
1295
1446
  return r && D.push(hu(e, u, r, t.descriptor)), n && D.push([hu(e, u, n.title, t.descriptor)].concat(n.values.map((a) => tt(a, t.loggerPrintWidth))).join(`
1296
1447
  `)), rt(D, t.loggerPrintWidth);
@@ -1304,24 +1455,32 @@ function tt({ text: e, list: u }, t) {
1304
1455
  `)), rt(r, t);
1305
1456
  }
1306
1457
  function rt(e, u) {
1307
- if (e.length === 1) return e[0];
1458
+ if (e.length === 1)
1459
+ return e[0];
1308
1460
  let [t, r] = e, [n, D] = e.map((a) => a.split(`
1309
1461
  `, 1)[0].length);
1310
1462
  return n > u && n > D ? r : t;
1311
1463
  }
1312
1464
  var Ne = [], Cu = [];
1313
1465
  function fn(e, u) {
1314
- if (e === u) return 0;
1466
+ if (e === u)
1467
+ return 0;
1315
1468
  let t = e;
1316
1469
  e.length > u.length && (e = u, u = t);
1317
1470
  let r = e.length, n = u.length;
1318
- for (; r > 0 && e.charCodeAt(~-r) === u.charCodeAt(~-n); ) r--, n--;
1471
+ for (; r > 0 && e.charCodeAt(~-r) === u.charCodeAt(~-n); )
1472
+ r--, n--;
1319
1473
  let D = 0;
1320
- for (; D < r && e.charCodeAt(D) === u.charCodeAt(D); ) D++;
1321
- if (r -= D, n -= D, r === 0) return n;
1474
+ for (; D < r && e.charCodeAt(D) === u.charCodeAt(D); )
1475
+ D++;
1476
+ if (r -= D, n -= D, r === 0)
1477
+ return n;
1322
1478
  let a, i, o, s, c = 0, F = 0;
1323
- for (; c < r; ) Cu[c] = e.charCodeAt(D + c), Ne[c] = ++c;
1324
- for (; F < n; ) for (a = u.charCodeAt(D + F), o = F++, i = F, c = 0; c < r; c++) s = a === Cu[c] ? o : o + 1, o = Ne[c], i = Ne[c] = o > i ? s > i ? i + 1 : s : s > o ? o + 1 : s;
1479
+ for (; c < r; )
1480
+ Cu[c] = e.charCodeAt(D + c), Ne[c] = ++c;
1481
+ for (; F < n; )
1482
+ for (a = u.charCodeAt(D + F), o = F++, i = F, c = 0; c < r; c++)
1483
+ s = a === Cu[c] ? o : o + 1, o = Ne[c], i = Ne[c] = o > i ? s > i ? i + 1 : s : s > o ? o + 1 : s;
1325
1484
  return i;
1326
1485
  }
1327
1486
  var nt = (e, u, { descriptor: t, logger: r, schemas: n }) => {
@@ -1330,7 +1489,8 @@ var nt = (e, u, { descriptor: t, logger: r, schemas: n }) => {
1330
1489
  }, dn = ["default", "expected", "validate", "deprecated", "forward", "redirect", "overlap", "preprocess", "postprocess"];
1331
1490
  function Fn(e, u) {
1332
1491
  let t = new e(u), r = Object.create(t);
1333
- for (let n of dn) n in u && (r[n] = pn(u[n], t, U.prototype[n].length));
1492
+ for (let n of dn)
1493
+ n in u && (r[n] = pn(u[n], t, U.prototype[n].length));
1334
1494
  return r;
1335
1495
  }
1336
1496
  var U = class {
@@ -1397,7 +1557,8 @@ var hn = class extends U {
1397
1557
  return { text: u && `an array of ${u}`, list: t && { title: "an array of the following values", values: [{ list: t }] } };
1398
1558
  }
1399
1559
  validate(e, u) {
1400
- if (!Array.isArray(e)) return !1;
1560
+ if (!Array.isArray(e))
1561
+ return !1;
1401
1562
  let t = [];
1402
1563
  for (let r of e) {
1403
1564
  let n = u.normalizeValidateResult(this._valueSchema.validate(r, u), r);
@@ -1448,7 +1609,8 @@ function gn(e, u) {
1448
1609
  let t = /* @__PURE__ */ Object.create(null);
1449
1610
  for (let r of e) {
1450
1611
  let n = r[u];
1451
- if (t[n]) throw new Error(`Duplicate ${u} ${JSON.stringify(n)}`);
1612
+ if (t[n])
1613
+ throw new Error(`Duplicate ${u} ${JSON.stringify(n)}`);
1452
1614
  t[n] = r;
1453
1615
  }
1454
1616
  return t;
@@ -1457,7 +1619,8 @@ function yn(e, u) {
1457
1619
  let t = /* @__PURE__ */ new Map();
1458
1620
  for (let r of e) {
1459
1621
  let n = r[u];
1460
- if (t.has(n)) throw new Error(`Duplicate ${u} ${JSON.stringify(n)}`);
1622
+ if (t.has(n))
1623
+ throw new Error(`Duplicate ${u} ${JSON.stringify(n)}`);
1461
1624
  t.set(n, r);
1462
1625
  }
1463
1626
  return t;
@@ -1471,14 +1634,16 @@ function vn() {
1471
1634
  }
1472
1635
  function Bn(e, u) {
1473
1636
  let t = [], r = [];
1474
- for (let n of e) u(n) ? t.push(n) : r.push(n);
1637
+ for (let n of e)
1638
+ u(n) ? t.push(n) : r.push(n);
1475
1639
  return [t, r];
1476
1640
  }
1477
1641
  function bn(e) {
1478
1642
  return e === Math.floor(e);
1479
1643
  }
1480
1644
  function An(e, u) {
1481
- if (e === u) return 0;
1645
+ if (e === u)
1646
+ return 0;
1482
1647
  let t = typeof e, r = typeof u, n = ["undefined", "object", "boolean", "number", "string"];
1483
1648
  return t !== r ? n.indexOf(t) - n.indexOf(r) : t !== "string" ? Number(e) - Number(u) : e.localeCompare(u);
1484
1649
  }
@@ -1492,7 +1657,8 @@ function Eu(e) {
1492
1657
  return e === void 0 ? {} : e;
1493
1658
  }
1494
1659
  function Dt(e) {
1495
- if (typeof e == "string") return { text: e };
1660
+ if (typeof e == "string")
1661
+ return { text: e };
1496
1662
  let { text: u, list: t } = e;
1497
1663
  return kn((u || t) !== void 0, "Unexpected `expected` result, there should be at least one field."), t ? { text: u, list: { title: t.title, values: t.values.map(Dt) } } : { text: u };
1498
1664
  }
@@ -1513,7 +1679,8 @@ function Bu(e, u) {
1513
1679
  return t.length === 0 ? { remain: u, redirect: t } : typeof e == "object" && "remain" in e ? { remain: e.remain, redirect: t } : { redirect: t };
1514
1680
  }
1515
1681
  function kn(e, u) {
1516
- if (!e) throw new Error(u);
1682
+ if (!e)
1683
+ throw new Error(u);
1517
1684
  }
1518
1685
  var Sn = class extends U {
1519
1686
  constructor(e) {
@@ -1585,7 +1752,8 @@ var Sn = class extends U {
1585
1752
  }
1586
1753
  r();
1587
1754
  for (let n of Object.keys(this._utils.schemas)) {
1588
- if (!(n in u)) continue;
1755
+ if (!(n in u))
1756
+ continue;
1589
1757
  let D = this._utils.schemas[n], a = u[n], i = D.postprocess(a, this._utils);
1590
1758
  i !== he && (this._applyValidation(i, n, D), u[n] = i);
1591
1759
  }
@@ -1600,14 +1768,17 @@ var Sn = class extends U {
1600
1768
  t.push(typeof l == "string" ? { [l]: F } : { [l.key]: l.value });
1601
1769
  }, s = ({ value: F, redirectTo: l }) => {
1602
1770
  let d = yu(a.deprecated(F, this._utils), i, !0);
1603
- if (d !== !1) if (d === !0) this._hasDeprecationWarned(D) || this._utils.logger.warn(this._deprecatedHandler(D, l, this._utils));
1604
- else for (let { value: f } of d) {
1605
- let h = { key: D, value: f };
1606
- if (!this._hasDeprecationWarned(h)) {
1607
- let p = typeof l == "string" ? { key: l, value: f } : l;
1608
- this._utils.logger.warn(this._deprecatedHandler(h, p, this._utils));
1609
- }
1610
- }
1771
+ if (d !== !1)
1772
+ if (d === !0)
1773
+ this._hasDeprecationWarned(D) || this._utils.logger.warn(this._deprecatedHandler(D, l, this._utils));
1774
+ else
1775
+ for (let { value: f } of d) {
1776
+ let h = { key: D, value: f };
1777
+ if (!this._hasDeprecationWarned(h)) {
1778
+ let p = typeof l == "string" ? { key: l, value: f } : l;
1779
+ this._utils.logger.warn(this._deprecatedHandler(h, p, this._utils));
1780
+ }
1781
+ }
1611
1782
  };
1612
1783
  Re(a.forward(i, this._utils), i).forEach(o);
1613
1784
  let c = Bu(a.redirect(i, this._utils), i);
@@ -1615,7 +1786,8 @@ var Sn = class extends U {
1615
1786
  let F = c.remain;
1616
1787
  u[D] = D in u ? a.overlap(u[D], F, this._utils) : F, s({ value: F });
1617
1788
  }
1618
- for (let { from: F, to: l } of c.redirect) s({ value: F, redirectTo: l });
1789
+ for (let { from: F, to: l } of c.redirect)
1790
+ s({ value: F, redirectTo: l });
1619
1791
  }
1620
1792
  for (let D of n) {
1621
1793
  let a = e[D];
@@ -1626,7 +1798,9 @@ var Sn = class extends U {
1626
1798
  return t;
1627
1799
  }
1628
1800
  _applyRequiredCheck(e) {
1629
- for (let u of Object.keys(this._utils.schemas)) if (this._identifyMissing(u, e) && this._identifyRequired(u)) throw this._invalidHandler(u, ut, this._utils);
1801
+ for (let u of Object.keys(this._utils.schemas))
1802
+ if (this._identifyMissing(u, e) && this._identifyRequired(u))
1803
+ throw this._invalidHandler(u, ut, this._utils);
1630
1804
  }
1631
1805
  _partitionOptionKeys(e) {
1632
1806
  let [u, t] = Bn(Object.keys(e).filter((r) => !this._identifyMissing(r, e)), (r) => r in this._utils.schemas);
@@ -1634,20 +1808,25 @@ var Sn = class extends U {
1634
1808
  }
1635
1809
  _applyValidation(e, u, t) {
1636
1810
  let r = gu(t.validate(e, this._utils), e);
1637
- if (r !== !0) throw this._invalidHandler(u, r.value, this._utils);
1811
+ if (r !== !0)
1812
+ throw this._invalidHandler(u, r.value, this._utils);
1638
1813
  }
1639
1814
  _applyUnknownHandler(e, u, t, r) {
1640
1815
  let n = this._unknownHandler(e, u, this._utils);
1641
- if (n) for (let D of Object.keys(n)) {
1642
- if (this._identifyMissing(D, n)) continue;
1643
- let a = n[D];
1644
- D in this._utils.schemas ? r(D, a) : t[D] = a;
1645
- }
1816
+ if (n)
1817
+ for (let D of Object.keys(n)) {
1818
+ if (this._identifyMissing(D, n))
1819
+ continue;
1820
+ let a = n[D];
1821
+ D in this._utils.schemas ? r(D, a) : t[D] = a;
1822
+ }
1646
1823
  }
1647
1824
  _applyPostprocess(e) {
1648
1825
  let u = this._postprocess(e, this._utils);
1649
1826
  if (u !== he) {
1650
- if (u.delete) for (let t of u.delete) delete e[t];
1827
+ if (u.delete)
1828
+ for (let t of u.delete)
1829
+ delete e[t];
1651
1830
  if (u.override) {
1652
1831
  let { knownKeys: t, unknownKeys: r } = this._partitionOptionKeys(u.override);
1653
1832
  for (let n of t) {
@@ -1667,9 +1846,12 @@ var Sn = class extends U {
1667
1846
  }, Oe;
1668
1847
  function Pn(e, u, { logger: t = !1, isCLI: r = !1, passThrough: n = !1, FlagSchema: D, descriptor: a } = {}) {
1669
1848
  if (r) {
1670
- if (!D) throw new Error("'FlagSchema' option is required.");
1671
- if (!a) throw new Error("'descriptor' option is required.");
1672
- } else a = ue;
1849
+ if (!D)
1850
+ throw new Error("'FlagSchema' option is required.");
1851
+ if (!a)
1852
+ throw new Error("'descriptor' option is required.");
1853
+ } else
1854
+ a = ue;
1673
1855
  let i = n ? Array.isArray(n) ? (l, d) => n.includes(l) ? { [l]: d } : void 0 : (l, d) => ({ [l]: d }) : (l, d, f) => {
1674
1856
  let { _: h, ...p } = f.schemas;
1675
1857
  return nt(l, d, { ...f, schemas: p });
@@ -1681,7 +1863,8 @@ function Pn(e, u, { logger: t = !1, isCLI: r = !1, passThrough: n = !1, FlagSche
1681
1863
  function $n(e, { isCLI: u, FlagSchema: t }) {
1682
1864
  let r = [];
1683
1865
  u && r.push(Cn.create({ name: "_" }));
1684
- for (let n of e) r.push(Ln(n, { isCLI: u, optionInfos: e, FlagSchema: t })), n.alias && u && r.push(hn.create({ name: n.alias, sourceName: n.name }));
1866
+ for (let n of e)
1867
+ r.push(Ln(n, { isCLI: u, optionInfos: e, FlagSchema: t })), n.alias && u && r.push(hn.create({ name: n.alias, sourceName: n.name }));
1685
1868
  return r;
1686
1869
  }
1687
1870
  function Ln(e, { isCLI: u, optionInfos: t, FlagSchema: r }) {
@@ -1716,24 +1899,30 @@ function Ln(e, { isCLI: u, optionInfos: t, FlagSchema: r }) {
1716
1899
  }
1717
1900
  var Rn = Pn, Wn = (e, u, t) => {
1718
1901
  if (!(e && u == null)) {
1719
- if (u.findLast) return u.findLast(t);
1902
+ if (u.findLast)
1903
+ return u.findLast(t);
1720
1904
  for (let r = u.length - 1; r >= 0; r--) {
1721
1905
  let n = u[r];
1722
- if (t(n, r, u)) return n;
1906
+ if (t(n, r, u))
1907
+ return n;
1723
1908
  }
1724
1909
  }
1725
1910
  }, at = Wn;
1726
1911
  function it(e, u) {
1727
- if (!u) throw new Error("parserName is required.");
1912
+ if (!u)
1913
+ throw new Error("parserName is required.");
1728
1914
  let t = at(!1, e, (n) => n.parsers && Object.prototype.hasOwnProperty.call(n.parsers, u));
1729
- if (t) return t;
1915
+ if (t)
1916
+ return t;
1730
1917
  let r = `Couldn't resolve parser "${u}".`;
1731
1918
  throw r += " Plugins must be explicitly added to the standalone bundle.", new Zu(r);
1732
1919
  }
1733
1920
  function Mn(e, u) {
1734
- if (!u) throw new Error("astFormat is required.");
1921
+ if (!u)
1922
+ throw new Error("astFormat is required.");
1735
1923
  let t = at(!1, e, (n) => n.printers && Object.prototype.hasOwnProperty.call(n.printers, u));
1736
- if (t) return t;
1924
+ if (t)
1925
+ return t;
1737
1926
  let r = `Couldn't find plugin for AST format "${u}".`;
1738
1927
  throw r += " Plugins must be explicitly added to the standalone bundle.", new Zu(r);
1739
1928
  }
@@ -1753,15 +1942,19 @@ var Au = { astFormat: "estree", printer: {}, originalText: void 0, locStart: nul
1753
1942
  async function zn(e, u = {}) {
1754
1943
  var t;
1755
1944
  let r = { ...e };
1756
- if (!r.parser) if (r.filepath) {
1757
- if (r.parser = sn(r, { physicalFile: r.filepath }), !r.parser) throw new iu(`No parser could be inferred for file "${r.filepath}".`);
1758
- } else throw new iu("No parser and no file path given, couldn't infer a parser.");
1945
+ if (!r.parser)
1946
+ if (r.filepath) {
1947
+ if (r.parser = sn(r, { physicalFile: r.filepath }), !r.parser)
1948
+ throw new iu(`No parser could be inferred for file "${r.filepath}".`);
1949
+ } else
1950
+ throw new iu("No parser and no file path given, couldn't infer a parser.");
1759
1951
  let n = Qu({ plugins: e.plugins, showDeprecated: !0 }).options, D = { ...Au, ...Object.fromEntries(n.filter((l) => l.default !== void 0).map((l) => [l.name, l.default])) }, a = it(r.plugins, r.parser), i = await ot(a, r.parser);
1760
1952
  r.astFormat = i.astFormat, r.locEnd = i.locEnd, r.locStart = i.locStart;
1761
1953
  let o = (t = a.printers) != null && t[i.astFormat] ? a : Mn(r.plugins, i.astFormat), s = await Vn(o, i.astFormat);
1762
1954
  r.printer = s;
1763
1955
  let c = o.defaultOptions ? Object.fromEntries(Object.entries(o.defaultOptions).filter(([, l]) => l !== void 0)) : {}, F = { ...D, ...c };
1764
- for (let [l, d] of Object.entries(F)) (r[l] === null || r[l] === void 0) && (r[l] = d);
1956
+ for (let [l, d] of Object.entries(F))
1957
+ (r[l] === null || r[l] === void 0) && (r[l] = d);
1765
1958
  return r.parser === "json" && (r.trailingComma = "none"), Rn(r, n, { passThrough: Object.keys(Au), ...u });
1766
1959
  }
1767
1960
  var ne = zn, qn = St(Ot());
@@ -1788,26 +1981,32 @@ function Jn(e, u) {
1788
1981
  var le = Un;
1789
1982
  async function Gn(e, u, t, r, n) {
1790
1983
  let { embeddedLanguageFormatting: D, printer: { embed: a, hasPrettierIgnore: i = () => !1, getVisitorKeys: o } } = t;
1791
- if (!a || D !== "auto") return;
1792
- if (a.length > 2) throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");
1984
+ if (!a || D !== "auto")
1985
+ return;
1986
+ if (a.length > 2)
1987
+ throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");
1793
1988
  let s = Be(a.getVisitorKeys ?? o), c = [];
1794
1989
  d();
1795
1990
  let F = e.stack;
1796
- for (let { print: f, node: h, pathStack: p } of c) try {
1797
- e.stack = p;
1798
- let C = await f(l, u, e, t);
1799
- C && n.set(h, C);
1800
- } catch (C) {
1801
- if (globalThis.PRETTIER_DEBUG) throw C;
1802
- }
1991
+ for (let { print: f, node: h, pathStack: p } of c)
1992
+ try {
1993
+ e.stack = p;
1994
+ let C = await f(l, u, e, t);
1995
+ C && n.set(h, C);
1996
+ } catch (C) {
1997
+ if (globalThis.PRETTIER_DEBUG)
1998
+ throw C;
1999
+ }
1803
2000
  e.stack = F;
1804
2001
  function l(f, h) {
1805
2002
  return Hn(f, h, t, r);
1806
2003
  }
1807
2004
  function d() {
1808
2005
  let { node: f } = e;
1809
- if (f === null || typeof f != "object" || i(e)) return;
1810
- for (let p of s(f)) Array.isArray(f[p]) ? e.each(d, p) : e.call(d, p);
2006
+ if (f === null || typeof f != "object" || i(e))
2007
+ return;
2008
+ for (let p of s(f))
2009
+ Array.isArray(f[p]) ? e.each(d, p) : e.call(d, p);
1811
2010
  let h = a(e, t);
1812
2011
  if (h) {
1813
2012
  if (typeof h == "function") {
@@ -1823,8 +2022,9 @@ async function Hn(e, u, t, r) {
1823
2022
  return Pu(a);
1824
2023
  }
1825
2024
  function Kn(e, u) {
1826
- let { originalText: t, [/* @__PURE__ */ Symbol.for("comments")]: r, locStart: n, locEnd: D, [/* @__PURE__ */ Symbol.for("printedComments")]: a } = u, { node: i } = e, o = n(i), s = D(i);
1827
- for (let c of r) n(c) >= o && D(c) <= s && a.add(c);
2025
+ let { originalText: t, [Symbol.for("comments")]: r, locStart: n, locEnd: D, [Symbol.for("printedComments")]: a } = u, { node: i } = e, o = n(i), s = D(i);
2026
+ for (let c of r)
2027
+ n(c) >= o && D(c) <= s && a.add(c);
1828
2028
  return t.slice(o, s);
1829
2029
  }
1830
2030
  var Yn = Kn;
@@ -1834,8 +2034,10 @@ async function be(e, u) {
1834
2034
  await Gn(r, a, u, be, n);
1835
2035
  let D = await wu(r, u, a, void 0, n);
1836
2036
  if (Hr(u), u.cursorOffset >= 0) {
1837
- if (u.nodeAfterCursor && !u.nodeBeforeCursor) return [K, D];
1838
- if (u.nodeBeforeCursor && !u.nodeAfterCursor) return [D, K];
2037
+ if (u.nodeAfterCursor && !u.nodeBeforeCursor)
2038
+ return [K, D];
2039
+ if (u.nodeBeforeCursor && !u.nodeAfterCursor)
2040
+ return [D, K];
1839
2041
  }
1840
2042
  return D;
1841
2043
  function a(o, s) {
@@ -1843,9 +2045,11 @@ async function be(e, u) {
1843
2045
  }
1844
2046
  function i(o) {
1845
2047
  let s = r.node;
1846
- if (s == null) return "";
2048
+ if (s == null)
2049
+ return "";
1847
2050
  let c = s && typeof s == "object" && o === void 0;
1848
- if (c && t.has(s)) return t.get(s);
2051
+ if (c && t.has(s))
2052
+ return t.get(s);
1849
2053
  let F = wu(r, u, a, o, n);
1850
2054
  return c && t.set(s, F), F;
1851
2055
  }
@@ -1868,14 +2072,16 @@ function wu(e, u, t, r, n) {
1868
2072
  }
1869
2073
  async function st(e, u) {
1870
2074
  let t = e.comments ?? [];
1871
- u[/* @__PURE__ */ Symbol.for("comments")] = t, u[/* @__PURE__ */ Symbol.for("printedComments")] = /* @__PURE__ */ new Set(), Wr(e, u);
2075
+ u[Symbol.for("comments")] = t, u[Symbol.for("printedComments")] = /* @__PURE__ */ new Set(), Wr(e, u);
1872
2076
  let { printer: { preprocess: r } } = u;
1873
2077
  return e = r ? await r(e, u) : e, { ast: e, comments: t };
1874
2078
  }
1875
2079
  function Zn(e, u) {
1876
2080
  let { cursorOffset: t, locStart: r, locEnd: n } = u, D = Be(u.printer.getVisitorKeys), a = (d) => r(d) <= t && n(d) >= t, i = e, o = [e];
1877
- for (let d of Nr(e, { getVisitorKeys: D, filter: a })) o.push(d), i = d;
1878
- if (Or(i, { getVisitorKeys: D })) return { cursorNode: i };
2081
+ for (let d of Nr(e, { getVisitorKeys: D, filter: a }))
2082
+ o.push(d), i = d;
2083
+ if (Or(i, { getVisitorKeys: D }))
2084
+ return { cursorNode: i };
1879
2085
  let s, c, F = -1, l = Number.POSITIVE_INFINITY;
1880
2086
  for (; o.length > 0 && (s === void 0 || c === void 0); ) {
1881
2087
  i = o.pop();
@@ -1896,24 +2102,31 @@ function Zn(e, u) {
1896
2102
  var lt = Zn;
1897
2103
  function Qn(e, u) {
1898
2104
  let { printer: { massageAstNode: t, getVisitorKeys: r } } = u;
1899
- if (!t) return e;
2105
+ if (!t)
2106
+ return e;
1900
2107
  let n = Be(r), D = t.ignoredProperties ?? /* @__PURE__ */ new Set();
1901
2108
  return a(e);
1902
2109
  function a(i, o) {
1903
- if (!(i !== null && typeof i == "object")) return i;
1904
- if (Array.isArray(i)) return i.map((l) => a(l, o)).filter(Boolean);
2110
+ if (!(i !== null && typeof i == "object"))
2111
+ return i;
2112
+ if (Array.isArray(i))
2113
+ return i.map((l) => a(l, o)).filter(Boolean);
1905
2114
  let s = {}, c = new Set(n(i));
1906
- for (let l in i) !Object.prototype.hasOwnProperty.call(i, l) || D.has(l) || (c.has(l) ? s[l] = a(i[l], i) : s[l] = i[l]);
2115
+ for (let l in i)
2116
+ !Object.prototype.hasOwnProperty.call(i, l) || D.has(l) || (c.has(l) ? s[l] = a(i[l], i) : s[l] = i[l]);
1907
2117
  let F = t(i, s, o);
1908
- if (F !== null) return F ?? s;
2118
+ if (F !== null)
2119
+ return F ?? s;
1909
2120
  }
1910
2121
  }
1911
2122
  var Xn = Qn, eD = (e, u, t) => {
1912
2123
  if (!(e && u == null)) {
1913
- if (u.findLastIndex) return u.findLastIndex(t);
2124
+ if (u.findLastIndex)
2125
+ return u.findLastIndex(t);
1914
2126
  for (let r = u.length - 1; r >= 0; r--) {
1915
2127
  let n = u[r];
1916
- if (t(n, r, u)) return r;
2128
+ if (t(n, r, u))
2129
+ return r;
1917
2130
  }
1918
2131
  return -1;
1919
2132
  }
@@ -1928,15 +2141,22 @@ function ku(e) {
1928
2141
  }
1929
2142
  function nD(e, u, { locStart: t, locEnd: r }) {
1930
2143
  let n = e.node, D = u.node;
1931
- if (n === D) return { startNode: n, endNode: D };
2144
+ if (n === D)
2145
+ return { startNode: n, endNode: D };
1932
2146
  let a = t(e.node);
1933
- for (let o of ku(u.parentNodes)) if (t(o) >= a) D = o;
1934
- else break;
2147
+ for (let o of ku(u.parentNodes))
2148
+ if (t(o) >= a)
2149
+ D = o;
2150
+ else
2151
+ break;
1935
2152
  let i = r(u.node);
1936
2153
  for (let o of ku(e.parentNodes)) {
1937
- if (r(o) <= i) n = o;
1938
- else break;
1939
- if (n === D) break;
2154
+ if (r(o) <= i)
2155
+ n = o;
2156
+ else
2157
+ break;
2158
+ if (n === D)
2159
+ break;
1940
2160
  }
1941
2161
  return { startNode: n, endNode: D };
1942
2162
  }
@@ -1945,9 +2165,11 @@ function We(e, u, t, r, n = [], D) {
1945
2165
  if (!(u > s || u < o || D === "rangeEnd" && u === o || D === "rangeStart" && u === s)) {
1946
2166
  for (let c of Ye(e, t)) {
1947
2167
  let F = We(c, u, t, r, [e, ...n], D);
1948
- if (F) return F;
2168
+ if (F)
2169
+ return F;
1949
2170
  }
1950
- if (!r || r(e, n[0])) return { node: e, parentNodes: n };
2171
+ if (!r || r(e, n[0]))
2172
+ return { node: e, parentNodes: n };
1951
2173
  }
1952
2174
  }
1953
2175
  function DD(e, u) {
@@ -1955,7 +2177,8 @@ function DD(e, u) {
1955
2177
  }
1956
2178
  var ct = /* @__PURE__ */ new Set(["JsonRoot", "ObjectExpression", "ArrayExpression", "StringLiteral", "NumericLiteral", "BooleanLiteral", "NullLiteral", "UnaryExpression", "TemplateLiteral"]), aD = /* @__PURE__ */ new Set(["OperationDefinition", "FragmentDefinition", "VariableDefinition", "TypeExtensionDefinition", "ObjectTypeDefinition", "FieldDefinition", "DirectiveDefinition", "EnumTypeDefinition", "EnumValueDefinition", "InputValueDefinition", "InputObjectTypeDefinition", "SchemaDefinition", "OperationTypeDefinition", "InterfaceTypeDefinition", "UnionTypeDefinition", "ScalarTypeDefinition"]);
1957
2179
  function Su(e, u, t) {
1958
- if (!u) return !1;
2180
+ if (!u)
2181
+ return !1;
1959
2182
  switch (e.parser) {
1960
2183
  case "flow":
1961
2184
  case "hermes":
@@ -1986,19 +2209,24 @@ function iD(e, u, t) {
1986
2209
  let { rangeStart: r, rangeEnd: n, locStart: D, locEnd: a } = u;
1987
2210
  Le.ok(n > r);
1988
2211
  let i = e.slice(r, n).search(/\S/u), o = i === -1;
1989
- if (!o) for (r += i; n > r && !/\S/u.test(e[n - 1]); --n) ;
2212
+ if (!o)
2213
+ for (r += i; n > r && !/\S/u.test(e[n - 1]); --n)
2214
+ ;
1990
2215
  let s = We(t, r, u, (d, f) => Su(u, d, f), [], "rangeStart"), c = o ? s : We(t, n, u, (d) => Su(u, d), [], "rangeEnd");
1991
- if (!s || !c) return { rangeStart: 0, rangeEnd: 0 };
2216
+ if (!s || !c)
2217
+ return { rangeStart: 0, rangeEnd: 0 };
1992
2218
  let F, l;
1993
2219
  if (tD(u)) {
1994
2220
  let d = rD(s, c);
1995
2221
  F = d, l = d;
1996
- } else ({ startNode: F, endNode: l } = nD(s, c, u));
2222
+ } else
2223
+ ({ startNode: F, endNode: l } = nD(s, c, u));
1997
2224
  return { rangeStart: Math.min(D(F), D(l)), rangeEnd: Math.max(a(F), a(l)) };
1998
2225
  }
1999
- var ft = "\uFEFF", xu = /* @__PURE__ */ Symbol("cursor");
2226
+ var ft = "\uFEFF", xu = Symbol("cursor");
2000
2227
  async function dt(e, u, t = 0) {
2001
- if (!e || e.trim().length === 0) return { formatted: "", cursorOffset: -1, comments: [] };
2228
+ if (!e || e.trim().length === 0)
2229
+ return { formatted: "", cursorOffset: -1, comments: [] };
2002
2230
  let { ast: r, text: n } = await le(e, u);
2003
2231
  u.cursorOffset >= 0 && (u = { ...u, ...lt(r, u) });
2004
2232
  let D = await be(r, u);
@@ -2008,25 +2236,33 @@ async function dt(e, u, t = 0) {
2008
2236
  let o = a.formatted.trim();
2009
2237
  a.cursorNodeStart !== void 0 && (a.cursorNodeStart -= a.formatted.indexOf(o), a.cursorNodeStart < 0 && (a.cursorNodeStart = 0, a.cursorNodeText = a.cursorNodeText.trimStart()), a.cursorNodeStart + a.cursorNodeText.length > o.length && (a.cursorNodeText = a.cursorNodeText.trimEnd())), a.formatted = o + ze(u.endOfLine);
2010
2238
  }
2011
- let i = u[/* @__PURE__ */ Symbol.for("comments")];
2239
+ let i = u[Symbol.for("comments")];
2012
2240
  if (u.cursorOffset >= 0) {
2013
2241
  let o, s, c, F;
2014
- if ((u.cursorNode || u.nodeBeforeCursor || u.nodeAfterCursor) && a.cursorNodeText) if (c = a.cursorNodeStart, F = a.cursorNodeText, u.cursorNode) o = u.locStart(u.cursorNode), s = n.slice(o, u.locEnd(u.cursorNode));
2015
- else {
2016
- if (!u.nodeBeforeCursor && !u.nodeAfterCursor) throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");
2017
- o = u.nodeBeforeCursor ? u.locEnd(u.nodeBeforeCursor) : 0;
2018
- let C = u.nodeAfterCursor ? u.locStart(u.nodeAfterCursor) : n.length;
2019
- s = n.slice(o, C);
2020
- }
2021
- else o = 0, s = n, c = 0, F = a.formatted;
2242
+ if ((u.cursorNode || u.nodeBeforeCursor || u.nodeAfterCursor) && a.cursorNodeText)
2243
+ if (c = a.cursorNodeStart, F = a.cursorNodeText, u.cursorNode)
2244
+ o = u.locStart(u.cursorNode), s = n.slice(o, u.locEnd(u.cursorNode));
2245
+ else {
2246
+ if (!u.nodeBeforeCursor && !u.nodeAfterCursor)
2247
+ throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");
2248
+ o = u.nodeBeforeCursor ? u.locEnd(u.nodeBeforeCursor) : 0;
2249
+ let C = u.nodeAfterCursor ? u.locStart(u.nodeAfterCursor) : n.length;
2250
+ s = n.slice(o, C);
2251
+ }
2252
+ else
2253
+ o = 0, s = n, c = 0, F = a.formatted;
2022
2254
  let l = u.cursorOffset - o;
2023
- if (s === F) return { formatted: a.formatted, cursorOffset: c + l, comments: i };
2255
+ if (s === F)
2256
+ return { formatted: a.formatted, cursorOffset: c + l, comments: i };
2024
2257
  let d = s.split("");
2025
2258
  d.splice(l, 0, xu);
2026
2259
  let f = F.split(""), h = $t(d, f), p = c;
2027
- for (let C of h) if (C.removed) {
2028
- if (C.value.includes(xu)) break;
2029
- } else p += C.count;
2260
+ for (let C of h)
2261
+ if (C.removed) {
2262
+ if (C.value.includes(xu))
2263
+ break;
2264
+ } else
2265
+ p += C.count;
2030
2266
  return { formatted: a.formatted, cursorOffset: p, comments: i };
2031
2267
  }
2032
2268
  return { formatted: a.formatted, cursorOffset: -1, comments: i };
@@ -2072,7 +2308,8 @@ async function sD(e, u) {
2072
2308
  }
2073
2309
  async function pt(e, u) {
2074
2310
  let { hasBOM: t, text: r, options: n } = Ft(e, await ne(u));
2075
- if (n.rangeStart >= n.rangeEnd && r !== "" || n.requirePragma && !await Ou(r, n) || n.checkIgnorePragma && await sD(r, n)) return { formatted: e, cursorOffset: u.cursorOffset, comments: [] };
2311
+ if (n.rangeStart >= n.rangeEnd && r !== "" || n.requirePragma && !await Ou(r, n) || n.checkIgnorePragma && await sD(r, n))
2312
+ return { formatted: e, cursorOffset: u.cursorOffset, comments: [] };
2076
2313
  let D;
2077
2314
  return n.rangeStart > 0 || n.rangeEnd < r.length ? D = await oD(r, n) : (!n.requirePragma && n.insertPragma && n.printer.insertPragma && !await Ou(r, n) && (r = n.printer.insertPragma(r)), D = await dt(r, n)), t && (D.formatted = ft + D.formatted, D.cursorOffset >= 0 && D.cursorOffset++), D;
2078
2315
  }
@@ -2102,9 +2339,12 @@ Ve(ht, { builders: () => pD, printer: () => hD, utils: () => CD });
2102
2339
  var pD = { join: Mu, line: Ru, softline: Fr, hardline: Y, literalline: Wu, group: $u, conditionalGroup: or, fill: sr, lineSuffix: je, lineSuffixBoundary: fr, cursor: K, breakParent: ge, ifBreak: lr, trim: dr, indent: Ce, indentIfBreak: cr, align: re, addAlignmentToDoc: Vu, markAsRoot: ar, dedentToRoot: Dr, dedent: ir, hardlineWithoutBreakParent: Je, literallineWithoutBreakParent: Lu, label: pr, concat: (e) => e }, hD = { printDocToString: ye }, CD = { willBreak: Ht, traverseDoc: qe, findInDoc: Ue, mapDoc: Ee, removeLines: Zt, stripTrailingHardline: Pu, replaceEndOfLine: er, canBreak: tr }, mD = "3.6.2", Ct = {};
2103
2340
  Ve(Ct, { addDanglingComment: () => G, addLeadingComment: () => ie, addTrailingComment: () => oe, getAlignmentSize: () => He, getIndentSize: () => bD, getMaxContinuousCount: () => kD, getNextNonSpaceNonCommentCharacter: () => xD, getNextNonSpaceNonCommentCharacterIndex: () => RD, getPreferredQuote: () => OD, getStringWidth: () => Ge, hasNewline: () => V, hasNewlineInRange: () => jD, hasSpaces: () => ID, isNextLineEmpty: () => zD, isNextLineEmptyAfterIndex: () => tu, isPreviousLineEmpty: () => MD, makeString: () => $D, skip: () => se, skipEverythingButNewLine: () => Ju, skipInlineComment: () => Xe, skipNewline: () => Z, skipSpaces: () => z, skipToLineEnd: () => Uu, skipTrailingComment: () => eu, skipWhitespace: () => _r });
2104
2341
  function ED(e, u) {
2105
- if (u === !1) return !1;
2342
+ if (u === !1)
2343
+ return !1;
2106
2344
  if (e.charAt(u) === "/" && e.charAt(u + 1) === "*") {
2107
- for (let t = u + 2; t < e.length; ++t) if (e.charAt(t) === "*" && e.charAt(t + 1) === "/") return t + 2;
2345
+ for (let t = u + 2; t < e.length; ++t)
2346
+ if (e.charAt(t) === "*" && e.charAt(t + 1) === "/")
2347
+ return t + 2;
2108
2348
  }
2109
2349
  return u;
2110
2350
  }
@@ -2115,13 +2355,15 @@ function gD(e, u) {
2115
2355
  var eu = gD;
2116
2356
  function yD(e, u) {
2117
2357
  let t = null, r = u;
2118
- for (; r !== t; ) t = r, r = z(e, r), r = Xe(e, r), r = eu(e, r), r = Z(e, r);
2358
+ for (; r !== t; )
2359
+ t = r, r = z(e, r), r = Xe(e, r), r = eu(e, r), r = Z(e, r);
2119
2360
  return r;
2120
2361
  }
2121
2362
  var uu = yD;
2122
2363
  function vD(e, u) {
2123
2364
  let t = null, r = u;
2124
- for (; r !== t; ) t = r, r = Uu(e, r), r = Xe(e, r), r = z(e, r);
2365
+ for (; r !== t; )
2366
+ t = r, r = Uu(e, r), r = Xe(e, r), r = z(e, r);
2125
2367
  return r = eu(e, r), r = Z(e, r), r !== !1 && V(e, r);
2126
2368
  }
2127
2369
  var tu = vD;
@@ -2132,7 +2374,8 @@ function BD(e, u) {
2132
2374
  }
2133
2375
  var bD = BD;
2134
2376
  function AD(e) {
2135
- if (typeof e != "string") throw new TypeError("Expected a string");
2377
+ if (typeof e != "string")
2378
+ throw new TypeError("Expected a string");
2136
2379
  return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
2137
2380
  }
2138
2381
  function wD(e, u) {
@@ -2147,13 +2390,16 @@ function SD(e, u) {
2147
2390
  var xD = SD, de = "'", _u = '"';
2148
2391
  function ND(e, u) {
2149
2392
  let t = u === !0 || u === de ? de : _u, r = t === de ? _u : de, n = 0, D = 0;
2150
- for (let a of e) a === t ? n++ : a === r && D++;
2393
+ for (let a of e)
2394
+ a === t ? n++ : a === r && D++;
2151
2395
  return n > D ? r : t;
2152
2396
  }
2153
2397
  var OD = ND;
2154
2398
  function _D(e, u, t) {
2155
- for (let r = u; r < t; ++r) if (e.charAt(r) === `
2156
- `) return !0;
2399
+ for (let r = u; r < t; ++r)
2400
+ if (e.charAt(r) === `
2401
+ `)
2402
+ return !0;
2157
2403
  return !1;
2158
2404
  }
2159
2405
  var jD = _D;