prettier-plugin-embed 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,28 +1,28 @@
1
- import { utils as G, builders as $ } from "prettier/doc";
2
- import Xe from "prettier/parser-babel";
3
- import Je from "prettier/parser-espree";
4
- import Ye from "prettier/parser-flow";
5
- import Ve from "prettier/parser-meriyah";
6
- import Qe from "prettier/parser-typescript";
7
- import { printers as Ze } from "prettier/plugins/estree.mjs";
8
- import { readFile as et } from "node:fs/promises";
9
- import { isAbsolute as tt, dirname as nt, resolve as rt, extname as st } from "node:path";
10
- import { Worker as ot } from "node:worker_threads";
11
- import { resolveConfigFile as it } from "prettier";
12
- const we = "embeddedCss", { group: at, indent: dt, softline: Y, lineSuffixBoundary: ct } = $, { mapDoc: lt } = G;
13
- function ut(t, n) {
1
+ import { utils as q, builders as I } from "prettier/doc";
2
+ import Je from "prettier/parser-babel";
3
+ import Ye from "prettier/parser-espree";
4
+ import Ve from "prettier/parser-flow";
5
+ import Qe from "prettier/parser-meriyah";
6
+ import Ze from "prettier/parser-typescript";
7
+ import { printers as et } from "prettier/plugins/estree.mjs";
8
+ import { readFile as tt } from "node:fs/promises";
9
+ import { isAbsolute as nt, dirname as rt, resolve as st, extname as ot } from "node:path";
10
+ import { Worker as it } from "node:worker_threads";
11
+ import { resolveConfigFile as at } from "prettier";
12
+ const Pe = "embeddedCss", { group: dt, indent: ct, softline: V, lineSuffixBoundary: lt } = I, { mapDoc: ut } = q;
13
+ function mt(t, n) {
14
14
  const { node: r } = t;
15
15
  let e = n();
16
- return r?.comments?.length && (e = at([dt([Y, e]), Y])), ["${", e, ct, "}"];
16
+ return r?.comments?.length && (e = dt([ct([V, e]), V])), ["${", e, lt, "}"];
17
17
  }
18
- function S(t, n) {
18
+ function D(t, n) {
19
19
  return t.map(
20
- (r) => ut(r, n),
20
+ (r) => mt(r, n),
21
21
  "expressions"
22
22
  );
23
23
  }
24
- function k(t, n, r) {
25
- return lt(t, (s) => {
24
+ function L(t, n, r) {
25
+ return ut(t, (s) => {
26
26
  if (typeof s != "string")
27
27
  return s;
28
28
  const o = [], a = s.split(n);
@@ -48,7 +48,7 @@ function A(t, n, r) {
48
48
  `Cannot format embedded language identified by "${r}", because plugin "${t}" is not loaded.`
49
49
  );
50
50
  }
51
- function mt(t, n, r) {
51
+ function gt(t, n, r) {
52
52
  if (n === r) {
53
53
  t.unshift(n);
54
54
  return;
@@ -64,7 +64,7 @@ function mt(t, n, r) {
64
64
  }
65
65
  t.splice(e, 0, n);
66
66
  }
67
- const V = (() => {
67
+ const Q = (() => {
68
68
  const t = [...Array(26).keys()].map((n) => String.fromCharCode(n + 97)).concat([...Array(10).keys()].map((n) => `${n}`));
69
69
  return () => {
70
70
  let r = "";
@@ -73,8 +73,8 @@ const V = (() => {
73
73
  return r;
74
74
  };
75
75
  })();
76
- function L(t = "p", n = "") {
77
- const r = V(), e = V(), s = Q(t), o = Q(n), a = (c) => `${t}${r}${c}${e}${n}`, i = new RegExp(
76
+ function S(t = "p", n = "") {
77
+ const r = Q(), e = Q(), s = Z(t), o = Z(n), a = (c) => `${t}${r}${c}${e}${n}`, i = new RegExp(
78
78
  `${s}${r}(\\d+)${e}${o}`,
79
79
  "g"
80
80
  );
@@ -83,42 +83,42 @@ function L(t = "p", n = "") {
83
83
  placeholderRegex: i
84
84
  };
85
85
  }
86
- function Q(t) {
86
+ function Z(t) {
87
87
  return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
88
88
  }
89
- function I(t) {
89
+ function $(t) {
90
90
  return `${t}Identifiers`;
91
91
  }
92
- function gt(t) {
92
+ function Me(t) {
93
93
  return `${t}Parser`;
94
94
  }
95
- const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
95
+ const { line: ee, group: k, indent: te, softline: ne } = I, pt = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
96
96
  e = {
97
97
  ...e,
98
98
  ...o
99
99
  };
100
- const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = L("@p"), l = a.quasis.map(
100
+ const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = S("@p"), l = a.quasis.map(
101
101
  (f, g, { length: h }) => g === h - 1 ? f.value.cooked : f.value.cooked + i(g)
102
- ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = S(r, n), b = await t(l, {
102
+ ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = D(r, n), b = await t(l, {
103
103
  ...e,
104
104
  parser: "scss"
105
- }), d = k(b, c, v);
105
+ }), d = L(b, c, v);
106
106
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(s))
107
- return O([
107
+ return k([
108
108
  "`",
109
109
  p,
110
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [O(d)] : ee([O(d)]),
110
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [k(d)] : te([k(d)]),
111
111
  u,
112
112
  "`"
113
113
  ]);
114
- const m = p.length ? Z : te, y = u.length ? Z : te;
115
- return O([
114
+ const m = p.length ? ee : ne, y = u.length ? ee : ne;
115
+ return k([
116
116
  "`",
117
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [m, O(d)] : ee([m, O(d)]),
117
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [m, k(d)] : te([m, k(d)]),
118
118
  y,
119
119
  "`"
120
120
  ]);
121
- }, ft = ["css"], ht = I(we), bt = {
121
+ }, ft = ["css"], ht = $(Pe), bt = {
122
122
  [ht]: {
123
123
  category: "Global",
124
124
  type: "string",
@@ -128,36 +128,36 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
128
128
  }
129
129
  }, yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
130
130
  __proto__: null,
131
- embeddedLanguage: we,
131
+ embeddedLanguage: Pe,
132
132
  embedder: pt,
133
133
  options: bt
134
- }, Symbol.toStringTag, { value: "Module" })), H = "embeddedEs", { line: ne, group: T, indent: re, softline: se } = $, vt = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
134
+ }, Symbol.toStringTag, { value: "Module" })), H = "embeddedEs", { line: re, group: T, indent: se, softline: oe } = I, vt = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
135
135
  e = {
136
136
  ...e,
137
137
  ...o
138
138
  };
139
- const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = L(), l = a.quasis.map(
139
+ const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = S(), l = a.quasis.map(
140
140
  (f, g, { length: h }) => g === h - 1 ? f.value.cooked : f.value.cooked + i(g)
141
- ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = S(r, n), b = await t(l, {
141
+ ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = D(r, n), b = await t(l, {
142
142
  ...e,
143
143
  parser: e.embeddedEsParser ?? "babel"
144
- }), d = k(b, c, v);
144
+ }), d = L(b, c, v);
145
145
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(s))
146
146
  return T([
147
147
  "`",
148
148
  p,
149
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [T(d)] : re([T(d)]),
149
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [T(d)] : se([T(d)]),
150
150
  u,
151
151
  "`"
152
152
  ]);
153
- const m = p.length ? ne : se, y = u.length ? ne : se;
153
+ const m = p.length ? re : oe, y = u.length ? re : oe;
154
154
  return T([
155
155
  "`",
156
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [m, T(d)] : re([m, T(d)]),
156
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [m, T(d)] : se([m, T(d)]),
157
157
  y,
158
158
  "`"
159
159
  ]);
160
- }, _t = [
160
+ }, Et = [
161
161
  "js",
162
162
  "jsx",
163
163
  "es",
@@ -166,12 +166,12 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
166
166
  "cjs",
167
167
  "pac",
168
168
  "javascript"
169
- ], Et = I(H), xt = gt(H), $t = {
170
- [Et]: {
169
+ ], _t = $(H), xt = Me(H), It = {
170
+ [_t]: {
171
171
  category: "Global",
172
172
  type: "string",
173
173
  array: !0,
174
- default: [{ value: [..._t] }],
174
+ default: [{ value: [...Et] }],
175
175
  description: "Specify embedded ES language identifiers."
176
176
  },
177
177
  [xt]: {
@@ -181,41 +181,41 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
181
181
  default: "babel",
182
182
  description: "Specify the embedded ES language parser."
183
183
  }
184
- }, It = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
184
+ }, $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
185
185
  __proto__: null,
186
186
  embeddedLanguage: H,
187
187
  embedder: vt,
188
- options: $t
189
- }, Symbol.toStringTag, { value: "Module" })), Pe = "embeddedGlsl", { line: oe, group: D, indent: ie, softline: ae } = $, St = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
188
+ options: It
189
+ }, Symbol.toStringTag, { value: "Module" })), Re = "embeddedGlsl", { line: ie, group: O, indent: ae, softline: de } = I, Dt = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
190
190
  A("prettier-plugin-glsl", e, s), e = {
191
191
  ...e,
192
192
  ...o
193
193
  };
194
- const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = L(), l = a.quasis.map(
195
- (g, h, { length: _ }) => h === _ - 1 ? g.value.cooked : g.value.cooked + i(h)
194
+ const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = S(), l = a.quasis.map(
195
+ (g, h, { length: E }) => h === E - 1 ? g.value.cooked : g.value.cooked + i(h)
196
196
  ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = l.slice(
197
197
  p.length,
198
198
  -u.length || void 0
199
- ), b = S(r, n), d = await t(v, {
199
+ ), b = D(r, n), d = await t(v, {
200
200
  ...e,
201
201
  parser: "glsl-parser"
202
- }), m = k(d, c, b);
202
+ }), m = L(d, c, b);
203
203
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(s))
204
- return D([
204
+ return O([
205
205
  "`",
206
206
  p,
207
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [D(m)] : ie([D(m)]),
207
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [O(m)] : ae([O(m)]),
208
208
  u,
209
209
  "`"
210
210
  ]);
211
- const y = p.length ? oe : ae, f = u.length ? oe : ae;
212
- return D([
211
+ const y = p.length ? ie : de, f = u.length ? ie : de;
212
+ return O([
213
213
  "`",
214
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [y, D(m)] : ie([y, D(m)]),
214
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [y, O(m)] : ae([y, O(m)]),
215
215
  f,
216
216
  "`"
217
217
  ]);
218
- }, Lt = [
218
+ }, St = [
219
219
  "glsl",
220
220
  "fp",
221
221
  "frag",
@@ -238,41 +238,41 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
238
238
  "vrx",
239
239
  "vsh",
240
240
  "vshader"
241
- ], kt = I(Pe), Ot = {
242
- [kt]: {
241
+ ], Lt = $(Re), kt = {
242
+ [Lt]: {
243
243
  category: "Global",
244
244
  type: "string",
245
245
  array: !0,
246
- default: [{ value: [...Lt] }],
246
+ default: [{ value: [...St] }],
247
247
  description: 'Specify embedded GLSL language identifiers. This requires "prettier-plugin-glsl".'
248
248
  }
249
249
  }, Tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
250
250
  __proto__: null,
251
- embeddedLanguage: Pe,
252
- embedder: St,
253
- options: Ot
254
- }, Symbol.toStringTag, { value: "Module" })), Re = "embeddedHtml", { line: de, group: w, indent: ce, softline: le } = $, { mapDoc: Dt } = G, wt = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
251
+ embeddedLanguage: Re,
252
+ embedder: Dt,
253
+ options: kt
254
+ }, Symbol.toStringTag, { value: "Module" })), Ne = "embeddedHtml", { line: ce, group: w, indent: le, softline: ue } = I, { mapDoc: Ot } = q, wt = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
255
255
  e = {
256
256
  ...e,
257
257
  ...o
258
258
  };
259
- const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = L(), l = a.quasis.map(
259
+ const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = S(), l = a.quasis.map(
260
260
  (f, g, { length: h }) => g === h - 1 ? f.value.cooked : f.value.cooked + i(g)
261
- ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = S(r, n), b = await t(l, {
261
+ ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = D(r, n), b = await t(l, {
262
262
  ...e,
263
263
  parser: "html"
264
- }), d = Dt(b, (f) => {
264
+ }), d = Ot(b, (f) => {
265
265
  if (typeof f != "string")
266
266
  return f;
267
267
  const g = [], h = f.split(c);
268
- for (let _ = 0; _ < h.length; _++) {
269
- let E = h[_];
270
- if (_ % 2 == 0) {
271
- if (!E)
268
+ for (let E = 0; E < h.length; E++) {
269
+ let _ = h[E];
270
+ if (E % 2 == 0) {
271
+ if (!_)
272
272
  continue;
273
- E = E.replaceAll(/([\\`]|\${)/g, "\\$1"), e.__embeddedInHtml && (E = E.replaceAll(/<\/(?=script\b)/gi, "<\\/")), g.push(E);
273
+ _ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), e.__embeddedInHtml && (_ = _.replaceAll(/<\/(?=script\b)/gi, "<\\/")), g.push(_);
274
274
  } else {
275
- const x = Number(E);
275
+ const x = Number(_);
276
276
  g.push(v[x]);
277
277
  }
278
278
  }
@@ -283,14 +283,14 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
283
283
  return w([
284
284
  "`",
285
285
  p,
286
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [w(d)] : ce([w(d)]),
286
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [w(d)] : le([w(d)]),
287
287
  u,
288
288
  "`"
289
289
  ]);
290
- const m = p.length ? de : le, y = u.length ? de : le;
290
+ const m = p.length ? ce : ue, y = u.length ? ce : ue;
291
291
  return w([
292
292
  "`",
293
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [m, w(d)] : ce([m, w(d)]),
293
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [m, w(d)] : le([m, w(d)]),
294
294
  y,
295
295
  "`"
296
296
  ]);
@@ -307,47 +307,47 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
307
307
  "jshtm",
308
308
  "volt",
309
309
  "rhtml"
310
- ], Rt = I(Re), Mt = {
311
- [Rt]: {
310
+ ], Mt = $(Ne), Rt = {
311
+ [Mt]: {
312
312
  category: "Global",
313
313
  type: "string",
314
314
  array: !0,
315
315
  default: [{ value: [...Pt] }],
316
316
  description: "Specify embedded HTML language identifiers."
317
317
  }
318
- }, Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
318
+ }, Nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
319
319
  __proto__: null,
320
- embeddedLanguage: Re,
320
+ embeddedLanguage: Ne,
321
321
  embedder: wt,
322
- options: Mt
323
- }, Symbol.toStringTag, { value: "Module" })), Me = "embeddedMarkdown", { line: ue, group: P, indent: me, softline: ge } = $, Nt = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
322
+ options: Rt
323
+ }, Symbol.toStringTag, { value: "Module" })), Fe = "embeddedMarkdown", { line: me, group: P, indent: ge, softline: pe } = I, Ft = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
324
324
  e = {
325
325
  ...e,
326
326
  ...o
327
327
  };
328
- const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = L(), l = a.quasis.map(
328
+ const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = S(), l = a.quasis.map(
329
329
  (f, g, { length: h }) => g === h - 1 ? f.value.cooked : f.value.cooked + i(g)
330
- ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = S(r, n), b = await t(l, {
330
+ ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = D(r, n), b = await t(l, {
331
331
  ...e,
332
332
  parser: "markdown",
333
333
  __inJsTemplate: !0
334
- }), d = k(b, c, v);
334
+ }), d = L(b, c, v);
335
335
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(s))
336
336
  return P([
337
337
  "`",
338
338
  p,
339
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [P(d)] : me([P(d)]),
339
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [P(d)] : ge([P(d)]),
340
340
  u,
341
341
  "`"
342
342
  ]);
343
- const m = p.length ? ue : ge, y = u.length ? ue : ge;
343
+ const m = p.length ? me : pe, y = u.length ? me : pe;
344
344
  return P([
345
345
  "`",
346
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [m, P(d)] : me([m, P(d)]),
346
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [m, P(d)] : ge([m, P(d)]),
347
347
  y,
348
348
  "`"
349
349
  ]);
350
- }, jt = [
350
+ }, Ct = [
351
351
  "md",
352
352
  "livemd",
353
353
  "markdown",
@@ -359,20 +359,20 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
359
359
  "ronn",
360
360
  "scd",
361
361
  "workbook"
362
- ], Ft = I(Me), At = {
363
- [Ft]: {
362
+ ], jt = $(Fe), At = {
363
+ [jt]: {
364
364
  category: "Global",
365
365
  type: "string",
366
366
  array: !0,
367
- default: [{ value: [...jt] }],
367
+ default: [{ value: [...Ct] }],
368
368
  description: "Specify embedded Markdown language identifiers."
369
369
  }
370
370
  }, Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
371
371
  __proto__: null,
372
- embeddedLanguage: Me,
373
- embedder: Nt,
372
+ embeddedLanguage: Fe,
373
+ embedder: Ft,
374
374
  options: At
375
- }, Symbol.toStringTag, { value: "Module" })), X = "embeddedNoop", Wt = I(X), qt = {
375
+ }, Symbol.toStringTag, { value: "Module" })), X = "embeddedNoop", Wt = $(X), Ut = {
376
376
  [Wt]: {
377
377
  category: "Global",
378
378
  type: "string",
@@ -380,41 +380,41 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
380
380
  default: [{ value: [] }],
381
381
  description: "Specify embedded language identifiers that will not be formatted."
382
382
  }
383
- }, Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
383
+ }, Gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
384
384
  __proto__: null,
385
385
  embeddedLanguage: X,
386
- options: qt
387
- }, Symbol.toStringTag, { value: "Module" })), Ce = "embeddedPhp", { line: pe, group: R, indent: fe, softline: he } = $, Ut = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
386
+ options: Ut
387
+ }, Symbol.toStringTag, { value: "Module" })), Ce = "embeddedPhp", { line: fe, group: M, indent: he, softline: be } = I, Kt = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
388
388
  A("@prettier/plugin-php", e, s), e = {
389
389
  ...e,
390
390
  ...o
391
391
  };
392
- const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = L("$p"), l = a.quasis.map(
393
- (g, h, { length: _ }) => h === _ - 1 ? g.value.cooked : g.value.cooked + i(h)
392
+ const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = S("$p"), l = a.quasis.map(
393
+ (g, h, { length: E }) => h === E - 1 ? g.value.cooked : g.value.cooked + i(h)
394
394
  ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = l.slice(
395
395
  p.length,
396
396
  -u.length || void 0
397
- ), b = S(r, n), d = await t(v, {
397
+ ), b = D(r, n), d = await t(v, {
398
398
  ...e,
399
399
  parser: "php"
400
- }), m = k(d, c, b);
400
+ }), m = L(d, c, b);
401
401
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(s))
402
- return R([
402
+ return M([
403
403
  "`",
404
404
  p,
405
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [R(m)] : fe([R(m)]),
405
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [M(m)] : he([M(m)]),
406
406
  u,
407
407
  "`"
408
408
  ]);
409
- const y = p.length ? pe : he, f = u.length ? pe : he;
410
- return R([
409
+ const y = p.length ? fe : be, f = u.length ? fe : be;
410
+ return M([
411
411
  "`",
412
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [y, R(m)] : fe([y, R(m)]),
412
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [y, M(m)] : he([y, M(m)]),
413
413
  f,
414
414
  "`"
415
415
  ]);
416
- }, zt = ["php", "php5", "phtml", "ctp"], Gt = I(Ce), Ht = {
417
- [Gt]: {
416
+ }, zt = ["php", "php5", "phtml", "ctp"], qt = $(Ce), Ht = {
417
+ [qt]: {
418
418
  category: "Global",
419
419
  type: "string",
420
420
  array: !0,
@@ -424,9 +424,9 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
424
424
  }, Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
425
425
  __proto__: null,
426
426
  embeddedLanguage: Ce,
427
- embedder: Ut,
427
+ embedder: Kt,
428
428
  options: Ht
429
- }, Symbol.toStringTag, { value: "Module" })), Ne = "embeddedRuby", q = [
429
+ }, Symbol.toStringTag, { value: "Module" })), je = "embeddedRuby", U = [
430
430
  "ruby",
431
431
  "arb",
432
432
  "axlsx",
@@ -452,11 +452,11 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
452
452
  "ru",
453
453
  "thor",
454
454
  "watchr"
455
- ], K = ["rbs"], U = ["haml"], Jt = [
456
- ...q,
457
- ...K,
458
- ...U
459
- ], Yt = "embeddedRubyParser", Vt = I(Ne), Qt = {
455
+ ], G = ["rbs"], K = ["haml"], Jt = [
456
+ ...U,
457
+ ...G,
458
+ ...K
459
+ ], Yt = "embeddedRubyParser", Vt = $(je), Qt = {
460
460
  [Vt]: {
461
461
  category: "Global",
462
462
  type: "string",
@@ -471,32 +471,32 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
471
471
  default: void 0,
472
472
  description: "Specify the embedded Ruby language parser."
473
473
  }
474
- }, { line: be, group: M, indent: ye, softline: ve } = $, Zt = async (t, n, r, e, { identifier: s, identifiers: o, embeddedOverrideOptions: a }) => {
474
+ }, { line: ye, group: R, indent: ve, softline: Ee } = I, Zt = async (t, n, r, e, { identifier: s, identifiers: o, embeddedOverrideOptions: a }) => {
475
475
  A("@prettier/plugin-ruby", e, s), e = {
476
476
  ...e,
477
477
  ...a
478
478
  };
479
- const { node: i } = r, { createPlaceholder: c, placeholderRegex: l } = L(), p = i.quasis.map(
480
- (_, E, { length: x }) => E === x - 1 ? _.value.cooked : _.value.cooked + c(E)
479
+ const { node: i } = r, { createPlaceholder: c, placeholderRegex: l } = S(), p = i.quasis.map(
480
+ (E, _, { length: x }) => _ === x - 1 ? E.value.cooked : E.value.cooked + c(_)
481
481
  ).join(""), u = p.match(/^\s+/)?.[0] ?? "", v = p.match(/\s+$/)?.[0] ?? "", b = p.slice(
482
482
  u.length,
483
483
  -v.length || void 0
484
- ), d = S(r, n), m = en(e, s, o), y = await t(b, {
484
+ ), d = D(r, n), m = en(e, s, o), y = await t(b, {
485
485
  ...e,
486
486
  parser: m
487
- }), f = k(y, l, d);
487
+ }), f = L(y, l, d);
488
488
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(s))
489
- return M([
489
+ return R([
490
490
  "`",
491
491
  u,
492
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [M(f)] : ye([M(f)]),
492
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [R(f)] : ve([R(f)]),
493
493
  v,
494
494
  "`"
495
495
  ]);
496
- const g = u.length ? be : ve, h = v.length ? be : ve;
497
- return M([
496
+ const g = u.length ? ye : Ee, h = v.length ? ye : Ee;
497
+ return R([
498
498
  "`",
499
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [g, M(f)] : ye([g, M(f)]),
499
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [g, R(f)] : ve([g, R(f)]),
500
500
  h,
501
501
  "`"
502
502
  ]);
@@ -507,179 +507,147 @@ function en(t, n, r) {
507
507
  const e = r.indexOf(n);
508
508
  for (let s = e; s >= 0; --s) {
509
509
  if (tn(n))
510
- return q[0];
510
+ return U[0];
511
511
  if (nn(n))
512
- return K[0];
512
+ return G[0];
513
513
  if (rn(n))
514
- return U[0];
514
+ return K[0];
515
515
  }
516
516
  throw new SyntaxError(`Unrecognized ruby identifier: ${n}`);
517
517
  }
518
518
  function tn(t) {
519
- return q.includes(t);
519
+ return U.includes(t);
520
520
  }
521
521
  function nn(t) {
522
- return K.includes(t);
522
+ return G.includes(t);
523
523
  }
524
524
  function rn(t) {
525
- return U.includes(t);
525
+ return K.includes(t);
526
526
  }
527
527
  const sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
528
528
  __proto__: null,
529
- HAML_PARSER_IDENTIFIERS: U,
530
- RBS_PARSER_IDENTIFIERS: K,
531
- RUBY_PARSER_IDENTIFIERS: q,
532
- embeddedLanguage: Ne,
529
+ HAML_PARSER_IDENTIFIERS: K,
530
+ RBS_PARSER_IDENTIFIERS: G,
531
+ RUBY_PARSER_IDENTIFIERS: U,
532
+ embeddedLanguage: je,
533
533
  embedder: Zt,
534
534
  options: Qt
535
- }, Symbol.toStringTag, { value: "Module" })), je = "embeddedSql", { hardline: on, group: C, line: _e, softline: Ee, indent: xe } = $, { mapDoc: an } = G, dn = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
535
+ }, Symbol.toStringTag, { value: "Module" })), Ae = "embeddedSql", { hardline: on, group: N, line: _e, softline: xe, indent: Ie } = I, { mapDoc: an } = q, dn = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
536
536
  A("prettier-plugin-sql", e, s), e = {
537
537
  ...e,
538
538
  ...o
539
539
  };
