prettier-plugin-embed 0.4.4 → 0.4.6

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,46 +1,46 @@
1
- import { utils as X, builders as I } from "prettier/doc";
2
- import Rt from "prettier/parser-babel";
3
- import jt from "prettier/parser-espree";
4
- import Ft from "prettier/parser-flow";
5
- import wt from "prettier/parser-meriyah";
6
- import Bt from "prettier/parser-typescript";
7
- import { printers as Ut } from "prettier/plugins/estree.mjs";
8
- import { readFile as Ct } from "node:fs/promises";
9
- import { isAbsolute as Wt, dirname as Gt, resolve as qt, extname as zt } from "node:path";
10
- import { Worker as Kt } from "node:worker_threads";
11
- import { resolveConfigFile as Ht } from "prettier";
12
- const { group: Jt, indent: Xt, softline: ce, lineSuffixBoundary: Yt } = I, { mapDoc: Qt } = X;
13
- function Vt(t, n) {
1
+ import { utils as X, builders as D } from "prettier/doc";
2
+ import wt from "prettier/parser-babel";
3
+ import Bt from "prettier/parser-espree";
4
+ import Ut from "prettier/parser-flow";
5
+ import qt from "prettier/parser-meriyah";
6
+ import Ct from "prettier/parser-typescript";
7
+ import { printers as Wt } from "prettier/plugins/estree.mjs";
8
+ import { readFile as Gt } from "node:fs/promises";
9
+ import { isAbsolute as zt, dirname as Kt, resolve as Ht, extname as Jt } from "node:path";
10
+ import { Worker as Xt } from "node:worker_threads";
11
+ import { resolveConfigFile as Yt } from "prettier";
12
+ const { group: Qt, indent: Vt, softline: ce, lineSuffixBoundary: Zt } = D, { mapDoc: en } = X;
13
+ function tn(t, n) {
14
14
  const { node: r } = t;
15
15
  let e = n();
16
- return r?.comments?.length && (e = Jt([Xt([ce, e]), ce])), ["${", e, Yt, "}"];
16
+ return r?.comments?.length && (e = Qt([Vt([ce, e]), ce])), ["${", e, Zt, "}"];
17
17
  }
18
18
  function x(t, n) {
19
19
  return t.map(
20
- (r) => Vt(r, n),
20
+ (r) => tn(r, n),
21
21
  "expressions"
22
22
  );
23
23
  }
24
- function T(t, n, r) {
25
- return Qt(t, (o) => {
24
+ function L(t, n, r) {
25
+ return en(t, (o) => {
26
26
  if (typeof o != "string")
27
27
  return o;
28
28
  const s = [], l = o.split(n);
29
- for (let d = 0; d < l.length; d++) {
30
- let p = l[d];
31
- if (d % 2 == 0) {
32
- if (!p)
29
+ for (let a = 0; a < l.length; a++) {
30
+ let g = l[a];
31
+ if (a % 2 == 0) {
32
+ if (!g)
33
33
  continue;
34
- p = p.replaceAll(/([\\`]|\${)/g, "\\$1"), s.push(p);
34
+ g = g.replaceAll(/([\\`]|\${)/g, "\\$1"), s.push(g);
35
35
  } else {
36
- const c = Number(p);
36
+ const c = Number(g);
37
37
  s.push(r[c]);
38
38
  }
39
39
  }
40
40
  return s;
41
41
  });
42
42
  }
43
- function M(t, n, r) {
43
+ function A(t, n, r) {
44
44
  if (!(n.plugins?.some(
45
45
  (e) => e.name?.match(
46
46
  new RegExp("(^|/)" + te(t) + "($|/)")
@@ -50,7 +50,7 @@ function M(t, n, r) {
50
50
  `Cannot format embedded language identified by "${r}", because plugin "${t}" is not loaded.`
51
51
  );
52
52
  }
53
- function Zt(t, n, r) {
53
+ function nn(t, n, r) {
54
54
  if (n === r) {
55
55
  t.unshift(n);
56
56
  return;
@@ -66,7 +66,7 @@ function Zt(t, n, r) {
66
66
  }
67
67
  t.splice(e, 0, n);
68
68
  }
69
- const Y = (() => {
69
+ const Q = (() => {
70
70
  const t = [...Array(26).keys()].map((n) => String.fromCharCode(n + 97)).concat([...Array(10).keys()].map((n) => `${n}`));
71
71
  return () => {
72
72
  let r = "";
@@ -75,100 +75,100 @@ const Y = (() => {
75
75
  return r;
76
76
  };
77
77
  })();
78
- function L(t = "p", n = "") {
79
- const r = Y(), e = Y(), o = te(t), s = te(n), l = (p) => `${t}${r}${p}${e}${n}`, d = new RegExp(
78
+ function S(t = "p", n = "") {
79
+ const r = Q(), e = Q(), o = te(t), s = te(n), l = (g) => `${t}${r}${g}${e}${n}`, a = new RegExp(
80
80
  `${o}${r}(\\d+)${e}${s}`,
81
81
  "ig"
82
82
  );
83
83
  return {
84
84
  createPlaceholder: l,
85
- placeholderRegex: d
85
+ placeholderRegex: a
86
86
  };
87
87
  }
88
88
  function te(t) {
89
89
  return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
90
90
  }
91
- function S(t) {
91
+ function T(t) {
92
92
  return `${t}Identifiers`;
93
93
  }
94
- function en(t) {
94
+ function rn(t) {
95
95
  return `${t}Plugin`;
96
96
  }
97
- function V(t) {
97
+ function Y(t) {
98
98
  return `${t}Parser`;
99
99
  }
100
- const { line: ae, group: k, indent: de, softline: le } = I, tn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
100
+ const { line: de, group: O, indent: le, softline: ue } = D, on = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
101
101
  e = {
102
102
  ...e,
103
103
  ...s
104
104
  };
105
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L("@p"), c = l.quasis.map(
106
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
107
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
108
- a.length,
105
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S("@p"), c = l.quasis.map(
106
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
107
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
108
+ d.length,
109
109
  -u.length || void 0
110
- ), b = x(r, n), E = await t(y, {
110
+ ), E = x(r, n), b = await t(y, {
111
111
  ...e,
112
112
  parser: "scss"
113
- }), i = T(E, p, b);
113
+ }), i = L(b, g, E);
114
114
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
115
- return k([
115
+ return O([
116
116
  "`",
117
- a,
118
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [k(i)] : de([k(i)]),
117
+ d,
118
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [O(i)] : le([O(i)]),
119
119
  u,
120
120
  "`"
121
121
  ]);
122
- const h = a.length ? ae : le, v = u.length ? ae : le;
123
- return k([
122
+ const h = d.length ? de : ue, v = u.length ? de : ue;
123
+ return O([
124
124
  "`",
125
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, k(i)] : de([h, k(i)]),
125
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, O(i)] : le([h, O(i)]),
126
126
  v,
127
127
  "`"
128
128
  ]);
129
- }, gt = "embeddedCss", nn = ["css"], rn = S(gt), on = {
130
- [rn]: {
129
+ }, pt = "embeddedCss", sn = ["css"], an = T(pt), cn = {
130
+ [an]: {
131
131
  category: "Embed",
132
132
  type: "string",
133
133
  array: !0,
134
- default: [{ value: [...nn] }],
135
- description: "Specify embedded CSS language identifiers."
134
+ default: [{ value: [...sn] }],
135
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded CSS language."
136
136
  }
137
- }, sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
137
+ }, dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
138
138
  __proto__: null,
139
- embedder: tn,
140
- language: gt,
141
- options: on
142
- }, Symbol.toStringTag, { value: "Module" })), { line: ue, group: N, indent: ge, softline: pe } = I, cn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
139
+ embedder: on,
140
+ language: pt,
141
+ options: cn
142
+ }, Symbol.toStringTag, { value: "Module" })), { line: ge, group: P, indent: me, softline: pe } = D, ln = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
143
143
  e = {
144
144
  ...e,
145
145
  ...s
146
146
  };
147
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
148
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
149
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
150
- a.length,
147
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
148
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
149
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
150
+ d.length,
151
151
  -u.length || void 0
152
- ), b = x(r, n), E = await t(y, {
152
+ ), E = x(r, n), b = await t(y, {
153
153
  ...e,
154
154
  parser: e.embeddedEsParser ?? "babel"
155
- }), i = T(E, p, b);
155
+ }), i = L(b, g, E);
156
156
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
157
- return N([
157
+ return P([
158
158
  "`",
159
- a,
160
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [N(i)] : ge([N(i)]),
159
+ d,
160
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [P(i)] : me([P(i)]),
161
161
  u,
162
162
  "`"
163
163
  ]);
164
- const h = a.length ? ue : pe, v = u.length ? ue : pe;
165
- return N([
164
+ const h = d.length ? ge : pe, v = u.length ? ge : pe;
165
+ return P([
166
166
  "`",
167
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, N(i)] : ge([h, N(i)]),
167
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, P(i)] : me([h, P(i)]),
168
168
  v,
169
169
  "`"
170
170
  ]);
171
- }, ne = "embeddedEs", an = [
171
+ }, ne = "embeddedEs", un = [
172
172
  "js",
173
173
  "jsx",
174
174
  "es",
@@ -177,253 +177,263 @@ const { line: ae, group: k, indent: de, softline: le } = I, tn = async (t, n, r,
177
177
  "cjs",
178
178
  "pac",
179
179
  "javascript"
180
- ], dn = [
180
+ ], gn = [
181
181
  "babel",
182
182
  "babel-flow",
183
183
  "acorn",
184
184
  "espree",
185
185
  "flow",
186
186
  "meriyah"
187
- ], ln = S(ne), un = V(ne), gn = {
188
- [ln]: {
187
+ ], mn = T(ne), pn = Y(ne), hn = {
188
+ [mn]: {
189
189
  category: "Embed",
190
190
  type: "string",
191
191
  array: !0,
192
- default: [{ value: [...an] }],
193
- description: "Specify embedded ES language identifiers."
192
+ default: [{ value: [...un] }],
193
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language."
194
194
  },
195
- [un]: {
195
+ [pn]: {
196
196
  category: "Embed",
197
197
  type: "choice",
198
198
  default: "babel",
199
- description: 'Specify the embedded ES language parser. Default is "babel".',
200
- choices: dn.map((t) => ({
199
+ description: "The parser used to parse the embedded ECMASCript/JavaScript language.",
200
+ choices: gn.map((t) => ({
201
201
  value: t,
202
- description: `Use "${t}".`
202
+ description: `Use the "${t}" parser.`
203
203
  }))
204
204
  }
205
- }, pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
205
+ }, fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
206
206
  __proto__: null,
207
- embedder: cn,
207
+ embedder: ln,
208
208
  language: ne,
209
- options: gn
210
- }, Symbol.toStringTag, { value: "Module" })), { line: me, group: A, indent: he, softline: fe } = I, mn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
211
- M("prettier-plugin-glsl", e, o), e = {
209
+ options: hn
210
+ }, Symbol.toStringTag, { value: "Module" })), { line: he, group: M, indent: fe, softline: be } = D, bn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
211
+ A("prettier-plugin-glsl", e, o), e = {
212
212
  ...e,
213
213
  ...s
214
214
  };
215
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
216
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
217
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
218
- a.length,
215
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
216
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
217
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
218
+ d.length,
219
219
  -u.length || void 0
220
- ), b = x(r, n), E = await t(y, {
220
+ ), E = x(r, n), b = await t(y, {
221
221
  ...e,
222
222
  parser: "glsl-parser"
223
- }), i = T(E, p, b);
223
+ }), i = L(b, g, E);
224
224
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
225
- return A([
225
+ return M([
226
226
  "`",
227
- a,
228
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [A(i)] : he([A(i)]),
227
+ d,
228
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [M(i)] : fe([M(i)]),
229
229
  u,
230
230
  "`"
231
231
  ]);
232
- const h = a.length ? me : fe, v = u.length ? me : fe;
233
- return A([
232
+ const h = d.length ? he : be, v = u.length ? he : be;
233
+ return M([
234
234
  "`",
235
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, A(i)] : he([h, A(i)]),
235
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, M(i)] : fe([h, M(i)]),
236
236
  v,
237
237
  "`"
238
238
  ]);
239
- }, pt = "embeddedGlsl", hn = ["glsl", "shader"], fn = S(pt), En = {
240
- [fn]: {
239
+ }, ht = "embeddedGlsl", En = ["glsl", "shader"], yn = T(ht), _n = {
240
+ [yn]: {
241
241
  category: "Embed",
242
242
  type: "string",
243
243
  array: !0,
244
- default: [{ value: [...hn] }],
245
- description: 'Specify embedded GLSL language identifiers. This requires "prettier-plugin-glsl".'
244
+ default: [{ value: [...En] }],
245
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin."
246
246
  }
247
- }, bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
247
+ }, vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
248
248
  __proto__: null,
249
- embedder: mn,
250
- language: pt,
251
- options: En
252
- }, Symbol.toStringTag, { value: "Module" })), { line: Ee, group: P, indent: be, softline: ye } = I, yn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
249
+ embedder: bn,
250
+ language: ht,
251
+ options: _n
252
+ }, Symbol.toStringTag, { value: "Module" })), { line: Ee, group: N, indent: ye, softline: _e } = D, $n = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
253
253
  e = {
254
254
  ...e,
255
255
  ...s
256
256
  };
257
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
258
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
259
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
260
- a.length,
257
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
258
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
259
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
260
+ d.length,
261
261
  -u.length || void 0
262
- ), b = x(r, n), E = await t(y, {
262
+ ), E = x(r, n), b = await t(y, {
263
263
  ...e,
264
264
  parser: "graphql"
265
- }), i = T(E, p, b);
265
+ }), i = L(b, g, E);
266
266
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
267
- return P([
267
+ return N([
268
268
  "`",
269
- a,
270
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [P(i)] : be([P(i)]),
269
+ d,
270
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [N(i)] : ye([N(i)]),
271
271
  u,
272
272
  "`"
273
273
  ]);
274
- const h = a.length ? Ee : ye, v = u.length ? Ee : ye;
275
- return P([
274
+ const h = d.length ? Ee : _e, v = u.length ? Ee : _e;
275
+ return N([
276
276
  "`",
277
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, P(i)] : be([h, P(i)]),
277
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, N(i)] : ye([h, N(i)]),
278
278
  v,
279
279
  "`"
280
280
  ]);
281
- }, mt = "embeddedGraphql", _n = ["graphql", "gql"], vn = S(mt), $n = {
282
- [vn]: {
281
+ }, ft = "embeddedGraphql", In = ["graphql", "gql"], Dn = T(ft), Tn = {
282
+ [Dn]: {
283
283
  category: "Embed",
284
284
  type: "string",
285
285
  array: !0,
286
- default: [{ value: [..._n] }],
287
- description: "Specify embedded GraphQL language identifiers."
286
+ default: [{ value: [...In] }],
287
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded GraphQL language."
288
288
  }
289
- }, Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
289
+ }, xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
290
290
  __proto__: null,
291
- embedder: yn,
292
- language: mt,
293
- options: $n
294
- }, Symbol.toStringTag, { value: "Module" })), { line: _e, group: R, indent: ve, softline: $e } = I, { mapDoc: In } = X, Sn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
291
+ embedder: $n,
292
+ language: ft,
293
+ options: Tn
294
+ }, Symbol.toStringTag, { value: "Module" })), { line: ve, group: R, indent: $e, softline: Ie } = D, { mapDoc: Sn } = X, Ln = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
295
295
  e = {
296
296
  ...e,
297
297
  ...s
298
298
  };
299
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
300
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
301
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
302
- a.length,
299
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
300
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
301
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
302
+ d.length,
303
303
  -u.length || void 0
304
- ), b = x(r, n), E = await t(y, {
304
+ ), E = x(r, n), b = await t(y, {
305
305
  ...e,
306
- parser: "html"
307
- }), i = In(E, (m) => {
308
- if (typeof m != "string")
309
- return m;
310
- const g = [], f = m.split(p);
306
+ parser: e.embeddedHtmlParser ?? "html"
307
+ }), i = Sn(b, (p) => {
308
+ if (typeof p != "string")
309
+ return p;
310
+ const m = [], f = p.split(g);
311
311
  for (let $ = 0; $ < f.length; $++) {
312
312
  let _ = f[$];
313
313
  if ($ % 2 == 0) {
314
314
  if (!_)
315
315
  continue;
316
- _ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), e.__embeddedInHtml && (_ = _.replaceAll(/<\/(?=script\b)/gi, "<\\/")), g.push(_);
316
+ _ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), e.__embeddedInHtml && (_ = _.replaceAll(/<\/(?=script\b)/gi, "<\\/")), m.push(_);
317
317
  } else {
318
- const D = Number(_);
319
- g.push(b[D]);
318
+ const I = Number(_);
319
+ m.push(E[I]);
320
320
  }
321
321
  }
322
- return g;
322
+ return m;
323
323
  });
324
324
  if (e.htmlWhitespaceSensitivity === "strict" || // TODO: is css mode should be included here?
325
325
  e.htmlWhitespaceSensitivity === "css" || e.preserveEmbeddedExteriorWhitespaces?.includes(o))
326
326
  return R([
327
327
  "`",
328
- a,
329
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [R(i)] : ve([R(i)]),
328
+ d,
329
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [R(i)] : $e([R(i)]),
330
330
  u,
331
331
  "`"
332
332
  ]);
333
- const h = a.length ? _e : $e, v = u.length ? _e : $e;
333
+ const h = d.length ? ve : Ie, v = u.length ? ve : Ie;
334
334
  return R([
335
335
  "`",
336
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, R(i)] : ve([h, R(i)]),
336
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, R(i)] : $e([h, R(i)]),
337
337
  v,
338
338
  "`"
339
339
  ]);