540
- const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = L(), l = a.quasis.map(
540
+ const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = S(), l = a.quasis.map(
541
541
  (f, g, { length: h }) => g === h - 1 ? f.value.cooked : f.value.cooked + i(g)
542
- ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = S(r, n), b = await t(l, {
542
+ ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = D(r, n), b = await t(l, {
543
543
  ...e,
544
544
  parser: "sql"
545
545
  }), d = an(b, (f) => {
546
546
  if (typeof f != "string")
547
547
  return f;
548
548
  const g = [], h = f.split(c);
549
- for (let _ = 0; _ < h.length; _++) {
550
- let E = h[_];
551
- if (_ % 2 == 0) {
552
- if (!E)
549
+ for (let E = 0; E < h.length; E++) {
550
+ let _ = h[E];
551
+ if (E % 2 == 0) {
552
+ if (!_)
553
553
  continue;
554
- E = E.replaceAll(/([\\`]|\${)/g, "\\$1"), E.split(/(\n)/).forEach((x) => x === `
554
+ _ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((x) => x === `
555
555
  ` ? g.push(on) : g.push(x));
556
556
  } else {
557
- const x = Number(E);
557
+ const x = Number(_);
558
558
  g.push(v[x]);
559
559
  }
560
560
  }
561
561
  return g;
562
562
  });
563
563
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(s))
564
- return C([
564
+ return N([
565
565
  "`",
566
566
  p,
567
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [C(d)] : xe([C(d)]),
567
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [N(d)] : Ie([N(d)]),
568
568
  u,
569
569
  "`"
570
570
  ]);
571
- const m = p.length ? _e : Ee, y = u.length ? _e : Ee;
572
- return C([
571
+ const m = p.length ? _e : xe, y = u.length ? _e : xe;
572
+ return N([
573
573
  "`",
574
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [m, C(d)] : xe([m, C(d)]),
574
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [m, N(d)] : Ie([m, N(d)]),
575
575
  y,
576
576
  "`"
577
577
  ]);
578
- }, cn = [
579
- "sql",
580
- "bigquery",
581
- "db2",
582
- "db2i",
583
- "hive",
584
- "mariadb",
585
- "mysql",
586
- "n1ql",
587
- "postgresql",
588
- "plsql",
589
- "redshift",
590
- "singlestoredb",
591
- "snowflake",
592
- "spark",
593
- "sqlite",
594
- "transactsql",
595
- "tsql",
596
- "trino"
597
- ], ln = [
598
- "bigquery",
599
- "db2",
600
- "hive",
601
- "mariadb",
602
- "mysql",
603
- "postgresql",
604
- "transactsql",
605
- "flinksql",
606
- "snowflake"
607
- ], un = I(je), mn = {
608
- [un]: {
578
+ }, cn = ["sql"], ln = $(Ae), un = {
579
+ [ln]: {
609
580
  category: "Global",
610
581
  type: "string",
611
582
  array: !0,
612
- // TODO: remove these hardcoded defaults once supported diacts are exported from prettier-plugin-sql
613
- default: [{ value: ["sql", "mysql", "mariadb", "postgresql"] }],
583
+ default: [{ value: [...cn] }],
614
584
  description: 'Specify embedded SQL language identifiers. This requires "prettier-plugin-sql".'
615
585
  }
616
- }, gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
586
+ }, mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
617
587
  __proto__: null,
618
- NODE_SQL_PARSER_DATABASES: ln,
619
- SQL_FORMATTER_LANGUAGES: cn,
620
- embeddedLanguage: je,
588
+ embeddedLanguage: Ae,
621
589
  embedder: dn,
622
- options: mn
623
- }, Symbol.toStringTag, { value: "Module" })), Fe = "embeddedTs", { line: $e, group: N, indent: Ie, softline: Se } = $, pn = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
590
+ options: un
591
+ }, Symbol.toStringTag, { value: "Module" })), J = "embeddedTs", { line: $e, group: F, indent: De, softline: Se } = I, gn = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
624
592
  e = {
625
593
  ...e,
626
594
  ...o
627
595
  };
628
- const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = L(), l = a.quasis.map(
596
+ const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = S(), l = a.quasis.map(
629
597
  (f, g, { length: h }) => g === h - 1 ? f.value.cooked : f.value.cooked + i(g)
630
- ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = S(r, n), b = await t(l, {
598
+ ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = D(r, n), b = await t(l, {
631
599
  ...e,
632
600
  parser: e.embeddedTsParser ?? "typescript",
633
601
  // set filepath to undefined to enable jsx auto detection:
634
602
  // https://github.com/prettier/prettier/blob/427a84d24203e2d54160cde153a1e6a6390fe65a/src/language-js/parse/typescript.js#L49-L53
635
603
  filepath: void 0
636
- }), d = k(b, c, v);
604
+ }), d = L(b, c, v);
637
605
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(s))
638
- return N([
606
+ return F([
639
607
  "`",
640
608
  p,
641
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [N(d)] : Ie([N(d)]),
609
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [F(d)] : De([F(d)]),
642
610
  u,
643
611
  "`"
644
612
  ]);
645
613
  const m = p.length ? $e : Se, y = u.length ? $e : Se;
646
- return N([
614
+ return F([
647
615
  "`",
648
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [m, N(d)] : Ie([m, N(d)]),
616
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [m, F(d)] : De([m, F(d)]),
649
617
  y,
650
618
  "`"
651
619
  ]);
652
- }, fn = ["ts", "tsx", "cts", "mts", "typescript"], hn = "embeddedTsParser", bn = I(Fe), yn = {
653
- [bn]: {
620
+ }, pn = ["ts", "tsx", "cts", "mts", "typescript"], fn = Me(J), hn = $(J), bn = {
621
+ [hn]: {
654
622
  category: "Global",
655
623
  type: "string",
656
624
  array: !0,
657
- default: [{ value: [...fn] }],
625
+ default: [{ value: [...pn] }],
658
626
  description: "Specify embedded TS language parsers."
659
627
  },
660
- [hn]: {
628
+ [fn]: {
661
629
  category: "Global",
662
630
  type: "string",
663
631
  array: !1,
664
632
  default: "typescript",
665
633
  description: "Specify the embedded TS language parser."
666
634
  }
667
- }, vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
635
+ }, yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
668
636
  __proto__: null,
669
- embeddedLanguage: Fe,
670
- embedder: pn,
671
- options: yn
672
- }, Symbol.toStringTag, { value: "Module" })), J = "embeddedXml", { line: Le, group: j, indent: ke, softline: z } = $, _n = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
637
+ embeddedLanguage: J,
638
+ embedder: gn,
639
+ options: bn
640
+ }, Symbol.toStringTag, { value: "Module" })), Y = "embeddedXml", { line: Le, group: C, indent: ke, softline: z } = I, vn = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
673
641
  A("@prettier/plugin-xml", e, s), e = {
674
642
  ...e,
675
643
  ...o
676
644
  };
677
- const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = L(), l = a.quasis.map(
678
- (h, _, { length: E }) => _ === E - 1 ? h.value.cooked : h.value.cooked + i(_)
645
+ const { node: a } = r, { createPlaceholder: i, placeholderRegex: c } = S(), l = a.quasis.map(
646
+ (h, E, { length: _ }) => E === _ - 1 ? h.value.cooked : h.value.cooked + i(E)
679
647
  ).join(""), p = l.match(/^\s+/)?.[0] ?? "", u = l.match(/\s+$/)?.[0] ?? "", v = l.slice(
680
648
  p.length,
681
649
  -u.length || void 0
682
- ), b = S(r, n), d = [];
650
+ ), b = D(r, n), d = [];
683
651
  let m = 0;
684
652
  for (; m !== void 0; ) {
685
653
  const h = v.slice(m);
@@ -689,26 +657,26 @@ const sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
689
657
  0,
690
658
  e.__embeddedXmlFragmentRecoverIndex.length
691
659
  );
692
- let _ = await t(h, {
660
+ let E = await t(h, {
693
661
  ...e,
694
- parser: J
662
+ parser: Y
695
663
  });
696
- const [E, x] = e.__embeddedXmlFragmentRecoverIndex ?? [];
697
- E === void 0 ? m = void 0 : x === void 0 ? m += E : (_ = h.slice(E, x + 1), m += x + 1), d.push(_);
664
+ const [_, x] = e.__embeddedXmlFragmentRecoverIndex ?? [];
665
+ _ === void 0 ? m = void 0 : x === void 0 ? m += _ : (E = h.slice(_, x + 1), m += x + 1), d.push(E);
698
666
  }
699
- const y = k(d, c, b);
667
+ const y = L(d, c, b);
700
668
  if (e.xmlWhitespaceSensitivity === "strict" || e.preserveEmbeddedExteriorWhitespaces?.includes(s))
701
- return j([
669
+ return C([
702
670
  "`",
703
671
  p,
704
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [j(y)] : ke([j(y)]),
672
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [C(y)] : ke([C(y)]),
705
673
  u,
706
674
  "`"
707
675
  ]);
708
676
  const f = p.length ? Le : z, g = u.length ? Le : z;
709
- return j([
677
+ return C([
710
678
  "`",
711
- e.noEmbeddedMultiLineIndentation?.includes(s) ? [f, j(y)] : ke([f, j(y)]),
679
+ e.noEmbeddedMultiLineIndentation?.includes(s) ? [f, C(y)] : ke([f, C(y)]),
712
680
  g,
713
681
  "`"
714
682
  ]);
@@ -769,8 +737,8 @@ const sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
769
737
  "xpdl",
770
738
  "xul",
771
739
  "xoml"
772
- ], xn = I(J), $n = {
773
- [xn]: {
740
+ ], _n = $(Y), xn = {
741
+ [_n]: {
774
742
  category: "Global",
775
743
  type: "string",
776
744
  array: !0,
@@ -806,7 +774,7 @@ function In(t) {
806
774
  );
807
775
  return Object.assign(r, n), r;
808
776
  }
809
- function Oe(t) {
777
+ function Te(t) {
810
778
  const n = {
811
779
  loc: {
812
780
  start: {
@@ -826,7 +794,7 @@ function Oe(t) {
826
794
  );
827
795
  return Object.assign(r, n), r;
828
796
  }
829
- const Sn = {
797
+ const $n = {
830
798
  async parse(t, n) {
831
799
  const { parse: r } = await import("@xml-tools/parser"), { lexErrors: e, parseErrors: s, cst: o } = r(t);
832
800
  if (e.length > 0) {
@@ -839,7 +807,7 @@ const Sn = {
839
807
  if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
840
808
  i.name
841
809
  ))
842
- throw Oe(i);
810
+ throw Te(i);
843
811
  if (i.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
844
812
  a = !0;
845
813
  continue;
@@ -867,9 +835,9 @@ const Sn = {
867
835
  ), a = !0;
868
836
  break;
869
837
  }
870
- throw Oe(i);
838
+ throw Te(i);
871
839
  }
872
- a && Ae(o);
840
+ a && Be(o);
873
841
  }
874
842
  return o;
875
843
  },
@@ -881,95 +849,95 @@ const Sn = {
881
849
  return t.location.endOffset ?? NaN;
882
850
  }
883
851
  };
884
- function Ae(t) {
852
+ function Be(t) {
885
853
  const n = t.children;
886
854
  for (const r in n) {
887
855
  const e = n[r] ?? [];
888
856
  for (let s = e.length - 1; s >= 0; --s) {
889
857
  const o = e[s];
890
- if (Ln(o)) {
858
+ if (Dn(o)) {
891
859
  if (Object.keys(o.children).length === 0) {
892
860
  e.splice(s, 1), e.length === 0 && delete n[r];
893
861
  continue;
894
862
  }
895
- Ae(o);
863
+ Be(o);
896
864
  }
897
865
  }
898
866
  }
899
867
  }
900
- function Ln(t) {
868
+ function Dn(t) {
901
869
  return "name" in t && "children" in t && "location" in t;
902
870
  }
903
- const kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
871
+ const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
904
872
  __proto__: null,
905
- embeddedLanguage: J,
906
- embedder: _n,
907
- options: $n,
908
- parser: Sn
909
- }, Symbol.toStringTag, { value: "Module" })), Be = [], We = {}, qe = {}, Ke = {}, On = /* @__PURE__ */ Object.assign({
873
+ embeddedLanguage: Y,
874
+ embedder: vn,
875
+ options: xn,
876
+ parser: $n
877
+ }, Symbol.toStringTag, { value: "Module" })), We = [], Ue = {}, Ge = {}, Ke = {}, Ln = /* @__PURE__ */ Object.assign({
910
878
  "./css/index.ts": yt,
911
- "./es/index.ts": It,
879
+ "./es/index.ts": $t,
912
880
  "./glsl/index.ts": Tt,
913
- "./html/index.ts": Ct,
881
+ "./html/index.ts": Nt,
914
882
  "./markdown/index.ts": Bt,
915
- "./noop/index.ts": Kt,
883
+ "./noop/index.ts": Gt,
916
884
  "./php/index.ts": Xt,
917
885
  "./ruby/index.ts": sn,
918
- "./sql/index.ts": gn,
919
- "./ts/index.ts": vn,
920
- "./xml/index.ts": kn
886
+ "./sql/index.ts": mn,
887
+ "./ts/index.ts": yn,
888
+ "./xml/index.ts": Sn
921
889
  });
922
- Object.values(On).forEach(
890
+ Object.values(Ln).forEach(
923
891
  ({ embeddedLanguage: t, parser: n, embedder: r, options: e }) => {
924
- mt(Be, t, X), n && (We[t] = n), r && (qe[t] = r), Object.assign(Ke, e);
892
+ gt(We, t, X), n && (Ue[t] = n), r && (Ge[t] = r), Object.assign(Ke, e);
925
893
  }
926
894
  );
927
- const Tn = "noEmbeddedIdentificationByComment", Dn = "noEmbeddedIdentificationByTag", wn = "preserveEmbeddedExteriorWhitespaces", Pn = "noEmbeddedMultiLineIndentation", Rn = "embeddedOverrides", ir = {
895
+ const kn = "noEmbeddedIdentificationByComment", Tn = "noEmbeddedIdentificationByTag", On = "preserveEmbeddedExteriorWhitespaces", wn = "noEmbeddedMultiLineIndentation", Pn = "embeddedOverrides", or = {
928
896
  ...Ke,
929
- [Tn]: {
897
+ [kn]: {
930
898
  category: "Global",
931
899
  type: "string",
932
900
  array: !0,
933
901
  default: [{ value: [] }],
934
902
  description: 'This option turns off "/* identifier */ `...`" comment-based language identification for the specified identifiers.'
935
903
  },
936
- [Dn]: {
904
+ [Tn]: {
937
905
  category: "Global",
938
906
  type: "string",
939
907
  array: !0,
940
908
  default: [{ value: [] }],
941
909
  description: 'This option turns off "identifier`...`" tag-based language identification for the specified identifiers.'
942
910
  },
943
- [wn]: {
911
+ [On]: {
944
912
  category: "Config",
945
913
  type: "string",
946
914
  array: !0,
947
915
  default: [{ value: [] }],
948
916
  description: "This option preserves leading and trailing whitespaces in the formatting results for the specified identifiers."
949
917
  },
950
- [Pn]: {
918
+ [wn]: {
951
919
  category: "Global",
952
920
  type: "string",
953
921
  array: !0,
954
922
  default: [{ value: [] }],
955
923
  description: "This option turns off auto indentation in the formatting results for the specified identifiers when they are formatted to span multi lines."
956
924
  },
957
- [Rn]: {
925
+ [Pn]: {
958
926
  category: "Global",
959
927
  type: "string",
960
928
  array: !1,
961
929
  default: void 0,
962
930
  description: "This option accepts option overrides for the specified identifiers. It should either be a stringified JSON or an absolute filepath to the option overrides file."
963
931
  }
964
- }, ar = {
932
+ }, ir = {
965
933
  // parsers from internal
966
- ...Xe.parsers,
967
934
  ...Je.parsers,
968
935
  ...Ye.parsers,
969
- ...Qe.parsers,
970
936
  ...Ve.parsers,
937
+ ...Ze.parsers,
938
+ ...Qe.parsers,
971
939
  // parsers from this plugin
972
- ...We
940
+ ...Ue
973
941
  };
974
942
  var Mn = {
975
943
  isEqual: !0,
@@ -980,10 +948,10 @@ var Mn = {
980
948
  onCacheChange: !0,
981
949
  onCacheHit: !0,
982
950
  transformKey: !0
983
- }, Cn = Array.prototype.slice;
951
+ }, Rn = Array.prototype.slice;
984
952
  function W(t) {
985
953
  var n = t.length;
986
- return n ? n === 1 ? [t[0]] : n === 2 ? [t[0], t[1]] : n === 3 ? [t[0], t[1], t[2]] : Cn.call(t, 0) : [];
954
+ return n ? n === 1 ? [t[0]] : n === 2 ? [t[0], t[1]] : n === 3 ? [t[0], t[1], t[2]] : Rn.call(t, 0) : [];
987
955
  }
988
956
  function Nn(t) {
989
957
  var n = {};
@@ -991,13 +959,13 @@ function Nn(t) {
991
959
  Mn[r] || (n[r] = t[r]);
992
960
  return n;
993
961
  }
994
- function jn(t) {
962
+ function Fn(t) {
995
963
  return typeof t == "function" && t.isMemoized;
996
964
  }
997
- function Fn(t, n) {
965
+ function Cn(t, n) {
998
966
  return t === n || t !== t && n !== n;
999
967
  }
1000
- function Te(t, n) {
968
+ function Oe(t, n) {
1001
969
  var r = {};
1002
970
  for (var e in t)
1003
971
  r[e] = t[e];
@@ -1005,7 +973,7 @@ function Te(t, n) {
1005
973
  r[e] = n[e];
1006
974
  return r;
1007
975
  }
1008
- var An = (
976
+ var jn = (
1009
977
  /** @class */
1010
978
  function() {
1011
979
  function t(n) {
@@ -1101,12 +1069,12 @@ var An = (
1101
1069
  }, t;
1102
1070
  }()
1103
1071
  );
1104
- function Ue(t, n) {
1105
- if (n === void 0 && (n = {}), jn(t))
1106
- return Ue(t.fn, Te(t.options, n));
1072
+ function ze(t, n) {
1073
+ if (n === void 0 && (n = {}), Fn(t))
1074
+ return ze(t.fn, Oe(t.options, n));
1107
1075
  if (typeof t != "function")
1108
1076
  throw new TypeError("You must pass a function to `memoize`.");
1109
- var r = n.isEqual, e = r === void 0 ? Fn : r, s = n.isMatchingKey, o = n.isPromise, a = o === void 0 ? !1 : o, i = n.maxSize, c = i === void 0 ? 1 : i, l = n.onCacheAdd, p = n.onCacheChange, u = n.onCacheHit, v = n.transformKey, b = Te({
1077
+ var r = n.isEqual, e = r === void 0 ? Cn : r, s = n.isMatchingKey, o = n.isPromise, a = o === void 0 ? !1 : o, i = n.maxSize, c = i === void 0 ? 1 : i, l = n.onCacheAdd, p = n.onCacheChange, u = n.onCacheHit, v = n.transformKey, b = Oe({
1110
1078
  isEqual: e,
1111
1079
  isMatchingKey: s,
1112
1080
  isPromise: a,
@@ -1115,33 +1083,33 @@ function Ue(t, n) {
1115
1083
  onCacheChange: p,
1116
1084
  onCacheHit: u,
1117
1085
  transformKey: v
1118
- }, Nn(n)), d = new An(b), m = d.keys, y = d.values, f = d.canTransformKey, g = d.shouldCloneArguments, h = d.shouldUpdateOnAdd, _ = d.shouldUpdateOnChange, E = d.shouldUpdateOnHit, x = function() {
1086
+ }, Nn(n)), d = new jn(b), m = d.keys, y = d.values, f = d.canTransformKey, g = d.shouldCloneArguments, h = d.shouldUpdateOnAdd, E = d.shouldUpdateOnChange, _ = d.shouldUpdateOnHit, x = function() {
1119
1087
  var B = g ? W(arguments) : arguments;
1120
1088
  f && (B = v(B));
1121
- var F = m.length ? d.getKeyIndex(B) : -1;
1122
- if (F !== -1)
1123
- E && u(d, b, x), F && (d.orderByLru(m[F], y[F], F), _ && p(d, b, x));
1089
+ var j = m.length ? d.getKeyIndex(B) : -1;
1090
+ if (j !== -1)
1091
+ _ && u(d, b, x), j && (d.orderByLru(m[j], y[j], j), E && p(d, b, x));
1124
1092
  else {
1125
- var Ge = t.apply(this, arguments), He = g ? B : W(arguments);
1126
- d.orderByLru(He, Ge, m.length), a && d.updateAsyncCache(x), h && l(d, b, x), _ && p(d, b, x);
1093
+ var He = t.apply(this, arguments), Xe = g ? B : W(arguments);
1094
+ d.orderByLru(Xe, He, m.length), a && d.updateAsyncCache(x), h && l(d, b, x), E && p(d, b, x);
1127
1095
  }
1128
1096
  return y[0];
1129
1097
  };
1130
1098
  return x.cache = d, x.fn = t, x.isMemoized = !0, x.options = b, x;
1131
1099
  }
1132
- async function De(t) {
1100
+ async function we(t) {
1133
1101
  try {
1134
- const n = await et(t, { encoding: "utf-8" });
1102
+ const n = await tt(t, { encoding: "utf-8" });
1135
1103
  return JSON.parse(n);
1136
1104
  } catch {
1137
1105
  }
1138
1106
  }
1139
- const Bn = /* @__PURE__ */ new URL(
1107
+ const An = /* @__PURE__ */ new URL(
1140
1108
  "data:text/javascript," + encodeURIComponent('import{pathToFileURL as r}from"node:url";import{parentPort as t,workerData as a}from"node:worker_threads";const s=async({absolutePath:o})=>{try{const e=await import(r(o).href);t?.postMessage(e.embeddedOverrides??e.default??void 0)}catch{t?.postMessage(void 0)}};s(a);')
1141
1109
  );
1142
- async function Wn(t) {
1110
+ async function Bn(t) {
1143
1111
  return new Promise((n) => {
1144
- const r = new ot(Bn, {
1112
+ const r = new it(An, {
1145
1113
  workerData: {
1146
1114
  absolutePath: t
1147
1115
  }
@@ -1153,44 +1121,44 @@ async function Wn(t) {
1153
1121
  });
1154
1122
  });
1155
1123
  }
1156
- async function qn(t) {
1124
+ async function Wn(t) {
1157
1125
  console.error(
1158
1126
  "Ts module type embeddedOverrides has not been implemented yet."
1159
1127
  );
1160
1128
  }
1161
- const Kn = Ue(
1129
+ const Un = ze(
1162
1130
  async (t, n) => {
1163
- if (tt(t))
1131
+ if (nt(t))
1164
1132
  return t;
1165
- const r = await it(n);
1133
+ const r = await at(n);
1166
1134
  let e;
1167
- return typeof r != "string" ? e = process.env.PWD ?? process.cwd() : e = nt(r), rt(e, t);
1135
+ return typeof r != "string" ? e = process.env.PWD ?? process.cwd() : e = rt(r), st(e, t);
1168
1136
  }
1169
- ), Un = async (t, n) => {
1170
- const r = Kn(
1137
+ ), Gn = async (t, n) => {
1138
+ const r = Un(
1171
1139
  t,
1172
1140
  n
1173
- ), e = st(t);
1141
+ ), e = ot(t);
1174
1142
  if (e === ".json") {
1175
- const s = await r, o = await De(s);
1143
+ const s = await r, o = await we(s);
1176
1144
  if (o !== void 0)
1177
1145
  return o;
1178
1146
  console.error(`Failed to parse the json file: ${s}`);
1179
1147
  return;
1180
1148
  } else if (e === ".mjs" || e === ".cjs" || e === ".js") {
1181
- const s = await r, o = await Wn(s);
1149
+ const s = await r, o = await Bn(s);
1182
1150
  if (o !== void 0)
1183
1151
  return o;
1184
1152
  console.error(`Failed to parse the js module file: ${s}`);
1185
1153
  return;
1186
1154
  } else if (e === ".mts" || e === ".cts" || e === ".ts") {
1187
- const s = await r, o = await qn();
1155
+ const s = await r, o = await Wn();
1188
1156
  if (o !== void 0)
1189
1157
  return o;
1190
1158
  console.error(`Failed to parse the ts module file: ${s}`);
1191
1159
  return;
1192
1160
  } else if (e === "") {
1193
- const s = await r, o = await De(s);
1161
+ const s = await r, o = await we(s);
1194
1162
  if (o !== void 0)
1195
1163
  return o;
1196
1164
  }
@@ -1199,10 +1167,10 @@ const Kn = Ue(
1199
1167
  } catch {
1200
1168
  console.error("Failed to parse embeddedOverrides as a json object");
1201
1169
  }
1202
- }, zn = async (t, n, r) => {
1170
+ }, Kn = async (t, n, r) => {
1203
1171
  if (t === void 0)
1204
1172
  return;
1205
- const e = await Un(
1173
+ const e = await Gn(
1206
1174
  t,
1207
1175
  r
1208
1176
  );
@@ -1215,7 +1183,7 @@ const Kn = Ue(
1215
1183
  console.error("Error parsing embedded override options.");
1216
1184
  }
1217
1185
  };
1218
- function Gn({ node: t, parent: n }, r, e) {
1186
+ function zn({ node: t, parent: n }, r, e) {
1219
1187
  if (r.length === 0 || t.type !== "TemplateLiteral")
1220
1188
  return;
1221
1189
  const s = t.comments ?? n?.comments;
@@ -1235,38 +1203,38 @@ function Gn({ node: t, parent: n }, r, e) {
1235
1203
  return a;
1236
1204
  }
1237
1205
  }
1238
- function Hn({ node: t, parent: n }, r, e) {
1206
+ function qn({ node: t, parent: n }, r, e) {
1239
1207
  if (r.length !== 0 && !(t.type !== "TemplateLiteral" || n?.type !== "TaggedTemplateExpression" || n.tag.type !== "Identifier")) {
1240
1208
  for (const s of r)
1241
1209
  if (n.tag.name === s && !e.includes(s))
1242
1210
  return s;
1243
1211
  }
1244
1212
  }
1245
- const { estree: ze } = Ze, Xn = function(t, n) {
1213
+ const { estree: qe } = et, Hn = function(t, n) {
1246
1214
  const { node: r } = t;
1247
1215
  if (r.type !== "TemplateLiteral" || r.quasis.some(({ value: { cooked: e } }) => e === null))
1248
1216
  return null;
1249
- for (const e of Be) {
1250
- const s = n[I(e)];
1217
+ for (const e of We) {
1218
+ const s = n[$(e)];
1251
1219
  if (!s)
1252
1220
  continue;
1253
- const o = Gn(
1221
+ const o = zn(
1254
1222
  t,
1255
1223
  s,
1256
1224
  n.noEmbeddedIdentificationByComment ?? []
1257
- ) ?? Hn(
1225
+ ) ?? qn(
1258
1226
  t,
1259
1227
  s,
1260
1228
  n.noEmbeddedIdentificationByTag ?? []
1261
1229
  );
1262
1230
  if (o === void 0)
1263
1231
  continue;
1264
- const a = qe[e];
1232
+ const a = Ge[e];
1265
1233
  if (!a)
1266
1234
  return null;
1267
1235
  const i = t.node;
1268
1236
  return i.quasis.length === 1 && i.quasis[0].value.raw.trim() === "" ? "``" : async (c, l, p, u) => {
1269
- const v = await zn(
1237
+ const v = await Kn(
1270
1238
  u.embeddedOverrides,
1271
1239
  o,
1272
1240
  u.filepath
@@ -1277,7 +1245,7 @@ const { estree: ze } = Ze, Xn = function(t, n) {
1277
1245
  identifiers: s,
1278
1246
  embeddedOverrideOptions: v
1279
1247
  });
1280
- return $.label(
1248
+ return I.label(
1281
1249
  { embed: !0, ...b.label },
1282
1250
  b
1283
1251
  );
@@ -1286,20 +1254,20 @@ const { estree: ze } = Ze, Xn = function(t, n) {
1286
1254
  }
1287
1255
  };
1288
1256
  }
1289
- return ze.embed?.(t, n) ?? null;
1290
- }, dr = {
1257
+ return qe.embed?.(t, n) ?? null;
1258
+ }, ar = {
1291
1259
  estree: {
1292
- ...ze,
1293
- embed: Xn
1260
+ ...qe,
1261
+ embed: Hn
1294
1262
  }
1295
1263
  };
1296
1264
  export {
1297
- qe as embeddedEmbedders,
1298
- Be as embeddedLanguages,
1265
+ Ge as embeddedEmbedders,
1266
+ We as embeddedLanguages,
1299
1267
  Ke as embeddedOptions,
1300
- We as embeddedParsers,
1301
- I as makeIdentifiersOptionName,
1302
- ir as options,
1303
- ar as parsers,
1304
- dr as printers
1268
+ Ue as embeddedParsers,
1269
+ $ as makeIdentifiersOptionName,
1270
+ or as options,
1271
+ ir as parsers,
1272
+ ar as printers
1305
1273
  };