340
- }, ht = "embeddedHtml", xn = ["html", "xhtml"], Ln = S(ht), Tn = {
341
- [Ln]: {
340
+ }, re = "embeddedHtml", kn = ["html", "xhtml"], An = ["html", "vue", "angular", "lwc"], On = T(re), Pn = Y(re), Mn = {
341
+ [On]: {
342
342
  category: "Embed",
343
343
  type: "string",
344
344
  array: !0,
345
- default: [{ value: [...xn] }],
346
- description: "Specify embedded HTML language identifiers."
345
+ default: [{ value: [...kn] }],
346
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded HTML language."
347
+ },
348
+ [Pn]: {
349
+ category: "Embed",
350
+ type: "choice",
351
+ default: "html",
352
+ description: "The parser used to parse the embedded HTML language.",
353
+ choices: An.map((t) => ({
354
+ value: t,
355
+ description: `Use the "${t}" parser.`
356
+ }))
347
357
  }
348
- }, On = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
358
+ }, Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
349
359
  __proto__: null,
350
- embedder: Sn,
351
- language: ht,
352
- options: Tn
353
- }, Symbol.toStringTag, { value: "Module" })), { line: De, group: j, indent: Ie, softline: Se } = I, Mn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
354
- M("prettier-plugin-ini", e, o), e = {
360
+ embedder: Ln,
361
+ language: re,
362
+ options: Mn
363
+ }, Symbol.toStringTag, { value: "Module" })), { line: De, group: F, indent: Te, softline: xe } = D, Rn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
364
+ A("prettier-plugin-ini", e, o), e = {
355
365
  ...e,
356
366
  ...s
357
367
  };
358
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
359
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
360
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
361
- a.length,
368
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
369
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
370
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
371
+ d.length,
362
372
  -u.length || void 0
363
- ), b = x(r, n), E = await t(y, {
373
+ ), E = x(r, n), b = await t(y, {
364
374
  ...e,
365
375
  parser: "ini"
366
- }), i = T(E, p, b);
376
+ }), i = L(b, g, E);
367
377
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
368
- return j([
378
+ return F([
369
379
  "`",
370
- a,
371
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [j(i)] : Ie([j(i)]),
380
+ d,
381
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [F(i)] : Te([F(i)]),
372
382
  u,
373
383
  "`"
374
384
  ]);
375
- const h = a.length ? De : Se, v = u.length ? De : Se;
376
- return j([
385
+ const h = d.length ? De : xe, v = u.length ? De : xe;
386
+ return F([
377
387
  "`",
378
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, j(i)] : Ie([h, j(i)]),
388
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, F(i)] : Te([h, F(i)]),
379
389
  v,
380
390
  "`"
381
391
  ]);
382
- }, ft = "embeddedIni", kn = ["ini", "cfg", "pro"], Nn = S(ft), An = {
383
- [Nn]: {
392
+ }, bt = "embeddedIni", Fn = ["ini", "cfg", "pro"], jn = T(bt), wn = {
393
+ [jn]: {
384
394
  category: "Embed",
385
395
  type: "string",
386
396
  array: !0,
387
- default: [{ value: [...kn] }],
388
- description: 'Specify embedded INI language identifiers. This requires "prettier-plugin-ini".'
397
+ default: [{ value: [...Fn] }],
398
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin."
389
399
  }
390
- }, Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
400
+ }, Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
391
401
  __proto__: null,
392
- embedder: Mn,
393
- language: ft,
394
- options: An
395
- }, Symbol.toStringTag, { value: "Module" })), { line: xe, group: F, indent: Le, softline: Te } = I, Rn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
402
+ embedder: Rn,
403
+ language: bt,
404
+ options: wn
405
+ }, Symbol.toStringTag, { value: "Module" })), { line: Se, group: j, indent: Le, softline: ke } = D, Un = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
396
406
  e = {
397
407
  ...e,
398
408
  ...s
399
409
  };
400
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = jn(), c = l.quasis.map(
401
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
402
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
403
- a.length,
410
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = qn(), c = l.quasis.map(
411
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
412
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
413
+ d.length,
404
414
  -u.length || void 0
405
- ), b = x(r, n), E = await t(y, {
415
+ ), E = x(r, n), b = await t(y, {
406
416
  ...e,
407
417
  parser: e.embeddedJsonParser ?? "json"
408
- }), i = T(E, p, b);
418
+ }), i = L(b, g, E);
409
419
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
410
- return F([
420
+ return j([
411
421
  "`",
412
- a,
413
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [F(i)] : Le([F(i)]),
422
+ d,
423
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [j(i)] : Le([j(i)]),
414
424
  u,
415
425
  "`"
416
426
  ]);
417
- const h = a.length ? xe : Te, v = u.length ? xe : Te;
418
- return F([
427
+ const h = d.length ? Se : ke, v = u.length ? Se : ke;
428
+ return j([
419
429
  "`",
420
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, F(i)] : Le([h, F(i)]),
430
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, j(i)] : Le([h, j(i)]),
421
431
  v,
422
432
  "`"
423
433
  ]);
424
434
  };
425
- function jn() {
426
- const t = Y(), n = Y(), r = (o) => `'0${t}${o}${n}'`, e = new RegExp(
435
+ function qn() {
436
+ const t = Q(), n = Q(), r = (o) => `'0${t}${o}${n}'`, e = new RegExp(
427
437
  `["']?0${t}(\\d+)${n}['"]?`,
428
438
  "ig"
429
439
  );
@@ -432,59 +442,59 @@ function jn() {
432
442
  placeholderRegex: e
433
443
  };
434
444
  }
435
- const re = "embeddedJson", Fn = ["json", "jsonl"], wn = ["json", "json-stringify", "json5"], Bn = V(re), Un = S(re), Cn = {
436
- [Un]: {
445
+ const oe = "embeddedJson", Cn = ["json", "jsonl"], Wn = ["json", "json5", "jsonc", "json-stringify"], Gn = Y(oe), zn = T(oe), Kn = {
446
+ [zn]: {
437
447
  category: "Embed",
438
448
  type: "string",
439
449
  array: !0,
440
- default: [{ value: [...Fn] }],
441
- description: "Specify embedded JSON language identifiers."
450
+ default: [{ value: [...Cn] }],
451
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSON language."
442
452
  },
443
- [Bn]: {
453
+ [Gn]: {
444
454
  category: "Embed",
445
455
  type: "choice",
446
456
  default: "json",
447
- description: 'Specify the embedded JSON language parser. Default is "json".',
448
- choices: wn.map((t) => ({
457
+ description: "The parser used to parse the embedded JSON language.",
458
+ choices: Wn.map((t) => ({
449
459
  value: t,
450
- description: `Use "${t}".`
460
+ description: `Use the "${t}" parser.`
451
461
  }))
452
462
  }
453
- }, Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
463
+ }, Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
454
464
  __proto__: null,
455
- embedder: Rn,
456
- language: re,
457
- options: Cn
458
- }, Symbol.toStringTag, { value: "Module" })), { line: Oe, group: w, indent: Me, softline: ke } = I, Gn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
459
- M("prettier-plugin-latex", e, o), e = {
465
+ embedder: Un,
466
+ language: oe,
467
+ options: Kn
468
+ }, Symbol.toStringTag, { value: "Module" })), { line: Ae, group: w, indent: Oe, softline: Pe } = D, Jn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
469
+ A("prettier-plugin-latex", e, o), e = {
460
470
  ...e,
461
471
  ...s
462
472
  };
463
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
464
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
465
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
466
- a.length,
473
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
474
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
475
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
476
+ d.length,
467
477
  -u.length || void 0
468
- ), b = x(r, n), E = await t(y, {
478
+ ), E = x(r, n), b = await t(y, {
469
479
  ...e,
470
480
  parser: "latex-parser"
471
- }), i = T(E, p, b);
481
+ }), i = L(b, g, E);
472
482
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
473
483
  return w([
474
484
  "`",
475
- a,
476
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [w(i)] : Me([w(i)]),
485
+ d,
486
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [w(i)] : Oe([w(i)]),
477
487
  u,
478
488
  "`"
479
489
  ]);
480
- const h = a.length ? Oe : ke, v = u.length ? Oe : ke;
490
+ const h = d.length ? Ae : Pe, v = u.length ? Ae : Pe;
481
491
  return w([
482
492
  "`",
483
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, w(i)] : Me([h, w(i)]),
493
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, w(i)] : Oe([h, w(i)]),
484
494
  v,
485
495
  "`"
486
496
  ]);
487
- }, Et = "embeddedLatex", qn = [
497
+ }, Et = "embeddedLatex", Xn = [
488
498
  "latex",
489
499
  "tex",
490
500
  "aux",
@@ -493,271 +503,271 @@ const re = "embeddedJson", Fn = ["json", "jsonl"], wn = ["json", "json-stringify
493
503
  "bib",
494
504
  "toc",
495
505
  "sty"
496
- ], zn = S(Et), Kn = {
497
- [zn]: {
506
+ ], Yn = T(Et), Qn = {
507
+ [Yn]: {
498
508
  category: "Embed",
499
509
  type: "string",
500
510
  array: !0,
501
- default: [{ value: [...qn] }],
502
- description: 'Specify embedded LaTeX language identifiers. This requires "prettier-plugin-latex".'
511
+ default: [{ value: [...Xn] }],
512
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin."
503
513
  }
504
- }, Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
514
+ }, Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
505
515
  __proto__: null,
506
- embedder: Gn,
516
+ embedder: Jn,
507
517
  language: Et,
508
- options: Kn
509
- }, Symbol.toStringTag, { value: "Module" })), { line: Ne, group: B, indent: Ae, softline: Pe } = I, Jn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
518
+ options: Qn
519
+ }, Symbol.toStringTag, { value: "Module" })), { line: Me, group: B, indent: Ne, softline: Re } = D, Zn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
510
520
  e = {
511
521
  ...e,
512
522
  ...s
513
523
  };
514
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
515
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
516
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
517
- a.length,
524
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
525
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
526
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
527
+ d.length,
518
528
  -u.length || void 0
519
- ), b = x(r, n), E = await t(y, {
529
+ ), E = x(r, n), b = await t(y, {
520
530
  ...e,
521
531
  parser: "markdown",
522
532
  __inJsTemplate: !0
523
- }), i = T(E, p, b);
533
+ }), i = L(b, g, E);
524
534
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
525
535
  return B([
526
536
  "`",
527
- a,
528
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [B(i)] : Ae([B(i)]),
537
+ d,
538
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [B(i)] : Ne([B(i)]),
529
539
  u,
530
540
  "`"
531
541
  ]);
532
- const h = a.length ? Ne : Pe, v = u.length ? Ne : Pe;
542
+ const h = d.length ? Me : Re, v = u.length ? Me : Re;
533
543
  return B([
534
544
  "`",
535
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, B(i)] : Ae([h, B(i)]),
545
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, B(i)] : Ne([h, B(i)]),
536
546
  v,
537
547
  "`"
538
548
  ]);
539
- }, bt = "embeddedMarkdown", Xn = ["md", "markdown"], Yn = S(bt), Qn = {
540
- [Yn]: {
549
+ }, yt = "embeddedMarkdown", er = ["md", "markdown"], tr = T(yt), nr = {
550
+ [tr]: {
541
551
  category: "Embed",
542
552
  type: "string",
543
553
  array: !0,
544
- default: [{ value: [...Xn] }],
545
- description: "Specify embedded Markdown language identifiers."
554
+ default: [{ value: [...er] }],
555
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Markdown language."
546
556
  }
547
- }, Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
557
+ }, rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
548
558
  __proto__: null,
549
- embedder: Jn,
550
- language: bt,
551
- options: Qn
552
- }, Symbol.toStringTag, { value: "Module" })), oe = "embeddedNoop", Zn = S(oe), er = {
553
- [Zn]: {
559
+ embedder: Zn,
560
+ language: yt,
561
+ options: nr
562
+ }, Symbol.toStringTag, { value: "Module" })), se = "embeddedNoop", or = T(se), sr = {
563
+ [or]: {
554
564
  category: "Embed",
555
565
  type: "string",
556
566
  array: !0,
557
567
  default: [{ value: [] }],
558
- description: "Specify embedded language identifiers that will not be formatted."
568
+ description: "Tag or comment identifiers that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted."
559
569
  }
560
- }, tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
570
+ }, ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
561
571
  __proto__: null,
562
- language: oe,
563
- options: er
564
- }, Symbol.toStringTag, { value: "Module" })), { line: Re, group: U, indent: je, softline: Fe } = I, nr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
565
- M("@prettier/plugin-php", e, o), e = {
572
+ language: se,
573
+ options: sr
574
+ }, Symbol.toStringTag, { value: "Module" })), { line: Fe, group: U, indent: je, softline: we } = D, ar = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
575
+ A("@prettier/plugin-php", e, o), e = {
566
576
  ...e,
567
577
  ...s
568
578
  };
569
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L("$p"), c = l.quasis.map(
570
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
571
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
572
- a.length,
579
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S("$p"), c = l.quasis.map(
580
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
581
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
582
+ d.length,
573
583
  -u.length || void 0
574
- ), b = x(r, n), E = await t(y, {
584
+ ), E = x(r, n), b = await t(y, {
575
585
  ...e,
576
586
  parser: "php"
577
- }), i = T(E, p, b);
587
+ }), i = L(b, g, E);
578
588
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
579
589
  return U([
580
590
  "`",
581
- a,
591
+ d,
582
592
  e.noEmbeddedMultiLineIndentation?.includes(o) ? [U(i)] : je([U(i)]),
583
593
  u,
584
594
  "`"
585
595
  ]);
586
- const h = a.length ? Re : Fe, v = u.length ? Re : Fe;
596
+ const h = d.length ? Fe : we, v = u.length ? Fe : we;
587
597
  return U([
588
598
  "`",
589
599
  e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, U(i)] : je([h, U(i)]),
590
600
  v,
591
601
  "`"
592
602
  ]);
593
- }, yt = "embeddedPhp", rr = ["php", "php5"], or = S(yt), sr = {
594
- [or]: {
603
+ }, _t = "embeddedPhp", cr = ["php", "php5"], dr = T(_t), lr = {
604
+ [dr]: {
595
605
  category: "Embed",
596
606
  type: "string",
597
607
  array: !0,
598
- default: [{ value: [...rr] }],
599
- description: 'Specify embedded PHP language identifiers. This requires "@prettier/plugin-php".'
608
+ default: [{ value: [...cr] }],
609
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin."
600
610
  }
601
- }, ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
611
+ }, ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
602
612
  __proto__: null,
603
- embedder: nr,
604
- language: yt,
605
- options: sr
606
- }, Symbol.toStringTag, { value: "Module" })), { line: we, group: C, indent: Be, softline: Ue } = I, cr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
607
- M("prettier-plugin-properties", e, o), e = {
613
+ embedder: ar,
614
+ language: _t,
615
+ options: lr
616
+ }, Symbol.toStringTag, { value: "Module" })), { line: Be, group: q, indent: Ue, softline: qe } = D, gr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
617
+ A("prettier-plugin-properties", e, o), e = {
608
618
  ...e,
609
619
  ...s
610
620
  };
611
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
612
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
613
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
614
- a.length,
621
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
622
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
623
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
624
+ d.length,
615
625
  -u.length || void 0
616
- ), b = x(r, n), E = await t(y, {
626
+ ), E = x(r, n), b = await t(y, {
617
627
  ...e,
618
628
  parser: "dot-properties"
619
- }), i = T(E, p, b);
629
+ }), i = L(b, g, E);
620
630
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
621
- return C([
631
+ return q([
622
632
  "`",
623
- a,
624
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [C(i)] : Be([C(i)]),
633
+ d,
634
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [q(i)] : Ue([q(i)]),
625
635
  u,
626
636
  "`"
627
637
  ]);
628
- const h = a.length ? we : Ue, v = u.length ? we : Ue;
629
- return C([
638
+ const h = d.length ? Be : qe, v = u.length ? Be : qe;
639
+ return q([
630
640
  "`",
631
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, C(i)] : Be([h, C(i)]),
641
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, q(i)] : Ue([h, q(i)]),
632
642
  v,
633
643
  "`"
634
644
  ]);
635
- }, _t = "embeddedProperties", ar = ["properties"], dr = S(_t), lr = {
636
- [dr]: {
645
+ }, vt = "embeddedProperties", mr = ["properties"], pr = T(vt), hr = {
646
+ [pr]: {
637
647
  category: "Embed",
638
648
  type: "string",
639
649
  array: !0,
640
- default: [{ value: [...ar] }],
641
- description: 'Specify embedded Java Properties language identifiers. This requires "prettier-plugin-properties".'
650
+ default: [{ value: [...mr] }],
651
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin."
642
652
  }
643
- }, ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
653
+ }, fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
644
654
  __proto__: null,
645
- embedder: cr,
646
- language: _t,
647
- options: lr
648
- }, Symbol.toStringTag, { value: "Module" })), { line: Ce, group: W, indent: We, softline: Ge } = I, gr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
649
- M("@prettier/plugin-ruby", e, o), e = {
655
+ embedder: gr,
656
+ language: vt,
657
+ options: hr
658
+ }, Symbol.toStringTag, { value: "Module" })), { line: Ce, group: C, indent: We, softline: Ge } = D, br = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
659
+ A("@prettier/plugin-ruby", e, o), e = {
650
660
  ...e,
651
661
  ...s
652
662
  };
653
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
654
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
655
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
656
- a.length,
663
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
664
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
665
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
666
+ d.length,
657
667
  -u.length || void 0
658
- ), b = x(r, n), E = await t(y, {
668
+ ), E = x(r, n), b = await t(y, {
659
669
  ...e,
660
670
  parser: e.embeddedRubyParser ?? "ruby"
661
- }), i = T(E, p, b);
671
+ }), i = L(b, g, E);
662
672
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
663
- return W([
673
+ return C([
664
674
  "`",
665
- a,
666
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [W(i)] : We([W(i)]),
675
+ d,
676
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [C(i)] : We([C(i)]),
667
677
  u,
668
678
  "`"
669
679
  ]);
670
- const h = a.length ? Ce : Ge, v = u.length ? Ce : Ge;
671
- return W([
680
+ const h = d.length ? Ce : Ge, v = u.length ? Ce : Ge;
681
+ return C([
672
682
  "`",
673
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, W(i)] : We([h, W(i)]),
683
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, C(i)] : We([h, C(i)]),
674
684
  v,
675
685
  "`"
676
686
  ]);
677
- }, vt = "embeddedRuby", pr = ["ruby"], mr = ["ruby", "rbs", "haml"], hr = "embeddedRubyParser", fr = S(vt), Er = {
678
- [fr]: {
687
+ }, $t = "embeddedRuby", Er = ["ruby"], yr = ["ruby", "rbs", "haml"], _r = "embeddedRubyParser", vr = T($t), $r = {
688
+ [vr]: {
679
689
  category: "Embed",
680
690
  type: "string",
681
691
  array: !0,
682
- default: [{ value: [...pr] }],
683
- description: 'Specify embedded Ruby language identifiers. This requires "@prettier/plugin-ruby".'
692
+ default: [{ value: [...Er] }],
693
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin."
684
694
  },
685
- [hr]: {
695
+ [_r]: {
686
696
  category: "Embed",
687
697
  type: "choice",
688
698
  default: "ruby",
689
- description: 'Specify the embedded Ruby language parser. Default is "ruby".',
690
- choices: mr.map((t) => ({
699
+ description: "The parser used to parse the embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin.",
700
+ choices: yr.map((t) => ({
691
701
  value: t,
692
- description: `Use "${t}".`
702
+ description: `Use the "${t}" parser.`
693
703
  }))
694
704
  }
695
- }, br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
705
+ }, Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
696
706
  __proto__: null,
697
- embedder: gr,
698
- language: vt,
699
- options: Er
700
- }, Symbol.toStringTag, { value: "Module" })), { hardline: yr, group: G, line: qe, softline: ze, indent: Ke } = I, { mapDoc: _r } = X, vr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
707
+ embedder: br,
708
+ language: $t,
709
+ options: $r
710
+ }, Symbol.toStringTag, { value: "Module" })), { hardline: Dr, group: W, line: ze, softline: Ke, indent: He } = D, { mapDoc: Tr } = X, xr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
701
711
  e = {
702
712
  ...e,
703
713
  ...s
704
714
  };
705
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
706
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
707
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
708
- a.length,
715
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
716
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
717
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
718
+ d.length,
709
719
  -u.length || void 0
710
- ), b = x(r, n), E = await t(y, {
720
+ ), E = x(r, n), b = await t(y, {
711
721
  ...e,
712
722
  parser: "sh"
713
- }), i = _r(E, (m) => {
714
- if (typeof m != "string")
715
- return m;
716
- const g = [], f = m.split(p);
723
+ }), i = Tr(b, (p) => {
724
+ if (typeof p != "string")
725
+ return p;
726
+ const m = [], f = p.split(g);
717
727
  for (let $ = 0; $ < f.length; $++) {
718
728
  let _ = f[$];
719
729
  if ($ % 2 == 0) {
720
730
  if (!_)
721
731
  continue;
722
- _ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((D) => D === `
723
- ` ? g.push(yr) : g.push(D));
732
+ _ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((I) => I === `
733
+ ` ? m.push(Dr) : m.push(I));
724
734
  } else {
725
- const D = Number(_);
726
- g.push(b[D]);
735
+ const I = Number(_);
736
+ m.push(E[I]);
727
737
  }
728
738
  }
729
- return g;
739
+ return m;
730
740
  });
731
741
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
732
- return G([
742
+ return W([
733
743
  "`",
734
- a,
735
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [G(i)] : Ke([G(i)]),
744
+ d,
745
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [W(i)] : He([W(i)]),
736
746
  u,
737
747
  "`"
738
748
  ]);
739
- const h = a.length ? qe : ze, v = u.length ? qe : ze;
740
- return G([
749
+ const h = d.length ? ze : Ke, v = u.length ? ze : Ke;
750
+ return W([
741
751
  "`",
742
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, G(i)] : Ke([h, G(i)]),
752
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, W(i)] : He([h, W(i)]),
743
753
  v,
744
754
  "`"
745
755
  ]);
746
- }, $t = "embeddedSh", $r = ["sh"], Dr = S($t), Ir = {
747
- [Dr]: {
756
+ }, It = "embeddedSh", Sr = ["sh"], Lr = T(It), kr = {
757
+ [Lr]: {
748
758
  category: "Embed",
749
759
  type: "string",
750
760
  array: !0,
751
- default: [{ value: [...$r] }],
752
- description: "Specify embedded Shell language identifiers."
761
+ default: [{ value: [...Sr] }],
762
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin."
753
763
  }
754
- }, Sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
764
+ }, Ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
755
765
  __proto__: null,
756
- embedder: vr,
757
- language: $t,
758
- options: Ir
766
+ embedder: xr,
767
+ language: It,
768
+ options: kr
759
769
  }, Symbol.toStringTag, { value: "Module" }));
760
- function He(t, n) {
770
+ function Je(t, n) {
761
771
  var r = Object.keys(t);
762
772
  if (Object.getOwnPropertySymbols) {
763
773
  var e = Object.getOwnPropertySymbols(t);
@@ -767,25 +777,25 @@ function He(t, n) {
767
777
  }
768
778
  return r;
769
779
  }
770
- function Je(t) {
780
+ function Xe(t) {
771
781
  for (var n = 1; n < arguments.length; n++) {
772
782
  var r = arguments[n] != null ? arguments[n] : {};
773
- n % 2 ? He(Object(r), !0).forEach(function(e) {
774
- xr(t, e, r[e]);
775
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : He(Object(r)).forEach(function(e) {
783
+ n % 2 ? Je(Object(r), !0).forEach(function(e) {
784
+ Or(t, e, r[e]);
785
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : Je(Object(r)).forEach(function(e) {
776
786
  Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
777
787
  });
778
788
  }
779
789
  return t;
780
790
  }
781
- function xr(t, n, r) {
782
- return n = Lr(n), n in t ? Object.defineProperty(t, n, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = r, t;
791
+ function Or(t, n, r) {
792
+ return n = Pr(n), n in t ? Object.defineProperty(t, n, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = r, t;
783
793
  }
784
- function Lr(t) {
785
- var n = Tr(t, "string");
794
+ function Pr(t) {
795
+ var n = Mr(t, "string");
786
796
  return typeof n == "symbol" ? n : String(n);
787
797
  }
788
- function Tr(t, n) {
798
+ function Mr(t, n) {
789
799
  if (typeof t != "object" || t === null)
790
800
  return t;
791
801
  var r = t[Symbol.toPrimitive];
@@ -797,301 +807,301 @@ function Tr(t, n) {
797
807
  }
798
808
  return (n === "string" ? String : Number)(t);
799
809
  }
800
- const Or = Dt({});
810
+ const Nr = Dt({});
801
811
  function Dt(t) {
802
- return n.withOptions = (r) => Dt(Je(Je({}, t), r)), n;
812
+ return n.withOptions = (r) => Dt(Xe(Xe({}, t), r)), n;
803
813
  function n(r, ...e) {
804
814
  const o = typeof r == "string" ? [r] : r.raw, {
805
815
  escapeSpecialCharacters: s = Array.isArray(r)
806
816
  } = t;
807
817
  let l = "";
808
818
  for (let c = 0; c < o.length; c++) {
809
- let a = o[c];
810
- s && (a = a.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\{/g, "{")), l += a, c < e.length && (l += e[c]);
819
+ let d = o[c];
820
+ s && (d = d.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\{/g, "{")), l += d, c < e.length && (l += e[c]);
811
821
  }
812
- const d = l.split(`
822
+ const a = l.split(`
813
823
  `);
814
- let p = null;
815
- for (const c of d) {
816
- const a = c.match(/^(\s+)\S+/);
817
- if (a) {
818
- const u = a[1].length;
819
- p ? p = Math.min(p, u) : p = u;
824
+ let g = null;
825
+ for (const c of a) {
826
+ const d = c.match(/^(\s+)\S+/);
827
+ if (d) {
828
+ const u = d[1].length;
829
+ g ? g = Math.min(g, u) : g = u;
820
830
  }
821
831
  }
822
- if (p !== null) {
823
- const c = p;
824
- l = d.map((a) => a[0] === " " || a[0] === " " ? a.slice(c) : a).join(`
832
+ if (g !== null) {
833
+ const c = g;
834
+ l = a.map((d) => d[0] === " " || d[0] === " " ? d.slice(c) : d).join(`
825
835
  `);
826
836
  }
827
837
  return l.trim().replace(/\\n/g, `
828
838
  `);
829
839
  }
830
840
  }
831
- const { hardline: Mr, group: q, line: Xe, softline: Ye, indent: Qe } = I, { mapDoc: kr } = X, Nr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
841
+ const { hardline: Rr, group: G, line: Ye, softline: Qe, indent: Ve } = D, { mapDoc: Fr } = X, jr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
832
842
  e = {
833
843
  ...e,
834
844
  ...s
835
845
  };
836
846
  const l = e.embeddedSqlPlugin ?? "prettier-plugin-sql";
837
- M(l, e, o);
838
- const { node: d } = r, { createPlaceholder: p, placeholderRegex: c } = L(), a = d.quasis.map(
839
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + p(g)
840
- ).join(""), u = a.match(/^\s+/)?.[0] ?? "", y = a.match(/\s+$/)?.[0] ?? "", b = a.slice(
847
+ A(l, e, o);
848
+ const { node: a } = r, { createPlaceholder: g, placeholderRegex: c } = S(), d = a.quasis.map(
849
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + g(m)
850
+ ).join(""), u = d.match(/^\s+/)?.[0] ?? "", y = d.match(/\s+$/)?.[0] ?? "", E = d.slice(
841
851
  u.length,
842
852
  -y.length || void 0
843
- ), E = x(r, n);
853
+ ), b = x(r, n);
844
854
  let i;
845
855
  if (l === "prettier-plugin-sql-cst") {
846
- const m = await t(b, {
856
+ const p = await t(E, {
847
857
  ...e,
848
858
  parser: e.embeddedSqlParser ?? "sqlite"
849
859
  });
850
- i = T(m, c, E);
860
+ i = L(p, c, b);
851
861
  } else {
852
- const m = await t(Or(b), {
862
+ const p = await t(Nr(E), {
853
863
  ...e,
854
864
  parser: "sql"
855
865
  });
856
- i = kr(m, (g) => {
857
- if (typeof g != "string")
858
- return g;
859
- const f = [], $ = g.split(c);
866
+ i = Fr(p, (m) => {
867
+ if (typeof m != "string")
868
+ return m;
869
+ const f = [], $ = m.split(c);
860
870
  for (let _ = 0; _ < $.length; _++) {
861
- let D = $[_];
871
+ let I = $[_];
862
872
  if (_ % 2 == 0) {
863
- if (!D)
873
+ if (!I)
864
874
  continue;
865
- D = D.replaceAll(/([\\`]|\${)/g, "\\$1"), D.split(/(\n)/).forEach(
866
- (O) => O === `
867
- ` ? f.push(Mr) : f.push(O)
875
+ I = I.replaceAll(/([\\`]|\${)/g, "\\$1"), I.split(/(\n)/).forEach(
876
+ (k) => k === `
877
+ ` ? f.push(Rr) : f.push(k)
868
878
  );
869
879
  } else {
870
- const O = Number(D);
871
- f.push(E[O]);
880
+ const k = Number(I);
881
+ f.push(b[k]);
872
882
  }
873
883
  }
874
884
  return f;
875
885
  });
876
886
  }
877
887
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
878
- return q([
888
+ return G([
879
889
  "`",
880
890
  u,
881
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [q(i)] : Qe([q(i)]),
891
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [G(i)] : Ve([G(i)]),
882
892
  y,
883
893
  "`"
884
894
  ]);
885
- const h = u.length ? Xe : Ye, v = y.length ? Xe : Ye;
886
- return q([
895
+ const h = u.length ? Ye : Qe, v = y.length ? Ye : Qe;
896
+ return G([
887
897
  "`",
888
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, q(i)] : Qe([h, q(i)]),
898
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, G(i)] : Ve([h, G(i)]),
889
899
  v,
890
900
  "`"
891
901
  ]);
892
- }, Z = "embeddedSql", Ar = ["sql"], Pr = ["prettier-plugin-sql", "prettier-plugin-sql-cst"], Rr = [
902
+ }, Z = "embeddedSql", wr = ["sql"], Br = ["prettier-plugin-sql", "prettier-plugin-sql-cst"], Ur = [
893
903
  "sqlite",
894
904
  "bigquery",
895
905
  "mysql",
896
906
  "mariadb",
897
907
  "postgresql"
898
- ], jr = S(Z), Fr = en(Z), wr = V(Z), Br = {
899
- [jr]: {
908
+ ], qr = T(Z), Cr = rn(Z), Wr = Y(Z), Gr = {
909
+ [qr]: {
900
910
  category: "Embed",
901
911
  type: "string",
902
912
  array: !0,
903
- default: [{ value: [...Ar] }],
904
- description: 'Specify embedded SQL language identifiers. This requires "prettier-plugin-sql" or "prettier-plugin-sql-cst".'
913
+ default: [{ value: [...wr] }],
914
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin."
905
915
  },
906
- [Fr]: {
916
+ [Cr]: {
907
917
  category: "Embed",
908
918
  type: "choice",
909
919
  default: "prettier-plugin-sql",
910
- description: 'Specify the Prettier plugin for parsing and formatting SQL. Default is "prettier-plugin-sql"',
911
- choices: Pr.map((t) => ({
920
+ description: "The plugin used to format the embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin.",
921
+ choices: Br.map((t) => ({
912
922
  value: t,
913
- description: `Use "${t}".`
923
+ description: `Use the "${t}" plugin.`
914
924
  }))
915
925
  },
916
- [wr]: {
926
+ [Wr]: {
917
927
  category: "Embed",
918
928
  type: "choice",
919
929
  default: "sqlite",
920
- description: 'Specify the embedded SQL language parser. Default is "sqlite". This option is only for "prettier-plugin-sql-cst".',
921
- choices: Rr.map((t) => ({
930
+ description: "Specify the embedded SQL language parser. This option is only needed with the `prettier-plugin-sql-cst` plugin.",
931
+ choices: Ur.map((t) => ({
922
932
  value: t,
923
- description: `Use "${t}" parser.`
933
+ description: `Use the "${t}" parser.`
924
934
  }))
925
935
  }
926
- }, Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
936
+ }, zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
927
937
  __proto__: null,
928
- embedder: Nr,
938
+ embedder: jr,
929
939
  language: Z,
930
- options: Br
931
- }, Symbol.toStringTag, { value: "Module" })), { line: Ve, group: z, indent: Ze, softline: et, hardline: Cr } = I, { mapDoc: Wr } = X, Gr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
932
- M("prettier-plugin-toml", e, o), e = {
940
+ options: Gr
941
+ }, Symbol.toStringTag, { value: "Module" })), { line: Ze, group: z, indent: et, softline: tt, hardline: Kr } = D, { mapDoc: Hr } = X, Jr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
942
+ A("prettier-plugin-toml", e, o), e = {
933
943
  ...e,
934
944
  ...s
935
945
  };
936
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
937
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
938
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
939
- a.length,
946
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
947
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
948
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
949
+ d.length,
940
950
  -u.length || void 0
941
- ), b = x(r, n), E = await t(y, {
951
+ ), E = x(r, n), b = await t(y, {
942
952
  ...e,
943
953
  parser: "toml"
944
- }), i = Wr(E, (m) => {
945
- if (typeof m != "string")
946
- return m;
947
- const g = [], f = m.split(p);
954
+ }), i = Hr(b, (p) => {
955
+ if (typeof p != "string")
956
+ return p;
957
+ const m = [], f = p.split(g);
948
958
  for (let $ = 0; $ < f.length; $++) {
949
959
  let _ = f[$];
950
960
  if ($ % 2 == 0) {
951
961
  if (!_)
952
962
  continue;
953
- _ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((D) => D === `
954
- ` ? g.push(Cr) : g.push(D));
963
+ _ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((I) => I === `
964
+ ` ? m.push(Kr) : m.push(I));
955
965
  } else {
956
- const D = Number(_);
957
- g.push(b[D]);
966
+ const I = Number(_);
967
+ m.push(E[I]);
958
968
  }
959
969
  }
960
- return g;
970
+ return m;
961
971
  });
962
972
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
963
973
  return z([
964
974
  "`",
965
- a,
966
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [z(i)] : Ze([z(i)]),
975
+ d,
976
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [z(i)] : et([z(i)]),
967
977
  u,
968
978
  "`"
969
979
  ]);
970
- const h = a.length ? Ve : et, v = u.length ? Ve : et;
980
+ const h = d.length ? Ze : tt, v = u.length ? Ze : tt;
971
981
  return z([
972
982
  "`",
973
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, z(i)] : Ze([h, z(i)]),
983
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, z(i)] : et([h, z(i)]),
974
984
  v,
975
985
  "`"
976
986
  ]);
977
- }, It = "embeddedToml", qr = ["toml"], zr = S(It), Kr = {
978
- [zr]: {
987
+ }, Tt = "embeddedToml", Xr = ["toml"], Yr = T(Tt), Qr = {
988
+ [Yr]: {
979
989
  category: "Embed",
980
990
  type: "string",
981
991
  array: !0,
982
- default: [{ value: [...qr] }],
983
- description: 'Specify embedded TOML language identifiers. This requires "prettier-plugin-toml".'
992
+ default: [{ value: [...Xr] }],
993
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin."
984
994
  }
985
- }, Hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
995
+ }, Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
986
996
  __proto__: null,
987
- embedder: Gr,
988
- language: It,
989
- options: Kr
990
- }, Symbol.toStringTag, { value: "Module" })), { line: tt, group: K, indent: nt, softline: rt } = I, Jr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
997
+ embedder: Jr,
998
+ language: Tt,
999
+ options: Qr
1000
+ }, Symbol.toStringTag, { value: "Module" })), { line: nt, group: K, indent: rt, softline: ot } = D, Zr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
991
1001
  e = {
992
1002
  ...e,
993
1003
  ...s
994
1004
  };
995
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
996
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
997
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
998
- a.length,
1005
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
1006
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
1007
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
1008
+ d.length,
999
1009
  -u.length || void 0
1000
- ), b = x(r, n), E = await t(y, {
1010
+ ), E = x(r, n), b = await t(y, {
1001
1011
  ...e,
1002
1012
  parser: e.embeddedTsParser ?? "typescript",
1003
1013
  // set filepath to undefined to enable jsx auto detection:
1004
1014
  // https://github.com/prettier/prettier/blob/427a84d24203e2d54160cde153a1e6a6390fe65a/src/language-js/parse/typescript.js#L49-L53
1005
1015
  filepath: void 0
1006
- }), i = T(E, p, b);
1016
+ }), i = L(b, g, E);
1007
1017
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
1008
1018
  return K([
1009
1019
  "`",
1010
- a,
1011
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [K(i)] : nt([K(i)]),
1020
+ d,
1021
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [K(i)] : rt([K(i)]),
1012
1022
  u,
1013
1023
  "`"
1014
1024
  ]);
1015
- const h = a.length ? tt : rt, v = u.length ? tt : rt;
1025
+ const h = d.length ? nt : ot, v = u.length ? nt : ot;
1016
1026
  return K([
1017
1027
  "`",
1018
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, K(i)] : nt([h, K(i)]),
1028
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, K(i)] : rt([h, K(i)]),
1019
1029
  v,
1020
1030
  "`"
1021
1031
  ]);
1022
- }, se = "embeddedTs", Xr = ["ts", "tsx", "cts", "mts", "typescript"], Yr = ["typescript", "babel-ts"], Qr = V(se), Vr = S(se), Zr = {
1023
- [Vr]: {
1032
+ }, ie = "embeddedTs", eo = ["ts", "tsx", "cts", "mts", "typescript"], to = ["typescript", "babel-ts"], no = Y(ie), ro = T(ie), oo = {
1033
+ [ro]: {
1024
1034
  category: "Embed",
1025
1035
  type: "string",
1026
1036
  array: !0,
1027
- default: [{ value: [...Xr] }],
1028
- description: "Specify embedded TS language parsers."
1037
+ default: [{ value: [...eo] }],
1038
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TypeScript language."
1029
1039
  },
1030
- [Qr]: {
1040
+ [no]: {
1031
1041
  category: "Embed",
1032
1042
  type: "choice",
1033
1043
  default: "typescript",
1034
- description: 'Specify the embedded TS language parser. Default is "typescript".',
1035
- choices: Yr.map((t) => ({
1044
+ description: "The parser used to parse the embedded TypeScript language.",
1045
+ choices: to.map((t) => ({
1036
1046
  value: t,
1037
- description: `Use "${t}".`
1047
+ description: `Use the "${t}" parser.`
1038
1048
  }))
1039
1049
  }
1040
- }, eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1050
+ }, so = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1041
1051
  __proto__: null,
1042
- embedder: Jr,
1043
- language: se,
1044
- options: Zr
1045
- }, Symbol.toStringTag, { value: "Module" })), ie = "embeddedXml", { line: ot, group: H, indent: st, softline: ee } = I, to = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
1046
- M("@prettier/plugin-xml", e, o), e = {
1052
+ embedder: Zr,
1053
+ language: ie,
1054
+ options: oo
1055
+ }, Symbol.toStringTag, { value: "Module" })), ae = "embeddedXml", { line: st, group: H, indent: it, softline: ee } = D, io = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
1056
+ A("@prettier/plugin-xml", e, o), e = {
1047
1057
  ...e,
1048
1058
  ...s
1049
1059
  };
1050
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
1051
- (g, f, { length: $ }) => f === $ - 1 ? g.value.cooked : g.value.cooked + d(f)
1052
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
1053
- a.length,
1060
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
1061
+ (m, f, { length: $ }) => f === $ - 1 ? m.value.cooked : m.value.cooked + a(f)
1062
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
1063
+ d.length,
1054
1064
  -u.length || void 0
1055
- ), b = x(r, n), E = [];
1065
+ ), E = x(r, n), b = [];
1056
1066
  let i = 0;
1057
1067
  for (; i !== void 0; ) {
1058
- const g = y.slice(i);
1059
- if (g.length === 0)
1068
+ const m = y.slice(i);
1069
+ if (m.length === 0)
1060
1070
  break;
1061
- i > 0 && e.xmlWhitespaceSensitivity !== "strict" && E.push(ee), e.__embeddedXmlFragmentRecoverIndex?.splice(
1071
+ i > 0 && e.xmlWhitespaceSensitivity !== "strict" && b.push(ee), e.__embeddedXmlFragmentRecoverIndex?.splice(
1062
1072
  0,
1063
1073
  e.__embeddedXmlFragmentRecoverIndex.length
1064
1074
  );
1065
- let f = await t(g, {
1075
+ let f = await t(m, {
1066
1076
  ...e,
1067
- parser: ie
1077
+ parser: ae
1068
1078
  });
1069
1079
  const [$, _] = e.__embeddedXmlFragmentRecoverIndex ?? [];
1070
- $ === void 0 ? i = void 0 : _ === void 0 ? i += $ : (f = g.slice($, _ + 1), i += _ + 1), E.push(f);
1080
+ $ === void 0 ? i = void 0 : _ === void 0 ? i += $ : (f = m.slice($, _ + 1), i += _ + 1), b.push(f);
1071
1081
  }
1072
- const h = T(E, p, b);
1082
+ const h = L(b, g, E);
1073
1083
  if (e.xmlWhitespaceSensitivity === "strict" || e.preserveEmbeddedExteriorWhitespaces?.includes(o))
1074
1084
  return H([
1075
1085
  "`",
1076
- a,
1077
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [H(h)] : st([H(h)]),
1086
+ d,
1087
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [H(h)] : it([H(h)]),
1078
1088
  u,
1079
1089
  "`"
1080
1090
  ]);
1081
- const v = a.length ? ot : ee, m = u.length ? ot : ee;
1091
+ const v = d.length ? st : ee, p = u.length ? st : ee;
1082
1092
  return H([
1083
1093
  "`",
1084
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [v, H(h)] : st([v, H(h)]),
1085
- m,
1094
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [v, H(h)] : it([v, H(h)]),
1095
+ p,
1086
1096
  "`"
1087
1097
  ]);
1088
- }, no = ["xml", "opml", "rss", "svg"], ro = S(ie), oo = {
1089
- [ro]: {
1098
+ }, ao = ["xml", "opml", "rss", "svg"], co = T(ae), lo = {
1099
+ [co]: {
1090
1100
  category: "Embed",
1091
1101
  type: "string",
1092
1102
  array: !0,
1093
- default: [{ value: [...no] }],
1094
- description: 'Specify embedded XML language identifiers. This requires "@prettier/plugin-xml".'
1103
+ default: [{ value: [...ao] }],
1104
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."
1095
1105
  },
1096
1106
  /**
1097
1107
  * @internal
@@ -1101,10 +1111,10 @@ const { hardline: Mr, group: q, line: Xe, softline: Ye, indent: Qe } = I, { mapD
1101
1111
  type: "int",
1102
1112
  array: !0,
1103
1113
  default: [{ value: [] }],
1104
- description: "This option is read only and used as a workaround to support xml fragments"
1114
+ description: "This option is read only and is used internally as a workaround to support xml fragments"
1105
1115
  }
1106
1116
  };
1107
- function so(t) {
1117
+ function uo(t) {
1108
1118
  const n = {
1109
1119
  loc: {
1110
1120
  start: {
@@ -1124,7 +1134,7 @@ function so(t) {
1124
1134
  );
1125
1135
  return Object.assign(r, n), r;
1126
1136
  }
1127
- function it(t) {
1137
+ function at(t) {
1128
1138
  const n = {
1129
1139
  loc: {
1130
1140
  start: {
@@ -1144,50 +1154,50 @@ function it(t) {
1144
1154
  );
1145
1155
  return Object.assign(r, n), r;
1146
1156
  }
1147
- const io = {
1157
+ const go = {
1148
1158
  async parse(t, n) {
1149
1159
  const { parse: r } = await import("@xml-tools/parser"), { lexErrors: e, parseErrors: o, cst: s } = r(t);
1150
1160
  if (e.length > 0) {
1151
1161
  const l = e[0];
1152
- throw so(l);
1162
+ throw uo(l);
1153
1163
  }
1154
1164
  if (o.length > 0) {
1155
1165
  let l = !1;
1156
- for (const d of o) {
1166
+ for (const a of o) {
1157
1167
  if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
1158
- d.name
1168
+ a.name
1159
1169
  ))
1160
- throw it(d);
1161
- if (d.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
1170
+ throw at(a);
1171
+ if (a.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
1162
1172
  l = !0;
1163
1173
  continue;
1164
1174
  }
1165
1175
  if (/Expecting token of type --> EOF <-- but found --> '[\s\S]+' <--/.test(
1166
- d.message
1167
- ) || /Redundant input, expecting EOF but found: /.test(d.message)) {
1176
+ a.message
1177
+ ) || /Redundant input, expecting EOF but found: /.test(a.message)) {
1168
1178
  n.__embeddedXmlFragmentRecoverIndex?.splice(
1169
1179
  0,
1170
1180
  n.__embeddedXmlFragmentRecoverIndex.length,
1171
- d.token.startOffset
1181
+ a.token.startOffset
1172
1182
  );
1173
1183
  break;
1174
1184
  }
1175
1185
  if (/Expecting token of type --> OPEN <-- but found --> '[\s\S]+' <--/.test(
1176
- d.message
1186
+ a.message
1177
1187
  )) {
1178
- if (d.token.endOffset === void 0 || Number.isNaN(d.token.endOffset))
1188
+ if (a.token.endOffset === void 0 || Number.isNaN(a.token.endOffset))
1179
1189
  break;
1180
1190
  n.__embeddedXmlFragmentRecoverIndex?.splice(
1181
1191
  0,
1182
1192
  n.__embeddedXmlFragmentRecoverIndex.length,
1183
- d.token.startOffset,
1184
- d.token.endOffset
1193
+ a.token.startOffset,
1194
+ a.token.endOffset
1185
1195
  ), l = !0;
1186
1196
  break;
1187
1197
  }
1188
- throw it(d);
1198
+ throw at(a);
1189
1199
  }
1190
- l && St(s);
1200
+ l && xt(s);
1191
1201
  }
1192
1202
  return s;
1193
1203
  },
@@ -1199,145 +1209,145 @@ const io = {
1199
1209
  return t.location.endOffset ?? NaN;
1200
1210
  }
1201
1211
  };
1202
- function St(t) {
1212
+ function xt(t) {
1203
1213
  const n = t.children;
1204
1214
  for (const r in n) {
1205
1215
  const e = n[r] ?? [];
1206
1216
  for (let o = e.length - 1; o >= 0; --o) {
1207
1217
  const s = e[o];
1208
- if (co(s)) {
1218
+ if (mo(s)) {
1209
1219
  if (Object.keys(s.children).length === 0) {
1210
1220
  e.splice(o, 1), e.length === 0 && delete n[r];
1211
1221
  continue;
1212
1222
  }
1213
- St(s);
1223
+ xt(s);
1214
1224
  }
1215
1225
  }
1216
1226
  }
1217
1227
  }
1218
- function co(t) {
1228
+ function mo(t) {
1219
1229
  return "name" in t && "children" in t && "location" in t;
1220
1230
  }
1221
- const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1231
+ const po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1222
1232
  __proto__: null,
1223
- embedder: to,
1224
- language: ie,
1225
- options: oo,
1226
- parser: io
1227
- }, Symbol.toStringTag, { value: "Module" })), { line: ct, group: J, indent: at, softline: dt } = I, lo = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
1233
+ embedder: io,
1234
+ language: ae,
1235
+ options: lo,
1236
+ parser: go
1237
+ }, Symbol.toStringTag, { value: "Module" })), { line: ct, group: J, indent: dt, softline: lt } = D, ho = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
1228
1238
  e = {
1229
1239
  ...e,
1230
1240
  ...s
1231
1241
  };
1232
- const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = L(), c = l.quasis.map(
1233
- (m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
1234
- ).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
1235
- a.length,
1242
+ const { node: l } = r, { createPlaceholder: a, placeholderRegex: g } = S(), c = l.quasis.map(
1243
+ (p, m, { length: f }) => m === f - 1 ? p.value.cooked : p.value.cooked + a(m)
1244
+ ).join(""), d = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
1245
+ d.length,
1236
1246
  -u.length || void 0
1237
- ), b = x(r, n), E = await t(y, {
1247
+ ), E = x(r, n), b = await t(y, {
1238
1248
  ...e,
1239
1249
  parser: "yaml"
1240
- }), i = T(E, p, b);
1250
+ }), i = L(b, g, E);
1241
1251
  if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
1242
1252
  return J([
1243
1253
  "`",
1244
- a,
1245
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [J(i)] : at([J(i)]),
1254
+ d,
1255
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [J(i)] : dt([J(i)]),
1246
1256
  u,
1247
1257
  "`"
1248
1258
  ]);
1249
- const h = a.length ? ct : dt, v = u.length ? ct : dt;
1259
+ const h = d.length ? ct : lt, v = u.length ? ct : lt;
1250
1260
  return J([
1251
1261
  "`",
1252
- e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, J(i)] : at([h, J(i)]),
1262
+ e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, J(i)] : dt([h, J(i)]),
1253
1263
  v,
1254
1264
  "`"
1255
1265
  ]);
1256
- }, xt = "embeddedYaml", uo = ["yaml", "yml"], go = S(xt), po = {
1257
- [go]: {
1266
+ }, St = "embeddedYaml", fo = ["yaml", "yml"], bo = T(St), Eo = {
1267
+ [bo]: {
1258
1268
  category: "Embed",
1259
1269
  type: "string",
1260
1270
  array: !0,
1261
- default: [{ value: [...uo] }],
1262
- description: "Specify embedded YAML language identifiers."
1271
+ default: [{ value: [...fo] }],
1272
+ description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded YAML language."
1263
1273
  }
1264
- }, mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1274
+ }, yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1265
1275
  __proto__: null,
1266
- embedder: lo,
1267
- language: xt,
1268
- options: po
1269
- }, Symbol.toStringTag, { value: "Module" })), Lt = [], Tt = {}, Ot = {}, Mt = {}, ho = /* @__PURE__ */ Object.assign({
1270
- "./css/index.ts": sn,
1271
- "./es/index.ts": pn,
1272
- "./glsl/index.ts": bn,
1273
- "./graphql/index.ts": Dn,
1274
- "./html/index.ts": On,
1275
- "./ini/index.ts": Pn,
1276
- "./json/index.ts": Wn,
1277
- "./latex/index.ts": Hn,
1278
- "./markdown/index.ts": Vn,
1279
- "./noop/index.ts": tr,
1280
- "./php/index.ts": ir,
1281
- "./properties/index.ts": ur,
1282
- "./ruby/index.ts": br,
1283
- "./sh/index.ts": Sr,
1284
- "./sql/index.ts": Ur,
1285
- "./toml/index.ts": Hr,
1286
- "./ts/index.ts": eo,
1287
- "./xml/index.ts": ao,
1288
- "./yaml/index.ts": mo
1276
+ embedder: ho,
1277
+ language: St,
1278
+ options: Eo
1279
+ }, Symbol.toStringTag, { value: "Module" })), Lt = [], kt = {}, At = {}, Ot = {}, _o = /* @__PURE__ */ Object.assign({
1280
+ "./css/index.ts": dn,
1281
+ "./es/index.ts": fn,
1282
+ "./glsl/index.ts": vn,
1283
+ "./graphql/index.ts": xn,
1284
+ "./html/index.ts": Nn,
1285
+ "./ini/index.ts": Bn,
1286
+ "./json/index.ts": Hn,
1287
+ "./latex/index.ts": Vn,
1288
+ "./markdown/index.ts": rr,
1289
+ "./noop/index.ts": ir,
1290
+ "./php/index.ts": ur,
1291
+ "./properties/index.ts": fr,
1292
+ "./ruby/index.ts": Ir,
1293
+ "./sh/index.ts": Ar,
1294
+ "./sql/index.ts": zr,
1295
+ "./toml/index.ts": Vr,
1296
+ "./ts/index.ts": so,
1297
+ "./xml/index.ts": po,
1298
+ "./yaml/index.ts": yo
1289
1299
  });
1290
- Object.values(ho).forEach(({ language: t, parser: n, embedder: r, options: e }) => {
1291
- Zt(Lt, t, oe), n && (Tt[t] = n), r && (Ot[t] = r), Object.assign(Mt, e);
1300
+ Object.values(_o).forEach(({ language: t, parser: n, embedder: r, options: e }) => {
1301
+ nn(Lt, t, se), n && (kt[t] = n), r && (At[t] = r), Object.assign(Ot, e);
1292
1302
  });
1293
- const fo = "noEmbeddedIdentificationByComment", Eo = "noEmbeddedIdentificationByTag", bo = "preserveEmbeddedExteriorWhitespaces", yo = "noEmbeddedMultiLineIndentation", _o = "embeddedOverrides", Ho = {
1294
- ...Mt,
1295
- [fo]: {
1303
+ const vo = "noEmbeddedIdentificationByComment", $o = "noEmbeddedIdentificationByTag", Io = "preserveEmbeddedExteriorWhitespaces", Do = "noEmbeddedMultiLineIndentation", To = "embeddedOverrides", es = {
1304
+ ...Ot,
1305
+ [vo]: {
1296
1306
  category: "Embed",
1297
1307
  type: "string",
1298
1308
  array: !0,
1299
1309
  default: [{ value: [] }],
1300
- description: 'This option turns off "/* identifier */ `...`" comment-based language identification for the specified identifiers.'
1310
+ description: "Turns off `` /* identifier */ `...` `` comment-based embedded language identification for the specified identifiers."
1301
1311
  },
1302
- [Eo]: {
1312
+ [$o]: {
1303
1313
  category: "Embed",
1304
1314
  type: "string",
1305
1315
  array: !0,
1306
1316
  default: [{ value: [] }],
1307
- description: 'This option turns off "identifier`...`" tag-based language identification for the specified identifiers.'
1317
+ description: "Turns off `` identifier`...` `` tag-based embedded language identification for the specified identifiers."
1308
1318
  },
1309
- [bo]: {
1310
- category: "Config",
1319
+ [Io]: {
1320
+ category: "Embed",
1311
1321
  type: "string",
1312
1322
  array: !0,
1313
1323
  default: [{ value: [] }],
1314
- description: "This option preserves leading and trailing whitespaces in the formatting results for the specified identifiers."
1324
+ description: "Preserves leading and trailing whitespaces in the formatting results for the specified identifiers."
1315
1325
  },
1316
- [yo]: {
1326
+ [Do]: {
1317
1327
  category: "Embed",
1318
1328
  type: "string",
1319
1329
  array: !0,
1320
1330
  default: [{ value: [] }],
1321
- description: "This option turns off auto indentation in the formatting results for the specified identifiers when they are formatted to span multi lines."
1331
+ description: "Turns off auto indentation in the formatting results for the specified identifiers when they are formatted to span multi lines."
1322
1332
  },
1323
- [_o]: {
1333
+ [To]: {
1324
1334
  category: "Embed",
1325
1335
  type: "string",
1326
1336
  array: !1,
1327
1337
  default: void 0,
1328
- 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."
1338
+ description: "Option overrides for the specified identifiers. It should either be a stringified JSON or an absolute filepath to the option overrides file."
1329
1339
  }
1330
- }, Jo = {
1340
+ }, ut = {
1331
1341
  // parsers from internal
1332
- ...Rt.parsers,
1333
- ...jt.parsers,
1334
- ...Ft.parsers,
1335
- ...Bt.parsers,
1336
1342
  ...wt.parsers,
1343
+ ...Bt.parsers,
1344
+ ...Ut.parsers,
1345
+ ...Ct.parsers,
1346
+ ...qt.parsers,
1337
1347
  // parsers from this plugin
1338
- ...Tt
1348
+ ...kt
1339
1349
  };
1340
- var vo = {
1350
+ var xo = {
1341
1351
  isEqual: !0,
1342
1352
  isMatchingKey: !0,
1343
1353
  isPromise: !0,
@@ -1346,24 +1356,24 @@ var vo = {
1346
1356
  onCacheChange: !0,
1347
1357
  onCacheHit: !0,
1348
1358
  transformKey: !0
1349
- }, $o = Array.prototype.slice;
1350
- function Q(t) {
1359
+ }, So = Array.prototype.slice;
1360
+ function V(t) {
1351
1361
  var n = t.length;
1352
- return n ? n === 1 ? [t[0]] : n === 2 ? [t[0], t[1]] : n === 3 ? [t[0], t[1], t[2]] : $o.call(t, 0) : [];
1362
+ return n ? n === 1 ? [t[0]] : n === 2 ? [t[0], t[1]] : n === 3 ? [t[0], t[1], t[2]] : So.call(t, 0) : [];
1353
1363
  }
1354
- function Do(t) {
1364
+ function Lo(t) {
1355
1365
  var n = {};
1356
1366
  for (var r in t)
1357
- vo[r] || (n[r] = t[r]);
1367
+ xo[r] || (n[r] = t[r]);
1358
1368
  return n;
1359
1369
  }
1360
- function Io(t) {
1370
+ function ko(t) {
1361
1371
  return typeof t == "function" && t.isMemoized;
1362
1372
  }
1363
- function So(t, n) {
1373
+ function Ao(t, n) {
1364
1374
  return t === n || t !== t && n !== n;
1365
1375
  }
1366
- function lt(t, n) {
1376
+ function gt(t, n) {
1367
1377
  var r = {};
1368
1378
  for (var e in t)
1369
1379
  r[e] = t[e];
@@ -1371,7 +1381,7 @@ function lt(t, n) {
1371
1381
  r[e] = n[e];
1372
1382
  return r;
1373
1383
  }
1374
- var xo = (
1384
+ var Oo = (
1375
1385
  /** @class */
1376
1386
  function() {
1377
1387
  function t(n) {
@@ -1396,9 +1406,9 @@ var xo = (
1396
1406
  */
1397
1407
  get: function() {
1398
1408
  return {
1399
- keys: Q(this.keys),
1409
+ keys: V(this.keys),
1400
1410
  size: this.size,
1401
- values: Q(this.values)
1411
+ values: V(this.values)
1402
1412
  };
1403
1413
  },
1404
1414
  enumerable: !1,
@@ -1410,9 +1420,9 @@ var xo = (
1410
1420
  if (e(s[0], n))
1411
1421
  return 0;
1412
1422
  if (o > 1) {
1413
- for (var d = 1; d < l; d++)
1414
- if (e(s[d], n))
1415
- return d;
1423
+ for (var a = 1; a < l; a++)
1424
+ if (e(s[a], n))
1425
+ return a;
1416
1426
  }
1417
1427
  return -1;
1418
1428
  }, t.prototype._getKeyIndexForMany = function(n) {
@@ -1421,19 +1431,19 @@ var xo = (
1421
1431
  return -1;
1422
1432
  if (o === 1)
1423
1433
  return this._getKeyIndexForSingle(n);
1424
- var s = n.length, l, d;
1434
+ var s = n.length, l, a;
1425
1435
  if (s > 1) {
1426
- for (var p = 0; p < o; p++)
1427
- if (l = e[p], l.length === s) {
1428
- for (d = 0; d < s && r(l[d], n[d]); d++)
1436
+ for (var g = 0; g < o; g++)
1437
+ if (l = e[g], l.length === s) {
1438
+ for (a = 0; a < s && r(l[a], n[a]); a++)
1429
1439
  ;
1430
- if (d === s)
1431
- return p;
1440
+ if (a === s)
1441
+ return g;
1432
1442
  }
1433
1443
  } else
1434
- for (var p = 0; p < o; p++)
1435
- if (l = e[p], l.length === s && r(l[0], n[0]))
1436
- return p;
1444
+ for (var g = 0; g < o; g++)
1445
+ if (l = e[g], l.length === s && r(l[0], n[0]))
1446
+ return g;
1437
1447
  return -1;
1438
1448
  }, t.prototype._getKeyIndexForSingle = function(n) {
1439
1449
  var r = this.keys;
@@ -1451,63 +1461,63 @@ var xo = (
1451
1461
  }
1452
1462
  return s(e[0], n[0]) ? 0 : -1;
1453
1463
  }, t.prototype.orderByLru = function(n, r, e) {
1454
- for (var o = this.keys, s = this.values, l = o.length, d = e; d--; )
1455
- o[d + 1] = o[d], s[d + 1] = s[d];
1464
+ for (var o = this.keys, s = this.values, l = o.length, a = e; a--; )
1465
+ o[a + 1] = o[a], s[a + 1] = s[a];
1456
1466
  o[0] = n, s[0] = r;
1457
- var p = this.options.maxSize;
1458
- l === p && e === l ? (o.pop(), s.pop()) : e >= p && (o.length = s.length = p);
1467
+ var g = this.options.maxSize;
1468
+ l === g && e === l ? (o.pop(), s.pop()) : e >= g && (o.length = s.length = g);
1459
1469
  }, t.prototype.updateAsyncCache = function(n) {
1460
- var r = this, e = this.options, o = e.onCacheChange, s = e.onCacheHit, l = this.keys[0], d = this.values[0];
1461
- this.values[0] = d.then(function(p) {
1462
- return r.shouldUpdateOnHit && s(r, r.options, n), r.shouldUpdateOnChange && o(r, r.options, n), p;
1463
- }, function(p) {
1470
+ var r = this, e = this.options, o = e.onCacheChange, s = e.onCacheHit, l = this.keys[0], a = this.values[0];
1471
+ this.values[0] = a.then(function(g) {
1472
+ return r.shouldUpdateOnHit && s(r, r.options, n), r.shouldUpdateOnChange && o(r, r.options, n), g;
1473
+ }, function(g) {
1464
1474
  var c = r.getKeyIndex(l);
1465
- throw c !== -1 && (r.keys.splice(c, 1), r.values.splice(c, 1)), p;
1475
+ throw c !== -1 && (r.keys.splice(c, 1), r.values.splice(c, 1)), g;
1466
1476
  });
1467
1477
  }, t;
1468
1478
  }()
1469
1479
  );
1470
- function kt(t, n) {
1471
- if (n === void 0 && (n = {}), Io(t))
1472
- return kt(t.fn, lt(t.options, n));
1480
+ function Pt(t, n) {
1481
+ if (n === void 0 && (n = {}), ko(t))
1482
+ return Pt(t.fn, gt(t.options, n));
1473
1483
  if (typeof t != "function")
1474
1484
  throw new TypeError("You must pass a function to `memoize`.");
1475
- var r = n.isEqual, e = r === void 0 ? So : r, o = n.isMatchingKey, s = n.isPromise, l = s === void 0 ? !1 : s, d = n.maxSize, p = d === void 0 ? 1 : d, c = n.onCacheAdd, a = n.onCacheChange, u = n.onCacheHit, y = n.transformKey, b = lt({
1485
+ var r = n.isEqual, e = r === void 0 ? Ao : r, o = n.isMatchingKey, s = n.isPromise, l = s === void 0 ? !1 : s, a = n.maxSize, g = a === void 0 ? 1 : a, c = n.onCacheAdd, d = n.onCacheChange, u = n.onCacheHit, y = n.transformKey, E = gt({
1476
1486
  isEqual: e,
1477
1487
  isMatchingKey: o,
1478
1488
  isPromise: l,
1479
- maxSize: p,
1489
+ maxSize: g,
1480
1490
  onCacheAdd: c,
1481
- onCacheChange: a,
1491
+ onCacheChange: d,
1482
1492
  onCacheHit: u,
1483
1493
  transformKey: y
1484
- }, Do(n)), E = new xo(b), i = E.keys, h = E.values, v = E.canTransformKey, m = E.shouldCloneArguments, g = E.shouldUpdateOnAdd, f = E.shouldUpdateOnChange, $ = E.shouldUpdateOnHit, _ = function() {
1485
- var D = m ? Q(arguments) : arguments;
1486
- v && (D = y(D));
1487
- var O = i.length ? E.getKeyIndex(D) : -1;
1488
- if (O !== -1)
1489
- $ && u(E, b, _), O && (E.orderByLru(i[O], h[O], O), f && a(E, b, _));
1494
+ }, Lo(n)), b = new Oo(E), i = b.keys, h = b.values, v = b.canTransformKey, p = b.shouldCloneArguments, m = b.shouldUpdateOnAdd, f = b.shouldUpdateOnChange, $ = b.shouldUpdateOnHit, _ = function() {
1495
+ var I = p ? V(arguments) : arguments;
1496
+ v && (I = y(I));
1497
+ var k = i.length ? b.getKeyIndex(I) : -1;
1498
+ if (k !== -1)
1499
+ $ && u(b, E, _), k && (b.orderByLru(i[k], h[k], k), f && d(b, E, _));
1490
1500
  else {
1491
- var At = t.apply(this, arguments), Pt = m ? D : Q(arguments);
1492
- E.orderByLru(Pt, At, i.length), l && E.updateAsyncCache(_), g && c(E, b, _), f && a(E, b, _);
1501
+ var Ft = t.apply(this, arguments), jt = p ? I : V(arguments);
1502
+ b.orderByLru(jt, Ft, i.length), l && b.updateAsyncCache(_), m && c(b, E, _), f && d(b, E, _);
1493
1503
  }
1494
1504
  return h[0];
1495
1505
  };
1496
- return _.cache = E, _.fn = t, _.isMemoized = !0, _.options = b, _;
1506
+ return _.cache = b, _.fn = t, _.isMemoized = !0, _.options = E, _;
1497
1507
  }
1498
- async function ut(t) {
1508
+ async function mt(t) {
1499
1509
  try {
1500
- const n = await Ct(t, { encoding: "utf-8" });
1510
+ const n = await Gt(t, { encoding: "utf-8" });
1501
1511
  return JSON.parse(n);
1502
1512
  } catch {
1503
1513
  }
1504
1514
  }
1505
- const Lo = /* @__PURE__ */ new URL(
1515
+ const Po = /* @__PURE__ */ new URL(
1506
1516
  "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);')
1507
1517
  );
1508
- async function To(t) {
1518
+ async function Mo(t) {
1509
1519
  return new Promise((n) => {
1510
- const r = new Kt(Lo, {
1520
+ const r = new Xt(Po, {
1511
1521
  workerData: {
1512
1522
  absolutePath: t
1513
1523
  }
@@ -1519,44 +1529,44 @@ async function To(t) {
1519
1529
  });
1520
1530
  });
1521
1531
  }
1522
- async function Oo(t) {
1532
+ async function No(t) {
1523
1533
  console.error(
1524
1534
  "Ts module type embeddedOverrides has not been implemented yet."
1525
1535
  );
1526
1536
  }
1527
- const Mo = kt(
1537
+ const Ro = Pt(
1528
1538
  async (t, n) => {
1529
- if (Wt(t))
1539
+ if (zt(t))
1530
1540
  return t;
1531
- const r = await Ht(n);
1541
+ const r = await Yt(n);
1532
1542
  let e;
1533
- return typeof r != "string" ? e = process.env.PWD ?? process.cwd() : e = Gt(r), qt(e, t);
1543
+ return typeof r != "string" ? e = process.env.PWD ?? process.cwd() : e = Kt(r), Ht(e, t);
1534
1544
  }
1535
- ), ko = async (t, n) => {
1536
- const r = Mo(
1545
+ ), Fo = async (t, n) => {
1546
+ const r = Ro(
1537
1547
  t,
1538
1548
  n
1539
- ), e = zt(t);
1549
+ ), e = Jt(t);
1540
1550
  if (e === ".json") {
1541
- const o = await r, s = await ut(o);
1551
+ const o = await r, s = await mt(o);
1542
1552
  if (s !== void 0)
1543
1553
  return s;
1544
1554
  console.error(`Failed to parse the json file: ${o}`);
1545
1555
  return;
1546
1556
  } else if (e === ".mjs" || e === ".cjs" || e === ".js") {
1547
- const o = await r, s = await To(o);
1557
+ const o = await r, s = await Mo(o);
1548
1558
  if (s !== void 0)
1549
1559
  return s;
1550
1560
  console.error(`Failed to parse the js module file: ${o}`);
1551
1561
  return;
1552
1562
  } else if (e === ".mts" || e === ".cts" || e === ".ts") {
1553
- const o = await r, s = await Oo();
1563
+ const o = await r, s = await No();
1554
1564
  if (s !== void 0)
1555
1565
  return s;
1556
1566
  console.error(`Failed to parse the ts module file: ${o}`);
1557
1567
  return;
1558
1568
  } else if (e === "") {
1559
- const o = await r, s = await ut(o);
1569
+ const o = await r, s = await mt(o);
1560
1570
  if (s !== void 0)
1561
1571
  return s;
1562
1572
  }
@@ -1565,10 +1575,10 @@ const Mo = kt(
1565
1575
  } catch {
1566
1576
  console.error("Failed to parse embeddedOverrides as a json object");
1567
1577
  }
1568
- }, No = async (t, n, r) => {
1578
+ }, jo = async (t, n, r) => {
1569
1579
  if (t === void 0)
1570
1580
  return;
1571
- const e = await ko(
1581
+ const e = await Fo(
1572
1582
  t,
1573
1583
  r
1574
1584
  );
@@ -1581,91 +1591,146 @@ const Mo = kt(
1581
1591
  console.error("Error parsing embedded override options.");
1582
1592
  }
1583
1593
  };
1584
- function Ao({ node: t, parent: n }, r, e) {
1594
+ function wo({ node: t, parent: n }, r, e) {
1585
1595
  if (r.length === 0 || t.type !== "TemplateLiteral")
1586
1596
  return;
1587
1597
  const o = t.comments ?? n?.comments;
1588
1598
  if (!o)
1589
1599
  return;
1590
1600
  const s = o[o.length - 1];
1591
- if (!(![
1601
+ if (![
1592
1602
  "MultiLine",
1593
1603
  // meriyah
1594
1604
  "Block",
1595
1605
  // typescript, acorn, espree, flow
1596
1606
  "CommentBlock"
1597
1607
  // babel, babel-flow, babel-ts
1598
- ].includes(s.type) || !s.leading)) {
1599
- for (const l of r)
1600
- if (` ${l} ` === s.value && !e.includes(l))
1601
- return l;
1602
- }
1608
+ ].includes(s.type) || !s.leading)
1609
+ return;
1610
+ const l = e.noEmbeddedIdentificationByComment ?? [];
1611
+ for (const a of r)
1612
+ if (!l.includes(a) && ` ${a} ` === s.value)
1613
+ return a;
1603
1614
  }
1604
- function Po({ node: t, parent: n }, r, e) {
1605
- if (r.length !== 0 && !(t.type !== "TemplateLiteral" || n?.type !== "TaggedTemplateExpression" || n.tag.type !== "Identifier")) {
1606
- for (const o of r)
1607
- if (n.tag.name === o && !e.includes(o))
1608
- return o;
1609
- }
1615
+ function Bo({ node: t, parent: n }, r, e) {
1616
+ if (r.length === 0 || t.type !== "TemplateLiteral" || n?.type !== "TaggedTemplateExpression")
1617
+ return;
1618
+ e.parser;
1619
+ const o = e.parser in ut, s = e.noEmbeddedIdentificationByTag ?? [], l = /* @__PURE__ */ new Set([
1620
+ "start",
1621
+ "end",
1622
+ "loc",
1623
+ "range",
1624
+ "filename",
1625
+ "typeAnnotation",
1626
+ "decorators"
1627
+ ]);
1628
+ for (const a of r)
1629
+ if (!s.includes(a))
1630
+ if (Uo(a)) {
1631
+ if (n.tag.type === "Identifier" && n.tag.name === a)
1632
+ return a;
1633
+ } else {
1634
+ if (!o)
1635
+ return;
1636
+ let g;
1637
+ try {
1638
+ const d = ut[e.parser].parse(
1639
+ `${a}\`\``,
1640
+ e
1641
+ );
1642
+ if (d instanceof Promise)
1643
+ throw new TypeError(
1644
+ "Async parse function hasn't been supported yet."
1645
+ );
1646
+ g = d;
1647
+ } catch {
1648
+ continue;
1649
+ }
1650
+ if (g.type === "File" && (g = g.program), !(g.type === "Program" && g.body[0]?.type === "ExpressionStatement"))
1651
+ continue;
1652
+ const c = g.body[0]?.expression;
1653
+ if (c?.type !== "TaggedTemplateExpression")
1654
+ continue;
1655
+ if (n.tag, c.tag, Nt(n.tag, c.tag, l))
1656
+ return a;
1657
+ }
1658
+ }
1659
+ function Uo(t) {
1660
+ return /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(t);
1661
+ }
1662
+ function Mt(t, n, r = /* @__PURE__ */ new Set()) {
1663
+ return Object.is(t, n) ? !0 : Array.isArray(t) ? qo(t, n, r) : typeof t == "object" ? Nt(
1664
+ t,
1665
+ n,
1666
+ r
1667
+ ) : !1;
1668
+ }
1669
+ function qo(t, n, r = /* @__PURE__ */ new Set()) {
1670
+ const e = t.length;
1671
+ if (e != n.length)
1672
+ return !1;
1673
+ for (let o = 0; o < e; o++)
1674
+ if (!Mt(t[o], n[o], r))
1675
+ return !1;
1676
+ return !0;
1610
1677
  }
1611
- const { estree: Nt } = Ut, Ro = function(t, n) {
1678
+ function Nt(t, n, r = /* @__PURE__ */ new Set()) {
1679
+ for (const e of Object.keys(t))
1680
+ if (!r.has(e) && !(Object.prototype.hasOwnProperty.call(n, e) && Mt(t[e], n[e], r)))
1681
+ return !1;
1682
+ return !0;
1683
+ }
1684
+ const { estree: Rt } = Wt, Co = function(t, n) {
1612
1685
  const { node: r } = t;
1613
1686
  if (r.type !== "TemplateLiteral" || r.quasis.some(({ value: { cooked: e } }) => e === null))
1614
1687
  return null;
1615
1688
  for (const e of Lt) {
1616
- const o = n[S(e)];
1689
+ const o = n[T(e)];
1617
1690
  if (!o)
1618
1691
  continue;
1619
- const s = Ao(
1620
- t,
1621
- o,
1622
- n.noEmbeddedIdentificationByComment ?? []
1623
- ) ?? Po(
1624
- t,
1625
- o,
1626
- n.noEmbeddedIdentificationByTag ?? []
1627
- );
1692
+ const s = wo(t, o, n) ?? Bo(t, o, n);
1628
1693
  if (s === void 0)
1629
1694
  continue;
1630
- const l = Ot[e];
1695
+ const l = At[e];
1631
1696
  if (!l)
1632
1697
  return null;
1633
- const d = t.node;
1634
- return d.quasis.length === 1 && d.quasis[0].value.raw.trim() === "" ? "``" : async (p, c, a, u) => {
1635
- const y = await No(
1698
+ const a = t.node;
1699
+ return a.quasis.length === 1 && a.quasis[0]?.value.raw.trim() === "" ? "``" : async (g, c, d, u) => {
1700
+ const y = await jo(
1636
1701
  u.embeddedOverrides,
1637
1702
  s,
1638
1703
  u.filepath
1639
1704
  );
1640
1705
  try {
1641
- const b = await l(p, c, a, u, {
1706
+ const E = await l(g, c, d, u, {
1642
1707
  identifier: s,
1643
1708
  identifiers: o,
1644
1709
  embeddedOverrideOptions: y
1645
1710
  });
1646
- return I.label(
1647
- { embed: !0, ...b.label },
1648
- b
1711
+ return D.label(
1712
+ { embed: !0, ...E.label },
1713
+ E
1649
1714
  );
1650
- } catch (b) {
1651
- throw console.error(b), b;
1715
+ } catch (E) {
1716
+ throw console.error(E), E;
1652
1717
  }
1653
1718
  };
1654
1719
  }
1655
- return Nt.embed?.(t, n) ?? null;
1656
- }, Xo = {
1720
+ return Rt.embed?.(t, n) ?? null;
1721
+ }, ts = {
1657
1722
  estree: {
1658
- ...Nt,
1659
- embed: Ro
1723
+ ...Rt,
1724
+ embed: Co
1660
1725
  }
1661
1726
  };
1662
1727
  export {
1663
- Ot as embeddedEmbedders,
1728
+ At as embeddedEmbedders,
1664
1729
  Lt as embeddedLanguages,
1665
- Mt as embeddedOptions,
1666
- Tt as embeddedParsers,
1667
- S as makeIdentifiersOptionName,
1668
- Ho as options,
1669
- Jo as parsers,
1670
- Xo as printers
1730
+ Ot as embeddedOptions,
1731
+ kt as embeddedParsers,
1732
+ T as makeIdentifiersOptionName,
1733
+ es as options,
1734
+ ut as parsers,
1735
+ ts as printers
1671
1736
  };